diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b5f44ee --- /dev/null +++ b/.gitignore @@ -0,0 +1,130 @@ +# Created by .ignore support plugin (hsz.mobi) +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.notes +.idea +.Python +env/ +venv-dip/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# dotenv +.env +.env* + +# virtualenv +.venv +venv/ +ENV/ + +# Spyder project settings +.spyderproject + +# Rope project settings +.ropeproject + +# Empty directories +diplomacy/games + +# Pickle +*.p +*.pkl + +# Outputs +out* +zzz* + +# Mac +*.DS_Store + +# Emacs +*~ +*# + +# File backups +*.bak + +# Protocol buffers +*.pb + +# Tests +.pytest_cache +data +*tests.xml + +# Tensorboard +events.out.* diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile new file mode 100644 index 0000000..90b4b99 --- /dev/null +++ b/.jenkins/Jenkinsfile @@ -0,0 +1,262 @@ +// Pipeline +import groovy.json.JsonSlurper +import hudson.Util +import java.util.concurrent.TimeUnit + +// Constants +String PENDING_MSG = "Jenkins started the build." +String SUCCESS_MSG = "The Jenkins build completed successfully." +String FAILURE_MSG = "The Jenkins build failed." + +// Parsing data +def data = new JsonSlurper().parseText(env.payload) + +// Detecting Git URL +String USERNAME = data.repository.owner.login +String REPOSITORY = data.repository.name +String GITHUB_URL = data.repository.ssh_url + +// Determining current pipeline +int exit_status = 0 +String BUILD_TYPE = "" +String COMMIT_HASH = "" +String SHORT_HASH = "" +String PR_BRANCH = "" +String COMMIT_BRANCH = "" +String COMMIT_URL = "" +String BASE_HASH = "0000000" +String SENDER = "" +int PR_NUMBER = 0 +String CHECKOUT_BRANCH = "" +String CHECKOUT_REF = "" +String ROOT_CONTEXT = "jenkins/diplomacy.ai" +String CONTEXT = "" +String MESSAGE = "" + +// ---- Push ---- +if (data.ref != null && data.after.substring(0, 7) != "0000000") { + BUILD_TYPE = "push" + COMMIT_HASH = data.after + SHORT_HASH = COMMIT_HASH.substring(0, 7) + COMMIT_BRANCH = data.ref.replaceAll("refs/heads/", "") + COMMIT_URL = data.compare + SENDER = data.pusher.name + CHECKOUT_BRANCH = COMMIT_HASH + CHECKOUT_REF = "" + CONTEXT = ROOT_CONTEXT + "/push" + MESSAGE = data.head_commit.message + currentBuild.description = "${SHORT_HASH} - ${COMMIT_BRANCH} - ${MESSAGE}" + +// ---- Pull Request ---- +} else if (data.pull_request != null \ + && data.number > 0 \ + && (data.action == "opened" || data.action == "reopened" || data.action == "synchronize")) { + BUILD_TYPE = "pr" + COMMIT_HASH = data.pull_request.head.sha + SHORT_HASH = COMMIT_HASH.substring(0, 7) + PR_BRANCH = data.pull_request.head.label + COMMIT_BRANCH = data.pull_request.base.ref + COMMIT_URL = data.pull_request.html_url + BASE_HASH = data.pull_request.base.sha + SENDER = data.pull_request.user.login + PR_NUMBER = data.pull_request.number + CHECKOUT_BRANCH = COMMIT_HASH + CHECKOUT_REF = "+refs/pull/*:refs/remotes/origin/pr/* +refs/heads/*:refs/remotes/origin/*" + CONTEXT = ROOT_CONTEXT + "/pr" + MESSAGE = data.pull_request.title + currentBuild.description = "${SHORT_HASH} - PR #${PR_NUMBER} - ${MESSAGE}" + +// ---- No need to build ---- +} else { + currentBuild.result = "SUCCESS" + currentBuild.description = "---" + return +} + + +// ====== STAGES ======= +data = null +String STRIPPED_BRANCH = COMMIT_BRANCH.replaceAll("/", "_") + +// ------------------------------- +// 1. Setting Status +try { + githubNotify account: USERNAME, context: ROOT_CONTEXT, credentialsId: 'ppaquette-jenkins-api-as-password', description: PENDING_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'PENDING', targetUrl: '' +} catch(err) { + echo "Error setting status on GitHub commit: ${err}" + exit_status = 1 + currentBuild.result = "FAILURE" +} + +// ------------------------------- +// 2. Running tests +parallel_test = [:] + +// Running Python 3.7 everytime, except for "web", "webdip", "build", "build_cpu" branch +if (BUILD_TYPE == 'push' && (COMMIT_BRANCH == 'web' || COMMIT_BRANCH == 'webdip' || COMMIT_BRANCH == 'build' || COMMIT_BRANCH == 'build_cpu')) { + // Skipping +} else { + parallel_test['python_3.7'] = { + node('ubuntu-1604-large') { + stage('Python 3.7') { + try { + timeout(time: 20, activity: true, unit: 'MINUTES') { + githubNotify account: USERNAME, context: CONTEXT + "/python3.7", credentialsId: 'ppaquette-jenkins-api-as-password', description: PENDING_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'PENDING', targetUrl: '' + withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-ssh-key', keyFileVariable: 'SSH_KEY_FILE', passphraseVariable: '', usernameVariable: '')]) { + withCredentials([string(credentialsId: 'GITHUB_TOKEN', variable: 'GITHUB_TOKEN')]) { + checkout([$class: 'GitSCM', branches: [[name: CHECKOUT_BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', refspec: CHECKOUT_REF, credentialsId: 'jenkins-ssh-key', url: GITHUB_URL]]]) + sh ".jenkins/merge_pr.sh $PR_NUMBER $COMMIT_HASH $BASE_HASH $SSH_KEY_FILE \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh \ + && chmod +x ./miniconda.sh \ + && rm -Rf $HOME/miniconda \ + && ./miniconda.sh -b -p $HOME/miniconda \ + && export PATH=$HOME/miniconda/bin:$PATH \ + && conda create -y -q -n py37 python=3.7 \ + && export PATH=$HOME/miniconda/envs/py37/bin:$PATH \ + && mkdir -p $HOME/.cache/diplomacy \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/cache-jenkins/convoy_paths_cache.pkl -O $HOME/.cache/diplomacy/convoy_paths_cache.pkl \ + && .jenkins/get_cache.sh $PR_NUMBER $STRIPPED_BRANCH \ + && .jenkins/expand_vars.sh \ + && pip install -r requirements.txt \ + && pip install -r requirements_dev.txt \ + && git checkout -- requirements.txt requirements_dev.txt \ + && touch run_install_nvm.sh \ + && chmod +x run_install_nvm.sh \ + && ./run_install_nvm.sh \ + && echo '--------------------------------------------------' \ + && pip --version \ + && python --version \ + && which python \ + && git rev-parse HEAD \ + && git log -n 1 \ + && ./run_tests.sh \ + && .jenkins/set_cache.sh $PR_NUMBER $STRIPPED_BRANCH" + } + } + githubNotify account: USERNAME, context: CONTEXT + "/python3.7", credentialsId: 'ppaquette-jenkins-api-as-password', description: SUCCESS_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'SUCCESS', targetUrl: '' + } + } catch(err) { + echo "Error encountered in parallel (Python 3.7): ${err}" + exit_status = 1 + currentBuild.result = "FAILURE" + githubNotify account: USERNAME, context: CONTEXT + "/python3.7", credentialsId: 'ppaquette-jenkins-api-as-password', description: FAILURE_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'FAILURE', targetUrl: '' + } + } + } + } +} + +// Only running 3.6 for Pull Requests (and for "jenkins" branch) + +if (BUILD_TYPE == 'pr' || (BUILD_TYPE == 'push' && COMMIT_BRANCH == 'jenkins')) { + parallel_test['python_3.6'] = { + node('ubuntu-1604-large') { + stage('Python 3.6') { + try { + timeout(time: 20, activity: true, unit: 'MINUTES') { + githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: PENDING_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'PENDING', targetUrl: '' + withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-ssh-key', keyFileVariable: 'SSH_KEY_FILE', passphraseVariable: '', usernameVariable: '')]) { + withCredentials([string(credentialsId: 'GITHUB_TOKEN', variable: 'GITHUB_TOKEN')]) { + checkout([$class: 'GitSCM', branches: [[name: CHECKOUT_BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', refspec: CHECKOUT_REF, credentialsId: 'jenkins-ssh-key', url: GITHUB_URL]]]) + sh ".jenkins/merge_pr.sh $PR_NUMBER $COMMIT_HASH $BASE_HASH $SSH_KEY_FILE \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh \ + && chmod +x ./miniconda.sh \ + && rm -Rf $HOME/miniconda \ + && ./miniconda.sh -b -p $HOME/miniconda \ + && export PATH=$HOME/miniconda/bin:$PATH \ + && conda create -y -q -n py36 python=3.6 \ + && export PATH=$HOME/miniconda/envs/py36/bin:$PATH \ + && mkdir -p $HOME/.cache/diplomacy \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/cache-jenkins/convoy_paths_cache.pkl -O $HOME/.cache/diplomacy/convoy_paths_cache.pkl \ + && .jenkins/get_cache.sh $PR_NUMBER $STRIPPED_BRANCH \ + && .jenkins/expand_vars.sh \ + && pip install -r requirements.txt \ + && pip install -r requirements_dev.txt \ + && git checkout -- requirements.txt requirements_dev.txt \ + && touch run_install_nvm.sh \ + && chmod +x run_install_nvm.sh \ + && ./run_install_nvm.sh \ + && echo '--------------------------------------------------' \ + && pip --version \ + && python --version \ + && which python \ + && git rev-parse HEAD \ + && git log -n 1 \ + && ./run_tests.sh \ + && .jenkins/set_cache.sh $PR_NUMBER $STRIPPED_BRANCH" + } + } + githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: SUCCESS_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'SUCCESS', targetUrl: '' + } + } catch(err) { + echo "Error encountered in parallel (Python 3.6): ${err}" + exit_status = 1 + currentBuild.result = "FAILURE" + githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: FAILURE_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'FAILURE', targetUrl: '' + } + } + } + } +} + +parallel parallel_test + +// ------------------------------- +// 3. Deploying +if (exit_status == 0 \ + && BUILD_TYPE == 'push' \ + && (COMMIT_BRANCH == 'master' || COMMIT_BRANCH == 'dev' || COMMIT_BRANCH == 'build' || COMMIT_BRANCH == 'build_cpu' || COMMIT_BRANCH == 'web' || COMMIT_BRANCH == 'webdip')) { + + node('ubuntu-1604-deploy') { + stage('Deploy') { + try { + timeout(time: 30, activity: true, unit: 'MINUTES') { + githubNotify account: USERNAME, context: ROOT_CONTEXT + "/deploy", credentialsId: 'ppaquette-jenkins-api-as-password', description: PENDING_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'PENDING', targetUrl: '' + withCredentials([string(credentialsId: 'GITHUB_TOKEN', variable: 'GITHUB_TOKEN')]) { + checkout([$class: 'GitSCM', branches: [[name: CHECKOUT_BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', refspec: CHECKOUT_REF, credentialsId: 'jenkins-ssh-key', url: GITHUB_URL]]]) + sh "wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh \ + && chmod +x ./miniconda.sh \ + && rm -Rf $HOME/miniconda \ + && ./miniconda.sh -b -p $HOME/miniconda \ + && export PATH=$HOME/miniconda/bin:$PATH \ + && conda create -y -q -n py37 python=3.7 \ + && export PATH=$HOME/miniconda/envs/py37/bin:$PATH \ + && mkdir -p $HOME/.cache/diplomacy \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/cache-jenkins/convoy_paths_cache.pkl -O $HOME/.cache/diplomacy/convoy_paths_cache.pkl \ + && .jenkins/get_cache.sh $PR_NUMBER $STRIPPED_BRANCH \ + && .jenkins/expand_vars.sh \ + && pip install -r requirements.txt \ + && pip install -r requirements_dev.txt \ + && git checkout -- requirements.txt requirements_dev.txt \ + && touch run_install_nvm.sh \ + && chmod +x run_install_nvm.sh \ + && ./run_install_nvm.sh \ + && echo '--------------------------------------------------' \ + && pip --version \ + && python --version \ + && which python \ + && git rev-parse HEAD \ + && git log -n 1 \ + && ./run_deploy.sh $USERNAME/$REPOSITORY $PR_NUMBER $COMMIT_BRANCH $COMMIT_HASH $GITHUB_TOKEN" + } + githubNotify account: USERNAME, context: ROOT_CONTEXT + "/deploy", credentialsId: 'ppaquette-jenkins-api-as-password', description: SUCCESS_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'SUCCESS', targetUrl: '' + } + } catch(err) { + echo "Error encountered in deployment: ${err}" + exit_status = 1 + currentBuild.result = "FAILURE" + githubNotify account: USERNAME, context: ROOT_CONTEXT + "/deploy", credentialsId: 'ppaquette-jenkins-api-as-password', description: FAILURE_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'FAILURE', targetUrl: '' + } + } + } +} + +// ------------------------------- +// 4. Updating git status +if (exit_status == 1) { + currentBuild.result = "FAILURE" + githubNotify account: USERNAME, context: ROOT_CONTEXT, credentialsId: 'ppaquette-jenkins-api-as-password', description: FAILURE_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'FAILURE', targetUrl: '' +} else { + currentBuild.result = "SUCCESS" + githubNotify account: USERNAME, context: ROOT_CONTEXT, credentialsId: 'ppaquette-jenkins-api-as-password', description: SUCCESS_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'SUCCESS', targetUrl: '' +} diff --git a/.jenkins/expand_vars.sh b/.jenkins/expand_vars.sh new file mode 100755 index 0000000..0138a01 --- /dev/null +++ b/.jenkins/expand_vars.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Expand environment variables in requirements.txt +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR/.. +sed -i 's@git+ssh://git@git+https://'"$GITHUB_TOKEN"':x-oauth-basic@' requirements.txt + +# Uninstall diplomacy from cache +pip uninstall -qy diplomacy +exit 0 diff --git a/.jenkins/get_cache.sh b/.jenkins/get_cache.sh new file mode 100755 index 0000000..0cbb0a9 --- /dev/null +++ b/.jenkins/get_cache.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Validating number of arguments +if [ "$#" -ne 2 ]; then + echo "Expected 2 arguments" + echo "Syntax: ./get_cache.sh " + echo "Use PR_NUMBER=0 if not a PR" + exit 1 +fi + +RELEASE=$(lsb_release -c -s) +PYTHON_VERSION=$(python -c "import sys; print('py%d%d' % (sys.version_info.major, sys.version_info.minor))") + +# Trying to download PR cache +if [ "$1" != "0" ]; then + CACHE_FILE="cache-pr_$1-$PYTHON_VERSION-$RELEASE.zip" + CACHE_PATH="gs://ppaquette-diplomacy/cache-jenkins/$CACHE_FILE" + gsutil -q stat "$CACHE_PATH" + RET_VALUE=$? + + if [ $RET_VALUE == 0 ]; then + echo "Downloading cache from $CACHE_PATH" + gsutil cp $CACHE_PATH . + unzip -qo $CACHE_FILE -d / + exit 0 + else + echo "No cache found at $CACHE_PATH" + fi +fi + +# Trying to download branch cache +CACHE_FILE="cache-$2-$PYTHON_VERSION-$RELEASE.zip" +CACHE_PATH="gs://ppaquette-diplomacy/cache-jenkins/$CACHE_FILE" +gsutil -q stat "$CACHE_PATH" +RET_VALUE=$? + +if [ $RET_VALUE == 0 ]; then + echo "Downloading cache from $CACHE_PATH" + gsutil cp $CACHE_PATH . + unzip -qo $CACHE_FILE -d / + exit 0 +else + echo "No cache found at $CACHE_PATH" +fi diff --git a/.jenkins/jenkins-agent.json b/.jenkins/jenkins-agent.json new file mode 100644 index 0000000..a554e4b --- /dev/null +++ b/.jenkins/jenkins-agent.json @@ -0,0 +1,25 @@ +{ + "builders": [ + { + "type": "googlecompute", + "project_id": "ppaquette-diplomacy", + "source_image_family": "ubuntu-1604-lts", + "source_image_project_id": "ubuntu-os-cloud", + "zone": "northamerica-northeast1-a", + "disk_size": "10", + "image_name": "jenkins-slave-{{timestamp}}", + "image_family": "jenkins-slave", + "ssh_username": "ubuntu" + } + ], + "provisioners": [ + { + "type": "shell", + "inline": ["sudo apt-get update -y", + "sudo apt-get upgrade -y", + "sudo apt-get install -y default-jdk git wget build-essential zip bzip2", + "sudo apt-get purge -y unattended-upgrades", + "sudo sed -i 's/1/0/g' /etc/apt/apt.conf.d/10periodic"] + } + ] +} diff --git a/.jenkins/merge_pr.sh b/.jenkins/merge_pr.sh new file mode 100755 index 0000000..4965151 --- /dev/null +++ b/.jenkins/merge_pr.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Validating number of arguments +if [ "$#" -ne 4 ]; then + echo "Expected 4 arguments" + echo "Syntax: ./merge_pr.sh " + echo "Use PR_NUMBER=0 if not a PR" + exit 1 +fi + +# Fetching merged head +if [ "$1" != "0" ]; then + PR_NUMBER=$1 + HASH_PR_HEAD=$2 + HASH_BASE_HEAD=$3 + SSH_KEY_PATH=$4 + + # Copying SSH key + mkdir -p $HOME/.ssh + sudo cp $SSH_KEY_PATH $HOME/.ssh/id_rsa + sudo chown $USER:$USER $HOME/.ssh/id_rsa + sudo chmod 400 $HOME/.ssh/id_rsa + + # Setting identity + git config --global user.email "jenkins@diplomacy.ai" + git config --global user.name "Jenkins (diplomacy.ai)" + + # Displaying hashes + echo "PR Head: $HASH_PR_HEAD" + echo "Base Head: $HASH_BASE_HEAD" + echo "PR #${PR_NUMBER} - Merging ${HASH_PR_HEAD::7} into ${HASH_BASE_HEAD::7}" + + # Fetching and merging + git fetch origin +refs/pull/*:refs/remotes/origin/pr/* +refs/heads/*:refs/remotes/origin/* + git checkout -qf $HASH_BASE_HEAD + git merge --no-ff $HASH_PR_HEAD -m "PR #${PR_NUMBER} - Merge ${HASH_PR_HEAD::7} into ${HASH_BASE_HEAD::7}" +fi diff --git a/.jenkins/set_cache.sh b/.jenkins/set_cache.sh new file mode 100755 index 0000000..cfb861e --- /dev/null +++ b/.jenkins/set_cache.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Validating number of arguments +if [ "$#" -ne 2 ]; then + echo "Expected 2 arguments" + echo "Syntax: ./set_cache.sh " + echo "Use PR_NUMBER=0 if not a PR" + exit 1 +fi + +RELEASE=$(lsb_release -c -s) +PYTHON_VERSION=$(python -c "import sys; print('py%d%d' % (sys.version_info.major, sys.version_info.minor))") + +# Trying to set cache +if [ "$1" != "0" ]; then + CACHE_FILE="cache-pr_$1-$PYTHON_VERSION-$RELEASE.zip" +else + CACHE_FILE="cache-$2-$PYTHON_VERSION-$RELEASE.zip" +fi + +CACHE_PATH="gs://ppaquette-diplomacy/cache-jenkins/$CACHE_FILE" +zip -qr $CACHE_FILE $HOME/.cache/pip/ +echo "Uploading cache to $CACHE_PATH" +gsutil cp ./$CACHE_FILE $CACHE_PATH +exit 0 diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..583783b --- /dev/null +++ b/.pylintrc @@ -0,0 +1,425 @@ +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist=numpy + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. +jobs=8 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=locally-disabled,suppressed-message,useless-suppression,not-context-manager + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[BASIC] + +# Naming hint for argument names +argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct argument names +argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for attribute names +attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct attribute names +attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class names +class-name-hint=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression matching correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming hint for function names +function-name-hint=(([a-z][a-z0-9_]{2,35})|(_[a-z0-9_]*))$ + +# Regular expression matching correct function names +function-rgx=(([a-z][a-z0-9_]{2,35})|(_[a-z0-9_]*))$ + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for method names +method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct method names +method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^__ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming hint for variable names +variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct variable names +variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,numpy,any + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules=numpy,numpy.random,tensorflow,ujson,h5py._hl.*,tensorflow.tools.api.generator.api.contrib,diplomacy_research.proto.diplomacy_proto.*,spacy,spacy.tokenizer + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=120 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=optparse + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=8 + +# Maximum number of attributes for a class (see R0902). +max-attributes=25 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=30 + +# Maximum number of locals for function / method body +max-locals=100 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=100 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=100 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=1 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2e82d63 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Philip Paquette + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5052d97 --- /dev/null +++ b/README.md @@ -0,0 +1,159 @@ +# Supervised and RL Models for No Press Diplomacy + +This repository contains the source code used to develop a supervised and RL agent that can play the No Press version of Diplomacy. + +

+ Diplomacy Map Overview +

+ +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +**Restrictions: The trained weights provided with this repository are for research purposes only and cannot be used to power any bots on any website without my prior written consent, which may be withheld without reasons.** + +**The data provider also prevents using its data to train any bots accessible on any website.** + +**You can play against the trained model by playing against "KestasBot" on webdiplomacy.net** + +## Dataset + +The model was trained by using a dataset of 156,468 games (diplomacy-v1-27k-msgs.zip), which consists of: + +- 16,633 games on non-standard maps (e.g. modern and ancmed) (other_maps.jsonl) +- 33,279 no-press games on the standard map (standard_no_press.jsonl) +- 50 press games on the standard map with messages (standard_press_with_msgs.jsonl) +- 106,456 press games on the standard map without messages (standard_press_without_msgs.jsonl) +- 50 public press games on the standard map with messages (standard_public_press.jsonl) + +A dataset of 156,458 games with 13,469,536 messages is also being prepared, but it is not yet available. + +Access to the dataset used to train the model can be requested by sending an email to webdipmod@gmail.com. + + +## Getting Started + +### Installation + +The repository can be installed in a conda environment with: + +```python3 +conda create -n diplomacy +conda activate diplomacy +pip install -r requirements.txt +pip install -r requirements_dev.txt +``` + +This package depends on Redis and singularity 3+. Singularity can be installed with: + +```bash +# Installing Singularity v3.2.0 +export VERSION=v3.2.0 +sudo apt-get update -y +sudo apt-get install -y build-essential libssl-dev uuid-dev libgpgme11-dev libseccomp-dev pkg-config squashfs-tools + +# Installing GO 1.12.5 +export GO_VERSION=1.12.5 OS=linux ARCH=amd64 +wget -nv https://dl.google.com/go/go$GO_VERSION.$OS-$ARCH.tar.gz +sudo tar -C /usr/local -xzf go$GO_VERSION.$OS-$ARCH.tar.gz +rm -f go$GO_VERSION.$OS-$ARCH.tar.gz +export GOPATH=$HOME/.go +export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin +mkdir -p $GOPATH +go get github.com/golang/dep/cmd/dep + +# Building from source +mkdir -p $GOPATH/src/github.com/sylabs +cd $GOPATH/src/github.com/sylabs +git clone https://github.com/sylabs/singularity.git +cd singularity +git checkout $VERSION +./mconfig -p /usr/local +cd ./builddir +make +sudo make install +``` + +The package is compatible with Python 3.5, 3.6, and 3.7. + +### Training models + +To train a model: + +```bash +$ export WORKING_DIR=/path/to/some/directory +$ cp diplomacy-v1-27k-msgs.zip $WORKING_DIR +$ conda activate diplomacy +$ python diplomacy_research/scripts/build_dataset.py +$ python diplomacy_research/models/policy/order_based/train.py --model_id 12 +``` + +### Playing against the SL and RL agents + +It is possible to play against the published results by using the `NeurIPS2019SLPlayer` and `NeurIPS2019RLPlayer` players in `diplomacy_research.players.benchmark_player`. + +These players will automatically download a singularity container with the trained weights, and then launch a TF serving server to handle the requests. + +A simple example on how to play a 7 bots game is: + +```python3 +from tornado import gen +import ujson as json +from diplomacy import Game +from diplomacy.utils.export import to_saved_game_format +from diplomacy_research.players.benchmark_player import NeurIPS2019SLPlayer +from diplomacy_research.utils.cluster import start_io_loop, stop_io_loop + +@gen.coroutine +def main(): + """ Plays a local game with 7 bots """ + player = NeurIPS2019SLPlayer() + game = Game() + + # Playing game + while not game.is_game_done: + orders = yield {power_name: player.get_orders(game, power_name) for power_name in game.powers} + for power_name, power_orders in orders.items(): + game.set_orders(power_name, power_orders) + game.process() + + # Saving to disk + with open('game.json', 'w') as file: + file.write(json.dumps(to_saved_game_format(game))) + stop_io_loop() + +if __name__ == '__main__': + start_io_loop(main) +``` + +### Playing against a model + +It is also possible for humans to play against bots using the web interface. The player can be changed in `diplomacy_research.scripts.launch_bot` + +```bash +# In a terminal window or tab - Launch React server (from diplomacy/diplomacy) +npm start + +# In another terminal window or tab - Launch diplomacy server +python -m diplomacy.server.run + +# In a third terminal window or tab - Launch the bot script +python diplomacy_research/scripts/launch_bot.py +``` + +### Trained weights and experiment logs + +To facilitate reproducibility, the experiments can be downloaded using the following links. These include hyperparameters, tensorboard graphs, output logs, and weights for each epoch. + +- Order based LSTM model (order-based v12 - Accuracy of 61.3% - **DipNet SL**) [Download - 5.4GB](https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/experiments/order-based-lstm.zip) +- Order based Transformer model (order-based v15 - Accuracy of 60.7%) [Download - 8.2GB](https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/experiments/order-based-trsf.zip) +- Token based LSTM model (token-based v10 - Accuracy of 60.3%) [Download - 6.0GB](https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/experiments/token-based-lstm.zip) +- Token based Transformer model (token-based v11 - Accuracy of 58.9%) [Download - 3.5GB](https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/experiments/token-based-trsf.zip) +- RL Model (Bootstrapped from order-based v12 and value v1 - **DipNet RL**) [Download - 11.1GB](https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/experiments/rl-model.zip) + +### Games against Albert (DAIDE) + +The 1v6 and 6v1 games played between DipNet SL and Albert (DAIDE) can be downloaded below: + +- List of games with power assignments [Download - 53KB](https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/experiments/daide_albert_results.xlsx) +- Visualisation of each game (svg and json) [Download - 2.3GB](https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/experiments/daide_albert_games.zip) diff --git a/diplomacy_research/__init__.py b/diplomacy_research/__init__.py new file mode 100644 index 0000000..133d363 --- /dev/null +++ b/diplomacy_research/__init__.py @@ -0,0 +1,39 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Diplomacy Research """ +# Setting up root logger +import os +import logging +import sys + +# Adding path to proto/ dir +sys.path.append(os.path.join(os.path.dirname(__file__), 'proto')) + +LOGGING_LEVEL = {'CRITICAL': logging.CRITICAL, + 'ERROR': logging.ERROR, + 'WARNING': logging.WARNING, + 'INFO': logging.INFO, + 'DEBUG': logging.DEBUG}.get(os.environ.get('DIPLOMACY_LOGGING', 'INFO'), logging.INFO) + +# Defining root logger +ROOT_LOGGER = logging.getLogger('diplomacy_research') +ROOT_LOGGER.setLevel(LOGGING_LEVEL) +ROOT_LOGGER.propagate = False + +# Adding output to stdout by default +STREAM_HANDLER = logging.StreamHandler(sys.stdout) +STREAM_HANDLER.setLevel(logging.DEBUG) +FORMATTER = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') +STREAM_HANDLER.setFormatter(FORMATTER) +ROOT_LOGGER.addHandler(STREAM_HANDLER) diff --git a/diplomacy_research/containers/albert-ai/Singularity b/diplomacy_research/containers/albert-ai/Singularity new file mode 100644 index 0000000..19dde43 --- /dev/null +++ b/diplomacy_research/containers/albert-ai/Singularity @@ -0,0 +1,81 @@ +Bootstrap: docker +From: ubuntu:18.04 + +%runscript +export BOT_NAME="$1" +export BOT_HOST="$2" +export BOT_PORT="$3" + +echo "----------------------------" +echo "Trying to launch a $BOT_NAME bot that will connect to port $BOT_PORT" +echo "----------------------------" + +# Detecting display +export DISPLAY=:99 +if xhost >& /dev/null ; then + echo "... Successfully detected a display" +else + echo "... Launching display :99" + Xvfb :99 -screen 0 1024x768x16 & +fi + +# Finding path +case "$BOT_NAME" in + albert) + export BOT_PATH="/data/albert/Albert.exe" + ;; + + dumbbot) + export BOT_PATH="/data/dumbbot/DumbBot.exe" + ;; + + *) + echo $"Usage: $0 {albert|dumbbot} {hostname} {port_number}" + exit 1 +esac + +# Launching and sleeping forever +echo "Launching bot..." +wine $BOT_PATH -i$BOT_HOST -p$BOT_PORT -h + +%environment +export LANG=en_CA.UTF-8 + +%labels +AUTHOR pcpaquette@gmail.com + +%post + +# Installing +apt-get -y update +apt-get install -y software-properties-common wget unzip apt-transport-https +echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections +dpkg --add-architecture i386 +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 76F1A20FF987672F +apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ +apt-get update -y +apt-get install -y --allow-unauthenticated winehq-stable xvfb x11-xserver-utils + +# Installing Albert +mkdir -p /data/albert +cd /data/albert +wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/bots/albert.zip +unzip albert.zip +rm albert.zip + +# Install Dumbbot +mkdir -p /data/dumbbot +cd /data/dumbbot +wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/bots/dumbbot.zip +unzip dumbbot.zip +rm dumbbot.zip + +# Redirecting sh to bash +mv /bin/sh /bin/sh.old +ln -s /bin/bash /bin/sh + +# Cleaning up +chmod -R 777 /data +apt-get clean +apt-get autoclean +rm -rf /var/lib/apt/lists/* diff --git a/diplomacy_research/containers/deploy-web/Dockerfile b/diplomacy_research/containers/deploy-web/Dockerfile new file mode 100644 index 0000000..e1c325f --- /dev/null +++ b/diplomacy_research/containers/deploy-web/Dockerfile @@ -0,0 +1,107 @@ +FROM pcpaquette/tensorflow-serving:20190226 + +# To build and push: +# sudo -s +# apt-get update -y +# apt-get install -y docker.io +# docker build -t gcr.io/ppaquette-diplomacy/web-deploy:7473ed4 --build-arg COMMIT_ID=7473ed4798a65c957b8b1a5eadbd876a307e00cf . +# gcloud auth configure-docker +# gcloud docker -- push gcr.io/ppaquette-diplomacy/web-deploy:7473ed4 + +ENV PYTHONIOENCODING=utf-8 +ENV LANG=en_CA.UTF-8 +ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp +ENV PYTHONUNBUFFERED=1 +ENV WORKING_DIR=/work_dir + +ARG GITHUB_TOKEN +ARG REPO +ARG COMMIT_ID +USER root +RUN echo "------------------------------------------------------" && \ + echo "Installing dependencies (psmisc)" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-get install -y psmisc software-properties-common wget curl && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing Nginx" && \ + echo "------------------------------------------------------" && \ + add-apt-repository -y ppa:nginx/stable && \ + apt-get update && \ + apt-get install -y nginx && \ + echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \ + chown -R www-data:www-data /var/lib/nginx && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -Rf /tmp/pip_build_root && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "------------------------------------------------------" && \ + echo "Installing Diplomacy" && \ + echo "------------------------------------------------------" && \ + apt-get update -y && \ + mkdir -p /work_dir && \ + mkdir -p /data && \ + mkdir -p /data/certs && \ + rm -Rf /data/diplomacy && \ + rm -Rf /data/env3.7 && \ + cd /data && \ + git clone "https://$GITHUB_TOKEN:x-oauth-basic@github.com/$REPO.git" diplomacy && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh && \ + bash ./miniconda.sh -b -p /data/env3.7 && \ + export PATH="/data/env3.7/bin:$PATH" && \ + pip install --upgrade pip && \ + cd diplomacy && \ + git checkout $COMMIT_ID && \ + .jenkins/expand_vars.sh && \ + pip install -r requirements.txt && \ + pip install -r requirements_dev.txt && \ + git checkout -- requirements.txt requirements_dev.txt && \ + ./run_install_nvm.sh && \ + cd /data && \ + \ + chmod -R 777 /data && \ + chmod -R 400 /data/certs && \ + chmod -R 777 /work_dir && \ + \ + echo "------------------------------------------------------" && \ + echo "Building launch script" && \ + echo "------------------------------------------------------" && \ + echo '#!/bin/bash' > /data/entry.sh && \ + echo 'export PATH="/data/env3.7/bin:$PATH"' >> /data/entry.sh && \ + echo "export DIPLOMACY_ROOT=`python -c 'import diplomacy; print(diplomacy.__path__[0])'`" >> /data/entry.sh && \ + echo 'cd /data/diplomacy' >> /data/entry.sh && \ + echo 'mkdir -p "$HOME/.cache/diplomacy"' >> /data/entry.sh && \ + echo 'wget -nv https://storage.googleapis.com/ppaquette-diplomacy/cache-jenkins/convoy_paths_cache.pkl -O "$HOME/.cache/diplomacy/convoy_paths_cache.pkl"' >> /data/entry.sh && \ + echo 'cd /work_dir' >> /data/entry.sh && \ + echo 'rm -f /work_dir/data/log_*.txt' >> /data/entry.sh && \ + echo 'python -m diplomacy.server.run |& tee -a /work_dir/data/log_server.txt &' >> /data/entry.sh && \ + echo 'python /data/diplomacy/diplomacy_research/scripts/launch_bot.py |& tee -a /work_dir/data/log_bot.txt &' >> /data/entry.sh && \ + echo 'cd $DIPLOMACY_ROOT/web/' >> /data/entry.sh && \ + echo 'export NVM_DIR="$HOME/.nvm"' >> /data/entry.sh && \ + echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /data/entry.sh && \ + echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> /data/entry.sh && \ + echo 'npm run-script build' >> /data/entry.sh && \ + echo 'cd -' >> /data/entry.sh && \ + echo '/usr/sbin/nginx' >> /data/entry.sh && \ + \ + echo "------------------------------------------------------" && \ + echo "Cleaning up" && \ + echo "------------------------------------------------------" && \ + apt-get clean && \ + apt-get autoclean && \ + rm -Rf /tmp/pip_build_root && \ + rm -rf /var/lib/apt/lists/* + +COPY default /etc/nginx/sites-available/default +WORKDIR /data/diplomacy +VOLUME ["/work_dir", "/data/certs"] +ENTRYPOINT ["/bin/bash", "/data/entry.sh"] + +# Expose ports. +EXPOSE 80 +EXPOSE 443 +EXPOSE 8432 +EXPOSE 8433 diff --git a/diplomacy_research/containers/deploy-web/default b/diplomacy_research/containers/deploy-web/default new file mode 100644 index 0000000..509fbe6 --- /dev/null +++ b/diplomacy_research/containers/deploy-web/default @@ -0,0 +1,49 @@ +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +upstream game-server { + server 127.0.0.1:8432; +} + +server { + listen 8433 ssl; + server_name web.diplomacy.ai; + + ssl_certificate /data/certs/fullchain.pem; + ssl_certificate_key /data/certs/privkey.pem; + ssl_session_cache shared:le_nginx_SSL:1m; + ssl_session_timeout 1440m; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"; + ssl_dhparam /data/certs/ssl-dhparams.pem; + + location / { + proxy_pass http://game-server; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + } +} + +server { + listen 80; + listen 443 ssl; + server_name web.diplomacy.ai; + root /data/env3.7/lib/python3.7/site-packages/diplomacy/web/build/; + + ssl_certificate /data/certs/fullchain.pem; + ssl_certificate_key /data/certs/privkey.pem; + ssl_session_cache shared:le_nginx_SSL:1m; + ssl_session_timeout 1440m; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"; + ssl_dhparam /data/certs/ssl-dhparams.pem; +} diff --git a/diplomacy_research/containers/deploy-webdip/Dockerfile b/diplomacy_research/containers/deploy-webdip/Dockerfile new file mode 100644 index 0000000..f60f174 --- /dev/null +++ b/diplomacy_research/containers/deploy-webdip/Dockerfile @@ -0,0 +1,83 @@ +FROM pcpaquette/tensorflow-serving:20190226 + +# To build and push: +# sudo -s +# apt-get update -y +# apt-get install -y docker.io +# docker build -t gcr.io/ppaquette-diplomacy/webdip-deploy:7473ed4 --build-arg COMMIT_ID=7473ed4798a65c957b8b1a5eadbd876a307e00cf . +# gcloud auth configure-docker +# gcloud docker -- push gcr.io/ppaquette-diplomacy/webdip-deploy:7473ed4 + +ENV PYTHONIOENCODING=utf-8 +ENV LANG=en_CA.UTF-8 +ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp +ENV PYTHONUNBUFFERED=1 +ENV WORKING_DIR=/work_dir + +ARG GITHUB_TOKEN +ARG REPO +ARG COMMIT_ID +USER root +RUN echo "------------------------------------------------------" && \ + echo "Installing dependencies (psmisc)" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-get install -y psmisc software-properties-common wget curl && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -Rf /tmp/pip_build_root && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "------------------------------------------------------" && \ + echo "Installing Diplomacy" && \ + echo "------------------------------------------------------" && \ + apt-get update -y && \ + mkdir -p /work_dir && \ + mkdir -p /data && \ + mkdir -p /data/certs && \ + rm -Rf /data/diplomacy && \ + rm -Rf /data/env3.7 && \ + cd /data && \ + git clone "https://$GITHUB_TOKEN:x-oauth-basic@github.com/$REPO.git" diplomacy && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh && \ + bash ./miniconda.sh -b -p /data/env3.7 && \ + export PATH="/data/env3.7/bin:$PATH" && \ + pip install --upgrade pip && \ + cd diplomacy && \ + git checkout $COMMIT_ID && \ + .jenkins/expand_vars.sh && \ + pip install -r requirements.txt && \ + pip install -r requirements_dev.txt && \ + git checkout -- requirements.txt requirements_dev.txt && \ + cd /data && \ + \ + chmod -R 777 /data && \ + chmod -R 400 /data/certs && \ + chmod -R 777 /work_dir && \ + \ + echo "------------------------------------------------------" && \ + echo "Building launch script" && \ + echo "------------------------------------------------------" && \ + echo '#!/bin/bash' > /data/entry.sh && \ + echo 'export PATH="/data/env3.7/bin:$PATH"' >> /data/entry.sh && \ + echo "export DIPLOMACY_ROOT=`python -c 'import diplomacy; print(diplomacy.__path__[0])'`" >> /data/entry.sh && \ + echo 'cd /data/diplomacy' >> /data/entry.sh && \ + echo 'mkdir -p "$HOME/.cache/diplomacy"' >> /data/entry.sh && \ + echo 'wget -nv https://storage.googleapis.com/ppaquette-diplomacy/cache-jenkins/convoy_paths_cache.pkl -O "$HOME/.cache/diplomacy/convoy_paths_cache.pkl"' >> /data/entry.sh && \ + echo 'cd /work_dir' >> /data/entry.sh && \ + echo 'mkdir -p /work_dir/data' >> /data/entry.sh && \ + echo 'rm -f /work_dir/data/log_serv*.txt' >> /data/entry.sh && \ + echo 'python /data/diplomacy/diplomacy_research/scripts/launch_bot_webdip.py |& tee -a /work_dir/data/log_bot_$(date +%Y-%m-%d_%H-%M-%S).txt' >> /data/entry.sh && \ + \ + echo "------------------------------------------------------" && \ + echo "Cleaning up" && \ + echo "------------------------------------------------------" && \ + apt-get clean && \ + apt-get autoclean && \ + rm -Rf /tmp/pip_build_root && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /data/diplomacy +VOLUME ["/work_dir", "/data/certs"] +ENTRYPOINT ["/bin/bash", "/data/entry.sh"] diff --git a/diplomacy_research/containers/redis/Singularity b/diplomacy_research/containers/redis/Singularity new file mode 100644 index 0000000..c5f3c81 --- /dev/null +++ b/diplomacy_research/containers/redis/Singularity @@ -0,0 +1,51 @@ +Bootstrap: docker +From: ubuntu:18.04 + +%runscript +cd /work_dir +if [ ! -f /work_dir/redis.conf ]; then + cp /data/redis.conf /work_dir/redis.conf +fi +echo "Use instance.start to start an instance." +echo "Don't forget to bind the /work_dir" +exec "$@" + +%startscript +cd /work_dir +if [ ! -f /work_dir/redis.conf ]; then + cp /data/redis.conf /work_dir/redis.conf +fi +echo "-----------------------------------" >> /work_dir/output.log +nohup redis-server /work_dir/redis.conf >> /work_dir/output.log 2>&1 + +%setup +cp ./redis.conf ${SINGULARITY_ROOTFS}/redis.conf + +%environment +export WORKING_DIR=/work_dir +export HOME="${HOME:-/work_dir}" +export PYTHONIOENCODING=utf-8 +export LANG=en_CA.UTF-8 + +%labels +AUTHOR pcpaquette@gmail.com + +%post +mkdir -p /data +mkdir -p /work_dir +mv /redis.conf /data/redis.conf +apt-get -y update +apt-get install -y software-properties-common +add-apt-repository -y ppa:chris-lea/redis-server +apt-get -y update +apt-get install -y redis-server + +chmod -R 777 /data +chmod -R 777 /work_dir +echo vm.overcommit_memory = 1 >> /etc/sysctl.conf +sysctl vm.overcommit_memory=1 + +# Cleaning up +apt-get clean +apt-get autoclean +rm -rf /var/lib/apt/lists/* diff --git a/diplomacy_research/containers/redis/redis.conf b/diplomacy_research/containers/redis/redis.conf new file mode 100644 index 0000000..f65849f --- /dev/null +++ b/diplomacy_research/containers/redis/redis.conf @@ -0,0 +1,1378 @@ +# Redis configuration file example. +# +# Note that in order to read the configuration file, Redis must be +# started with the file path as first argument: +# +# ./redis-server /path/to/redis.conf + +# Note on units: when memory size is needed, it is possible to specify +# it in the usual form of 1k 5GB 4M and so forth: +# +# 1k => 1000 bytes +# 1kb => 1024 bytes +# 1m => 1000000 bytes +# 1mb => 1024*1024 bytes +# 1g => 1000000000 bytes +# 1gb => 1024*1024*1024 bytes +# +# units are case insensitive so 1GB 1Gb 1gB are all the same. + +################################## INCLUDES ################################### + +# Include one or more other config files here. This is useful if you +# have a standard template that goes to all Redis servers but also need +# to customize a few per-server settings. Include files can include +# other files, so use this wisely. +# +# Notice option "include" won't be rewritten by command "CONFIG REWRITE" +# from admin or Redis Sentinel. Since Redis always uses the last processed +# line as value of a configuration directive, you'd better put includes +# at the beginning of this file to avoid overwriting config change at runtime. +# +# If instead you are interested in using includes to override configuration +# options, it is better to use include as the last line. +# +# include /path/to/local.conf +# include /path/to/other.conf + +################################## MODULES ##################################### + +# Load modules at startup. If the server is not able to load modules +# it will abort. It is possible to use multiple loadmodule directives. +# +# loadmodule /path/to/my_module.so +# loadmodule /path/to/other_module.so + +################################## NETWORK ##################################### + +# By default, if no "bind" configuration directive is specified, Redis listens +# for connections from all the network interfaces available on the server. +# It is possible to listen to just one or multiple selected interfaces using +# the "bind" configuration directive, followed by one or more IP addresses. +# +# Examples: +# +# bind 192.168.1.100 10.0.0.1 +# bind 127.0.0.1 ::1 +# +# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the +# internet, binding to all the interfaces is dangerous and will expose the +# instance to everybody on the internet. So by default we uncomment the +# following bind directive, that will force Redis to listen only into +# the IPv4 loopback interface address (this means Redis will be able to +# accept connections only from clients running into the same computer it +# is running). +# +# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES +# JUST COMMENT THE FOLLOWING LINE. +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# bind 127.0.0.1 + +# Protected mode is a layer of security protection, in order to avoid that +# Redis instances left open on the internet are accessed and exploited. +# +# When protected mode is on and if: +# +# 1) The server is not binding explicitly to a set of addresses using the +# "bind" directive. +# 2) No password is configured. +# +# The server only accepts connections from clients connecting from the +# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain +# sockets. +# +# By default protected mode is enabled. You should disable it only if +# you are sure you want clients from other hosts to connect to Redis +# even if no authentication is configured, nor a specific set of interfaces +# are explicitly listed using the "bind" directive. +protected-mode no + +# Accept connections on the specified port, default is 6379 (IANA #815344). +# If port 0 is specified Redis will not listen on a TCP socket. +port 6379 + +# TCP listen() backlog. +# +# In high requests-per-second environments you need an high backlog in order +# to avoid slow clients connections issues. Note that the Linux kernel +# will silently truncate it to the value of /proc/sys/net/core/somaxconn so +# make sure to raise both the value of somaxconn and tcp_max_syn_backlog +# in order to get the desired effect. +tcp-backlog 511 + +# Unix socket. +# +# Specify the path for the Unix socket that will be used to listen for +# incoming connections. There is no default, so Redis will not listen +# on a unix socket when not specified. +# +# unixsocket /tmp/redis.sock +# unixsocketperm 700 + +# Close the connection after a client is idle for N seconds (0 to disable) +timeout 0 + +# TCP keepalive. +# +# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence +# of communication. This is useful for two reasons: +# +# 1) Detect dead peers. +# 2) Take the connection alive from the point of view of network +# equipment in the middle. +# +# On Linux, the specified value (in seconds) is the period used to send ACKs. +# Note that to close the connection the double of the time is needed. +# On other kernels the period depends on the kernel configuration. +# +# A reasonable value for this option is 300 seconds, which is the new +# Redis default starting with Redis 3.2.1. +tcp-keepalive 300 + +################################# GENERAL ##################################### + +# By default Redis does not run as a daemon. Use 'yes' if you need it. +# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. +daemonize no + +# If you run Redis from upstart or systemd, Redis can interact with your +# supervision tree. Options: +# supervised no - no supervision interaction +# supervised upstart - signal upstart by putting Redis into SIGSTOP mode +# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET +# supervised auto - detect upstart or systemd method based on +# UPSTART_JOB or NOTIFY_SOCKET environment variables +# Note: these supervision methods only signal "process is ready." +# They do not enable continuous liveness pings back to your supervisor. +supervised no + +# If a pid file is specified, Redis writes it where specified at startup +# and removes it at exit. +# +# When the server runs non daemonized, no pid file is created if none is +# specified in the configuration. When the server is daemonized, the pid file +# is used even if not specified, defaulting to "/var/run/redis.pid". +# +# Creating a pid file is best effort: if Redis is not able to create it +# nothing bad happens, the server will start and run normally. +pidfile /var/run/redis_6379.pid + +# Specify the server verbosity level. +# This can be one of: +# debug (a lot of information, useful for development/testing) +# verbose (many rarely useful info, but not a mess like the debug level) +# notice (moderately verbose, what you want in production probably) +# warning (only very important / critical messages are logged) +loglevel notice + +# Specify the log file name. Also the empty string can be used to force +# Redis to log on the standard output. Note that if you use standard +# output for logging but daemonize, logs will be sent to /dev/null +logfile "" + +# To enable logging to the system logger, just set 'syslog-enabled' to yes, +# and optionally update the other syslog parameters to suit your needs. +# syslog-enabled no + +# Specify the syslog identity. +# syslog-ident redis + +# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. +# syslog-facility local0 + +# Set the number of databases. The default database is DB 0, you can select +# a different one on a per-connection basis using SELECT where +# dbid is a number between 0 and 'databases'-1 +databases 16 + +# By default Redis shows an ASCII art logo only when started to log to the +# standard output and if the standard output is a TTY. Basically this means +# that normally a logo is displayed only in interactive sessions. +# +# However it is possible to force the pre-4.0 behavior and always show a +# ASCII art logo in startup logs by setting the following option to yes. +always-show-logo yes + +################################ SNAPSHOTTING ################################ +# +# Save the DB on disk: +# +# save +# +# Will save the DB if both the given number of seconds and the given +# number of write operations against the DB occurred. +# +# In the example below the behaviour will be to save: +# after 900 sec (15 min) if at least 1 key changed +# after 300 sec (5 min) if at least 10 keys changed +# after 60 sec if at least 10000 keys changed +# +# Note: you can disable saving completely by commenting out all "save" lines. +# +# It is also possible to remove all the previously configured save +# points by adding a save directive with a single empty string argument +# like in the following example: +# +# save "" + +save 900 1 +save 300 10 +save 60 10000 + +# By default Redis will stop accepting writes if RDB snapshots are enabled +# (at least one save point) and the latest background save failed. +# This will make the user aware (in a hard way) that data is not persisting +# on disk properly, otherwise chances are that no one will notice and some +# disaster will happen. +# +# If the background saving process will start working again Redis will +# automatically allow writes again. +# +# However if you have setup your proper monitoring of the Redis server +# and persistence, you may want to disable this feature so that Redis will +# continue to work as usual even if there are problems with disk, +# permissions, and so forth. +stop-writes-on-bgsave-error yes + +# Compress string objects using LZF when dump .rdb databases? +# For default that's set to 'yes' as it's almost always a win. +# If you want to save some CPU in the saving child set it to 'no' but +# the dataset will likely be bigger if you have compressible values or keys. +rdbcompression yes + +# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. +# This makes the format more resistant to corruption but there is a performance +# hit to pay (around 10%) when saving and loading RDB files, so you can disable it +# for maximum performances. +# +# RDB files created with checksum disabled have a checksum of zero that will +# tell the loading code to skip the check. +rdbchecksum yes + +# The filename where to dump the DB +dbfilename saved_redis.rdb + +# The working directory. +# +# The DB will be written inside this directory, with the filename specified +# above using the 'dbfilename' configuration directive. +# +# The Append Only File will also be created inside this directory. +# +# Note that you must specify a directory here, not a file name. +dir /work_dir + +################################# REPLICATION ################################# + +# Master-Replica replication. Use replicaof to make a Redis instance a copy of +# another Redis server. A few things to understand ASAP about Redis replication. +# +# +------------------+ +---------------+ +# | Master | ---> | Replica | +# | (receive writes) | | (exact copy) | +# +------------------+ +---------------+ +# +# 1) Redis replication is asynchronous, but you can configure a master to +# stop accepting writes if it appears to be not connected with at least +# a given number of replicas. +# 2) Redis replicas are able to perform a partial resynchronization with the +# master if the replication link is lost for a relatively small amount of +# time. You may want to configure the replication backlog size (see the next +# sections of this file) with a sensible value depending on your needs. +# 3) Replication is automatic and does not need user intervention. After a +# network partition replicas automatically try to reconnect to masters +# and resynchronize with them. +# +# replicaof + +# If the master is password protected (using the "requirepass" configuration +# directive below) it is possible to tell the replica to authenticate before +# starting the replication synchronization process, otherwise the master will +# refuse the replica request. +# +# masterauth + +# When a replica loses its connection with the master, or when the replication +# is still in progress, the replica can act in two different ways: +# +# 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will +# still reply to client requests, possibly with out of date data, or the +# data set may just be empty if this is the first synchronization. +# +# 2) if replica-serve-stale-data is set to 'no' the replica will reply with +# an error "SYNC with master in progress" to all the kind of commands +# but to INFO, replicaOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG, +# SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, +# COMMAND, POST, HOST: and LATENCY. +# +replica-serve-stale-data yes + +# You can configure a replica instance to accept writes or not. Writing against +# a replica instance may be useful to store some ephemeral data (because data +# written on a replica will be easily deleted after resync with the master) but +# may also cause problems if clients are writing to it because of a +# misconfiguration. +# +# Since Redis 2.6 by default replicas are read-only. +# +# Note: read only replicas are not designed to be exposed to untrusted clients +# on the internet. It's just a protection layer against misuse of the instance. +# Still a read only replica exports by default all the administrative commands +# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve +# security of read only replicas using 'rename-command' to shadow all the +# administrative / dangerous commands. +replica-read-only yes + +# Replication SYNC strategy: disk or socket. +# +# ------------------------------------------------------- +# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY +# ------------------------------------------------------- +# +# New replicas and reconnecting replicas that are not able to continue the replication +# process just receiving differences, need to do what is called a "full +# synchronization". An RDB file is transmitted from the master to the replicas. +# The transmission can happen in two different ways: +# +# 1) Disk-backed: The Redis master creates a new process that writes the RDB +# file on disk. Later the file is transferred by the parent +# process to the replicas incrementally. +# 2) Diskless: The Redis master creates a new process that directly writes the +# RDB file to replica sockets, without touching the disk at all. +# +# With disk-backed replication, while the RDB file is generated, more replicas +# can be queued and served with the RDB file as soon as the current child producing +# the RDB file finishes its work. With diskless replication instead once +# the transfer starts, new replicas arriving will be queued and a new transfer +# will start when the current one terminates. +# +# When diskless replication is used, the master waits a configurable amount of +# time (in seconds) before starting the transfer in the hope that multiple replicas +# will arrive and the transfer can be parallelized. +# +# With slow disks and fast (large bandwidth) networks, diskless replication +# works better. +repl-diskless-sync no + +# When diskless replication is enabled, it is possible to configure the delay +# the server waits in order to spawn the child that transfers the RDB via socket +# to the replicas. +# +# This is important since once the transfer starts, it is not possible to serve +# new replicas arriving, that will be queued for the next RDB transfer, so the server +# waits a delay in order to let more replicas arrive. +# +# The delay is specified in seconds, and by default is 5 seconds. To disable +# it entirely just set it to 0 seconds and the transfer will start ASAP. +repl-diskless-sync-delay 5 + +# Replicas send PINGs to server in a predefined interval. It's possible to change +# this interval with the repl_ping_replica_period option. The default value is 10 +# seconds. +# +# repl-ping-replica-period 10 + +# The following option sets the replication timeout for: +# +# 1) Bulk transfer I/O during SYNC, from the point of view of replica. +# 2) Master timeout from the point of view of replicas (data, pings). +# 3) Replica timeout from the point of view of masters (REPLCONF ACK pings). +# +# It is important to make sure that this value is greater than the value +# specified for repl-ping-replica-period otherwise a timeout will be detected +# every time there is low traffic between the master and the replica. +# +# repl-timeout 60 + +# Disable TCP_NODELAY on the replica socket after SYNC? +# +# If you select "yes" Redis will use a smaller number of TCP packets and +# less bandwidth to send data to replicas. But this can add a delay for +# the data to appear on the replica side, up to 40 milliseconds with +# Linux kernels using a default configuration. +# +# If you select "no" the delay for data to appear on the replica side will +# be reduced but more bandwidth will be used for replication. +# +# By default we optimize for low latency, but in very high traffic conditions +# or when the master and replicas are many hops away, turning this to "yes" may +# be a good idea. +repl-disable-tcp-nodelay no + +# Set the replication backlog size. The backlog is a buffer that accumulates +# replica data when replicas are disconnected for some time, so that when a replica +# wants to reconnect again, often a full resync is not needed, but a partial +# resync is enough, just passing the portion of data the replica missed while +# disconnected. +# +# The bigger the replication backlog, the longer the time the replica can be +# disconnected and later be able to perform a partial resynchronization. +# +# The backlog is only allocated once there is at least a replica connected. +# +# repl-backlog-size 1mb + +# After a master has no longer connected replicas for some time, the backlog +# will be freed. The following option configures the amount of seconds that +# need to elapse, starting from the time the last replica disconnected, for +# the backlog buffer to be freed. +# +# Note that replicas never free the backlog for timeout, since they may be +# promoted to masters later, and should be able to correctly "partially +# resynchronize" with the replicas: hence they should always accumulate backlog. +# +# A value of 0 means to never release the backlog. +# +# repl-backlog-ttl 3600 + +# The replica priority is an integer number published by Redis in the INFO output. +# It is used by Redis Sentinel in order to select a replica to promote into a +# master if the master is no longer working correctly. +# +# A replica with a low priority number is considered better for promotion, so +# for instance if there are three replicas with priority 10, 100, 25 Sentinel will +# pick the one with priority 10, that is the lowest. +# +# However a special priority of 0 marks the replica as not able to perform the +# role of master, so a replica with priority of 0 will never be selected by +# Redis Sentinel for promotion. +# +# By default the priority is 100. +replica-priority 100 + +# It is possible for a master to stop accepting writes if there are less than +# N replicas connected, having a lag less or equal than M seconds. +# +# The N replicas need to be in "online" state. +# +# The lag in seconds, that must be <= the specified value, is calculated from +# the last ping received from the replica, that is usually sent every second. +# +# This option does not GUARANTEE that N replicas will accept the write, but +# will limit the window of exposure for lost writes in case not enough replicas +# are available, to the specified number of seconds. +# +# For example to require at least 3 replicas with a lag <= 10 seconds use: +# +# min-replicas-to-write 3 +# min-replicas-max-lag 10 +# +# Setting one or the other to 0 disables the feature. +# +# By default min-replicas-to-write is set to 0 (feature disabled) and +# min-replicas-max-lag is set to 10. + +# A Redis master is able to list the address and port of the attached +# replicas in different ways. For example the "INFO replication" section +# offers this information, which is used, among other tools, by +# Redis Sentinel in order to discover replica instances. +# Another place where this info is available is in the output of the +# "ROLE" command of a master. +# +# The listed IP and address normally reported by a replica is obtained +# in the following way: +# +# IP: The address is auto detected by checking the peer address +# of the socket used by the replica to connect with the master. +# +# Port: The port is communicated by the replica during the replication +# handshake, and is normally the port that the replica is using to +# listen for connections. +# +# However when port forwarding or Network Address Translation (NAT) is +# used, the replica may be actually reachable via different IP and port +# pairs. The following two options can be used by a replica in order to +# report to its master a specific set of IP and port, so that both INFO +# and ROLE will report those values. +# +# There is no need to use both the options if you need to override just +# the port or the IP address. +# +# replica-announce-ip 5.5.5.5 +# replica-announce-port 1234 + +################################## SECURITY ################################### + +# Require clients to issue AUTH before processing any other +# commands. This might be useful in environments in which you do not trust +# others with access to the host running redis-server. +# +# This should stay commented out for backward compatibility and because most +# people do not need auth (e.g. they run their own servers). +# +# Warning: since Redis is pretty fast an outside user can try up to +# 150k passwords per second against a good box. This means that you should +# use a very strong password otherwise it will be very easy to break. +# +# requirepass foobared + +# Command renaming. +# +# It is possible to change the name of dangerous commands in a shared +# environment. For instance the CONFIG command may be renamed into something +# hard to guess so that it will still be available for internal-use tools +# but not available for general clients. +# +# Example: +# +# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 +# +# It is also possible to completely kill a command by renaming it into +# an empty string: +# +# rename-command CONFIG "" +# +# Please note that changing the name of commands that are logged into the +# AOF file or transmitted to replicas may cause problems. + +################################### CLIENTS #################################### + +# Set the max number of connected clients at the same time. By default +# this limit is set to 10000 clients, however if the Redis server is not +# able to configure the process file limit to allow for the specified limit +# the max number of allowed clients is set to the current file limit +# minus 32 (as Redis reserves a few file descriptors for internal uses). +# +# Once the limit is reached Redis will close all the new connections sending +# an error 'max number of clients reached'. +# +maxclients 10000 + +############################## MEMORY MANAGEMENT ################################ + +# Set a memory usage limit to the specified amount of bytes. +# When the memory limit is reached Redis will try to remove keys +# according to the eviction policy selected (see maxmemory-policy). +# +# If Redis can't remove keys according to the policy, or if the policy is +# set to 'noeviction', Redis will start to reply with errors to commands +# that would use more memory, like SET, LPUSH, and so on, and will continue +# to reply to read-only commands like GET. +# +# This option is usually useful when using Redis as an LRU or LFU cache, or to +# set a hard memory limit for an instance (using the 'noeviction' policy). +# +# WARNING: If you have replicas attached to an instance with maxmemory on, +# the size of the output buffers needed to feed the replicas are subtracted +# from the used memory count, so that network problems / resyncs will +# not trigger a loop where keys are evicted, and in turn the output +# buffer of replicas is full with DELs of keys evicted triggering the deletion +# of more keys, and so forth until the database is completely emptied. +# +# In short... if you have replicas attached it is suggested that you set a lower +# limit for maxmemory so that there is some free RAM on the system for replica +# output buffers (but this is not needed if the policy is 'noeviction'). +# +maxmemory 100gb + +# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory +# is reached. You can select among five behaviors: +# +# volatile-lru -> Evict using approximated LRU among the keys with an expire set. +# allkeys-lru -> Evict any key using approximated LRU. +# volatile-lfu -> Evict using approximated LFU among the keys with an expire set. +# allkeys-lfu -> Evict any key using approximated LFU. +# volatile-random -> Remove a random key among the ones with an expire set. +# allkeys-random -> Remove a random key, any key. +# volatile-ttl -> Remove the key with the nearest expire time (minor TTL) +# noeviction -> Don't evict anything, just return an error on write operations. +# +# LRU means Least Recently Used +# LFU means Least Frequently Used +# +# Both LRU, LFU and volatile-ttl are implemented using approximated +# randomized algorithms. +# +# Note: with any of the above policies, Redis will return an error on write +# operations, when there are no suitable keys for eviction. +# +# At the date of writing these commands are: set setnx setex append +# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd +# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby +# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby +# getset mset msetnx exec sort +# +# The default is: +# +# maxmemory-policy noeviction +maxmemory-policy volatile-lru + +# LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated +# algorithms (in order to save memory), so you can tune it for speed or +# accuracy. For default Redis will check five keys and pick the one that was +# used less recently, you can change the sample size using the following +# configuration directive. +# +# The default of 5 produces good enough results. 10 Approximates very closely +# true LRU but costs more CPU. 3 is faster but not very accurate. +# +maxmemory-samples 5 + +# Starting from Redis 5, by default a replica will ignore its maxmemory setting +# (unless it is promoted to master after a failover or manually). It means +# that the eviction of keys will be just handled by the master, sending the +# DEL commands to the replica as keys evict in the master side. +# +# This behavior ensures that masters and replicas stay consistent, and is usually +# what you want, however if your replica is writable, or you want the replica to have +# a different memory setting, and you are sure all the writes performed to the +# replica are idempotent, then you may change this default (but be sure to understand +# what you are doing). +# +# Note that since the replica by default does not evict, it may end using more +# memory than the one set via maxmemory (there are certain buffers that may +# be larger on the replica, or data structures may sometimes take more memory and so +# forth). So make sure you monitor your replicas and make sure they have enough +# memory to never hit a real out-of-memory condition before the master hits +# the configured maxmemory setting. +# +# replica-ignore-maxmemory yes + +############################# LAZY FREEING #################################### + +# Redis has two primitives to delete keys. One is called DEL and is a blocking +# deletion of the object. It means that the server stops processing new commands +# in order to reclaim all the memory associated with an object in a synchronous +# way. If the key deleted is associated with a small object, the time needed +# in order to execute the DEL command is very small and comparable to most other +# O(1) or O(log_N) commands in Redis. However if the key is associated with an +# aggregated value containing millions of elements, the server can block for +# a long time (even seconds) in order to complete the operation. +# +# For the above reasons Redis also offers non blocking deletion primitives +# such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and +# FLUSHDB commands, in order to reclaim memory in background. Those commands +# are executed in constant time. Another thread will incrementally free the +# object in the background as fast as possible. +# +# DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled. +# It's up to the design of the application to understand when it is a good +# idea to use one or the other. However the Redis server sometimes has to +# delete keys or flush the whole database as a side effect of other operations. +# Specifically Redis deletes objects independently of a user call in the +# following scenarios: +# +# 1) On eviction, because of the maxmemory and maxmemory policy configurations, +# in order to make room for new data, without going over the specified +# memory limit. +# 2) Because of expire: when a key with an associated time to live (see the +# EXPIRE command) must be deleted from memory. +# 3) Because of a side effect of a command that stores data on a key that may +# already exist. For example the RENAME command may delete the old key +# content when it is replaced with another one. Similarly SUNIONSTORE +# or SORT with STORE option may delete existing keys. The SET command +# itself removes any old content of the specified key in order to replace +# it with the specified string. +# 4) During replication, when a replica performs a full resynchronization with +# its master, the content of the whole database is removed in order to +# load the RDB file just transferred. +# +# In all the above cases the default is to delete objects in a blocking way, +# like if DEL was called. However you can configure each case specifically +# in order to instead release memory in a non-blocking way like if UNLINK +# was called, using the following configuration directives: + +lazyfree-lazy-eviction no +lazyfree-lazy-expire no +lazyfree-lazy-server-del no +replica-lazy-flush no + +############################## APPEND ONLY MODE ############################### + +# By default Redis asynchronously dumps the dataset on disk. This mode is +# good enough in many applications, but an issue with the Redis process or +# a power outage may result into a few minutes of writes lost (depending on +# the configured save points). +# +# The Append Only File is an alternative persistence mode that provides +# much better durability. For instance using the default data fsync policy +# (see later in the config file) Redis can lose just one second of writes in a +# dramatic event like a server power outage, or a single write if something +# wrong with the Redis process itself happens, but the operating system is +# still running correctly. +# +# AOF and RDB persistence can be enabled at the same time without problems. +# If the AOF is enabled on startup Redis will load the AOF, that is the file +# with the better durability guarantees. +# +# Please check http://redis.io/topics/persistence for more information. + +appendonly yes + +# The name of the append only file (default: "appendonly.aof") + +appendfilename "saved_redis.aof" + +# The fsync() call tells the Operating System to actually write data on disk +# instead of waiting for more data in the output buffer. Some OS will really flush +# data on disk, some other OS will just try to do it ASAP. +# +# Redis supports three different modes: +# +# no: don't fsync, just let the OS flush the data when it wants. Faster. +# always: fsync after every write to the append only log. Slow, Safest. +# everysec: fsync only one time every second. Compromise. +# +# The default is "everysec", as that's usually the right compromise between +# speed and data safety. It's up to you to understand if you can relax this to +# "no" that will let the operating system flush the output buffer when +# it wants, for better performances (but if you can live with the idea of +# some data loss consider the default persistence mode that's snapshotting), +# or on the contrary, use "always" that's very slow but a bit safer than +# everysec. +# +# More details please check the following article: +# http://antirez.com/post/redis-persistence-demystified.html +# +# If unsure, use "everysec". + +# appendfsync always +appendfsync everysec +# appendfsync no + +# When the AOF fsync policy is set to always or everysec, and a background +# saving process (a background save or AOF log background rewriting) is +# performing a lot of I/O against the disk, in some Linux configurations +# Redis may block too long on the fsync() call. Note that there is no fix for +# this currently, as even performing fsync in a different thread will block +# our synchronous write(2) call. +# +# In order to mitigate this problem it's possible to use the following option +# that will prevent fsync() from being called in the main process while a +# BGSAVE or BGREWRITEAOF is in progress. +# +# This means that while another child is saving, the durability of Redis is +# the same as "appendfsync none". In practical terms, this means that it is +# possible to lose up to 30 seconds of log in the worst scenario (with the +# default Linux settings). +# +# If you have latency problems turn this to "yes". Otherwise leave it as +# "no" that is the safest pick from the point of view of durability. + +no-appendfsync-on-rewrite no + +# Automatic rewrite of the append only file. +# Redis is able to automatically rewrite the log file implicitly calling +# BGREWRITEAOF when the AOF log size grows by the specified percentage. +# +# This is how it works: Redis remembers the size of the AOF file after the +# latest rewrite (if no rewrite has happened since the restart, the size of +# the AOF at startup is used). +# +# This base size is compared to the current size. If the current size is +# bigger than the specified percentage, the rewrite is triggered. Also +# you need to specify a minimal size for the AOF file to be rewritten, this +# is useful to avoid rewriting the AOF file even if the percentage increase +# is reached but it is still pretty small. +# +# Specify a percentage of zero in order to disable the automatic AOF +# rewrite feature. + +auto-aof-rewrite-percentage 100 +auto-aof-rewrite-min-size 64mb + +# An AOF file may be found to be truncated at the end during the Redis +# startup process, when the AOF data gets loaded back into memory. +# This may happen when the system where Redis is running +# crashes, especially when an ext4 filesystem is mounted without the +# data=ordered option (however this can't happen when Redis itself +# crashes or aborts but the operating system still works correctly). +# +# Redis can either exit with an error when this happens, or load as much +# data as possible (the default now) and start if the AOF file is found +# to be truncated at the end. The following option controls this behavior. +# +# If aof-load-truncated is set to yes, a truncated AOF file is loaded and +# the Redis server starts emitting a log to inform the user of the event. +# Otherwise if the option is set to no, the server aborts with an error +# and refuses to start. When the option is set to no, the user requires +# to fix the AOF file using the "redis-check-aof" utility before to restart +# the server. +# +# Note that if the AOF file will be found to be corrupted in the middle +# the server will still exit with an error. This option only applies when +# Redis will try to read more data from the AOF file but not enough bytes +# will be found. +aof-load-truncated yes + +# When rewriting the AOF file, Redis is able to use an RDB preamble in the +# AOF file for faster rewrites and recoveries. When this option is turned +# on the rewritten AOF file is composed of two different stanzas: +# +# [RDB file][AOF tail] +# +# When loading Redis recognizes that the AOF file starts with the "REDIS" +# string and loads the prefixed RDB file, and continues loading the AOF +# tail. +aof-use-rdb-preamble yes + +################################ LUA SCRIPTING ############################### + +# Max execution time of a Lua script in milliseconds. +# +# If the maximum execution time is reached Redis will log that a script is +# still in execution after the maximum allowed time and will start to +# reply to queries with an error. +# +# When a long running script exceeds the maximum execution time only the +# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be +# used to stop a script that did not yet called write commands. The second +# is the only way to shut down the server in the case a write command was +# already issued by the script but the user doesn't want to wait for the natural +# termination of the script. +# +# Set it to 0 or a negative value for unlimited execution without warnings. +lua-time-limit 5000 + +################################ REDIS CLUSTER ############################### +# +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however +# in order to mark it as "mature" we need to wait for a non trivial percentage +# of users to deploy it in production. +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# +# Normal Redis instances can't be part of a Redis Cluster; only nodes that are +# started as cluster nodes can. In order to start a Redis instance as a +# cluster node enable the cluster support uncommenting the following: +# +# cluster-enabled yes + +# Every cluster node has a cluster configuration file. This file is not +# intended to be edited by hand. It is created and updated by Redis nodes. +# Every Redis Cluster node requires a different cluster configuration file. +# Make sure that instances running in the same system do not have +# overlapping cluster configuration file names. +# +# cluster-config-file nodes-6379.conf + +# Cluster node timeout is the amount of milliseconds a node must be unreachable +# for it to be considered in failure state. +# Most other internal time limits are multiple of the node timeout. +# +# cluster-node-timeout 15000 + +# A replica of a failing master will avoid to start a failover if its data +# looks too old. +# +# There is no simple way for a replica to actually have an exact measure of +# its "data age", so the following two checks are performed: +# +# 1) If there are multiple replicas able to failover, they exchange messages +# in order to try to give an advantage to the replica with the best +# replication offset (more data from the master processed). +# Replicas will try to get their rank by offset, and apply to the start +# of the failover a delay proportional to their rank. +# +# 2) Every single replica computes the time of the last interaction with +# its master. This can be the last ping or command received (if the master +# is still in the "connected" state), or the time that elapsed since the +# disconnection with the master (if the replication link is currently down). +# If the last interaction is too old, the replica will not try to failover +# at all. +# +# The point "2" can be tuned by user. Specifically a replica will not perform +# the failover if, since the last interaction with the master, the time +# elapsed is greater than: +# +# (node-timeout * replica-validity-factor) + repl-ping-replica-period +# +# So for example if node-timeout is 30 seconds, and the replica-validity-factor +# is 10, and assuming a default repl-ping-replica-period of 10 seconds, the +# replica will not try to failover if it was not able to talk with the master +# for longer than 310 seconds. +# +# A large replica-validity-factor may allow replicas with too old data to failover +# a master, while a too small value may prevent the cluster from being able to +# elect a replica at all. +# +# For maximum availability, it is possible to set the replica-validity-factor +# to a value of 0, which means, that replicas will always try to failover the +# master regardless of the last time they interacted with the master. +# (However they'll always try to apply a delay proportional to their +# offset rank). +# +# Zero is the only value able to guarantee that when all the partitions heal +# the cluster will always be able to continue. +# +# cluster-replica-validity-factor 10 + +# Cluster replicas are able to migrate to orphaned masters, that are masters +# that are left without working replicas. This improves the cluster ability +# to resist to failures as otherwise an orphaned master can't be failed over +# in case of failure if it has no working replicas. +# +# Replicas migrate to orphaned masters only if there are still at least a +# given number of other working replicas for their old master. This number +# is the "migration barrier". A migration barrier of 1 means that a replica +# will migrate only if there is at least 1 other working replica for its master +# and so forth. It usually reflects the number of replicas you want for every +# master in your cluster. +# +# Default is 1 (replicas migrate only if their masters remain with at least +# one replica). To disable migration just set it to a very large value. +# A value of 0 can be set but is useful only for debugging and dangerous +# in production. +# +# cluster-migration-barrier 1 + +# By default Redis Cluster nodes stop accepting queries if they detect there +# is at least an hash slot uncovered (no available node is serving it). +# This way if the cluster is partially down (for example a range of hash slots +# are no longer covered) all the cluster becomes, eventually, unavailable. +# It automatically returns available as soon as all the slots are covered again. +# +# However sometimes you want the subset of the cluster which is working, +# to continue to accept queries for the part of the key space that is still +# covered. In order to do so, just set the cluster-require-full-coverage +# option to no. +# +# cluster-require-full-coverage yes + +# This option, when set to yes, prevents replicas from trying to failover its +# master during master failures. However the master can still perform a +# manual failover, if forced to do so. +# +# This is useful in different scenarios, especially in the case of multiple +# data center operations, where we want one side to never be promoted if not +# in the case of a total DC failure. +# +# cluster-replica-no-failover no + +# In order to setup your cluster make sure to read the documentation +# available at http://redis.io web site. + +########################## CLUSTER DOCKER/NAT support ######################## + +# In certain deployments, Redis Cluster nodes address discovery fails, because +# addresses are NAT-ted or because ports are forwarded (the typical case is +# Docker and other containers). +# +# In order to make Redis Cluster working in such environments, a static +# configuration where each node knows its public address is needed. The +# following two options are used for this scope, and are: +# +# * cluster-announce-ip +# * cluster-announce-port +# * cluster-announce-bus-port +# +# Each instruct the node about its address, client port, and cluster message +# bus port. The information is then published in the header of the bus packets +# so that other nodes will be able to correctly map the address of the node +# publishing the information. +# +# If the above options are not used, the normal Redis Cluster auto-detection +# will be used instead. +# +# Note that when remapped, the bus port may not be at the fixed offset of +# clients port + 10000, so you can specify any port and bus-port depending +# on how they get remapped. If the bus-port is not set, a fixed offset of +# 10000 will be used as usually. +# +# Example: +# +# cluster-announce-ip 10.1.1.5 +# cluster-announce-port 6379 +# cluster-announce-bus-port 6380 + +################################## SLOW LOG ################################### + +# The Redis Slow Log is a system to log queries that exceeded a specified +# execution time. The execution time does not include the I/O operations +# like talking with the client, sending the reply and so forth, +# but just the time needed to actually execute the command (this is the only +# stage of command execution where the thread is blocked and can not serve +# other requests in the meantime). +# +# You can configure the slow log with two parameters: one tells Redis +# what is the execution time, in microseconds, to exceed in order for the +# command to get logged, and the other parameter is the length of the +# slow log. When a new command is logged the oldest one is removed from the +# queue of logged commands. + +# The following time is expressed in microseconds, so 1000000 is equivalent +# to one second. Note that a negative number disables the slow log, while +# a value of zero forces the logging of every command. +slowlog-log-slower-than 10000 + +# There is no limit to this length. Just be aware that it will consume memory. +# You can reclaim memory used by the slow log with SLOWLOG RESET. +slowlog-max-len 128 + +################################ LATENCY MONITOR ############################## + +# The Redis latency monitoring subsystem samples different operations +# at runtime in order to collect data related to possible sources of +# latency of a Redis instance. +# +# Via the LATENCY command this information is available to the user that can +# print graphs and obtain reports. +# +# The system only logs operations that were performed in a time equal or +# greater than the amount of milliseconds specified via the +# latency-monitor-threshold configuration directive. When its value is set +# to zero, the latency monitor is turned off. +# +# By default latency monitoring is disabled since it is mostly not needed +# if you don't have latency issues, and collecting data has a performance +# impact, that while very small, can be measured under big load. Latency +# monitoring can easily be enabled at runtime using the command +# "CONFIG SET latency-monitor-threshold " if needed. +latency-monitor-threshold 0 + +############################# EVENT NOTIFICATION ############################## + +# Redis can notify Pub/Sub clients about events happening in the key space. +# This feature is documented at http://redis.io/topics/notifications +# +# For instance if keyspace events notification is enabled, and a client +# performs a DEL operation on key "foo" stored in the Database 0, two +# messages will be published via Pub/Sub: +# +# PUBLISH __keyspace@0__:foo del +# PUBLISH __keyevent@0__:del foo +# +# It is possible to select the events that Redis will notify among a set +# of classes. Every class is identified by a single character: +# +# K Keyspace events, published with __keyspace@__ prefix. +# E Keyevent events, published with __keyevent@__ prefix. +# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... +# $ String commands +# l List commands +# s Set commands +# h Hash commands +# z Sorted set commands +# x Expired events (events generated every time a key expires) +# e Evicted events (events generated when a key is evicted for maxmemory) +# A Alias for g$lshzxe, so that the "AKE" string means all the events. +# +# The "notify-keyspace-events" takes as argument a string that is composed +# of zero or multiple characters. The empty string means that notifications +# are disabled. +# +# Example: to enable list and generic events, from the point of view of the +# event name, use: +# +# notify-keyspace-events Elg +# +# Example 2: to get the stream of the expired keys subscribing to channel +# name __keyevent@0__:expired use: +# +# notify-keyspace-events Ex +# +# By default all notifications are disabled because most users don't need +# this feature and the feature has some overhead. Note that if you don't +# specify at least one of K or E, no events will be delivered. +notify-keyspace-events "" + +############################### ADVANCED CONFIG ############################### + +# Hashes are encoded using a memory efficient data structure when they have a +# small number of entries, and the biggest entry does not exceed a given +# threshold. These thresholds can be configured using the following directives. +hash-max-ziplist-entries 512 +hash-max-ziplist-value 64 + +# Lists are also encoded in a special way to save a lot of space. +# The number of entries allowed per internal list node can be specified +# as a fixed maximum size or a maximum number of elements. +# For a fixed maximum size, use -5 through -1, meaning: +# -5: max size: 64 Kb <-- not recommended for normal workloads +# -4: max size: 32 Kb <-- not recommended +# -3: max size: 16 Kb <-- probably not recommended +# -2: max size: 8 Kb <-- good +# -1: max size: 4 Kb <-- good +# Positive numbers mean store up to _exactly_ that number of elements +# per list node. +# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), +# but if your use case is unique, adjust the settings as necessary. +list-max-ziplist-size -2 + +# Lists may also be compressed. +# Compress depth is the number of quicklist ziplist nodes from *each* side of +# the list to *exclude* from compression. The head and tail of the list +# are always uncompressed for fast push/pop operations. Settings are: +# 0: disable all list compression +# 1: depth 1 means "don't start compressing until after 1 node into the list, +# going from either the head or tail" +# So: [head]->node->node->...->node->[tail] +# [head], [tail] will always be uncompressed; inner nodes will compress. +# 2: [head]->[next]->node->node->...->node->[prev]->[tail] +# 2 here means: don't compress head or head->next or tail->prev or tail, +# but compress all nodes between them. +# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] +# etc. +list-compress-depth 0 + +# Sets have a special encoding in just one case: when a set is composed +# of just strings that happen to be integers in radix 10 in the range +# of 64 bit signed integers. +# The following configuration setting sets the limit in the size of the +# set in order to use this special memory saving encoding. +set-max-intset-entries 512 + +# Similarly to hashes and lists, sorted sets are also specially encoded in +# order to save a lot of space. This encoding is only used when the length and +# elements of a sorted set are below the following limits: +zset-max-ziplist-entries 128 +zset-max-ziplist-value 64 + +# HyperLogLog sparse representation bytes limit. The limit includes the +# 16 bytes header. When an HyperLogLog using the sparse representation crosses +# this limit, it is converted into the dense representation. +# +# A value greater than 16000 is totally useless, since at that point the +# dense representation is more memory efficient. +# +# The suggested value is ~ 3000 in order to have the benefits of +# the space efficient encoding without slowing down too much PFADD, +# which is O(N) with the sparse encoding. The value can be raised to +# ~ 10000 when CPU is not a concern, but space is, and the data set is +# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. +hll-sparse-max-bytes 3000 + +# Streams macro node max size / items. The stream data structure is a radix +# tree of big nodes that encode multiple items inside. Using this configuration +# it is possible to configure how big a single node can be in bytes, and the +# maximum number of items it may contain before switching to a new node when +# appending new stream entries. If any of the following settings are set to +# zero, the limit is ignored, so for instance it is possible to set just a +# max entires limit by setting max-bytes to 0 and max-entries to the desired +# value. +stream-node-max-bytes 4096 +stream-node-max-entries 100 + +# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in +# order to help rehashing the main Redis hash table (the one mapping top-level +# keys to values). The hash table implementation Redis uses (see dict.c) +# performs a lazy rehashing: the more operation you run into a hash table +# that is rehashing, the more rehashing "steps" are performed, so if the +# server is idle the rehashing is never complete and some more memory is used +# by the hash table. +# +# The default is to use this millisecond 10 times every second in order to +# actively rehash the main dictionaries, freeing memory when possible. +# +# If unsure: +# use "activerehashing no" if you have hard latency requirements and it is +# not a good thing in your environment that Redis can reply from time to time +# to queries with 2 milliseconds delay. +# +# use "activerehashing yes" if you don't have such hard requirements but +# want to free memory asap when possible. +activerehashing yes + +# The client output buffer limits can be used to force disconnection of clients +# that are not reading data from the server fast enough for some reason (a +# common reason is that a Pub/Sub client can't consume messages as fast as the +# publisher can produce them). +# +# The limit can be set differently for the three different classes of clients: +# +# normal -> normal clients including MONITOR clients +# replica -> replica clients +# pubsub -> clients subscribed to at least one pubsub channel or pattern +# +# The syntax of every client-output-buffer-limit directive is the following: +# +# client-output-buffer-limit +# +# A client is immediately disconnected once the hard limit is reached, or if +# the soft limit is reached and remains reached for the specified number of +# seconds (continuously). +# So for instance if the hard limit is 32 megabytes and the soft limit is +# 16 megabytes / 10 seconds, the client will get disconnected immediately +# if the size of the output buffers reach 32 megabytes, but will also get +# disconnected if the client reaches 16 megabytes and continuously overcomes +# the limit for 10 seconds. +# +# By default normal clients are not limited because they don't receive data +# without asking (in a push way), but just after a request, so only +# asynchronous clients may create a scenario where data is requested faster +# than it can read. +# +# Instead there is a default limit for pubsub and replica clients, since +# subscribers and replicas receive data in a push fashion. +# +# Both the hard or the soft limit can be disabled by setting them to zero. +client-output-buffer-limit normal 0 0 0 +client-output-buffer-limit replica 256mb 64mb 60 +client-output-buffer-limit pubsub 32mb 8mb 60 + +# Client query buffers accumulate new commands. They are limited to a fixed +# amount by default in order to avoid that a protocol desynchronization (for +# instance due to a bug in the client) will lead to unbound memory usage in +# the query buffer. However you can configure it here if you have very special +# needs, such us huge multi/exec requests or alike. +# +# client-query-buffer-limit 1gb + +# In the Redis protocol, bulk requests, that are, elements representing single +# strings, are normally limited ot 512 mb. However you can change this limit +# here. +# +# proto-max-bulk-len 512mb + +# Redis calls an internal function to perform many background tasks, like +# closing connections of clients in timeout, purging expired keys that are +# never requested, and so forth. +# +# Not all tasks are performed with the same frequency, but Redis checks for +# tasks to perform according to the specified "hz" value. +# +# By default "hz" is set to 10. Raising the value will use more CPU when +# Redis is idle, but at the same time will make Redis more responsive when +# there are many keys expiring at the same time, and timeouts may be +# handled with more precision. +# +# The range is between 1 and 500, however a value over 100 is usually not +# a good idea. Most users should use the default of 10 and raise this up to +# 100 only in environments where very low latency is required. +hz 10 + +# Normally it is useful to have an HZ value which is proportional to the +# number of clients connected. This is useful in order, for instance, to +# avoid too many clients are processed for each background task invocation +# in order to avoid latency spikes. +# +# Since the default HZ value by default is conservatively set to 10, Redis +# offers, and enables by default, the ability to use an adaptive HZ value +# which will temporary raise when there are many connected clients. +# +# When dynamic HZ is enabled, the actual configured HZ will be used as +# as a baseline, but multiples of the configured HZ value will be actually +# used as needed once more clients are connected. In this way an idle +# instance will use very little CPU time while a busy instance will be +# more responsive. +dynamic-hz yes + +# When a child rewrites the AOF file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +aof-rewrite-incremental-fsync yes + +# When redis saves RDB file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +rdb-save-incremental-fsync yes + +# Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good +# idea to start with the default settings and only change them after investigating +# how to improve the performances and how the keys LFU change over time, which +# is possible to inspect via the OBJECT FREQ command. +# +# There are two tunable parameters in the Redis LFU implementation: the +# counter logarithm factor and the counter decay time. It is important to +# understand what the two parameters mean before changing them. +# +# The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis +# uses a probabilistic increment with logarithmic behavior. Given the value +# of the old counter, when a key is accessed, the counter is incremented in +# this way: +# +# 1. A random number R between 0 and 1 is extracted. +# 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1). +# 3. The counter is incremented only if R < P. +# +# The default lfu-log-factor is 10. This is a table of how the frequency +# counter changes with a different number of accesses with different +# logarithmic factors: +# +# +--------+------------+------------+------------+------------+------------+ +# | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits | +# +--------+------------+------------+------------+------------+------------+ +# | 0 | 104 | 255 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 1 | 18 | 49 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 10 | 10 | 18 | 142 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 100 | 8 | 11 | 49 | 143 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# +# NOTE: The above table was obtained by running the following commands: +# +# redis-benchmark -n 1000000 incr foo +# redis-cli object freq foo +# +# NOTE 2: The counter initial value is 5 in order to give new objects a chance +# to accumulate hits. +# +# The counter decay time is the time, in minutes, that must elapse in order +# for the key counter to be divided by two (or decremented if it has a value +# less <= 10). +# +# The default value for the lfu-decay-time is 1. A Special value of 0 means to +# decay the counter every time it happens to be scanned. +# +# lfu-log-factor 10 +# lfu-decay-time 1 + +########################### ACTIVE DEFRAGMENTATION ####################### +# +# WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested +# even in production and manually tested by multiple engineers for some +# time. +# +# What is active defragmentation? +# ------------------------------- +# +# Active (online) defragmentation allows a Redis server to compact the +# spaces left between small allocations and deallocations of data in memory, +# thus allowing to reclaim back memory. +# +# Fragmentation is a natural process that happens with every allocator (but +# less so with Jemalloc, fortunately) and certain workloads. Normally a server +# restart is needed in order to lower the fragmentation, or at least to flush +# away all the data and create it again. However thanks to this feature +# implemented by Oran Agra for Redis 4.0 this process can happen at runtime +# in an "hot" way, while the server is running. +# +# Basically when the fragmentation is over a certain level (see the +# configuration options below) Redis will start to create new copies of the +# values in contiguous memory regions by exploiting certain specific Jemalloc +# features (in order to understand if an allocation is causing fragmentation +# and to allocate it in a better place), and at the same time, will release the +# old copies of the data. This process, repeated incrementally for all the keys +# will cause the fragmentation to drop back to normal values. +# +# Important things to understand: +# +# 1. This feature is disabled by default, and only works if you compiled Redis +# to use the copy of Jemalloc we ship with the source code of Redis. +# This is the default with Linux builds. +# +# 2. You never need to enable this feature if you don't have fragmentation +# issues. +# +# 3. Once you experience fragmentation, you can enable this feature when +# needed with the command "CONFIG SET activedefrag yes". +# +# The configuration parameters are able to fine tune the behavior of the +# defragmentation process. If you are not sure about what they mean it is +# a good idea to leave the defaults untouched. + +# Enabled active defragmentation +# activedefrag yes + +# Minimum amount of fragmentation waste to start active defrag +# active-defrag-ignore-bytes 100mb + +# Minimum percentage of fragmentation to start active defrag +# active-defrag-threshold-lower 10 + +# Maximum percentage of fragmentation at which we use maximum effort +# active-defrag-threshold-upper 100 + +# Minimal effort for defrag in CPU percentage +# active-defrag-cycle-min 5 + +# Maximal effort for defrag in CPU percentage +# active-defrag-cycle-max 75 + +# Maximum number of set/hash/zset/list fields that will be processed from +# the main dictionary scan +# active-defrag-max-scan-fields 1000 diff --git a/diplomacy_research/containers/research/Singularity b/diplomacy_research/containers/research/Singularity new file mode 100644 index 0000000..0fe153b --- /dev/null +++ b/diplomacy_research/containers/research/Singularity @@ -0,0 +1,77 @@ +Bootstrap: localimage +From: /data/ubuntu-cuda10-20190226.sif + +%runscript +cd /data/diplomacy +mkdir -p /work_dir/redis + +# Moving default redis conf +if [ ! -f /work_dir/redis/redis.conf ]; then + cp /data/redis.conf /work_dir/redis/redis.conf +fi + +# Executing +exec "$@" + +%environment +export WORKING_DIR=/work_dir/diplomacy +export HOME="${HOME:-/work_dir}" +export CUDA_HOME=/usr/local/cuda +export CUDA_ROOT=$CUDA_HOME +export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib64 +export PATH=/data/env3.7/bin:$PATH +export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp +export PYTHONIOENCODING=utf-8 +export LANG=en_CA.UTF-8 +export PYTHONUNBUFFERED=1 + +%labels +AUTHOR pcpaquette@gmail.com + +%setup +cp /home/jenkins/.container/build_args $SINGULARITY_ROOTFS/root/build_args +cp /home/jenkins/.container/redis.conf ${SINGULARITY_ROOTFS}/redis.conf + +%post +# Creating directories +mkdir -p /scratch +mkdir -p /cvmfs +. /root/build_args + +# Cloning repo +mkdir -p /data +mkdir -p /work_dir/diplomacy +cd /data +mv /redis.conf /data/redis.conf +git clone "https://$GITHUB_TOKEN:x-oauth-basic@github.com/$REPO.git" diplomacy + +# Installing Anaconda - Python3.7 with dependencies +wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh +bash ./miniconda.sh -b -p /data/env3.7 +export PATH="/data/env3.7/bin:$PATH" +cd diplomacy +git checkout $COMMIT_ID +./diplomacy_research/scripts/build_proto.sh +./.jenkins/expand_vars.sh +pip install -r requirements.txt +pip install -r requirements_dev.txt +git checkout -- requirements.txt requirements_dev.txt +python -m compileall . + +# Installing TF Serving dummy +cd /data +wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/serving.zip -O serving.zip +unzip serving.zip +rm -f serving.zip + +# Removing Tensorflow and installing custom TensorFlow +if [ "${BRANCH:-master}" != "build_cpu" ]; then + pip uninstall -y tensorflow + cd /data + pip install /data/tensorflow*.whl +fi +chmod -R 777 /data +chmod -R 777 /work_dir + +# Deleting pip cache +rm -Rf /tmp/pip_build_root diff --git a/diplomacy_research/containers/research/redis.conf b/diplomacy_research/containers/research/redis.conf new file mode 100644 index 0000000..f184e35 --- /dev/null +++ b/diplomacy_research/containers/research/redis.conf @@ -0,0 +1,1378 @@ +# Redis configuration file example. +# +# Note that in order to read the configuration file, Redis must be +# started with the file path as first argument: +# +# ./redis-server /path/to/redis.conf + +# Note on units: when memory size is needed, it is possible to specify +# it in the usual form of 1k 5GB 4M and so forth: +# +# 1k => 1000 bytes +# 1kb => 1024 bytes +# 1m => 1000000 bytes +# 1mb => 1024*1024 bytes +# 1g => 1000000000 bytes +# 1gb => 1024*1024*1024 bytes +# +# units are case insensitive so 1GB 1Gb 1gB are all the same. + +################################## INCLUDES ################################### + +# Include one or more other config files here. This is useful if you +# have a standard template that goes to all Redis servers but also need +# to customize a few per-server settings. Include files can include +# other files, so use this wisely. +# +# Notice option "include" won't be rewritten by command "CONFIG REWRITE" +# from admin or Redis Sentinel. Since Redis always uses the last processed +# line as value of a configuration directive, you'd better put includes +# at the beginning of this file to avoid overwriting config change at runtime. +# +# If instead you are interested in using includes to override configuration +# options, it is better to use include as the last line. +# +# include /path/to/local.conf +# include /path/to/other.conf + +################################## MODULES ##################################### + +# Load modules at startup. If the server is not able to load modules +# it will abort. It is possible to use multiple loadmodule directives. +# +# loadmodule /path/to/my_module.so +# loadmodule /path/to/other_module.so + +################################## NETWORK ##################################### + +# By default, if no "bind" configuration directive is specified, Redis listens +# for connections from all the network interfaces available on the server. +# It is possible to listen to just one or multiple selected interfaces using +# the "bind" configuration directive, followed by one or more IP addresses. +# +# Examples: +# +# bind 192.168.1.100 10.0.0.1 +# bind 127.0.0.1 ::1 +# +# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the +# internet, binding to all the interfaces is dangerous and will expose the +# instance to everybody on the internet. So by default we uncomment the +# following bind directive, that will force Redis to listen only into +# the IPv4 loopback interface address (this means Redis will be able to +# accept connections only from clients running into the same computer it +# is running). +# +# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES +# JUST COMMENT THE FOLLOWING LINE. +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# bind 127.0.0.1 + +# Protected mode is a layer of security protection, in order to avoid that +# Redis instances left open on the internet are accessed and exploited. +# +# When protected mode is on and if: +# +# 1) The server is not binding explicitly to a set of addresses using the +# "bind" directive. +# 2) No password is configured. +# +# The server only accepts connections from clients connecting from the +# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain +# sockets. +# +# By default protected mode is enabled. You should disable it only if +# you are sure you want clients from other hosts to connect to Redis +# even if no authentication is configured, nor a specific set of interfaces +# are explicitly listed using the "bind" directive. +protected-mode no + +# Accept connections on the specified port, default is 6379 (IANA #815344). +# If port 0 is specified Redis will not listen on a TCP socket. +port 6379 + +# TCP listen() backlog. +# +# In high requests-per-second environments you need an high backlog in order +# to avoid slow clients connections issues. Note that the Linux kernel +# will silently truncate it to the value of /proc/sys/net/core/somaxconn so +# make sure to raise both the value of somaxconn and tcp_max_syn_backlog +# in order to get the desired effect. +tcp-backlog 511 + +# Unix socket. +# +# Specify the path for the Unix socket that will be used to listen for +# incoming connections. There is no default, so Redis will not listen +# on a unix socket when not specified. +# +# unixsocket /tmp/redis.sock +# unixsocketperm 700 + +# Close the connection after a client is idle for N seconds (0 to disable) +timeout 0 + +# TCP keepalive. +# +# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence +# of communication. This is useful for two reasons: +# +# 1) Detect dead peers. +# 2) Take the connection alive from the point of view of network +# equipment in the middle. +# +# On Linux, the specified value (in seconds) is the period used to send ACKs. +# Note that to close the connection the double of the time is needed. +# On other kernels the period depends on the kernel configuration. +# +# A reasonable value for this option is 300 seconds, which is the new +# Redis default starting with Redis 3.2.1. +tcp-keepalive 300 + +################################# GENERAL ##################################### + +# By default Redis does not run as a daemon. Use 'yes' if you need it. +# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. +daemonize no + +# If you run Redis from upstart or systemd, Redis can interact with your +# supervision tree. Options: +# supervised no - no supervision interaction +# supervised upstart - signal upstart by putting Redis into SIGSTOP mode +# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET +# supervised auto - detect upstart or systemd method based on +# UPSTART_JOB or NOTIFY_SOCKET environment variables +# Note: these supervision methods only signal "process is ready." +# They do not enable continuous liveness pings back to your supervisor. +supervised no + +# If a pid file is specified, Redis writes it where specified at startup +# and removes it at exit. +# +# When the server runs non daemonized, no pid file is created if none is +# specified in the configuration. When the server is daemonized, the pid file +# is used even if not specified, defaulting to "/var/run/redis.pid". +# +# Creating a pid file is best effort: if Redis is not able to create it +# nothing bad happens, the server will start and run normally. +pidfile /var/run/redis_6379.pid + +# Specify the server verbosity level. +# This can be one of: +# debug (a lot of information, useful for development/testing) +# verbose (many rarely useful info, but not a mess like the debug level) +# notice (moderately verbose, what you want in production probably) +# warning (only very important / critical messages are logged) +loglevel notice + +# Specify the log file name. Also the empty string can be used to force +# Redis to log on the standard output. Note that if you use standard +# output for logging but daemonize, logs will be sent to /dev/null +logfile "" + +# To enable logging to the system logger, just set 'syslog-enabled' to yes, +# and optionally update the other syslog parameters to suit your needs. +# syslog-enabled no + +# Specify the syslog identity. +# syslog-ident redis + +# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. +# syslog-facility local0 + +# Set the number of databases. The default database is DB 0, you can select +# a different one on a per-connection basis using SELECT where +# dbid is a number between 0 and 'databases'-1 +databases 16 + +# By default Redis shows an ASCII art logo only when started to log to the +# standard output and if the standard output is a TTY. Basically this means +# that normally a logo is displayed only in interactive sessions. +# +# However it is possible to force the pre-4.0 behavior and always show a +# ASCII art logo in startup logs by setting the following option to yes. +always-show-logo yes + +################################ SNAPSHOTTING ################################ +# +# Save the DB on disk: +# +# save +# +# Will save the DB if both the given number of seconds and the given +# number of write operations against the DB occurred. +# +# In the example below the behaviour will be to save: +# after 900 sec (15 min) if at least 1 key changed +# after 300 sec (5 min) if at least 10 keys changed +# after 60 sec if at least 10000 keys changed +# +# Note: you can disable saving completely by commenting out all "save" lines. +# +# It is also possible to remove all the previously configured save +# points by adding a save directive with a single empty string argument +# like in the following example: +# +# save "" + +save 900 1 +save 300 10 +save 60 10000 + +# By default Redis will stop accepting writes if RDB snapshots are enabled +# (at least one save point) and the latest background save failed. +# This will make the user aware (in a hard way) that data is not persisting +# on disk properly, otherwise chances are that no one will notice and some +# disaster will happen. +# +# If the background saving process will start working again Redis will +# automatically allow writes again. +# +# However if you have setup your proper monitoring of the Redis server +# and persistence, you may want to disable this feature so that Redis will +# continue to work as usual even if there are problems with disk, +# permissions, and so forth. +stop-writes-on-bgsave-error yes + +# Compress string objects using LZF when dump .rdb databases? +# For default that's set to 'yes' as it's almost always a win. +# If you want to save some CPU in the saving child set it to 'no' but +# the dataset will likely be bigger if you have compressible values or keys. +rdbcompression yes + +# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. +# This makes the format more resistant to corruption but there is a performance +# hit to pay (around 10%) when saving and loading RDB files, so you can disable it +# for maximum performances. +# +# RDB files created with checksum disabled have a checksum of zero that will +# tell the loading code to skip the check. +rdbchecksum yes + +# The filename where to dump the DB +dbfilename saved_redis.rdb + +# The working directory. +# +# The DB will be written inside this directory, with the filename specified +# above using the 'dbfilename' configuration directive. +# +# The Append Only File will also be created inside this directory. +# +# Note that you must specify a directory here, not a file name. +dir /work_dir/redis + +################################# REPLICATION ################################# + +# Master-Replica replication. Use replicaof to make a Redis instance a copy of +# another Redis server. A few things to understand ASAP about Redis replication. +# +# +------------------+ +---------------+ +# | Master | ---> | Replica | +# | (receive writes) | | (exact copy) | +# +------------------+ +---------------+ +# +# 1) Redis replication is asynchronous, but you can configure a master to +# stop accepting writes if it appears to be not connected with at least +# a given number of replicas. +# 2) Redis replicas are able to perform a partial resynchronization with the +# master if the replication link is lost for a relatively small amount of +# time. You may want to configure the replication backlog size (see the next +# sections of this file) with a sensible value depending on your needs. +# 3) Replication is automatic and does not need user intervention. After a +# network partition replicas automatically try to reconnect to masters +# and resynchronize with them. +# +# replicaof + +# If the master is password protected (using the "requirepass" configuration +# directive below) it is possible to tell the replica to authenticate before +# starting the replication synchronization process, otherwise the master will +# refuse the replica request. +# +# masterauth + +# When a replica loses its connection with the master, or when the replication +# is still in progress, the replica can act in two different ways: +# +# 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will +# still reply to client requests, possibly with out of date data, or the +# data set may just be empty if this is the first synchronization. +# +# 2) if replica-serve-stale-data is set to 'no' the replica will reply with +# an error "SYNC with master in progress" to all the kind of commands +# but to INFO, replicaOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG, +# SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, +# COMMAND, POST, HOST: and LATENCY. +# +replica-serve-stale-data yes + +# You can configure a replica instance to accept writes or not. Writing against +# a replica instance may be useful to store some ephemeral data (because data +# written on a replica will be easily deleted after resync with the master) but +# may also cause problems if clients are writing to it because of a +# misconfiguration. +# +# Since Redis 2.6 by default replicas are read-only. +# +# Note: read only replicas are not designed to be exposed to untrusted clients +# on the internet. It's just a protection layer against misuse of the instance. +# Still a read only replica exports by default all the administrative commands +# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve +# security of read only replicas using 'rename-command' to shadow all the +# administrative / dangerous commands. +replica-read-only yes + +# Replication SYNC strategy: disk or socket. +# +# ------------------------------------------------------- +# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY +# ------------------------------------------------------- +# +# New replicas and reconnecting replicas that are not able to continue the replication +# process just receiving differences, need to do what is called a "full +# synchronization". An RDB file is transmitted from the master to the replicas. +# The transmission can happen in two different ways: +# +# 1) Disk-backed: The Redis master creates a new process that writes the RDB +# file on disk. Later the file is transferred by the parent +# process to the replicas incrementally. +# 2) Diskless: The Redis master creates a new process that directly writes the +# RDB file to replica sockets, without touching the disk at all. +# +# With disk-backed replication, while the RDB file is generated, more replicas +# can be queued and served with the RDB file as soon as the current child producing +# the RDB file finishes its work. With diskless replication instead once +# the transfer starts, new replicas arriving will be queued and a new transfer +# will start when the current one terminates. +# +# When diskless replication is used, the master waits a configurable amount of +# time (in seconds) before starting the transfer in the hope that multiple replicas +# will arrive and the transfer can be parallelized. +# +# With slow disks and fast (large bandwidth) networks, diskless replication +# works better. +repl-diskless-sync no + +# When diskless replication is enabled, it is possible to configure the delay +# the server waits in order to spawn the child that transfers the RDB via socket +# to the replicas. +# +# This is important since once the transfer starts, it is not possible to serve +# new replicas arriving, that will be queued for the next RDB transfer, so the server +# waits a delay in order to let more replicas arrive. +# +# The delay is specified in seconds, and by default is 5 seconds. To disable +# it entirely just set it to 0 seconds and the transfer will start ASAP. +repl-diskless-sync-delay 5 + +# Replicas send PINGs to server in a predefined interval. It's possible to change +# this interval with the repl_ping_replica_period option. The default value is 10 +# seconds. +# +# repl-ping-replica-period 10 + +# The following option sets the replication timeout for: +# +# 1) Bulk transfer I/O during SYNC, from the point of view of replica. +# 2) Master timeout from the point of view of replicas (data, pings). +# 3) Replica timeout from the point of view of masters (REPLCONF ACK pings). +# +# It is important to make sure that this value is greater than the value +# specified for repl-ping-replica-period otherwise a timeout will be detected +# every time there is low traffic between the master and the replica. +# +# repl-timeout 60 + +# Disable TCP_NODELAY on the replica socket after SYNC? +# +# If you select "yes" Redis will use a smaller number of TCP packets and +# less bandwidth to send data to replicas. But this can add a delay for +# the data to appear on the replica side, up to 40 milliseconds with +# Linux kernels using a default configuration. +# +# If you select "no" the delay for data to appear on the replica side will +# be reduced but more bandwidth will be used for replication. +# +# By default we optimize for low latency, but in very high traffic conditions +# or when the master and replicas are many hops away, turning this to "yes" may +# be a good idea. +repl-disable-tcp-nodelay no + +# Set the replication backlog size. The backlog is a buffer that accumulates +# replica data when replicas are disconnected for some time, so that when a replica +# wants to reconnect again, often a full resync is not needed, but a partial +# resync is enough, just passing the portion of data the replica missed while +# disconnected. +# +# The bigger the replication backlog, the longer the time the replica can be +# disconnected and later be able to perform a partial resynchronization. +# +# The backlog is only allocated once there is at least a replica connected. +# +# repl-backlog-size 1mb + +# After a master has no longer connected replicas for some time, the backlog +# will be freed. The following option configures the amount of seconds that +# need to elapse, starting from the time the last replica disconnected, for +# the backlog buffer to be freed. +# +# Note that replicas never free the backlog for timeout, since they may be +# promoted to masters later, and should be able to correctly "partially +# resynchronize" with the replicas: hence they should always accumulate backlog. +# +# A value of 0 means to never release the backlog. +# +# repl-backlog-ttl 3600 + +# The replica priority is an integer number published by Redis in the INFO output. +# It is used by Redis Sentinel in order to select a replica to promote into a +# master if the master is no longer working correctly. +# +# A replica with a low priority number is considered better for promotion, so +# for instance if there are three replicas with priority 10, 100, 25 Sentinel will +# pick the one with priority 10, that is the lowest. +# +# However a special priority of 0 marks the replica as not able to perform the +# role of master, so a replica with priority of 0 will never be selected by +# Redis Sentinel for promotion. +# +# By default the priority is 100. +replica-priority 100 + +# It is possible for a master to stop accepting writes if there are less than +# N replicas connected, having a lag less or equal than M seconds. +# +# The N replicas need to be in "online" state. +# +# The lag in seconds, that must be <= the specified value, is calculated from +# the last ping received from the replica, that is usually sent every second. +# +# This option does not GUARANTEE that N replicas will accept the write, but +# will limit the window of exposure for lost writes in case not enough replicas +# are available, to the specified number of seconds. +# +# For example to require at least 3 replicas with a lag <= 10 seconds use: +# +# min-replicas-to-write 3 +# min-replicas-max-lag 10 +# +# Setting one or the other to 0 disables the feature. +# +# By default min-replicas-to-write is set to 0 (feature disabled) and +# min-replicas-max-lag is set to 10. + +# A Redis master is able to list the address and port of the attached +# replicas in different ways. For example the "INFO replication" section +# offers this information, which is used, among other tools, by +# Redis Sentinel in order to discover replica instances. +# Another place where this info is available is in the output of the +# "ROLE" command of a master. +# +# The listed IP and address normally reported by a replica is obtained +# in the following way: +# +# IP: The address is auto detected by checking the peer address +# of the socket used by the replica to connect with the master. +# +# Port: The port is communicated by the replica during the replication +# handshake, and is normally the port that the replica is using to +# listen for connections. +# +# However when port forwarding or Network Address Translation (NAT) is +# used, the replica may be actually reachable via different IP and port +# pairs. The following two options can be used by a replica in order to +# report to its master a specific set of IP and port, so that both INFO +# and ROLE will report those values. +# +# There is no need to use both the options if you need to override just +# the port or the IP address. +# +# replica-announce-ip 5.5.5.5 +# replica-announce-port 1234 + +################################## SECURITY ################################### + +# Require clients to issue AUTH before processing any other +# commands. This might be useful in environments in which you do not trust +# others with access to the host running redis-server. +# +# This should stay commented out for backward compatibility and because most +# people do not need auth (e.g. they run their own servers). +# +# Warning: since Redis is pretty fast an outside user can try up to +# 150k passwords per second against a good box. This means that you should +# use a very strong password otherwise it will be very easy to break. +# +# requirepass foobared + +# Command renaming. +# +# It is possible to change the name of dangerous commands in a shared +# environment. For instance the CONFIG command may be renamed into something +# hard to guess so that it will still be available for internal-use tools +# but not available for general clients. +# +# Example: +# +# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 +# +# It is also possible to completely kill a command by renaming it into +# an empty string: +# +# rename-command CONFIG "" +# +# Please note that changing the name of commands that are logged into the +# AOF file or transmitted to replicas may cause problems. + +################################### CLIENTS #################################### + +# Set the max number of connected clients at the same time. By default +# this limit is set to 10000 clients, however if the Redis server is not +# able to configure the process file limit to allow for the specified limit +# the max number of allowed clients is set to the current file limit +# minus 32 (as Redis reserves a few file descriptors for internal uses). +# +# Once the limit is reached Redis will close all the new connections sending +# an error 'max number of clients reached'. +# +maxclients 10000 + +############################## MEMORY MANAGEMENT ################################ + +# Set a memory usage limit to the specified amount of bytes. +# When the memory limit is reached Redis will try to remove keys +# according to the eviction policy selected (see maxmemory-policy). +# +# If Redis can't remove keys according to the policy, or if the policy is +# set to 'noeviction', Redis will start to reply with errors to commands +# that would use more memory, like SET, LPUSH, and so on, and will continue +# to reply to read-only commands like GET. +# +# This option is usually useful when using Redis as an LRU or LFU cache, or to +# set a hard memory limit for an instance (using the 'noeviction' policy). +# +# WARNING: If you have replicas attached to an instance with maxmemory on, +# the size of the output buffers needed to feed the replicas are subtracted +# from the used memory count, so that network problems / resyncs will +# not trigger a loop where keys are evicted, and in turn the output +# buffer of replicas is full with DELs of keys evicted triggering the deletion +# of more keys, and so forth until the database is completely emptied. +# +# In short... if you have replicas attached it is suggested that you set a lower +# limit for maxmemory so that there is some free RAM on the system for replica +# output buffers (but this is not needed if the policy is 'noeviction'). +# +maxmemory 100gb + +# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory +# is reached. You can select among five behaviors: +# +# volatile-lru -> Evict using approximated LRU among the keys with an expire set. +# allkeys-lru -> Evict any key using approximated LRU. +# volatile-lfu -> Evict using approximated LFU among the keys with an expire set. +# allkeys-lfu -> Evict any key using approximated LFU. +# volatile-random -> Remove a random key among the ones with an expire set. +# allkeys-random -> Remove a random key, any key. +# volatile-ttl -> Remove the key with the nearest expire time (minor TTL) +# noeviction -> Don't evict anything, just return an error on write operations. +# +# LRU means Least Recently Used +# LFU means Least Frequently Used +# +# Both LRU, LFU and volatile-ttl are implemented using approximated +# randomized algorithms. +# +# Note: with any of the above policies, Redis will return an error on write +# operations, when there are no suitable keys for eviction. +# +# At the date of writing these commands are: set setnx setex append +# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd +# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby +# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby +# getset mset msetnx exec sort +# +# The default is: +# +# maxmemory-policy noeviction +maxmemory-policy volatile-lru + +# LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated +# algorithms (in order to save memory), so you can tune it for speed or +# accuracy. For default Redis will check five keys and pick the one that was +# used less recently, you can change the sample size using the following +# configuration directive. +# +# The default of 5 produces good enough results. 10 Approximates very closely +# true LRU but costs more CPU. 3 is faster but not very accurate. +# +maxmemory-samples 5 + +# Starting from Redis 5, by default a replica will ignore its maxmemory setting +# (unless it is promoted to master after a failover or manually). It means +# that the eviction of keys will be just handled by the master, sending the +# DEL commands to the replica as keys evict in the master side. +# +# This behavior ensures that masters and replicas stay consistent, and is usually +# what you want, however if your replica is writable, or you want the replica to have +# a different memory setting, and you are sure all the writes performed to the +# replica are idempotent, then you may change this default (but be sure to understand +# what you are doing). +# +# Note that since the replica by default does not evict, it may end using more +# memory than the one set via maxmemory (there are certain buffers that may +# be larger on the replica, or data structures may sometimes take more memory and so +# forth). So make sure you monitor your replicas and make sure they have enough +# memory to never hit a real out-of-memory condition before the master hits +# the configured maxmemory setting. +# +# replica-ignore-maxmemory yes + +############################# LAZY FREEING #################################### + +# Redis has two primitives to delete keys. One is called DEL and is a blocking +# deletion of the object. It means that the server stops processing new commands +# in order to reclaim all the memory associated with an object in a synchronous +# way. If the key deleted is associated with a small object, the time needed +# in order to execute the DEL command is very small and comparable to most other +# O(1) or O(log_N) commands in Redis. However if the key is associated with an +# aggregated value containing millions of elements, the server can block for +# a long time (even seconds) in order to complete the operation. +# +# For the above reasons Redis also offers non blocking deletion primitives +# such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and +# FLUSHDB commands, in order to reclaim memory in background. Those commands +# are executed in constant time. Another thread will incrementally free the +# object in the background as fast as possible. +# +# DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled. +# It's up to the design of the application to understand when it is a good +# idea to use one or the other. However the Redis server sometimes has to +# delete keys or flush the whole database as a side effect of other operations. +# Specifically Redis deletes objects independently of a user call in the +# following scenarios: +# +# 1) On eviction, because of the maxmemory and maxmemory policy configurations, +# in order to make room for new data, without going over the specified +# memory limit. +# 2) Because of expire: when a key with an associated time to live (see the +# EXPIRE command) must be deleted from memory. +# 3) Because of a side effect of a command that stores data on a key that may +# already exist. For example the RENAME command may delete the old key +# content when it is replaced with another one. Similarly SUNIONSTORE +# or SORT with STORE option may delete existing keys. The SET command +# itself removes any old content of the specified key in order to replace +# it with the specified string. +# 4) During replication, when a replica performs a full resynchronization with +# its master, the content of the whole database is removed in order to +# load the RDB file just transferred. +# +# In all the above cases the default is to delete objects in a blocking way, +# like if DEL was called. However you can configure each case specifically +# in order to instead release memory in a non-blocking way like if UNLINK +# was called, using the following configuration directives: + +lazyfree-lazy-eviction no +lazyfree-lazy-expire no +lazyfree-lazy-server-del no +replica-lazy-flush no + +############################## APPEND ONLY MODE ############################### + +# By default Redis asynchronously dumps the dataset on disk. This mode is +# good enough in many applications, but an issue with the Redis process or +# a power outage may result into a few minutes of writes lost (depending on +# the configured save points). +# +# The Append Only File is an alternative persistence mode that provides +# much better durability. For instance using the default data fsync policy +# (see later in the config file) Redis can lose just one second of writes in a +# dramatic event like a server power outage, or a single write if something +# wrong with the Redis process itself happens, but the operating system is +# still running correctly. +# +# AOF and RDB persistence can be enabled at the same time without problems. +# If the AOF is enabled on startup Redis will load the AOF, that is the file +# with the better durability guarantees. +# +# Please check http://redis.io/topics/persistence for more information. + +appendonly yes + +# The name of the append only file (default: "appendonly.aof") + +appendfilename "saved_redis.aof" + +# The fsync() call tells the Operating System to actually write data on disk +# instead of waiting for more data in the output buffer. Some OS will really flush +# data on disk, some other OS will just try to do it ASAP. +# +# Redis supports three different modes: +# +# no: don't fsync, just let the OS flush the data when it wants. Faster. +# always: fsync after every write to the append only log. Slow, Safest. +# everysec: fsync only one time every second. Compromise. +# +# The default is "everysec", as that's usually the right compromise between +# speed and data safety. It's up to you to understand if you can relax this to +# "no" that will let the operating system flush the output buffer when +# it wants, for better performances (but if you can live with the idea of +# some data loss consider the default persistence mode that's snapshotting), +# or on the contrary, use "always" that's very slow but a bit safer than +# everysec. +# +# More details please check the following article: +# http://antirez.com/post/redis-persistence-demystified.html +# +# If unsure, use "everysec". + +# appendfsync always +appendfsync everysec +# appendfsync no + +# When the AOF fsync policy is set to always or everysec, and a background +# saving process (a background save or AOF log background rewriting) is +# performing a lot of I/O against the disk, in some Linux configurations +# Redis may block too long on the fsync() call. Note that there is no fix for +# this currently, as even performing fsync in a different thread will block +# our synchronous write(2) call. +# +# In order to mitigate this problem it's possible to use the following option +# that will prevent fsync() from being called in the main process while a +# BGSAVE or BGREWRITEAOF is in progress. +# +# This means that while another child is saving, the durability of Redis is +# the same as "appendfsync none". In practical terms, this means that it is +# possible to lose up to 30 seconds of log in the worst scenario (with the +# default Linux settings). +# +# If you have latency problems turn this to "yes". Otherwise leave it as +# "no" that is the safest pick from the point of view of durability. + +no-appendfsync-on-rewrite no + +# Automatic rewrite of the append only file. +# Redis is able to automatically rewrite the log file implicitly calling +# BGREWRITEAOF when the AOF log size grows by the specified percentage. +# +# This is how it works: Redis remembers the size of the AOF file after the +# latest rewrite (if no rewrite has happened since the restart, the size of +# the AOF at startup is used). +# +# This base size is compared to the current size. If the current size is +# bigger than the specified percentage, the rewrite is triggered. Also +# you need to specify a minimal size for the AOF file to be rewritten, this +# is useful to avoid rewriting the AOF file even if the percentage increase +# is reached but it is still pretty small. +# +# Specify a percentage of zero in order to disable the automatic AOF +# rewrite feature. + +auto-aof-rewrite-percentage 100 +auto-aof-rewrite-min-size 64mb + +# An AOF file may be found to be truncated at the end during the Redis +# startup process, when the AOF data gets loaded back into memory. +# This may happen when the system where Redis is running +# crashes, especially when an ext4 filesystem is mounted without the +# data=ordered option (however this can't happen when Redis itself +# crashes or aborts but the operating system still works correctly). +# +# Redis can either exit with an error when this happens, or load as much +# data as possible (the default now) and start if the AOF file is found +# to be truncated at the end. The following option controls this behavior. +# +# If aof-load-truncated is set to yes, a truncated AOF file is loaded and +# the Redis server starts emitting a log to inform the user of the event. +# Otherwise if the option is set to no, the server aborts with an error +# and refuses to start. When the option is set to no, the user requires +# to fix the AOF file using the "redis-check-aof" utility before to restart +# the server. +# +# Note that if the AOF file will be found to be corrupted in the middle +# the server will still exit with an error. This option only applies when +# Redis will try to read more data from the AOF file but not enough bytes +# will be found. +aof-load-truncated yes + +# When rewriting the AOF file, Redis is able to use an RDB preamble in the +# AOF file for faster rewrites and recoveries. When this option is turned +# on the rewritten AOF file is composed of two different stanzas: +# +# [RDB file][AOF tail] +# +# When loading Redis recognizes that the AOF file starts with the "REDIS" +# string and loads the prefixed RDB file, and continues loading the AOF +# tail. +aof-use-rdb-preamble yes + +################################ LUA SCRIPTING ############################### + +# Max execution time of a Lua script in milliseconds. +# +# If the maximum execution time is reached Redis will log that a script is +# still in execution after the maximum allowed time and will start to +# reply to queries with an error. +# +# When a long running script exceeds the maximum execution time only the +# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be +# used to stop a script that did not yet called write commands. The second +# is the only way to shut down the server in the case a write command was +# already issued by the script but the user doesn't want to wait for the natural +# termination of the script. +# +# Set it to 0 or a negative value for unlimited execution without warnings. +lua-time-limit 5000 + +################################ REDIS CLUSTER ############################### +# +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however +# in order to mark it as "mature" we need to wait for a non trivial percentage +# of users to deploy it in production. +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# +# Normal Redis instances can't be part of a Redis Cluster; only nodes that are +# started as cluster nodes can. In order to start a Redis instance as a +# cluster node enable the cluster support uncommenting the following: +# +# cluster-enabled yes + +# Every cluster node has a cluster configuration file. This file is not +# intended to be edited by hand. It is created and updated by Redis nodes. +# Every Redis Cluster node requires a different cluster configuration file. +# Make sure that instances running in the same system do not have +# overlapping cluster configuration file names. +# +# cluster-config-file nodes-6379.conf + +# Cluster node timeout is the amount of milliseconds a node must be unreachable +# for it to be considered in failure state. +# Most other internal time limits are multiple of the node timeout. +# +# cluster-node-timeout 15000 + +# A replica of a failing master will avoid to start a failover if its data +# looks too old. +# +# There is no simple way for a replica to actually have an exact measure of +# its "data age", so the following two checks are performed: +# +# 1) If there are multiple replicas able to failover, they exchange messages +# in order to try to give an advantage to the replica with the best +# replication offset (more data from the master processed). +# Replicas will try to get their rank by offset, and apply to the start +# of the failover a delay proportional to their rank. +# +# 2) Every single replica computes the time of the last interaction with +# its master. This can be the last ping or command received (if the master +# is still in the "connected" state), or the time that elapsed since the +# disconnection with the master (if the replication link is currently down). +# If the last interaction is too old, the replica will not try to failover +# at all. +# +# The point "2" can be tuned by user. Specifically a replica will not perform +# the failover if, since the last interaction with the master, the time +# elapsed is greater than: +# +# (node-timeout * replica-validity-factor) + repl-ping-replica-period +# +# So for example if node-timeout is 30 seconds, and the replica-validity-factor +# is 10, and assuming a default repl-ping-replica-period of 10 seconds, the +# replica will not try to failover if it was not able to talk with the master +# for longer than 310 seconds. +# +# A large replica-validity-factor may allow replicas with too old data to failover +# a master, while a too small value may prevent the cluster from being able to +# elect a replica at all. +# +# For maximum availability, it is possible to set the replica-validity-factor +# to a value of 0, which means, that replicas will always try to failover the +# master regardless of the last time they interacted with the master. +# (However they'll always try to apply a delay proportional to their +# offset rank). +# +# Zero is the only value able to guarantee that when all the partitions heal +# the cluster will always be able to continue. +# +# cluster-replica-validity-factor 10 + +# Cluster replicas are able to migrate to orphaned masters, that are masters +# that are left without working replicas. This improves the cluster ability +# to resist to failures as otherwise an orphaned master can't be failed over +# in case of failure if it has no working replicas. +# +# Replicas migrate to orphaned masters only if there are still at least a +# given number of other working replicas for their old master. This number +# is the "migration barrier". A migration barrier of 1 means that a replica +# will migrate only if there is at least 1 other working replica for its master +# and so forth. It usually reflects the number of replicas you want for every +# master in your cluster. +# +# Default is 1 (replicas migrate only if their masters remain with at least +# one replica). To disable migration just set it to a very large value. +# A value of 0 can be set but is useful only for debugging and dangerous +# in production. +# +# cluster-migration-barrier 1 + +# By default Redis Cluster nodes stop accepting queries if they detect there +# is at least an hash slot uncovered (no available node is serving it). +# This way if the cluster is partially down (for example a range of hash slots +# are no longer covered) all the cluster becomes, eventually, unavailable. +# It automatically returns available as soon as all the slots are covered again. +# +# However sometimes you want the subset of the cluster which is working, +# to continue to accept queries for the part of the key space that is still +# covered. In order to do so, just set the cluster-require-full-coverage +# option to no. +# +# cluster-require-full-coverage yes + +# This option, when set to yes, prevents replicas from trying to failover its +# master during master failures. However the master can still perform a +# manual failover, if forced to do so. +# +# This is useful in different scenarios, especially in the case of multiple +# data center operations, where we want one side to never be promoted if not +# in the case of a total DC failure. +# +# cluster-replica-no-failover no + +# In order to setup your cluster make sure to read the documentation +# available at http://redis.io web site. + +########################## CLUSTER DOCKER/NAT support ######################## + +# In certain deployments, Redis Cluster nodes address discovery fails, because +# addresses are NAT-ted or because ports are forwarded (the typical case is +# Docker and other containers). +# +# In order to make Redis Cluster working in such environments, a static +# configuration where each node knows its public address is needed. The +# following two options are used for this scope, and are: +# +# * cluster-announce-ip +# * cluster-announce-port +# * cluster-announce-bus-port +# +# Each instruct the node about its address, client port, and cluster message +# bus port. The information is then published in the header of the bus packets +# so that other nodes will be able to correctly map the address of the node +# publishing the information. +# +# If the above options are not used, the normal Redis Cluster auto-detection +# will be used instead. +# +# Note that when remapped, the bus port may not be at the fixed offset of +# clients port + 10000, so you can specify any port and bus-port depending +# on how they get remapped. If the bus-port is not set, a fixed offset of +# 10000 will be used as usually. +# +# Example: +# +# cluster-announce-ip 10.1.1.5 +# cluster-announce-port 6379 +# cluster-announce-bus-port 6380 + +################################## SLOW LOG ################################### + +# The Redis Slow Log is a system to log queries that exceeded a specified +# execution time. The execution time does not include the I/O operations +# like talking with the client, sending the reply and so forth, +# but just the time needed to actually execute the command (this is the only +# stage of command execution where the thread is blocked and can not serve +# other requests in the meantime). +# +# You can configure the slow log with two parameters: one tells Redis +# what is the execution time, in microseconds, to exceed in order for the +# command to get logged, and the other parameter is the length of the +# slow log. When a new command is logged the oldest one is removed from the +# queue of logged commands. + +# The following time is expressed in microseconds, so 1000000 is equivalent +# to one second. Note that a negative number disables the slow log, while +# a value of zero forces the logging of every command. +slowlog-log-slower-than 10000 + +# There is no limit to this length. Just be aware that it will consume memory. +# You can reclaim memory used by the slow log with SLOWLOG RESET. +slowlog-max-len 128 + +################################ LATENCY MONITOR ############################## + +# The Redis latency monitoring subsystem samples different operations +# at runtime in order to collect data related to possible sources of +# latency of a Redis instance. +# +# Via the LATENCY command this information is available to the user that can +# print graphs and obtain reports. +# +# The system only logs operations that were performed in a time equal or +# greater than the amount of milliseconds specified via the +# latency-monitor-threshold configuration directive. When its value is set +# to zero, the latency monitor is turned off. +# +# By default latency monitoring is disabled since it is mostly not needed +# if you don't have latency issues, and collecting data has a performance +# impact, that while very small, can be measured under big load. Latency +# monitoring can easily be enabled at runtime using the command +# "CONFIG SET latency-monitor-threshold " if needed. +latency-monitor-threshold 0 + +############################# EVENT NOTIFICATION ############################## + +# Redis can notify Pub/Sub clients about events happening in the key space. +# This feature is documented at http://redis.io/topics/notifications +# +# For instance if keyspace events notification is enabled, and a client +# performs a DEL operation on key "foo" stored in the Database 0, two +# messages will be published via Pub/Sub: +# +# PUBLISH __keyspace@0__:foo del +# PUBLISH __keyevent@0__:del foo +# +# It is possible to select the events that Redis will notify among a set +# of classes. Every class is identified by a single character: +# +# K Keyspace events, published with __keyspace@__ prefix. +# E Keyevent events, published with __keyevent@__ prefix. +# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... +# $ String commands +# l List commands +# s Set commands +# h Hash commands +# z Sorted set commands +# x Expired events (events generated every time a key expires) +# e Evicted events (events generated when a key is evicted for maxmemory) +# A Alias for g$lshzxe, so that the "AKE" string means all the events. +# +# The "notify-keyspace-events" takes as argument a string that is composed +# of zero or multiple characters. The empty string means that notifications +# are disabled. +# +# Example: to enable list and generic events, from the point of view of the +# event name, use: +# +# notify-keyspace-events Elg +# +# Example 2: to get the stream of the expired keys subscribing to channel +# name __keyevent@0__:expired use: +# +# notify-keyspace-events Ex +# +# By default all notifications are disabled because most users don't need +# this feature and the feature has some overhead. Note that if you don't +# specify at least one of K or E, no events will be delivered. +notify-keyspace-events "" + +############################### ADVANCED CONFIG ############################### + +# Hashes are encoded using a memory efficient data structure when they have a +# small number of entries, and the biggest entry does not exceed a given +# threshold. These thresholds can be configured using the following directives. +hash-max-ziplist-entries 512 +hash-max-ziplist-value 64 + +# Lists are also encoded in a special way to save a lot of space. +# The number of entries allowed per internal list node can be specified +# as a fixed maximum size or a maximum number of elements. +# For a fixed maximum size, use -5 through -1, meaning: +# -5: max size: 64 Kb <-- not recommended for normal workloads +# -4: max size: 32 Kb <-- not recommended +# -3: max size: 16 Kb <-- probably not recommended +# -2: max size: 8 Kb <-- good +# -1: max size: 4 Kb <-- good +# Positive numbers mean store up to _exactly_ that number of elements +# per list node. +# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), +# but if your use case is unique, adjust the settings as necessary. +list-max-ziplist-size -2 + +# Lists may also be compressed. +# Compress depth is the number of quicklist ziplist nodes from *each* side of +# the list to *exclude* from compression. The head and tail of the list +# are always uncompressed for fast push/pop operations. Settings are: +# 0: disable all list compression +# 1: depth 1 means "don't start compressing until after 1 node into the list, +# going from either the head or tail" +# So: [head]->node->node->...->node->[tail] +# [head], [tail] will always be uncompressed; inner nodes will compress. +# 2: [head]->[next]->node->node->...->node->[prev]->[tail] +# 2 here means: don't compress head or head->next or tail->prev or tail, +# but compress all nodes between them. +# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] +# etc. +list-compress-depth 0 + +# Sets have a special encoding in just one case: when a set is composed +# of just strings that happen to be integers in radix 10 in the range +# of 64 bit signed integers. +# The following configuration setting sets the limit in the size of the +# set in order to use this special memory saving encoding. +set-max-intset-entries 512 + +# Similarly to hashes and lists, sorted sets are also specially encoded in +# order to save a lot of space. This encoding is only used when the length and +# elements of a sorted set are below the following limits: +zset-max-ziplist-entries 128 +zset-max-ziplist-value 64 + +# HyperLogLog sparse representation bytes limit. The limit includes the +# 16 bytes header. When an HyperLogLog using the sparse representation crosses +# this limit, it is converted into the dense representation. +# +# A value greater than 16000 is totally useless, since at that point the +# dense representation is more memory efficient. +# +# The suggested value is ~ 3000 in order to have the benefits of +# the space efficient encoding without slowing down too much PFADD, +# which is O(N) with the sparse encoding. The value can be raised to +# ~ 10000 when CPU is not a concern, but space is, and the data set is +# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. +hll-sparse-max-bytes 3000 + +# Streams macro node max size / items. The stream data structure is a radix +# tree of big nodes that encode multiple items inside. Using this configuration +# it is possible to configure how big a single node can be in bytes, and the +# maximum number of items it may contain before switching to a new node when +# appending new stream entries. If any of the following settings are set to +# zero, the limit is ignored, so for instance it is possible to set just a +# max entires limit by setting max-bytes to 0 and max-entries to the desired +# value. +stream-node-max-bytes 4096 +stream-node-max-entries 100 + +# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in +# order to help rehashing the main Redis hash table (the one mapping top-level +# keys to values). The hash table implementation Redis uses (see dict.c) +# performs a lazy rehashing: the more operation you run into a hash table +# that is rehashing, the more rehashing "steps" are performed, so if the +# server is idle the rehashing is never complete and some more memory is used +# by the hash table. +# +# The default is to use this millisecond 10 times every second in order to +# actively rehash the main dictionaries, freeing memory when possible. +# +# If unsure: +# use "activerehashing no" if you have hard latency requirements and it is +# not a good thing in your environment that Redis can reply from time to time +# to queries with 2 milliseconds delay. +# +# use "activerehashing yes" if you don't have such hard requirements but +# want to free memory asap when possible. +activerehashing yes + +# The client output buffer limits can be used to force disconnection of clients +# that are not reading data from the server fast enough for some reason (a +# common reason is that a Pub/Sub client can't consume messages as fast as the +# publisher can produce them). +# +# The limit can be set differently for the three different classes of clients: +# +# normal -> normal clients including MONITOR clients +# replica -> replica clients +# pubsub -> clients subscribed to at least one pubsub channel or pattern +# +# The syntax of every client-output-buffer-limit directive is the following: +# +# client-output-buffer-limit +# +# A client is immediately disconnected once the hard limit is reached, or if +# the soft limit is reached and remains reached for the specified number of +# seconds (continuously). +# So for instance if the hard limit is 32 megabytes and the soft limit is +# 16 megabytes / 10 seconds, the client will get disconnected immediately +# if the size of the output buffers reach 32 megabytes, but will also get +# disconnected if the client reaches 16 megabytes and continuously overcomes +# the limit for 10 seconds. +# +# By default normal clients are not limited because they don't receive data +# without asking (in a push way), but just after a request, so only +# asynchronous clients may create a scenario where data is requested faster +# than it can read. +# +# Instead there is a default limit for pubsub and replica clients, since +# subscribers and replicas receive data in a push fashion. +# +# Both the hard or the soft limit can be disabled by setting them to zero. +client-output-buffer-limit normal 0 0 0 +client-output-buffer-limit replica 256mb 64mb 60 +client-output-buffer-limit pubsub 32mb 8mb 60 + +# Client query buffers accumulate new commands. They are limited to a fixed +# amount by default in order to avoid that a protocol desynchronization (for +# instance due to a bug in the client) will lead to unbound memory usage in +# the query buffer. However you can configure it here if you have very special +# needs, such us huge multi/exec requests or alike. +# +# client-query-buffer-limit 1gb + +# In the Redis protocol, bulk requests, that are, elements representing single +# strings, are normally limited ot 512 mb. However you can change this limit +# here. +# +# proto-max-bulk-len 512mb + +# Redis calls an internal function to perform many background tasks, like +# closing connections of clients in timeout, purging expired keys that are +# never requested, and so forth. +# +# Not all tasks are performed with the same frequency, but Redis checks for +# tasks to perform according to the specified "hz" value. +# +# By default "hz" is set to 10. Raising the value will use more CPU when +# Redis is idle, but at the same time will make Redis more responsive when +# there are many keys expiring at the same time, and timeouts may be +# handled with more precision. +# +# The range is between 1 and 500, however a value over 100 is usually not +# a good idea. Most users should use the default of 10 and raise this up to +# 100 only in environments where very low latency is required. +hz 10 + +# Normally it is useful to have an HZ value which is proportional to the +# number of clients connected. This is useful in order, for instance, to +# avoid too many clients are processed for each background task invocation +# in order to avoid latency spikes. +# +# Since the default HZ value by default is conservatively set to 10, Redis +# offers, and enables by default, the ability to use an adaptive HZ value +# which will temporary raise when there are many connected clients. +# +# When dynamic HZ is enabled, the actual configured HZ will be used as +# as a baseline, but multiples of the configured HZ value will be actually +# used as needed once more clients are connected. In this way an idle +# instance will use very little CPU time while a busy instance will be +# more responsive. +dynamic-hz yes + +# When a child rewrites the AOF file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +aof-rewrite-incremental-fsync yes + +# When redis saves RDB file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +rdb-save-incremental-fsync yes + +# Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good +# idea to start with the default settings and only change them after investigating +# how to improve the performances and how the keys LFU change over time, which +# is possible to inspect via the OBJECT FREQ command. +# +# There are two tunable parameters in the Redis LFU implementation: the +# counter logarithm factor and the counter decay time. It is important to +# understand what the two parameters mean before changing them. +# +# The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis +# uses a probabilistic increment with logarithmic behavior. Given the value +# of the old counter, when a key is accessed, the counter is incremented in +# this way: +# +# 1. A random number R between 0 and 1 is extracted. +# 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1). +# 3. The counter is incremented only if R < P. +# +# The default lfu-log-factor is 10. This is a table of how the frequency +# counter changes with a different number of accesses with different +# logarithmic factors: +# +# +--------+------------+------------+------------+------------+------------+ +# | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits | +# +--------+------------+------------+------------+------------+------------+ +# | 0 | 104 | 255 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 1 | 18 | 49 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 10 | 10 | 18 | 142 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 100 | 8 | 11 | 49 | 143 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# +# NOTE: The above table was obtained by running the following commands: +# +# redis-benchmark -n 1000000 incr foo +# redis-cli object freq foo +# +# NOTE 2: The counter initial value is 5 in order to give new objects a chance +# to accumulate hits. +# +# The counter decay time is the time, in minutes, that must elapse in order +# for the key counter to be divided by two (or decremented if it has a value +# less <= 10). +# +# The default value for the lfu-decay-time is 1. A Special value of 0 means to +# decay the counter every time it happens to be scanned. +# +# lfu-log-factor 10 +# lfu-decay-time 1 + +########################### ACTIVE DEFRAGMENTATION ####################### +# +# WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested +# even in production and manually tested by multiple engineers for some +# time. +# +# What is active defragmentation? +# ------------------------------- +# +# Active (online) defragmentation allows a Redis server to compact the +# spaces left between small allocations and deallocations of data in memory, +# thus allowing to reclaim back memory. +# +# Fragmentation is a natural process that happens with every allocator (but +# less so with Jemalloc, fortunately) and certain workloads. Normally a server +# restart is needed in order to lower the fragmentation, or at least to flush +# away all the data and create it again. However thanks to this feature +# implemented by Oran Agra for Redis 4.0 this process can happen at runtime +# in an "hot" way, while the server is running. +# +# Basically when the fragmentation is over a certain level (see the +# configuration options below) Redis will start to create new copies of the +# values in contiguous memory regions by exploiting certain specific Jemalloc +# features (in order to understand if an allocation is causing fragmentation +# and to allocate it in a better place), and at the same time, will release the +# old copies of the data. This process, repeated incrementally for all the keys +# will cause the fragmentation to drop back to normal values. +# +# Important things to understand: +# +# 1. This feature is disabled by default, and only works if you compiled Redis +# to use the copy of Jemalloc we ship with the source code of Redis. +# This is the default with Linux builds. +# +# 2. You never need to enable this feature if you don't have fragmentation +# issues. +# +# 3. Once you experience fragmentation, you can enable this feature when +# needed with the command "CONFIG SET activedefrag yes". +# +# The configuration parameters are able to fine tune the behavior of the +# defragmentation process. If you are not sure about what they mean it is +# a good idea to leave the defaults untouched. + +# Enabled active defragmentation +# activedefrag yes + +# Minimum amount of fragmentation waste to start active defrag +# active-defrag-ignore-bytes 100mb + +# Minimum percentage of fragmentation to start active defrag +# active-defrag-threshold-lower 10 + +# Maximum percentage of fragmentation at which we use maximum effort +# active-defrag-threshold-upper 100 + +# Minimal effort for defrag in CPU percentage +# active-defrag-cycle-min 5 + +# Maximal effort for defrag in CPU percentage +# active-defrag-cycle-max 75 + +# Maximum number of set/hash/zset/list fields that will be processed from +# the main dictionary scan +# active-defrag-max-scan-fields 1000 diff --git a/diplomacy_research/containers/tensorflow-patches/serving-v1.13-20190226.patch b/diplomacy_research/containers/tensorflow-patches/serving-v1.13-20190226.patch new file mode 100644 index 0000000..0756149 --- /dev/null +++ b/diplomacy_research/containers/tensorflow-patches/serving-v1.13-20190226.patch @@ -0,0 +1,35 @@ +From 7723227ea65272019fafaaa91d3087f5cbbe1796 Mon Sep 17 00:00:00 2001 +From: Philip Paquette +Date: Thu, 26 Feb 2019 15:45:51 -0500 +Subject: [PATCH] 20190226 - Patching user_ops + +--- + tensorflow_serving/repo.bzl | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/tensorflow_serving/repo.bzl b/tensorflow_serving/repo.bzl +index 21fb4cd..ed0c8a9 100644 +--- a/tensorflow_serving/repo.bzl ++++ b/tensorflow_serving/repo.bzl +@@ -23,17 +23,7 @@ def _tensorflow_http_archive(ctx): + sha256 = "" + git_commit = override_git_commit + +- strip_prefix = "tensorflow-%s" % git_commit +- urls = [ +- "https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/%s.tar.gz" % git_commit, +- "https://github.com/tensorflow/tensorflow/archive/%s.tar.gz" % git_commit, +- ] +- ctx.download_and_extract( +- urls, +- "", +- sha256, +- "", +- strip_prefix) ++ ctx.symlink("/bazel/serving/tensorflow/", "") + + tensorflow_http_archive = repository_rule( + implementation=_tensorflow_http_archive, +-- +2.20.1 + diff --git a/diplomacy_research/containers/tensorflow-patches/tensorflow-v1.13-20190226.patch b/diplomacy_research/containers/tensorflow-patches/tensorflow-v1.13-20190226.patch new file mode 100644 index 0000000..191515a --- /dev/null +++ b/diplomacy_research/containers/tensorflow-patches/tensorflow-v1.13-20190226.patch @@ -0,0 +1,143 @@ +From 0d65a7bc16cafd6db705bdfc983629f7e3732cd6 Mon Sep 17 00:00:00 2001 +From: Philip Paquette +Date: Thu, 26 Feb 2019 15:43:30 -0500 +Subject: [PATCH] 20190226 - Patching user_ops + +--- + tensorflow/core/user_ops/seeded_random.cc | 124 ++++++++++++++++++++++ + 1 file changed, 124 insertions(+) + create mode 100644 tensorflow/core/user_ops/seeded_random.cc + +diff --git a/tensorflow/core/user_ops/seeded_random.cc b/tensorflow/core/user_ops/seeded_random.cc +new file mode 100644 +index 0000000000..45c841b884 +--- /dev/null ++++ b/tensorflow/core/user_ops/seeded_random.cc +@@ -0,0 +1,124 @@ ++/** SeededRandom Op ++ ++ - Given a vector of seeds, generate a matrix of size (nb_seeds, size) where each row with identical seed is ++ identical. (e.g. seeds of [10, 5, 10, 5] will have the same 1st and 3rd row, and the same 2nd and 4th row). ++ - Rows with a seeds of 0, with use the graph seed, then the op seed, then a random seed. ++ ++ Attributes: ++ seed: graph_seed. - The graph seed (defaults to 0) ++ seed2: op_seed - The seed at the op construction (default to 0) ++ ++ Inputs: ++ seeds (int32): vector of seeds. Batch of seeds used to generate random numbers. Vector length is batch size. ++ offset (int32): integer to add to seeds as deterministic mask at initialization. ++ size (int32): output size. Number of values to generate for each seed. ++ ++ Output: Matrix of generated random numbers, with shape (batch size, size). ++**/ ++#include ++#include ++#include ++#include "tensorflow/core/framework/op.h" ++#include "tensorflow/core/framework/tensor_shape.h" ++#include "tensorflow/core/framework/shape_inference.h" ++#include "tensorflow/core/framework/op_kernel.h" ++#include "tensorflow/core/framework/function.h" ++ ++#define M 2147483647U ++#define A 2147483629U ++#define C 2147483587U ++ ++using namespace tensorflow; ++ ++REGISTER_OP("SeededRandom") ++ .Input("seeds: int32") ++ .Input("offset: int32") ++ .Input("size: int32") ++ .SetIsStateful() // seems necessary to force re-computation even when all inputs are constant. ++ .Output("output: float") // output format: (batch_size, size) ++ .Attr("seed: int = 0") ++ .Attr("seed2: int = 0") ++ .SetShapeFn([](::tensorflow::shape_inference::InferenceContext* c) { ++ shape_inference::ShapeHandle seeds_shape; ++ shape_inference::ShapeHandle size_shape; ++ TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &seeds_shape)); ++ TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &size_shape)); ++ ++ size_t output_size = 0; ++ const Tensor* size_tensor = c->input_tensor(2); ++ if (size_tensor) { output_size = size_tensor->scalar()(); } ++ ++ std::vector outputDimensions; ++ outputDimensions.push_back(c->Dim(seeds_shape, 0)); // Batch size. ++ outputDimensions.push_back(output_size ? c->MakeDim(output_size) : c->UnknownDim()); // Output size. ++ c->set_output(0, c->MakeShape(outputDimensions)); ++ return Status::OK(); ++ }); ++ ++class SeededRandomOp: public OpKernel { ++ int _seed; ++ int _seed2; ++public: ++ explicit SeededRandomOp(OpKernelConstruction* context): OpKernel(context) { ++ OP_REQUIRES_OK(context, context->GetAttr("seed", &_seed)); ++ OP_REQUIRES_OK(context, context->GetAttr("seed2", &_seed2)); ++ } ++ void Compute(OpKernelContext* context) override { ++ // Get tensors. ++ const Tensor& seeds_tensor = context->input(0); ++ const Tensor& offset_tensor = context->input(1); ++ const Tensor& size_tensor = context->input(2); ++ ++ // Get tensor shapes. ++ const TensorShape& seeds_shape = seeds_tensor.shape(); ++ const TensorShape& offset_shape = offset_tensor.shape(); ++ const TensorShape& size_shape = size_tensor.shape(); ++ ++ // Check inputs shapes . ++ DCHECK_EQ(seeds_shape.dims(), 1); ++ DCHECK_EQ(offset_shape.dims(), 0); ++ DCHECK_EQ(size_shape.dims(), 0); ++ ++ // Get inputs data. ++ auto seeds = seeds_tensor.vec(); ++ auto offset = offset_tensor.scalar()(); ++ auto output_size = size_tensor.scalar()(); ++ size_t batch_size = seeds_shape.dim_size(0); ++ ++ // Allocate output matrix (shape_prod, batch size). ++ TensorShape output_shape; ++ output_shape.AddDim(batch_size); ++ output_shape.AddDim(output_size); ++ Tensor* output = NULL; ++ OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output)); ++ auto output_matrix = output->matrix(); ++ ++ // Generate alternative seeds. ++ std::vector alt_seeds(batch_size, 0); ++ std::vector rng(batch_size, 0); ++ if (_seed || _seed2) { ++ auto seed = _seed ? _seed : _seed2; ++ for (size_t i = 0; i < batch_size; ++i) { alt_seeds[i] = seed; } ++ } else { ++ std::default_random_engine generator(std::chrono::system_clock::now().time_since_epoch().count()); ++ std::uniform_int_distribution distribution(0, M - 1); ++ for (size_t i = 0; i < batch_size; ++i) { alt_seeds[i] = distribution(generator); } ++ } ++ ++ // Initialize RNG. ++ for (size_t i = 0; i < batch_size; ++i) { ++ rng[i] = ((seeds(i) ? seeds(i) : alt_seeds[i]) + offset) % M; ++ } ++ ++ // Update RNG and generate output. ++ for (size_t i = 0; i < batch_size; ++i) { ++ for (size_t j = 0; j < output_size; ++j) { ++ rng[i] = (A * rng[i] + C) % M; ++ output_matrix(i, j) = float(rng[i]) / M; ++ } ++ } ++ } ++}; ++ ++REGISTER_KERNEL_BUILDER(Name("SeededRandom").Device(DEVICE_CPU), SeededRandomOp); ++REGISTER_OP_NO_GRADIENT("SeededRandom"); +-- +2.20.1 + diff --git a/diplomacy_research/containers/tensorflow-serving/Dockerfile b/diplomacy_research/containers/tensorflow-serving/Dockerfile new file mode 100644 index 0000000..17ceb2a --- /dev/null +++ b/diplomacy_research/containers/tensorflow-serving/Dockerfile @@ -0,0 +1,210 @@ +FROM ubuntu:18.04 + +# To build and push: +# sudo -s +# apt-get update -y +# apt-get install -y docker.io +# echo '{ "experimental": true }' >> /etc/docker/daemon.json +# service docker restart +# docker build --squash -t pcpaquette/tensorflow-serving:20190226 -t pcpaquette/tensorflow-serving:latest . +# docker login +# docker push pcpaquette/tensorflow-serving + +ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp +ENV PYTHONIOENCODING=utf-8 +ENV LANG=en_CA.UTF-8 +ENV PYTHONUNBUFFERED=1 +ENV PATH=/data/env3.7/bin:$PATH + +ENV PYTHON_BIN_PATH=/data/env3.7/bin/python +ENV PYTHON_LIB_PATH=/data/env3.7/lib/python3.7/site-packages +ENV TF_NEED_JEMALLOC=1 +ENV TF_NEED_IGNITE=1 +ENV TF_NEED_AWS=1 +ENV TF_NEED_GCP=1 +ENV TF_NEED_HDFS=1 +ENV TF_NEED_S3=1 +ENV TF_NEED_KAFKA=0 +ENV TF_ENABLE_XLA=0 +ENV TF_NEED_OPENCL=0 +ENV TF_NEED_OPENCL_SYCL=0 +ENV TF_NEED_ROCM=0 +ENV TF_NEED_CUDA=0 +ENV TF_DOWNLOAD_CLANG=0 +ENV TF_NEED_MPI=0 +ENV MPI_HOME="/usr/local/openmpi" +ENV CC_OPT_FLAGS="-march=native" +ENV TF_SET_ANDROID_WORKSPACE=0 +ENV GCC_HOST_COMPILER_PATH="/usr/bin/gcc" + +ENV BAZEL_VERSION=0.20.0 + +USER root +RUN FILE_VERSION=2019-02-26 && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing dependencies and Python " && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-get install -y \ + apt-transport-https \ + autoconf \ + automake \ + build-essential \ + bzip2 \ + ca-certificates \ + clang \ + curl \ + dh-autoreconf \ + g++ \ + gcc \ + git \ + gnupg \ + libc++-dev \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libgflags-dev \ + libgtest-dev \ + libpng-dev \ + libtool \ + libzmq3-dev \ + locales \ + make \ + mlocate \ + openjdk-8-jdk \ + openjdk-8-jre-headless \ + pkg-config \ + software-properties-common \ + swig \ + unzip \ + virtualenv \ + wget \ + zip \ + zlib1g-dev && \ + locale-gen en_US.UTF-8 && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing Protobuf v3.6.1 " && \ + echo "------------------------------------------------------" && \ + wget https://github.com/google/protobuf/archive/v3.6.1.zip && \ + unzip v3.6.1.zip && \ + rm -Rf v3.6.1.zip && \ + cd protobuf-3.6.1/ && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make && \ + make install && \ + ldconfig && \ + cd .. && \ + rm -Rf protobuf-3.6.1 && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing grpcio v1.15.0 " && \ + echo "------------------------------------------------------" && \ + git clone https://github.com/grpc/grpc.git && \ + cd grpc && \ + echo "Using gRPC v1.15.0... (d2c7d4d)" && \ + git checkout d2c7d4dea492b9a86a53555aabdbfa90c2b01730 && \ + git submodule update --init && \ + cd third_party/protobuf && \ + echo "Using Protobuf v3.6.1... (48cb18e)" && \ + git checkout 48cb18e5c419ddd23d9badcfe4e9df7bde1979b2 && \ + cd ../.. && \ + make && \ + make install && \ + cd .. && \ + rm -Rf grpc && \ + \ + echo "------------------------------------------------------" && \ + echo "Setting up Bazel" && \ + echo "------------------------------------------------------" && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get -y update && \ + mkdir -p /bazel && \ + cd /bazel && \ + curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \ + chmod +x bazel-*.sh && \ + ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + cd / && \ + rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing Python 3.7" && \ + echo "------------------------------------------------------" && \ + mkdir -p /data && \ + cd /data && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh && \ + bash ./miniconda.sh -b -p /data/env3.7 && \ + export PATH="/data/env3.7/bin:$PATH" && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing PIP dependencies" && \ + echo "------------------------------------------------------" && \ + pip install pip six wheel mock requests && \ + pip install 'protobuf==3.6.1' && \ + pip install 'grpcio==1.15.0' && \ + pip install 'grpcio-tools==1.15.0' && \ + pip install 'h5py==2.8.0' && \ + pip install 'keras_applications==1.0.6' --no-deps && \ + pip install 'keras_preprocessing==1.0.5' --no-deps && \ + pip install 'numpy>=1.15,<1.16' && \ + \ + echo "------------------------------------------------------" && \ + echo "Building bazel" && \ + echo "------------------------------------------------------" && \ + cd /bazel && \ + git clone https://github.com/tensorflow/serving && \ + cd serving && \ + echo "# Serving v1.13.0" && \ + git checkout f16e77783927353fca89dbb411fc01cbd3d42bda && \ + git submodule update --init && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/tensorflow/patch/serving-v1.13-20190226.patch && \ + git apply serving-v1.13-20190226.patch && \ + \ + echo "------------------------------------------------------" && \ + echo "Selecting Tensorflow Version" && \ + echo "------------------------------------------------------" && \ + echo "# TensorFlow v1.13.1" && \ + export TF_REVISION=6612da89516247503f03ef76e974b51a434fb52e && \ + rm -Rf tensorflow/ && \ + git clone https://github.com/tensorflow/tensorflow.git && \ + cd tensorflow && \ + git checkout "$TF_REVISION" && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/tensorflow/patch/tensorflow-v1.13-20190226.patch && \ + git apply tensorflow-v1.13-20190226.patch && \ + ./configure && \ + cd ../ && \ + cp tensorflow/.tf_configure.bazelrc ./ && \ + echo "" >> .bazelrc && \ + echo "import /bazel/serving/tensorflow/.tf_configure.bazelrc" >> .bazelrc && \ + \ + echo "------------------------------------------------------" && \ + echo "Building TF Serving" && \ + echo "------------------------------------------------------" && \ + bazel build \ + --color=yes --curses=yes \ + --action_env TF_REVISION="$TF_REVISION" \ + --output_filter=DONT_MATCH_ANYTHING \ + --verbose_failures \ + --spawn_strategy=standalone \ + tensorflow_serving/model_servers:tensorflow_model_server && \ + cp bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server /usr/local/bin/ && \ + bazel clean --expunge && \ + \ + cd /data && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/serving.zip -O serving.zip && \ + unzip serving.zip && \ + rm -f serving.zip && \ + chmod -R 777 /data/serving/ && \ + \ + echo "------------------------------------------------------" && \ + echo "Cleaning up" && \ + echo "------------------------------------------------------" && \ + mkdir -p /work_dir && \ + chmod -R 777 /work_dir && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + rm -Rf /bazel && \ + rm -Rf /tmp/pip_build_root && \ + rm -Rf ~/.cache/bazel diff --git a/diplomacy_research/containers/tensorflow-serving/Singularity b/diplomacy_research/containers/tensorflow-serving/Singularity new file mode 100644 index 0000000..0bd9c7a --- /dev/null +++ b/diplomacy_research/containers/tensorflow-serving/Singularity @@ -0,0 +1,18 @@ +Bootstrap: docker +From: pcpaquette/tensorflow-serving:20190226 + +%runscript +cd /work_dir +/data/serving/run_tf_serving.sh "$@" + +%environment +export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp +export PYTHONIOENCODING=utf-8 +export LANG=en_CA.UTF-8 +export PYTHONUNBUFFERED=1 +export PATH=/data/env3.7/bin:$PATH + +%labels +AUTHOR pcpaquette@gmail.com + +%post diff --git a/diplomacy_research/containers/ubuntu-cuda10/Dockerfile b/diplomacy_research/containers/ubuntu-cuda10/Dockerfile new file mode 100644 index 0000000..8240459 --- /dev/null +++ b/diplomacy_research/containers/ubuntu-cuda10/Dockerfile @@ -0,0 +1,378 @@ +FROM ubuntu:18.04 + +# To build and push: +# sudo -s +# apt-get update -y +# apt-get install -y docker.io +# echo '{ "experimental": true }' >> /etc/docker/daemon.json +# service docker restart +# docker build --squash -t pcpaquette/ubuntu-cuda10:20190226 . +# docker login +# docker push pcpaquette/ubuntu-cuda10 + +ENV PYTHONIOENCODING=utf-8 +ENV LANG=en_CA.UTF-8 + +ENV PYTHON_BIN_PATH=/data/env3.7/bin/python +ENV PYTHON_LIB_PATH=/data/env3.7/lib/python3.7/site-packages +ENV TF_NEED_JEMALLOC=1 +ENV TF_NEED_IGNITE=1 +ENV TF_NEED_AWS=1 +ENV TF_NEED_GCP=1 +ENV TF_NEED_HDFS=1 +ENV TF_NEED_S3=1 +ENV TF_NEED_KAFKA=1 +ENV TF_ENABLE_XLA=1 +ENV TF_NEED_OPENCL=0 +ENV TF_NEED_OPENCL_SYCL=0 +ENV TF_NEED_ROCM=0 +ENV TF_NEED_CUDA=1 +ENV TF_CUDA_VERSION="10.0" +ENV CUDA_TOOLKIT_PATH="/usr/local/cuda" +ENV TF_CUDNN_VERSION="7" +ENV CUDNN_INSTALL_PATH="/usr/local/cuda" +ENV TF_NEED_TENSORRT=0 +ENV TF_NCCL_VERSION="2" +ENV NCCL_INSTALL_PATH=/usr/lib/nccl/lib +ENV NCCL_HDR_PATH=/usr/lib/nccl/include +ENV TF_CUDA_COMPUTE_CAPABILITIES="3.5,3.7,5.2,6.0,6.1,7.0" +ENV TF_CUDA_CLANG=0 +ENV TF_DOWNLOAD_CLANG=0 +ENV GCC_HOST_COMPILER_PATH="/usr/bin/gcc" +ENV TF_NEED_MPI=0 +ENV MPI_HOME="/usr/local/openmpi" +ENV CC_OPT_FLAGS="--copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2" +ENV TF_SET_ANDROID_WORKSPACE=0 + +# Versions +ENV NCCL_VERSION=2.4.2 +ENV CUDA_VERSION=10.0.130 +ENV CUDNN_VERSION=7.4.1.5 +ENV NVIDIA_DRIVER=410 +ENV BAZEL_VERSION=0.20.0 +ENV CUDA_PKG_VERSION 10-0=$CUDA_VERSION-1 + +USER root +RUN FILE_VERSION=2019-02-26 && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing dependencies and Python (psmisc -> fuser) " && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-get install -y \ + apt-transport-https \ + autoconf \ + automake \ + build-essential \ + bzip2 \ + ca-certificates \ + clang \ + curl \ + dh-autoreconf \ + g++ \ + gcc \ + gfortran \ + git \ + gnupg \ + libatlas-base-dev \ + libblas-dev \ + libc++-dev \ + libcupti-dev \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libgflags-dev \ + libgtest-dev \ + liblapack-dev \ + libncurses5-dev \ + libopenblas-dev \ + libpng-dev \ + libtool \ + libxft-dev \ + libzmq3-dev \ + locales \ + make \ + mlocate \ + openjdk-8-jdk \ + openjdk-8-jre-headless \ + pkg-config \ + psmisc \ + software-properties-common \ + swig \ + unzip \ + virtualenv \ + wget \ + zip \ + zlib1g-dev && \ + locale-gen en_US.UTF-8 && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "------------------------------------------------------" && \ + echo "Installing CUDA 10.0.130" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && \ + echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \ + echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list && \ + apt-get -y update && \ + apt-get install -y \ + cuda-cudart-$CUDA_PKG_VERSION \ + cuda-toolkit-$CUDA_PKG_VERSION \ + cuda-command-line-tools-$CUDA_PKG_VERSION \ + cuda-cublas-dev-$CUDA_PKG_VERSION \ + cuda-cudart-dev-$CUDA_PKG_VERSION \ + cuda-cufft-dev-$CUDA_PKG_VERSION \ + cuda-curand-dev-$CUDA_PKG_VERSION \ + cuda-cusolver-dev-$CUDA_PKG_VERSION \ + cuda-cusparse-dev-$CUDA_PKG_VERSION && \ + ln -s cuda-10.0 /usr/local/cuda && \ + echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \ + echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing NCCL 2.4" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-get -y install libnccl2=${NCCL_VERSION}-1+cuda10.0 libnccl-dev=${NCCL_VERSION}-1+cuda10.0 && \ + mkdir -p ${NCCL_INSTALL_PATH} && \ + mkdir -p ${NCCL_HDR_PATH} && \ + ln -s /usr/include/nccl.h ${NCCL_HDR_PATH}/nccl.h && \ + ln -s /usr/lib/x86_64-linux-gnu/libnccl.so ${NCCL_INSTALL_PATH}/libnccl.so && \ + ln -s /usr/lib/x86_64-linux-gnu/libnccl.so.${TF_NCCL_VERSION} ${NCCL_INSTALL_PATH}/libnccl.so.${TF_NCCL_VERSION} && \ + ldconfig && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing CuDNN 7.4.1" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-get -y install libcudnn7=${CUDNN_VERSION}-1+cuda10.0 libcudnn7-dev=${CUDNN_VERSION}-1+cuda10.0 && \ + mkdir /usr/lib/x86_64-linux-gnu/include/ && \ + ln -s /usr/lib/x86_64-linux-gnu/include/cudnn.h /usr/lib/x86_64-linux-gnu/include/cudnn.h && \ + ln -s /usr/include/cudnn.h /usr/local/cuda/include/cudnn.h && \ + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/local/cuda/lib64/libcudnn.so && \ + ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.${TF_CUDNN_VERSION} /usr/local/cuda/lib64/libcudnn.so.${TF_CUDNN_VERSION} && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing VERBS" && \ + echo "------------------------------------------------------" && \ + apt-get install -y alien && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/libibverbs-13-7.el7.x86_64.rpm && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/libibumad-13-7.el7.x86_64.rpm && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/libibverbs-utils-13-7.el7.x86_64.rpm && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/librdmacm-13-7.el7.x86_64.rpm && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/libibcm-13-7.el7.x86_64.rpm && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/ibacm-13-7.el7.x86_64.rpm && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/libnl3-3.2.28-4.el7.x86_64.rpm && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/verbs/rdma-core-devel-13-7.el7.x86_64.rpm && \ + alien -i libibverbs-13-7.el7.x86_64.rpm && \ + alien -i libibumad-13-7.el7.x86_64.rpm && \ + alien -i libibverbs-utils-13-7.el7.x86_64.rpm && \ + alien -i librdmacm-13-7.el7.x86_64.rpm && \ + alien -i libibcm-13-7.el7.x86_64.rpm && \ + alien -i ibacm-13-7.el7.x86_64.rpm && \ + alien -i libnl3-3.2.28-4.el7.x86_64.rpm && \ + alien -i rdma-core-devel-13-7.el7.x86_64.rpm && \ + rm libibverbs-13-7.el7.x86_64.rpm && \ + rm libibumad-13-7.el7.x86_64.rpm && \ + rm libibverbs-utils-13-7.el7.x86_64.rpm && \ + rm librdmacm-13-7.el7.x86_64.rpm && \ + rm libibcm-13-7.el7.x86_64.rpm && \ + rm ibacm-13-7.el7.x86_64.rpm && \ + rm libnl3-3.2.28-4.el7.x86_64.rpm && \ + rm rdma-core-devel-13-7.el7.x86_64.rpm && \ + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64 && \ + \ + find /usr/local/cuda-10.0/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \ + rm -f /usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a && \ + apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "------------------------------------------------------" && \ + echo "Installing Protobuf 3.6.1" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + wget https://github.com/google/protobuf/archive/v3.6.1.zip && \ + unzip v3.6.1.zip && \ + rm -Rf v3.6.1.zip && \ + cd protobuf-3.6.1/ && \ + ./autogen.sh && \ + ./configure --prefix=/usr && \ + make && \ + make install && \ + ldconfig && \ + cd .. && \ + rm -Rf protobuf-3.6.1 && \ + \ + echo "------------------------------------------------------" && \ + echo "Installing gRPC v1.15.0" && \ + echo "------------------------------------------------------" && \ + git clone https://github.com/grpc/grpc.git && \ + cd grpc && \ + echo "Using gRPC v1.15.0... (d2c7d4d)" && \ + git checkout d2c7d4dea492b9a86a53555aabdbfa90c2b01730 && \ + git submodule update --init && \ + cd third_party/protobuf && \ + echo "Using Protobuf v3.6.1... (48cb18e)" && \ + git checkout 48cb18e5c419ddd23d9badcfe4e9df7bde1979b2 && \ + cd ../.. && \ + make && \ + make install && \ + cd .. && \ + rm -Rf grpc && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "------------------------------------------------------" && \ + echo "Installing OpenMPI 3.0.0" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + wget -nv https://www.open-mpi.org/software/ompi/v3.0/downloads/openmpi-3.0.0.tar.gz && \ + tar -xzf openmpi-3.0.0.tar.gz && \ + cd openmpi-3.0.0 && \ + ./configure --prefix=/usr/local/openmpi --enable-orterun-prefix-by-default --enable-mpirun-prefix-by-default --enable-static --enable-shared --with-cuda --with-verbs && \ + make all install && \ + cd .. && \ + rm -Rf openmpi-3.0.0 && \ + rm openmpi-3.0.0.tar.gz && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "------------------------------------------------------" && \ + echo "Installing Redis 5.0" && \ + echo "------------------------------------------------------" && \ + add-apt-repository -y ppa:chris-lea/redis-server && \ + apt-get -y update && \ + apt-get install -y redis-server && \ + echo vm.overcommit_memory = 1 >> /etc/sysctl.conf && \ + sysctl vm.overcommit_memory=1 && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* + +# Tensorflow v1.13.1 +ENV TF_REVISION="6612da89516247503f03ef76e974b51a434fb52e" +RUN echo "------------------------------------------------------" && \ + echo "Compiling Tensorflow" && \ + echo "------------------------------------------------------" && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get -y update && \ + mkdir -p /bazel && \ + cd /bazel && \ + curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \ + chmod +x bazel-*.sh && \ + ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + cd / && \ + rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ + \ + apt-get install -y nvidia-driver-$NVIDIA_DRIVER && \ + ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \ + export CUDA_HOME=/usr/local/cuda && \ + export CUDA_ROOT=$CUDA_HOME && \ + export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib64 && \ + \ + mkdir -p /data && \ + cd /data && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh && \ + bash ./miniconda.sh -b -p /data/env3.7 && \ + export PATH="/data/env3.7/bin:$PATH" && \ + pip install pip six wheel mock requests && \ + pip install 'protobuf==3.6.1' && \ + pip install 'grpcio==1.15.0' && \ + pip install 'grpcio-tools==1.15.0' && \ + pip install 'h5py==2.8.0' && \ + pip install 'keras_applications==1.0.6' --no-deps && \ + pip install 'keras_preprocessing==1.0.5' --no-deps && \ + pip install 'numpy>=1.15,<1.16' && \ + \ + cd /bazel && \ + git clone https://github.com/tensorflow/tensorflow.git && \ + cd tensorflow && \ + git checkout $TF_REVISION && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/tensorflow/patch/tensorflow-v1.13-20190226.patch && \ + git apply tensorflow-v1.13-20190226.patch && \ + ./configure && \ + bazel build \ + --verbose_failures -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 \ + --config=cuda --action_env="LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" \ + -k //tensorflow/tools/pip_package:build_pip_package && \ + bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg && \ + cp /tmp/tensorflow_pkg/*.whl /data && \ + cd .. && \ + rm -Rf tensorflow/ && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* + +# Tensorflow Serving 1.13.1 +ENV TF_REVISION_SERVING="f16e77783927353fca89dbb411fc01cbd3d42bda" +RUN echo "------------------------------------------------------" && \ + echo "Compiling Tensorflow Serving" && \ + echo "------------------------------------------------------" && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get -y update && \ + export PATH="/data/env3.7/bin:$PATH" && \ + export CUDA_HOME=/usr/local/cuda && \ + export CUDA_ROOT=$CUDA_HOME && \ + export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib64 && \ + \ + mkdir -p /bazel && \ + cd /bazel && \ + git clone https://github.com/tensorflow/serving && \ + cd serving && \ + echo "# Serving v1.13.0" && \ + git checkout $TF_REVISION_SERVING && \ + git submodule update --init && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/tensorflow/patch/serving-v1.13-20190226.patch && \ + git apply serving-v1.13-20190226.patch && \ + \ + rm -Rf tensorflow/ && \ + git clone https://github.com/tensorflow/tensorflow.git && \ + cd tensorflow && \ + git checkout $TF_REVISION && \ + wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/tensorflow/patch/tensorflow-v1.13-20190226.patch && \ + git apply tensorflow-v1.13-20190226.patch && \ + ./configure && \ + cd ../ && \ + cp tensorflow/.tf_configure.bazelrc ./ && \ + echo "" >> .bazelrc && \ + echo "import /bazel/serving/tensorflow/.tf_configure.bazelrc" >> .bazelrc && \ + \ + bazel build \ + --color=yes --curses=yes --config=cuda --copt="-fPIC" \ + --action_env TF_REVISION="$TF_REVISION" --action_env="LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" \ + --output_filter=DONT_MATCH_ANYTHING \ + --verbose_failures -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 \ + --spawn_strategy=standalone --crosstool_top=@local_config_cuda//crosstool:toolchain \ + tensorflow_serving/model_servers:tensorflow_model_server && \ + cp bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server /usr/local/bin/ && \ + rm -f /usr/local/cuda/lib64/stubs/libcuda.so.1 && \ + bazel clean --expunge && \ + \ + apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* + +RUN echo "------------------------------------------------------" && \ + echo "Final Cleanup" && \ + echo "------------------------------------------------------" && \ + apt-get -y update && \ + apt-get install -y sudo && \ + apt-get purge -y nvidia-driver-$NVIDIA_DRIVER && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + rm -Rf /bazel && \ + rm -Rf /tmp/tensorflow_pkg && \ + rm -Rf /tmp/pip_build_root && \ + rm -Rf ~/.cache/bazel && \ + rm -Rf /data/env* diff --git a/diplomacy_research/containers/ubuntu-cuda10/Singularity b/diplomacy_research/containers/ubuntu-cuda10/Singularity new file mode 100644 index 0000000..3426859 --- /dev/null +++ b/diplomacy_research/containers/ubuntu-cuda10/Singularity @@ -0,0 +1,2 @@ +Bootstrap: docker +From: pcpaquette/ubuntu-cuda10:20190226 diff --git a/diplomacy_research/models/__init__.py b/diplomacy_research/models/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/base_adapter.py b/diplomacy_research/models/base_adapter.py new file mode 100644 index 0000000..160b0c7 --- /dev/null +++ b/diplomacy_research/models/base_adapter.py @@ -0,0 +1,205 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Adapter + - This module allows a player to interact with a model using a standardized interface +""" +from abc import ABCMeta +import logging +import time +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.utils.cluster import is_ioloop_running + +# Note: The following is imported in `load_from_checkpoint()` to avoid cyclical imports +# from diplomacy_research.utils.checkpoint import load_frozen_graph, load_graph_from_ckpt + +# Constants +LOGGER = logging.getLogger(__name__) + +class BaseAdapter(metaclass=ABCMeta): + """ Allows the evaluation of a policy adapter from a TensorFlow graph and session """ + + def __init__(self, feedable_dataset, graph=None, session=None): + """ Initializer + :param feedable_dataset: The feedable dataset to use (must be initiated under the graph provided) + :param graph: The graph object that contains the policy model to evaluate + :param session: The session to use to interact with the graph + :type feedable_dataset: diplomacy_research.models.datasets.feedable_dataset.FeedableDataset + :type graph: tensorflow.python.framework.ops.Graph + :type session: tensorflow.python.client.session.Session + """ + self.graph = graph + self.session = session + self.feedable_dataset = feedable_dataset + self.iterator = self.feedable_dataset.iterator + self.features = {} + self.placeholders = {} + self.outputs = {} + + # Checking if the IOLoop is started + if not is_ioloop_running(): + LOGGER.error('This object requires a running IO-Loop. Please start it before instantiating this object.') + raise RuntimeError('IO Loop has not been started.') + + # Loading features, outputs, placeholders + if graph is not None: + self._load_features_placeholders() + + # Initializes the adapter + if self.session: + self.initialize(self.session) + + # Creating queues + self.create_queues() + + @staticmethod + def get_signature(): + """ Returns the signature of all the possible calls using this adapter + Format: { method_signature_name: {'placeholders': {name: (value, numpy_dtype)}, + 'outputs': [output_name, output_name] } } + e.g. {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs: ['selected_tokens', 'log_probs', 'draw_prob']}} + """ + raise NotImplementedError() + + def _load_features_placeholders(self): + """ Loads the features, outputs, and placeholders nodes from the model """ + from diplomacy_research.utils.tensorflow import tf + graph = self.graph or tf.get_default_graph() + collection_keys = graph.get_all_collection_keys() + + for key in collection_keys: + # If list, getting first element + key_value = graph.get_collection(key) + if isinstance(key_value, list) and key_value: + key_value = key_value[0] + + # Setting in self. + if key.startswith('feature'): + self.features[key.replace('feature_', '')] = key_value + elif key.startswith('placeholder'): + self.placeholders[key.replace('placeholder_', '')] = key_value + else: + self.outputs[key] = key_value + + @property + def is_trainable(self): + """ Returns a boolean that indicates if the policy model can be trained """ + return len([key for key in self.outputs if 'is_trainable' in key]) > 0 + + def initialize(self, session): + """ Initialize the adapter (init global vars and the dataset) + :type session: tensorflow.python.client.session.Session + """ + if not self.feedable_dataset.can_support_iterator or not self.iterator: + return + + from diplomacy_research.utils.tensorflow import tf + assert session, 'You must pass a session to initialize the adapter' + assert isinstance(self.feedable_dataset, QueueDataset), 'The dataset must be a QueueDataset' + self.session = session + + # Initializes uninit global vars + graph = self.graph or tf.get_default_graph() + if not graph.finalized: + with graph.as_default(): + var_to_initialize = tf.global_variables() + tf.local_variables() + is_initialized = self.session.run([tf.is_variable_initialized(var) for var in var_to_initialize]) + not_initialized_vars = [var for (var, is_init) in zip(var_to_initialize, is_initialized) if not is_init] + if not_initialized_vars: + LOGGER.info('Initialized %d variables.', len(not_initialized_vars)) + self.session.run(tf.variables_initializer(not_initialized_vars)) + + # Initializing the dataset to use the feedable model + if not self.feedable_dataset.is_started and self.session: + self.feedable_dataset.start(self.session) + elif not self.feedable_dataset.is_initialized and self.session: + self.feedable_dataset.initialize(self.session) + + def load_from_checkpoint(self, checkpoint_path): + """ Loads the variable from the checkpoint into the current graph + :param checkpoint_path: Either 1) Path to a checkpoint (e.g. /path/model.ckpt-XXX) or + 2) Path to a frozen graph (e.g. /path/frozen.pb) + :return: Nothing + """ + assert self.feedable_dataset.can_support_iterator, 'The dataset must be able to support an iterator' + assert isinstance(self.feedable_dataset, QueueDataset), 'The dataset must be a QueueDataset' + + # ---- ---- + # Loaded here to avoid cyclical imports + from diplomacy_research.utils.checkpoint import load_frozen_graph, load_graph_from_ckpt # pylint: disable=wrong-import-position + # ---- ---- + + # Loading graph from disk + if checkpoint_path[-3:] == '.pb': + load_frozen_graph(checkpoint_path, graph=self.graph, session=self.session) + else: + load_graph_from_ckpt(checkpoint_path, graph=self.graph, session=self.session) + + # Loading features, outputs, placeholders + self._load_features_placeholders() + + # Making sure we have an iterator resource + iterator_resource = [self.outputs[key] for key in self.outputs if 'iterator_resource' in key] + if not iterator_resource: + LOGGER.error('An "iterator_resource" key must be defined in checkpoints for models to be resumable.') + raise RuntimeError('"iterator_resource" not present.') + + # Creating new iterator with the iterator_resource + iterator_resource = iterator_resource[0] + self.feedable_dataset.create_iterator(iterator_resource, features=self.features) + self.feedable_dataset.initialize(self.session) + + # Rebuilding queues + self.create_queues() + + def create_queues(self): + """ Generates queues to feed data directly in the dataset in feedable mode """ + # The dataset must be a QueueDataset + if not isinstance(self.feedable_dataset, QueueDataset): + return + + # We haven't loaded a model yet (probably going to load a frozen checkpoint instead) + # We can't build queue yets because the graph is not built. + if not self.outputs or not self.features: + return + + # Building queues + signature = self.get_signature() + for method_name in signature: + placeholders = signature[method_name].get('placeholders', {}) + outputs = signature[method_name]['outputs'] + + # Queue already created + if self.feedable_dataset.has_queue(method_name): + LOGGER.warning('Queue %s has already been created.', method_name) + continue + + # Output not available + missing_outputs = [output_name for output_name in outputs if output_name not in self.outputs] + if missing_outputs: + LOGGER.warning('Unable to create queue "%s" - Missing outputs: %s', method_name, missing_outputs) + continue + + # Placeholder not available + missing_pholders = [pholder_name for pholder_name in placeholders if pholder_name not in self.placeholders] + if missing_pholders: + LOGGER.warning('Unable to create queue "%s" - Missing placeholders: %s', method_name, missing_pholders) + continue + + # Building queue + self.feedable_dataset.create_queue(method_name, + outputs=[self.outputs[output_name] for output_name in outputs], + placeholders={self.placeholders[ph_name]: placeholders[ph_name][0] + for ph_name in placeholders}, + post_queue=lambda _: time.sleep(0.10)) # To collect many batches diff --git a/diplomacy_research/models/base_model.py b/diplomacy_research/models/base_model.py new file mode 100644 index 0000000..79914cc --- /dev/null +++ b/diplomacy_research/models/base_model.py @@ -0,0 +1,717 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base model + - Contains the base model, with functions common to all models +""" +from collections import OrderedDict +from functools import reduce +import logging +from operator import mul +from diplomacy_research.utils.model import merge_complex_dicts +from diplomacy_research.settings import DEFAULT_SAVE_DIR, GIT_COMMIT_HASH + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + # Default settings + args = [ + ('int', 'model_id', -1, 'The model ID.'), + ('int', 'batch_size', 128, 'Training batch size.'), + ('str', 'config', 'config.yaml', 'The configuration file to use to set hyparameters (in save_dir)'), + ('str', 'config_section', '', 'Config section to load from the configuration file. Otherwise root.'), + ('str', 'save_dir', DEFAULT_SAVE_DIR, 'Save directory'), + ('bool', 'allow_gpu_growth', False, 'Boolean that indicates to not take the full GPU memory.'), + ('str', 'gradient_checkpoint', '', 'One of "speed", "memory", "collection" to active gradient checkpointing.'), + ('bool', 'sync_gradients', True, 'For distributed supervised training, uses SyncReplicasOptimizer'), + ('bool', 'avg_gradients', False, 'For distributed rl training, uses AvgGradOptimizer'), + ('bool', 'swap_memory', False, 'If set, reduces memory usage by storing gradients on CPU'), + ('str', 'grad_aggregation', 'ADD_N', 'One of "ADD_N", "ACCUMULATE_N", "TREE". Gradient aggregation method'), + ('int', 'nb_param_servers', 3, '(Distributed) The number of parameter servers to start. 0 for non-distributed'), + ('int', 'min_nb_param_servers', 0, '(Distributed) Launches at least this number of PS to force partitioning.'), + ('int', 'gpu_id', -1, 'The GPU id for this node. Values >= 100 indicate parameter servers.'), + ('int', 'grpc_port', 2200, 'The starting port to open for distributed training'), + ('bool', 'use_partitioner', False, 'Whether to use a partitioner for message and order embeddings'), + ('bool', 'use_verbs', False, 'Use GRPC+verbs rather than just GRPC for distributed training.'), + ('bool', 'use_xla', True, 'Use XLA compilation.'), + ('str', 'profile', '', 'One of "op", "scope", "graph" to activate profiling.'), + ('str', 'training_mode', 'supervised', 'The current training mode ("supervised" or "reinforcement").'), + ('bool', 'debug', False, 'Boolean that indicates to load the TensorFlow debugger.'), + ('bool', 'debug_batch', False, 'Boolean that indicates we want to overfit a mini-batch to debug the model.'), + ('int', 'debug_nb_cpu_workers', 0, '(Distributed) If set, will start this nb of parallel cpu workers.') + ] + + # Returning + return args + +class BaseModel(): + """ Base Model""" + + def __init__(self, parent_model, dataset, hparams): + """ Initialization + :param parent_model: A `base_model` to which we are adding features + :param dataset: The dataset that is used to iterate over the data. + :param hparams: A dictionary of hyper parameters with their values + :type parent_model: BaseModel + :type dataset: diplomacy_research.models.datasets.supervised_dataset.SupervisedDataset + :type dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + """ + from diplomacy_research.utils.tensorflow import tf + assert dataset.can_support_iterator, 'The dataset must be able to support an iterator' + self.placeholders = {} + self.sess = None + self.outputs = {} + self.optimizer = None + self.nb_optimizers = 0 + self.learning_rate = None + self.decay_learning_rate = None + self.build_finalized = False + + # Overriding from parent + if parent_model: + self.__dict__.update(parent_model.__dict__) + + # Setting from args + self.parent_model = parent_model + self.hparams = hparams + self.proto_fields = dataset.dataset_builder.get_proto_fields() + self.cluster_config = dataset.cluster_config + self.iterator_resource = dataset.iterator._iterator_resource # pylint: disable=protected-access + self.features = dataset.output_features + + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + self.global_step = tf.train.get_or_create_global_step() + + @property + def nb_evaluation_loops(self): + """ Contains the number of different evaluation tags we want to compute + This also represent the number of loops we should do over the validation set + Some model wants to calculate different statistics and require multiple pass to do that + """ + return self.nb_parent_evaluation_loops + self._nb_evaluation_loops - 1 + + @property + def nb_parent_evaluation_loops(self): + """ Contains the number of different evaluation tags we want to compute + Note: This only includes models above ourself (self.parent_model) and exclude self._nb_evaluation_loops + """ + return 1 if not self.parent_model else self.parent_model.nb_evaluation_loops + + @property + def my_eval_loop_ixs(self): + """ Contains the eval loop ix that this model uses for evaluation """ + return [0] + list(range(self.nb_parent_evaluation_loops, + self.nb_parent_evaluation_loops + self._nb_evaluation_loops - 1)) + + def get_evaluation_tags(self): + """ Returns a list of list of evaluation tags + Note: There should be a list of tags for every evaluation loop + e.g. [['Acc_1', 'Acc_5', 'Acc_Tokens'], ['Gr_1', 'Gr_5', 'Gr_Tokens']] + """ + eval_tags = [] if not self.parent_model else self.parent_model.get_evaluation_tags() + for _ in range(self.nb_evaluation_loops - len(eval_tags)): + eval_tags.append([]) + for eval_loop_ix, tags in zip(self.my_eval_loop_ixs, self._evaluation_tags): + eval_tags[eval_loop_ix] += tags + return eval_tags + + def get_early_stopping_tags(self): + """ List of tags to use to detect early stopping + The tags are a tuple of 1) 'min' or 'max' and 2) the tag's name + e.g. [('max', '[Gr]Acc_1'), ('min', '[TF]Perplexity')] + """ + assert isinstance(self._early_stopping_tags, list), 'Expected early stopping tags to be a list of tags' + early_stopping_tags = [] if not self.parent_model else self.parent_model.get_early_stopping_tags() + for tag_type, tag_name in self._early_stopping_tags: + assert tag_type in ('min', 'max'), 'The tag type must be "min" or "max". Got %s' % tag_type + early_stopping_tags += [(tag_type, tag_name)] + return early_stopping_tags + + def get_placeholders(self): + """ Creates and returns TensorFlow placeholders """ + placeholders = {} + + # Finding the list of models from the top parent downwards + current_model = self + models = [current_model] + while current_model.parent_model: + current_model = current_model.parent_model + models += [current_model] + + # Building the placeholders + while models: + current_model = models.pop(-1) + placeholders.update(self._placeholders) + + # Returning + return placeholders + + def get_optimizer(self, learning_rate): + """ Returns the optimizer to use for this model """ + # Finding the list of models from the top parent downwards + current_model = self + models = [current_model] + while current_model.parent_model: + current_model = current_model.parent_model + models += [current_model] + + # Checking if we have an optimizer override + optimizer = None + while models: + current_model = models.pop(-1) + optimizer = current_model._get_optimizer(learning_rate) or optimizer # pylint: disable=protected-access + + # Default optimizer + if not optimizer: + from diplomacy_research.utils.tensorflow import tf + optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate) + return optimizer + + def make_optimizer(self, learning_rate): + """ Builds a sync or async Adam optimizer + :param learning_rate: The learning rate variable + :return: A sync or async Adam optimizer + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.avg_grad_optimizer import AvgGradOptimizer + assert self.hparams['training_mode'] in ('supervised', 'reinforcement'), 'Invalid training mode.' + + # Getting parameters + is_distributed = bool(self.cluster_config) + avg_gradients = self.hparams.get('avg_gradients', False) + sync_gradients = self.hparams.get('sync_gradients', False) + training_mode = self.hparams['training_mode'] + max_gradient_norm = self.hparams.get('max_gradient_norm', None) + + # Creating optimizer + optimizer = self.get_optimizer(learning_rate) + + # Supervised learning - Detecting if we need to sync gradients + if training_mode == 'supervised' and sync_gradients and is_distributed: + LOGGER.info('Using SyncReplicasOptimizer for the optimization') + optimizer = tf.train.SyncReplicasOptimizer(opt=optimizer, + replicas_to_aggregate=self.cluster_config.num_shards, + total_num_replicas=self.cluster_config.num_shards) + + # RL - Averaging Gradients + elif training_mode == 'reinforcement' and avg_gradients: + LOGGER.info('Using AvgGradOptimizer for the optimization') + num_workers = 1 + if is_distributed and sync_gradients: + num_workers = self.cluster_config.count('learner') + optimizer = AvgGradOptimizer(optimizer, + num_workers=num_workers, + is_chief=not is_distributed or self.cluster_config.is_chief, + max_gradient_norm=max_gradient_norm) + + # RL - Syncing Gradients + elif training_mode == 'reinforcement' \ + and not avg_gradients \ + and sync_gradients \ + and is_distributed \ + and self.cluster_config.num_shards > 1: + LOGGER.info('Using SyncReplicasOptimizer for the optimization') + optimizer = tf.train.SyncReplicasOptimizer(opt=optimizer, + replicas_to_aggregate=self.cluster_config.num_shards, + total_num_replicas=self.cluster_config.num_shards) + + # Returning + return optimizer + + def create_optimizer_op(self, cost_and_scope, ignored_scope=None, max_gradient_norm=None): + """ Creates an optimizer op to reduce the cost + :param cost_and_scope: List of tuples (cost, scope, ignored_scope) + - cost is a tensor representing the cost to minimize + - scope is either a string, or a list of strings. Contains the scope(s) where the get the vars to update + - ignored_scope is either None, a string, or a list of strings. Contains scope(s) to ignore. + :param ignored_scope: A scope or list of scope for which we know we won't compute gradients + :param max_gradient_norm: Optional. If set, gradients will be clipped to this value. + :return: The optimizer op + + Note: The ignored scope inside 'cost_and_scope' is local to that cost, while the arg ignored_scope is global + for all costs. + """ + # pylint: disable=too-many-branches + from diplomacy_research.utils.tensorflow import tf, scope_vars, ensure_finite + from diplomacy_research.utils import gradient_checkpoint + assert self.optimizer, 'Optimizer must be defined in self.optimizer before calling this method.' + if self.cluster_config \ + and self.hparams['training_mode'] == 'supervised' \ + and 'sync_gradients' in self.hparams \ + and self.hparams['sync_gradients']: + assert isinstance(self.optimizer, tf.train.SyncReplicasOptimizer), 'optimizer must be SyncReplicasOptimizer' + assert self.hparams['grad_aggregation'].upper() in ['ADD_N', 'ACCUMULATE_N', 'TREE'], 'Invalid aggregation' + + # Warning if more than 1 optimizer is created + self.nb_optimizers += 1 + if self.nb_optimizers > 1: + LOGGER.warning('You have created %d optimizers for this model. This is not recommended (High memory usage)', + self.nb_optimizers) + + # Determining aggregation_method based on accumulate_n flag + aggregation_method = None + if self.hparams['grad_aggregation'].upper() == 'ACCUMULATE_N': + aggregation_method = tf.AggregationMethod.EXPERIMENTAL_ACCUMULATE_N + elif self.hparams['grad_aggregation'].upper() == 'TREE': + aggregation_method = tf.AggregationMethod.EXPERIMENTAL_TREE + + # Finding all trainable variables + all_trainable_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES) + + ignored_scope_trainable_vars = [] + if isinstance(ignored_scope, list): + for scope_name in ignored_scope: + ignored_scope_trainable_vars += scope_vars(scope_name, trainable_only=True) + elif ignored_scope is not None: + ignored_scope_trainable_vars = scope_vars(ignored_scope, trainable_only=True) + ignored_scope_trainable_vars = set(ignored_scope_trainable_vars) + + # Building a list of all trainable vars, and removing them when used by an op + unused_trainable_vars = set(all_trainable_vars) - set(ignored_scope_trainable_vars) + + # Summing gradients if we are optimizing multiple costs + global_gradients = {} + for cost, scope, local_ignored_scope in cost_and_scope: + + local_ignored_vars = [] + if isinstance(local_ignored_scope, list): + for scope_name in local_ignored_scope: + local_ignored_vars += scope_vars(scope_name, trainable_only=True) + elif local_ignored_scope is not None: + local_ignored_vars = scope_vars(local_ignored_scope, trainable_only=True) + local_ignored_vars = set(local_ignored_vars) + + # Computing gradients with respect to all scope vars (except global ignored vars, but incl. local ignored) + scope_trainable_vars = [] + scope = [scope] if not isinstance(scope, list) else scope + for scope_name in scope: + for variable in scope_vars(scope_name, trainable_only=True): + if variable not in scope_trainable_vars and variable not in ignored_scope_trainable_vars: + scope_trainable_vars += [variable] + + # Computing gradients + if self.hparams['gradient_checkpoint']: + LOGGER.info('****** Optimizing graph with gradient checkpointing...') + gradients = gradient_checkpoint.gradients(cost, scope_trainable_vars, + checkpoints=self.hparams['gradient_checkpoint'], + aggregation_method=aggregation_method) + LOGGER.info('Done optimizing graph with gradient checkpointing...') + else: + LOGGER.info('****** Computing gradients with respect to %s...', str(cost)) + gradients = tf.gradients(cost, scope_trainable_vars, aggregation_method=aggregation_method) + + # Storing gradients in global_gradients + for trainable_var, gradient in zip(scope_trainable_vars, gradients): + if trainable_var in local_ignored_vars: + continue + if trainable_var in unused_trainable_vars: + unused_trainable_vars.remove(trainable_var) + if gradient is None: + LOGGER.warning('Gradient for %s is None. Is the graph disconnected?', str(trainable_var)) + continue + if trainable_var.name in global_gradients: + global_gradients[str(trainable_var.name)] += [gradient] + else: + global_gradients[str(trainable_var.name)] = [gradient] + + # Warning about missing trainable variables + for variable in unused_trainable_vars: + LOGGER.warning('The training variable %s has not been included in the optimizer_op.', str(variable)) + + # Warning about ignored training variables + for variable in ignored_scope_trainable_vars: + LOGGER.info('Ignoring variable: "%s" (Shape: %s).', str(variable.name), str(variable.shape)) + + # Computing and clipping gradients + gradients = [] + for variable in all_trainable_vars: + var_gradients = global_gradients.get(str(variable.name), []) + if not var_gradients: + gradients += [None] + elif len(var_gradients) == 1: + gradients += var_gradients + else: + if [1 for grad in var_gradients if isinstance(grad, tf.IndexedSlices)]: + LOGGER.info('Adding IndexedSlices for %s', variable) + gradients += [tf.add_n(var_gradients, name='%s/Add_N' % (variable.name.split(':')[0]))] + gradients = [ensure_finite(gradient) for gradient in gradients] + if max_gradient_norm is not None: + gradients, _ = tf.clip_by_global_norm(gradients, max_gradient_norm) + + # Finding update ops + update_ops = [] + for _, scope, _ in cost_and_scope: + if isinstance(scope, list): + for scope_name in scope: + for update_op in tf.get_collection(tf.GraphKeys.UPDATE_OPS, scope=scope_name): + if update_op not in update_ops: + update_ops += [update_op] + else: + update_ops += tf.get_collection(tf.GraphKeys.UPDATE_OPS, scope=scope) + + # Printing number of variables + global_vars = tf.global_variables() + LOGGER.info('Model has %d global vars and %d trainable vars', len(global_vars), len(all_trainable_vars)) + + # Computing the number of parameters + nb_global_params = sum([reduce(mul, variable.shape.as_list(), 1) for variable in global_vars]) + nb_trainable_params = sum([reduce(mul, variable.shape.as_list(), 1) for variable in all_trainable_vars]) + LOGGER.info('Model has %s parameters (%s for trainable vars)', + '{:,}'.format(nb_global_params), + '{:,}'.format(nb_trainable_params)) + + # Creating optimizer op (with dependencies on update for batch norm) + with tf.control_dependencies(update_ops): + opt_op = self.optimizer.apply_gradients(zip(gradients, all_trainable_vars), global_step=self.global_step) + + # Returning optimization op + return opt_op + + def build_policy(self): + """ Builds a policy model (initial step) """ + if hasattr(self, '_build_policy_initial'): + return getattr(self, '_build_policy_initial')() + if self.parent_model is None: + raise NotImplementedError() + + # Calling our parent, and updating recursively + ret_val = self.parent_model.build_policy() + self.__dict__.update(self.parent_model.__dict__) + return ret_val + + def build_value(self): + """ Builds a value model (initial step) """ + if hasattr(self, '_build_value_initial'): + return getattr(self, '_build_value_initial')() + if self.parent_model is None: + raise NotImplementedError() + + # Calling our parent, and updating recursively + ret_val = self.parent_model.build_value() + self.__dict__.update(self.parent_model.__dict__) + return ret_val + + def build_draw(self): + """ Builds a draw model (initial step) """ + if hasattr(self, '_build_draw_initial'): + return getattr(self, '_build_draw_initial')() + if self.parent_model is None: + raise NotImplementedError() + + # Calling our parent, and updating recursively + ret_val = self.parent_model.build_draw() + self.__dict__.update(self.parent_model.__dict__) + return ret_val + + def finalize_build(self): + """ Builds the policy, value, and draw model (final step) """ + if self.build_finalized: + LOGGER.warning('Build already finalized. Skipping.') + return + + if self.parent_model: + self.parent_model.finalize_build() + self.outputs.update(self.parent_model.outputs) + + if hasattr(self, '_build_policy_final'): + getattr(self, '_build_policy_final')() + if hasattr(self, '_build_value_final'): + getattr(self, '_build_value_final')() + if hasattr(self, '_build_draw_final'): + getattr(self, '_build_draw_final')() + + self.build_finalized = True + + def encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + if hasattr(self, '_encode_board'): + return getattr(self, '_encode_board')(board_state=board_state, name=name, reuse=reuse) + if self.parent_model is None: + raise NotImplementedError() + return self.parent_model.encode_board(board_state=board_state, name=name, reuse=reuse) + + def get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + # pylint: disable=too-many-arguments + if hasattr(self, '_get_board_state_conv'): + return getattr(self, '_get_board_state_conv')(board_0yr_conv, is_training, prev_ord_conv) + if self.parent_model is None: + LOGGER.warning('Unable to find a get_board_state_conv function. Returning the `board_0yr_conv`.') + return board_0yr_conv + return self.parent_model.get_board_state_conv(board_0yr_conv, is_training, prev_ord_conv) + + def get_board_value(self, board_state, current_power, name='board_state_value', reuse=None): + """ Computes the estimated value of a board state + :param board_state: The board state - (batch, NB_NODES, NB_FEATURES) + :param current_power: The power for which we want the board value - (batch,) + :param name: The name to use for the operaton + :param reuse: Whether to reuse or not the weights from another operation + :return: The value of the board state for the specified power - (batch,) + """ + from diplomacy_research.utils.tensorflow import tf + if hasattr(self, '_get_board_value'): + return getattr(self, '_get_board_value')(board_state, current_power, name, reuse) + if self.parent_model is None: + LOGGER.warning('Unable to find a value function. Returning 0. for `get_board_value`.') + return tf.zeros_like(current_power, dtype=tf.float32) + return self.parent_model.get_board_value(board_state, current_power, name, reuse) + + def validate(self): + """ Validates the built model + Throws a RuntimeError if the model is not build properly. + """ + assert self.build_finalized, 'The model has not been finalized. Please call .finalize_build()' + self._validate() + if self.parent_model: + self.parent_model.validate() + + def get_session_args(self, decode=False, eval_loop_ix=None): + """ Returns a dict of kwargs to feed to session.run + Expected format: {fetches, feed_dict=None} + """ + fetches, feed_dict = {}, {} + + # Finding the list of models from the top parent downwards + current_model = self + models = [current_model] + while current_model.parent_model: + current_model = current_model.parent_model + models += [current_model] + + # Updates the session args + while models: + current_model = models.pop(-1) + new_session_args = current_model._get_session_args(decode=decode, eval_loop_ix=eval_loop_ix) # pylint: disable=protected-access + new_fetches = new_session_args.get('fetches', {}) + new_feed_dict = new_session_args.get('feed_dict', None) or {} + fetches.update(new_fetches) + feed_dict.update(new_feed_dict) + + # Returning + return {'fetches': fetches, 'feed_dict': feed_dict} + + def decode(self, **fetches): + """ Performs decoding on the output + :param fetches: A dictionary of fetches from the model. + :return: A dictionary of decoded results + """ + # Finding the list of models from the top parent downwards + current_model = self + models = [current_model] + while current_model.parent_model: + current_model = current_model.parent_model + models += [current_model] + + # Decoding + decoded_results = {} + while models: + current_model = models.pop(-1) + new_decoded_results = current_model._decode(**fetches) # pylint: disable=protected-access + decoded_results = merge_complex_dicts(decoded_results, new_decoded_results) + + # Returning + return decoded_results + + def evaluate(self, decoded_results, feed_dict, eval_loop_ix, incl_detailed): + """ Evaluates the model + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index + :param incl_detailed: is true if training is over, more statistics can be computed + :return: A tuple consisting of: + 1) An ordered dictionary with result_name as key and result value as value (Regular results) + 2) An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + # Finding the list of models from the top parent downwards + current_model = self + models = [current_model] + while current_model.parent_model: + current_model = current_model.parent_model + models += [current_model] + + # Evaluating + regular, detailed = OrderedDict(), OrderedDict() + while models: + current_model = models.pop(-1) + new_regular, new_detailed = current_model._evaluate(decoded_results, feed_dict, eval_loop_ix, incl_detailed) # pylint: disable=protected-access + regular = merge_complex_dicts(regular, new_regular) + detailed = merge_complex_dicts(detailed, new_detailed) + + # Returning + return regular, detailed + + def post_process_results(self, detailed_results): + """ Perform post-processing on the detailed results + :param detailed_results: An dictionary which contains detailed evaluation statistics + :return: A dictionary with the post-processed statistics. + """ + # Finding the list of models from the top parent downwards + current_model = self + models = [current_model] + while current_model.parent_model: + current_model = current_model.parent_model + models += [current_model] + + # Post-Processing + while models: + current_model = models.pop(-1) + detailed_results = current_model._post_process_results(detailed_results) # pylint: disable=protected-access + + # Returning + return detailed_results + + def add_meta_information(self, outputs): + """ Adds features, placeholders, and outputs to the meta-graph + :param outputs: A dictionary of outputs (e.g. {'training_op': ..., 'training_outputs': ...}) + :return: Nothing, but adds those items to the meta-graph + """ + from diplomacy_research.utils.tensorflow import tf + + # Storing features + for feature in self.features: + cached_features = tf.get_collection('feature_{}'.format(feature)) + if not cached_features: + tf.add_to_collection('feature_{}'.format(feature), self.features[feature]) + + # Storing placeholders + for placeholder in self.placeholders: + cached_placeholders = tf.get_collection('placeholder_{}'.format(placeholder)) + if not cached_placeholders: + tf.add_to_collection('placeholder_{}'.format(placeholder), self.placeholders[placeholder]) + + # Storing outputs in model + for output_name in outputs: + self.outputs[output_name] = outputs[output_name] + self.outputs['tag/commit_hash'] = GIT_COMMIT_HASH + self.outputs['is_trainable'] = True + self.outputs['iterator_resource'] = self.iterator_resource + + # Labeling outputs on meta-graph + # Clearing collection if we want to re-add the key + # Avoiding creating key if already present + for output_tag in self.outputs: + if output_tag in outputs and tf.get_collection(output_tag): + tf.get_default_graph().clear_collection(output_tag) + if self.outputs[output_tag] is not None \ + and not output_tag.startswith('_') \ + and not output_tag.endswith('_ta') \ + and not tf.get_collection(output_tag): + tf.add_to_collection(output_tag, self.outputs[output_tag]) + + # Storing hparams + for hparam_name, hparam_value in self.hparams.items(): + if not tf.get_collection('tag/hparam/{}'.format(hparam_name)): + tf.add_to_collection('tag/hparam/{}'.format(hparam_name), str(hparam_value)) + + def add_output(self, output_name, output_value): + """ Adds an output to all the models """ + current_model = self + while current_model: + current_model.outputs[output_name] = output_value + current_model = current_model.parent_model + + # ------------------------------------------------- + # Private Methods + # ------------------------------------------------- + @property + def _nb_evaluation_loops(self): + """ Contains the number of different evaluation tags we want to compute + This also represent the number of loops we should do over the validation set + Some model wants to calculate different statistics and require multiple pass to do that + + A value of 1 indicates to only run in the main validation loop + A value > 1 indicates to run additional loops only for this model. + """ + return 1 + + @property + def _evaluation_tags(self): + """ List of evaluation tags (1 list of evaluation tag for each evaluation loop) + e.g. [['Acc_1', 'Acc_5', 'Acc_Tokens'], ['Gr_1', 'Gr_5', 'Gr_Tokens']] + """ + return [] + + @property + def _early_stopping_tags(self): + """ List of tags to use to detect early stopping + The tags are a tuple of 1) 'min' or 'max' and 2) the tag's name + e.g. [('max', '[Gr]Acc_1'), ('min', '[TF]Perplexity')] + """ + return [] + + @property + def _placeholders(self): + """ Return a dictionary of all placeholders needed by the model """ + return {} + + @staticmethod + def _get_optimizer(learning_rate): + """ Returns the optimizer to use for this model """ + del learning_rate # Unused args + + def _validate(self): + """ Validates the built model """ + + @staticmethod + def _get_session_args(decode=False, eval_loop_ix=None): + """ Returns a dict of kwargs to feed to session.run + Expected format: {fetches, feed_dict=None} + """ + del decode, eval_loop_ix # Unused args + return {} + + @staticmethod + def _decode(**fetches): + """ Performs decoding on the output + :param fetches: A dictionary of fetches from the model. + :return: A dictionary of decoded results + """ + del fetches # Unused args + return {} + + @staticmethod + def _evaluate(decoded_results, feed_dict, eval_loop_ix, incl_detailed): + """ Evaluates the model + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index + :param incl_detailed: is true if training is over, more statistics can be computed + :return: A tuple consisting of: + 1) An ordered dictionary with result_name as key and (weight, value) as value (Regular results) + 2) An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + del decoded_results, feed_dict, eval_loop_ix, incl_detailed # Unused args + return OrderedDict(), OrderedDict() + + @staticmethod + def _post_process_results(detailed_results): + """ Perform post-processing on the detailed results + :param detailed_results: An dictionary which contains detailed evaluation statistics + :return: A dictionary with the post-processed statistics. + """ + return detailed_results diff --git a/diplomacy_research/models/datasets/__init__.py b/diplomacy_research/models/datasets/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/datasets/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/datasets/base_builder.py b/diplomacy_research/models/datasets/base_builder.py new file mode 100644 index 0000000..9949826 --- /dev/null +++ b/diplomacy_research/models/datasets/base_builder.py @@ -0,0 +1,626 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Dataset Builder + - Abstract class responsible for generating the protocol buffers to be used by the model +""" +from abc import ABCMeta +from collections import namedtuple, OrderedDict +from concurrent.futures import ProcessPoolExecutor +from copy import deepcopy +import logging +import math +import os +import pickle +from queue import Queue +import shutil +import sys +import traceback +import numpy as np +from tqdm import tqdm +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.model import pad_list, merge_dicts +from diplomacy_research.utils.proto import read_next_bytes, bytes_to_proto, proto_to_zlib, zlib_to_bytes +from diplomacy_research.settings import PROTO_DATASET_PATH, VALIDATION_SET_SPLIT, PHASES_COUNT_DATASET_PATH + +# Constants +LOGGER = logging.getLogger(__name__) + +class BaseField(namedtuple('ProtoField', ('shape', # The shape w/o the batch dimension (e.g. [81, 35]) + 'dtype')), # The final dtype required + metaclass=ABCMeta): + """ Base Proto Field """ + +class FixedProtoField(BaseField): + """ Represents a FixedLenFeature in tf.train.Example protocol buffer """ + +class VarProtoField(BaseField): + """ Represents a VarLenFeature in tf.train.Example protocol buffer """ + +class SparseProtoField(BaseField): + """ Represents a SparseFeature in a tf.train.Example protocol buffer """ + +class FixedLenFeature(namedtuple('FixedLenFeature', ('shape', 'dtype', 'default_value'))): + """ FixedLenFeature (from tf.io.FixedLenFeature) """ + +class VarLenFeature(namedtuple('VarLenFeature', ['dtype'])): + """ VarLenFeature (from tf.io.VarLenFeature) """ + + +# ---------------------------------------------------------------------------- +# ---------- THREADS METHODS ---------------- +# ---------------------------------------------------------------------------- +def handle_queues(task_ids, proto_callable, saved_game_bytes, is_validation_set): + """ Handles the next phase """ + try: + proto_results = proto_callable(saved_game_bytes, is_validation_set) + results = [] + for phase_ix, task_id in enumerate(task_ids): + if not proto_results[phase_ix]: + results.append((task_id, None, 0, None)) + continue + for power_name in proto_results[phase_ix]: + message_lengths, proto_result = proto_results[phase_ix][power_name] + results.append((task_id, power_name, message_lengths, proto_result)) + return results + except Exception as exc: + traceback.print_exc(file=sys.stdout) + raise exc + +# ---------------------------------------------------------------------------- +# ---------- BUILDER METHODS ---------------- +# ---------------------------------------------------------------------------- +class BaseBuilder(metaclass=ABCMeta): + """ This object is responsible for generating entries to feed the model (using the tf.data.dataset API) """ + # pylint: disable=too-many-instance-attributes + + # Paths as class properties + training_dataset_path = None + validation_dataset_path = None + dataset_index_path = None + + def __init__(self, extra_proto_fields=None): + """ Constructor + :param extra_proto_fields: A dictionary of extra proto fields to use when building the iterator + """ + self.features = {} + self.padded_shapes = {} + self.output_shapes = {} + self.output_types = {} + self.proto_fields = merge_dicts(self.get_proto_fields(), extra_proto_fields or {}) + + # Parsing FixedLenFeature, VarLenFeature, and SparseFeature + for feature_name, proto_field in self.proto_fields.items(): + + # FixedLenFeature + # Scalar are encoded directly (e.g. tf.int64 or tf.float32) + # Arrays are encoded with tf.string and need to be decoded with tf.io.decode_raw + if isinstance(proto_field, FixedProtoField): + if not proto_field.shape: + feature = FixedLenFeature([], self.get_encoded_dtype(proto_field.dtype), None) + else: + feature = FixedLenFeature([], np.object, None) + output_shape = proto_field.shape + padded_shape = proto_field.shape + + # VarLenFeature + # Always encoded with tf.string and decoded with tf.io.decode_raw + elif isinstance(proto_field, VarProtoField): + feature = FixedLenFeature([], np.object, None) + output_shape = [None] + padded_shape = [None] + + # SparseFeature + # Encoded with tf.string and decoded with tf.io.decode_raw + elif isinstance(proto_field, SparseProtoField): + # Adding an {}_indices + self.features['%s_indices' % feature_name] = FixedLenFeature([], np.object, None) + self.output_shapes['%s_indices' % feature_name] = [None] + self.output_types['%s_indices' % feature_name] = np.int64 + self.padded_shapes['%s_indices' % feature_name] = [None] + + # Going to the next feature + continue + else: + raise ValueError('Feature %s is not of a valid type.' % feature_name) + + # Storing results in respective dict + self.features[feature_name] = feature + self.output_shapes[feature_name] = output_shape + self.output_types[feature_name] = proto_field.dtype or np.object + self.padded_shapes[feature_name] = padded_shape + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this dataset builder """ + raise NotImplementedError() + + @staticmethod + def parse_sparse_fields(proto_fields): + """ Creates a new proto fields by replacing the SparseProto with their components """ + new_proto_fields = deepcopy(proto_fields) + for feature_name, proto_field in proto_fields.items(): + if not isinstance(proto_field, SparseProtoField): + continue + + # Removing the field + del new_proto_fields[feature_name] + nb_dims = len(proto_field.shape) + + # Adding {}_indices + new_proto_fields['%s_indices' % feature_name] = VarProtoField([None, nb_dims], dtype=np.int64) + + # Returning the new proto fields + return new_proto_fields + + @staticmethod + def get_encoded_dtype(numpy_dtype): + """ Computes the most-efficient encoding for the given dtype """ + if numpy_dtype is None: + return np.object + if numpy_dtype in [np.bool, np.uint8, np.uint16, np.int8, np.int16, np.int32, np.int64]: + return np.int64 + if numpy_dtype in [np.float16, np.float32]: + return np.float32 + raise RuntimeError('Invalid dtype specified: %s' % numpy_dtype) + + @staticmethod + def get_feedable_item(*args, **kwargs): + """ Computes and return a feedable item (to be fed into the feedable queue) """ + raise NotImplementedError() + + @staticmethod + def get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set): + """ Returns the standardized request id for this game/phase """ + return '%s/%s/%d/%s/%s' % ('train' if not is_validation_set else 'valid', + saved_game_proto.id, + phase_ix, + saved_game_proto.phases[phase_ix].name, + power_name) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + raise NotImplementedError() + + @property + def sort_dataset_by_phase(self): + """ Indicates that we want to have phase_ix 0 for all games, then phase_ix 1, ... + Otherwise, we have all phases to game id 0, then all phases for game id 1, ... + """ + return False + + @property + def group_by_message_length(self): + """ Indicates that we want to group phases with similar message length together to improve training speed. + Otherwise, a batch might include either no messages at all, or messages of very different length + """ + return False + + def parse_function(self, example_proto): + """ Parses a stored protocol buffer """ + from diplomacy_research.utils.tensorflow import tf, np_to_tf + + # Converting features to tf.io.FixedLenFeature and tf.io.VarLenFeature + tf_features = {} + for feature_name in self.features: + if isinstance(self.features[feature_name], FixedLenFeature): + tf_features[feature_name] = tf.io.FixedLenFeature(**self.features[feature_name]._asdict()) + elif isinstance(self.features[feature_name], VarLenFeature): + tf_features[feature_name] = tf.io.VarLenFeature(**self.features[feature_name]._asdict()) + else: + raise RuntimeError('Unsupported feature type.') + + data = tf.parse_single_example(example_proto, tf_features) + proto_fields = self.parse_sparse_fields(self.proto_fields) + + # Decoding from protocol buffer + for feature_name, proto_field in proto_fields.items(): + current_dtype = np.object + + # Decoding tf.string + if self.features[feature_name].dtype == np.object and proto_field.dtype is not None: + encoded_dtype = np.uint8 if proto_field.dtype == np.bool else proto_field.dtype + data[feature_name] = tf.io.decode_raw(data[feature_name], np_to_tf(encoded_dtype)) + current_dtype = encoded_dtype + + # Converting SparseTensor to Dense + if isinstance(data[feature_name], tf.SparseTensor) and isinstance(proto_field, VarProtoField): + data[feature_name] = tf.sparse.to_dense(data[feature_name]) + + # Casting to final dtype + if proto_field.dtype is not None and proto_field.dtype != current_dtype: + data[feature_name] = tf.cast(data[feature_name], np_to_tf(proto_field.dtype)) + + # Converting to final shape + if isinstance(proto_field, FixedProtoField) and proto_field.shape: + data[feature_name] = tf.reshape(data[feature_name], proto_field.shape) + + # Returning parsed data + return data + + @staticmethod + def build_example(features, proto_fields): + """ Builds a tf.train.Example to store in the protocol buffer + :param features: A dictionary of feature_name with their respective value to pad and convert + :param proto_fields: The list of proto fields defined for this protocol buffer + :return: A tf.train.Example + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.utils.tensorflow import generic_feature, strings_feature, ints_feature, floats_feature + proto_fields = BaseBuilder.parse_sparse_fields(proto_fields) + + # 0) Adding missing fields + for feature_name, proto_field in proto_fields.items(): + if feature_name not in features: + if isinstance(proto_field, FixedProtoField): + features[feature_name] = np.zeros(shape=proto_field.shape, dtype=proto_field.dtype) + elif isinstance(proto_field, VarProtoField): + features[feature_name] = [] + + # 1) Padding all FixedLenFeatures + for feature_name, proto_field in proto_fields.items(): + if isinstance(proto_field, FixedProtoField) and proto_field.shape: + features[feature_name] = pad_list(features[feature_name], proto_field.shape) + + # 2) Converting features to proper proto features + for feature_name, proto_field in proto_fields.items(): + + # Scalar - Encoding directly + if not proto_field.shape and proto_field.dtype: + encoded_dtype = BaseBuilder.get_encoded_dtype(proto_field.dtype) + if encoded_dtype == np.object: + features[feature_name] = strings_feature(features[feature_name]) + elif encoded_dtype == np.int64: + features[feature_name] = ints_feature(features[feature_name]) + elif encoded_dtype == np.float32: + features[feature_name] = floats_feature(features[feature_name]) + else: + RuntimeError('Invalid feature type') + + # Valid type according to tf.io.decode_raw + elif proto_field.dtype in [np.float16, np.float32, np.float64, np.int32, np.uint16, np.uint8, np.int16, + np.int8, np.int64, None]: + features[feature_name] = generic_feature(features[feature_name], proto_field.dtype) + + # Bool - Casting to uint8 + elif proto_field.dtype == np.bool: + features[feature_name] = generic_feature(features[feature_name], np.uint8) + + # Otherwise, unsupported dtype + else: + raise RuntimeError('Dtype %s is not supported by tf.io.decode_raw' % proto_field.dtype.name) + + # 3) Building a tf.train.Example + return tf.train.Example(features=tf.train.Features(feature=features)) + + def generate_proto_files(self, validation_perc=VALIDATION_SET_SPLIT): + """ Generates train and validation protocol buffer files + :param validation_perc: The percentage of the dataset to use to generate the validation dataset. + """ + # pylint: disable=too-many-nested-blocks,too-many-statements,too-many-branches + from diplomacy_research.utils.tensorflow import tf + + # The protocol buffers files have already been generated + if os.path.exists(self.training_dataset_path) \ + and os.path.exists(self.validation_dataset_path) \ + and os.path.exists(self.dataset_index_path): + return + + # Deleting the files if they exist + shutil.rmtree(self.training_dataset_path, ignore_errors=True) + shutil.rmtree(self.validation_dataset_path, ignore_errors=True) + shutil.rmtree(self.dataset_index_path, ignore_errors=True) + + # Making sure the proto_generation_callable is callable + proto_callable = self.proto_generation_callable + assert callable(proto_callable), "The proto_generable_callable must be a callable function" + + # Loading index + dataset_index = {} + + # Splitting games into training and validation + with open(PHASES_COUNT_DATASET_PATH, 'rb') as file: + game_ids = list(pickle.load(file).keys()) + nb_valid = int(validation_perc * len(game_ids)) + set_valid_ids = set(sorted(game_ids)[-nb_valid:]) + train_ids = list(sorted([game_id for game_id in game_ids if game_id not in set_valid_ids])) + valid_ids = list(sorted(set_valid_ids)) + + # Building a list of all task phases + train_task_phases, valid_task_phases = [], [] + + # Case 1) - We just build a list of game_ids with all their phase_ids (sorted by game id asc) + if not self.sort_dataset_by_phase: + with open(PHASES_COUNT_DATASET_PATH, 'rb') as phase_count_dataset: + phase_count_dataset = pickle.load(phase_count_dataset) + for game_id in train_ids: + for phase_ix in range(phase_count_dataset.get(game_id, 0)): + train_task_phases += [(phase_ix, game_id)] + for game_id in valid_ids: + for phase_ix in range(phase_count_dataset.get(game_id, 0)): + valid_task_phases += [(phase_ix, game_id)] + + # Case 2) - We build 10 groups sorted by game_id asc, and for each group we put all phase_ix 0, then + # all phase_ix 1, ... + # - We need to split into groups so that the model can learn a mix of game beginning and endings + # otherwise, the model will only see beginnings and after 1 day only endings + else: + with open(PHASES_COUNT_DATASET_PATH, 'rb') as phase_count_dataset: + phase_count_dataset = pickle.load(phase_count_dataset) + nb_groups = 10 + nb_items_per_group = math.ceil(len(train_ids) / nb_groups) + + # Training + for group_ix in range(nb_groups): + group_game_ids = train_ids[group_ix * nb_items_per_group:(group_ix + 1) * nb_items_per_group] + group_task_phases = [] + for game_id in group_game_ids: + for phase_ix in range(phase_count_dataset.get(game_id, 0)): + group_task_phases += [(phase_ix, game_id)] + train_task_phases += list(sorted(group_task_phases)) + + # Validation + for game_id in valid_ids: + for phase_ix in range(phase_count_dataset.get(game_id, 0)): + valid_task_phases += [(phase_ix, game_id)] + valid_task_phases = list(sorted(valid_task_phases)) + + # Grouping tasks by buckets + # buckets_pending contains a set of pending task ids in each bucket + # buckets_keys contains a list of tuples so we can group items with similar message length together + task_to_bucket = {} # {task_id: bucket_id} + train_buckets_pending, valid_buckets_pending = [], [] # [bucket_id: set()] + train_buckets_keys, valid_buckets_keys = [], [] # [bucket_id: (msg_len, task_id, power_name)] + if self.group_by_message_length: + nb_valid_buckets = int(VALIDATION_SET_SPLIT * 100) + nb_train_buckets = 100 + + # Train buckets + task_id = 1 + nb_items_per_bucket = math.ceil(len(train_task_phases) / nb_train_buckets) + for bucket_ix in range(nb_train_buckets): + items = train_task_phases[bucket_ix * nb_items_per_bucket:(bucket_ix + 1) * nb_items_per_bucket] + nb_items = len(items) + train_buckets_pending.append(set()) + train_buckets_keys.append([]) + + for _ in range(nb_items): + train_buckets_pending[bucket_ix].add(task_id) + task_to_bucket[task_id] = bucket_ix + task_id += 1 + + # Valid buckets + task_id = -1 + nb_items_per_bucket = math.ceil(len(valid_task_phases) / nb_valid_buckets) + for bucket_ix in range(nb_valid_buckets): + items = valid_task_phases[bucket_ix * nb_items_per_bucket:(bucket_ix + 1) * nb_items_per_bucket] + nb_items = len(items) + valid_buckets_pending.append(set()) + valid_buckets_keys.append([]) + + for _ in range(nb_items): + valid_buckets_pending[bucket_ix].add(task_id) + task_to_bucket[task_id] = bucket_ix + task_id -= 1 + + # Building a dictionary of {game_id: {phase_ix: task_id}} + # Train tasks have a id >= 0, valid tasks have an id < 0 + task_id = 1 + task_id_per_game = {} + for phase_ix, game_id in train_task_phases: + task_id_per_game.setdefault(game_id, {})[phase_ix] = task_id + task_id += 1 + + task_id = -1 + for phase_ix, game_id in valid_task_phases: + task_id_per_game.setdefault(game_id, {})[phase_ix] = task_id + task_id -= 1 + + # Building a dictionary of pending items, so we can write them to disk in the correct order + nb_train_tasks = len(train_task_phases) + nb_valid_tasks = len(valid_task_phases) + pending_train_tasks = OrderedDict({task_id: None for task_id in range(1, nb_train_tasks + 1)}) + pending_valid_tasks = OrderedDict({task_id: None for task_id in range(1, nb_valid_tasks + 1)}) + + # Computing batch_size, progress bar and creating a pool of processes + batch_size = 5120 + progress_bar = tqdm(total=nb_train_tasks + nb_valid_tasks) + process_pool = ProcessPoolExecutor() + futures = set() + + # Creating buffer to write all protos to disk at once + train_buffer, valid_buffer = Queue(), Queue() + + # Opening the proto file to read games + proto_dataset = open(PROTO_DATASET_PATH, 'rb') + nb_items_being_processed = 0 + + # Creating training and validation dataset + for training_mode in ['train', 'valid']: + next_key = 1 + current_bucket = 0 + + if training_mode == 'train': + pending_tasks = pending_train_tasks + buckets_pending = train_buckets_pending + buckets_keys = train_buckets_keys + buffer = train_buffer + max_next_key = nb_train_tasks + 1 + else: + pending_tasks = pending_valid_tasks + buckets_pending = valid_buckets_pending + buckets_keys = valid_buckets_keys + buffer = valid_buffer + max_next_key = nb_valid_tasks + 1 + dataset_index['size_{}_dataset'.format(training_mode)] = 0 + + # Processing with a queue to avoid high memory usage + while pending_tasks: + + # Filling queues + while batch_size > nb_items_being_processed: + saved_game_bytes = read_next_bytes(proto_dataset) + if saved_game_bytes is None: + break + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + game_id = saved_game_proto.id + if game_id not in task_id_per_game: + continue + nb_phases = len(saved_game_proto.phases) + task_ids = [task_id_per_game[game_id][phase_ix] for phase_ix in range(nb_phases)] + futures.add((tuple(task_ids), process_pool.submit(handle_queues, + task_ids, + proto_callable, + saved_game_bytes, + task_ids[0] < 0))) + nb_items_being_processed += nb_phases + + # Processing results + for expected_task_ids, future in list(futures): + if not future.done(): + continue + results = future.result() + current_task_ids = set() + + # Storing in compressed format in memory + for task_id, power_name, message_lengths, proto_result in results: + current_task_ids.add(task_id) + + if proto_result is not None: + zlib_result = proto_to_zlib(proto_result) + if task_id > 0: + if pending_train_tasks[abs(task_id)] is None: + pending_train_tasks[abs(task_id)] = {} + pending_train_tasks[abs(task_id)][power_name] = zlib_result + else: + if pending_valid_tasks[abs(task_id)] is None: + pending_valid_tasks[abs(task_id)] = {} + pending_valid_tasks[abs(task_id)][power_name] = zlib_result + + if self.group_by_message_length: + task_bucket_id = task_to_bucket[task_id] + if task_id > 0: + train_buckets_keys[task_bucket_id].append((message_lengths, task_id, power_name)) + else: + valid_buckets_keys[task_bucket_id].append((message_lengths, task_id, power_name)) + + # No results - Marking task id as done + elif task_id > 0 and pending_train_tasks[abs(task_id)] is None: + del pending_train_tasks[abs(task_id)] + elif task_id < 0 and pending_valid_tasks[abs(task_id)] is None: + del pending_valid_tasks[abs(task_id)] + + # Missing some task ids + if set(expected_task_ids) != current_task_ids: + LOGGER.warning('Missing tasks ids. Got %s - Expected: %s', current_task_ids, expected_task_ids) + current_task_ids = expected_task_ids + + # Marking tasks as completed + nb_items_being_processed -= len(expected_task_ids) + progress_bar.update(len(current_task_ids)) + + # Marking items as not pending in buckets + if self.group_by_message_length: + for task_id in current_task_ids: + task_bucket_id = task_to_bucket[task_id] + if task_id > 0: + train_buckets_pending[task_bucket_id].remove(task_id) + else: + valid_buckets_pending[task_bucket_id].remove(task_id) + + # Deleting futures to release memory + futures.remove((expected_task_ids, future)) + del future + + # Writing to disk + while True: + if self.group_by_message_length: + + # Done all buckets + if current_bucket >= len(buckets_pending): + break + + # Still waiting for tasks in the current bucket + if buckets_pending[current_bucket]: + break + + # Bucket was empty - We can look at next bucket + if not buckets_keys[current_bucket]: + current_bucket += 1 + break + + # Sorting items in bucket before writing them in buffer + items_in_bucket = list(sorted(buckets_keys[current_bucket])) + for _, task_id, power_name in items_in_bucket: + zlib_result = pending_tasks[abs(task_id)][power_name] + buffer.put(zlib_result) + dataset_index['size_{}_dataset'.format(training_mode)] += 1 + del pending_tasks[abs(task_id)][power_name] + if not pending_tasks[abs(task_id)]: + del pending_tasks[abs(task_id)] + current_bucket += 1 + del items_in_bucket + break + + # Writing to buffer in the same order as they are received + if next_key >= max_next_key: + break + if next_key not in pending_tasks: + next_key += 1 + continue + if pending_tasks[next_key] is None: + break + zlib_results = pending_tasks.pop(next_key) + for zlib_result in zlib_results.values(): + buffer.put(zlib_result) + dataset_index['size_{}_dataset'.format(training_mode)] += 1 + next_key += 1 + del zlib_results + + # Stopping pool, and progress bar + process_pool.shutdown(wait=True) + progress_bar.close() + proto_dataset.close() + + # Storing protos to disk + LOGGER.info('Writing protos to disk...') + progress_bar = tqdm(total=train_buffer.qsize() + valid_buffer.qsize()) + options = tf.io.TFRecordOptions(compression_type=tf.io.TFRecordCompressionType.GZIP) + + with tf.io.TFRecordWriter(self.training_dataset_path, options=options) as dataset_writer: + while not train_buffer.empty(): + zlib_result = train_buffer.get() + dataset_writer.write(zlib_to_bytes(zlib_result)) + progress_bar.update(1) + + with tf.io.TFRecordWriter(self.validation_dataset_path, options=options) as dataset_writer: + while not valid_buffer.empty(): + zlib_result = valid_buffer.get() + dataset_writer.write(zlib_to_bytes(zlib_result)) + progress_bar.update(1) + + with open(self.dataset_index_path, 'wb') as dataset_index_file: + pickle.dump(dataset_index, dataset_index_file, pickle.HIGHEST_PROTOCOL) + + # Closing + progress_bar.close() diff --git a/diplomacy_research/models/datasets/feedable_dataset.py b/diplomacy_research/models/datasets/feedable_dataset.py new file mode 100644 index 0000000..5705991 --- /dev/null +++ b/diplomacy_research/models/datasets/feedable_dataset.py @@ -0,0 +1,138 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Feedable Dataset + - Abstract class responsible for feeding data inside a model +""" +from abc import ABCMeta, abstractmethod +import logging +import numpy as np +from diplomacy_research.models.datasets.base_builder import BaseBuilder, VarProtoField, FixedProtoField +from diplomacy_research.utils.model import pad_list + +# Constants +LOGGER = logging.getLogger(__name__) + +class FeedableDataset(metaclass=ABCMeta): + """ This object is a generic feedable dataset """ + + def __init__(self, dataset_builder, cluster_config=None): + """ Constructor + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param cluster_config: Optional. If set, the cluster configuration will be used for distributed training. + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + self.dataset_builder = dataset_builder + self.cluster_config = cluster_config + self.proto_fields = BaseBuilder.parse_sparse_fields(dataset_builder.proto_fields) + self.default_features = {} # Will be used as default if features are missing + + self.session = None + self.iterator = None + self._is_started = False + self._is_initialized = False + self._is_closing = False + + def __del__(self): + """ Destructor """ + self.close() + + @property + def can_support_iterator(self): + """ Determines if the dataset can support an iterator or if it is a remote (RPC) dataset """ + raise NotImplementedError() + + @property + def is_started(self): + """ Determines if the dataset has been started """ + return self._is_started + + @property + def is_initialized(self): + """ Determines if the iterator is initialized """ + return self._is_initialized + + @property + def is_closing(self): + """ Determines if the dataset is closing """ + return self._is_closing + + @abstractmethod + def build(self): + """ Builds the dataset """ + raise NotImplementedError() + + @abstractmethod + def start(self, session): + """ Starts the dataset + :param session: The TensorFlow session to use. + :type session: tensorflow.python.client.session.Session + """ + raise NotImplementedError() + + @abstractmethod + def initialize(self, session): + """ Initializes the dataset (and its iterator) + :param session: The TensorFlow session to use. + :type session: tensorflow.python.client.session.Session + """ + raise NotImplementedError() + + def get_feedable_item(self, *args, **kwargs): + """ Calls the dataset_builder get_feedable_item """ + return self.dataset_builder.get_feedable_item(*args, **kwargs) + + def prepare_item(self, item): + """ Makes sure the item respects the required protofields and casts/pads the item accordingly """ + # Checking all features in items, padding them and converting them to the right dtype + for feature in item: + assert feature in self.proto_fields, 'Feature %s is not in proto fields.' % feature + proto_field = self.proto_fields[feature] + + # Converting sets to lists + if isinstance(item[feature], set): + item[feature] = list(item[feature]) + + # Var Len - Converting and flattening + # Scalar - Just converting + # Fixed Len - Padding and converting + if proto_field.dtype is None: + continue + elif isinstance(proto_field, VarProtoField): + item[feature] = np.array(item[feature], proto_field.dtype).flatten() + elif not proto_field.shape: + item[feature] = np.array(item[feature], proto_field.dtype) + elif isinstance(proto_field, FixedProtoField): + item[feature] = np.array(pad_list(item[feature], proto_field.shape), proto_field.dtype) + + # Returning item + return item + + @abstractmethod + def get_results(self, queue_name, item, retry_on_failure=True, **kwargs): + """ Computes the outputs of a name using item as inout + :param queue_name: The name of the queue where to put the item + :param item: A dictionary with the fields required for that queue + :param retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: A tornado.concurrent.Future that will be set with the results when they become available + """ + raise NotImplementedError() + + @staticmethod + def make_session_run_hook(): + """ Builds a SessionRunHook for the MonitoredTrainingSession object """ + + def close(self): + """ Stops the dataset """ + self._is_closing = True diff --git a/diplomacy_research/models/datasets/grpc_dataset.py b/diplomacy_research/models/datasets/grpc_dataset.py new file mode 100644 index 0000000..f01afad --- /dev/null +++ b/diplomacy_research/models/datasets/grpc_dataset.py @@ -0,0 +1,327 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" gRPC Dataset + - Class responsible for retrieving outputs by sending gRPC request over the network +""" +from collections import namedtuple +import logging +import time + +import numpy as np +from tornado import gen + +from diplomacy_research.models.datasets.base_builder import VarProtoField +from diplomacy_research.models.datasets.feedable_dataset import FeedableDataset +from diplomacy_research.proto.tensorflow_serving.apis.get_model_status_pb2 import GetModelStatusRequest +from diplomacy_research.proto.tensorflow_serving.apis.model_management_pb2 import ReloadConfigRequest +from diplomacy_research.proto.tensorflow_serving.apis.predict_pb2 import PredictRequest +from diplomacy_research.proto.tensorflow_serving.config import model_server_config_pb2 +from diplomacy_research.utils.cluster import is_port_opened, wrap_grpc_call +from diplomacy_research.utils.proto import make_tensor_proto, make_ndarray + +# Constants +LOGGER = logging.getLogger(__name__) +UNKNOWN, START, LOADING, AVAILABLE, UNLOADING, END = 0, 10, 20, 30, 40, 50 + +class ModelConfig(namedtuple('ModelConfig', ('name', # The name of the model + 'base_path', # The path to look for servable on disk + 'version_policy'))): # e.g {'latest': 1} or {'specific': [1, 2, 3]} + """ A ModelConfiguration to send to the TF Serving server """ + +class GRPCDataset(FeedableDataset): + """ This object is responsible for retrieving model outputs over the network using remote procedure calls """ + + def __init__(self, hostname, port, model_name, signature, dataset_builder, cluster_config=None, connect_timeout=300, + timeout=30, nb_retries=100): + """ Constructor + :param hostname: The hostname of the TensorFlow Serving server + :param port: The port used by the TensorFlow Serving server. + :param model_name: The name of the model being served by the TensorFlow Serving server. + :param signature: The output of adapter.get_signature() - signature of all the possible calls + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param cluster_config: Optional. If set, the cluster configuration will be used for distributed training. + :param connect_timeout: The timeout to try to connect to the TF serving server. + :param timeout: The timeout (in seconds) to wait for a request + :param nb_retries: The number of retries in case of grpc.RpcError before giving up. + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + # pylint: disable=too-many-arguments + super(GRPCDataset, self).__init__(dataset_builder=dataset_builder, + cluster_config=cluster_config) + self.hostname = hostname + self.port = port + self.model_name = model_name + self.signature = signature + self.timeout = timeout + self.nb_retries = nb_retries + self.channel = None + self.predict_stub = None + self.config_stub = None + + # Waiting for port to be opened + for retry_ix in range(connect_timeout): + time.sleep(1) + if is_port_opened(self.port, self.hostname): + break + if (retry_ix + 1) % 10 == 0: + LOGGER.info('Trying to connect to TF Serving at %s:%d. Attempt %d / %d', + self.hostname, self.port, retry_ix + 1, connect_timeout) + else: + raise RuntimeError('Unable to connect to %s:%d. Max attempts reached.' % (self.hostname, self.port)) + + # Building the dataset + self.build() + + @property + def can_support_iterator(self): + """ Determines if the dataset can support an iterator or if it is a remote (RPC) dataset """ + return False + + def build(self): + """ Builds the channel and the stub """ + import grpc + from diplomacy_research.proto.tensorflow_serving.apis.prediction_service_pb2_grpc import PredictionServiceStub + + assert 'request_id' in self.proto_fields, 'You need to have a "request_id" field.' + assert is_port_opened(self.port, self.hostname), 'Unable to connect to %s:%d.' % (self.hostname, self.port) + + # Creating insecure channel with corresponding stubs + self.channel = grpc.insecure_channel('%s:%d' % (self.hostname, self.port)) + self.predict_stub = PredictionServiceStub(self.channel) + + # Padding output shapes with None + output_types = self.dataset_builder.output_types + output_shapes = self.dataset_builder.output_shapes + output_shapes = {key: [None] + list(shape) for key, shape in output_shapes.items()} + + # Building a list of generic default values from the output types and output shapes + for feature_name, feature_shape in output_shapes.items(): + if output_types[feature_name] == np.object: + self.default_features[feature_name] = make_tensor_proto(bytes('', 'utf-8'), dtype=np.object, shape=[1]) + elif isinstance(self.proto_fields[feature_name], VarProtoField): + self.default_features[feature_name] = make_tensor_proto([], + dtype=output_types[feature_name], + shape=[1, 0]) + else: + self.default_features[feature_name] = make_tensor_proto(0, + dtype=output_types[feature_name], + shape=[1] + feature_shape[1:]) + + def start(self, session): + """ Starts the dataset + :param session: The TensorFlow session to use. + :type session: tensorflow.python.client.session.Session + """ + self._is_started = True + + def initialize(self, session): + """ Initializes the dataset (and its iterator) + :param session: The TensorFlow session to use. + :type session: tensorflow.python.client.session.Session + """ + self._is_initialized = True + + def has_queue(self, queue_name): + """ Determines if the feedable dataset already has a queue with the specified name """ + return queue_name in self.signature + + @staticmethod + def set_config(hostname, port, new_config, timeout=30): + """ Modify the server configuration by sending a ReloadConfigRequest + :param hostname: The hostname of the TensorFlow Serving server + :param port: The port used by the TensorFlow Serving server. + :param new_config: A ModelConfig named tuple or a list of ModelConfig named tuple + :param timeout: The timeout (in seconds) to wait for a request + :return: Boolean that indicates if the request was successful + """ + import grpc + from diplomacy_research.proto.tensorflow_serving.apis.model_service_pb2_grpc import ModelServiceStub + + config_list = [] + if not isinstance(new_config, list): + new_config = [new_config] + + # Parsing the config + for config in new_config: + assert isinstance(config, ModelConfig), 'The configuration must be an instance of ModelConfig' + this_config = {'name': config.name, + 'base_path': config.base_path, + 'model_platform': 'tensorflow'} + if isinstance(config.version_policy, dict): + if 'latest' in config.version_policy: + num_versions = int(config.version_policy.get('latest')) + this_config['model_version_policy'] = {'latest': {'num_versions': num_versions}} + elif 'specific' in config.version_policy: + specific_versions = config.version_policy.get('specific') + if not isinstance(specific_versions, list): + specific_versions = [specific_versions] + this_config['model_version_policy'] = {'specific': {'versions': specific_versions}} + config_list += [model_server_config_pb2.ModelConfig(**this_config)] + + # Building the request + request = ReloadConfigRequest(config={'model_config_list': {'config': config_list}}) + + # Sending the request + try: + channel = grpc.insecure_channel('%s:%d' % (hostname, port)) + config_stub = ModelServiceStub(channel) + config_stub.HandleReloadConfigRequest(request, timeout=timeout) + channel.close() + return True + except grpc.RpcError as grpc_error: + LOGGER.error(grpc_error) + return False + + @staticmethod + def wait_for_model_to_load(hostname, port, model_name, version_id=None, timeout=10): + """ Waits for the model to be loaded on the server + :param hostname: The hostname of the TensorFlow Serving server + :param port: The port used by the TensorFlow Serving server. + :param model_name: The model name that needs to be loaded + :param version_id: The version that should be loaded + :param timeout: The maximum number of seconds to wait. Logs an error if reached. + """ + import grpc + from diplomacy_research.proto.tensorflow_serving.apis.model_service_pb2_grpc import ModelServiceStub + + request = GetModelStatusRequest() + request.model_spec.name = model_name # pylint: disable=no-member + if version_id: + request.model_spec.version.value = version_id # pylint: disable=no-member + + # Sending the request + starting_time = time.time() + channel = grpc.insecure_channel('%s:%d' % (hostname, port)) + config_stub = ModelServiceStub(channel) + + # Looping until we get the LOADED status + while time.time() < starting_time + timeout: + try: + response = config_stub.GetModelStatus(request, timeout=10) + except grpc.RpcError as grpc_error: + if grpc_error.code() != grpc.StatusCode.NOT_FOUND: # pylint: disable=no-member + LOGGER.error(grpc_error) + channel.close() + return False + + # Not found - Sleeping and retrying + time.sleep(1.) + continue + + # Getting the status code of the latest version + nb_versions = len(response.model_version_status) + latest_version = -1 + status = UNKNOWN + error_code = 0 + error_message = "" + + for response_ix in range(nb_versions): + if response.model_version_status[response_ix].version > latest_version: + latest_version = response.model_version_status[response_ix].version + status = response.model_version_status[response_ix].state + error_code = response.model_version_status[response_ix].status.error_code + error_message = response.model_version_status[response_ix].status.error_message + + # Model has an error. Logging it and returning. + if error_code: + LOGGER.error('Model has an error. %s', error_message) + channel.close() + return False + + # Model is loaded and available + if status == AVAILABLE: + channel.close() + return True + + # Otherwise, waiting and retrying + time.sleep(0.1) + + # Model was still not available + LOGGER.warning('The model "%s" is still not available after %d seconds.', model_name, timeout) + channel.close() + return False + + @gen.coroutine + def get_results(self, queue_name, item, retry_on_failure=True, **kwargs): + """ Computes the outputs of a name using item as inout + :param queue_name: The name of the queue where to put the item (or model_name/queue_name) + :param item: A dictionary with the fields required for that queue + :param retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: A tornado.concurrent.Future that will be set with the results when they become available + """ + import grpc + + if not self.has_queue(queue_name): + LOGGER.warning('The method "%s" could not be found.', queue_name) + return None + if not isinstance(item, dict): + LOGGER.warning('The item object passed to get_results must be a dictionary.') + return None + + # Trying to infer the model_name from the queue_name + model_name = self.model_name + if '/' in queue_name: + model_name, queue_name = queue_name.split('/') + + # Preparing the item + item['request_id'] = bytes('', 'utf-8') + item = self.prepare_item(item) + + # Building the request + request = PredictRequest() + request.model_spec.name = model_name # pylint: disable=no-member + request.model_spec.signature_name = queue_name # pylint: disable=no-member + + # Setting the keys in items + # Adding a leading batch dimension, so that TF Serving can batch items properly + # i.e. (dim_1, dim_2) --> (1, dim_1, dim_2) + for key in item: + batched_item_key = item[key][None, ...] if isinstance(item[key], np.ndarray) else [item[key]] + request.inputs[key].CopyFrom(make_tensor_proto(batched_item_key, # pylint: disable=no-member + dtype=self.dataset_builder.output_types[key])) + + # Setting the placeholders defined in the signature + placeholders = self.signature[queue_name].get('placeholders', {}) + for ph_name in placeholders: + ph_value, ph_dtype = placeholders[ph_name] + request.inputs[ph_name].CopyFrom(make_tensor_proto(ph_value, dtype=ph_dtype)) # pylint: disable=no-member + + # Adding generic default values (all zeros) + for default_key, default_val in self.default_features.items(): + if default_key not in item: + request.inputs[default_key].CopyFrom(default_val) # pylint: disable=no-member + + # Sending the request and processing the response + # Trying for a maximum of self.nb_retries + for attempt_ix in range(self.nb_retries): + try: + grpc_response = yield wrap_grpc_call(self.predict_stub.Predict.future(request, timeout=self.timeout)) + return [make_ndarray(grpc_response.outputs[key])[0, ...] for key in sorted(grpc_response.outputs)] + except grpc.RpcError as grpc_error: + if not retry_on_failure: + raise grpc_error + yield gen.sleep(30) + if (attempt_ix + 1) % 10 == 0: + LOGGER.warning('Unable to get results. Attempt %d/%d', attempt_ix + 1, self.nb_retries) + + # Raising fatal exception + raise RuntimeError('Unable to get results after %d attempts. Aborting' % self.nb_retries) + + def close(self): + """ Closes the underlying channel """ + super(GRPCDataset, self).close() + if self.channel: + self.channel.close() + self.channel = None diff --git a/diplomacy_research/models/datasets/queue_dataset.py b/diplomacy_research/models/datasets/queue_dataset.py new file mode 100644 index 0000000..7769870 --- /dev/null +++ b/diplomacy_research/models/datasets/queue_dataset.py @@ -0,0 +1,611 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Queue Dataset + - Class responsible for putting entries in a queue and feeding them to the model through tf.data.dataset +""" +import logging +from queue import Queue +import time +from threading import Thread +import uuid + +import numpy as np +from tornado.concurrent import Future + +from diplomacy_research.models.datasets.base_builder import VarProtoField +from diplomacy_research.models.datasets.feedable_dataset import FeedableDataset +from diplomacy_research.utils.cluster import get_current_io_loop, PrefetchedItem +from diplomacy_research.settings import SESSION_RUN_TIMEOUT + +# Constants +LOGGER = logging.getLogger(__name__) +RUNNING, PAUSED, CLOSED = 'RUNNING', 'PAUSED', 'CLOSED' +FILLING_QUEUE = '' + +# ---------------------------------------------------------------------------- +# ---------- THREADS METHODS ---------------- +# ---------------------------------------------------------------------------- +def run_single_or_list_callable(callable_or_list, *args, **kwargs): + """ Calls a single callable or a list of callable and returns a list of results + :param callable_or_list: A single callable or a list of callables + """ + if isinstance(callable_or_list, list): + return [func(*args, **kwargs) for func in callable_or_list] + return [callable_or_list(*args, **kwargs)] + +def process_queues(dataset, in_main_thread=False): + """ This method will be launched in a separate thread and is in charge of rotating through the queues + :param dataset: The instantiated feedable dataset + :param in_main_thread: Boolean that indicates that we are running in the main Python thread. + :type dataset: QueueDataset + """ + from diplomacy_research.utils.tensorflow import tf + assert dataset.session is not None, 'Error - The dataset must have a session object attached to it' + def_options = tf.RunOptions(timeout_in_ms=SESSION_RUN_TIMEOUT) + + while not dataset.all_threads_closing: + all_queues_are_empty = True + + # Thread is paused + if dataset.all_threads_paused and not in_main_thread: + dataset.thread_status['process_queues'] = PAUSED + while dataset.all_threads_paused and not dataset.all_threads_closing: + time.sleep(0.1) + + # Thread resumed / started + if not in_main_thread: + dataset.thread_status['process_queues'] = RUNNING + + # Filling queues - Pausing + if dataset.last_queue == FILLING_QUEUE: + time.sleep(0.1) + continue + + # Looping through every queue + for queue_name in list(dataset.feedable_queues): + queue = dataset.feedable_queues[queue_name]['queue'] + outputs = dataset.feedable_queues[queue_name]['outputs'] + placeholders = dataset.feedable_queues[queue_name]['placeholders'] + with_status = dataset.feedable_queues[queue_name]['with_status'] + pre_condition_hook = dataset.feedable_queues[queue_name]['hooks'].get('pre_condition', None) + pre_run_hook = dataset.feedable_queues[queue_name]['hooks'].get('pre_run', None) + post_run_hook = dataset.feedable_queues[queue_name]['hooks'].get('post_run', None) + pre_queue_hook = dataset.feedable_queues[queue_name]['hooks'].get('pre_queue', None) + post_queue_hook = dataset.feedable_queues[queue_name]['hooks'].get('post_queue', None) + queue_size = queue.qsize() + + # [Hook] Pre-Condition + if pre_condition_hook is not None: + if False in run_single_or_list_callable(pre_condition_hook, dataset): + continue + + # Setting this queue as active + if queue_size: + all_queues_are_empty = False + dataset.active_queue = queue_name + dataset.nb_items_to_pull_from_queue = queue_size + + # [Hook] Pre-Queue + if pre_queue_hook is not None: + run_single_or_list_callable(pre_queue_hook, dataset) + + # Initializing iterator + dataset.initialize(dataset.session) + remaining_dequeues = dataset.nb_items_to_pull_from_queue + + # Processing queue + while remaining_dequeues > 0 and (dataset.nb_items_to_pull_from_queue > 0 or not dataset.is_done): + try: + # [Hook] Pre-Run + if pre_run_hook is not None: + run_single_or_list_callable(pre_run_hook, dataset) + + results = dataset.session.run(outputs, feed_dict=placeholders, options=def_options) + dataset.model_results += [results] + remaining_dequeues -= results[0].shape[0] + + # Status message + if with_status: + nb_items = results[0].shape[0] + LOGGER.info('[%s] Processed %d items. Remaining: %d/%d', + queue_name, nb_items, remaining_dequeues, queue_size) + + # [Hook] Post-Run + if post_run_hook is not None: + run_single_or_list_callable(post_run_hook, dataset) + except (tf.errors.UnavailableError, tf.errors.AbortedError) as err: + LOGGER.warning('Received a fatal error on queue %s', queue_name) + raise err + except tf.errors.OutOfRangeError: + pass + + # [Hook] Post-Queue + if post_queue_hook is not None: + run_single_or_list_callable(post_queue_hook, dataset) + + # Processing results in main thread + if in_main_thread: + process_results(dataset, in_main_thread=in_main_thread) + + # Sleeping if all queues were empty, or exiting if in main thread. + if all_queues_are_empty: + if in_main_thread: + break + time.sleep(0.1) + + # Exiting + if not in_main_thread: + dataset.thread_status['process_queues'] = CLOSED + +def process_results(dataset, in_main_thread=False): + """ This method will be launched in a separate thread and is in charge of settings the results on the calling + future objects, so that the method that has put an object in the queue knows that its results are ready. + :param dataset: The instantiated feedable dataset + :param in_main_thread: Boolean that indicates that we are running in the main Python thread. + :type dataset: QueueDataset + """ + while not dataset.all_threads_closing: + + # Thread is paused + if dataset.all_threads_paused and not in_main_thread: + dataset.thread_status['process_results'] = PAUSED + while dataset.all_threads_paused and not dataset.all_threads_closing: + time.sleep(0.1) + + # Thread resumed / started + if not in_main_thread: + dataset.thread_status['process_results'] = RUNNING + + # No items in results queue, we can sleep, or exit if in main thread. + if not dataset.model_results: + if in_main_thread: + break + time.sleep(0.1) + continue + + # Processing all items in the results queue + # The first item of the results is always the request_id + while dataset.model_results: + results = dataset.model_results.pop(0) + request_ids, output_results = results[0], results[1:] + nb_results = request_ids.shape[0] + + # Determining if we have a queue with results + # As opposed to an operation queue that doesn't return tensors + # If the output results are a tuple (as opposed to a list for each item) + # We return the tuple to each item in the batch (i.e. results are shared) + if len(results) == 1: + has_results = False + elif isinstance(output_results[0], np.ndarray): + has_results = bool(output_results[0].shape and output_results[0].shape[0] == nb_results) + elif isinstance(output_results[0], list): + has_results = len(output_results[0]) == nb_results + elif isinstance(output_results, list) and output_results: + output_results = [[result] * nb_results for result in output_results] + has_results = True + else: + has_results = False + + # Processing each request id + for result_ix in range(nb_results): + this_request_id = request_ids[result_ix].decode('utf-8') + this_result = [result[result_ix] for result in output_results] if has_results else None + + # Unknown request_id, skipping + if this_request_id not in dataset.futures_ioloop: + continue + + # Otherwise marking the future as completed + future, io_loop = dataset.futures_ioloop[this_request_id] + del dataset.futures_ioloop[this_request_id] + io_loop.asyncio_loop.call_soon_threadsafe(future.set_result, this_result) + + # Exiting + if not in_main_thread: + dataset.thread_status['process_results'] = CLOSED + +# ---------------------------------------------------------------------------- +# ---------- DATASET ---------------- +# ---------------------------------------------------------------------------- +class QueueDataset(FeedableDataset): + """ This object is responsible for generating entries to feed the model (using the tf.data.dataset API) """ + + def __init__(self, batch_size, dataset_builder, cluster_config=None, no_iterator=False): + """ Constructor + :param batch_size: The size of a batch per tower + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param cluster_config: Optional. If set, the cluster configuration will be used for distributed training. + :param no_iterator: Boolean flag that indicates to not create an iterator (it will be loaded from a ckpt) + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + super(QueueDataset, self).__init__(dataset_builder=dataset_builder, + cluster_config=cluster_config) + self.batch_size = batch_size + self.no_iterator = no_iterator + self.tf_dataset = None + + # Creating iterator with init ops + self.init_op = None + self.output_features = None # This represents iterator.get_next() + + # Feedable queues + self.feedable_queues = {} + self.active_queue = None + self.nb_items_to_pull_from_queue = 0 + self.model_results = [] + self.futures_ioloop = {} # Contains tuple (future, original thread io_loop) + self._dataset_is_done = False + self.last_queue = '' + + # Threads + self.threads = {} + self.thread_status = {'process_queues': CLOSED, 'process_results': CLOSED} + self.all_threads_paused = False + self.all_threads_closing = True + + # Building the dataset + self.build() + + @property + def can_support_iterator(self): + """ Determines if the dataset can support an iterator or if it is a remote (RPC) dataset """ + return True + + @property + def is_done(self): + """ Returns True if the end of file has been reached """ + return self._dataset_is_done + + def mark_as_done(self): + """ Marks the dataset as having reached the end of the file""" + self._dataset_is_done = True + + def build(self): + """ Builds the TensorFlow dataset """ + from diplomacy_research.utils.tensorflow import tf, np_to_tf + assert 'request_id' in self.proto_fields, 'You need to have a "request_id" field.' + + def feedable_generator(): + """ Generator that feeds data into the feedable_dataset + When this functions exits/returns, a tf.errors.OutOfRangeError is triggered + """ + while True: + next_batch = self.get_next_feedable_batch() + if next_batch is None: + self.mark_as_done() + break + yield next_batch + + # Padding output shapes with None + output_types = self.dataset_builder.output_types + output_shapes = self.dataset_builder.output_shapes + output_shapes = {key: [None] + list(shape) for key, shape in output_shapes.items()} + + # Building a list of generic default values from the output types and output shapes + for feature_name, feature_shape in output_shapes.items(): + if output_types[feature_name] == np.object: + self.default_features[feature_name] = bytes('', 'utf-8') + elif isinstance(self.proto_fields[feature_name], VarProtoField): + self.default_features[feature_name] = np.array([], dtype=output_types[feature_name]) + else: + self.default_features[feature_name] = np.zeros(shape=feature_shape[1:], + dtype=output_types[feature_name]) + + # Creates dataset + tf_output_types = {key: np_to_tf(dtype) for key, dtype in output_types.items()} + tf_output_shapes = {key: tf.TensorShape(shape) for key, shape in output_shapes.items()} + self.tf_dataset = tf.data.Dataset.from_generator(feedable_generator, + output_types=tf_output_types, + output_shapes=tf_output_shapes) + self.tf_dataset = self.tf_dataset.prefetch(1) + + # Creating iterator (with a new iterator_resource), unless specified otherwise + if not self.no_iterator: + self.create_iterator() + + def start(self, session): + """ Starts the dataset + :param session: The TensorFlow session to use. + :type session: tensorflow.python.client.session.Session + """ + if self.is_started: + LOGGER.error('Dataset was already started. Not re-starting it.') + return + self.session = session + self.initialize(session) + self.start_threads() + self._is_started = True + + def restart(self, session): + """ Restarts the threads using a (new) session object + :param session: The TensorFlow session to use. + :type session: tensorflow.python.client.session.Session + """ + if not self._is_started: + self.start(session) + return + self.session = session + self.start_threads() + + def run(self): + """ Run process queues on the current thread - This is to use the session recoverability + Note: threads needs to be paused before calling this method + """ + if not self.all_threads_paused: + LOGGER.warning('You must pause the threads before calling run(). Aborting.') + return + process_queues(self, in_main_thread=True) + + def start_threads(self): + """ (Re)-starts the threads """ + if self.thread_status['process_queues'] != CLOSED or self.thread_status['process_results'] != CLOSED: + self.stop_threads() + self.all_threads_paused = False + self.all_threads_closing = False + self.threads['process_queues'] = Thread(target=process_queues, args=(self,), daemon=True) + self.threads['process_results'] = Thread(target=process_results, args=(self,), daemon=True) + self.threads['process_queues'].start() + self.threads['process_results'].start() + + def stop_threads(self): + """ Stops the threads and waits for termination """ + self.all_threads_paused = False + self.all_threads_closing = True + if self.threads['process_queues'] is not None: + self.threads['process_queues'].join() + self.threads['process_queues'] = None + self.thread_status['process_queues'] = CLOSED + if self.threads['process_results'] is not None: + self.threads['process_results'].join() + self.threads['process_results'] = None + self.thread_status['process_results'] = CLOSED + + def pause_threads(self): + """ Pauses all running threads and wait for them to be paused """ + self.all_threads_paused = True + self.all_threads_closing = False + start_time = int(time.time()) + current_time = start_time + + # Waiting for threads to pause + while (self.thread_status['process_queues'] == RUNNING + or self.thread_status['process_results'] == RUNNING + or current_time - start_time > 60): + time.sleep(1.) + current_time = int(time.time()) + + def resume_threads(self): + """ Resumes all running threads and wait for them to be resumed """ + self.all_threads_paused = False + self.all_threads_closing = False + start_time = int(time.time()) + current_time = start_time + + # Waiting for threads to pause + while (self.thread_status['process_queues'] == PAUSED + or self.thread_status['process_results'] == PAUSED + or current_time - start_time > 60): + time.sleep(1.) + current_time = int(time.time()) + + def initialize(self, session): + """ Initializes the dataset (and its iterator) + :param session: The TensorFlow session to use. + :type session: tensorflow.python.client.session.Session + """ + # We haven't created an iterator yet + if self.iterator is None: + return + + # Running init_op + # If session is wrapped, executing it without hooks + if hasattr(session, 'run_step_fn'): + session.run_step_fn(lambda step_context: step_context.session.run(self.init_op)) + else: + session.run(self.init_op) + self._is_initialized = True + self._dataset_is_done = False + + def create_iterator(self, iterator_resource=None, shared_name=None, features=None): + """ Creates an iterator object (optionally using a shared name and a specific iterator resource) + + :param iterator_resource: A tf.resource scalar tf.Tensor representing the iterator. + :param shared_name: Optional. If non-empty, this iterator will be shared under the given name across + multiple sessions that share the same devices (e.g. when using a remote server). + :param features: If an iterator_resource is specified, this corresponds to the output of iterator.get_next() + :return: Nothing, but sets the self.iterator, self.features, and dataset init_ops + """ + if iterator_resource is not None and not self.no_iterator: + LOGGER.error('An iterator resource can only be set if the dataset was created with the "no_iterator" flag.') + raise RuntimeError("Cannot create new iterator") + if iterator_resource is not None and features is None: + LOGGER.error('The iterator features are required when reloading a saved iterator.') + raise ValueError() + + # Loading Tensorflow + from diplomacy_research.utils.tensorflow import tf + + output_types = self.tf_dataset.output_types + output_shapes = self.tf_dataset.output_shapes + output_classes = {key: tf.Tensor for key in output_types} + + # Making sure iterator is on the right device/worker + with tf.device(self.cluster_config.iterator_device if self.cluster_config else None): + + # We have an iterator resource, so we use it + if iterator_resource is not None: + self.iterator = tf.data.Iterator(iterator_resource=iterator_resource, + initializer=None, + output_types=output_types, + output_shapes=output_shapes, + output_classes=output_classes) + if features: + self.output_features = features + + # Otherwise, we create a brand new iterator + else: + self.iterator = tf.data.Iterator.from_structure(output_types, + output_shapes, + shared_name=shared_name) + self.output_features = self.iterator.get_next() + + # Generating init op + self._is_initialized = False + self.init_op = self.iterator.make_initializer(self.tf_dataset) + + def create_queue(self, queue_name, outputs, default_values=None, placeholders=None, *, + pre_condition=None, pre_queue=None, post_queue=None, pre_run=None, post_run=None, + with_status=False): + """ Creates a new feedable queue + :param queue_name: The name of the queue to add + :param outputs: A list of outputs the model needs to run and return for this queue + :param default_values: A dictionary of default values that will be added to new items in the queue + :param placeholders: A feed dict of placeholders to automatically feed when processing the queue + :param pre_condition: [Hook] Callable or list of callables. Args: (dataset) + Is run before selecting the current queue. Must return True for all callables, otherw. + the queue is skipped. + :param pre_queue: [Hook] Callable or list of callables. Args: (dataset). + This hook is ran after the queue as been selected, but before any session.run. + :param post_queue: [Hook] Callable or list of callables. Args: (dataset). + This hook is ran after all session.run for a given queue. + :param pre_run: [Hook] Callable or list of callables. Args: (dataset) + This hook is ran before each session.run + :param post_run: [Hook] Callable or list of callables. Args: (dataset) + This hook is ran after each session.run + :param with_status: Boolean that indicates that we need to display a status message after session.run() + :return: Nothing + """ + if self.has_queue(queue_name): + LOGGER.warning('The feedable queue "%s" has already been defined. Please choose a new queue name.', + queue_name) + return + + # Creating queue + self.feedable_queues[queue_name] = {'queue': Queue(), + 'outputs': [self.output_features['request_id']] + list(outputs), + 'default_values': default_values or {}, + 'placeholders': placeholders or {}, + 'with_status': with_status, + 'hooks': { + 'pre_condition': pre_condition, + 'pre_queue': pre_queue, + 'post_queue': post_queue, + 'pre_run': pre_run, + 'post_run': post_run + }} + + def has_queue(self, queue_name): + """ Determines if the feedable dataset already has a queue with the specified name """ + return queue_name in self.feedable_queues + + def get_results(self, queue_name, item, retry_on_failure=True, **kwargs): + """ Computes the outputs of a name using item as input + :param queue_name: The name of the queue where to put the item + :param item: A dictionary with the fields required for that queue + :param retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :param kwargs: Additional optional kwargs: + - prefetch: Boolean that indicates to return a PrefetchedItem, otherwise returns a future. + :return: Either: + - if not prefetch, a Future that will be set with the results when they become available + - if prefetch, a PrefetchedItem that can be put in the queue. + """ + if not self.has_queue(queue_name): + LOGGER.warning('The queue "%s" could not be found.', queue_name) + return Future().set_result(None) + if not isinstance(item, dict): + LOGGER.warning('The item object passed to get_results must be a dictionary.') + return Future().set_result(None) + + request_id = str(uuid.uuid4()) + item['request_id'] = bytes(request_id, 'utf-8') + item = self.prepare_item(item) + + # Adding default values provided + for default_key, default_val in self.feedable_queues[queue_name]['default_values'].items(): + if default_key not in item: + item[default_key] = default_val + + # Adding generic default values (all zeros) + for default_key, default_val in self.default_features.items(): + if default_key not in item: + item[default_key] = default_val + + # Prefetching - We return a prefetched item + if kwargs.get('prefetch', False): + return PrefetchedItem(queue_name, item) + + # Otherwise, we put the item in the queue and return a future + return self.put_item_in_queue(queue_name, item) + + def put_item_in_queue(self, queue_name, item): + """ Puts an item in the queue, so that it can be processed by a TensorFlow session. + :param queue_name: The name of the queue where to put the item + :param item: A dictionary with the fields required for that queue. + :return: A Future that will be set with the results when they become available + """ + item_future = Future() + request_id = item['request_id'].decode('utf-8') + self.futures_ioloop[request_id] = (item_future, get_current_io_loop()) + self.feedable_queues[queue_name]['queue'].put_nowait(item) + return item_future + + def get_next_feedable_batch(self): + """ Returns the next feedable batch in the active queue, None otherwise + The batch is a dictionary with feature names as key, and list of numpy arrays as values + """ + if not self.active_queue \ + or not self.has_queue(self.active_queue) \ + or self.nb_items_to_pull_from_queue <= 0: + return None + + # Building batch + max_items_in_batch = min(self.nb_items_to_pull_from_queue, self.batch_size) + batch = {key: [] for key in self.output_features.keys()} + nb_items_in_batch = 0 + max_var_len = {key: 0 for key in self.proto_fields if isinstance(self.proto_fields[key], VarProtoField)} + + # Building batch - No padding yet + while nb_items_in_batch < max_items_in_batch: + next_batch_of_data = self.feedable_queues[self.active_queue]['queue'].get() + for key in self.output_features.keys(): + batch[key] += [next_batch_of_data[key]] + if key in max_var_len: + max_var_len[key] = max(max_var_len[key], len(next_batch_of_data[key])) + nb_items_in_batch += 1 + + # Padding all var len features to the maximum length in batch + for padded_feature in max_var_len: + for item_ix in range(nb_items_in_batch): + current_len = len(batch[padded_feature][item_ix]) + max_len = max_var_len[padded_feature] + if current_len < max_len: + batch[padded_feature][item_ix] = np.pad(batch[padded_feature][item_ix], + (0, max_len - current_len), + mode='constant') + + # Sending to generator + self.nb_items_to_pull_from_queue -= nb_items_in_batch + return batch + + def make_session_run_hook(self): + """ Builds a SessionRunHook for the MonitoredTrainingSession object """ + from diplomacy_research.utils.tensorflow import QueueDatasetSessionRunHook + return QueueDatasetSessionRunHook(self) + + def close(self): + """ Stops iterating the dataset """ + self._is_closing = True + self.tf_dataset = None + self.stop_threads() diff --git a/diplomacy_research/models/datasets/supervised_dataset.py b/diplomacy_research/models/datasets/supervised_dataset.py new file mode 100644 index 0000000..3a71ec8 --- /dev/null +++ b/diplomacy_research/models/datasets/supervised_dataset.py @@ -0,0 +1,499 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Supervised Dataset + - Class responsible for using a training and validation dataset to feed data to the model through tf.data.dataset +""" +from enum import Enum +import logging +import os +import math +import multiprocessing +import pickle +import numpy as np +from diplomacy_research.settings import WORKING_DIR + +# Constants +LOGGER = logging.getLogger(__name__) + +class TrainingMode(Enum): + """ Enumeration of training modes """ + TRAINING = 'train' + VALIDATION = 'valid' + + +class SupervisedDataset(): + """ This object is responsible for generating entries to feed the model (using the tf.data.dataset API) """ + # pylint: disable=too-many-instance-attributes + + def __init__(self, batch_size, dataset_builder, checkpoint_dir='', cluster_config=None, debug_batch=False, + no_iterator=False, do_infinite_training=False, perc_epoch_for_training=1.): + """ Constructor + :param batch_size: The size of a batch per tower + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param checkpoint_dir: The directory where the status is to be saved. None to disable, '' for default dir. + :param cluster_config: Optional. If set, the cluster configuration will be used for distributed training. + :param debug_batch: Boolean flag to indicate to return the same batch over-and-over to debug our model + :param no_iterator: Boolean flag that indicates to not create an iterator (it will be loaded from a ckpt) + :param do_infinite_training: If set, supervised training will loop over the training set forever + and will not switch to the validation set. + :param perc_epoch_for_training: If set, the training epoch will be for this percentage of available steps + before running another evaluation epoch (e.g. 2.5% train, valid, 2.5% train, ...) + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + # pylint: disable=too-many-arguments + self._batch_size = batch_size + self.dataset_builder = dataset_builder + self.checkpoint_dir = checkpoint_dir if checkpoint_dir != '' else WORKING_DIR # None = disabled + self.cluster_config = cluster_config + self.debug_batch = debug_batch + self.no_iterator = no_iterator + self.perc_epoch_for_training = 1.00 if do_infinite_training else max(1e-3, min(1., perc_epoch_for_training)) + self.do_infinite_training = do_infinite_training + self.is_closing = False + self.session = None + + # Creating empty datasets + self.training_dataset = None + self.validation_dataset = None + self.feedable_dataset = None + + # Creating iterator with init ops + self.iterator = None + self._iterator_initialized = False + self.training_init_op = None + self.validation_init_op = None + self.output_features = None # This represents iterator.get_next() + self.default_features = {} # Will be used as default if features are missing from queue + + # Steps + self.nb_batches_to_skip = 0 # Nb of batches to skip + self.steps_in_current_mode = 0 # Step count in current mode + self.training_progress = 0. + + # Number of items remaining in epoch + self.total_nb_items_training_proto = 0 + self.total_nb_items_valid_proto = 0 + self.training_mode = TrainingMode.TRAINING + self.nb_completed_epochs = 0 + self._dataset_is_done = False + + # Loading number of items remaining + if os.path.exists(self.dataset_builder.dataset_index_path) \ + and os.path.getsize(self.dataset_builder.dataset_index_path): + with open(self.dataset_builder.dataset_index_path, 'rb') as dataset_index: + dataset_index = pickle.load(dataset_index) + self.total_nb_items_training_proto = dataset_index['size_train_dataset'] + self.total_nb_items_valid_proto = dataset_index['size_valid_dataset'] + + # Building the datasets + self.build() + + @property + def can_support_iterator(self): + """ Determines if the dataset can support an iterator or if it is a remote (RPC) dataset """ + return True + + @property + def batch_size(self): + """ Getter for batch_size """ + return self._batch_size + + @batch_size.setter + def batch_size(self, value): + """ Setter for batch_size """ + if self.num_shards is not None: + raise RuntimeError('You cannot change the batch_size when using shards') + self._batch_size = value + + @property + def num_shards(self): + """ Returns the number of shards (if a cluster config is set), otherwise None """ + return self.cluster_config.num_shards if self.cluster_config else 1 + + @property + def nb_training_steps_per_epoch(self): + """ Returns the number of training steps per epoch """ + nb_items_per_epoch = self.perc_epoch_for_training * self.total_nb_items_training_proto + return int(math.ceil(nb_items_per_epoch / (self.batch_size * self.num_shards))) + + @property + def nb_training_steps_per_full_epoch(self): # pylint: disable=invalid-name + """ Returns the number of training steps per full epoch """ + return int(math.ceil(self.total_nb_items_training_proto / (self.batch_size * self.num_shards))) + + @property + def nb_validation_steps_per_epoch(self): + """ Returns the number of validation steps per epoch """ + return int(math.ceil(self.total_nb_items_valid_proto / (self.batch_size * self.num_shards))) + + @property + def nb_total_steps_per_epoch(self): + """ Returns the total number of training and validation steps per epoch """ + return self.nb_training_steps_per_epoch + self.nb_validation_steps_per_epoch + + @property + def nb_steps_per_epoch_current_mode(self): + """ Returns the number of steps per epoch in the current mode (Training / Validation) """ + if self.training_mode == TrainingMode.VALIDATION: + return self.nb_validation_steps_per_epoch + return self.nb_training_steps_per_epoch + + @property + def iterator_initialized(self): + """ Determine if the iterator has been initialized """ + return self._iterator_initialized + + @property + def status_path(self): + """ Path to the status file on disk (where progress is saved) """ + if not self.checkpoint_dir: + return None + if not self.cluster_config: + return os.path.join(self.checkpoint_dir, 'status.pkl') + return os.path.join(self.checkpoint_dir, 'status', 'status-%03d.pkl' % self.cluster_config.task_id) + + @property + def chief_status_path(self): + """ Path to the chief status path (to validate our status) """ + if not self.cluster_config: + return None + return os.path.join(self.checkpoint_dir, 'status', 'status-%03d.pkl' % 0) + + @property + def fallback_status_path(self): + """ Path to an alternate status file if the primary is not available """ + fallbacks = [os.path.join(self.checkpoint_dir, 'status', 'status-%03d.pkl' % 0), + os.path.join(self.checkpoint_dir, 'status.pkl')] + for fallback in fallbacks: + if os.path.exists(fallback): + return fallback + return None + + @property + def is_done(self): + """ Returns True if the end of file has been reached """ + if self.do_infinite_training: + return False + return self._dataset_is_done or self.steps_in_current_mode >= self.nb_steps_per_epoch_current_mode + + def take_local_step(self): + """ Increments the local step counter """ + if not self.is_done or self.do_infinite_training: + self.steps_in_current_mode += 1 + if self.training_mode == TrainingMode.TRAINING: + self.training_progress = (self.training_progress + 1. / self.nb_training_steps_per_full_epoch) % 1 + + def mark_as_done(self): + """ Marks the dataset as having reached the end of the file""" + self._dataset_is_done = True + + def build(self): + """ Builds the TensorFlow datasets """ + from diplomacy_research.utils.tensorflow import tf + assert 'request_id' in self.dataset_builder.get_proto_fields(), 'You need to have a "request_id" field.' + + # Training dataset + self.training_dataset = tf.data.TFRecordDataset(self.dataset_builder.training_dataset_path, + compression_type='GZIP') + + # Debug (batch) mode + # Only taking one batch and looping over that batch forever + if self.debug_batch: + self.training_dataset = self.training_dataset.take(self.batch_size) + self.training_dataset = self.training_dataset.repeat(count=-1) + + # Regular mode + # Otherwise, sharding and shuffling the dataset + # Repeating to make sure all workers can loop on the dataset at all times + else: + if self.cluster_config and self.num_shards > 1: + LOGGER.info('Sharding dataset. There are %d shards. Current shard index: #%d.', + self.cluster_config.num_shards, self.cluster_config.shard_index) + shard_fn = tf.data.experimental.filter_for_shard(num_shards=self.cluster_config.num_shards, + shard_index=self.cluster_config.shard_index) + self.training_dataset = self.training_dataset.apply(shard_fn) + self.training_dataset = self.training_dataset.repeat() + self.training_dataset = self.training_dataset.shuffle(100 * self.batch_size) + + # Batching with prefetching + self.training_dataset = self.training_dataset.map(self.dataset_builder.parse_function, + num_parallel_calls=multiprocessing.cpu_count()) + self.training_dataset = self.training_dataset.prefetch(100 * self.batch_size) + self.training_dataset = self.training_dataset.padded_batch(self.batch_size, + padded_shapes=self.dataset_builder.padded_shapes) + + # Building a list of generic default values from the output types and output shapes + self.default_features = {} + for feature_name, feature_shape in self.dataset_builder.output_shapes.items(): + if self.dataset_builder.output_types[feature_name] == np.object: + self.default_features[feature_name] = bytes('', 'utf-8') + else: + dtype = self.dataset_builder.output_types[feature_name] + self.default_features[feature_name] = np.zeros(shape=feature_shape[1:], dtype=dtype) + + # ----------------------------- + # Validation dataset + self.validation_dataset = tf.data.TFRecordDataset(self.dataset_builder.validation_dataset_path, + compression_type='GZIP') + + # Sharding, but no need to shuffle + if self.cluster_config and self.num_shards > 1: + shard_fn = tf.data.experimental.filter_for_shard(num_shards=self.cluster_config.num_shards, + shard_index=self.cluster_config.shard_index) + self.validation_dataset = self.validation_dataset.apply(shard_fn) + + # Batching with prefetching + self.validation_dataset = self.validation_dataset.map(self.dataset_builder.parse_function, + num_parallel_calls=multiprocessing.cpu_count()) + self.validation_dataset = self.validation_dataset.prefetch(20 * self.batch_size) + self.validation_dataset = self.validation_dataset.padded_batch(self.batch_size, + padded_shapes=self.dataset_builder.padded_shapes) + + # Creating iterator (with a new iterator_resource), unless specified otherwise + if not self.no_iterator: + self.create_iterator() + + def create_iterator(self, iterator_resource=None, shared_name=None, features=None): + """ Creates an iterator object (optionally using a shared name and a specific iterator resource) + + :param iterator_resource: A tf.resource scalar tf.Tensor representing the iterator. + :param shared_name: Optional. If non-empty, this iterator will be shared under the given name across + multiple sessions that share the same devices (e.g. when using a remote server). + :param features: If an iterator_resource is specified, this corresponds to the output of iterator.get_next() + :return: Nothing, but sets the self.iterator, self.features, and dataset init_ops + """ + if iterator_resource is not None and not self.no_iterator: + LOGGER.error('An iterator resource can only be set if the dataset was created with the "no_iterator" flag.') + raise RuntimeError("Cannot create new iterator") + if iterator_resource is not None and features is None: + LOGGER.error('The iterator features are required when reloading a saved iterator.') + raise ValueError() + + # Loading TensorFlow + from diplomacy_research.utils.tensorflow import tf + + output_types = self.training_dataset.output_types + output_shapes = self.training_dataset.output_shapes + output_classes = self.training_dataset.output_classes + + # Making sure itertor is on the right device/worker + with tf.device(self.cluster_config.iterator_device if self.cluster_config else None): + + # We have an iterator resource, so we use it + if iterator_resource is not None: + self.iterator = tf.data.Iterator(iterator_resource=iterator_resource, + initializer=None, + output_types=output_types, + output_shapes=output_shapes, + output_classes=output_classes) + if features: + self.output_features = features + + # Otherwise, we create a brand new iterator + else: + self.iterator = tf.data.Iterator.from_structure(output_types=output_types, + output_shapes=output_shapes, + output_classes=output_classes, + shared_name=shared_name) + self.output_features = self.iterator.get_next() + + # Generating init op for each dataset + # Using different names because we can't define initializers with the same name + self._iterator_initialized = False + self.training_init_op = self.iterator.make_initializer(self.training_dataset) + self.validation_init_op = self.iterator.make_initializer(self.validation_dataset) + + def initialize_iterator(self, session): + """ Initializes the current iterator + :param session: The session used to initialize the init op + :type session: tensorflow.python.client.session.Session + """ + # We haven't created an iterator yet + if self.iterator is None: + return + + # Loading TensorFlow + from diplomacy_research.utils.tensorflow import tf + + # Running init_op + # If session is wrapped, executing it without hooks + init_op = {TrainingMode.TRAINING: self.training_init_op, + TrainingMode.VALIDATION: self.validation_init_op}[self.training_mode] + if hasattr(session, 'run_step_fn'): + session.run_step_fn(lambda step_context: step_context.session.run(init_op)) + else: + session.run(init_op) + self._iterator_initialized = True + self._dataset_is_done = False + + # For validation set, we can reset the steps since we are always starting from the beginning + # For training, we might resume mid-epoch (from load_status()) - So we keep the current value + if self.training_mode == TrainingMode.VALIDATION: + self.steps_in_current_mode = 0 + + # Resuming by skipping a certain number of already processed items + if self.nb_batches_to_skip: + LOGGER.info('Resuming training by skipping %d batches in the training dataset.', self.nb_batches_to_skip) + try: + for _ in range(self.nb_batches_to_skip): + if hasattr(session, 'run_step_fn'): + session.run_step_fn( + lambda step_context: step_context.session.run(self.output_features['request_id'])) + else: + session.run(self.output_features['request_id']) + except tf.errors.OutOfRangeError: + self.mark_as_done() + self.nb_batches_to_skip = 0 + + def start_training_mode(self, session): + """ Starts the dataset in training mode + :param session: The session used to initialize the init op + :type session: tensorflow.python.client.session.Session + """ + if self.is_done: + self.nb_completed_epochs += 1 + self.nb_batches_to_skip = int(self.training_progress * self.nb_training_steps_per_full_epoch) + self.training_mode = TrainingMode.TRAINING + self.steps_in_current_mode = 0 + self.initialize_iterator(session) + + def start_validation_mode(self, session): + """ Starts the dataset in validation mode + :param session: The session used to initialize the init op + :type session: tensorflow.python.client.session.Session + """ + if self.do_infinite_training: + LOGGER.error('Dataset is currently in "infinite training" mode. Only the training set can be accessed.') + raise RuntimeError('Invalid training mode specified.') + self.training_mode = TrainingMode.VALIDATION + self.steps_in_current_mode = 0 + self.initialize_iterator(session) + + def get_progress(self): + """ Returns the number of completed epochs, and the current % of the epoch completed """ + if self.do_infinite_training: + self.nb_completed_epochs = int(self.steps_in_current_mode / self.nb_training_steps_per_full_epoch) + perc_epoch_completed = self.steps_in_current_mode / self.nb_steps_per_epoch_current_mode + return self.nb_completed_epochs, perc_epoch_completed + + def save_status(self): + """ Save current status to file to be able to resume later """ + # Not saving status if checkpoint_dir is None + if not self.status_path: + return + + # Recomputing nb of completed epochs when doing infinite training + if self.do_infinite_training: + self.nb_completed_epochs = int(self.steps_in_current_mode / self.nb_training_steps_per_full_epoch) + + # Creating directory and saving + if not os.path.exists(os.path.dirname(self.status_path)): + os.makedirs(os.path.dirname(self.status_path), exist_ok=True) + + status = {'training_mode': self.training_mode, + 'nb_completed_epochs': self.nb_completed_epochs, + 'steps_current_mode': self.steps_in_current_mode, + 'training_progress': self.training_progress, + 'num_shards': self.num_shards} + with open(self.status_path, 'wb') as file: + pickle.dump(status, file, pickle.HIGHEST_PROTOCOL) + + def load_status(self): + """ Loads dataset status from disk and resume where we were """ + status = {} + status_loaded = False + + # Not loading status if checkpoint_dir is None. + if not self.status_path: + return + + # Trying to load from primary path + if os.path.exists(self.status_path) and os.path.getsize(self.status_path): + with open(self.status_path, 'rb') as status: + status = pickle.load(status) + + # Detecting num of shards change and deleting file if that's the case + if self.num_shards == status['num_shards']: + status_loaded = True + else: + LOGGER.info('Number of shards has changed from %d to %d', status['num_shards'], self.num_shards) + + # If we are chief, we do a cleanup on the status folder + if self.cluster_config and self.cluster_config.is_chief: + for status_ix in range(self.num_shards, status['num_shards']): + if os.path.exists(os.path.join(self.checkpoint_dir, 'status', 'status-%03d.pkl' % status_ix)): + os.unlink(os.path.join(self.checkpoint_dir, 'status', 'status-%03d.pkl' % status_ix)) + + # Otherwise, we just delete the worker status file + else: + os.unlink(self.status_path) + + # We load the fallback status + if not status_loaded and self.fallback_status_path: + try: + with open(self.fallback_status_path, 'rb') as status: + status = pickle.load(status) + status_loaded = True + except EOFError: + pass + + # We load the chief status to validate that we have the same training_mode and nb_epochs + if self.cluster_config and os.path.exists(self.chief_status_path) and os.path.getsize(self.chief_status_path): + with open(self.chief_status_path, 'rb') as chief_status: + chief_status = pickle.load(chief_status) + else: + chief_status = status + + # We couldn't find a status file to load, aborting + if not status_loaded: + return + + # If we have the same value as the chief, we load our status, otherwise we use the chief + use_own_status = ((status['training_mode'] == chief_status['training_mode']) + and status['nb_completed_epochs'] == chief_status['nb_completed_epochs']) + + # Loading status + self._iterator_initialized = False + if use_own_status: + self.training_mode = status['training_mode'] + self.nb_completed_epochs = status['nb_completed_epochs'] + self.steps_in_current_mode = status['steps_current_mode'] + self.training_progress = status['training_progress'] + if self.training_mode == TrainingMode.VALIDATION: + self.steps_in_current_mode = 0 + else: + LOGGER.warning('Status between worker and chief does not match. Resuming using chief status.') + self.training_mode = chief_status['training_mode'] + self.nb_completed_epochs = chief_status['nb_completed_epochs'] + self.steps_in_current_mode = chief_status['steps_current_mode'] + self.training_progress = chief_status['training_progress'] + if self.training_mode == TrainingMode.VALIDATION: + self.steps_in_current_mode = 0 + + # If we were training the train dataset, we need to skip a certain number of batches + # to get to the same training point + if self.training_mode == TrainingMode.TRAINING: + self.nb_batches_to_skip = int(self.training_progress * self.nb_training_steps_per_full_epoch) + + def make_session_run_hook(self): + """ Builds a SessionRunHook for the MonitoredTrainingSession object """ + from diplomacy_research.utils.tensorflow import SupervisedDatasetSessionRunHook + return SupervisedDatasetSessionRunHook(self) + + def close(self): + """ Stops iterating the dataset """ + self.is_closing = True + self.training_dataset = None + self.validation_dataset = None diff --git a/diplomacy_research/models/draw/__init__.py b/diplomacy_research/models/draw/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/draw/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/draw/base_draw_model.py b/diplomacy_research/models/draw/base_draw_model.py new file mode 100644 index 0000000..c7f0c0c --- /dev/null +++ b/diplomacy_research/models/draw/base_draw_model.py @@ -0,0 +1,172 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Draw model + - Contains the base draw model, which is used by all draw models. +""" +from collections import OrderedDict +import logging +import re +from diplomacy_research.models.base_model import BaseModel + +# Constants +LOGGER = logging.getLogger(__name__) +VALID_TAG = re.compile('^tag/draw/v[0-9]{3}_[a-z0-9_]+$') + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return [ + ('int', 'draw_model_id', -1, 'The model ID of the value function.'), + ('float', 'draw_coeff', 1.0, 'The coefficient to apply to the draw loss') + ] + +class BaseDrawModel(BaseModel): + """ Base Draw Model""" + + def __init__(self, parent_model, dataset, hparams): + """ Initialization + :param parent_model: A `base_model` to which we are adding features + :param dataset: The dataset that is used to iterate over the data. + :param hparams: A dictionary of hyper parameters with their values + :type parent_model: diplomacy_research.models.base_model.BaseModel + :type dataset: diplomacy_research.models.datasets.supervised_dataset.SupervisedDataset + :type dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + """ + BaseModel.__init__(self, parent_model, dataset, hparams) + self.build_draw() + + @property + def _nb_evaluation_loops(self): + """ Contains the number of different evaluation tags we want to compute + This also represent the number of loops we should do over the validation set + Some model wants to calculate different statistics and require multiple pass to do that + + A value of 1 indicates to only run in the main validation loop + A value > 1 indicates to run additional loops only for this model. + """ + return 1 + + @property + def _evaluation_tags(self): + """ List of evaluation tags (1 list of evaluation tag for each evaluation loop) + e.g. [['Acc_1', 'Acc_5', 'Acc_Tokens'], ['Gr_1', 'Gr_5', 'Gr_Tokens']] + """ + return [['[Draw]L2_Loss']] + + @property + def _early_stopping_tags(self): + """ List of tags to use to detect early stopping + The tags are a tuple of 1) 'min' or 'max' and 2) the tag's name + e.g. [('max', '[Gr]Acc_1'), ('min', '[TF]Perplexity')] + """ + return [('min', '[Draw]L2_Loss')] + + @property + def _placeholders(self): + """ Return a dictionary of all placeholders needed by the model """ + from diplomacy_research.utils.tensorflow import tf, get_placeholder_with_default + return { + 'stop_gradient_all': get_placeholder_with_default('stop_gradient_all', False, shape=(), dtype=tf.bool) + } + + def _build_draw_initial(self): + """ Builds the draw model (initial step) """ + raise NotImplementedError() + + def _build_draw_final(self): + """ Builds the draw model (final step) """ + + def _get_session_args(self, decode=False, eval_loop_ix=None): + """ Returns a dict of kwargs to feed to session.run + Expected format: {fetches, feed_dict=None} + """ + # Detecting if we are doing validation + in_validation, our_validation = False, False + if eval_loop_ix is not None: + in_validation = True + our_validation = eval_loop_ix in self.my_eval_loop_ixs + + # --------- Fetches --------------- + train_fetches = {'optimizer_op': self.outputs['optimizer_op'], + 'draw_loss': self.outputs['draw_loss']} + + eval_fetches = {'draw_loss': self.outputs['draw_loss']} + + # --------- Feed dict -------------- + # Building feed dict + feed_dict = {self.placeholders['stop_gradient_all']: False} + + # --------- Validation Loop -------------- + # Validation Loop - Running one of our validation loops + if our_validation: + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Validation Loop - Running someone else validation loop + if in_validation: + return {'feed_dict': feed_dict} + + # --------- Training Loop -------------- + # Training Loop - We want to decode the specific batch to display stats + if decode: + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Training Loop - Training the model + return {'fetches': train_fetches, 'feed_dict': feed_dict} + + def _validate(self): + """ Validates the built model """ + # Making sure all the required outputs are present + assert 'draw_target' in self.features + assert 'draw_prob' in self.outputs + assert 'draw_loss' in self.outputs + assert len(self.outputs['draw_prob'].shape) == 1 + + # Making sure we have a name tag + for tag in self.outputs: + if VALID_TAG.match(tag): + break + else: + raise RuntimeError('Unable to find a name tag. Format: "tag/draw/v000_xxxxxx".') + + @staticmethod + def _decode(**fetches): + """ Performs decoding on the output (draw model) + :param fetches: A dictionary of fetches from the model. + :return: A dictionary of decoded results, including various keys for evaluation + """ + if 'draw_loss' not in fetches: + return {} + return {'draw_loss': fetches['draw_loss']} + + def _evaluate(self, decoded_results, feed_dict, eval_loop_ix, incl_detailed): + """ Calculates the accuracy of the model + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index + :param incl_detailed: is true if training is over, more statistics can be computed + :return: A tuple consisting of: + 1) An ordered dictionary with result_name as key and (weight, value) as value (Regular results) + 2) An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + # Detecting if it's our evaluation or not + if eval_loop_ix == -1: + pass + else: + our_validation = eval_loop_ix in self.my_eval_loop_ixs + if not our_validation: + return OrderedDict(), OrderedDict() + + # Returning evaluation results + return OrderedDict({'[Draw]L2_Loss': (1, decoded_results['draw_loss'])}), OrderedDict() diff --git a/diplomacy_research/models/draw/tests/draw_model_test_setup.py b/diplomacy_research/models/draw/tests/draw_model_test_setup.py new file mode 100644 index 0000000..f5dcee2 --- /dev/null +++ b/diplomacy_research/models/draw/tests/draw_model_test_setup.py @@ -0,0 +1,151 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generic class to tests for draw model correctness """ +from tornado import gen +from tornado.ioloop import IOLoop +from diplomacy import Game +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.state_space import extract_state_proto, extract_phase_history_proto, \ + extract_possible_orders_proto +from diplomacy_research.utils.cluster import process_fetches_dict + + +class DrawModelTestSetup(): + """ Creates a testable setup to test a model and a constructor """ + + def __init__(self, policy_model_ctor, value_model_ctor, draw_model_ctor, dataset_builder, adapter_ctor, + load_policy_args, load_value_args, load_draw_args): + """ Constructor + :param policy_model_ctor: The policy model constructor to create the policy. + :param value_model_ctor: The value model constructor to create the value model. + :param draw_model_ctor: The draw model constructor to create the draw model. + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param adaptor_ctor: The policy adapter constructor to create the policy adapter + :param load_policy_args: Reference to the callable function required to load policy args + :param load_value_args: Reference to the callable function required to load value args + :param load_draw_args: Reference to the callable function required to load draw args + :type policy_model_ctor: diplomacy_research.models.policy.base_policy_model.BasePolicyModel.__class__ + :type value_model_ctor: diplomacy_research.models.value.base_value_model.BaseValueModel.__class__ + :type draw_model_ctor: diplomacy_research.models.draw.base_draw_model.BaseDrawModel.__class__ + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + """ + # pylint: disable=too-many-arguments + # Parsing new flags + args = load_policy_args() + if load_value_args is not None: + args += load_value_args() + args += load_draw_args() + self.hparams = self.parse_flags(args) + + # Other attributes + self.graph = None + self.sess = None + self.adapter = None + self.queue_dataset = None + self.policy_model_ctor = policy_model_ctor + self.value_model_ctor = value_model_ctor + self.draw_model_ctor = draw_model_ctor + self.dataset_builder = dataset_builder + self.adapter_ctor = adapter_ctor + + def build_model(self): + """ Builds the model """ + from diplomacy_research.utils.tensorflow import tf + graph = tf.Graph() + with graph.as_default(): + + # Creating dataset + self.queue_dataset = QueueDataset(batch_size=self.hparams['batch_size'], + dataset_builder=self.dataset_builder) + + # Creating model and validating + model = self.policy_model_ctor(self.queue_dataset, self.hparams) + if self.value_model_ctor is not None: + model = self.value_model_ctor(model, self.queue_dataset, self.hparams) + model = self.draw_model_ctor(model, self.queue_dataset, self.hparams) + model.finalize_build() + model.validate() + + self.graph = graph + self.sess = tf.Session(graph=graph) + + @staticmethod + def parse_flags(args): + """ Parse flags without calling tf.app.run() """ + define = {'bool': lambda x: bool(x), # pylint: disable=unnecessary-lambda + 'int': lambda x: int(x), # pylint: disable=unnecessary-lambda + 'str': lambda x: str(x), # pylint: disable=unnecessary-lambda + 'float': lambda x: float(x), # pylint: disable=unnecessary-lambda + '---': lambda x: x} # pylint: disable=unnecessary-lambda + + # Keeping a dictionary of parse args to overwrite if provided multiple times + flags = {} + for arg in args: + arg_type, arg_name, arg_value, _ = arg + flags[arg_name] = define[arg_type](arg_value) + if arg_type == '---' and arg_name in flags: + del flags[arg_name] + return flags + + def run_tests(self): + """ Run all tests """ + IOLoop.current().run_sync(self.run_tests_async) + + @gen.coroutine + def run_tests_async(self): + """ Run tests in an asynchronous IO Loop """ + self.build_model() + self.adapter = self.adapter_ctor(self.queue_dataset, self.graph, session=self.sess) + yield self.test_get_draw_prob() + + @gen.coroutine + def test_get_draw_prob(self): + """ Checks if the .get_draw_prob method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + kwargs = {'player_seed': 0, 'noise': 0., 'temperature': 1., 'dropout_rate': 0.} + + # Temperature == 1. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + _, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **kwargs) + else: + fetches = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + _, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **kwargs) + + assert policy_details['draw_action'] in (True, False) + assert 0. < policy_details['draw_prob'] < 1. diff --git a/diplomacy_research/models/draw/v001_draw_relu/__init__.py b/diplomacy_research/models/draw/v001_draw_relu/__init__.py new file mode 100644 index 0000000..c6299af --- /dev/null +++ b/diplomacy_research/models/draw/v001_draw_relu/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v001_draw_relu Draw Model """ +from .model import DrawModel, load_args diff --git a/diplomacy_research/models/draw/v001_draw_relu/model.py b/diplomacy_research/models/draw/v001_draw_relu/model.py new file mode 100644 index 0000000..2182dc1 --- /dev/null +++ b/diplomacy_research/models/draw/v001_draw_relu/model.py @@ -0,0 +1,118 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Draw model (v001_draw_relu) + - Contains the draw model +""" +import logging +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_NODES, NB_FEATURES, NB_POWERS +from diplomacy_research.models.draw.base_draw_model import BaseDrawModel, load_args as load_parent_args + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'draw_gcn_1_output_size', 25, 'Graph Conv 1 output size.'), + ('int', 'draw_embedding_size', 128, 'Embedding size.'), + ('int', 'draw_h1_size', 64, 'The size of the first hidden layer in the draw calculation'), + ('int', 'draw_h2_size', 64, 'The size of the second hidden layer in the draw calculation') + ] + +class DrawModel(BaseDrawModel): + """ Draw Model - Evaluates whether a given power should accept a draw or not """ + + def _build_draw_initial(self): + """ Builds the draw model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import GraphConvolution, preprocess_adjacency + from diplomacy_research.utils.tensorflow import to_float + + if not self.placeholders: + self.placeholders = self.get_placeholders() + else: + self.placeholders.update(self.get_placeholders()) + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + sigmoid = tf.nn.sigmoid + + # Training loop + with tf.variable_scope('draw', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.float32 - (b, NB_NODES, NB_FEATURES) + current_power = self.features['current_power'] # tf.int32 - (b,) + draw_target = self.features['draw_target'] # tf.float32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Norm Adjacency + batch_size = tf.shape(board_state)[0] + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [batch_size, 1, 1]) + + # Graph embeddings + with tf.variable_scope('graph_conv_scope'): + board_state_h0 = board_state # (b, 81, 35) + board_state_h1 = GraphConvolution(input_dim=NB_FEATURES, + output_dim=hps('draw_gcn_1_output_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + bias=True)(board_state_h0) # (b, 81, 25) + + # board_state_h2: (b, 2025) + # board_state_h3: (b, 128) + board_state_h2 = tf.reshape(board_state_h1, shape=[-1, NB_NODES * hps('draw_gcn_1_output_size')]) + board_state_graph_conv = tf.layers.Dense(units=hps('draw_embedding_size'), + activation=relu, + use_bias=True)(board_state_h2) + + # Calculating draw for all powers + with tf.variable_scope('draw_scope'): + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + + draw_h0 = board_state_graph_conv # (b, 128) + draw_h1 = tf.layers.Dense(units=hps('draw_h1_size'), # (b, 64) + activation=relu, + use_bias=True)(draw_h0) + draw_h2 = tf.layers.Dense(units=hps('draw_h2_size'), # (b, 64) + activation=relu, + use_bias=True)(draw_h1) + draw_probs = tf.layers.Dense(units=NB_POWERS, # (b, 7) + activation=sigmoid, + use_bias=True)(draw_h2) + draw_prob = tf.reduce_sum(draw_probs * current_power_mask, axis=1) # (b,) + + # Computing draw loss + with tf.variable_scope('draw_loss'): + draw_loss = tf.reduce_mean(tf.square(draw_target - draw_prob)) + draw_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(draw_loss), # pylint: disable=cell-var-from-loop + lambda: draw_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/draw/v001_draw_relu': True, + 'draw_prob': draw_prob, + 'draw_loss': draw_loss} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/draw/v001_draw_relu/tests/__init__.py b/diplomacy_research/models/draw/v001_draw_relu/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/draw/v001_draw_relu/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/draw/v001_draw_relu/tests/test_model.py b/diplomacy_research/models/draw/v001_draw_relu/tests/test_model.py new file mode 100644 index 0000000..1573ccf --- /dev/null +++ b/diplomacy_research/models/draw/v001_draw_relu/tests/test_model.py @@ -0,0 +1,60 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the v001_draw_relu DrawModel """ +from diplomacy_research.models.policy import order_based +from diplomacy_research.models.policy import token_based +import diplomacy_research.models.policy.order_based.v005_markovian_film_board_align as order_based_model +import diplomacy_research.models.policy.token_based.v005_markovian_film_board_align as token_based_model +from diplomacy_research.models.draw.tests.draw_model_test_setup import DrawModelTestSetup +from diplomacy_research.models.draw.v001_draw_relu import DrawModel, load_args +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Launch Scripts -------------- +def launch_order_based(): + """ Launches tests for order based """ + model_family_path = order_based + model_version_path = order_based_model + test_object = DrawModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=None, + draw_model_ctor=DrawModel, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=None, + load_draw_args=load_args) + test_object.run_tests() + +def launch_token_based(): + """ Launches tests for token based """ + model_family_path = token_based + model_version_path = token_based_model + test_object = DrawModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=None, + draw_model_ctor=DrawModel, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=None, + load_draw_args=load_args) + test_object.run_tests() + +# ----------- Tests -------------- +def test_order_based(): + """ Runs the order_based test """ + run_in_separate_process(target=launch_order_based, timeout=120) + +def test_token_based(): + """ Runs the token_based test """ + run_in_separate_process(target=launch_token_based, timeout=120) diff --git a/diplomacy_research/models/gym/__init__.py b/diplomacy_research/models/gym/__init__.py new file mode 100644 index 0000000..44631cb --- /dev/null +++ b/diplomacy_research/models/gym/__init__.py @@ -0,0 +1,25 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" OpenAI Gym integration modules """ +import warnings +from gym.envs.registration import register +from diplomacy_research.models.gym.wrappers import AutoDraw, LimitNumberYears, LoopDetection, SetInitialState, \ + AssignPlayers, RandomizePlayers, SetPlayerSeed, SaveGame + +# Ignore specific warnings +warnings.filterwarnings('ignore', message='Parameters to load are deprecated') + +register( + id='DiplomacyEnv-v0', + entry_point='diplomacy_research.models.gym.environment:DiplomacyEnv') diff --git a/diplomacy_research/models/gym/environment.py b/diplomacy_research/models/gym/environment.py new file mode 100644 index 0000000..ac6ec75 --- /dev/null +++ b/diplomacy_research/models/gym/environment.py @@ -0,0 +1,127 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" OpenAI Gym Environment for Diplomacy + - Implements a gym environment to train the RL model +""" +from enum import Enum +import logging +import gym +from gym.utils import seeding +from diplomacy import Game +from diplomacy_research.models.state_space import get_game_id, get_player_seed, get_map_powers + +# Constants +LOGGER = logging.getLogger(__name__) + +class DoneReason(Enum): + """ Enumeration of reasons why the environment has terminated """ + NOT_DONE = 'not_done' # Partial game - Not yet completed + GAME_ENGINE = 'game_engine' # Triggered by the game engine + AUTO_DRAW = 'auto_draw' # Game was automatically drawn accord. to some prob. + PHASE_LIMIT = 'phase_limit' # The maximum number of phases was reached + THRASHED = 'thrashed' # A loop was detected. + +class DiplomacyEnv(gym.Env): + """ Gym environment wrapper for the Diplomacy board game. """ + metadata = {'render.modes': ['human']} + + def __init__(self): + """ Constructor """ + self.game = None + self.curr_seed = 0 + self._last_known_phase = 'S1901M' + + @property + def current_year(self): + """ Returns the current year of the game in normalized format + e.g. S1901M = year 1 + F1903M = year 3 + COMPLETED = year of last phase + """ + current_phase = self.game.get_current_phase() + if current_phase == 'COMPLETED': + current_phase = self._last_known_phase + return int(current_phase[1:5]) - self.game.map.first_year + 1 + + @property + def game_id(self): + """ Returns the current game game_id """ + if self.game: + return self.game.game_id + return '' + + @property + def players(self): + """ Returns a list of players instances playing the game """ + raise NotImplementedError() + + @property + def is_done(self): + """ Determines if the game is done """ + return self.game.is_game_done + + @property + def done_reason(self): + """ Returns the reason why the game was terminated """ + if self.is_done: + return DoneReason.GAME_ENGINE + return None + + def process(self): + """ Requests that the game processes the current orders """ + self.game.process() + current_phase = self.game.get_current_phase() + if current_phase != 'COMPLETED': + self._last_known_phase = current_phase + + def seed(self, seed=None): + """ Sets a random seed """ + self.curr_seed = seeding.hash_seed(seed) % 2 ** 32 + return [self.curr_seed] + + def step(self, action): + """ Have one agent interact with the environment once. + :param action: Tuple containing the POWER name and its corresponding list of orders. + (e.g. ('FRANCE', ['A PAR H', 'A MAR - BUR', ...]) + :return: Nothing + """ + power_name, orders = action + if self.game.get_current_phase()[-1] == 'R': + orders = [order.replace(' - ', ' R ') for order in orders] + orders = [order for order in orders if order != 'WAIVE'] + self.game.set_orders(power_name, orders, expand=False) + + def reset(self): + """ Resets the game to its starting configuration + :return: ** None. This is a deviation from the standard Gym API. ** + """ + self.game = Game(game_id=get_game_id()) + self._last_known_phase = self.game.get_current_phase() + + def get_all_powers_name(self): + """ Returns the power for all players """ + map_object = (self.game or Game()).map + return get_map_powers(map_object) + + def get_player_seeds(self): + """ Returns a dictionary of power_name: seed to use for all powers """ + map_object = (self.game or Game()).map + if not self.game: + return {power_name: 0 for power_name in get_map_powers(map_object)} + return {power_name: get_player_seed(self.game.game_id, power_name) + for power_name in get_map_powers(map_object)} + + @staticmethod + def get_saved_game(): + """ Returns the last saved game """ diff --git a/diplomacy_research/models/gym/tests/__init__.py b/diplomacy_research/models/gym/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/gym/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/gym/tests/test_wrappers.py b/diplomacy_research/models/gym/tests/test_wrappers.py new file mode 100644 index 0000000..872f5b0 --- /dev/null +++ b/diplomacy_research/models/gym/tests/test_wrappers.py @@ -0,0 +1,171 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for gym wrappers """ +import gym +from diplomacy_research.models.gym import AutoDraw, LimitNumberYears, LoopDetection, SetInitialState, \ + AssignPlayers, RandomizePlayers, SetPlayerSeed, SaveGame +from diplomacy_research.models.state_space import get_player_seed +from diplomacy_research.proto.diplomacy_proto.game_pb2 import State as StateProto +from diplomacy_research.players import DummyPlayer +from diplomacy_research.utils.proto import zlib_to_proto + +def test_auto_draw(): + """ Tests the AutoDraw Wrapper """ + env = gym.make('DiplomacyEnv-v0') + env = AutoDraw(env) + env.reset() + + # Expecting env to be done after 10 process + for _ in range(100): + if env.is_done: + break + env.process() + assert env.is_done + final_year = int(env.game.get_current_phase()[1:5]) + assert 1905 <= final_year <= 1951 + +def test_limit_number_years(): + """ Tests the LimitNumberYears Wrapper """ + env = gym.make('DiplomacyEnv-v0') + env = LimitNumberYears(env, max_nb_years=10) + env.reset() + + # Expecting env to be done after 10 process + for _ in range(100): + if env.is_done: + break + env.process() + assert env.is_done + assert env.game.get_current_phase() == 'S1911M' + +def test_loop_detection(): + """ Test LoopDetection Wrapper """ + env = gym.make('DiplomacyEnv-v0') + env = LoopDetection(env, threshold=3) + env.reset() + + assert env.is_done is False + nb_process = 0 + while env.is_done is False: + env.process() + nb_process += 1 + assert nb_process == 3 + assert env.is_done + assert 'Loop' in env.game.note + + # after thrashing process has no effect + curr_phase = env.game.get_current_phase() + env.process() + assert curr_phase == env.game.get_current_phase() + +def test_set_initial_state(): + """ Tests the SetInitialState wrapper """ + state_zlib = b'x\x9cmSMk\xdb@\x105,v\x92u\x8a\xc0\xf8\xd0\x8465J\xdb\x80\xa0\x1fQ/\xado+kc/Z\xed\x8aY\xc9B\xbd' \ + b'\x08\x87\xdcR\nIz\xe8\xcf\xef\xcc\xca\xb2A\xf42\xa3\xdd}3\xef\xbd\x19\xc4\xcf\x1f\xff\xfez|\xfa' \ + b'\xfe\xf4-\xde\xdd?\xcf&\xee\xf6\xc7\xd78\xbf<}\xf9\xb3\xfb\xfd\xb0{~\x08\xa7\xc6\xb6\xa9\x14' \ + b'\xa9VF\x86|\x95\xb6i\x95\xe7J\xbap*t-\x1a\xd7\xd6B\x95\xe1\x99\xb3Z\x95B\x81\x0cO\xb1\xa0\x00' \ + b'\xe9\\\xf8J\xad\x8d\x05\xd9J\x00\x0b.= len(survivors): + self._is_done = True + self._draw_year = int(self.game.get_current_phase()[1:5]) + self._draw_prob = self.probs.get(self.current_year, 0.) + + # Processing, and resetting draw probs + self.env.process(**kwargs) + self.draw_probs = {power_name: 0. for power_name in self.draw_probs} + + def reset(self, **kwargs): + """ Resets the game to its starting configuration """ + # _reset was deprecated in gym 0.9.6, method_hidden triggered by gym.core L235 + # pylint: disable=method-hidden + self.draw_probs = {power_name: 0. for power_name in self.env.get_all_powers_name()} + self.draw_actions = {power_name: False for power_name in self.env.get_all_powers_name()} + self._is_done = False + self._draw_year = 0 + self._draw_prob = 0. + return self.env.reset(**kwargs) + + def set_draw_prob(self, power_name, draw_prob): + """ Sets the probability of accepting a draw for a given power """ + self.draw_probs[power_name] = draw_prob + + def get_draw_actions(self): + """ Returns a dictionary with power_name as key, and draw_action (True/False) as value """ + return self.draw_actions + +class LimitNumberYears(DiplomacyWrapper): + """ Wrapper that limits the length of a game to a certain number of years """ + def __init__(self, env, max_nb_years): + """ Constructor + :param env: The wrapped env + :param max_nb_years: The maximum number of years + :type env: gym.core.Env + """ + super(LimitNumberYears, self).__init__(env) + self._max_nb_years = max_nb_years + + @property + def is_done(self): + """ Determines if the game is done """ + if self.current_year == self._max_nb_years + 1: + self.game.note = 'Limit reached ({} years).'.format(self._max_nb_years) + return self.env.is_done or self.current_year > self._max_nb_years + + @property + def done_reason(self): + """ Returns the reason why the game was terminated """ + if self.current_year > self._max_nb_years: + return DoneReason.PHASE_LIMIT + return self.env.done_reason + + def process(self, **kwargs): + """ Requests that the game processes the current orders """ + if self.current_year > self._max_nb_years: + LOGGER.error('The maximum number of years have been reached. Please reset() the game.') + return None + return self.env.process(**kwargs) + +class LoopDetection(DiplomacyWrapper): + """ Wrapper that ends the game when the same state is detected multiple times (i.e. loops / thrashing) """ + def __init__(self, env, threshold=3): + """ Constructor + :param env: The wrapped env + :param threshold: The minimum number of times to detect the same state before ending the game. + :type env: gym.core.Env + """ + super(LoopDetection, self).__init__(env) + self.hash_count = {} + self.threshold = threshold + + @property + def is_done(self): + """ Determines if the game is done """ + state_count = self.hash_count.get(self.game.get_hash(), 0) + if state_count == self.threshold: + self.game.note = 'Loop detected ({} occurrences).'.format(self.threshold) + return self.env.is_done or state_count >= self.threshold + + @property + def done_reason(self): + """ Returns the reason why the game was terminated """ + state_count = self.hash_count.get(self.game.get_hash(), 0) + if state_count >= self.threshold: + return DoneReason.THRASHED + return self.env.done_reason + + def process(self, **kwargs): + """ Requests that the game processes the current orders """ + if self.hash_count.get(self.game.get_hash(), 0) >= self.threshold: + LOGGER.error('A loop (%d occurrences) has been detected. Please reset() the game.', self.threshold) + return + self.env.process(**kwargs) + self.hash_count[self.game.get_hash()] = self.hash_count.get(self.game.get_hash(), 0) + 1 + + def reset(self, **kwargs): + """ Resets the game to its starting configuration and reset the state count """ + # _reset was deprecated in gym 0.9.6, method_hidden triggered by gym.core L235 + # pylint: disable=method-hidden + self.hash_count = {} + return self.env.reset(**kwargs) + +class SetInitialState(DiplomacyWrapper): + """ Wrapper that sets the initial state to a different state of the game """ + def __init__(self, env, state_proto): + """ Constructor + :param env: The wrapped env + :param state_proto: A state proto representing the initial state of the game. + :type env: gym.core.Env + """ + super(SetInitialState, self).__init__(env) + self._initial_state = proto_to_dict(state_proto) + + def reset(self, **kwargs): + """ Resets the game to its starting configuration and resets the initial state """ + # _reset was deprecated in gym 0.9.6, method_hidden triggered by gym.core L235 + # pylint: disable=method-hidden + return_var = self.env.reset(**kwargs) + self.game.set_state(self._initial_state) + return return_var + +class AssignPlayers(DiplomacyWrapper): + """ Wrapper that assign the same power to each player on every reset """ + def __init__(self, env, players, power_assignments): + """ Constructor + :param env: The wrapped env + :param players: A list of player instances + :param power_assignments: The list of powers (in order) to assign to each player + :type env: gym.core.Env + :type players: List[diplomacy_research.players.player.Player] + """ + super(AssignPlayers, self).__init__(env) + game = self.game or Game() + + # Making sure we have the correct number of powers + assert len(power_assignments) == len(game.powers.keys()) + assert sorted(power_assignments) == sorted(game.powers.keys()) + + # Setting fixed ordering + self._powers = power_assignments + self._players = players + + @property + def players(self): + """ Returns a list of players instances playing the game """ + return self._players + + def get_all_powers_name(self): + """ Returns the power for all players """ + return self._powers + + def reset(self, **kwargs): + """ Resets the game to its starting configuration and re-assign the correct ordering """ + # _reset was deprecated in gym 0.9.6, method_hidden triggered by gym.core L235 + # pylint: disable=method-hidden + return_var = self.env.reset(**kwargs) + self.game.note = ' / '.join([power_name[:3] for power_name in self._powers]) + return return_var + +class RandomizePlayers(DiplomacyWrapper): + """ Wrapper that randomizes the power each player is playing at every reset """ + def __init__(self, env, players, clusters=None): + """ Constructor + :param env: The wrapped env + :param players: A list of player instances (all 7 players if no clusters, otherwise 1 player per cluster) + :param clusters: Optional. Contains a list of clusters, where each cluster is a tuple with + - 1) the number of players inside it, 2) a boolean that indicates if the players need to be merged + + e.g. [(1,False), (3, False), (3, False)] would create a 1 vs 3 vs 3 game (3 clusters), where + players[0] is assigned to the first cluster, + players[1] is copied 3 times and assigned to the second cluster, and + players[2] is copied 3 times and assigned to the third cluster. + :type env: gym.core.Env + :type players: List[diplomacy_research.players.player.Player] + """ + super(RandomizePlayers, self).__init__(env) + game = self.game or Game() + self._powers = [power_name for power_name in game.powers] + self._clusters = clusters if clusters is not None else [(1, False)] * len(self._powers) + + # Making sure we have the right number of players + if len(players) < len(self._clusters): + LOGGER.error('The nb of players (%d) must be greater or equal to %d.', len(players), len(self._clusters)) + raise ValueError() + + # Generating the list of players based on the clusters definition + self._players = [] + for cluster_ix, cluster_def in enumerate(self._clusters): + nb_players_in_cluster = cluster_def[0] + self._players += [players[cluster_ix]] * nb_players_in_cluster + + # Generating an ordering to shuffle players + self._ordering = list(range(len(self._players))) + + @property + def players(self): + """ Returns a list of players instances playing the game """ + return self._players + + def get_all_powers_name(self): + """ Returns the power for all players """ + return [self._powers[self._ordering[player_ix]] for player_ix in range(len(self._players))] + + def reset(self, **kwargs): + """ Resets the game to its starting configuration and shuffles the player ordering """ + # _reset was deprecated in gym 0.9.6, method_hidden triggered by gym.core L235 + # pylint: disable=method-hidden + shuffle(self._ordering) + return_var = self.env.reset(**kwargs) + note_to_display = [] + + # Determining power assigned to each cluster, and merging if necessary + remaining_players, remaining_powers = self._players[:], self.get_all_powers_name() + for nb_players_in_cluster, merge_cluster in self._clusters: + cluster_players = remaining_players[:nb_players_in_cluster] + cluster_powers = remaining_powers[:nb_players_in_cluster] + remaining_players = remaining_players[nb_players_in_cluster:] + remaining_powers = remaining_powers[nb_players_in_cluster:] + + # Merging all powers in cluster into merged_power + if merge_cluster and cluster_players: + merged_power = None + for power_ix, power_name in enumerate(cluster_powers): + current_power = self.game.get_power(power_name) + if power_ix == 0: + merged_power = current_power + else: + merged_power.merge(current_power) + + # Concatenating note + note_to_display += [' '.join([power_name[:3] for power_name in cluster_powers])] + + # Displaying note and returning + self.game.note = ' / '.join(note_to_display) + return return_var + +class SetPlayerSeed(DiplomacyWrapper): + """ Wrapper that automatically sets the player seed on every reset """ + def __init__(self, env, players): + """ Constructor + :param env: The wrapped env + :param players: A list of player instances + :type env: gym.core.Env + :type players: List[diplomacy_research.players.player.Player] + """ + super(SetPlayerSeed, self).__init__(env) + self._players = players + + # Making sure players are separate objects + nb_players = len(players) + for player_ix in range(1, nb_players): + if players[0] == players[player_ix]: + raise ValueError('Player 0 and %d are the same object. Different player objects expected.' % player_ix) + + @property + def players(self): + """ Returns a list of players instances playing the game """ + return self._players + + def reset(self, **kwargs): + """ Sets the player seed for each player based on the game id """ + # _reset was deprecated in gym 0.9.6, method_hidden triggered by gym.core L235 + # pylint: disable=method-hidden + return_var = self.env.reset(**kwargs) + powers = self.env.get_all_powers_name() + player_seeds = self.env.get_player_seeds() # {power_name: player_seed} + for power_name, player in zip(powers, self._players): + player.player_seed = player_seeds[power_name] + return return_var + +class SaveGame(DiplomacyWrapper): + """ Wrapper that saves game to memory / disk """ + def __init__(self, env, output_directory=None): + """ Constructor + :param env: The wrapped env + :param output_directory: The directory were to save the games (None to only save in memory) + :type env: gym.core.Env + """ + super(SaveGame, self).__init__(env) + self.output_dir = output_directory + self.saved = False + self.saved_game = None + + # Creating directory, it might be created multiple times in parallel + if self.output_dir and not os.path.exists(self.output_dir): + os.makedirs(self.output_dir, exist_ok=True) + + def _save_game(self): + """ Save the buffer to disk """ + # Building saved game + self.saved_game = to_saved_game_format(self.game) + self.saved = True + + # Saving to disk + if self.output_dir: + timestamp = int(time.time()) + output_path = os.path.join(self.output_dir, '{}_{}.json'.format(timestamp, self.game_id)) + with open(output_path, 'w') as file: + file.write(json.dumps(self.saved_game)) + + def process(self, **kwargs): + """ Clearing state cache and saving it to buffer """ + return_var = self.env.process(**kwargs) + if self.is_done: + self._save_game() + return return_var + + def reset(self, **kwargs): + """ Resets the game to its starting configuration and saves it to disk """ + # _reset was deprecated in gym 0.9.6, method_hidden triggered by gym.core L235 + # pylint: disable=method-hidden + if not self.saved and self.game and self.game.state_history: + self._save_game() + return_var = self.env.reset(**kwargs) + self.saved = False + return return_var + + def get_saved_game(self): + """ Returns the last saved game """ + if not self.saved: + return to_saved_game_format(self.game) + return self.saved_game diff --git a/diplomacy_research/models/layers/__init__.py b/diplomacy_research/models/layers/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/layers/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/layers/attention.py b/diplomacy_research/models/layers/attention.py new file mode 100644 index 0000000..de099d4 --- /dev/null +++ b/diplomacy_research/models/layers/attention.py @@ -0,0 +1,819 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Attention + - Contains tensorflow class to apply attention +""" +import collections +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' +import numpy as np + +from diplomacy_research.models.layers.layers import Identity +from diplomacy_research.utils.tensorflow import _transpose_batch_time +from diplomacy_research.utils.tensorflow import _unstack_ta +from diplomacy_research.utils.tensorflow import AttentionWrapperState, _BaseAttentionMechanism, AttentionMechanism +from diplomacy_research.utils.tensorflow import _bahdanau_score, _maybe_mask_score, _zero_state_tensors +from diplomacy_research.utils.tensorflow import _compute_attention +from diplomacy_research.utils.tensorflow import ops, core +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import check_ops +from diplomacy_research.utils.tensorflow import control_flow_ops +from diplomacy_research.utils.tensorflow import contrib_framework +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import math_ops, gen_math_ops +from diplomacy_research.utils.tensorflow import nn_ops +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import rnn_cell_impl +from diplomacy_research.utils.tensorflow import tensor_array_ops +from diplomacy_research.utils.tensorflow import variable_scope + +class BahdanauAttention(_BaseAttentionMechanism): + # Source: tensorflow/blob/r1.13/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py + """ Implements Bahdanau-style (additive) attention. + + This attention has two forms. The first is Bahdanau attention, as described in: + + Dzmitry Bahdanau, Kyunghyun Cho, Yoshua Bengio. + "Neural Machine Translation by Jointly Learning to Align and Translate." ICLR 2015. + https://arxiv.org/abs/1409.0473 + + The second is the normalized form. This form is inspired by the weight normalization article: + + Tim Salimans, Diederik P. Kingma. + "Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks." + https://arxiv.org/abs/1602.07868 + + To enable the second form, construct the object with parameter `normalize=True`. + """ + + def __init__(self, num_units, memory, memory_sequence_length=None, normalize=False, probability_fn=None, + score_mask_value=None, dtype=None, name_or_scope='BahdanauAttention'): + """ Construct the Attention mechanism. + :param num_units: The depth of the query mechanism. + :param memory: The memory to query; usually the output of an RNN encoder. This tensor should be + shaped `[batch_size, max_time, ...]`. + :param memory_sequence_length: (optional): Sequence lengths for the batch entries in memory. If provided, + the memory tensor rows are masked with zeros for values past the respective + sequence lengths. + :param normalize: Python boolean. Whether to normalize the energy term. + :param probability_fn: (optional) A `callable`. Converts the score to probabilities. The default is + @{tf.nn.softmax}. Other options include @{tf.contrib.seq2seq.hardmax} and + @{tf.contrib.sparsemax.sparsemax}. + Its signature should be: `probabilities = probability_fn(score)`. + :param score_mask_value: (optional): The mask value for score before passing into `probability_fn`. + The default is -inf. Only used if `memory_sequence_length` is not None. + :param dtype: The data type for the query and memory layers of the attention mechanism. + :param name_or_scope: String or VariableScope to use when creating ops. + """ + # pylint: disable=too-many-arguments + if probability_fn is None: + probability_fn = nn_ops.softmax + if dtype is None: + dtype = dtypes.float32 + wrapped_probability_fn = lambda score, _: probability_fn(score) + + self._num_units = num_units + self._normalize = normalize + self._name_or_scope = name_or_scope + + with variable_scope.variable_scope(name_or_scope, default_name='BahdanauAttention'): + super(BahdanauAttention, self).__init__(query_layer=core.Dense(num_units, + name='query_layer', + use_bias=False, + dtype=dtype), + memory_layer=core.Dense(num_units, + name='memory_layer', + use_bias=False, + dtype=dtype), + memory=memory, + probability_fn=wrapped_probability_fn, + memory_sequence_length=memory_sequence_length, + score_mask_value=score_mask_value) + + def __call__(self, query, state): + """ Score the query based on the keys and values. + :param query: Tensor of dtype matching `self.values` and shape `[batch_size, query_depth]`. + :param state: Tensor of dtype matching `self.values` and shape `[batch_size, alignments_size]` + (`alignments_size` is memory's `max_time`). + :return: Tensor of dtype matching `self.values` and shape `[batch_size, alignments_size]` + (`alignments_size` is memory's `max_time`). + """ + with variable_scope.variable_scope(self._name_or_scope, 'bahdanau_attention', [query]): + processed_query = self.query_layer(query) if self.query_layer else query + score = _bahdanau_score(processed_query, self._keys, self._normalize) + alignments = self._probability_fn(score, state) + next_state = alignments + return alignments, next_state + +class ModifiedBahdanauAttention(BahdanauAttention): + """ Implements Bahdanau-style (additive) attention. + + This implementation doesn't use a memory layer if the memory already has num_units. + """ + def __init__(self, num_units, memory, memory_sequence_length=None, normalize=False, probability_fn=None, + score_mask_value=None, dtype=None, name_or_scope='ModifiedBahdanauAttention'): + """ Construct the Attention mechanism. + :param num_units: The depth of the query mechanism. + :param memory: The memory to query; usually the output of an RNN encoder. This tensor should be + shaped `[batch_size, max_time, ...]`. + :param memory_sequence_length: (optional): Sequence lengths for the batch entries in memory. If provided, + the memory tensor rows are masked with zeros for values past the respective + sequence lengths. + :param normalize: Python boolean. Whether to normalize the energy term. + :param probability_fn: (optional) A `callable`. Converts the score to probabilities. The default is + @{tf.nn.softmax}. Other options include @{tf.contrib.seq2seq.hardmax} and + @{tf.contrib.sparsemax.sparsemax}. + Its signature should be: `probabilities = probability_fn(score)`. + :param score_mask_value: (optional): The mask value for score before passing into `probability_fn`. + The default is -inf. Only used if `memory_sequence_length` is not None. + :param dtype: The data type for the query and memory layers of the attention mechanism. + :param name_or_scope: String or VariableScope to use when creating ops. + """ + # pylint: disable=too-many-arguments + if probability_fn is None: + probability_fn = nn_ops.softmax + if dtype is None: + dtype = dtypes.float32 + wrapped_probability_fn = lambda score, _: probability_fn(score) + + self._num_units = num_units + self._normalize = normalize + self._name_or_scope = name_or_scope + + with variable_scope.variable_scope(name_or_scope, default_name='ModifiedBahdanauAttention'): + + # Only creating memory layer if memory size != num_units + if num_units != memory.get_shape()[-1].value: + memory_layer = core.Dense(num_units, name='memory_layer', use_bias=False, dtype=dtype) + else: + memory_layer = Identity(dtype=memory.dtype) + query_layer = core.Dense(num_units, name='query_layer', use_bias=False, dtype=dtype) + + # Building + super(BahdanauAttention, self).__init__(query_layer=query_layer, # pylint: disable=bad-super-call + memory_layer=memory_layer, + memory=memory, + probability_fn=wrapped_probability_fn, + memory_sequence_length=memory_sequence_length, + score_mask_value=score_mask_value) + +class AttentionWrapper(rnn_cell_impl.RNNCell): + # Source: tensorflow/blob/r1.13/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py + """ Wraps another `RNNCell` with attention. """ + + def __init__(self, cell, attention_mechanism, attention_layer_size=None, alignment_history=False, + cell_input_fn=None, output_attention=True, initial_cell_state=None, name_or_scope='AttentionWrapper', + attention_layer=None): + """ Construct the `AttentionWrapper`. + + :param cell: An instance of `RNNCell`. + :param attention_mechanism: A list of `AttentionMechanism` instances or a singleinstance. + :param attention_layer_size: A list of Python integers or a single Python integer, + the depth of the attention (output) layer(s). + :param alignment_history: Python boolean, whether to store alignment history from all time steps in the + final output state + :param cell_input_fn: (optional) A `callable`. The default is: concat([inputs, attention], axis=-1) + :param output_attention: Python bool. If `True` (default), the output at each time step is the attn value. + :param initial_cell_state: The initial state value to use for the cell when the user calls `zero_state()`. + :param name_or_scope: String or VariableScope to use when creating ops. + :param attention_layer: A list of `tf.layers.Layer` instances or a single `tf.layers.Layer` instance taking + the context and cell output as inputs to generate attention at each time step. + If None (default), use the context as attention at each time step. + + **NOTE** If you are using the `BeamSearchDecoder` with a cell wrapped in `AttentionWrapper`, + then you must ensure that: + + - The encoder output has been tiled to `beam_width` via `tf.contrib.seq2seq.tile_batch` (NOT `tf.tile`). + - The `batch_size` argument passed to the `zero_state` method of this wrapper is equal to + `true_batch_size * beam_width`. + - The initial state created with `zero_state` above contains a `cell_state` value containing properly + tiled final state from the encoder. + """ + # pylint: disable=too-many-arguments + self._name_or_scope = name_or_scope + with variable_scope.variable_scope(name_or_scope, 'AttentionWrapper'): + super(AttentionWrapper, self).__init__() + rnn_cell_impl.assert_like_rnncell("cell", cell) + + # Attention mechanism + if isinstance(attention_mechanism, (list, tuple)): + self._is_multi = True + attention_mechanisms = attention_mechanism + for attn_mechanism in attention_mechanisms: + if not isinstance(attn_mechanism, AttentionMechanism): + raise TypeError('attention_mechanism must contain only instances of AttentionMechanism, saw ' + 'type: %s' % type(attn_mechanism).__name__) + else: + self._is_multi = False + if not isinstance(attention_mechanism, AttentionMechanism): + raise TypeError('attention_mechanism must be an AttentionMechanism or list of multiple ' + 'AttentionMechanism instances, saw type: %s' % type(attention_mechanism).__name__) + attention_mechanisms = (attention_mechanism,) + + # Cell input function + if cell_input_fn is None: + cell_input_fn = lambda inputs, attention: array_ops.concat([inputs, attention], -1) + else: + if not callable(cell_input_fn): + raise TypeError('cell_input_fn must be callable, saw type: %s' % type(cell_input_fn).__name__) + + # Attention layer size + if attention_layer_size is not None and attention_layer is not None: + raise ValueError('Only one of attention_layer_size and attention_layer should be set') + + if attention_layer_size is not None: + attention_layer_sizes = tuple(attention_layer_size + if isinstance(attention_layer_size, (list, tuple)) + else (attention_layer_size,)) + if len(attention_layer_sizes) != len(attention_mechanisms): + raise ValueError('If provided, attention_layer_size must contain exactly one integer per ' + 'attention_mechanism, saw: %d vs %d' % (len(attention_layer_sizes), + len(attention_mechanisms))) + self._attention_layers = tuple(core.Dense(attention_layer_size, + name='attention_layer', + use_bias=False, + dtype=attention_mechanisms[i].dtype) + for i, attention_layer_size in enumerate(attention_layer_sizes)) + self._attention_layer_size = sum(attention_layer_sizes) + + elif attention_layer is not None: + self._attention_layers = tuple(attention_layer + if isinstance(attention_layer, (list, tuple)) + else (attention_layer,)) + if len(self._attention_layers) != len(attention_mechanisms): + raise ValueError('If provided, attention_layer must contain exactly one layer per ' + 'attention_mechanism, saw: %d vs %d' % (len(self._attention_layers), + len(attention_mechanisms))) + self._attention_layer_size = \ + sum(tensor_shape.dimension_value( + layer.compute_output_shape([None, + cell.output_size + + tensor_shape.dimension_value(mechanism.values.shape[-1])])[-1]) + for layer, mechanism in zip(self._attention_layers, attention_mechanisms)) + else: + self._attention_layers = None + self._attention_layer_size = sum(tensor_shape.dimension_value(attention_mechanism.values.shape[-1]) + for attention_mechanism in attention_mechanisms) + + self._cell = cell + self._attention_mechanisms = attention_mechanisms + self._cell_input_fn = cell_input_fn + self._output_attention = output_attention + self._alignment_history = alignment_history + + if initial_cell_state is None: + self._initial_cell_state = None + else: + final_state_tensor = nest.flatten(initial_cell_state)[-1] + state_batch_size = (tensor_shape.dimension_value(final_state_tensor.shape[0]) + or array_ops.shape(final_state_tensor)[0]) + error_message = ('When constructing AttentionWrapper %s: ' % self._base_name + + 'Non-matching batch sizes between the memory (encoder output) and initial_cell_state. ' + 'Are you using the BeamSearchDecoder? You may need to tile your initial state via the ' + 'tf.contrib.seq2seq.tile_batch function with argument multiple=beam_width.') + + with ops.control_dependencies(self._batch_size_checks(state_batch_size, error_message)): + self._initial_cell_state = \ + nest.map_structure(lambda state: array_ops.identity(state, name='check_initial_cell_state'), + initial_cell_state) + + def _batch_size_checks(self, batch_size, error_message): + """ Checks if the batch size of each attention mechanism is correct """ + return [check_ops.assert_equal(batch_size, attention_mechanism.batch_size, message=error_message) + for attention_mechanism in self._attention_mechanisms] + + def _item_or_tuple(self, seq): + """ Returns `seq` as tuple or the singular element """ + if self._is_multi: + return tuple(seq) + return tuple(seq)[0] + + @property + def output_size(self): + """ Returns the cell output size """ + if self._output_attention: + return self._attention_layer_size + return self._cell.output_size + + @property + def state_size(self): + """ Returns an `AttentionWrapperState` tuple containing shapes used by this object. """ + return AttentionWrapperState(cell_state=self._cell.state_size, + time=tensor_shape.TensorShape([]), + attention=self._attention_layer_size, + alignments=self._item_or_tuple(a.alignments_size + for a in self._attention_mechanisms), + attention_state=self._item_or_tuple(a.state_size + for a in self._attention_mechanisms), + alignment_history=self._item_or_tuple(a.alignments_size + if self._alignment_history else () + for a in self._attention_mechanisms)) + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this `AttentionWrapper`. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: AttentionWrapperState` tuple containing zeroed out tensors and, possibly, empty `TensorArrays`. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + if self._initial_cell_state is not None: + cell_state = self._initial_cell_state + else: + cell_state = self._cell.zero_state(batch_size, dtype) + + error_message = ('When calling zero_state of AttentionWrapper %s: ' % self._base_name + + 'Non-matching batch sizes between the memory encoder output) and the requested batch ' + 'size. Are you using the BeamSearchDecoder? If so, make sure your encoder output has been ' + 'tiled to beam_width via tf.contrib.seq2seq.tile_batch, and the batch_size= argument ' + 'passed to zero_state is batch_size * beam_width.') + with ops.control_dependencies(self._batch_size_checks(batch_size, error_message)): + cell_state = nest.map_structure(lambda state: array_ops.identity(state, name='checked_cell_state'), + cell_state) + initial_alignments = [attention_mechanism.initial_alignments(batch_size, dtype) + for attention_mechanism in self._attention_mechanisms] + return AttentionWrapperState(cell_state=cell_state, + time=array_ops.zeros([], dtype=dtypes.int32), + attention=_zero_state_tensors(self._attention_layer_size, batch_size, dtype), + alignments=self._item_or_tuple(initial_alignments), + attention_state=self._item_or_tuple( + attention_mechanism.initial_state(batch_size, dtype) + for attention_mechanism in self._attention_mechanisms), + alignment_history=self._item_or_tuple( + tensor_array_ops.TensorArray(dtype, + size=0, + dynamic_size=True, + element_shape=alignment.shape) + if self._alignment_history else () + for alignment in initial_alignments)) + + def call(self, inputs, state): + """ Performs a step of attention-wrapped RNN. + + 1) Mix the `inputs` and previous step's `attention` output via `cell_input_fn`. + 2) Call the wrapped `cell` with this input and its previous state. + 3) Score the cell's output with `attention_mechanism`. + 4) Calculate the alignments by passing the score through the `normalizer`. + 5) Calculate the context vector as the inner product between the alignments and the attention_mechanism's + values (memory). + 6) Calculate the attention output by concatenating the cell output and context through the attention + layer (a linear layer with `attention_layer_size` outputs). + + :param inputs: (Possibly nested tuple of) Tensor, the input at this time step. + :param state: An instance of `AttentionWrapperState` containing tensors from the previous time step. + :return: A tuple `(attention_or_cell_output, next_state)`, where: + - `attention_or_cell_output` depending on `output_attention`. + - `next_state` is an instance of `AttentionWrapperState` containing the state calculated at this time step. + """ + # pylint: disable=arguments-differ + if not isinstance(state, AttentionWrapperState): + raise TypeError('Expected state to be instance of AttentionWrapperState. Rcvd %s instead. ' % type(state)) + + # Step 1: Calculate the true inputs to the cell based on the previous attention value. + cell_inputs = self._cell_input_fn(inputs, state.attention) + cell_state = state.cell_state + cell_output, next_cell_state = self._cell(cell_inputs, cell_state) + + cell_batch_size = tensor_shape.dimension_value(cell_output.shape[0]) or array_ops.shape(cell_output)[0] + error_message = ('When applying AttentionWrapper %s: ' % self.name + 'Non-matching batch sizes between ' + 'the memory (encoder output) and the query (decoder output). Are you using the ' + 'BeamSearchDecoder? You may need to tile your memory input via the tf.contrib.seq2seq.' + 'tile_batch function with argument multiple=beam_width.') + + with variable_scope.variable_scope(self._name_or_scope, 'AttentionWrapper', [inputs, state]): + + with ops.control_dependencies(self._batch_size_checks(cell_batch_size, error_message)): + cell_output = array_ops.identity(cell_output, name='checked_cell_output') + + if self._is_multi: + previous_attention_state = state.attention_state + previous_alignment_history = state.alignment_history + else: + previous_attention_state = [state.attention_state] + previous_alignment_history = [state.alignment_history] + + # Computing attention + all_alignments = [] + all_attentions = [] + all_attention_states = [] + maybe_all_histories = [] + for i, attention_mechanism in enumerate(self._attention_mechanisms): + attention, alignments, next_attention_state = _compute_attention(attention_mechanism, + cell_output, + previous_attention_state[i], + self._attention_layers[i] + if self._attention_layers else None) + alignment_history = previous_alignment_history[i].write(state.time, + alignments) if self._alignment_history else () + + all_attention_states.append(next_attention_state) + all_alignments.append(alignments) + all_attentions.append(attention) + maybe_all_histories.append(alignment_history) + + # Building next state + attention = array_ops.concat(all_attentions, 1) + next_state = AttentionWrapperState(time=state.time + 1, + cell_state=next_cell_state, + attention=attention, + attention_state=self._item_or_tuple(all_attention_states), + alignments=self._item_or_tuple(all_alignments), + alignment_history=self._item_or_tuple(maybe_all_histories)) + + # Returning + if self._output_attention: + return attention, next_state + return cell_output, next_state + +class StaticAttentionWrapper(rnn_cell_impl.RNNCell): + """ Wraps another `RNNCell` with attention. """ + + def __init__(self, cell, memory, alignments, sequence_length, probability_fn=None, score_mask_value=None, + attention_layer_size=None, cell_input_fn=None, output_attention=False, name=None): + """ Constructs an AttentionWrapper with static alignments (attention weights) + + :param cell: An instance of `RNNCell`. + :param memory: The memory to query [batch_size, memory_time, memory_size] + :param alignments: A tensor of probabilities of shape [batch_size, time_steps, memory_time] + :param sequence_length: Sequence lengths for the batch entries in memory. Size (b,) + :param probability_fn: A `callable`. Converts the score to probabilities. The default is @{tf.nn.softmax}. + :param score_mask_value: The mask value for score before passing into `probability_fn`. Default is -inf. + :param attention_layer_size: The size of the attention layer. Uses the context if None. + :param cell_input_fn: (optional) A `callable` to aggregate attention. + Default: `lambda inputs, attention: array_ops.concat([inputs, attention], -1)`. + :param output_attention: If true, outputs the attention, if False outputs the cell output. + :param name: name: Name to use when creating ops. + """ + # pylint: disable=too-many-arguments + # Initializing RNN Cell + super(StaticAttentionWrapper, self).__init__(name=name) + rnn_cell_impl.assert_like_rnncell('cell', cell) + + # Setting values + self._cell = cell + self._memory = memory + self._attention_layer_size = attention_layer_size + self._output_attention = output_attention + self._memory_time = alignments.get_shape()[-1].value + self._memory_size = memory.get_shape()[-1].value + self._sequence_length = sequence_length + + # Validating attention layer size + if self._attention_layer_size is None: + self._attention_layer_size = self._memory_size + + # Validating cell_input_fn + if cell_input_fn is None: + cell_input_fn = lambda inputs, attention: array_ops.concat([inputs, attention], -1) + else: + if not callable(cell_input_fn): + raise TypeError('cell_input_fn must be callable, saw type: %s' % type(cell_input_fn).__name__) + self._cell_input_fn = cell_input_fn + + # Probability Function + if probability_fn is None: + probability_fn = nn_ops.softmax + if score_mask_value is None: + score_mask_value = dtypes.as_dtype(self._memory.dtype).as_numpy_dtype(-np.inf) + self._probability_fn = lambda score, _: probability_fn(_maybe_mask_score(score, + sequence_length, + score_mask_value), _) + + # Storing alignments as TA + # Padding with 1 additional zero, to prevent error on read(0) + alignments = array_ops.pad(alignments, [(0, 0), (0, 1), (0, 0)]) + alignments = nest.map_structure(_transpose_batch_time, alignments) # (max_time + 1, b, memory_time) + self._alignments_ta = nest.map_structure(_unstack_ta, alignments) # [time_step + 1, batch, memory_time] + self._initial_alignment = self._alignments_ta.read(0) + self._initial_attention = self._compute_attention(self._initial_alignment, self._memory)[0] + + # Storing zero inputs + batch_size = array_ops.shape(memory)[0] + self._zero_cell_output = array_ops.zeros([batch_size, cell.output_size]) + self._zero_attention = array_ops.zeros([batch_size, self._attention_layer_size]) + self._zero_state = self.zero_state(batch_size, dtypes.float32) + self._zero_alignment = array_ops.zeros_like(self._initial_alignment) + + def _compute_attention(self, alignments, memory): + """Computes the attention and alignments for a given attention_mechanism.""" + # Reshape from [batch_size, memory_time] to [batch_size, 1, memory_time] + expanded_alignments = array_ops.expand_dims(alignments, 1) + + # Context is the inner product of alignments and values along the + # memory time dimension. + # alignments shape is [batch_size, 1, memory_time] + # memory is [batch_size, memory_time, memory_size] + # the batched matmul is over memory_time, so the output shape is [batch_size, 1, memory_size]. + # we then squeeze out the singleton dim. + context = math_ops.matmul(expanded_alignments, memory) + context = array_ops.squeeze(context, [1]) + attn_layer = lambda x: x + if self._attention_layer_size != self._memory_size: + attn_layer = core.Dense(self._attention_layer_size, name='attn_layer', use_bias=False, dtype=context.dtype) + attention = attn_layer(context) + return attention, alignments + + @property + def output_size(self): + """ Returns the WrappedCell output size """ + if self._output_attention: + return self._attention_layer_size + return self._cell.output_size + + @property + def state_size(self): + """ The `state_size` property of `AttentionWrapper`. + :return: An `AttentionWrapperState` tuple containing shapes used by this object. + """ + return AttentionWrapperState(cell_state=self._cell.state_size, + time=tensor_shape.TensorShape([]), + attention=self._attention_layer_size, + alignments=self._memory_time, + attention_state=self._memory_time, + alignment_history=()) + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this `AttentionWrapper`. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: An `AttentionWrapperState` tuple containing zeroed out tensors and, possibly, empty TA objects. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + return AttentionWrapperState(cell_state=self._cell.zero_state(batch_size, dtype), + time=array_ops.zeros([], dtype=dtypes.int32), + attention=self._initial_attention, + alignments=self._initial_alignment, + attention_state=self._initial_alignment, + alignment_history=()) + + def compute_output_shape(self, input_shape): + """ Computes the output shape of the given layer """ + input_shape = tensor_shape.TensorShape(input_shape) + input_shape = input_shape.with_rank_at_least(2) + return input_shape[:-1].concatenate(self.output_size) + + def call(self, inputs, state): # pylint: disable=arguments-differ + """ Perform a step of attention-wrapped RNN + :param inputs: (Possibly nested tuple of) Tensor, the input at this time step. + :param state: An instance of `AttentionWrapperState` containing tensors from the previous time step. + :return: A tuple `(attention_or_cell_output, next_state)`, where: + - `attention_or_cell_output` depending on `output_attention`. + - `next_state` is an instance of `AttentionWrapperState` containing the state calculated at + this time step. + """ + if not isinstance(state, AttentionWrapperState): + raise TypeError('Expected state to be instance of AttentionWrapperState. Received type %s instead.' + % type(state)) + + next_time = state.time + 1 + finished = (next_time >= self._sequence_length) + all_finished = math_ops.reduce_all(finished) + + def get_next_alignments(): + """ Returns the next alignments """ + next_align = self._alignments_ta.read(next_time) + with ops.control_dependencies([next_align]): + return array_ops.identity(next_align) + + # Calculate the true inputs to the cell based on the previous attention value. + cell_inputs = self._cell_input_fn(inputs, state.attention) + cell_state = state.cell_state + cell_output, cell_state = self._cell(cell_inputs, cell_state) + + # Computing context + next_alignments = control_flow_ops.cond(all_finished, + true_fn=lambda: self._zero_alignment, + false_fn=get_next_alignments) + attention, _ = self._compute_attention(next_alignments, self._memory) + + next_state = AttentionWrapperState(time=next_time, + cell_state=cell_state, + attention=attention, + alignments=next_alignments, + attention_state=next_alignments, + alignment_history=()) + + if self._output_attention: + return attention, next_state + return cell_output, next_state + + +class SelfAttentionWrapperState( + collections.namedtuple('SelfAttentionWrapperState', ('cell_state', # The underlying cell state + 'time', # The current time + 'memory'))): # The current memory [b, t, mem_size] + """ `namedtuple` storing the state of a `SelfAttentionWrapper`. """ + + def clone(self, **kwargs): + """ Clone this object, overriding components provided by kwargs. """ + def with_same_shape(old, new): + """Check and set new tensor's shape.""" + if isinstance(old, ops.Tensor) and isinstance(new, ops.Tensor): + return contrib_framework.with_same_shape(old, new) + return new + + return nest.map_structure(with_same_shape, + self, + super(SelfAttentionWrapperState, self)._replace(**kwargs)) + +class SelfAttentionWrapper(rnn_cell_impl.RNNCell): + """ Wraps another `RNNCell` with attention over the previous outputs. """ + + def __init__(self, cell, memory_size, num_units, sequence_length, normalize=False, probability_fn=None, + score_mask_value=None, attention_layer_size=None, cell_input_fn=None, input_fn=None, + output_attention=False, dtype=None, name=None): + """ Wrapper that computes attention over previous outputs (i.e. inputs from time 1 to time t) + :param cell: An instance of `RNNCell`. + :param memory_size: The size of the memory (inputs to the cell). + :param num_units: The depth of the query mechanism. + :param sequence_length: Sequence lengths for the batch entries in memory. Size (b,) + :param normalize: Python boolean. Whether to normalize the energy term. + :param probability_fn: A `callable`. Converts the score to probabilities. The default is @{tf.nn.softmax}. + :param score_mask_value: The mask value for score before passing into `probability_fn`. Default is -inf. + :param attention_layer_size: The size of the attention layer. Uses the context if None. + :param cell_input_fn: A `callable` to aggregate attention. Default: concat([input, attn], axis=-1) + :param input_fn: A `callable` to apply to the cell inputs before adding to the memory. Default: identity. + :param output_attention: If true, outputs the attention, if False outputs the cell output. + :param dtype: The data type for the query and memory layers of the attention mechanism. + :param name: name: Name to use when creating ops. + """ + # pylint: disable=too-many-arguments + # Initializing RNN Cell + super(SelfAttentionWrapper, self).__init__(name=name) + rnn_cell_impl.assert_like_rnncell('cell', cell) + + # Setting values + self._cell = cell + self._memory_size = memory_size + self._num_units = num_units + self._sequence_length = sequence_length + self._normalize = normalize + self._attention_layer_size = attention_layer_size + self._output_attention = output_attention + self._dtype = dtype if dtype is not None else dtypes.float32 + self._name = name + + # Cell input function + if cell_input_fn is None: + cell_input_fn = lambda inputs, attention: array_ops.concat([inputs, attention], -1) + elif not callable(cell_input_fn): + raise TypeError('cell_input_fn must be callable, saw type: %s' % type(cell_input_fn).__name__) + self._cell_input_fn = cell_input_fn + + # Input function + if input_fn is None: + input_fn = lambda inputs: inputs + elif not callable(input_fn): + raise TypeError('input_fn must be callable, saw type: %s' % type(input_fn).__name__) + self._input_fn = input_fn + + # Bahdanau Attention + if probability_fn is None: + probability_fn = nn_ops.softmax + self._wrapped_probability_fn = lambda score, _: probability_fn(score) + if score_mask_value is None: + score_mask_value = dtypes.as_dtype(self._dtype).as_numpy_dtype(-np.inf) + self._score_mask_value = score_mask_value + + def _compute_attention(self, query, memory): + """ Computes the attention and alignments for the Bahdanau attention mechanism . + :param query: The query (inputs) to use to compute attention. Size [b, input_size] + :param memory: The memory (previous outputs) used to compute attention [b, time_step, memory_size] + :return: The attention. Size [b, attn_size] + """ + assert len(memory.shape) == 3, 'Memory needs to be [batch, time, memory_size]' + memory_time = array_ops.shape(memory)[1] + memory_size = memory.shape[2] + num_units = self._num_units + assert self._memory_size == memory_size, 'Expected mem size of %s - Got %s' % (self._memory_size, memory_size) + + # Query, memory, and attention layers + query_layer = core.Dense(num_units, name='query_layer', use_bias=False, dtype=self._dtype) + memory_layer = lambda x: x + if memory_size != self._num_units: + memory_layer = core.Dense(num_units, name='memory_layer', use_bias=False, dtype=self._dtype) + attn_layer = lambda x: x + if self._attention_layer_size is not None and memory_size != self._attention_layer_size: + attn_layer = core.Dense(self._attention_layer_size, name='attn_layer', use_bias=False, dtype=self._dtype) + + # Masking memory + sequence_length = gen_math_ops.minimum(memory_time, self._sequence_length) + sequence_mask = array_ops.sequence_mask(sequence_length, maxlen=memory_time, dtype=dtypes.float32)[..., None] + values = memory * sequence_mask + keys = memory_layer(values) + + # Computing scores + processed_query = query_layer(query) + scores = _bahdanau_score(processed_query, keys, self._normalize) + + # Getting alignments + masked_scores = _maybe_mask_score(scores, sequence_length, self._score_mask_value) + alignments = self._wrapped_probability_fn(masked_scores, None) # [batch, time] + + # Getting attention + expanded_alignments = array_ops.expand_dims(alignments, 1) # [batch, 1, time] + context = math_ops.matmul(expanded_alignments, memory) # [batch, 1, memory_size] + context = array_ops.squeeze(context, [1]) # [batch, memory_size] + attention = attn_layer(context) # [batch, attn_size] + + # Returning attention + return attention + + @property + def output_size(self): + """ Returns the WrappedCell output size """ + if self._output_attention: + return self._attention_layer_size + return self._cell.output_size + + @property + def state_size(self): + """ The `state_size` property of `AttentionWrapper`. + :return: An `SelfAttentionWrapperState` tuple containing shapes used by this object. + """ + return SelfAttentionWrapperState(cell_state=self._cell.state_size, + time=tensor_shape.TensorShape([]), + memory=self._memory_size) + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this `AttentionWrapper`. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: An `SelfAttentionWrapperState` tuple containing zeroed out tensors. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + # Using batch_size * 0, rather than just 0 to have a dynamic dimension + initial_cell_state = self._cell.zero_state(batch_size, dtype) + initial_memory = array_ops.zeros([batch_size, batch_size * 0, self._memory_size], dtype=self._dtype) + return SelfAttentionWrapperState(cell_state=initial_cell_state, + time=array_ops.zeros([], dtype=dtypes.int32), + memory=initial_memory) + + def compute_output_shape(self, input_shape): + """ Computes the output shape of the given layer """ + input_shape = tensor_shape.TensorShape(input_shape) + input_shape = input_shape.with_rank_at_least(2) + return input_shape[:-1].concatenate(self.output_size) + + def call(self, inputs, state): # pylint: disable=arguments-differ + """ Perform a step of attention-wrapped RNN + :param inputs: (Possibly nested tuple of) Tensor, the input at this time step. + :param state: An instance of `SelfAttentionWrapperState` containing tensors from the previous time step. + :return: A tuple `(attention_or_cell_output, next_state)`, where: + - `attention_or_cell_output` depending on `output_attention`. + - `next_state` is an instance of `SelfAttentionWrapperState` containing the state calculated at + this time step. + """ + if not isinstance(state, SelfAttentionWrapperState): + raise TypeError('Expected state to be instance of AttentionWrapperState. Received type %s instead.' + % type(state)) + + # Getting batch size + batch_size = array_ops.shape(inputs)[0] + assert len(inputs.shape) == 2, 'Expected inputs to be of rank 2' + + def get_next_memory_and_attn(): + """ Gets the next memory and attention """ + next_memory = array_ops.concat([state.memory, # [b, t, mem_size] + array_ops.expand_dims(self._input_fn(inputs), axis=1)], axis=1) + next_attention = self._compute_attention(inputs, next_memory) + with ops.control_dependencies([next_memory, next_attention]): + return array_ops.identity(next_memory), array_ops.identity(next_attention) + + def get_zero_memory_and_attn(): + """ Time = 0, we don't concatenate to memory and attention is all 0. """ + next_memory = state.memory + next_attention = array_ops.zeros([batch_size, self._attention_layer_size], dtype=inputs.dtype) + with ops.control_dependencies([next_memory, next_attention]): + return array_ops.identity(next_memory), array_ops.identity(next_attention) + + # Computing memory and attention + memory, attention = control_flow_ops.cond(gen_math_ops.equal(state.time, 0), + true_fn=get_zero_memory_and_attn, + false_fn=get_next_memory_and_attn) + + # Calculate the true inputs to the cell based on the previous attention value. + cell_inputs = self._cell_input_fn(inputs, attention) + cell_state = state.cell_state + cell_output, cell_state = self._cell(cell_inputs, cell_state) + + # Extracting computed context + next_state = SelfAttentionWrapperState(cell_state=cell_state, + time=state.time + 1, + memory=memory) + + # Returning cell output or attention + if self._output_attention: + return attention, next_state + return cell_output, next_state diff --git a/diplomacy_research/models/layers/avg_grad_optimizer.py b/diplomacy_research/models/layers/avg_grad_optimizer.py new file mode 100644 index 0000000..0519f3e --- /dev/null +++ b/diplomacy_research/models/layers/avg_grad_optimizer.py @@ -0,0 +1,373 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Average Gradient Optimizer + - Accumulates a certain number of gradients, average them and then applies them to the variables +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import clip_ops +from diplomacy_research.utils.tensorflow import control_flow_ops, gen_control_flow_ops +from diplomacy_research.utils.tensorflow import data_flow_ops +from diplomacy_research.utils.tensorflow import array_ops, gen_array_ops +from diplomacy_research.utils.tensorflow import ensure_finite +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import math_ops, gen_math_ops +from diplomacy_research.utils.tensorflow import optimizer +from diplomacy_research.utils.tensorflow import state_ops +from diplomacy_research.utils.tensorflow import variable_scope + + +class AvgGradOptimizer(optimizer.Optimizer): + """ Class to aggregate gradients and then apply them (by passing them to the optimizer.) + + The following accumulators/queue are created: + + * N `gradient accumulators`, one per variable to train. Gradients are pushed to them and will be averaged + before being applied to variables. + + The optimizer adds nodes to the graph to collect gradients. + + For the Parameter Server job: + + 1. An accumulator is created for each variable, and each replica pushes the gradients into the accumulators + instead of directly applying them to the variables. + 2. Each accumulator averages all gradients when the chief requests the optimizer to apply the gradients. + 3. The global step is increased every time a gradient is pushed on the accumulator + + For the replicas: + + 1. Start a step: fetch variables and compute gradients. + 2. Once the gradients have been computed, push them into gradient accumulators. + """ + + def __init__(self, opt, num_workers, is_chief, use_locking=False, max_gradient_norm=None, + name='avg_grad_optimizer'): + """ Constructor + :param opt: The actual optimizer that will be used to compute and apply the gradients + :param num_workers: The number of workers sending gradients to the average accumulator. + :param is_chief: Boolean that indicates if the current worker is the chief. + :param use_locking: Boolean. If True use locks for update operation. + :param max_gradient_norm: If set, the average gradients are also clipped by global norm. + :param average_locally: Boolean. If set, only the workers variables are averaged. + :param name: Optional name of the returned operation. + :type opt: optimizer.Optimizer + """ + super(AvgGradOptimizer, self).__init__(use_locking=use_locking, name=name) + self._optimizer = opt + self._num_workers = num_workers + self._is_chief = is_chief or num_workers == 1 + self._use_locking = use_locking + self._max_gradient_norm = max_gradient_norm + self._accumulators = {} # var_name: (var, accumulator, device) + self._finalized = False + + self._local_step = None + self._global_step = None + self._sync_token_queue = None + + self.local_step_init_op = None # Does local_step = global_step + self.chief_init_op = None + self._apply_grad_op = None # Chief - Applies gradient + + def compute_gradients(self, *args, **kwargs): + """ Compute gradients of 'loss' for the variables in 'var_list' + + This simply wraps the compute_gradients() from the real optimizer. The gradients will be aggregated in + the apply_gradients() so that user can modify the gradients like clipping with per replica global norm + if needed. The global norm with aggregated gradients can be bad as one replica's huge gradients can hurt + the gradients from other replicas. + + :return: A list of (gradient, variable) pairs + """ + # pylint: disable=arguments-differ + return self._optimizer.compute_gradients(*args, **kwargs) + + def apply_gradients(self, grads_and_vars, global_step=None, name=None): + """ Accumulates gradients for the variables and stores them in the accumulator + + Note: This does not update the variables, it just accumulate the gradients + + :param grads_and_vars: List of (gradient, variable) pairs as returned by compute_gradients() + :param global_step: Optional variable to increment by one after the variables have been updated. + :param name: Optional name for the returned op. Default to name passed to the optimizer constructor. + :return: The training operation to be run by each replica + + Raises - ValueError if the grads_and_vars is empty + - ValueError if global step is not provided + - ValueError if update() has already been called + """ + # Making sure grads_and_var and global_step are provided + if not grads_and_vars: + raise ValueError('Must supply at least one variable.') + if not global_step: + raise ValueError('You must provide a global_step variable') + if self._finalized: + raise ValueError('The optimizer has been finalized. You cannot call this method after update().') + + train_ops = [] + accumulated_grad = [] + var_list = [] + chief_init_ops = [] + self._global_step = global_step + + # Colocating local step to prevent it from being placed on the parameter server + local_anchor = gen_control_flow_ops.no_op() + with ops.device(local_anchor.device): + self._local_step = variable_scope.variable(initial_value=0, + trainable=False, + collections=[ops.GraphKeys.LOCAL_VARIABLES], + dtype=global_step.dtype.base_dtype, + name='sync_rep_local_step') + + # Setting initial step + self.local_step_init_op = state_ops.assign(self._local_step, global_step) + chief_init_ops += [self.local_step_init_op] + + with ops.name_scope(None, self._name): + + # Creating accumulators + for grad, var in grads_and_vars: + var_list += [var] + with ops.device(var.device): + + # No gradient - Pass-Through + if grad is None: + accumulated_grad += [None] + continue + + # Sparse Variable - Accumulating over the dense shape + elif isinstance(grad, ops.IndexedSlices): + grad_accum = self._create_sparse_accumulator(var, grad) + train_ops += [grad_accum.apply_indexed_slices_grad(grad, local_step=self._local_step)] + accumulated_grad += [self._take_sparse_grad(grad_accum, grad)] + chief_init_ops += [grad_accum.set_global_step(global_step, name='SetGlobalStep')] + + # Dense Variable + elif isinstance(grad, ops.Tensor): + grad_accum = self._create_dense_accumulator(var, grad) + train_ops += [grad_accum.apply_grad(grad, local_step=self._local_step)] + accumulated_grad += [self._take_dense_grad(grad_accum, grad)] + chief_init_ops += [grad_accum.set_global_step(global_step, name='SetGlobalStep')] + + # Unknown + else: + raise RuntimeError('Unsupported gradient type.') + + # Building update_op + with ops.device(self._global_step.device), ops.name_scope(''): + accumulated_grad = [ensure_finite(gradient) for gradient in accumulated_grad] + if self._max_gradient_norm: + accumulated_grad, _ = clip_ops.clip_by_global_norm(accumulated_grad, self._max_gradient_norm) + self._apply_grad_op = self._optimizer.apply_gradients(zip(accumulated_grad, var_list), global_step) + + # Building chief init ops + self.chief_init_op = control_flow_ops.group(*chief_init_ops) + + # Building train_op + return control_flow_ops.group(*train_ops) + + def update(self, version_step=None): + """ Performs the gradient averaging, updates the variables, and the global step + :param version_step: A variable that represents the model's version + :return: The update operation to be run by the chief + + Raises - ValueError if apply_gradients has not been calculated. + - ValueError if reset() has already been called. + """ + if not self._accumulators or not self._global_step: + raise ValueError('Should be called after apply_gradients().') + if self._finalized: + raise ValueError('The optimizer has been finalized. You cannot call this method after update().') + + self._finalized = True + if self._num_workers == 1: + return self._update_standalone(version_step=version_step) + if self._is_chief: + return self._update_distributed_as_chief(version_step=version_step) + return self._update_distributed_as_worker() + + def init(self): + """ Returns the operation to run to initialize the avg grad optimizer """ + return self.chief_init_op if self._is_chief else self.local_step_init_op + + def _update_standalone(self, version_step=None): + """ Performs the gradient averaging, updates the variables, and the global step + :param version_step: A variable that represents the model's version + :return: The update operation to run + + Note: This method is called when there are no workers (no synchronization) + """ + with ops.device(self._global_step.device), ops.name_scope(''): + with ops.control_dependencies([self._apply_grad_op]): + update_ops = [state_ops.assign(self._local_step, self._global_step)] + + # Increasing version step + if version_step is not None: + update_ops += [state_ops.assign_add(version_step, 1)] + + # Returning + return control_flow_ops.group(*update_ops) + + def _update_distributed_as_chief(self, version_step=None): + """ Performs the gradient averaging, updates the variables, and the global step + :param version_step: A variable that represents the model's version + :return: The update operation to run + + Note: This method is called by the chief when synchronization is required. + """ + # Creating sync_token queue + with ops.device(self._global_step.device), ops.name_scope(''): + self._sync_token_queue = data_flow_ops.FIFOQueue(capacity=-1, + dtypes=self._global_step.dtype.base_dtype, + shapes=(), + name='sync_token_q', + shared_name='sync_token_q') + + # Applying grads, then adding tokens to queue + with ops.control_dependencies([self._apply_grad_op]): + tokens = gen_array_ops.fill([self._num_workers], self._global_step) + sync_op = self._sync_token_queue.enqueue_many((tokens,)) + + # Waiting for token in queue (sync point) + with ops.control_dependencies([sync_op]): + token = self._sync_token_queue.dequeue() + update_ops = [state_ops.assign(self._local_step, token)] + + # Increasing version step + if version_step is not None: + update_ops += [state_ops.assign_add(version_step, 1)] + + # Returning + return control_flow_ops.group(*update_ops) + + def _update_distributed_as_worker(self): + """ Performs the gradient averaging, updates the variables, and the global step + :param version_step: A variable that represents the model's version + :return: The update operation to run + + Note: This method is called by a worker when synchronization is required. + """ + # Creating sync_token queue + with ops.device(self._global_step.device), ops.name_scope(''): + self._sync_token_queue = data_flow_ops.FIFOQueue(capacity=-1, + dtypes=self._global_step.dtype.base_dtype, + shapes=(), + name='sync_token_q', + shared_name='sync_token_q') + + # Waiting for token in queue (sync point) + token = self._sync_token_queue.dequeue() + return state_ops.assign(self._local_step, token) + + def _create_dense_accumulator(self, var, grad): + """ Creates a dense accumulator for the specified variable """ + assert var.name not in self._accumulators, 'Variable %s has already an accumulator' % var.name + shared_name = None if self._num_workers == 1 else var.name + '/grad_accum' + grad_accum = data_flow_ops.ConditionalAccumulator(grad.dtype, + shape=var.get_shape(), + shared_name=shared_name) + self._accumulators[var.name] = (var, grad_accum, var.device) + return grad_accum + + def _create_sparse_accumulator(self, var, grad): + """ Creates a sparse accumulator for the specified variable """ + assert var.name not in self._accumulators, 'Variable %s has already an accumulator' % var.name + shared_name = None if self._num_workers == 1 else var.name + '/grad_accum' + grad_accum = data_flow_ops.SparseConditionalAccumulator(grad.dtype, + shape=(), + shared_name=shared_name) + self._accumulators[var.name] = (var, grad_accum, var.device) + return grad_accum + + @staticmethod + def _take_dense_grad(grad_accum, grad): + """ Computes the gradient for a ConditionalAccumulator + :param grad_accum: The gradient accumulator where gradients are stored + :param grad: An instance of the gradient stored in the accumulator + :return: The avg gradient to apply (or a zero-like object if no gradients are stored) + :type grad_accum: data_flow_ops.ConditionalAccumulator + """ + def _take_grad(): + """ Computes the gradient from the accumulator """ + avg_grad = grad_accum.take_grad(num_required=1) + with ops.control_dependencies([avg_grad]): + return array_ops.identity(avg_grad) + + def _zero_grad(): + """ Returns a zeroed-out gradient """ + zero_like_grad = array_ops.zeros_like(grad) + with ops.control_dependencies([zero_like_grad]): + return array_ops.identity(zero_like_grad) + + return control_flow_ops.cond(gen_math_ops.equal(grad_accum.num_accumulated(), 0), + true_fn=_zero_grad, + false_fn=_take_grad) + + @staticmethod + def _take_sparse_grad(grad_accum, grad): + """ Computes the gradient for a SparseConditionalAccumulator + :param grad_accum: The gradient accumulator where gradients are stored + :param grad: An instance of the gradient stored in the accumulator + :return: The avg gradient to apply (or a zero-like object if no gradients are stored) + :type grad_accum: data_flow_ops.SparseConditionalAccumulator + """ + def _take_grad(): + """ Computes the gradient from the accumulator """ + avg_grad = grad_accum.take_indexed_slices_grad(num_required=1) + with ops.control_dependencies([avg_grad]): + return ops.IndexedSlices(values=array_ops.identity(avg_grad.values), + indices=avg_grad.indices, + dense_shape=avg_grad.dense_shape) + + def _zero_grad(): + """ Returns a zeroed-out gradient """ + zero_values = array_ops.zeros_like(grad.values) + with ops.control_dependencies([zero_values]): + return ops.IndexedSlices(values=array_ops.identity(zero_values), + indices=math_ops.cast(grad.indices, dtypes.int64), + dense_shape=math_ops.cast(grad.dense_shape, dtypes.int64)) + + return control_flow_ops.cond(gen_math_ops.equal(grad_accum.num_accumulated(), 0), + true_fn=_zero_grad, + false_fn=_take_grad) + + def get_slot(self, var, name): + """ Returns a slot named 'name' created by 'var' by the Optimizer """ + return self._optimizer.get_slot(var, name) + + def get_slot_names(self): + """ Returns a list of the names of slots created by the Optimizer """ + return self._optimizer.get_slot_names() + + def variables(self): + """ Fetches a list of optimizer variables in the default graph (excluding the local step) """ + return self._optimizer.variables() + + def _apply_dense(self, grad, var): + """ Add ops to apply dense gradients to `var`. """ + raise NotImplementedError() + + def _apply_sparse(self, grad, var): + """ Add ops to apply sparse gradients to `var`. """ + raise NotImplementedError() + + def _resource_apply_dense(self, grad, handle): + """ Add ops to apply dense gradients to the variable `handle`. """ + raise NotImplementedError() + + def _resource_apply_sparse(self, grad, handle, indices): + """ Add ops to apply sparse gradients to the variable `handle`. """ + raise NotImplementedError() diff --git a/diplomacy_research/models/layers/beam_decoder.py b/diplomacy_research/models/layers/beam_decoder.py new file mode 100644 index 0000000..be89eec --- /dev/null +++ b/diplomacy_research/models/layers/beam_decoder.py @@ -0,0 +1,491 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Diverse Beam Search Decoder + - Contains a custom implementation of a beam search +""" +# Source: https://github.com/tensorflow/tensorflow/blob/r1.12/tensorflow/contrib/seq2seq/python/ops/beam_search_decoder +from abc import ABCMeta, abstractmethod +import math +import sys +import numpy as np +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import gen_array_ops +from diplomacy_research.utils.tensorflow import beam_search_decoder +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import gen_math_ops +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import nn_ops +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import tensor_array_ops +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import tensor_util + + +def _check_maybe(tensor): + """ Checks that the tensor has a known rank. """ + if tensor.shape.ndims is None: + raise ValueError('Expected tensor (%s) to have known rank, but ndims == None.' % tensor) + +class BeamHelper(metaclass=ABCMeta): + """ A helper to feed data in a custom beam search decoder """ + + @property + def beam_width(self): + """ Returns the beam width """ + raise NotImplementedError() + + @property + def batch_size(self): + """ Returns the batch size """ + raise NotImplementedError() + + @property + def output_size(self): + """ Returns the size of the RNN output """ + raise NotImplementedError() + + @abstractmethod + def initialize(self): + """ Initialize the beam helper - Called in beam_decoder.initialize() + :return: `(finished, start_inputs, initial_cell_state)`. + """ + raise NotImplementedError() + + @abstractmethod + def step(self, time, inputs, cell_state): + """ Performs a step using the beam search cell + :param time: The current time step (scalar) + :param inputs: A (structure of) input tensors. + :param state: A (structure of) state tensors and TensorArrays. + :return: `(cell_outputs, next_cell_state)`. + """ + raise NotImplementedError() + + @abstractmethod + def next_inputs(self, time, inputs, beam_search_output, beam_search_state): + """ Computes the inputs at the next time step given the beam outputs + :param time: The current time step (scalar) + :param inputs: A (structure of) input tensors. + :param beam_search_output: The output of the beam search step + :param beam_search_state: The state after the beam search step + :return: `(beam_search_output, next_inputs)` + :type beam_search_output: beam_search_decoder.BeamSearchDecoderOutput + :type beam_search_state: beam_search_decoder.BeamSearchDecoderState + """ + raise NotImplementedError() + + def _merge_batch_beams(self, tensor, depth_shape=None): + """ Merges the tensor from a batch of beam into a batch by beams + More exactly, `tensor` is a tensor of dimension [batch, beam, depth_shape]. + We reshape this into [batch * beam, depth_shape] + + :param tensor: Tensor of dimension [batch_size, beam_width, depth_shape] + :param depth_shape: (Possibly known) depth shape. + :return: A reshaped version of tensor with dimension [batch_size * beam_width, depth_shape] + """ + if isinstance(depth_shape, ops.Tensor): + depth_shape = tensor_shape.as_shape(tensor_util.constant_value(depth_shape)) + else: + depth_shape = tensor_shape.TensorShape(depth_shape) + tensor_full_shape = array_ops.shape(tensor) + static_batch_size = tensor_util.constant_value(self.batch_size) + batch_size_beam_width = None if static_batch_size is None else static_batch_size * self.beam_width + reshaped_tensor = gen_array_ops.reshape(tensor, + array_ops.concat(([self.batch_size * self.beam_width], + tensor_full_shape[2:]), + 0)) + reshaped_tensor.set_shape((tensor_shape.TensorShape([batch_size_beam_width]).concatenate(depth_shape))) + return reshaped_tensor + + def _split_batch_beams(self, tensor, depth_shape=None): + """ Splits the tensor from a batch by beams into a batch of beams. + More exactly, `tensor` is a tensor of dimension [batch_size * beam_width, depth_shape]. + We reshape this into [batch_size, beam_width, depth_shape] + + :param tensor: Tensor of dimension [batch_size * beam_width, depth_shape] + :param depth_shape: (Possible known) depth shape. + :return: A reshaped version of tensor with dimension [batch_size, beam_width, depth_shape] + """ + if isinstance(depth_shape, ops.Tensor): + depth_shape = tensor_shape.TensorShape(tensor_util.constant_value(depth_shape)) + else: + depth_shape = tensor_shape.TensorShape(depth_shape) + tensor_full_shape = array_ops.shape(tensor) + reshaped_tensor = gen_array_ops.reshape(tensor, + array_ops.concat(([self.batch_size, self.beam_width], + tensor_full_shape[1:]), + 0)) + static_batch_size = tensor_util.constant_value(self.batch_size) + expected_reshaped_shape = tensor_shape.TensorShape([static_batch_size, + self.beam_width]).concatenate(depth_shape) + if not reshaped_tensor.shape.is_compatible_with(expected_reshaped_shape): + raise ValueError('Unexpected behavior when reshaping between beam width and batch size. The reshaped ' + 'tensor has shape: %s. We expected it to have shape (batch_size, beam_width, depth) == %s.' + 'Perhaps you forgot to create a zero_state with batch_size=encoder_batch_size * beam_width' + '?' % (reshaped_tensor.shape, expected_reshaped_shape)) + reshaped_tensor.set_shape(expected_reshaped_shape) + return reshaped_tensor + + def _maybe_split_batch_beams(self, tensor, depth_shape): + """ Maybe splits the tensor from a batch by beams into a batch of beams + We do this so that we can use nest and not run into problems with shapes. + + :param tensor: `Tensor`, either scalar or shaped `[batch_size * beam_width] + depth_shape`. + :param depth_shape: `Tensor`, Python int, or `TensorShape`. + :return: If `tensor` is a matrix or higher order tensor, then the return value is `tensor` reshaped + to [batch_size, beam_width] + depth_shape. Otherwise, `tensor` is returned unchanged. + """ + if isinstance(tensor, tensor_array_ops.TensorArray): + return tensor + _check_maybe(tensor) + if tensor.shape.ndims >= 1: + return self._split_batch_beams(tensor, depth_shape) + return tensor + + def _maybe_merge_batch_beams(self, tensor, depth_shape): + """ Splits the tensor from a batch by beams into a beam of beams + More exactly, `tensor` is a tensor of dimension `[batch_size * beam_width] + depth_shape`, then + we reshape it to `[batch_size, beam_width] + depth_shape` + + :param tensor: `Tensor` of dimension `[batch_size * beam_width] + depth_shape`. + :param depth_shape: `Tensor`, Python int, or `TensorShape`. + :return: A reshaped version of `tensor` with shape `[batch_size, beam_width] + depth_shape` + """ + if isinstance(tensor, tensor_array_ops.TensorArray): + return tensor + _check_maybe(tensor) + if tensor.shape.ndims >= 2: + return self._merge_batch_beams(tensor, depth_shape) + return tensor + + +class DiverseBeamSearchDecoder(beam_search_decoder.BeamSearchDecoder): + """ Diverse BeamSearch sampling decoder. + + **NOTE** If you are using the `BeamSearchDecoder` with a cell wrapped in `AttentionWrapper`, + then you must ensure that: + + - The encoder output has been tiled to `beam_width` via @{tf.contrib.seq2seq.tile_batch} (NOT `tf.tile`). + - The `batch_size` argument passed to the `zero_state` method of this wrapper is equal to + `true_batch_size * beam_width`. + - The initial state created with `zero_state` above contains a `cell_state` value containing properly tiled + final state from the encoder. + + An example: + ``` + tiled_encoder_outputs = tf.contrib.seq2seq.tile_batch(encoder_outputs, multiplier=beam_width) + tiled_encoder_final_state = tf.contrib.seq2seq.tile_batch(encoder_final_state, multiplier=beam_width) + tiled_sequence_length = tf.contrib.seq2seq.tile_batch(sequence_length, multiplier=beam_width) + attention_mechanism = MyFavoriteAttentionMechanism(num_units=attention_depth, + memory=tiled_inputs, + memory_sequence_length=tiled_sequence_length) + attention_cell = AttentionWrapper(cell, attention_mechanism, ...) + decoder_initial_state = attention_cell.zero_state(dtype, batch_size=true_batch_size * beam_width) + decoder_initial_state = decoder_initial_state.clone(cell_state=tiled_encoder_final_state) + ``` + """ + def __init__(self, beam_helper, sequence_length, nb_groups=5, similarity_penalty=1., reorder_tensor_arrays=True): + """ Initialize the BeamSearchDecoder + :param beam_helper: A `BeamHelper` class to feed data in the BeamSearchDecoder + :param sequence_length: The length of each sequence (batch,) + :param nb_groups: Python integer. The number of groups to use (for diverse beam search - 1610.02424) + :param similarity_penalty: The penalty to apply to tokens similar to previous groups (ArXiV 1610.02424) + :param reorder_tensor_arrays: If `True`, `TensorArray`s' elements within the cell state will be reordered + according to the beam search path. If the `TensorArray` can be reordered, the + stacked form will be returned. Otherwise, the `TensorArray` will be returned as + is. Set this flag to `False` if the cell state contains `TensorArray`s that are + not amenable to reordering. + :type beam_helper: BeamHelper + """ + # pylint: disable=super-init-not-called,too-many-arguments + assert isinstance(nb_groups, int), 'nb_groups should be a Python integer' + + self._sequence_length = ops.convert_to_tensor(sequence_length, name='sequence_length') + if self._sequence_length.get_shape().ndims != 1: + raise ValueError("Expected vector for sequence_length. Shape: %s" % self._sequence_length.get_shape()) + + # Getting beam width and batch size from helper + self._beam_width = beam_helper.beam_width + self._batch_size = beam_helper.batch_size + + # Finding group splits + nb_groups = min(max(nb_groups, 1), self._beam_width) # Cannot have more groups than beams + group_ids = [group_id % nb_groups for group_id in range(self._beam_width)] + self._group_splits = [len([item for item in group_ids if item == x]) for x in range(nb_groups)] + + # Setting variables + self._beam_helper = beam_helper + self._similarity_penalty = similarity_penalty + self._reorder_tensor_arrays = reorder_tensor_arrays + self._end_token = -1 + + @property + def output_size(self): + """ Returns the cell output and the id """ + return beam_search_decoder.BeamSearchDecoderOutput(scores=tensor_shape.TensorShape([self._beam_width]), + predicted_ids=tensor_shape.TensorShape([self._beam_width]), + parent_ids=tensor_shape.TensorShape([self._beam_width])) + + @property + def output_dtype(self): + """ Returns the cell dtype """ + return beam_search_decoder.BeamSearchDecoderOutput(scores=nest.map_structure(lambda _: dtypes.float32, + self._rnn_output_size()), + predicted_ids=dtypes.int32, + parent_ids=dtypes.int32) + + def _rnn_output_size(self): + """ Computes the RNN cell size """ + return self._beam_helper.output_size + + def initialize(self, name=None): + """ Initialize the decoder. + :param name: Name scope for any created operations. + :return: `(finished, start_inputs, initial_state)`. + """ + finished, start_inputs, initial_cell_state = self._beam_helper.initialize() + + # Initial state + dtype = nest.flatten(initial_cell_state)[0].dtype + log_probs = array_ops.one_hot(array_ops.zeros([self._batch_size], dtype=dtypes.int32), # (batch_sz, beam_sz) + depth=self._beam_width, + on_value=ops.convert_to_tensor(0.0, dtype=dtype), + off_value=ops.convert_to_tensor(-np.Inf, dtype=dtype), + dtype=dtype) + initial_state = beam_search_decoder.BeamSearchDecoderState(cell_state=initial_cell_state, + log_probs=log_probs, + finished=finished, + lengths=array_ops.zeros([self._batch_size, + self._beam_width], + dtype=dtypes.int64), + accumulated_attention_probs=()) + + # Returning + return finished, start_inputs, initial_state + + def step(self, time, inputs, state, name=None): + """ Performs a decoding step. + :param time: scalar `int32` tensor. + :param inputs: A (structure of) input tensors. + :param state: A (structure of) state tensors and TensorArrays. + :param name: Name scope for any created operations. + :return: `(outputs, next_state, next_inputs, finished)`. + """ + with ops.name_scope(name, 'BeamSearchDecoderStep', (time, inputs, state)): + # Stepping through beam helper + cell_state = state.cell_state + cell_outputs, next_cell_state = self._beam_helper.step(time, inputs, cell_state) + + # Performing beam search step + beam_search_output, beam_search_state = _beam_search_step(time=time, + logits=cell_outputs, + group_splits=self._group_splits, + next_cell_state=next_cell_state, + beam_state=state, + batch_size=self._batch_size, + beam_width=self._beam_width, + similarity_penalty=self._similarity_penalty, + sequence_length=self._sequence_length) + + # Computing next inputs + beam_search_output, next_inputs = self._beam_helper.next_inputs(time, + inputs, + beam_search_output, + beam_search_state) + + # Returning + return beam_search_output, beam_search_state, next_inputs, beam_search_state.finished + +def _beam_search_step(time, logits, group_splits, next_cell_state, beam_state, batch_size, beam_width, + similarity_penalty, sequence_length): + """ Performs a single step of Beam Search Decoding. + :param time: Beam search time step, should start at 0. At time 0 we assume that all beams are equal and + consider only the first beam for continuations. + :param logits: Logits at the current time step. A tensor of shape `[batch_size, beam_width, vocab_size]` + :param group_splits: The size of each group (e.g. [2, 2, 2, 1, 1] for splitting beam of 8 in 5 groups) + :param next_cell_state: The next state from the cell, e.g. AttentionWrapperState if the cell is attentional. + :param beam_state: Current state of the beam search. An instance of `BeamSearchDecoderState`. + :param batch_size: The batch size for this input. + :param beam_width: Python int. The size of the beams. + :param similarity_penalty: The penalty to apply to scores to account for similarity to previous beams. + :param sequence_length: The length of each input (b,) + :return: A new beam state. + """ + # pylint: disable=too-many-arguments + time = ops.convert_to_tensor(time, name='time') + static_batch_size = tensor_util.constant_value(batch_size) + + # Calculate the current lengths of the predictions + prediction_lengths = beam_state.lengths + previously_finished = beam_state.finished + + # Calculate the total log probs for the new hypotheses + # Final Shape: [batch_size, beam_width, vocab_size] + step_log_probs = nn_ops.log_softmax(logits) + step_log_probs = _mask_probs(step_log_probs, 0, previously_finished) + total_probs = array_ops.expand_dims(beam_state.log_probs, 2) + step_log_probs + + # Calculate the continuation lengths by adding to all continuing beams. + vocab_size = logits.shape[-1].value or array_ops.shape(logits)[-1] + lengths_to_add = gen_math_ops.cast(gen_math_ops.less(time + 1, sequence_length), dtypes.int64) + lengths_to_add = gen_array_ops.tile(lengths_to_add[:, None, None], multiples=[1, 1, vocab_size]) + add_mask = math_ops.cast(gen_math_ops.logical_not(previously_finished), dtypes.int64) + lengths_to_add *= array_ops.expand_dims(add_mask, 2) + new_prediction_lengths = lengths_to_add + array_ops.expand_dims(prediction_lengths, 2) + + # Calculate the scores for each beam + scores = _get_scores(log_probs=total_probs, sequence_lengths=new_prediction_lengths) + scores_flat = gen_array_ops.reshape(scores, [batch_size, -1]) + + # Adjusting for similarity (arXiv:1610.02424 - Diverse Beam Search) + next_beam_scores = array_ops.zeros(shape=[batch_size, 0], dtype=dtypes.float32) + word_indices = array_ops.zeros(shape=[batch_size, 0], dtype=dtypes.int32) + next_word_ids = array_ops.zeros(shape=[batch_size, 0], dtype=dtypes.int32, name='next_beam_word_ids') + next_beam_ids = array_ops.zeros(shape=[batch_size, 0], dtype=dtypes.int32, name='next_beam_parent_ids') + + # For each group, selecting the top `group_size` candidates, and penalizing those candidates in future groups + for group_size in group_splits: + t_group_size = ops.convert_to_tensor(group_size, dtype=dtypes.int32) + + # Computing the best candidates for the current group + next_group_scores, group_indices = nn_ops.top_k(scores_flat, k=t_group_size) + next_group_scores.set_shape([static_batch_size, group_size]) + group_indices.set_shape([static_batch_size, group_size]) + + # Storing the best scores and the indices + next_beam_scores = array_ops.concat([next_beam_scores, next_group_scores], axis=1) + word_indices = array_ops.concat([word_indices, group_indices], axis=1) + + # Decoding the selected positions in the group + group_next_word_ids = math_ops.cast(math_ops.mod(group_indices, vocab_size), dtypes.int32) + group_next_beam_ids = math_ops.cast(group_indices / vocab_size, dtypes.int32) + next_word_ids = array_ops.concat([next_word_ids, group_next_word_ids], axis=1) + next_beam_ids = array_ops.concat([next_beam_ids, group_next_beam_ids], axis=1) + + # Masking word indices so the next groups doesn't reselect them + word_indices_mask = array_ops.one_hot(word_indices, # [batch, group_size, vocab * beam] + depth=vocab_size * beam_width, + on_value=ops.convert_to_tensor(-np.Inf, dtype=dtypes.float32), + off_value=ops.convert_to_tensor(0.0, dtype=dtypes.float32), + dtype=dtypes.float32) + + # Reducing the probability of selecting the same word in the next groups + same_word_mask = gen_array_ops.tile(array_ops.one_hot(group_next_word_ids, # [batch, group_sz, vocab * beam] + depth=vocab_size, + on_value=math.log(0.5), + off_value=0., + dtype=dtypes.float32), [1, 1, beam_width]) + + # Adding mask to scores flat + scores_flat = scores_flat \ + + math_ops.reduce_sum(word_indices_mask, axis=1) \ + + similarity_penalty * math_ops.reduce_sum(same_word_mask, axis=1) + + # Pick out the probs, beam_ids, and states according to the chosen predictions + next_beam_probs = beam_search_decoder._tensor_gather_helper(gather_indices=word_indices, # pylint: disable=protected-access + gather_from=total_probs, + batch_size=batch_size, + range_size=beam_width * vocab_size, + gather_shape=[-1], + name='next_beam_probs') + + # Append new ids to current predictions + previously_finished = beam_search_decoder._tensor_gather_helper(gather_indices=next_beam_ids, # pylint: disable=protected-access + gather_from=previously_finished, + batch_size=batch_size, + range_size=beam_width, + gather_shape=[-1]) + next_finished = gen_math_ops.logical_or(previously_finished, + array_ops.expand_dims(gen_math_ops.greater_equal(time + 1, sequence_length), + axis=-1), + name='next_beam_finished') + + # Calculate the length of the next predictions. + # 1. Finished beams remain unchanged. + # 2. Beams that are now finished (EOS predicted) have their length increased by 1. + # 3. Beams that are not yet finished have their length increased by 1. + lengths_to_add = math_ops.cast(gen_math_ops.logical_not(previously_finished), dtypes.int64) + next_prediction_len = beam_search_decoder._tensor_gather_helper(gather_indices=next_beam_ids, # pylint: disable=protected-access + gather_from=beam_state.lengths, + batch_size=batch_size, + range_size=beam_width, + gather_shape=[-1]) + next_prediction_len += lengths_to_add + + # Pick out the cell_states according to the next_beam_ids. We use a different gather_shape here because the + # cell_state tensors, i.e. the tensors that would be gathered from, all have dimension greater than two and we + # need to preserve those dimensions. + gather_helper = beam_search_decoder._maybe_tensor_gather_helper # pylint: disable=protected-access + + def _get_gather_shape(tensor): + """ Computes the gather shape """ + # We can use -1 if the entire shape is static + # Otherwise, we need to define specifically the gather shape (because we have multiple dynamic dims) + if None not in tensor.shape.as_list()[1:]: + return [batch_size * beam_width, -1] + if len([1 for dim in tensor.shape.as_list()[2:] if dim is None]) == 1: + return [batch_size * beam_width] + [-1 if dim.value is None else dim.value for dim in tensor.shape[2:]] + raise ValueError('Cannot gather shape with more than 2 dynamic dims - %s' % tensor.shape.as_list()) + + next_cell_state = nest.map_structure(lambda gather_from: gather_helper(gather_indices=next_beam_ids, + gather_from=gather_from, + batch_size=batch_size, + range_size=beam_width, + gather_shape=_get_gather_shape(gather_from)), + next_cell_state) + + next_state = beam_search_decoder.BeamSearchDecoderState(cell_state=next_cell_state, + log_probs=next_beam_probs, + lengths=next_prediction_len, + finished=next_finished, + accumulated_attention_probs=()) + output = beam_search_decoder.BeamSearchDecoderOutput(scores=next_beam_scores, + predicted_ids=next_word_ids, + parent_ids=next_beam_ids) + return output, next_state + +def _get_scores(log_probs, sequence_lengths): + """ Calculates scores for beam search hypotheses. + :param log_probs: The log probabilities with shape `[batch_size, beam_width, vocab_size]`. + :param sequence_lengths: The array of sequence lengths. + :return: The scores for beam search hypotheses + """ + del sequence_lengths # Unused args + return log_probs + +def _mask_probs(probs, end_token, finished): + """ Masks log probabilities. + The result is that finished beams allocate all probability mass to PAD_ID and unfinished beams remain unchanged. + :param probs: Log probabilities of shape `[batch_size, beam_width, vocab_size]` + :param end_token: An int32 id corresponding to the token to allocate probability to when finished. + :param finished: A boolean tensor of shape `[batch_size, beam_width]` that specifies which elements in the + beam are finished already. + :return: A tensor of shape `[batch_size, beam_width, vocab_size]`, where unfinished beams stay unchanged and + finished beams are replaced with a tensor with all probability on the EOS token. + """ + vocab_size = array_ops.shape(probs)[2] + + # All finished examples are replaced with a vector that has all probability on end_token + finished_row = array_ops.one_hot(end_token, + vocab_size, + dtype=probs.dtype, + on_value=ops.convert_to_tensor(0., dtype=probs.dtype), + off_value=probs.dtype.min) + finished_probs = gen_array_ops.tile(gen_array_ops.reshape(finished_row, [1, 1, -1]), + array_ops.concat([array_ops.shape(finished), [1]], 0)) + finished_mask = gen_array_ops.tile(array_ops.expand_dims(finished, 2), [1, 1, vocab_size]) + return array_ops.where(finished_mask, finished_probs, probs) diff --git a/diplomacy_research/models/layers/decoder.py b/diplomacy_research/models/layers/decoder.py new file mode 100644 index 0000000..4b780b1 --- /dev/null +++ b/diplomacy_research/models/layers/decoder.py @@ -0,0 +1,205 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Decoders + - Contains derived tensorflow decoders that can apply a decoder mask at every time step +""" +import collections +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import seq2seq +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import gen_math_ops +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import nest + +LARGE_NEGATIVE = -1e20 + +class MaskedInputs( + collections.namedtuple('MaskedInputs', ('inputs', 'mask'))): + """ Basic masked inputs (where a mask is also provided for every output """ + +class CandidateInputs( + collections.namedtuple('CandidateInputs', ('inputs', 'candidates', 'candidates_emb'))): + """ Candidate Input type. Contains a list of candidates (b, nb_candidate) and their corresponding embedding """ + +class BasicDecoderWithStateOutput( + collections.namedtuple('BasicDecoderWithStateOutput', ('rnn_output', 'rnn_state', 'sample_id'))): + """ Basic Decoder Named Tuple with rnn_output, rnn_state, and sample_id """ + + +class MaskedBasicDecoder(seq2seq.BasicDecoder): + """ Basic sampling decoder with mask applied at each step. """ + + def __init__(self, cell, helper, initial_state, output_layer=None, extract_state=False): + """ Constructor + :param cell: An `RNNCell` instance. + :param helper: A `Helper` instance. + :param initial_state: A (nested tuple of...) tensors and TensorArrays. Initial state of the RNNCell. + :param output_layer: Optional. An instance of `tf.layers.Layer`, i.e., `tf.layers.Dense`. Optional layer + to apply to the RNN output prior to storing the result or sampling. + :param extract_state: Optional. Boolean. If set, will also return the RNN state at each time step. + :type cell: tensorflow.python.ops.rnn_cell_impl.RNNCell + :type helper: tensorflow.contrib.seq2seq.python.ops.helper.Helper + :type output_layer: tensorflow.python.layers.base.Layer + """ + super(MaskedBasicDecoder, self).__init__(cell=cell, + helper=helper, + initial_state=initial_state, + output_layer=output_layer) + self.extract_state = extract_state + + @property + def output_size(self): + # Return the cell output and the id + if self.extract_state: + return BasicDecoderWithStateOutput(rnn_output=self._rnn_output_size(), + rnn_state=tensor_shape.TensorShape([self._cell.output_size]), + sample_id=self._helper.sample_ids_shape) + return seq2seq.BasicDecoderOutput(rnn_output=self._rnn_output_size(), + sample_id=self._helper.sample_ids_shape) + + @property + def output_dtype(self): + # Assume the dtype of the cell is the output_size structure + # containing the input_state's first component's dtype. + # Return that structure and the sample_ids_dtype from the helper. + dtype = nest.flatten(self._initial_state)[0].dtype + if self.extract_state: + return BasicDecoderWithStateOutput(nest.map_structure(lambda _: dtype, self._rnn_output_size()), + dtype, + self._helper.sample_ids_dtype) + return seq2seq.BasicDecoderOutput(nest.map_structure(lambda _: dtype, self._rnn_output_size()), + self._helper.sample_ids_dtype) + + def step(self, time, inputs, state, name=None): + """ Performs a decoding step + :param time: scalar `int32` tensor. + :param inputs: A (structure of) input tensors. (** This is a MaskedInputs tuple **) + :param state: A (structure of) state tensors and TensorArrays. + :param name: Name scope for any created operations. + :return: (outputs, next_state, next_inputs, finished) + """ + assert isinstance(inputs, (MaskedInputs, ops.Tensor)), 'Expected "MaskedInputs" or a Tensor.' + with ops.name_scope(name, "BasicDecoderStep", (time, inputs, state)): + inputs, output_mask = inputs, None + if isinstance(inputs, MaskedInputs): + inputs, output_mask = inputs.inputs, inputs.mask + cell_outputs, cell_state = self._cell(inputs, state) + cell_state_output = cell_outputs # Corresponds to cell_state.h (before output layer) + if self._output_layer is not None: + cell_outputs = self._output_layer(cell_outputs) + if output_mask is not None: + cell_outputs = gen_math_ops.add(cell_outputs, (1. - output_mask) * LARGE_NEGATIVE) + sample_ids = self._helper.sample(time=time, outputs=cell_outputs, state=cell_state) + (finished, next_inputs, next_state) = self._helper.next_inputs(time=time, + outputs=cell_outputs, + state=cell_state, + sample_ids=sample_ids) + if self.extract_state: + outputs = BasicDecoderWithStateOutput(cell_outputs, cell_state_output, sample_ids) + else: + outputs = seq2seq.BasicDecoderOutput(cell_outputs, sample_ids) + return outputs, next_state, next_inputs, finished + + def finalize(self, outputs, final_state, sequence_lengths): + """ Finalize function """ + return outputs, final_state + +class CandidateBasicDecoder(seq2seq.BasicDecoder): + """ Basic sampling decoder that chooses among candidates at each step. """ + + def __init__(self, cell, helper, initial_state, max_candidate_length, output_layer=None, extract_state=False): + """ Constructor + :param cell: An `RNNCell` instance. + :param helper: A `Helper` instance. + :param initial_state: A (nested tuple of...) tensors and TensorArrays. Initial state of the RNNCell. + :param max_candidate_length: The maximum number of candidates + :param output_layer: Optional. An instance of `tf.layers.Layer`, i.e., `tf.layers.Dense`. Optional layer + to apply to the RNN output prior to storing the result or sampling. + :param extract_state: Optional. Boolean. If set, will also return the RNN state at each time step. + :type cell: tensorflow.python.ops.rnn_cell_impl.RNNCell + :type helper: tensorflow.contrib.seq2seq.python.ops.helper.Helper + :type output_layer: tensorflow.python.layers.base.Layer + """ + super(CandidateBasicDecoder, self).__init__(cell=cell, + helper=helper, + initial_state=initial_state, + output_layer=output_layer) + self.extract_state = extract_state + self.max_candidate_length = max_candidate_length + + @property + def output_size(self): + # Return the cell output and the id + if self.extract_state: + return BasicDecoderWithStateOutput(rnn_output=self.max_candidate_length, + rnn_state=tensor_shape.TensorShape([self._cell.output_size]), + sample_id=self._helper.sample_ids_shape) + return seq2seq.BasicDecoderOutput(rnn_output=self.max_candidate_length, + sample_id=self._helper.sample_ids_shape) + + @property + def output_dtype(self): + # Assume the dtype of the cell is the output_size structure + # containing the input_state's first component's dtype. + # Return that structure and the sample_ids_dtype from the helper. + dtype = nest.flatten(self._initial_state)[0].dtype + if self.extract_state: + return BasicDecoderWithStateOutput(dtype, + dtype, + self._helper.sample_ids_dtype) + return seq2seq.BasicDecoderOutput(dtype, + self._helper.sample_ids_dtype) + + def step(self, time, inputs, state, name=None): + """ Performs a decoding step + :param time: scalar `int32` tensor. + :param inputs: A (structure of) input tensors. (** This is a MaskedInputs tuple **) + :param state: A (structure of) state tensors and TensorArrays. + :param name: Name scope for any created operations. + :return: (outputs, next_state, next_inputs, finished) + """ + assert isinstance(inputs, CandidateInputs), 'The inputs must be of type "CandidateInputs"' + with ops.name_scope(name, "BasicDecoderStep", (time, inputs, state)): + inputs, candidates, candidates_emb = inputs.inputs, inputs.candidates, inputs.candidates_emb + cell_outputs, cell_state = self._cell(inputs, state) + cell_state_output = cell_outputs # Corresponds to cell_state.h (before output layer) + if self._output_layer is not None: + cell_outputs = self._output_layer(cell_outputs) + + # Adding a bias dimension, then computing candidate logits and masking PAD_IDs + cell_outputs = array_ops.pad(cell_outputs, [(0, 0), (0, 1)], constant_values=1.) + cell_outputs = math_ops.reduce_sum(cell_outputs[:, None, :] * candidates_emb, axis=-1) + output_mask = math_ops.cast(gen_math_ops.greater(candidates, 0), dtypes.float32) + cell_outputs = gen_math_ops.add(cell_outputs, (1. - output_mask) * LARGE_NEGATIVE) + + # Sampling and computing next inputs + sample_ids = self._helper.sample(time=time, outputs=(cell_outputs, candidates), state=cell_state) + (finished, next_inputs, next_state) = self._helper.next_inputs(time=time, + outputs=cell_outputs, + state=cell_state, + sample_ids=sample_ids) + if self.extract_state: + outputs = BasicDecoderWithStateOutput(cell_outputs, cell_state_output, sample_ids) + else: + outputs = seq2seq.BasicDecoderOutput(cell_outputs, sample_ids) + return outputs, next_state, next_inputs, finished + + def finalize(self, outputs, final_state, sequence_lengths): + """ Finalize function """ + return outputs, final_state diff --git a/diplomacy_research/models/layers/dropout.py b/diplomacy_research/models/layers/dropout.py new file mode 100644 index 0000000..49c94df --- /dev/null +++ b/diplomacy_research/models/layers/dropout.py @@ -0,0 +1,323 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Dropout + - Contains tensorflow class to apply seeded dropout +""" +import collections +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.models.layers.seeded_random import seeded_random +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import gen_array_ops +from diplomacy_research.utils.tensorflow import constant_op +from diplomacy_research.utils.tensorflow import context +from diplomacy_research.utils.tensorflow import contrib_framework +from diplomacy_research.utils.tensorflow import control_flow_ops +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import gen_math_ops +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import nn_ops +from diplomacy_research.utils.tensorflow import rnn_cell_impl +from diplomacy_research.utils.tensorflow import tensor_shape + + +def seeded_dropout(inputs, seeds, keep_probs, offset=None, noise_shape=None, seed=None, name=None): + """ Computes dropout (with a deterministic mask). + Every item in the batch has a deterministic seed to compute the deterministic mask + + With probability `keep_probs`, outputs the input element scaled up by `1 / keep_prob`, otherwise outputs `0`. + The scaling is so that the expected sum is unchanged. + + By default, each element is kept or dropped independently. If `noise_shape` is specified, it must be + broadcastable to the shape of `x`, and only dimensions with `noise_shape[i] == shape(x)[i]` will make + independent decisions. + + For example, if `shape(x) = [k, l, m, n]` and `noise_shape = [k, 1, 1, n]`, each batch and channel component + will be kept independently and each row and column will be kept or not kept together. + + :param inputs: A floating point tensor. + :param seeds: A tensor representing the seed for each item in the batch. (Size: (batch,)) + :param keep_probs: A scalar or vector of size (batch,). The probability that each element is kept. + :param offset: Integer. Alternative offset to apply to compute the deterministic mask (e.g. in a loop). + :param noise_shape: A 1-D `Tensor` of type `int32`, represents the shape for randomly generated keep/drop flags. + :param seed: A Python integer. Used to create a default seed for the operation. + :param name: name: A name for this operation (optional). + :return: A Tensor of the same shape of `x`. + """ + if offset is None: + seeded_dropout.offset += 40555607 + + # If inputs is a scalar, this is likely the 'time' attribute in a state, we don't want to mask it + # Same thing for integers - We can safely ignore them + # So we don't want to mask it + if not inputs.shape or inputs.dtype.is_integer: + return inputs + + with ops.name_scope(name, 'seeded_dropout', [inputs]): + inputs = ops.convert_to_tensor(inputs, name='x') + if not inputs.dtype.is_floating: + raise ValueError('Expected a floating point tensor. Got a %s tensor instead.' % inputs.dtype) + if isinstance(keep_probs, float) and not 0 < keep_probs <= 1: + raise ValueError('keep_probs must be a scalar tensor or a float in the range (0, 1], got %g' % keep_probs) + + # Early return if nothing needs to be dropped. + if isinstance(keep_probs, float) and keep_probs == 1: + return inputs + + # Not supported in eager mode + if context.executing_eagerly(): + raise ValueError('This function is not supported in eager mode.') + + # Converting to tensor + keep_probs = ops.convert_to_tensor(keep_probs, dtype=inputs.dtype, name='keep_probs') + keep_probs = gen_math_ops.maximum(0., gen_math_ops.minimum(1., keep_probs)) + keep_probs = gen_array_ops.reshape(keep_probs, [-1] + [1] * (len(inputs.shape) - 1)) + all_keep_probs_are_one = math_ops.reduce_all(gen_math_ops.equal(keep_probs, 1.)) + + # Computing noise shape + noise_shape = nn_ops._get_noise_shape(inputs, noise_shape) # pylint: disable=protected-access + + def get_dropout_mask(): + """ Computes the dropout mask """ + # random_tensor = uniform [keep_probs, 1.0 + keep_probs) + random_tensor = keep_probs + random_tensor += seeded_random(seeds, + offset=offset if offset is not None else seeded_dropout.offset, + shape=noise_shape[1:], + dtype=inputs.dtype, + seed=seed) + + # 0. if [keep_probs, 1.0) and 1. if [1.0, 1.0 + keep_prob) + binary_tensor = gen_math_ops.floor(random_tensor) + ret = math_ops.divide(inputs, keep_probs) * binary_tensor + ret.set_shape(inputs.get_shape()) + + # Setting control flow ops to avoid computing this function if not required + with ops.control_dependencies([ret]): + return array_ops.identity(ret) + + # Returning the dropout mask + return control_flow_ops.cond(all_keep_probs_are_one, + true_fn=lambda: inputs, + false_fn=get_dropout_mask) + +class SeededDropoutWrapperState( + collections.namedtuple('SeededDropoutWrapperState', ('cell_state', # The underlying cell state + 'time'))): # The current time + """ `namedtuple` storing the state of a `SeededDropoutWrapper`. """ + def clone(self, **kwargs): + """ Clone this object, overriding components provided by kwargs. """ + def with_same_shape(old, new): + """Check and set new tensor's shape.""" + if isinstance(old, ops.Tensor) and isinstance(new, ops.Tensor): + return contrib_framework.with_same_shape(old, new) + return new + return nest.map_structure(with_same_shape, + self, + super(SeededDropoutWrapperState, self)._replace(**kwargs)) + +class SeededDropoutWrapper(rnn_cell_impl.DropoutWrapper): + """Operator adding seeded dropout to inputs and outputs of the given cell.""" + + def __init__(self, cell, seeds, input_keep_probs=1.0, output_keep_probs=1.0, state_keep_probs=1.0, + variational_recurrent=False, input_size=None, dtype=None, seed=None, + dropout_state_filter_visitor=None): + """ Create a cell with added input, state, and/or output seeded dropout. + + If `variational_recurrent` is set to `True` (**NOT** the default behavior), then the same dropout mask is + applied at every step, as described in: + + Y. Gal, Z Ghahramani. "A Theoretically Grounded Application of Dropout in + Recurrent Neural Networks". https://arxiv.org/abs/1512.05287 + + Otherwise a different dropout mask is applied at every time step. + + Note, by default (unless a custom `dropout_state_filter` is provided), the memory state (`c` component + of any `LSTMStateTuple`) passing through a `DropoutWrapper` is never modified. This behavior is + described in the above article. + + :param cell: an RNNCell, a projection to output_size is added to it. + :param seeds: A tensor representing the seed for each item in the batch. (Size: (batch,)) + :param input_keep_probs: float, scalar tensor, or batch vector (b,). Input keep probabilities. + :param output_keep_probs: float, scalar tensor, or batch vector (b,). Output keep probabilities. + :param state_keep_probs: float, scalar tensor, or batch vector (b,). State keep probabilities (excl 'c') + :param variational_recurrent: If `True`, same dropout pattern is applied across all time steps per run call + :param input_size: (optional) (possibly nested tuple of) `TensorShape` objects containing the depth(s) of + the input tensors expected to be passed in to the `DropoutWrapper`. + Required and used **iff** `variational_recurrent = True` and `input_keep_prob < 1`. + :param dtype: (optional) The `dtype` of the input, state, and output tensors. + :param seed: (optional) integer, the default randomness seed to use if one of the seeds is 0. + :param dropout_state_filter_visitor: Optional. See DropoutWrapper for description. + """ + # pylint: disable=too-many-arguments + SeededDropoutWrapper.offset += 11828683 + super(SeededDropoutWrapper, self).__init__(cell=cell, + input_keep_prob=1., + output_keep_prob=1., + state_keep_prob=1., + variational_recurrent=False, + input_size=input_size, + dtype=dtype, + seed=seed, + dropout_state_filter_visitor=dropout_state_filter_visitor) + + def _convert_to_probs_tensor(keep_probs): + """ Converts a keep_probs tensor to its broadcastable shape """ + probs_tensor = ops.convert_to_tensor(keep_probs) + probs_tensor = gen_math_ops.maximum(0., gen_math_ops.minimum(1., probs_tensor)) + return gen_array_ops.reshape(probs_tensor, [-1, 1]) + + # Converting to tensor + self._input_keep_probs = _convert_to_probs_tensor(input_keep_probs) + self._output_keep_probs = _convert_to_probs_tensor(output_keep_probs) + self._state_keep_probs = _convert_to_probs_tensor(state_keep_probs) + + # Detecting if we skip computing those probs + self._skip_input_keep_probs = isinstance(input_keep_probs, float) and input_keep_probs == 1. + self._skip_output_keep_probs = isinstance(output_keep_probs, float) and output_keep_probs == 1. + self._skip_state_keep_probs = isinstance(state_keep_probs, float) and state_keep_probs == 1. + + # Generating variational recurrent + self._seeds = seeds + self._variational_recurrent = variational_recurrent + + enum_map_up_to = rnn_cell_impl._enumerated_map_structure_up_to # pylint: disable=protected-access + + def batch_noise(input_dim, inner_offset, inner_seed): + """ Generates noise for variational dropout """ + if not isinstance(input_dim, int): # Scalar tensor - We can ignore it safely + return None + return seeded_random(seeds, + offset=SeededDropoutWrapper.offset + inner_offset, + shape=[input_dim], + dtype=dtype, + seed=inner_seed) + + # Computing deterministic recurrent noise + if variational_recurrent: + if dtype is None: + raise ValueError('When variational_recurrent=True, dtype must be provided') + + input_map_fn = lambda index, inp_shape: batch_noise(inp_shape, 127602767, self._gen_seed('input', index)) + state_map_fn = lambda index, inp_shape: batch_noise(inp_shape, 31248361, self._gen_seed('state', index)) + output_map_fn = lambda index, inp_shape: batch_noise(inp_shape, 71709719, self._gen_seed('output', index)) + + if not self._skip_input_keep_probs: + if input_size is None: + raise ValueError("When variational_recurrent=True and input_keep_prob < 1.0 or " + "is unknown, input_size must be provided") + self._recurrent_input_noise = enum_map_up_to(input_size, input_map_fn, input_size) + self._recurrent_state_noise = enum_map_up_to(cell.state_size, state_map_fn, cell.state_size) + self._recurrent_output_noise = enum_map_up_to(cell.output_size, output_map_fn, cell.output_size) + + @property + def state_size(self): + """ The `state_size` property of `SeededDropoutWrapper`. + :return: A `SeededDropoutWrapperState` tuple containing shapes used by this object. + """ + return SeededDropoutWrapperState(cell_state=self._cell.state_size, + time=tensor_shape.TensorShape([])) + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this `AttentionWrapper`. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: An `SelfAttentionWrapperState` tuple containing zeroed out tensors. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + return SeededDropoutWrapperState(cell_state=self._cell.zero_state(batch_size, dtype), + time=array_ops.zeros([], dtype=dtypes.int32)) + + def _do_dropout(self, values, offset, salt_prefix, recurrent_noise, keep_probs, filtered_structure=None): + """ Decides whether to perform standard dropout or recurrent dropout + :param values: (Possibly nested) tensor on which to perform dropout. + :param offset: Integer. Offset to apply to compute the mask (should be different at each time step). + :param salt_prefix: Salt prefix to compute the default op seed. + :param recurrent_noise: The recurrent noise to apply for variational dropout. + :param keep_probs: The probabilities to keep the inputs (no dropout). - Size: (batch,) + :param filtered_structure: Tree-like structure used to decide where to apply dropout. + :return: The values with dropout applied. + """ + enum_map_up_to = rnn_cell_impl._enumerated_map_structure_up_to # pylint: disable=protected-access + + def reg_dropout_map_fn(index, do_dropout, value): + """ Applies regular dropout """ + if not isinstance(do_dropout, bool) or do_dropout: + return seeded_dropout(value, self._seeds, keep_probs, + offset=SeededDropoutWrapper.offset + offset, + seed=self._gen_seed(salt_prefix, index)) + return value + + def var_dropout_map_fn(index, do_dropout, value, noise): + """ Applies variational dropout """ + if noise is None: + return value + if not isinstance(do_dropout, bool) or do_dropout: + return self._variational_recurrent_dropout_value(index, value, noise, keep_probs) + return value + + # Shallow filtered substructure + # To traverse the entire structure; inside the dropout fn, we check to see if leafs of this are bool or not + if filtered_structure is None: + filtered_structure = values + + # Regular Dropout + if not self._variational_recurrent: + return enum_map_up_to(filtered_structure, reg_dropout_map_fn, *[filtered_structure, values]) + + # Variational Dropout + return enum_map_up_to(filtered_structure, var_dropout_map_fn, *[filtered_structure, values, recurrent_noise]) + + def __call__(self, inputs, state, scope=None): + """Run the cell with the declared dropouts.""" + if not isinstance(state, SeededDropoutWrapperState): + raise TypeError('Expected state to be instance of SeededDropoutWrapperState. Received type %s instead.' + % type(state)) + + # Dropout on inputs + if not self._skip_input_keep_probs: + inputs = self._do_dropout(inputs, + offset=state.time * 46202587, + salt_prefix='input', + recurrent_noise=self._recurrent_input_noise, + keep_probs=self._input_keep_probs) + + # Dropout on state + output, new_state = self._cell(inputs, state.cell_state, scope=scope) + if not self._skip_state_keep_probs: + shallow_filtered_substructure = nest.get_traverse_shallow_structure(self._dropout_state_filter, new_state) + new_state = self._do_dropout(new_state, + offset=state.time * 79907039, + salt_prefix='state', + recurrent_noise=self._recurrent_state_noise, + keep_probs=self._state_keep_probs, + filtered_structure=shallow_filtered_substructure) + + # Dropout on outputs + if not self._skip_output_keep_probs: + output = self._do_dropout(output, + offset=state.time * 16676461, + salt_prefix='output', + recurrent_noise=self._recurrent_output_noise, + keep_probs=self._output_keep_probs) + + # Returning + return output, SeededDropoutWrapperState(cell_state=new_state, time=state.time + 1) + +# Settings offsets, so that a different offset is generated per call +seeded_dropout.offset = constant_op.constant(0) +SeededDropoutWrapper.offset = constant_op.constant(0) diff --git a/diplomacy_research/models/layers/dynamic_decode.py b/diplomacy_research/models/layers/dynamic_decode.py new file mode 100644 index 0000000..9e3d2e2 --- /dev/null +++ b/diplomacy_research/models/layers/dynamic_decode.py @@ -0,0 +1,201 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Dynamic Decoders + - Contains an implementation of dynamic_decode that uses shape invariants + Source: https://github.com/tensorflow/tensorflow/blob/r1.13/tensorflow/contrib/seq2seq/python/ops/decoder.py +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import _create_zero_outputs, _transpose_batch_time +from diplomacy_research.utils.tensorflow import seq2seq +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import array_ops, gen_array_ops +from diplomacy_research.utils.tensorflow import constant_op +from diplomacy_research.utils.tensorflow import context +from diplomacy_research.utils.tensorflow import control_flow_ops +from diplomacy_research.utils.tensorflow import control_flow_util +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import math_ops, gen_math_ops +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import tensor_array_ops +from diplomacy_research.utils.tensorflow import tensor_util +from diplomacy_research.utils.tensorflow import variable_scope + +def dynamic_decode(decoder, output_time_major=False, impute_finished=False, maximum_iterations=None, + parallel_iterations=32, invariants_map=None, swap_memory=False, scope=None): + """ Performs dynamic decoding with `decoder`. + :param decoder: A `Decoder` instance. + :param output_time_major: If True, outputs [time, batch, ...], otherwise outputs [batch, time, ...] + :param impute_finished: If true, finished states are copied through the end of the game + :param maximum_iterations: Int or None. The maximum number of steps (otherwise decode until it's done) + :param parallel_iterations: Argument passed to tf.while_loop + :param invariants_map: Optional. Dictionary of tensor path (in initial_state) to its shape invariant. + :param swap_memory: Argument passed to `tf.while_loop`. + :param scope: Optional variable scope to use. + :return: A tuple of 1) final_outputs, 2) final_state, 3) final_sequence_length + """ + if not isinstance(decoder, seq2seq.Decoder): + raise TypeError('Expected decoder to be type Decoder, but saw: %s' % type(decoder)) + + with variable_scope.variable_scope(scope, 'decoder') as varscope: + + # Determine context types. + ctxt = ops.get_default_graph()._get_control_flow_context() # pylint: disable=protected-access + is_xla = control_flow_util.GetContainingXLAContext(ctxt) is not None + in_while_loop = control_flow_util.GetContainingWhileContext(ctxt) is not None + + # Properly cache variable values inside the while_loop. + # Don't set a caching device when running in a loop, since it is possible that train steps could be wrapped + # in a tf.while_loop. In that scenario caching prevents forward computations in loop iterations from re-reading + # the updated weights. + if not context.executing_eagerly() and not in_while_loop: + if varscope.caching_device is None: + varscope.set_caching_device(lambda op: op.device) + + # Setting maximum iterations + if maximum_iterations is not None: + maximum_iterations = ops.convert_to_tensor(maximum_iterations, + dtype=dtypes.int32, + name="maximum_iterations") + if maximum_iterations.get_shape().ndims != 0: + raise ValueError('maximum_iterations must be a scalar') + + def _inv_shape(maybe_ta): + """ Returns the invariatns shape """ + if isinstance(maybe_ta, tensor_array_ops.TensorArray): + return maybe_ta.flow.shape + return maybe_ta.shape + + def _invariants(structure): + """ Returns the invariants of a structure """ + return nest.map_structure(_inv_shape, structure) + + def _map_invariants(structure): + """ Returns the invariants of a structure, but replaces the invariant using the value in invariants_map """ + return nest.map_structure_with_paths(lambda path, tensor: (invariants_map or {}).get(path, + _inv_shape(tensor)), + structure) + + # Initializing decoder + initial_finished, initial_inputs, initial_state = decoder.initialize() + zero_outputs = _create_zero_outputs(decoder.output_size, decoder.output_dtype, decoder.batch_size) + + if is_xla and maximum_iterations is None: + raise ValueError('maximum_iterations is required for XLA compilation.') + if maximum_iterations is not None: + initial_finished = gen_math_ops.logical_or(initial_finished, maximum_iterations <= 0) + initial_sequence_lengths = array_ops.zeros_like(initial_finished, dtype=dtypes.int32) + initial_time = constant_op.constant(0, dtype=dtypes.int32) + + # Creating initial output TA + def _shape(batch_size, from_shape): + """ Returns the batch_size concatenated with the from_shape """ + if (not isinstance(from_shape, tensor_shape.TensorShape) or from_shape.ndims == 0): + return tensor_shape.TensorShape(None) + batch_size = tensor_util.constant_value(ops.convert_to_tensor(batch_size, name='batch_size')) + return tensor_shape.TensorShape([batch_size]).concatenate(from_shape) + + dynamic_size = maximum_iterations is None or not is_xla + + def _create_ta(shape, dtype): + """ Creates a tensor array""" + return tensor_array_ops.TensorArray(dtype=dtype, + size=0 if dynamic_size else maximum_iterations, + dynamic_size=dynamic_size, + element_shape=_shape(decoder.batch_size, shape)) + + initial_outputs_ta = nest.map_structure(_create_ta, decoder.output_size, decoder.output_dtype) + + def condition(unused_time, unused_outputs_ta, unused_state, unused_inputs, finished, unused_sequence_lengths): + """ While loop condition""" + return gen_math_ops.logical_not(math_ops.reduce_all(finished)) + + def body(time, outputs_ta, state, inputs, finished, sequence_lengths): + """ Internal while_loop body. """ + (next_outputs, decoder_state, next_inputs, decoder_finished) = decoder.step(time, inputs, state) + if decoder.tracks_own_finished: + next_finished = decoder_finished + else: + next_finished = gen_math_ops.logical_or(decoder_finished, finished) + next_sequence_lengths = array_ops.where(gen_math_ops.logical_not(finished), + gen_array_ops.fill(array_ops.shape(sequence_lengths), time + 1), + sequence_lengths) + + nest.assert_same_structure(state, decoder_state) + nest.assert_same_structure(outputs_ta, next_outputs) + nest.assert_same_structure(inputs, next_inputs) + + # Zero out output values past finish + if impute_finished: + emit = nest.map_structure(lambda out, zero: array_ops.where(finished, zero, out), + next_outputs, + zero_outputs) + else: + emit = next_outputs + + # Copy through states past finish + def _maybe_copy_state(new, cur): + # TensorArrays, multiple dynamic dims, and scalar states get passed through. + if isinstance(cur, tensor_array_ops.TensorArray): + pass_through = True + elif None in new.shape.as_list()[1:]: + pass_through = True + else: + new.set_shape(cur.shape) + pass_through = (new.shape.ndims == 0) + return new if pass_through else array_ops.where(finished, cur, new) + + if impute_finished: + next_state = nest.map_structure(_maybe_copy_state, decoder_state, state) + else: + next_state = decoder_state + + outputs_ta = nest.map_structure(lambda ta, out: ta.write(time, out), outputs_ta, emit) + return (time + 1, outputs_ta, next_state, next_inputs, next_finished, next_sequence_lengths) + + res = control_flow_ops.while_loop(condition, + body, + loop_vars=(initial_time, + initial_outputs_ta, + initial_state, + initial_inputs, + initial_finished, + initial_sequence_lengths), + shape_invariants=(_invariants(initial_time), + _invariants(initial_outputs_ta), + _map_invariants(initial_state), + _invariants(initial_inputs), + _invariants(initial_finished), + _invariants(initial_sequence_lengths)), + parallel_iterations=parallel_iterations, + maximum_iterations=maximum_iterations, + swap_memory=swap_memory) + + final_outputs_ta = res[1] + final_state = res[2] + final_sequence_lengths = res[5] + + final_outputs = nest.map_structure(lambda ta: ta.stack(), final_outputs_ta) + + try: + final_outputs, final_state = decoder.finalize(final_outputs, final_state, final_sequence_lengths) + except NotImplementedError: + pass + + if not output_time_major: + final_outputs = nest.map_structure(_transpose_batch_time, final_outputs) + + return final_outputs, final_state, final_sequence_lengths diff --git a/diplomacy_research/models/layers/graph_convolution.py b/diplomacy_research/models/layers/graph_convolution.py new file mode 100644 index 0000000..e820a9d --- /dev/null +++ b/diplomacy_research/models/layers/graph_convolution.py @@ -0,0 +1,128 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Graph Convolution + - Implements the graph convolution algorithm (ArXiv 1609.02907) + - Partially adapted from https://github.com/tkipf/gcn/ (MIT License) +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +import numpy as np +from diplomacy_research.models.layers.initializers import he, zeros +from diplomacy_research.models.state_space import NB_NODES +from diplomacy_research.utils.tensorflow import tf, batch_norm + +# Method described in - SEMI-SUPERVISED CLASSIFICATION WITH GRAPH CONVOLUTIONAL NETWORKS +# ArXiv 1609.02907 +def preprocess_adjacency(adjacency_matrix): + """ Symmetrically normalize the adjacency matrix for graph convolutions. + :param adjacency_matrix: A NxN adjacency matrix + :return: A normalized NxN adjacency matrix + """ + # Computing A^~ = A + I_N + adj = adjacency_matrix + adj_tilde = adj + np.eye(adj.shape[0]) + + # Calculating the sum of each row + sum_of_row = np.array(adj_tilde.sum(1)) + + # Calculating the D tilde matrix ^ (-1/2) + d_inv_sqrt = np.power(sum_of_row, -0.5).flatten() + d_inv_sqrt[np.isinf(d_inv_sqrt)] = 0. + d_mat_inv_sqrt = np.diag(d_inv_sqrt) + + # Calculating the normalized adjacency matrix + norm_adj = adj_tilde.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt) + return np.array(norm_adj, dtype=np.float32) + +class GraphConvolution(): + """ Performs a graph convolution (ArXiV 1609.02907) """ + # pylint: disable=too-few-public-methods, too-many-arguments + + def __init__(self, input_dim, output_dim, norm_adjacency, activation_fn=tf.nn.relu, residual=False, bias=False, + scope=None, reuse=None): + """ Initializes the graph convolutional network + :param input_dim: The number of features per node in the input + :param output_dim: The number of features per node desired in the output + :param norm_adjacency: [PLACEHOLDER] The sparse normalized adjacency matrix (NxN matrix) + :param activation_fn: The activation function to use after the graph convolution + :param residual: Use residual connection or not. + :param bias: Boolean flag that indicates we also want to include a bias term + :param scope: Optional. The scope to use for this layer + :param reuse: Optional. Boolean. Whether or not the layer and its variables should be reused. + """ + self.activation_fn = activation_fn if activation_fn is not None else lambda x: x + self.norm_adjacency = norm_adjacency + self.bias = bias + self.var_w, self.var_b = None, None + self.residual = residual + + # Initializing variables + with tf.variable_scope(scope, 'GraphConv', reuse=reuse): + self.var_w = he('W', [NB_NODES, input_dim, output_dim]) + if self.bias: + self.var_b = zeros('b', [output_dim]) + + def __call__(self, inputs): + """ Actually performs the graph convolution + :param inputs: The input feature matrix + :return: The activated output matrix + """ + # Performs the convolution + pre_act = tf.transpose(inputs, perm=[1, 0, 2]) # (b, N, in ) => (N, b, in ) + pre_act = tf.matmul(pre_act, self.var_w) # (N, b, in) * (N, in, out) => (N, b, out) + pre_act = tf.transpose(pre_act, perm=[1, 0, 2]) # (N, b, out) => (b, N, out) + pre_act = tf.matmul(self.norm_adjacency, pre_act) # (b, N, N) * (b, N, out) => (b, N, out) + + # Adds the bias + if self.bias: + pre_act += self.var_b # (b, N, out) + (1,1,out) => (b, N, out) + + # Applying activation fn and residual connection + post_act = self.activation_fn(pre_act) + if self.residual: + post_act += inputs + return post_act # (b, N, out) + +def film_gcn_res_block(inputs, gamma, beta, gcn_out_dim, norm_adjacency, is_training, residual=True, + activation_fn=tf.nn.relu): + """ Following the design here https://arxiv.org/pdf/1709.07871.pdf + :param inputs: A tensor of [b, NB_NODES, gcn_in_dim] + :param gamma: A tensor of [b, 1, gcn_out_dim]. Used for film + :param beta: A tensor of [b, 1, gcn_out_dim]. Used for film + :param gcn_out_dim: number of output channels of graph conv + :param norm_adjacency: The adjacency matrix for graph conv + :param is_training: a flag for train/test behavior. + :param residual: Use residual connection or not. + :param activation_fn: The activation function on the output. default: relu + :return: A tensor of [b, NB_NODES, gcn_out_dim] + """ + gcn_in_dim = inputs.shape.as_list()[-1] + assert gcn_in_dim == gcn_out_dim or not residual, 'For residual blocks, the in and out dims must be equal' + + gcn_result = GraphConvolution(input_dim=gcn_in_dim, + output_dim=gcn_out_dim, + norm_adjacency=norm_adjacency, + activation_fn=None, + residual=False, + bias=True)(inputs) + gcn_bn_result = batch_norm(gcn_result, is_training=is_training, fused=True) + film_result = gamma * gcn_bn_result + beta + + # Applying activation fn and residual connection + if activation_fn is not None: + film_result = activation_fn(film_result) + if residual: + film_result += inputs + return film_result diff --git a/diplomacy_research/models/layers/initializers.py b/diplomacy_research/models/layers/initializers.py new file mode 100644 index 0000000..a65c245 --- /dev/null +++ b/diplomacy_research/models/layers/initializers.py @@ -0,0 +1,83 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Initializers + - Contains implementation of common variable initializers +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import tf + +def uniform(name, shape, scale=0.05, **kwargs): + """ Creates a variable which is randomly initiated between -scale and +scale + :param name: The name of the variable + :param shape: The shape of the variable to create + :param scale: The minimum and maximum value of the random uniform distribution + :return: A variable who is randomly uniformly distributed between -scale and +scale + """ + initial = tf.random_uniform_initializer(minval=-scale, maxval=scale, dtype=tf.float32) + return tf.get_variable(name=name, shape=shape, initializer=initial, **kwargs) + +def glorot(name, shape, **kwargs): + """ Creates a variable which is initiated using the Glorot & Bengio uniform method + :param name: The name of the variable + :param shape: The shape of the variable to create + :return: A variable who is initiated using Glorot uniform + """ + if len(shape) >= 2: + fan_in, fan_out = shape[-2], shape[-1] + else: + fan_in, fan_out = shape[-1], shape[-1] + init_range = tf.sqrt(6. / (fan_in + fan_out)) + initial = tf.random_uniform_initializer(minval=-1. * init_range, maxval=init_range, dtype=tf.float32) + return tf.get_variable(name=name, shape=shape, initializer=initial, **kwargs) + +def he(name, shape, **kwargs): + """ Creates a variable which is initiated using the He normal method + :param name: The name of the variable + :param shape: The shape of the variable to create + :return: A variable who is initiated using He normal + """ + # pylint: disable=invalid-name + fan_in = shape[-2] if len(shape) >= 2 else shape[-1] + init_range = tf.sqrt(2. / fan_in) + initial = tf.random_normal_initializer(mean=0., stddev=init_range, dtype=tf.float32) + return tf.get_variable(name=name, shape=shape, initializer=initial, **kwargs) + +def zeros(name, shape, **kwargs): + """ Creates a variable which is initiated to zeros + :param name: The name of the variable + :param shape: The shape of the variable + :return: A zero-initiated variable + """ + return constant(name, shape, value=0., dtype=tf.float32, **kwargs) + +def ones(name, shape, **kwargs): + """ Creates a variable which is initiated to ones + :param name: The name of the variable + :param shape: The shape of the variable + :return: A one-initiated variable + """ + return constant(name, shape, value=1., dtype=tf.float32, **kwargs) + +def constant(name, shape, value, dtype=tf.float32, **kwargs): + """ Creates a variable which is initiated to a constant value + :param name: The name of the variable + :param shape: The shape of the variable + :param value: The constant value of the tensor + :param dtype: The data type + :return: A constant-initiated variable + """ + initial = tf.constant_initializer(value=value, dtype=dtype) + return tf.get_variable(name=name, shape=shape, initializer=initial, **kwargs) diff --git a/diplomacy_research/models/layers/layers.py b/diplomacy_research/models/layers/layers.py new file mode 100644 index 0000000..c8f4555 --- /dev/null +++ b/diplomacy_research/models/layers/layers.py @@ -0,0 +1,123 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Layers + - Contains custom TensorFlow Layers objects +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import base +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import nn +from diplomacy_research.utils.tensorflow import tensor_shape + + +class Identity(base.Layer): + """ Identity Layer """ + + def __init__(self, dtype, name=None, **kwargs): + """ Constructor + :param dtype: The output dtype + :param name: The name of the layer (string). + :param kwargs: Optional keyword arguments. + """ + super(Identity, self).__init__(dtype=dtype, name=name, **kwargs) + + def call(self, inputs, **kwargs): + """ Returns inputs """ + return inputs + + def compute_output_shape(self, input_shape): + """ Computes the output shape given the input shape """ + return input_shape + + +class MultiLayers(base.Layer): + """ Multi Layer Class - Applies multiple layers sequentially """ + + def __init__(self, layers, **kwargs): + """ Constructor + :param layers: A list of layers to apply + :param kwargs: Optional. Keyword arguments + :type layers: List[base.Layer] + """ + super(MultiLayers, self).__init__(**kwargs) + self.layers = layers + + def call(self, inputs, **kwargs): + """ Sequentially calls each layer with the output of the previous one """ + outputs = inputs + for layer in self.layers: + outputs = layer(outputs) + return outputs + + def compute_output_shape(self, input_shape): + """ Computes the output shape given the input shape """ + output_shape = input_shape + for layer in self.layers: + output_shape = layer.compute_output_shape(output_shape) + return output_shape + + +class Dropout(base.Layer): + """ Modified Dropout Class """ + + def __init__(self, keep_prob=0.5, noise_shape=None, seed=None, name=None, **kwargs): + """ Constructor + :param keep_prob: The keep probability, between 0 and 1. + :param noise_shape: 1D tensor of type `int32` representing the shape of the binary dropout mask that will + be multiplied with the input. + :param seed: A Python integer. Used to create random seeds. + :param name: The name of the layer (string). + :param kwargs: Optional keyword arguments. + """ + super(Dropout, self).__init__(name=name, **kwargs) + self.keep_prob = keep_prob + self.noise_shape = noise_shape + self.seed = seed + + def call(self, inputs, **kwargs): + """ Applies dropout """ + return nn.dropout(inputs, self.keep_prob, noise_shape=self.noise_shape, seed=self.seed) + + def compute_output_shape(self, input_shape): + """ Computes the output shape given the input shape """ + return input_shape + +class MatMul(base.Layer): + """ Matrix Multiplication class """ + + def __init__(self, proj_matrix, transpose_a=False, transpose_b=False, name=None, **kwargs): + """ Constructor + :param proj_matrix: The proj_matrix + :param transpose_a: Boolean that indicates to transpose the first matrix in the matrix multiplication. + :param transpose_b: Boolean that indicates to transpose the second matrix in the matrix multiplication. + :param name: The name of the layer (string). + :param kwargs: Optional keyword arguments. + """ + super(MatMul, self).__init__(name=name, **kwargs) + self.proj_matrix = proj_matrix + self.transpose_a = transpose_a + self.transpose_b = transpose_b + + def call(self, inputs, **kwargs): + """ Performs the matrix multiplication """ + return math_ops.matmul(inputs, self.proj_matrix, transpose_a=self.transpose_a, transpose_b=self.transpose_b) + + def compute_output_shape(self, input_shape): + """ Computes the output shape of the given layer """ + output_size = self.proj_matrix.shape[0].value if self.transpose_b else self.proj_matrix.shape[1].value + input_shape = tensor_shape.TensorShape(input_shape) + input_shape = input_shape.with_rank_at_least(2) + return input_shape[:-1].concatenate(output_size) diff --git a/diplomacy_research/models/layers/noisy_networks.py b/diplomacy_research/models/layers/noisy_networks.py new file mode 100644 index 0000000..3ea0736 --- /dev/null +++ b/diplomacy_research/models/layers/noisy_networks.py @@ -0,0 +1,82 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Noisy Networks + - Converts variables in a graph to their noisy equivalent +""" +from math import sqrt +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import tf +from diplomacy_research.utils.tensorflow import graph_editor + + +def convert_to_noisy_variables(variables, activation=None): + """ Converts a list of variables to noisy variables + :param variables: A list of variables to make noisy + :param activation: Optional. The activation function to use on the linear noisy transformation + :return: Nothing, but modifies the graph in-place + + Reference: 1706.10295 - Noisy Networks for exploration + """ + if tf.get_collection(tf.GraphKeys.TRAIN_OP): + raise RuntimeError('You must call convert_to_noisy_variables before applying an optimizer on the graph.') + + graph = tf.get_default_graph() + if not isinstance(variables, list): + variables = list(variables) + + # Replacing each variable + for variable in variables: + variable_read_op = _get_variable_read_op(variable, graph) + variable_outputs = _get_variable_outputs(variable_read_op, graph) + variable_scope = variable.name.split(':')[0] + variable_shape = variable.shape.as_list() + fan_in = variable_shape[0] + + # Creating noisy variables + with tf.variable_scope(variable_scope + '_noisy'): + with tf.device(variable.device): + s_init = tf.constant_initializer(0.5 / sqrt(fan_in)) + + noisy_u = tf.identity(variable, name='mu') + noisy_s = tf.get_variable(name='sigma', + shape=variable.shape, + dtype=tf.float32, + initializer=s_init, + caching_device=variable._caching_device) # pylint: disable=protected-access + noise = tf.random.normal(shape=variable_shape) + + replaced_var = noisy_u + noisy_s * noise + replaced_var = activation(replaced_var) if activation else replaced_var + + # Replacing in-place + inputs_index = [var_index for var_index, var_input in enumerate(graph_editor.sgv(*variable_outputs).inputs) + if var_input.name.split(':')[0] == variable_read_op.name.split(':')[0]] + graph_editor.connect(graph_editor.sgv(replaced_var.op), + graph_editor.sgv(*variable_outputs).remap_inputs(inputs_index), + disconnect_first=True) + +def _get_variable_read_op(variable, graph): + """ Returns the /read operation for a variable """ + return graph.get_operation_by_name(variable.name.split(':')[0] + '/read') + +def _get_variable_outputs(variable_read_op, graph): + """ Returns the list of tensors that have the variable as input """ + outputs = [] + for graph_op in graph.get_operations(): + for var_input in graph_op.inputs._inputs: # pylint: disable=protected-access + if var_input in variable_read_op.outputs: + outputs += [graph_op] + return outputs diff --git a/diplomacy_research/models/layers/seeded_random.py b/diplomacy_research/models/layers/seeded_random.py new file mode 100644 index 0000000..6b7053d --- /dev/null +++ b/diplomacy_research/models/layers/seeded_random.py @@ -0,0 +1,55 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Seeded Random + - Contains the seeded_random op +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import gen_array_ops +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import load_so_by_name +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import random_seed +from diplomacy_research.utils.tensorflow import gen_user_ops + +# Finding the correct implementation of seeded_random +SEEDED_RANDOM_SO = gen_user_ops if hasattr(gen_user_ops, 'seeded_random') else load_so_by_name('seeded_random') + + +def seeded_random(seeds, offset, shape, dtype, seed=None, name=None): + """ Outputs random values from a uniform distribution. + The random values are deterministic given a seed. + + :param seeds: A vector of seeds (Size: [batch,]) - If 0, defaults to seed attr, then graph seed, then random. + :param offset: Integer to add to the seed to get a deterministic mask. + :param shape: The shape required for each seed (e.g. [3, 5] with a batch of 10 will return [10, 3, 5]). + :param dtype: The type of the output. `float16`, `float32`, `float64` + :param seed: A Python integer. Used to create a default seed for the operation. + :param name: A name for the operation (optional). + :return: A tensor of the specified shape filled with deterministic random values. + """ + if dtype not in (dtypes.float16, dtypes.bfloat16, dtypes.float32, dtypes.float64): + raise ValueError('Invalid dtype %r' % dtype) + with ops.name_scope(name, 'seeded_random', [shape]): + seeds = ops.convert_to_tensor(seeds, dtype=dtypes.int32, name='seeds') + shape = ops.convert_to_tensor(shape, dtype=dtypes.int32, name='shape') + offset = ops.convert_to_tensor(offset, dtype=dtypes.int32, name='offset') + size = math_ops.reduce_prod(shape) + graph_seed, op_seed = random_seed.get_seed(seed) + matrix_output = SEEDED_RANDOM_SO.seeded_random(seeds, offset, size, seed=graph_seed, seed2=op_seed) + output = gen_array_ops.reshape(matrix_output, array_ops.concat([(-1,), shape], axis=0)) + return math_ops.cast(output, dtype) diff --git a/diplomacy_research/models/layers/transformer.py b/diplomacy_research/models/layers/transformer.py new file mode 100644 index 0000000..1bd032d --- /dev/null +++ b/diplomacy_research/models/layers/transformer.py @@ -0,0 +1,453 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Transformer + - Contains the code to implement a transformer cell +""" +# Adapted from: https://github.com/openai/gpt-2/blob/master/src/model.py - MIT License +import collections +import logging +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import pad_axis +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import array_ops, gen_array_ops +from diplomacy_research.utils.tensorflow import contrib_framework +from diplomacy_research.utils.tensorflow import core +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import embedding_lookup +from diplomacy_research.utils.tensorflow import gelu +from diplomacy_research.utils.tensorflow import init_ops +from diplomacy_research.utils.tensorflow import math_ops, gen_math_ops +from diplomacy_research.utils.tensorflow import nn_ops +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import rnn_cell_impl +from diplomacy_research.utils.tensorflow import variable_scope + +# Constants +LOGGER = logging.getLogger(__name__) + +def _get_embedding_fn(embedding): + """ Returns a callable embedding function """ + return embedding if callable(embedding) else (lambda ids: embedding_lookup(embedding, ids)) + +class TransformerCellState( + collections.namedtuple('TransformerCellState', ('past_attentions', # Past attentions + 'feeder_state', # The state of the feeder cell + 'time'))): # The current time step + """ `namedtuple` storing the state of a `TransformerCellState`. """ + + def clone(self, **kwargs): + """ Clone this object, overriding components provided by kwargs. """ + def with_same_shape(old, new): + """Check and set new tensor's shape.""" + if isinstance(old, ops.Tensor) and isinstance(new, ops.Tensor): + return contrib_framework.with_same_shape(old, new) + return new + return nest.map_structure(with_same_shape, self, super(TransformerCellState, self)._replace(**kwargs)) + +class TransformerCell(rnn_cell_impl.RNNCell): + """ Transformer RNN cell that conditions optionally on a previous context and feeder cell + This is a uni-directional implementation, where attention is only on the current and previous outputs + """ + + def __init__(self, nb_layers, nb_heads, word_embedding, position_embedding, batch_size, feeder_cell=None, + feeder_init_state=None, past_attentions=None, context=None, context_word_embedding=None, + past_seq_lengths=None, scope=None, name=None): + """ Uni-directional transformer cell + :param nb_layers: The number of layers to use + :param nb_heads: The number of attention heads to use + :param word_embedding: The word embedding vector - [vocab_size, emb_size] + :param position_embedding: The position embedding vector - [context_size, emb_size] + :param batch_size: The current batch size - Scalar + :param feeder_cell: Optional. An other RNN cell that returns additional inputs to condition on. + :param feeder_init_state: Optional. The initial state of the feeder. + :param past_attentions: Optional. The past_attention tensor from the final state of another cell. + :param context: Optional. A list of tokens to use as context (initial input of the sequence) - (b, seq_len) + :param context_word_embedding: The word embedding vector to embed words in the context - [ctxt_voc, emb_sz] + :param past_seq_lengths: Optional. The len of each item in the past_attentions or context (b,) + :param scope: Optional. Scope to use to properly share parameters. + :param name: Optional scope name. + """ + # pylint: disable=too-many-arguments + # Initializing RNN Cell + super(TransformerCell, self).__init__(name=name) + + # Setting values + self._nb_layers = nb_layers + self._nb_heads = nb_heads + self._word_embedding = word_embedding # [vocab_size, emb_size] + self._position_embedding_fn = _get_embedding_fn(position_embedding) + self._feeder_cell = feeder_cell + self._feeder_init_state = feeder_init_state + self._past_attns = past_attentions + self._context = None + self._context_word_embedding_fn = lambda ids: ids + self._past_seq_lengths = past_seq_lengths + self._scope = scope + + # Infering shapes + self._batch_size = batch_size + self._vocab_size = word_embedding.shape.as_list()[0] + self._emb_size = word_embedding.shape.as_list()[1] + self._position_emb_size = position_embedding.shape.as_list()[0] + assert self._emb_size % self._nb_heads == 0, 'The embedding size must be perfectly divisible by the nb of heads' + + # Cannot provide both a context and a past_attentions tensor array + assert past_attentions is None or context is None, 'Cannot provide both a context and past_attentions' + + # Validating context + if context is not None: + assert context_word_embedding is not None, 'Arg "context_word_embedding" is required when context provided.' + if feeder_cell is not None: + LOGGER.warning('The feeder cell will not be applied on the context.') + LOGGER.warning('Otherwise, use "past_attentions" on the output of another transformer cell.') + self._context = context + self._context_word_embedding_fn = _get_embedding_fn(context_word_embedding) + + @property + def output_size(self): + """ Returns the cell output size """ + return self._emb_size + + @property + def state_size(self): + """ The `state_size` property of `TransformerCell` """ + past_attns_shape = [self._nb_layers, 2, self._nb_heads, None, self._emb_size // self._nb_heads] + feeder_state_shape = tensor_shape.TensorShape([]) if self._feeder_cell is None else self._feeder_cell.state_size + return TransformerCellState(past_attentions=tensor_shape.TensorShape(past_attns_shape), + feeder_state=feeder_state_shape, + time=tensor_shape.TensorShape([])) + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this `IdentityCell`. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: A zeroed out scalar representing the initial state of the cell. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + if self._feeder_cell is None: + feeder_init_state = array_ops.zeros([], dtype=dtype) + elif self._feeder_init_state is not None: + feeder_init_state = self._feeder_init_state + else: + feeder_init_state = self._feeder_cell.zero_state(batch_size, dtype) + + # Empty past attentions + if self._past_attns is None: + head_size = self._emb_size // self._nb_heads + past_attns_shape = [batch_size, self._nb_layers, 2, self._nb_heads, 0 * batch_size, head_size] + self._past_attns = array_ops.zeros(past_attns_shape, dtype=dtypes.float32) + + # No Context - Returning a zero past attention + if self._context is None: + return TransformerCellState(past_attentions=self._past_attns, + feeder_state=feeder_init_state, + time=array_ops.zeros([], dtype=dtypes.int32)) + + # Context provided - Computing attention by running a single block step + _, present_attns, _ = self._step(inputs=self._context_word_embedding_fn(self._context), + past_attns=self._past_attns, + time=0, + feeder_cell=None, + feeder_state=None) + return TransformerCellState(past_attentions=present_attns, + feeder_state=feeder_init_state, + time=array_ops.zeros([], dtype=dtypes.int32)) + + def compute_output_shape(self, input_shape): + """ Computes the output shape of the given layer """ + input_shape = tensor_shape.TensorShape(input_shape) + input_shape = input_shape.with_rank_at_least(2) + return input_shape[:-1].concatenate(self.output_size) + + def call(self, inputs, state): # pylint: disable=arguments-differ + """ Runs the identity cell + :param inputs: Tensor of shpae - [batch, emb_size] + :param state: The state from the previous time step. + :return: The cell output and the next state + """ + if not isinstance(state, TransformerCellState): + raise TypeError('Expected state to be instance of TransformerCellState. Received type %s instead.' + % type(state)) + + past_attns, feeder_state, time = state + cell_outputs, present_attns, next_feeder_state = self._step(inputs[:, None, :], past_attns, time, + feeder_cell=self._feeder_cell, + feeder_state=feeder_state) + cell_outputs = array_ops.squeeze(cell_outputs, axis=1) + + # Updating feeder cell state - 'feeder' processing mode. + if self._feeder_cell is not None and hasattr(self._feeder_cell, 'update_state'): + next_feeder_state = getattr(self._feeder_cell, 'update_state')(time, cell_outputs, next_feeder_state) + + # Computing next_state + next_state = TransformerCellState(past_attentions=array_ops.concat([past_attns, present_attns], axis=-2), + feeder_state=next_feeder_state, + time=time + 1) + return cell_outputs, next_state + + def _step(self, inputs, past_attns, time, feeder_cell, feeder_state): + """ Performs the block operation on n-layers + :param inputs: The tensor inputs (embedding of each word) - [batch, seq_len, emb_size] + :param past_attns: The past attentions - [batch, nb_layers, 2, nb_heads. past_length, emb_size // nb_heads] + :param time: A tensor representing the current time step + :param feeder_cell: None or A feeder cell that returns a RNN cell output to use for conditioning + :param feeder_state: None or the initial state of the feeder cell + :param name: Name of the scope - To share weights between calls + :return: A tuple consisting of: + 1) The cell outputs - [batch, seq_len, emb_size] + 2) The present attention - [batch, nb_layers, 2, nb_heads. seq_len, emb_size // nb_heads] + 3) The new state of the feeder cell + """ + with variable_scope.variable_scope(self._scope, default_name='step'): + past_length = array_ops.shape(past_attns)[-2] # How many past attention steps we have + seq_len = array_ops.shape(inputs)[-2] # How many steps are we computing for the current time + emb_size = inputs.shape[-1].value # The size of the embedding + assert emb_size == self._emb_size, 'Expected an embedding size of %d' % self._emb_size + + # 1) Computing the word embedding of each token + assert inputs.shape.ndims == 3, 'Expected [batch, seq_len, emb_size]' # [bz, seq, emb] + out_h = inputs + + # 2) Computing the position embedding of each token + # If we know the context was padded, the effective past length is the context length + nb of time steps + if self._past_seq_lengths is not None: + past_length = gen_math_ops.minimum(past_length, self._past_seq_lengths + time)[:, None] # [bz, 1] + else: + past_length = gen_array_ops.fill([self._batch_size, 1], value=past_length) # [bz, 1] + step_ix = math_ops.range(seq_len)[None, :] # [1, seq_len] + token_positions = gen_math_ops.add(past_length, step_ix) # [batch, seq_len] + token_positions = gen_math_ops.minimum(self._position_emb_size - 1, token_positions) # [batch, seq_len] + h_pos = self._position_embedding_fn(token_positions) # [bz, seq, emb] + out_h = out_h + h_pos + + # 3) If we have a feeder cell, we also need to condition 'h' on it. + next_feeder_state = feeder_state + if feeder_cell is not None: + assert feeder_state is not None, 'A feeder state is required if a feeder cell is provided.' + assert inputs.shape[1].value == 1, 'The seq dimension must be 1 to use a feeder_cell' + feeder_outputs, next_feeder_state = feeder_cell(array_ops.squeeze(inputs, axis=1), feeder_state) + h_feed = feeder_outputs # [bz, feeder_sz] + if feeder_outputs.shape[-1].value != emb_size: + h_feed = core.Dense(emb_size, activation=None, name='h_feed')(h_feed) # [bz, emb] + h_feed = gen_array_ops.tile(h_feed[:, None, :], [1, seq_len, 1]) # [bz, seq, emb] + out_h = out_h + h_feed + + # Transformer + presents = [] + pasts = array_ops.unstack(past_attns, axis=1) # list of [batch, 2, heads, past_len, head_sz] + assert len(pasts) == self._nb_layers, 'Expected the past attention to have %d layers.' % self._nb_layers + + for layer_ix, past_attn in enumerate(pasts): + out_h, present = self._block(out_h, past_attn, 'layer.%d' % layer_ix) + presents += [present] + presents = array_ops.stack(presents, axis=1) + + # Normalizing and returning + cell_outputs = self._norm(out_h, 'norm_h') # [batch, seq, emb] + return cell_outputs, presents, next_feeder_state + + @staticmethod + def _conv1d(inputs, output_dim, name=None): + """ Performs 1d convolution + :param inputs: The tensor inputs - [axis_0, ..., axis_n-1, input_dim] + :param output_dim: The size of the 1d convoltuion + :param name: Name of the scope - To share weights between calls + :return: The tensors after the convolution - [axis_0, ..., axis_n-1, output_dim] + """ + with variable_scope.variable_scope(name): + input_dims = [array_ops.shape(inputs)[axis] if dim.value is None else dim.value + for axis, dim in enumerate(inputs.shape)] + input_prefix_dims, input_last_dim = input_dims[:-1], input_dims[-1] + weight = variable_scope.get_variable('w', + shape=[input_last_dim, output_dim], + initializer=init_ops.random_normal_initializer(0.02)) + beta = variable_scope.get_variable('b', + shape=[output_dim], + initializer=init_ops.constant_initializer(0.)) + + inputs = gen_array_ops.reshape(inputs, [-1, input_last_dim]) # [B, input_last_dim] + outputs = math_ops.matmul(inputs, weight) + beta # [B, output_dim] + return gen_array_ops.reshape(outputs, input_prefix_dims + [output_dim]) # [..., output_dim] + + @staticmethod + def _norm(inputs, name, axis=-1): + """ Applies normalization to the input tensor by normalizing to mean=0, std_dev=1, then applying a gamma, beta + :param inputs: The tensor inputs to normalize + :param name: Name of the scope - To share weights between calls + :param axis: Axis to normalize. Defaults to last one. + :return: A tensor of the same shape as inputs, but normalized and transformed + """ + with variable_scope.variable_scope(name): + axis_dim = inputs.shape[axis].value + gamma = variable_scope.get_variable('gamma', [axis_dim], initializer=init_ops.constant_initializer(1.)) + beta = variable_scope.get_variable('beta', [axis_dim], initializer=init_ops.constant_initializer(0.)) + mean = math_ops.reduce_mean(inputs, axis=axis, keepdims=True) + var = math_ops.reduce_mean(gen_math_ops.square(inputs - mean), axis=axis, keepdims=True) + norm_inputs = (inputs - mean) * gen_math_ops.rsqrt(var + 1e-8) + outputs = gamma * norm_inputs + beta + return outputs + + def _mask_attn_weights(self, attn_weights): + """ Masks the attention weights + :param attn_weights: The attention weights - [batch, nb_head, seq_len, seq_len + past_length] + :return: A tensor of 0 and 1. of the same shape and dtype as attn_weights + """ + seq_len = array_ops.shape(attn_weights)[-2] + total_len = array_ops.shape(attn_weights)[-1] + + # 1) Creating the attention mask matrix (with the lower triangle set to 1. on the right) + # e.g. if seq_len == 3, and total_len == 10 + # the attention mask would be: - [seq_len, total_len] + # [[1., 1., 1., 1., 1., 1., 1., 1., 0., 0.], + # [1., 1., 1., 1., 1., 1., 1., 1., 1., 0.], + # [1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]] + num_lower = math_ops.cast(-1, dtypes.int32) + num_upper = total_len - seq_len + attn_mask = gen_array_ops.matrix_band_part(array_ops.ones([seq_len, total_len]), num_lower, num_upper) + + # No past_attentions/context - We just add two leading dimensions to attn_mask and can return it + if self._past_seq_lengths is None: + return attn_mask[None, None, :, :] + + # If we have a context with varying sequence length, we also need to mask the items after the end of sequence + # e.g. + # [[1., 1., 1., 0., 0., 0., 0., 1., 1., 1.], # => length of 3 (padded to 7) + seq_len of 3 + # [1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], # => length of 7 (padded to 7) + seq_len of 3 + # [1., 1., 1., 1., 1., 0., 0., 1., 1., 1.]] # => length of 5 (padded to 7) + seq_len of 3 + # + # The resulting attention mask would be the product of the two. + # [[1., 1., 1., 0., 0., 0., 0., 1., 0., 0.], + # [1., 1., 1., 1., 1., 1., 1., 1., 1., 0.], + # [1., 1., 1., 1., 1., 0., 0., 1., 1., 1.]] + seq_mask = array_ops.sequence_mask(self._past_seq_lengths, dtype=dtypes.float32) # [b, max_len] + seq_mask = pad_axis(seq_mask, axis=-1, min_size=total_len) # [b, total_len] + + # Returning the multiplication of the two masks + return gen_math_ops.mul(attn_mask[None, None, :, :], seq_mask[:, None, None, :]) # [b, nb_heads, seq, total] + + def _attn(self, inputs, attn_dim, past_attn, name): + """ Performs multi-head attention inside a transformer block + :param inputs: The tensor inputs - [batch, seq_len, emb_size] + :param attn_dim: The dimension of the attention (and output) + :param past_attn: The past attention - [batch, 2, nb_heads. seq_len, emb_size // nb_heads] + :param name: Name of the scope - To share weights between calls + :return: A tuple consisting of: + 1) The output of the attention - [batch, seq_len, attn_dim] + 2) The present attention - [batch, 2, nb_heads, seq_len, emb_size // nb_heads] + """ + assert inputs.shape.ndims == 3, 'Expected [batch, seq_len, emb_size]' + with variable_scope.variable_scope(name): + + # Computing the query, key, and value vectors + query_keys_values = self._conv1d(inputs, 3 * attn_dim, 'attn_fc1') # [batch, seq_len, 3 * attn_dim] + query, keys, values = array_ops.split(query_keys_values, 3, axis=-1) # 3x [batch, seq_len, attn_dim] + + # Splitting into nb_heads of size attn_dim // nb_heads + # Output format is [batch, nb_heads, seq_len, attn_dim // nb_heads] + query = self._split_in_heads(query) # [bz, nb_heads, seq_len, head_sz] + keys = self._split_in_heads(keys) # [bz, nb_heads, seq_len, head_sz] + values = self._split_in_heads(values) # [bz, nb_heads, seq_len, head_sz] + head_size = query.shape[-1].value + + # Stacking keys and values to get the present_attn + present_attn = array_ops.stack([keys, values], axis=1) # [bz, 2, nb_heads, seq_len, head_sz] + + # Adding past_attn to keys and values + past_keys, past_values = array_ops.unstack(past_attn, 2, axis=1) # 2x [bz, nb_heads, past_len, head_sz] + keys = array_ops.concat([past_keys, keys], axis=-2) # [bz, nb_heads, total_len, head_sz] + values = array_ops.concat([past_values, values], axis=-2) # [bz, nb_heads, total_len, head_sz] + + # Performing multi-head attention + attn_w = math_ops.matmul(query, keys, transpose_b=True) # [bz. nb_heads, seq_len, total_len] + attn_w = attn_w * gen_math_ops.rsqrt(math_ops.cast(head_size, attn_w.dtype) + 1e-8) + attn_mask = self._mask_attn_weights(attn_w) # [bz, 1, seq_len, total_len] + attn_w = attn_w * attn_mask + math_ops.cast(1e-10, attn_w.dtype) * (1. - attn_mask) + attn_w = nn_ops.softmax(attn_w) + attn = math_ops.matmul(attn_w, values) # [bz, nb_heads, seq_len, head_sz] + + # Merging attention heads, then 1d conv before returning + out_attn = self._merge_heads(attn) # [bz, seq_len, attn_dim] + out_attn = self._conv1d(out_attn, attn_dim, 'attn_fc2') # [bz, seq_len, attn_dim] + + # Returning + return out_attn, present_attn + + def _block(self, inputs, past_attn, name): + """ Computes a transformer block + :param inputs: The inputs tensor - [batch, seq_len, emb_dim] + :param past_attn: The past attention - [batch, 2, nb_heads, emb_size // nb_heads] + :param name: Name of the scope - To share weights between calls + :return: A tuple consisting of: + 1) The output of the transformer block - [batch, seq_len, emb_dim] + 2) The present attention - [batch, 2, nb_heads, 1, emb_size // nb_heads] + """ + with variable_scope.variable_scope(name): + input_dim = inputs.shape[-1].value + h_out = inputs + h_attn, present_attn = self._attn(self._norm(h_out, 'block_norm1'), input_dim, past_attn, 'block_attn') + h_out = h_out + h_attn + h_mlp = self._linear(self._norm(h_out, 'block_norm2'), input_dim * 4, 'block_mlp') + h_out = h_out + h_mlp + return h_out, present_attn + + def _linear(self, inputs, proj_dim, name): + """ Computes a linear unit inside a full block - Projects to 'proj_dim' and back to 'input_dim' + :param inputs: The inputs tensor - [axis_0, ..., axis_n-1, input_dim] + :param proj_dim: The dimension of the projection + :param name: Name of the scope - To share weights between calls + :return: A tensor of shape - [axis_0, ..., axis_n-1, input_dim] + """ + with variable_scope.variable_scope(name): + input_dim = inputs.shape[-1].value + output_h1 = gelu(self._conv1d(inputs, proj_dim, 'mlp_fc1')) + output_h2 = self._conv1d(output_h1, input_dim, 'mlp_fc2') + return output_h2 + + def _split_in_heads(self, inputs): + """ Splits the tensor into heads of size attn_dim / heads + :param inputs: The tensor to split - [batch, seq_len, attn_dim] + :return: A tensor in the format - [batch, nb_heads, seq_len, attn_dim // nb_heads] + """ + assert inputs.shape.ndims == 3, 'Expected inputs to be [batch, seq_len, attn_dim]' + attn_dim = inputs.shape[-1].value + assert attn_dim % self._nb_heads == 0, 'The attn_dim must be evenly divisible by the nb of heads' + + # Reshaping to [batch, seq_len, nb_heads, head_size] + batch_size = array_ops.shape(inputs)[0] + seq_len = array_ops.shape(inputs)[1] + head_size = attn_dim // self._nb_heads + inputs = gen_array_ops.reshape(inputs, [batch_size, seq_len, self._nb_heads, head_size]) + + # Transposing to [batch, nb_heads, seq_len, head_size] + return array_ops.transpose(inputs, [0, 2, 1, 3]) + + def _merge_heads(self, inputs): + """ Merges the attn heads of the tensor into a single dimension + :param inputs: The tensor to merge - [batch, nb_heads, seq_len, head_size] + :return: A tensor in the format - [batch, seq_len, nb_heads * head_size] + """ + assert inputs.shape.ndims == 4, 'Expected inputs to be [batch, nb_heads, seq_len, head_size]' + assert inputs.shape[1].value == self._nb_heads, 'Expected the 2nd dimension to be the number of heads' + + # Transposing to [batch, seq_len, nb_heads, head_size] + inputs = array_ops.transpose(inputs, [0, 2, 1, 3]) + + # Merging last 2 dims + batch_size = array_ops.shape(inputs)[0] + seq_len = array_ops.shape(inputs)[1] + head_size = inputs.shape[-1].value + return gen_array_ops.reshape(inputs, [batch_size, seq_len, self._nb_heads * head_size]) diff --git a/diplomacy_research/models/layers/wrappers.py b/diplomacy_research/models/layers/wrappers.py new file mode 100644 index 0000000..24a4d0e --- /dev/null +++ b/diplomacy_research/models/layers/wrappers.py @@ -0,0 +1,277 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Wrappers + - Contains various tensorflow decoder wrappers +""" +import collections +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.utils.tensorflow import _transpose_batch_time +from diplomacy_research.utils.tensorflow import _unstack_ta +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import contrib_framework +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import embedding_lookup +from diplomacy_research.utils.tensorflow import gen_math_ops +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import rnn_cell_impl + + +def _get_embedding_fn(embedding): + """ Returns a callable embedding function """ + if embedding is None: + return lambda ids: ids + if callable(embedding): + return embedding + return lambda ids: embedding_lookup(embedding, ids) + +class ConcatenationWrapper(rnn_cell_impl.RNNCell): + """ Wraps another `RNNCell` and concatenates the same input at each time step. """ + + def __init__(self, cell, concat_inputs, name=None): + """ Constructs an ConcatenationWrapper + + :param cell: An instance of `RNNCell`. + :param concat_inputs: The inputs to concatenate at each time step [batch, input_size] + :param name: name: Name to use when creating ops. + """ + # pylint: disable=too-many-arguments + # Initializing RNN Cell + super(ConcatenationWrapper, self).__init__(name=name) + rnn_cell_impl.assert_like_rnncell('cell', cell) + + # Setting values + self._cell = cell + self._concat_inputs = concat_inputs + self._cell_input_fn = lambda input_1, input_2: array_ops.concat([input_1, input_2], axis=-1) + + @property + def output_size(self): + """ Returns the cell output size """ + return self._cell.output_size + + @property + def state_size(self): + """ The `state_size` property of the parent cell. """ + return self._cell.state_size + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this cell. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: A tuple containing zeroed out tensors and, possibly, empty TA objects. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + return self._cell.zero_state(batch_size, dtype) + + def compute_output_shape(self, input_shape): + """ Computes the output shape of the given layer """ + input_shape = tensor_shape.TensorShape(input_shape) + input_shape = input_shape.with_rank_at_least(2) + return input_shape[:-1].concatenate(self.output_size) + + def call(self, inputs, state): # pylint: disable=arguments-differ + """ Performs a time-step (i.e. concatenation) + :param inputs: (Possibly nested tuple of) Tensor, the input at this time step. + :param state: The state from the previous time step. + :return: The cell output and the next state + """ + cell_inputs = self._cell_input_fn(inputs, self._concat_inputs) + cell_output, next_state = self._cell(cell_inputs, state) + return cell_output, next_state + + def update_state(self, time, cell_outputs, state): + """ Update the state of a feeder cell after it has been processed + :param time: The current time step + :param cell_outputs: The output of the main cell + :param state: The current next_state for the feeder cell + :return: The updated next_state + """ + if not hasattr(self._cell, 'update_state'): + return state + return getattr(self._cell, 'update_state')(time, cell_outputs, state) + +class ArrayConcatWrapperState( + collections.namedtuple('ArrayConcatWrapperState', ('cell_state', # The underlying cell state + 'time'))): # The current time step + """ `namedtuple` storing the state of a `ArrayConcatWrapper`. """ + + def clone(self, **kwargs): + """ Clone this object, overriding components provided by kwargs. """ + def with_same_shape(old, new): + """Check and set new tensor's shape.""" + if isinstance(old, ops.Tensor) and isinstance(new, ops.Tensor): + return contrib_framework.with_same_shape(old, new) + return new + return nest.map_structure(with_same_shape, self, super(ArrayConcatWrapperState, self)._replace(**kwargs)) + +class ArrayConcatWrapper(rnn_cell_impl.RNNCell): + """ Wraps another `RNNCell` and concatenates the input[i] of the array at each time step. """ + + def __init__(self, cell, concat_inputs, mask_inputs=None, embedding=None, name=None): + """ Constructs an ArrayConcatWrapper + + If embedding is provided, the concat_inputs is expected to be [batch, time] + If embedding is not provided, the concat_inputs is expected to be [batch, time, input_size] + + mask_inputs of True will mask (zero-out) the given input (or embedded input) + + :param cell: An instance of `RNNCell`. + :param concat_inputs: The inputs to concatenate [batch, time] or [batch, time, input_size] + :param mask_inputs: Optional. Boolean [batch, time] that indicates if the concat_inputs is to be masked + :param embedding: Optional. Embedding fn or embedding vector to embed the concat_inputs at each time step + :param name: name: Name to use when creating ops. + """ + # pylint: disable=too-many-arguments + # Initializing RNN Cell + super(ArrayConcatWrapper, self).__init__(name=name) + rnn_cell_impl.assert_like_rnncell('cell', cell) + + # Setting values + self._cell = cell + self._cell_input_fn = lambda input_1, input_2: array_ops.concat([input_1, input_2], axis=-1) + self._embedding_fn = _get_embedding_fn(embedding) + self._mask_inputs_ta = None + + # Converting mask inputs to a tensor array + if mask_inputs is not None: + mask_inputs = nest.map_structure(_transpose_batch_time, mask_inputs) + self._mask_inputs_ta = nest.map_structure(_unstack_ta, mask_inputs) # [time, batch] + + # Converting concat_inputs to a tensor array + concat_inputs = nest.map_structure(_transpose_batch_time, concat_inputs) + self._concat_inputs_ta = nest.map_structure(_unstack_ta, concat_inputs) # [time, batch] / [t, b, inp_sz] + + @property + def output_size(self): + """ Returns the cell output size """ + return self._cell.output_size + + @property + def state_size(self): + """ The `state_size` property of `ArrayConcatWrapper`. + :return: An `ArrayConcatWrapperState` tuple containing shapes used by this object. + """ + return ArrayConcatWrapperState(cell_state=self._cell.state_size, + time=tensor_shape.TensorShape([])) + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this `ArrayConcatWrapper`. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: An `ArrayConcatWrapperState` tuple containing zeroed out tensors and, possibly, empty TA objects. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + return ArrayConcatWrapperState(cell_state=self._cell.zero_state(batch_size, dtype), + time=array_ops.zeros([], dtype=dtypes.int32)) + + def compute_output_shape(self, input_shape): + """ Computes the output shape of the given layer """ + input_shape = tensor_shape.TensorShape(input_shape) + input_shape = input_shape.with_rank_at_least(2) + return input_shape[:-1].concatenate(self.output_size) + + def call(self, inputs, state): # pylint: disable=arguments-differ + """ Performs a time-step (i.e. concatenation of input[i]) + :param inputs: (Possibly nested tuple of) Tensor, the input at this time step. + :param state: The state from the previous time step. + :return: The cell output and the next state + """ + if not isinstance(state, ArrayConcatWrapperState): + raise TypeError('Expected state to be instance of ArrayConcatWrapperState. Received type %s instead.' + % type(state)) + + next_time = state.time + 1 + concat_inputs_i = self._embedding_fn(self._concat_inputs_ta.read(state.time)) # [batch, emb_size] + + # Masking - Values of True are zeroed-out + if self._mask_inputs_ta is not None: + mask_i = self._mask_inputs_ta.read(state.time) + concat_inputs_i = concat_inputs_i * math_ops.cast(gen_math_ops.logical_not(mask_i)[:, None], dtypes.float32) + + # Concatenating to real input + cell_inputs = self._cell_input_fn(inputs, concat_inputs_i) + cell_state = state.cell_state + cell_output, cell_state = self._cell(cell_inputs, cell_state) + next_state = ArrayConcatWrapperState(cell_state=cell_state, time=next_time) + return cell_output, next_state + + def update_state(self, time, cell_outputs, state): + """ Update the state of a feeder cell after it has been processed + :param time: The current time step + :param cell_outputs: The output of the main cell + :param state: The current next_state for the feeder cell + :return: The updated next_state + """ + if not hasattr(self._cell, 'update_state'): + return state + return ArrayConcatWrapperState(cell_state=getattr(self._cell, 'update_state')(time, + cell_outputs, + state.cell_state), + time=state.time) + +class IdentityCell(rnn_cell_impl.RNNCell): + """ RNN cell that returns its inputs as outputs """ + + def __init__(self, output_size, name=None): + """ IdentityCell - Returns its inputs as outputs + :param output_size: The size of the input / output + :param name: name: Name to use when creating ops. + """ + # pylint: disable=too-many-arguments + # Initializing RNN Cell + super(IdentityCell, self).__init__(name=name) + + # Setting values + self._output_size = output_size + + @property + def output_size(self): + """ Returns the cell output size """ + return self._output_size + + @property + def state_size(self): + """ The `state_size` property of `IdentityCell`. """ + return tensor_shape.TensorShape([]) + + def zero_state(self, batch_size, dtype): + """ Return an initial (zero) state tuple for this `IdentityCell`. + :param batch_size: `0D` integer tensor: the batch size. + :param dtype: The internal state data type. + :return: A zeroed out scalar representing the initial state of the cell. + """ + with ops.name_scope(type(self).__name__ + 'ZeroState', values=[batch_size]): + return array_ops.zeros([], dtype=dtypes.int32) + + def compute_output_shape(self, input_shape): + """ Computes the output shape of the given layer """ + input_shape = tensor_shape.TensorShape(input_shape) + input_shape = input_shape.with_rank_at_least(2) + return input_shape[:-1].concatenate(self.output_size) + + def call(self, inputs, state): # pylint: disable=arguments-differ + """ Runs the identity cell + :param inputs: (Possibly nested tuple of) Tensor, the input at this time step. + :param state: The state from the previous time step. + :return: The cell output and the next state + """ + outputs, next_state = inputs, state + assert outputs.shape[1].value == self._output_size, \ + 'Expected output size of %d - Got %d' % (self._output_size, outputs.shape[1].value) + return outputs, next_state diff --git a/diplomacy_research/models/policy/__init__.py b/diplomacy_research/models/policy/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/base_policy_adapter.py b/diplomacy_research/models/policy/base_policy_adapter.py new file mode 100644 index 0000000..2691e81 --- /dev/null +++ b/diplomacy_research/models/policy/base_policy_adapter.py @@ -0,0 +1,202 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy Adapter + - Implements an instance of a policy adapter using an active or a frozen Tensorflow graph +""" +from abc import ABCMeta, abstractmethod +import logging +from tornado import gen +from diplomacy_research.models.base_adapter import BaseAdapter +from diplomacy_research.models.datasets.queue_dataset import QueueDataset + +# Constants +LOGGER = logging.getLogger(__name__) + +class BasePolicyAdapter(BaseAdapter, metaclass=ABCMeta): + """ Allows the evaluation of a policy adapter from a TensorFlow graph and session """ + + @property + def has_value_model(self): + """ Indicates if the policy model has a value model (actor-critic) or is just a policy model """ + return bool('state_value' in self.outputs or not isinstance(self.feedable_dataset, QueueDataset)) + + @abstractmethod + def tokenize(self, order): + """ Returns the tokens use by the adapter for a specific order """ + raise NotImplementedError() + + @abstractmethod + def _decode_policy(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Returns the output of the Policy Model decoder + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: Boolean that indicates that we want to use a beam search, + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: A future (fetches) to yield on. + """ + # pylint: disable=too-many-arguments + raise NotImplementedError() + + @abstractmethod + @gen.coroutine + def get_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds the orders to submit at each location given the current state + Orderings are calculated by defining an ordering and computing the next unit order conditioned on the + orders already selected + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: Boolean that indicates that we want to use a beam search, + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False and with_state_value=False (default), a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + - if prefetch=False and with_state_value=True, a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + raise NotImplementedError() + + @gen.coroutine + def get_beam_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds all the beams with their probabilities returned by the diverse beam search + Beams are ordered by score (highest first). + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False and with_state_value=False (default), a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + - if prefetch=False and with_state_value=True, a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + 3) The state value for the given state + """ + raise NotImplementedError() + + @abstractmethod + @gen.coroutine + def get_updated_policy_details(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + old_policy_details=None, submitted_orders=None, **kwargs): + """ Computes the current policy details (locs, tokens, log_probs) under the current model + Either one of 1) old_policy_details or 2) submitted_orders must be submitted to extract the locs and tokens + + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param old_policy_details: (Optional) Some policy details + ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + :param submitted_orders: (Optional) A list of submitted orders ['A PAR - BUR', 'A MAR H'] + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, The corresponding updated policy details + ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + """ + raise NotImplementedError() + + @abstractmethod + @gen.coroutine + def expand(self, confirmed_orders, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Computes the conditional probability of possible orders for each loc given the confirmed orders. + :param confirmed_orders: The list of orders on which to condition the probs (e.g. ['A PAR H', 'A MAR - SPA'] + :param locs: The locations for which we want to compute probabilities + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the probabilities + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, + A dictionary with every location in locs as key, and a list of tuples where each tuple is composed + of 1) an order, 2) the order conditional probability, 3) the conditional log probs of each token + e.g. {'PAR': [('A PAR H', 0.000, [...]), ('A PAR - BUR', 0.000, [...]), ...]} + """ + raise NotImplementedError() + + @abstractmethod + @gen.coroutine + def get_state_value(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, **kwargs): + """ Computes the value of the current state for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, a float representing the value of the state of the game to the specified power + """ + raise NotImplementedError() diff --git a/diplomacy_research/models/policy/base_policy_builder.py b/diplomacy_research/models/policy/base_policy_builder.py new file mode 100644 index 0000000..dcdfe38 --- /dev/null +++ b/diplomacy_research/models/policy/base_policy_builder.py @@ -0,0 +1,58 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Policy Dataset Builder + - Abstract class responsible for generating the protocol buffers to be used by the model + - All policies builders will inherit from this class +""" +from abc import ABCMeta +import logging +from diplomacy_research.models.datasets.base_builder import BaseBuilder + +# Constants +LOGGER = logging.getLogger(__name__) + +class BasePolicyBuilder(BaseBuilder, metaclass=ABCMeta): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this dataset builder """ + raise NotImplementedError() + + @staticmethod + def get_feedable_item(locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Computes and return a feedable item (to be fed into the feedable queue) + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :return: A feedable item, with feature names as key and numpy arrays as values + """ + # pylint: disable=arguments-differ + raise NotImplementedError() + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + raise NotImplementedError() diff --git a/diplomacy_research/models/policy/base_policy_model.py b/diplomacy_research/models/policy/base_policy_model.py new file mode 100644 index 0000000..31d729d --- /dev/null +++ b/diplomacy_research/models/policy/base_policy_model.py @@ -0,0 +1,130 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Policy model + - Contains the base policy model, which is used by all policy models. +""" +from collections import namedtuple +import logging +import re +from diplomacy_research.models.base_model import BaseModel, load_args as load_common_args +from diplomacy_research.settings import NO_PRESS_ALL_DATASET + +# Constants +VALID_TAG = re.compile('^tag/policy/[a-z_]+/v[0-9]{3}_[a-z0-9_]+$') +LOGGER = logging.getLogger(__name__) + +# Separate variable, so PolicyAdapter can load it +POLICY_BEAM_WIDTH = 10 +GREEDY_DECODER = 0 +TRAINING_DECODER = 1 +SAMPLE_DECODER = 2 +BEAM_SEARCH_DECODER = 3 + +class OrderProbTokenLogProbs(namedtuple('OrderProbTokenLogProbs', ('order', # The order (e.g. A PAR - MAR) + 'probability', # The (cond.) prob of the order + 'log_probs'))): # The log probs of each token selec. + """ A named tuple containing the order, its conditional prob., and the log prob of each selected token """ + +class StatsKey(namedtuple('StatsKey', ('prefix', 'power_name', 'order_type', 'season', 'phase', 'position'))): + """ A named tuple representing a set of characteristics to compute accuracy """ + + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_common_args() + [ + ('str', 'dataset', NO_PRESS_ALL_DATASET, 'The dataset builder to use for supervised learning'), + ('float', 'learning_rate', 1e-3, 'Initial learning rate.'), + ('float', 'lr_decay_factor', 0.93, 'Learning rate decay factor.'), + ('float', 'max_gradient_norm', 5.0, 'Maximum gradient norm.'), + ('int', 'beam_width', POLICY_BEAM_WIDTH, 'The number of beams to use for beam search'), + ('int', 'beam_groups', POLICY_BEAM_WIDTH // 2, 'The number of groups for beam search'), + ('float', 'dropout_rate', 0.5, 'Dropout rate to apply to all items in a training batch (Supervised learning).'), + ('bool', 'use_v_dropout', True, 'Use variational dropout (same mask across all time steps)'), + ('float', 'perc_epoch_for_training', 1.00, 'If < 1., runs evaluation every time x% of training epoch is done'), + ('int', 'early_stopping_stop_after', 5, 'Stops after this many epochs if none of the tags have improved'), + ('float', 'policy_coeff', 1.0, 'The coefficient to apply to the policy loss') + ] + +class BasePolicyModel(BaseModel): + """ Base Policy Model""" + + def __init__(self, dataset, hparams): + """ Initialization + :param dataset: The dataset that is used to iterate over the data. + :param hparams: A dictionary of hyper parameters with their values + :type dataset: diplomacy_research.models.datasets.supervised_dataset.SupervisedDataset + :type dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + """ + BaseModel.__init__(self, + parent_model=None, + dataset=dataset, + hparams=hparams) + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + raise NotImplementedError() + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + raise NotImplementedError() + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + raise NotImplementedError() + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + + def _validate(self): + """ Validates the built model """ + # Making sure all the required outputs are present + assert 'board_state' in self.features + assert 'current_power' in self.features + assert 'targets' in self.outputs + assert 'selected_tokens' in self.outputs + assert 'argmax_tokens' in self.outputs + assert 'logits' in self.outputs + assert 'log_probs' in self.outputs + assert 'beam_tokens' in self.outputs + assert 'beam_log_probs' in self.outputs + assert 'board_state_conv' in self.outputs + assert 'board_state_0yr_conv' in self.outputs + assert 'rnn_states' in self.outputs + assert 'policy_loss' in self.outputs + assert 'draw_prob' in self.outputs + assert 'learning_rate' in self.outputs + assert 'in_retreat_phase' in self.outputs + + # Making sure we have a name tag + for tag in self.outputs: + if VALID_TAG.match(tag): + class_name = str(type(self)) # diplomacy_research.models.policy.token_based.vxxx_002.yyy + expected_tag = '/'.join(['tag'] + class_name.split('.')[2:5]) + assert tag == expected_tag, 'Expected tag to be "%s".' % expected_tag + break + else: + raise RuntimeError('Unable to find a name tag. Format: "tag/policy/xxxxx/v000_xxxxxx".') diff --git a/diplomacy_research/models/policy/order_based/__init__.py b/diplomacy_research/models/policy/order_based/__init__.py new file mode 100644 index 0000000..84e20db --- /dev/null +++ b/diplomacy_research/models/policy/order_based/__init__.py @@ -0,0 +1,17 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Order Based Policy Model """ +from .adapter import PolicyAdapter +from .model import OrderBasedPolicyModel, load_args +from .dataset.base import BaseDatasetBuilder diff --git a/diplomacy_research/models/policy/order_based/adapter.py b/diplomacy_research/models/policy/order_based/adapter.py new file mode 100644 index 0000000..f91e1b5 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/adapter.py @@ -0,0 +1,653 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" OrderBased Policy Adapter + - Implements an instance of a policy adapter to connect to a order_based model +""" +from collections import OrderedDict +import logging +import numpy as np +from numpy.random import choice +from tornado import gen +from diplomacy_research.models.policy.base_policy_adapter import BasePolicyAdapter +from diplomacy_research.models.policy.base_policy_model import OrderProbTokenLogProbs, TRAINING_DECODER, \ + GREEDY_DECODER, SAMPLE_DECODER +from diplomacy_research.models.policy.order_based.model import OrderBasedPolicyModel +from diplomacy_research.models.state_space import GO_ID, EOS_ID, PAD_ID, order_to_ix, ix_to_order, \ + get_orderable_locs_for_powers +from diplomacy_research.proto.diplomacy_proto.common_pb2 import MapStringList +from diplomacy_research.utils.cluster import CompletedFuture, process_fetches_dict +from diplomacy_research.utils.model import logsumexp, apply_temperature, strip_keys, assert_normalized + +# Constants +LOGGER = logging.getLogger(__name__) + +class PolicyAdapter(BasePolicyAdapter): + """ Adapter to connect to an OrderBased model """ + + @staticmethod + def get_signature(): + """ Returns the signature of all the possible calls using this adapter + Format: { method_signature_name: {'placeholders': {name: (value, numpy_dtype)}, + 'outputs': [output_name, output_name] } } + e.g. {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs: ['selected_tokens', 'log_probs', 'draw_prob']}} + """ + return {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs': ['selected_tokens', + 'log_probs', + 'draw_prob']}, + 'policy_beam_search': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['beam_tokens', + 'beam_log_probs', + 'draw_prob']}, + 'policy_evaluate_with_state_value': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs': ['selected_tokens', + 'log_probs', + 'draw_prob', + 'state_value']}, + 'policy_beam_search_with_state_value': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['beam_tokens', + 'beam_log_probs', + 'draw_prob', + 'state_value']}, + 'policy_expand': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['logits']}, + 'policy_log_probs': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['log_probs', 'draw_prob']}, + 'policy_get_value': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['state_value']}} + + def tokenize(self, order): + """ Returns the tokens use by the adapter for a specific order """ + return [order_to_ix(order) or PAD_ID] + + def _decode_policy(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Returns the output of the Policy Model decoder + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: Boolean that indicates that we want to use a beam search, + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: A future (fetches) to yield on. + """ + is_prefetching = kwargs.get('prefetch', False) + + # No locations provided, we can return early + if not locs: + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + LOGGER.warning('The method .get_feedable_item() did not return an item to feed to the model.') + LOGGER.warning('Make sure you have provided the correct locs and a list of possible orders') + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Queue + with_state_value = kwargs.get('with_state_value', False) + use_beam = kwargs.get('use_beam', False) + queue_name = {(False, False): 'policy_evaluate', + (False, True): 'policy_evaluate_with_state_value', + (True, False): 'policy_beam_search', + (True, True): 'policy_beam_search_with_state_value'}[(use_beam, with_state_value)] + return self.feedable_dataset.get_results(queue_name, feedable_item, **kwargs) + + @staticmethod + def _process_fetches(decode_fetches): + """ Decodes the fetches returned by self._decode_policy() + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + tokens, log_probs = decode_fetches[:2] + decoded_results = OrderBasedPolicyModel._decode(selected_tokens=np.array([tokens]), # pylint: disable=protected-access + log_probs=np.array([log_probs])) + return decoded_results['decoded_orders'][0] + + @staticmethod + def _process_single_beam_fetches(decode_fetches, temperature=0.): + """ Decodes the beam fetches returned self._decode_policy() - This samples the beam to use based on a temp. + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + beam_tokens, beam_log_probs = decode_fetches[:2] + + # Computing probabilities after applying temperature + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=temperature).tolist() + nb_probs = len(probs) + + # Sampling according to probs + selected_beam_id = choice(range(nb_probs), p=assert_normalized(adj_probs)) + + # Decoding that specific beam + # Assigning probability mass equally over all orders in beam + selected_beam_tokens = np.array([beam_tokens[selected_beam_id]]) + selected_beam_log_probs = np.zeros_like(selected_beam_tokens) + decoded_results = OrderBasedPolicyModel._decode(selected_tokens=selected_beam_tokens, # pylint: disable=protected-access + log_probs=selected_beam_log_probs)['decoded_orders'][0] + + # Adjusting log probs to make it uniform over all locs + nb_locs = len(decoded_results) + adj_log_probs = beam_log_probs[selected_beam_id] / max(1, nb_locs) + decoded_results = {loc: OrderProbTokenLogProbs(order=decoded_results[loc].order, + probability=decoded_results[loc].probability, + log_probs=[adj_log_probs]) for loc in decoded_results} + return decoded_results + + @gen.coroutine + def get_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds the orders to submit at each location given the current state + Orderings are calculated by defining an ordering and computing the next unit order conditioned on the + orders already selected + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: Boolean that indicates that we want to use a beam search, (Default; False) + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False and with_state_value=False (default), a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + - if prefetch=False and with_state_value=True, a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + with_state_value = kwargs.get('with_state_value', False) + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + selected_orders = [] + policy_details = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + state_value = 0. + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] + if decode_fetches is None: + return tuple([selected_orders, policy_details] + ([state_value] if with_state_value else [])) + + if kwargs.get('use_beam', False): + results = self._process_single_beam_fetches(decode_fetches, temperature=kwargs.get('temperature', 0.)) + else: + results = self._process_fetches(decode_fetches) + + # Building policy details based on returned locations + for loc in results: + order_prob_token_log_probs = results[loc] + + # Splitting + order = order_prob_token_log_probs.order + log_probs = order_prob_token_log_probs.log_probs + + # Building the policy details + selected_orders += [order] + policy_details['locs'] += [loc] + policy_details['tokens'] += self.tokenize(order) + policy_details['log_probs'] += list(log_probs) + + # Getting draw action and probability + policy_details['draw_action'] = bool(decode_fetches[2] >= 0.5) + policy_details['draw_prob'] = decode_fetches[2] + + # Getting state value + if with_state_value: + state_value = decode_fetches[-1] + + # Returning sampled orders with the policy details + return tuple([selected_orders, policy_details] + ([state_value] if with_state_value else [])) + + @gen.coroutine + def get_beam_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds all the beams with their probabilities returned by the diverse beam search + Beams are ordered by score (highest first). + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False and with_state_value=False (default), a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + - if prefetch=False and with_state_value=True, a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + 3) The state value for the given state + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + with_state_value = kwargs.get('with_state_value', False) + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + use_beam=True, + **strip_keys(kwargs, ['use_beam'])) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + beams, adj_probs, state_value = [], [], 0. + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] # (beam_orders, beam_log_probs, draw, value) + if decode_fetches is None: + return tuple([beams, adj_probs] + ([state_value] if with_state_value else [])) + + # Computing adj probabilities + beam_orders, beam_log_probs = decode_fetches[:2] + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=1.).tolist() + + # Decoding + for beam_candidates in beam_orders: + beams += [[ix_to_order(order_ix) for order_ix in beam_candidates if order_ix > EOS_ID]] + + # Getting state value + if with_state_value: + state_value = decode_fetches[-1] + + # Returning + return tuple([beams, adj_probs] + ([state_value] if with_state_value else [])) + + @gen.coroutine + def get_updated_policy_details(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + old_policy_details=None, submitted_orders=None, **kwargs): + """ Computes the current policy details (locs, tokens, log_probs) under the current model + Either one of 1) old_policy_details or 2) submitted_orders must be submitted to extract the locs and tokens + + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param old_policy_details: (Optional) Some policy details + ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + :param submitted_orders: (Optional) A list of submitted orders ['A PAR - BUR', 'A MAR H'] + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, The corresponding updated policy details + ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + """ + assert self.feedable_dataset.has_queue('policy_log_probs'), 'Unable to get supervised log probs' + + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_updated_policy_details' + + # Setting tokens and actual locs + if old_policy_details: + actual_locs = old_policy_details['locs'] + tokens = old_policy_details['tokens'] + + # Using submitted orders + else: + actual_locs, tokens = [], [] + for order in submitted_orders: + actual_locs += [order.split()[1][:3]] if len(order.split()) >= 2 else [] + tokens += self.tokenize(order) + + # Getting fetches + if not is_postfetching: + + if not old_policy_details and not submitted_orders: + LOGGER.warning('Unable to compute policy details without old policy details or submitted orders.') + ret_val = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + return {'%s/ret_val' % fetch_prefix: CompletedFuture(ret_val)} if is_prefetching else ret_val + + # In adjustment phase, the locs are all the orderable locs + if state_proto.name[-1] == 'A': + locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + elif old_policy_details: + locs = old_policy_details['locs'] + else: + locs = [order.split()[1][:3] for order in submitted_orders if len(order.split()) >= 2] + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + ret_val = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + return {'%s/ret_val' % fetch_prefix: CompletedFuture(ret_val)} if is_prefetching else ret_val + + feedable_item['decoder_inputs'] = [GO_ID] + tokens + feedable_item['decoder_lengths'] = len(tokens) + + # Querying model + queue_name = 'policy_log_probs' + fetches['%s/log_probs_fetches' % fetch_prefix] = self.feedable_dataset.get_results(queue_name, + feedable_item, + **kwargs) + + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Processing fetches + if '%s/ret_val' % fetch_prefix in fetches: + return fetches['%s/ret_val' % fetch_prefix] + + new_log_probs, new_draw_prob = fetches['%s/log_probs_fetches' % fetch_prefix] + new_log_probs = new_log_probs[:len(actual_locs)].tolist() + + # Validating + assert submitted_orders is not None or len(new_log_probs) == len(old_policy_details['log_probs']) + + # Returning + return {'locs': actual_locs, + 'tokens': tokens, + 'log_probs': new_log_probs, + 'draw_action': old_policy_details['draw_action'] if old_policy_details else bool(new_draw_prob >= 0.5), + 'draw_prob': new_draw_prob} + + @gen.coroutine + def expand(self, confirmed_orders, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Computes the conditional probability of possible orders for each loc given the confirmed orders. + :param confirmed_orders: The list of orders on which to condition the probs (e.g. ['A PAR H', 'A MAR - SPA'] + :param locs: The locations for which we want to compute probabilities + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the probabilities + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, + A dictionary with every location in locs as key, and a list of tuples where each tuple is composed + of 1) an order, 2) the order conditional probability, 3) the conditional log probs of each token + e.g. {'PAR': [('A PAR H', 0.000, [...]), ('A PAR - BUR', 0.000, [...]), ...]} + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'expand' + + # Locations + locs = [loc[:3] for loc in locs] + confirmed_locs = [order.split()[1][:3] for order in confirmed_orders] + + # Getting fetches + if not is_postfetching: + + confirmed_tokens = [] + for order in confirmed_orders: + confirmed_tokens += self.tokenize(order) + + # Building all feedable items + feedable_items = OrderedDict() + candidates = OrderedDict() + for loc in locs: + feedable_item = self.feedable_dataset.get_feedable_item(confirmed_locs + [loc], + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + loc_candidates = [candidate for candidate in feedable_item['candidates'][-1] if candidate > PAD_ID] + + # No candidates - Can't expand + if not loc_candidates: + continue + + # Setting the decoder input + # We need to set a dummy target for the loc to expand - It will not be used by the decoder + feedable_item['decoder_inputs'] = [GO_ID] + confirmed_tokens + [loc_candidates[0]] + feedable_item['decoder_lengths'] = len(confirmed_tokens) + 1 + + # Storing + feedable_items[loc] = feedable_item + candidates[loc] = loc_candidates + + # Running all the feedable items + queue_name = 'policy_expand' + fetches['%s/locs' % fetch_prefix] = CompletedFuture([loc for loc in feedable_items]) + fetches['%s/candidates' % fetch_prefix] = CompletedFuture(candidates) + fetches['%s/results' % fetch_prefix] = [self.feedable_dataset.get_results(queue_name, item, **kwargs) + for item in feedable_items.values()] + + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Processing fetches + def softmax(softmax_logits): + """ Compute softmax values for the logits """ + e_x = np.exp(softmax_logits - softmax_logits.max(axis=-1, keepdims=True)) + return e_x / e_x.sum(axis=-1, keepdims=True) + + feedable_locs = fetches['%s/locs' % fetch_prefix] + candidates = fetches['%s/candidates' % fetch_prefix] + results = fetches['%s/results' % fetch_prefix] + (logits, ) = zip(*results) + + # Computing probabilities + expand_results = {loc: [] for loc in locs} + for loc_ix, loc in enumerate(feedable_locs): + loc_cond_probs = softmax(logits[loc_ix][-1][:len(candidates[loc])]) + + # iterate over all candidate + for candidate_ix, probability in enumerate(loc_cond_probs): + token = candidates[loc][candidate_ix] + + # ignore PAD_ID + if token <= EOS_ID: + continue + + expand_results[loc] += [OrderProbTokenLogProbs(order=ix_to_order(token), + probability=probability, + log_probs=[np.log(np.maximum(probability, 1e-8))])] + + # Sorting loc by probability + expand_results[loc] = list(sorted(expand_results[loc], key=lambda item: item.probability, reverse=True)) + + # Returning + return expand_results + + @gen.coroutine + def get_state_value(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, **kwargs): + """ Computes the value of the current state for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, a float representing the value of the state of the game to the specified power + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_state_value' + + # Getting fetches + if not is_postfetching: + + if not self.has_value_model: + LOGGER.error('This model does not have a value function. Returning a value of 0.') + return {'%s/ret_val' % fetch_prefix: CompletedFuture(0.)} if is_prefetching else 0. + + # Finding orderable locations + locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + + # Building a list of empty possible orders + # The value function should at most only use the first step of the decoder (time step 0) + # So, we don't need to apply a mask + if possible_orders_proto is None: + possible_orders_proto = MapStringList().value # pylint: disable=no-member + for loc in locs: + possible_orders_proto[loc].value.extend([]) + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + LOGGER.warning('The method .get_feedable_item() did not return an item to feed to the model.') + LOGGER.warning('Make sure you have provided the correct locs and a list of possible orders') + LOGGER.warning('Returning a value of 0.') + return {'%s/ret_val' % fetch_prefix: CompletedFuture(0.)} if is_prefetching else 0. + + # Selecting queue + queue_name = 'policy_get_value' + fetches['%s/state_value' % fetch_prefix] = self.feedable_dataset.get_results(queue_name, + feedable_item, + **kwargs) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Processing fetches + if '%s/ret_val' % fetch_prefix in fetches: + return fetches['%s/ret_val' % fetch_prefix] + + # Returning the fetched state value + (state_value,) = fetches['%s/state_value' % fetch_prefix] + return state_value diff --git a/diplomacy_research/models/policy/order_based/dataset/__init__.py b/diplomacy_research/models/policy/order_based/dataset/__init__.py new file mode 100644 index 0000000..0a47f4e --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/__init__.py @@ -0,0 +1,18 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Order Based Builders """ +from .no_press_all import DatasetBuilder as NoPressAllDatasetBuilder +from .no_press_large import DatasetBuilder as NoPressLargeDatasetBuilder +from .no_press_value_all import DatasetBuilder as NoPressValueAllDatasetBuilder +from .no_press_value_large import DatasetBuilder as NoPressValueLargeDatasetBuilder diff --git a/diplomacy_research/models/policy/order_based/dataset/base.py b/diplomacy_research/models/policy/order_based/dataset/base.py new file mode 100644 index 0000000..c9b0676 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/base.py @@ -0,0 +1,372 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Order Based Base Dataset Builder + - Base class responsible for generating the protocol buffers to be used by the model +""" +import logging +import numpy as np +from diplomacy import Map +from diplomacy_research.models.datasets.base_builder import FixedProtoField, VarProtoField +from diplomacy_research.models.policy.base_policy_builder import BasePolicyBuilder +from diplomacy_research.models.self_play.reward_functions import DefaultRewardFunction, DEFAULT_GAMMA +from diplomacy_research.models.state_space import get_order_tokens, get_order_based_mask, \ + get_possible_orders_for_powers, get_issued_orders_for_powers, proto_to_board_state, GO_ID, NB_NODES, \ + NB_SUPPLY_CENTERS, POWER_VOCABULARY_KEY_TO_IX, order_to_ix, MAX_CANDIDATES, NB_FEATURES, NB_ORDERS_FEATURES, \ + NB_PREV_ORDERS, NB_PREV_ORDERS_HISTORY, get_board_alignments, get_orderable_locs_for_powers, get_current_season, \ + proto_to_prev_orders_state + +# Constants +LOGGER = logging.getLogger(__name__) + +class BaseDatasetBuilder(BasePolicyBuilder): + """ This object is responsible for maintaining the data and feeding it into the model """ + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this dataset builder """ + # Creating proto fields + proto_fields = { + 'request_id': FixedProtoField([], None), + 'player_seed': FixedProtoField([], np.int32), + 'board_state': FixedProtoField([NB_NODES, NB_FEATURES], np.uint8), + 'board_alignments': VarProtoField([NB_NODES * NB_SUPPLY_CENTERS], np.uint8), + 'prev_orders_state': FixedProtoField([NB_PREV_ORDERS, NB_NODES, NB_ORDERS_FEATURES], np.uint8), + 'decoder_inputs': VarProtoField([1 + NB_SUPPLY_CENTERS], np.int32), + 'decoder_lengths': FixedProtoField([], np.int32), + 'candidates': VarProtoField([None, MAX_CANDIDATES], np.int32), + 'noise': FixedProtoField([], np.float32), + 'temperature': FixedProtoField([], np.float32), + 'dropout_rate': FixedProtoField([], np.float32), + 'current_power': FixedProtoField([], np.int32), + 'current_season': FixedProtoField([], np.int32), + 'draw_target': FixedProtoField([], np.float32), + 'value_target': FixedProtoField([], np.float32) + } + return proto_fields + + @staticmethod + def get_feedable_item(locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Computes and return a feedable item (to be fed into the feedable queue) + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :return: A feedable item, with feature names as key and numpy arrays as values + """ + # pylint: disable=too-many-branches + # Converting to state space + map_object = Map(state_proto.map) + board_state = proto_to_board_state(state_proto, map_object) + + # Building the decoder length + # For adjustment phase, we restrict the number of builds/disbands to what is allowed by the game engine + in_adjustment_phase = state_proto.name[-1] == 'A' + nb_builds = state_proto.builds[power_name].count + nb_homes = len(state_proto.builds[power_name].homes) + + # If we are in adjustment phase, making sure the locs are the orderable locs (and not the policy locs) + if in_adjustment_phase: + orderable_locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + if sorted(locs) != sorted(orderable_locs): + if locs: + LOGGER.warning('Adj. phase requires orderable locs. Got %s. Expected %s.', locs, orderable_locs) + locs = orderable_locs + + # WxxxA - We can build units + # WxxxA - We can disband units + # Other phase + if in_adjustment_phase and nb_builds >= 0: + decoder_length = min(nb_builds, nb_homes) + elif in_adjustment_phase and nb_builds < 0: + decoder_length = abs(nb_builds) + else: + decoder_length = len(locs) + + # Computing the candidates for the policy + if possible_orders_proto: + + # Adjustment Phase - Use all possible orders for each location. + if in_adjustment_phase: + + # Building a list of all orders for all locations + adj_orders = [] + for loc in locs: + adj_orders += possible_orders_proto[loc].value + + # Computing the candidates + candidates = [get_order_based_mask(adj_orders)] * decoder_length + + # Regular phase - Compute candidates for each location + else: + candidates = [] + for loc in locs: + candidates += [get_order_based_mask(possible_orders_proto[loc].value)] + + # We don't have possible orders, so we cannot compute candidates + # This might be normal if we are only getting the state value or the next message to send + else: + candidates = [] + for _ in range(decoder_length): + candidates.append([]) + + # Prev orders state + prev_orders_state = [] + for phase_proto in reversed(phase_history_proto): + if len(prev_orders_state) == NB_PREV_ORDERS: + break + if phase_proto.name[-1] == 'M': + prev_orders_state = [proto_to_prev_orders_state(phase_proto, map_object)] + prev_orders_state + for _ in range(NB_PREV_ORDERS - len(prev_orders_state)): + prev_orders_state = [np.zeros((NB_NODES, NB_ORDERS_FEATURES), dtype=np.uint8)] + prev_orders_state + prev_orders_state = np.array(prev_orders_state) + + # Building (order) decoder inputs [GO_ID] + decoder_inputs = [GO_ID] + + # kwargs + player_seed = kwargs.get('player_seed', 0) + noise = kwargs.get('noise', 0.) + temperature = kwargs.get('temperature', 0.) + dropout_rate = kwargs.get('dropout_rate', 0.) + + # Building feedable data + item = { + 'player_seed': player_seed, + 'board_state': board_state, + 'board_alignments': get_board_alignments(locs, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=1, + decoder_length=decoder_length), + 'prev_orders_state': prev_orders_state, + 'decoder_inputs': decoder_inputs, + 'decoder_lengths': decoder_length, + 'candidates': candidates, + 'noise': noise, + 'temperature': temperature, + 'dropout_rate': dropout_rate, + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(state_proto) + } + + # Return + return item + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + raise NotImplementedError() + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def get_policy_data(saved_game_proto, power_names, top_victors): + """ Computes the proto to save in tf.train.Example as a training example for the policy network + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param power_names: The list of powers for which we want the policy data + :param top_victors: The list of powers that ended with more than 25% of the supply centers + :return: A dictionary with key: the phase_ix + with value: A dict with the power_name as key and a dict with the example fields as value + """ + nb_phases = len(saved_game_proto.phases) + policy_data = {phase_ix: {} for phase_ix in range(nb_phases - 1)} + game_id = saved_game_proto.id + map_object = Map(saved_game_proto.map) + + # Determining if we have a draw + nb_sc_to_win = len(map_object.scs) // 2 + 1 + has_solo_winner = max([len(saved_game_proto.phases[-1].state.centers[power_name].value) + for power_name in saved_game_proto.phases[-1].state.centers]) >= nb_sc_to_win + survivors = [power_name for power_name in saved_game_proto.phases[-1].state.centers + if saved_game_proto.phases[-1].state.centers[power_name].value] + has_draw = not has_solo_winner and len(survivors) >= 2 + + # Processing all phases (except the last one) + current_year = 0 + for phase_ix in range(nb_phases - 1): + + # Building a list of orders of previous phases + previous_orders_states = [np.zeros((NB_NODES, NB_ORDERS_FEATURES), dtype=np.uint8)] * NB_PREV_ORDERS + for phase_proto in saved_game_proto.phases[max(0, phase_ix - NB_PREV_ORDERS_HISTORY):phase_ix]: + if phase_proto.name[-1] == 'M': + previous_orders_states += [proto_to_prev_orders_state(phase_proto, map_object)] + previous_orders_states = previous_orders_states[-NB_PREV_ORDERS:] + prev_orders_state = np.array(previous_orders_states) + + # Parsing each requested power in the specified phase + phase_proto = saved_game_proto.phases[phase_ix] + phase_name = phase_proto.name + state_proto = phase_proto.state + phase_board_state = proto_to_board_state(state_proto, map_object) + + # Increasing year for every spring or when the game is completed + if phase_proto.name == 'COMPLETED' or (phase_proto.name[0] == 'S' and phase_proto.name[-1] == 'M'): + current_year += 1 + + for power_name in power_names: + phase_issued_orders = get_issued_orders_for_powers(phase_proto, [power_name]) + phase_possible_orders = get_possible_orders_for_powers(phase_proto, [power_name]) + phase_draw_target = 1. if has_draw and phase_ix == (nb_phases - 2) and power_name in survivors else 0. + + # Data to use when not learning a policy + blank_policy_data = {'board_state': phase_board_state, + 'prev_orders_state': prev_orders_state, + 'draw_target': phase_draw_target} + + # Power is not a top victor - We don't want to learn a policy from him + if power_name not in top_victors: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Finding the orderable locs + orderable_locations = list(phase_issued_orders[power_name].keys()) + + # Skipping power for this phase if we are only issuing Hold + for order_loc, order in phase_issued_orders[power_name].items(): + order_tokens = get_order_tokens(order) + if len(order_tokens) >= 2 and order_tokens[1] != 'H': + break + else: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Removing orderable locs where orders are not possible (i.e. NO_CHECK games) + for order_loc, order in phase_issued_orders[power_name].items(): + if order not in phase_possible_orders[order_loc] and order_loc in orderable_locations: + if 'NO_CHECK' not in saved_game_proto.rules: + LOGGER.warning('%s not in all possible orders. Phase %s - Game %s.', order, phase_name, game_id) + orderable_locations.remove(order_loc) + + # Remove orderable locs where the order is either invalid or not frequent + if order_to_ix(order) is None and order_loc in orderable_locations: + orderable_locations.remove(order_loc) + + # Determining if we are in an adjustment phase + in_adjustment_phase = state_proto.name[-1] == 'A' + nb_builds = state_proto.builds[power_name].count + nb_homes = len(state_proto.builds[power_name].homes) + + # WxxxA - We can build units + # WxxxA - We can disband units + # Other phase + if in_adjustment_phase and nb_builds >= 0: + decoder_length = min(nb_builds, nb_homes) + elif in_adjustment_phase and nb_builds < 0: + decoder_length = abs(nb_builds) + else: + decoder_length = len(orderable_locations) + + # Not all units were disbanded - Skipping this power as we can't learn the orders properly + if in_adjustment_phase and nb_builds < 0 and len(orderable_locations) < abs(nb_builds): + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Not enough orderable locations for this power, skipping + if not orderable_locations or not decoder_length: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # decoder_inputs [GO, order1, order2, order3] + decoder_inputs = [GO_ID] + decoder_inputs += [order_to_ix(phase_issued_orders[power_name][loc]) for loc in orderable_locations] + if in_adjustment_phase and nb_builds > 0: + decoder_inputs += [order_to_ix('WAIVE')] * (min(nb_builds, nb_homes) - len(orderable_locations)) + decoder_length = min(decoder_length, NB_SUPPLY_CENTERS) + + # Adjustment Phase - Use all possible orders for each location. + if in_adjustment_phase: + build_disband_locs = list(get_possible_orders_for_powers(phase_proto, [power_name]).keys()) + phase_board_alignments = get_board_alignments(build_disband_locs, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=1, + decoder_length=decoder_length) + + # Building a list of all orders for all locations + adj_orders = [] + for loc in build_disband_locs: + adj_orders += phase_possible_orders[loc] + + # Not learning builds for BUILD_ANY + if nb_builds > 0 and 'BUILD_ANY' in state_proto.rules: + adj_orders = [] + + # No orders found - Skipping + if not adj_orders: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Computing the candidates + candidates = [get_order_based_mask(adj_orders)] * decoder_length + + # Regular phase - Compute candidates for each location + else: + phase_board_alignments = get_board_alignments(orderable_locations, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=1, + decoder_length=decoder_length) + candidates = [] + for loc in orderable_locations: + candidates += [get_order_based_mask(phase_possible_orders[loc])] + + # Saving results + # No need to return temperature, current_power, current_season + policy_data[phase_ix][power_name] = {'board_state': phase_board_state, + 'board_alignments': phase_board_alignments, + 'prev_orders_state': prev_orders_state, + 'decoder_inputs': decoder_inputs, + 'decoder_lengths': decoder_length, + 'candidates': candidates, + 'draw_target': phase_draw_target} + # Returning + return policy_data + +def get_value_data(saved_game_proto, power_names): + """ Computes the proto to save in tf.train.Example as a training example for the value network + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param power_names: The list of powers for which we want the policy data + :return: A dictionary with key: the phase_ix + with value: A dict with the power_name as key and a dict with the example fields as value + """ + nb_phases = len(saved_game_proto.phases) + value_data = {phase_ix: {} for phase_ix in range(nb_phases - 1)} + + # Computing the value of each phase + for power_name in power_names: + value_targets = [] + current_value = 0. + rewards = DefaultRewardFunction().get_episode_rewards(saved_game_proto, power_name) + for reward in reversed(rewards): + current_value = reward + DEFAULT_GAMMA * current_value + value_targets += [current_value] + value_targets += [0] + + # Computing the value data + for phase_ix in range(nb_phases - 1): + value_data[phase_ix][power_name] = {'value_target': value_targets[phase_ix]} + + # Returning the value of the specified phase for each power + return value_data diff --git a/diplomacy_research/models/policy/order_based/dataset/no_press_all.py b/diplomacy_research/models/policy/order_based/dataset/no_press_all.py new file mode 100644 index 0000000..49c492f --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/no_press_all.py @@ -0,0 +1,121 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Order Based NoPress Builder (All) dataset + - Class responsible for generating the protocol buffers for NoPress (All) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.order_based.dataset.base import BaseDatasetBuilder, get_policy_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, \ + POWER_VOCABULARY_KEY_TO_IX, get_map_powers +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-order_based-no_press_all" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + all_powers = get_map_powers(map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy data for the phase_ix + # (All powers for training - Top victors for evaluation) + policy_data = get_policy_data(saved_game_proto, + power_names=all_powers, + top_victors=top_victors if is_validation_set else all_powers) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in all_powers: + if is_validation_set and power_name not in top_victors: + continue + phase_policy = policy_data[phase_ix][power_name] + + if 'decoder_inputs' not in phase_policy: + continue + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/order_based/dataset/no_press_large.py b/diplomacy_research/models/policy/order_based/dataset/no_press_large.py new file mode 100644 index 0000000..f5d5f63 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/no_press_large.py @@ -0,0 +1,114 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Order Based NoPress Builder (Large) dataset + - Class responsible for generating the protocol buffers for NoPress (Large) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.order_based.dataset.base import BaseDatasetBuilder, get_policy_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, POWER_VOCABULARY_KEY_TO_IX +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-order_based-no_press_large" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy data for the phase_ix + policy_data = get_policy_data(saved_game_proto, power_names=top_victors, top_victors=top_victors) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in top_victors: + phase_policy = policy_data[phase_ix][power_name] + + if 'decoder_inputs' not in phase_policy: + continue + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/order_based/dataset/no_press_value_all.py b/diplomacy_research/models/policy/order_based/dataset/no_press_value_all.py new file mode 100644 index 0000000..e3c9f3f --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/no_press_value_all.py @@ -0,0 +1,122 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Order Based NoPressValue (All) Builder + - Class responsible for generating the protocol buffers for NoPressValue (All) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.order_based.dataset.base import BaseDatasetBuilder, get_policy_data, \ + get_value_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, \ + POWER_VOCABULARY_KEY_TO_IX, get_map_powers +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-order_based-no_press_value_all" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + all_powers = get_map_powers(map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy data for the phase_ix + # (All powers for training - Top victors for evaluation) + policy_data = get_policy_data(saved_game_proto, + power_names=all_powers, + top_victors=top_victors if is_validation_set else all_powers) + value_data = get_value_data(saved_game_proto, all_powers) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in all_powers: + if is_validation_set and power_name not in top_victors: + continue + phase_policy = policy_data[phase_ix][power_name] + phase_value = value_data[phase_ix][power_name] + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + data.update(phase_value) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/order_based/dataset/no_press_value_large.py b/diplomacy_research/models/policy/order_based/dataset/no_press_value_large.py new file mode 100644 index 0000000..9cca284 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/no_press_value_large.py @@ -0,0 +1,117 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Order Based NoPressValue (Large) Builder + - Class responsible for generating the protocol buffers for NoPressValue (Large) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.order_based.dataset.base import BaseDatasetBuilder, get_policy_data, \ + get_value_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, \ + POWER_VOCABULARY_KEY_TO_IX, get_map_powers +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-order_based-no_press_value_large" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + all_powers = get_map_powers(map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy and value data for the phase_ix + policy_data = get_policy_data(saved_game_proto, all_powers, top_victors) + value_data = get_value_data(saved_game_proto, all_powers) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in all_powers: + phase_policy = policy_data[phase_ix][power_name] + phase_value = value_data[phase_ix][power_name] + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + data.update(phase_value) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/order_based/dataset/tests/__init__.py b/diplomacy_research/models/policy/order_based/dataset/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_all_builder.py b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_all_builder.py new file mode 100644 index 0000000..db14489 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_all_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPress (All) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.order_based.dataset.no_press_all import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_large_builder.py b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_large_builder.py new file mode 100644 index 0000000..68285b9 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_large_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPress (Large) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.order_based.dataset.no_press_large import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_value_all_builder.py b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_value_all_builder.py new file mode 100644 index 0000000..6339250 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_value_all_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPressValue (All) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.order_based.dataset.no_press_value_all import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_value_large_builder.py b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_value_large_builder.py new file mode 100644 index 0000000..64953b6 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/dataset/tests/test_no_press_value_large_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPressValue (Large) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.order_based.dataset.no_press_value_large import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/order_based/helper.py b/diplomacy_research/models/policy/order_based/helper.py new file mode 100644 index 0000000..bda65e0 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/helper.py @@ -0,0 +1,420 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Custom Helpers + - Contains custom decoder helper functions for the policy model (Order Based) +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.models.layers.decoder import CandidateInputs, LARGE_NEGATIVE +from diplomacy_research.models.layers.beam_decoder import BeamHelper +from diplomacy_research.models.policy.base_policy_model import TRAINING_DECODER, GREEDY_DECODER, SAMPLE_DECODER +from diplomacy_research.models.state_space import GO_ID +from diplomacy_research.utils.tensorflow import Helper +from diplomacy_research.utils.tensorflow import _transpose_batch_time +from diplomacy_research.utils.tensorflow import _unstack_ta +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import gen_array_ops +from diplomacy_research.utils.tensorflow import beam_search_decoder +from diplomacy_research.utils.tensorflow import control_flow_ops +from diplomacy_research.utils.tensorflow import embedding_lookup +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import gen_math_ops +from diplomacy_research.utils.tensorflow import categorical +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import rnn_cell_impl + + +def _get_embedding_fn(embedding): + """ Returns a callable embedding function """ + return embedding if callable(embedding) else (lambda ids: embedding_lookup(embedding, ids)) + +class CustomHelper(Helper): + """ A custom helper that work with teacher forcing, greedy, and sampling. + Takes inputs then applies a linear layer. + Returns -1s for sample_ids where no sampling took place; valid sample id values elsewhere. + """ + def __init__(self, decoder_type, inputs, order_embedding, candidate_embedding, sequence_length, candidates, + input_layer=None, time_major=False, softmax_temperature=None, seed=None, name=None): + """ Constructor + :param decoder_type: An uint8 representing TRAINING_DECODER, GREEDY_DECODER, or SAMPLE_DECODER + :param inputs: The decoder input (b, dec_len) + :param order_embedding: The order embedding vector + :param candidate_embedding: The candidate embedding vector + :param sequence_length: The length of each input (b,) + :param candidates: The candidates at each time step -- Size: (b, nb_cand, max_candidates) + :param input_layer: Optional. A layer to apply on the inputs + :param time_major: If true indicates that the first dimension is time, otherwise it is batch size + :param softmax_temperature: Optional. Softmax temperature. None, scalar, or size: (batch_size,) + :param seed: Optional. The sampling seed + :param name: Optional scope name. + """ + # pylint: disable=too-many-arguments + with ops.name_scope(name, "CustomHelper", [inputs, sequence_length, order_embedding, candidate_embedding]): + inputs = ops.convert_to_tensor(inputs, name="inputs") + candidates = ops.convert_to_tensor(candidates, name="candidates") + self._inputs = inputs + self._order_embedding_fn = _get_embedding_fn(order_embedding) + self._candidate_embedding_fn = _get_embedding_fn(candidate_embedding) + if not time_major: + inputs = nest.map_structure(_transpose_batch_time, inputs) + candidates = nest.map_structure(_transpose_batch_time, candidates) + self._input_tas = nest.map_structure(_unstack_ta, inputs) + self._candidate_tas = nest.map_structure(_unstack_ta, candidates) + self._decoder_type = decoder_type + self._sequence_length = ops.convert_to_tensor(sequence_length, name="sequence_length") + if self._sequence_length.get_shape().ndims != 1: + raise ValueError("Expected vector for sequence_length. Shape: %s" % self._sequence_length.get_shape()) + self._input_layer = input_layer if input_layer is not None else lambda x: x + self._batch_size = array_ops.size(sequence_length) + self._start_inputs = gen_array_ops.fill([self._batch_size], GO_ID) + self._softmax_temperature = softmax_temperature + self._seed = seed + + # Compute input shape + self._zero_inputs = \ + CandidateInputs(inputs= + array_ops.zeros_like(self._input_layer(self._order_embedding_fn(self._start_inputs))), + candidates=array_ops.zeros_like(candidates[0, :]), + candidates_emb=array_ops.zeros_like(self._candidate_embedding_fn(candidates[0, :]))) + + # Preventing div by zero + # Adding an extra dim to the matrix, so we can broadcast with the outputs shape + if softmax_temperature is not None: + self._softmax_temperature = gen_math_ops.maximum(1e-10, self._softmax_temperature) + if self._softmax_temperature.get_shape().ndims == 1: + self._softmax_temperature = self._softmax_temperature[:, None] + + @property + def batch_size(self): + """ Returns the batch size """ + return self._batch_size + + @property + def sample_ids_shape(self): + """ Returns the shape of the sample ids """ + return tensor_shape.TensorShape([]) + + @property + def sample_ids_dtype(self): + """ Returns the dtype of the sample ids """ + return dtypes.int32 + + def sample(self, time, outputs, state, name=None): + """ Samples the id for the next time step (or -1 for teacher forcing) + Note: outputs is a tuple of (cell_outputs, candidate) + """ + cell_outputs, candidate = outputs + + with ops.name_scope(name, 'CustomHelperSample', [time, outputs, state]): + + def training(): + """ Selecting training / teacher forcing """ + fill_op = gen_array_ops.fill([array_ops.shape(cell_outputs)[0]], -1) + with ops.control_dependencies([fill_op]): + return array_ops.identity(fill_op) + + def greedy(): + """ Selecting greedy """ + argmax_id = math_ops.cast(math_ops.argmax(cell_outputs, axis=-1), dtypes.int32) + nb_candidate = array_ops.shape(candidate)[1] + candidate_ids = \ + math_ops.reduce_sum(array_ops.one_hot(argmax_id, nb_candidate, dtype=dtypes.int32) * candidate, + axis=-1) + with ops.control_dependencies([candidate_ids]): + return array_ops.identity(candidate_ids) + + def sample(): + """ Sampling """ + logits = cell_outputs if self._softmax_temperature is None else cell_outputs / self._softmax_temperature + sample_id_sampler = categorical.Categorical(logits=logits) + sample_ids = sample_id_sampler.sample(seed=self._seed) + nb_candidate = array_ops.shape(candidate)[1] + reduce_op = math_ops.reduce_sum(array_ops.one_hot(sample_ids, + nb_candidate, + dtype=dtypes.int32) * candidate, axis=-1) + with ops.control_dependencies([reduce_op]): + return array_ops.identity(reduce_op) + + return control_flow_ops.case([(gen_math_ops.equal(self._decoder_type, TRAINING_DECODER), training), + (gen_math_ops.equal(self._decoder_type, GREEDY_DECODER), greedy), + (gen_math_ops.equal(self._decoder_type, SAMPLE_DECODER), sample)], + default=training) + + def initialize(self, name=None): + """ Performs helper initialization (to get initial state) """ + with ops.name_scope(name, 'CustomHelperInitialize'): + finished = gen_math_ops.equal(0, self._sequence_length) + all_finished = math_ops.reduce_all(finished) + initial_candidates = self._candidate_tas.read(0) + + def training_inputs(): + """ Returns the training initial input """ + embed_op = self._order_embedding_fn(self._input_tas.read(0)) + with ops.control_dependencies([embed_op]): + return array_ops.identity(embed_op) + + def start_inputs(): + """ Returns the GO_ID initial input """ + embed_op = self._order_embedding_fn(self._start_inputs) + with ops.control_dependencies([embed_op]): + return array_ops.identity(embed_op) + + # Getting initial inputs + initial_inputs = control_flow_ops.case( + [(gen_math_ops.equal(self._decoder_type, TRAINING_DECODER), training_inputs), + (gen_math_ops.equal(self._decoder_type, GREEDY_DECODER), start_inputs), + (gen_math_ops.equal(self._decoder_type, SAMPLE_DECODER), start_inputs)], + default=training_inputs) + + next_inputs = \ + control_flow_ops.cond(all_finished, + lambda: self._zero_inputs, + lambda: CandidateInputs( + inputs=self._input_layer(initial_inputs), + candidates=initial_candidates, + candidates_emb=self._candidate_embedding_fn(initial_candidates))) + return (finished, next_inputs) + + def next_inputs(self, time, outputs, state, sample_ids, name=None): + """ Computes the next inputs at a time step """ + with ops.name_scope(name, 'CustomHelperNextInputs', [time, outputs, state, sample_ids]): + next_time = time + 1 + finished = (next_time >= self._sequence_length) + all_finished = math_ops.reduce_all(finished) + + def get_next_inputs(): + """ Retrieves the inputs for the next time step """ + def get_training_inputs(): + """ Selecting training inputs """ + read_op = self._input_tas.read(next_time) + with ops.control_dependencies([read_op]): + return array_ops.identity(read_op) + + def get_sample_inputs(): + """ Selecting greedy/sample inputs """ + return sample_ids + + inputs_next_step = control_flow_ops.case( + [(gen_math_ops.equal(self._decoder_type, TRAINING_DECODER), get_training_inputs), + (gen_math_ops.equal(self._decoder_type, GREEDY_DECODER), get_sample_inputs), + (gen_math_ops.equal(self._decoder_type, SAMPLE_DECODER), get_sample_inputs)], + default=get_training_inputs) + inputs_emb_next_step = self._input_layer(self._order_embedding_fn(inputs_next_step)) + candidate_next_step = self._candidate_tas.read(next_time) + candidate_emb_next_step = self._candidate_embedding_fn(candidate_next_step) + + # Prevents this branch from executing eagerly + with ops.control_dependencies([inputs_emb_next_step, candidate_next_step, candidate_emb_next_step]): + return CandidateInputs(inputs=array_ops.identity(inputs_emb_next_step), + candidates=array_ops.identity(candidate_next_step), + candidates_emb=array_ops.identity(candidate_emb_next_step)) + + next_inputs = control_flow_ops.cond(all_finished, + true_fn=lambda: self._zero_inputs, + false_fn=get_next_inputs) + + # Returning + return (finished, next_inputs, state) + + +class CustomBeamHelper(BeamHelper): + """ A helper to feed data in a custom beam search decoder """ + + def __init__(self, cell, order_embedding, candidate_embedding, candidates, sequence_length, initial_state, + beam_width, input_layer=None, output_layer=None, time_major=False): + """ Initialize the CustomBeamHelper + :param cell: An `RNNCell` instance. + :param order_embedding: The order embedding vector - Size: (batch, ord_emb_size) + :param candidate_embedding: The candidate embedding vector - Size: (batch, cand_emb_size) + :param candidates: The candidates at each time step -- Size: (batch, nb_cand, max_candidates) + :param sequence_length: The length of each sequence (batch,) + :param initial_state: A (possibly nested tuple of...) tensors and TensorArrays. + :param beam_width: Python integer, the number of beams. + :param input_layer: Optional. A layer to apply on the inputs + :param output_layer: Optional. An instance of `tf.layers.Layer`, i.e., `tf.layers.Dense`. Optional layer + to apply to the RNN output prior to storing the result or sampling. + :param time_major: If true indicates that the first dimension is time, otherwise it is batch size. + """ + # pylint: disable=super-init-not-called,too-many-arguments + rnn_cell_impl.assert_like_rnncell('cell', cell) # pylint: disable=protected-access + assert isinstance(beam_width, int), 'beam_width should be a Python integer' + + self._sequence_length = ops.convert_to_tensor(sequence_length, name='sequence_length') + if self._sequence_length.get_shape().ndims != 1: + raise ValueError("Expected vector for sequence_length. Shape: %s" % self._sequence_length.get_shape()) + + candidates = ops.convert_to_tensor(candidates, name='candidates') + candidates = nest.map_structure(_transpose_batch_time, candidates) if not time_major else candidates + + self._cell = cell + self._order_embedding_fn = _get_embedding_fn(order_embedding) + self._candidate_embedding_fn = _get_embedding_fn(candidate_embedding) + self._candidate_tas = nest.map_structure(_unstack_ta, candidates) + self._input_layer = input_layer if input_layer is not None else lambda x: x + self._output_layer = output_layer + + self._input_size = order_embedding.shape[-1] + if input_layer is not None: + self._input_size = self._input_layer.compute_output_shape([None, self._input_size])[-1] + + self._batch_size = array_ops.size(sequence_length) + self._start_tokens = gen_array_ops.fill([self._batch_size * beam_width], GO_ID) + self._end_token = -1 + self._beam_width = beam_width + self._initial_cell_state = nest.map_structure(self._maybe_split_batch_beams, + initial_state, + self._cell.state_size) + self._finished = array_ops.one_hot(array_ops.zeros([self._batch_size], dtype=dtypes.int32), + depth=self._beam_width, + on_value=False, + off_value=True, + dtype=dtypes.bool) + + # Compute input shape + self._zero_inputs = \ + CandidateInputs(inputs= + array_ops.zeros_like(self._split_batch_beams( + self._input_layer(self._order_embedding_fn(self._start_tokens)), + self._input_size)), + candidates=array_ops.zeros_like(candidates[0, :]), + candidates_emb=array_ops.zeros_like(self._candidate_embedding_fn(candidates[0, :]))) + + @property + def beam_width(self): + """ Returns the beam width """ + return self._beam_width + + @property + def batch_size(self): + """ Returns the batch size """ + return self._batch_size + + @property + def output_size(self): + """ Returns the size of the RNN output """ + size = self._cell.output_size + if self._output_layer is None: + return size + + # To use layer's compute_output_shape, we need to convert the RNNCell's output_size entries into shapes + # with an unknown batch size. We then pass this through the layer's compute_output_shape and read off + # all but the first (batch) dimensions to get the output size of the rnn with the layer applied to the top. + output_shape_with_unknown_batch = \ + nest.map_structure(lambda shape: tensor_shape.TensorShape([None]).concatenate(shape), size) + layer_output_shape = self._output_layer.compute_output_shape(output_shape_with_unknown_batch) + return nest.map_structure(lambda shape: shape[1:], layer_output_shape) + + def initialize(self): + """ Initialize the beam helper - Called in beam_decoder.initialize() + :return: `(finished, start_inputs, initial_cell_state)`. + """ + finished, zero_inputs = self._finished, self._zero_inputs + all_finished = math_ops.reduce_all(gen_math_ops.equal(0, self._sequence_length)) + initial_inputs = self._order_embedding_fn(self._start_tokens) + initial_candidates = self._candidate_tas.read(0) + + # Start Inputs + start_inputs = control_flow_ops.cond(all_finished, + lambda: zero_inputs, + lambda: CandidateInputs( + inputs=self._split_batch_beams(self._input_layer(initial_inputs), + self._input_size), + candidates=initial_candidates, + candidates_emb=self._candidate_embedding_fn(initial_candidates))) + + return finished, start_inputs, self._initial_cell_state + + def step(self, time, inputs, cell_state): + """ Performs a step using the beam search cell + :param time: The current time step (scalar) + :param inputs: A (structure of) input tensors. + :param state: A (structure of) state tensors and TensorArrays. + :return: `(cell_outputs, next_cell_state)`. + """ + raw_inputs = inputs + inputs, candidates, candidates_emb = raw_inputs.inputs, raw_inputs.candidates, raw_inputs.candidates_emb + + inputs = nest.map_structure(lambda inp: self._merge_batch_beams(inp, depth_shape=inp.shape[2:]), inputs) + cell_state = nest.map_structure(self._maybe_merge_batch_beams, cell_state, self._cell.state_size) + cell_outputs, next_cell_state = self._cell(inputs, cell_state) # [batch * beam, out_sz] + next_cell_state = nest.map_structure(self._maybe_split_batch_beams, next_cell_state, self._cell.state_size) + + # Splitting outputs and adding a bias dimension + # cell_outputs is [batch, beam, cand_emb_size + 1] + cell_outputs = self._output_layer(cell_outputs) if self._output_layer is not None else cell_outputs + cell_outputs = nest.map_structure(lambda out: self._split_batch_beams(out, out.shape[1:]), cell_outputs) + cell_outputs = array_ops.pad(cell_outputs, [(0, 0), (0, 0), (0, 1)], constant_values=1.) + + # Computing candidates + # cell_outputs is reshaped to [batch, beam, 1, cand_emb_size + 1] + # candidates_emb is reshaped to [batch, 1, max_cand, cand_emb_size + 1] + # output_mask is [batch, 1, max_cand] + # cell_outputs is finally [batch, beam, max_cand] + cell_outputs = math_ops.reduce_sum(array_ops.expand_dims(cell_outputs, axis=2) + * array_ops.expand_dims(candidates_emb, axis=1), axis=-1) + output_mask = math_ops.cast(array_ops.expand_dims(gen_math_ops.greater(candidates, 0), axis=1), dtypes.float32) + cell_outputs = gen_math_ops.add(cell_outputs, (1. - output_mask) * LARGE_NEGATIVE) + + # Returning + return cell_outputs, next_cell_state + + def next_inputs(self, time, inputs, beam_search_output, beam_search_state): + """ Computes the inputs at the next time step given the beam outputs + :param time: The current time step (scalar) + :param inputs: A (structure of) input tensors. + :param beam_search_output: The output of the beam search step + :param beam_search_state: The state after the beam search step + :return: `(beam_search_output, next_inputs)` + :type beam_search_output: beam_search_decoder.BeamSearchDecoderOutput + :type beam_search_state: beam_search_decoder.BeamSearchDecoderState + """ + next_time = time + 1 + all_finished = math_ops.reduce_all(next_time >= self._sequence_length) + + # Sampling + next_word_ids = beam_search_output.predicted_ids + candidates = inputs.candidates + nb_candidates = array_ops.shape(candidates)[1] + sample_ids = math_ops.reduce_sum(array_ops.one_hot(next_word_ids, nb_candidates, dtype=dtypes.int32) + * array_ops.expand_dims(candidates, axis=1), axis=-1) + + def get_next_inputs(): + """ Retrieves the inputs for the next time step """ + inputs_next_step = sample_ids + inputs_emb_next_step = self._input_layer(self._order_embedding_fn(inputs_next_step)) + candidate_next_step = self._candidate_tas.read(next_time) + candidate_emb_next_step = self._candidate_embedding_fn(candidate_next_step) + + # Prevents this branch from executing eagerly + with ops.control_dependencies([inputs_emb_next_step, candidate_next_step, candidate_emb_next_step]): + return CandidateInputs(inputs=array_ops.identity(inputs_emb_next_step), + candidates=array_ops.identity(candidate_next_step), + candidates_emb=array_ops.identity(candidate_emb_next_step)) + + # Getting next inputs + next_inputs = control_flow_ops.cond(all_finished, + true_fn=lambda: self._zero_inputs, + false_fn=get_next_inputs) + + # Rewriting beam search output with the correct sample ids + beam_search_output = beam_search_decoder.BeamSearchDecoderOutput(scores=beam_search_output.scores, + predicted_ids=sample_ids, + parent_ids=beam_search_output.parent_ids) + + # Returning + return beam_search_output, next_inputs diff --git a/diplomacy_research/models/policy/order_based/model.py b/diplomacy_research/models/policy/order_based/model.py new file mode 100644 index 0000000..a60d1ea --- /dev/null +++ b/diplomacy_research/models/policy/order_based/model.py @@ -0,0 +1,577 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (Order Based) + - Contains the parent policy model, to evaluate the best actions given a state +""" +from collections import OrderedDict +import logging +import math +from diplomacy_research.models.policy.base_policy_model import GREEDY_DECODER, TRAINING_DECODER, StatsKey, \ + OrderProbTokenLogProbs, BasePolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import ix_to_order, get_order_tokens, EOS_ID, EOS_TOKEN, PAD_TOKEN, \ + POWER_VOCABULARY_IX_TO_KEY, POWER_VOCABULARY_LIST, NB_SUPPLY_CENTERS, STANDARD_TOPO_LOCS, TOKENS_PER_ORDER + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + +class OrderBasedPolicyModel(BasePolicyModel): + """ Policy Model """ + + def __init__(self, dataset, hparams): + """ Initialization + :param dataset: The dataset that is used to iterate over the data. + :param hparams: A dictionary of hyper parameters with their values + :type dataset: diplomacy_research.models.datasets.supervised_dataset.SupervisedDataset + :type dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + """ + from diplomacy_research.utils.tensorflow import tf + hps = lambda hparam_name: self.hparams[hparam_name] + BasePolicyModel.__init__(self, dataset, hparams) + + # Learning rate + if not hasattr(self, 'learning_rate') or self.learning_rate is None: + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + self.learning_rate = tf.Variable(float(hps('learning_rate')), trainable=False, dtype=tf.float32) + + # Optimizer + if not hasattr(self, 'optimizer') or self.optimizer is None: + self.optimizer = self.make_optimizer(self.learning_rate) + + # Build ops + self.build_policy() + + # Decay ops + if not hasattr(self, 'decay_learning_rate') or self.decay_learning_rate is None: + self.decay_learning_rate = self.learning_rate.assign(self.placeholders['learning_rate']) + + @property + def _nb_evaluation_loops(self): + """ Contains the number of different evaluation tags we want to compute + This also represent the number of loops we should do over the validation set + Some model wants to calculate different statistics and require multiple pass to do that + + A value of 1 indicates to only run in the main validation loop + A value > 1 indicates to run additional loops only for this model. + """ + return 2 + + @property + def _evaluation_tags(self): + """ List of evaluation tags (1 list of evaluation tag for each evaluation loop) + e.g. [['Acc_1', 'Acc_5', 'Acc_Tokens'], ['Gr_1', 'Gr_5', 'Gr_Tokens']] + """ + return [['[TF]X-Ent', '[TF]Perplexity', '[TF]Acc_1', '[TF]Acc_1_NoHold', '[TF]Acc_Tokens', '[TF]Acc_Player'], + ['[Gr]Acc_1', '[Gr]Acc_1_NoHold', '[Gr]Acc_Tokens', '[Gr]Acc_Player']] + + @property + def _early_stopping_tags(self): + """ List of tags to use to detect early stopping + The tags are a tuple of 1) 'min' or 'max' and 2) the tag's name + e.g. [('max', '[Gr]Acc_1'), ('min', '[TF]Perplexity')] + """ + return [('min', '[TF]Perplexity'), ('max', '[Gr]Acc_1')] + + @property + def _placeholders(self): + """ Return a dictionary of all placeholders needed by the model """ + from diplomacy_research.utils.tensorflow import tf, get_placeholder, get_placeholder_with_default + + # Note: 'decoder_type' needs to have a batch_dim to be compatible with TF Serving + # but will be reduced to a scalar with tf.reduce_max + return { + 'decoder_type': get_placeholder('decoder_type', shape=[None], dtype=tf.uint8), + 'learning_rate': get_placeholder_with_default('learning_rate', 1e-4, shape=(), dtype=tf.float32), + 'dropout_rate': get_placeholder_with_default('dropout_rate', 0., shape=(), dtype=tf.float32), + 'is_training': get_placeholder_with_default('is_training', False, shape=(), dtype=tf.bool), + 'stop_gradient_all': get_placeholder_with_default('stop_gradient_all', False, shape=(), dtype=tf.bool) + } + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + raise NotImplementedError() + + @staticmethod + def _get_optimizer(learning_rate): + """ Returns the optimizer to use for this model """ + from diplomacy_research.utils.tensorflow import tf + LOGGER.info('Using tf.contrib.opt.LazyAdamOptimizer as the optimizer.') + return tf.contrib.opt.LazyAdamOptimizer(learning_rate=learning_rate) + + def _get_session_args(self, decode=False, eval_loop_ix=None): + """ Returns a dict of kwargs to feed to session.run + Expected format: {fetches, feed_dict=None} + """ + hps = lambda hparam_name: self.hparams[hparam_name] + + # Detecting if we are doing validation + in_validation, our_validation = False, False + if eval_loop_ix is not None: + in_validation = True + our_validation = eval_loop_ix in self.my_eval_loop_ixs + + # --------- Fetches --------------- + train_fetches = {'optimizer_op': self.outputs['optimizer_op'], + 'policy_loss': self.outputs['policy_loss']} + + eval_fetches = {'policy_loss': self.outputs['policy_loss'], + 'argmax_tokens': self.outputs['argmax_tokens'], + 'log_probs': self.outputs['log_probs'], + 'targets': self.outputs['targets'], + 'current_power': self.features['current_power'], + 'current_season': self.features['current_season'], + 'in_retreat_phase': self.outputs['in_retreat_phase'], + 'request_id': self.features['request_id']} + + # --------- Feed dict -------------- + # Building feed dict + feed_dict = {self.placeholders['decoder_type']: [TRAINING_DECODER], # Batch size of 1 + self.placeholders['is_training']: True, + self.placeholders['stop_gradient_all']: False} + + # Dropout disabled during debug (batch), validation, or decoding (stats) + if self.hparams['debug_batch'] or in_validation or decode: + feed_dict.update({self.placeholders['dropout_rate']: 0.}) + else: + feed_dict.update({self.placeholders['dropout_rate']: hps('dropout_rate')}) + + # --------- Validation Loop -------------- + # Validation Loop - Running one of our validation loops + if our_validation: + decoder_type = {0: TRAINING_DECODER, 1: GREEDY_DECODER}[self.my_eval_loop_ixs.index(eval_loop_ix)] + feed_dict[self.placeholders['decoder_type']] = [decoder_type] # Batch size of 1 + feed_dict[self.placeholders['is_training']] = False + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Validation Loop - Running someone else validation loop + if in_validation: + return {'feed_dict': feed_dict} + + # --------- Training Loop -------------- + # Training Loop - We want to decode the specific batch to display stats + if decode: + decoder_type = TRAINING_DECODER + feed_dict[self.placeholders['decoder_type']] = [decoder_type] # Batch size of 1 + feed_dict[self.placeholders['is_training']] = False + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Training Loop - Training the model + return {'fetches': train_fetches, 'feed_dict': feed_dict} + + @staticmethod + def _decode(**fetches): + """ Performs decoding on the output (order_based model) + :param fetches: A dictionary of fetches from the model. + + Keys can include: + + - selected_tokens / argmax_tokens: [Required] The tokens from the model (Tensor [batch, decoder_length]) + - log_probs: [Required] The log probs from the model (Tensor [batch, decoder_length]) + - policy_loss: The policy loss for the batch. + - targets: The targets from the model (Tensor [batch, length]). Required for evaluation. + - current_power: The current_power from the model (Tensor [batch,]). Required for evaluation. + - current_season: The current_season from the model (Tensor [batch,]). Required for evaluation. + - in_retreat_phase: Boolean that indicates dislodged units are on the map. ([b,]). Required for evaluation. + - request_id: The unique request id for each item in the batch. + + :return: A dictionary of decoded results, including + - 1) decoded_orders: + A list of dictionary (one per batch) where each dict has location as key and a + OrderProbTokenLogProbs tuple as value (i.e. an order, its prob, and the token log probs) + e.g. [{'PAR': (order, prob, log_probs),'MAR': (order, prob, log_probs)}, + {'PAR': (order, prob, log_probs),'MAR': (order, prob, log_probs)}] + - 2) various other keys for evaluation + """ + # Missing the required fetches, returning an empty decoded results + if ('selected_tokens' not in fetches and 'argmax_tokens' not in fetches) or 'log_probs' not in fetches: + return {} + + # tokens: [batch, dec_len] + # log_probs: [batch, dec_len] + # policy_loss: () + # targets: [batch, dec_len] + # current_power: [batch] + # current_season: [batch] + # in_retreat_phase: [batch] + # request_ids: [batch] + tokens = fetches.get('selected_tokens', fetches.get('argmax_tokens')) + log_probs = fetches['log_probs'] + policy_loss = fetches.get('policy_loss', None) + targets = fetches.get('targets', None) + current_power = fetches.get('current_power', None) + current_season = fetches.get('current_season', None) + in_retreat_phase = fetches.get('in_retreat_phase', None) + request_ids = fetches.get('request_id', None) + + # Decoding orders + results = [] + result_tokens = [] + nb_batches = tokens.shape[0] + + for batch_ix in range(nb_batches): + batch_results = OrderedDict() + batch_results_tokens = OrderedDict() + batch_tokens = tokens[batch_ix] + batch_log_probs = log_probs[batch_ix] + nb_waive = 0 + + # We didn't try to predict orders - Skipping + if not len(batch_tokens) or batch_tokens[0] == [0]: # pylint: disable=len-as-condition + results += [batch_results] + result_tokens += [batch_results_tokens] + continue + + for token_ix, token in enumerate(batch_tokens): + if token <= EOS_ID: + continue + + order = ix_to_order(token) + + # WAIVE orders + if order == 'WAIVE': + loc = 'WAIVE_{}'.format(nb_waive) + nb_waive += 1 + + # Use normal location and skip if already stored + else: + loc = order.split()[1] + if loc in batch_results: + continue + loc = loc[:3] + + # Storing order + batch_results[loc] = OrderProbTokenLogProbs(order=order, + probability=1., + log_probs=[batch_log_probs[token_ix]]) + batch_results_tokens[loc] = [token] + + # Done with batch + results += [batch_results] + result_tokens += [batch_results_tokens] + + # Returning + return {'decoded_orders': results, + 'policy_loss': policy_loss, + 'targets': targets, + 'tokens': result_tokens, + 'current_power': current_power, + 'current_season': current_season, + 'in_retreat_phase': in_retreat_phase, + 'request_id': request_ids, + 'log_probs': log_probs} + + def _evaluate(self, decoded_results, feed_dict, eval_loop_ix, incl_detailed): + """ Calculates the accuracy of the model + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index (-1 for training) + :param incl_detailed: is true if training is over, more statistics can be computed + :return: A tuple consisting of: + 1) An ordered dictionary with result_name as key and (weight, value) as value (Regular results) + 2) An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + # Detecting if it's our evaluation or not + if eval_loop_ix == -1: + eval_loop_ix = 0 + else: + our_validation = eval_loop_ix in self.my_eval_loop_ixs + if not our_validation: + return OrderedDict(), OrderedDict() + eval_loop_ix = self.my_eval_loop_ixs.index(eval_loop_ix) + + # Evaluating + policy_loss = decoded_results['policy_loss'] # Avg X-Ent per unit-order + perplexity = math.exp(policy_loss) if policy_loss <= 100 else float('inf') + targets = decoded_results['targets'] + batch_size = targets.shape[0] + nb_locs_per_target = targets.shape[1] + decoded_orders = decoded_results['decoded_orders'] + + # Logging an error if perplexity is inf + if perplexity == float('inf'): + for request_id, log_probs in zip(decoded_results['request_id'], decoded_results['log_probs']): + if sum(log_probs) <= -100: + LOGGER.error('Request %s has log probs that causes a -inf perplexity.', request_id) + + # Accuracy + acc_1_num, denom = 0., 0. + acc_1_no_hold_num, denom_no_hold = 0., 0. + nb_tokens_match, nb_tokens_total = 0., 0. + acc_player_num, denom_player = 0., 0. + + # Decoding batch by batch, loc by loc + for batch_ix in range(batch_size): + player_order_mismatch = False + nb_waive = 0 + + # We didn't learn a policy - Skipping + if not len(targets[batch_ix]) or targets[batch_ix][0] == 0: # pylint: disable=len-as-condition + continue + + for loc_ix in range(nb_locs_per_target): + decoded_target = targets[batch_ix][loc_ix] + decoded_target_order = ix_to_order(decoded_target) if decoded_target > EOS_ID else '' + if not decoded_target_order: + break + nb_tokens_total += TOKENS_PER_ORDER + + if decoded_target_order == 'WAIVE': + loc = 'WAIVE_{}'.format(nb_waive) + is_hold_order = False + nb_waive += 1 + else: + loc = decoded_target_order.split()[1][:3] + is_hold_order = len(decoded_target_order.split()) <= 2 or decoded_target_order.split()[2] == 'H' + + # Computing Acc 1 + denom += 1. + if not is_hold_order: + denom_no_hold += 1. + + # Checking if the target is in the decoded results + if loc in decoded_orders[batch_ix] and decoded_orders[batch_ix][loc].order == decoded_target_order: + acc_1_num += 1. + if not is_hold_order: + acc_1_no_hold_num += 1. + else: + player_order_mismatch = True + + # Computing Acc Tokens + tokenized_targets = get_order_tokens(decoded_target_order) + [EOS_TOKEN] + tokenized_targets += [PAD_TOKEN] * (TOKENS_PER_ORDER - len(tokenized_targets)) + + tokenized_results = [-1] * TOKENS_PER_ORDER + if loc in decoded_orders[batch_ix]: + tokenized_results = get_order_tokens(decoded_orders[batch_ix][loc].order) + [EOS_TOKEN] + tokenized_results += [PAD_TOKEN] * (TOKENS_PER_ORDER - len(tokenized_results)) + + nb_tokens_match += sum([1. for i in range(TOKENS_PER_ORDER) + if tokenized_targets[i] == tokenized_results[i]]) + + # Compute accuracy for this phase + if not player_order_mismatch: + acc_player_num += 1 + denom_player += 1 + + # No orders at all + if not denom: + acc_1 = 1. + acc_1_no_hold = 1. + acc_tokens = 1. + acc_player = 1. + else: + acc_1 = acc_1_num / (denom + 1e-12) + acc_1_no_hold = acc_1_no_hold_num / (denom_no_hold + 1e-12) + acc_tokens = nb_tokens_match / (nb_tokens_total + 1e-12) + acc_player = acc_player_num / (denom_player + 1e-12) + + # Computing detailed statistics + detailed_results = OrderedDict() + if incl_detailed: + detailed_results = self._get_detailed_results(decoded_results, feed_dict, eval_loop_ix) + + # Validating decoder type + decoder_type = [value for tensor, value in feed_dict.items() if 'decoder_type' in tensor.name] + decoder_type = '' if not decoder_type else decoder_type[0][0] + + # 0 - Teacher Forcing results + if eval_loop_ix == 0: + assert decoder_type == TRAINING_DECODER + return OrderedDict({'[TF]X-Ent': (denom, policy_loss), + '[TF]Perplexity': (denom, perplexity), + '[TF]Acc_1': (denom, 100. * acc_1), + '[TF]Acc_1_NoHold': (denom_no_hold, 100. * acc_1_no_hold), + '[TF]Acc_Tokens': (nb_tokens_total, 100. * acc_tokens), + '[TF]Acc_Player': (denom_player, 100. * acc_player)}), detailed_results + + # 1 - Greedy Results + if eval_loop_ix == 1: + assert decoder_type == GREEDY_DECODER + return OrderedDict({'[Gr]Acc_1': (denom, 100. * acc_1), + '[Gr]Acc_1_NoHold': (denom_no_hold, 100. * acc_1_no_hold), + '[Gr]Acc_Tokens': (nb_tokens_total, 100. * acc_tokens), + '[Gr]Acc_Player': (denom_player, 100. * acc_player)}), detailed_results + + # Otherwise, invalid evaluation_loop_ix + raise RuntimeError('Invalid evaluation_loop_ix - Got "%s"' % eval_loop_ix) + + @staticmethod + def _get_detailed_results(decoded_results, feed_dict, evaluation_loop_ix): + """ Computes detailed accuracy statistics for the batch + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index + :return: An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + del feed_dict # Unused args + + targets = decoded_results['targets'] + log_probs = decoded_results['log_probs'] + request_ids = decoded_results['request_id'] + batch_size = targets.shape[0] + nb_locs_per_target = targets.shape[1] + decoded_orders = decoded_results['decoded_orders'] + + # Extracting from additional info + for field_name in ['current_power', 'current_season', 'in_retreat_phase']: + if field_name not in decoded_results: + LOGGER.warning('The field "%s" is missing. Cannot compute stats', field_name) + return OrderedDict() + current_power_name = [POWER_VOCABULARY_IX_TO_KEY[current_power] + for current_power in decoded_results['current_power']] + current_season_name = ['SFW'[current_season] for current_season in decoded_results['current_season']] + in_retreat_phase = decoded_results['in_retreat_phase'] + + # Prefix + prefix = '[TF]' if evaluation_loop_ix == 0 else '[Gr]' + + # Building results dict + results = OrderedDict() + results[prefix + 'Accuracy'] = [] + results[prefix + 'LogProbsDetails'] = [{}] # {request_id: (log_probs, mismatch)} + for power_name in POWER_VOCABULARY_LIST: + results[prefix + power_name] = [] + for order_type in ['H', '-', '- VIA', 'S', 'C', 'R', 'B', 'D', 'WAIVE']: + results[prefix + 'Order %s' % order_type] = [] + for season in 'SFW': # Spring, Fall, Winter + results[prefix + 'Season %s' % season] = [] + for phase in 'MRA': # Movement, Retreats, Adjustments + results[prefix + 'Phase %s' % phase] = [] + for position in range(-1, NB_SUPPLY_CENTERS): # Position -1 is used for Adjustment phases + results[prefix + 'Position %d' % position] = [] + for order_loc in sorted(STANDARD_TOPO_LOCS): # Order location + results[prefix + 'Loc %s' % order_loc] = [] + + # Computing accuracy + for batch_ix in range(batch_size): + request_id = request_ids[batch_ix] + player_orders_mismatch = False + nb_waive = 0 + + # We didn't learn a policy - Skipping + if not len(targets[batch_ix]) or targets[batch_ix][0] == 0: # pylint: disable=len-as-condition + continue + + for loc_ix in range(nb_locs_per_target): + decoded_target = targets[batch_ix][loc_ix] + decoded_target_order = ix_to_order(decoded_target) if decoded_target > EOS_ID else '' + if not decoded_target_order: + break + + if decoded_target_order == 'WAIVE': + loc = 'WAIVE_{}'.format(nb_waive) + order_type = 'WAIVE' + nb_waive += 1 + else: + loc = decoded_target_order.split()[1][:3] + order_type = decoded_target_order.split()[2] if len(decoded_target_order.split()) > 2 else 'H' + if order_type == '-' and decoded_target_order.split()[-1] == 'VIA': + order_type = '- VIA' + + # Determining categories + power_name = current_power_name[batch_ix] + season = current_season_name[batch_ix] + if in_retreat_phase[batch_ix]: + phase = 'R' + order_type = 'R' if order_type in ['-', '- VIA'] else order_type + else: + phase = {'H': 'M', '-': 'M', '- VIA': 'M', 'S': 'M', 'C': 'M', + 'R': 'R', + 'D': 'A', 'B': 'A', 'WAIVE': 'A'}[order_type] + + # Use -1 as position for A phase + position = -1 if phase == 'A' else loc_ix + stats_key = StatsKey(prefix, power_name, order_type, season, phase, position) + + # Computing accuracies + success = int(loc in decoded_orders[batch_ix] + and decoded_orders[batch_ix][loc].order == decoded_target_order) + if not success: + player_orders_mismatch = True + + results[prefix + 'Accuracy'] += [success] + results[prefix + power_name] += [success] + results[prefix + 'Order %s' % order_type] += [success] + results[prefix + 'Season %s' % season] += [success] + results[prefix + 'Phase %s' % phase] += [success] + results[prefix + 'Position %d' % position] += [success] + if order_type != 'WAIVE': + results[prefix + 'Loc %s' % loc] += [success] + results[stats_key] = results.get(stats_key, []) + [success] + + # Storing (log_probs, mismatch) + results[prefix + 'LogProbsDetails'][0][request_id] = (log_probs[batch_ix].sum(), + int(player_orders_mismatch)) + + # Returning results + return results + + @staticmethod + def _post_process_results(detailed_results): + """ Perform post-processing on the detailed results + :param detailed_results: An dictionary which contains detailed evaluation statistics + :return: A dictionary with the post-processed statistics. + """ + # Adding [Gr]SearchFailure (== 1. iff. logprob(label) > logprob(greedy) and greedy != label) + # Adding [TF]Acc_Player and [Gr]Acc_Player + # Removing LogProbsDetails + + # Make sure the detailed results have the correct key (i.e. they have not yet been post-processed) + for prefix in ['[TF]', '[Gr]']: + assert prefix + 'LogProbsDetails' in detailed_results + + # Building a dictionary {request_id: (log_probs, mismatch)} + tf_items, gr_items = {}, {} + for tf_item in detailed_results['[TF]LogProbsDetails']: + tf_items.update(tf_item) + for gr_item in detailed_results['[Gr]LogProbsDetails']: + gr_items.update(gr_item) + + # Making sure we have processed the same number of TF items and Gr items + tf_nb_items = len(tf_items) + gr_nb_items = len(gr_items) + if tf_nb_items != gr_nb_items: + LOGGER.warning('Got a different number of items between [TF] (%d items) and [Gr] (%d items)', + tf_nb_items, gr_nb_items) + + # Computing search failure and mismatch + search_failure, gr_acc_player, tf_acc_player = [], [], [] + for request_id in tf_items: + if request_id not in gr_items: + LOGGER.warning('Item %s was computed using [TF], but is missing for [Gr]. Skipping.', request_id) + continue + + tf_logprobs, tf_mismatch = tf_items[request_id] + gr_logprobs, gr_mismatch = gr_items[request_id] + + # Computing stats + if gr_mismatch: + search_failure += [int(tf_logprobs > gr_logprobs)] + tf_acc_player += [int(not tf_mismatch)] + gr_acc_player += [int(not gr_mismatch)] + + # Removing extra keys and adding new keys + detailed_results['[Gr]SearchFailure'] = search_failure + detailed_results['[TF]Acc_Player'] = tf_acc_player + detailed_results['[Gr]Acc_Player'] = gr_acc_player + del detailed_results['[TF]LogProbsDetails'] + del detailed_results['[Gr]LogProbsDetails'] + + # Returning post-processed results + return detailed_results diff --git a/diplomacy_research/models/policy/order_based/train.py b/diplomacy_research/models/policy/order_based/train.py new file mode 100644 index 0000000..4870898 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/train.py @@ -0,0 +1,71 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (order based) + - Contains the training methods for the policy model +""" +import os +from diplomacy_research.models.policy.order_based import PolicyAdapter +from diplomacy_research.models.training.supervised import SupervisedTrainer +from diplomacy_research.utils.cluster import start_distributed_training +from diplomacy_research.utils.cluster_config.supervised import get_cluster_config +from diplomacy_research.utils.model import load_dynamically_from_model_id, load_dataset_builder +from diplomacy_research.utils.model import parse_args_into_flags, run_app +from diplomacy_research.settings import ROOT_DIR + +def main(_): + """ Trains the policy model """ + def start_supervised_training(cluster_config, _): + """ Callable fn to start training """ + SupervisedTrainer(policy_constructor=PolicyModel, + value_constructor=ValueModel, + draw_constructor=DrawModel, + dataset_builder=DatasetBuilder(), + adapter_constructor=PolicyAdapter, + cluster_config=cluster_config, + flags=FLAGS).start() + + # Detecting if we need to start regular or distributed training + start_distributed_training(callable_fn=start_supervised_training, + flags=FLAGS, + get_cluster_config_fn=get_cluster_config, + with_process_pool=False) + +if __name__ == '__main__': + + # Detecting PolicyModel, and load_args + PolicyModel, load_args = load_dynamically_from_model_id(['PolicyModel', 'load_args'], arg_name='model_id') # pylint: disable=invalid-name + + # Detecting ValueModel, and load_args + ValueModel, load_value_args = load_dynamically_from_model_id(['ValueModel', 'load_args'], # pylint: disable=invalid-name + arg_name='value_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'value'), + on_error='ignore') + + # Detecting DrawModel, and load_args + DrawModel, load_draw_args = load_dynamically_from_model_id(['DrawModel', 'load_args'], # pylint: disable=invalid-name + arg_name='draw_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'draw'), + on_error='ignore') + + # Loading args + ARGS = load_args() \ + + (load_value_args() if load_value_args is not None else []) \ + + (load_draw_args() if load_draw_args is not None else []) + FLAGS = parse_args_into_flags(ARGS) + + # Loading DatasetBuilder + DatasetBuilder = load_dataset_builder(FLAGS.dataset) # pylint: disable=invalid-name + + # Running + run_app() diff --git a/diplomacy_research/models/policy/order_based/v001_markovian_no_film/__init__.py b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/__init__.py new file mode 100644 index 0000000..766c728 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v001_markovian_no_film Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v001_markovian_no_film/model.py b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/model.py new file mode 100644 index 0000000..f68fc31 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/model.py @@ -0,0 +1,403 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v001_markovian_no_film) + - Contains the policy model (v001_markovian_no_film), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, MAX_CANDIDATES, \ + ORDER_VOCABULARY_SIZE, PAD_ID +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 8, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 200, 'Order embedding size.'), + ('int', 'gcn_size', 80, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 80, 'LSTM decoder attention size.'), + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import GraphConvolution, preprocess_adjacency + from diplomacy_research.utils.tensorflow import batch_norm + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = board_state + + # First Layer + graph_conv = GraphConvolution(input_dim=graph_conv.shape[-1].value, # (b, NB_NODES, gcn_size) + output_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + bias=True)(graph_conv) + + # Intermediate Layers + for _ in range(1, hps('nb_graph_conv') - 1): + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, gcn_size) + output_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + bias=True)(graph_conv) + graph_conv = batch_norm(graph_conv, is_training=pholder('is_training'), fused=True) + + # Final Layer + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, attn_size) + output_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + activation_fn=None, + bias=True)(graph_conv) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import AttentionWrapper, BahdanauAttention + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_scope = tf.VariableScope(name='policy/decoder_scope/Attention', reuse=tf.AUTO_REUSE) + attention_mechanism = BahdanauAttention(num_units=hps('attn_size'), + memory=board_state_conv, + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(board_state_conv, axis=1)) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_mechanism = BahdanauAttention(num_units=hps('attn_size'), + memory=tile_beam(board_state_conv), + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(tile_beam(board_state_conv), + axis=1)) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v001_markovian_no_film': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v001_markovian_no_film/tests/__init__.py b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v001_markovian_no_film/tests/test_model.py b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/tests/test_model.py new file mode 100644 index 0000000..c84dbdb --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v001_markovian_no_film/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v001_markovian_no_film import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v002_markovian_film/__init__.py b/diplomacy_research/models/policy/order_based/v002_markovian_film/__init__.py new file mode 100644 index 0000000..7faf7a8 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v002_markovian_film/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v002_markovian_film Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v002_markovian_film/model.py b/diplomacy_research/models/policy/order_based/v002_markovian_film/model.py new file mode 100644 index 0000000..d0de9ea --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v002_markovian_film/model.py @@ -0,0 +1,425 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v002_markovian_film) + - Contains the policy model (v002_markovian_film), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_POWERS, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 8, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 200, 'Order embedding size.'), + ('int', 'power_emb_size', 80, 'Power embedding size.'), + ('int', 'gcn_size', 80, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 80, 'LSTM decoder attention size.'), + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, final_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + current_power = self.features['current_power'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size')] + film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(current_power_embedding)[:, None, :] + film_gammas, film_betas = tf.split(film_weights, 2, axis=2) # (b, 1, 750) + film_gammas = tf.split(film_gammas, film_output_dims, axis=2) + film_betas = tf.split(film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', film_gammas) + self.add_output('_board_state_conv_film_betas', film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import AttentionWrapper, ModifiedBahdanauAttention + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_scope = tf.VariableScope(name='policy/decoder_scope/Attention', reuse=tf.AUTO_REUSE) + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=board_state_conv, + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(board_state_conv, axis=1)) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=tile_beam(board_state_conv), + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(tile_beam(board_state_conv), + axis=1)) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v002_markovian_film': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v002_markovian_film/tests/__init__.py b/diplomacy_research/models/policy/order_based/v002_markovian_film/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v002_markovian_film/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v002_markovian_film/tests/test_model.py b/diplomacy_research/models/policy/order_based/v002_markovian_film/tests/test_model.py new file mode 100644 index 0000000..f8da4c4 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v002_markovian_film/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v002_markovian_film import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v003_film_prev_order/.deprecated b/diplomacy_research/models/policy/order_based/v003_film_prev_order/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/order_based/v004_language_model/__init__.py b/diplomacy_research/models/policy/order_based/v004_language_model/__init__.py new file mode 100644 index 0000000..ce70e75 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v004_language_model/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v004_language_model Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v004_language_model/model.py b/diplomacy_research/models/policy/order_based/v004_language_model/model.py new file mode 100644 index 0000000..0bf2b7e --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v004_language_model/model.py @@ -0,0 +1,321 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v004_language_model) + - Use nothing but modelling the unit order as language model +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import NB_NODES, NB_SUPPLY_CENTERS, MAX_CANDIDATES, ORDER_VOCABULARY_SIZE, \ + PAD_ID +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'order_emb_size', 80, 'Order embedding size.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + # This model doesn't encode the board state - Returning the inputs + del name, reuse # Unused args + return board_state + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + # This model does not support any board state + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': tf.zeros([batch_size, NB_NODES, 0], dtype=tf.float32), + 'board_state_0yr_conv': tf.zeros([batch_size, NB_NODES, 0], dtype=tf.float32), + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying dropout to input and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size'), + dtype=tf.float32) + + # Blank initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size'), + dtype=tf.float32) + + # Blank initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v004_language_model': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v004_language_model/tests/__init__.py b/diplomacy_research/models/policy/order_based/v004_language_model/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v004_language_model/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v004_language_model/tests/test_model.py b/diplomacy_research/models/policy/order_based/v004_language_model/tests/test_model.py new file mode 100644 index 0000000..8bd8cc1 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v004_language_model/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v004_language_model import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/__init__.py b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/__init__.py new file mode 100644 index 0000000..7389597 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v005_markovian_film_board_align Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/model.py b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/model.py new file mode 100644 index 0000000..7552863 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/model.py @@ -0,0 +1,433 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v005_markovian_film_board_align) + - Contains the policy model (v005_markovian_film_board_align), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID, NB_SEASONS +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 16, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 80, 'Order embedding size.'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.') + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, attn_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size')] + film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + film_gammas, film_betas = tf.split(film_weights, 2, axis=2) # (b, 1, 750) + film_gammas = tf.split(film_gammas, film_output_dims, axis=2) + film_betas = tf.split(film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', film_gammas) + self.add_output('_board_state_conv_film_betas', film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v005_markovian_film_board_align': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/tests/__init__.py b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/tests/test_model.py b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/tests/test_model.py new file mode 100644 index 0000000..e5668e1 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v005_markovian_film_board_align/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v005_markovian_film_board_align import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/__init__.py b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/__init__.py new file mode 100644 index 0000000..c794ac1 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v006_markovian_film_both_attn Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/model.py b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/model.py new file mode 100644 index 0000000..dc227ae --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/model.py @@ -0,0 +1,457 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v006_markovian_film_both_attn) + - Contains the policy model (v006_markovian_film_both_attn), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID, NB_SEASONS +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 16, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 80, 'Order embedding size.'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size.'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.'), + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, attn_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size')] + film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + film_gammas, film_betas = tf.split(film_weights, 2, axis=2) # (b, 1, 750) + film_gammas = tf.split(film_gammas, film_output_dims, axis=2) + film_betas = tf.split(film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', film_gammas) + self.add_output('_board_state_conv_film_betas', film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import ModifiedBahdanauAttention, AttentionWrapper, \ + StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + 2 * hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_scope = tf.VariableScope(name='policy/decoder_scope/Attention', reuse=tf.AUTO_REUSE) + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=board_state_conv, + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + 2 * hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=tile_beam(board_state_conv), + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v006_markovian_film_both_attn': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/tests/__init__.py b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/tests/test_model.py b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/tests/test_model.py new file mode 100644 index 0000000..82e7e52 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v006_markovian_film_both_attn/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v006_markovian_film_both_attn import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v007_mark_film_board_align_self_attn/.deprecated b/diplomacy_research/models/policy/order_based/v007_mark_film_board_align_self_attn/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/order_based/v008_mark_film_hier_board_align/.deprecated b/diplomacy_research/models/policy/order_based/v008_mark_film_hier_board_align/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/__init__.py b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/__init__.py new file mode 100644 index 0000000..4b79572 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v009_mark_board_align_no_norm Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/model.py b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/model.py new file mode 100644 index 0000000..b3c9c51 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/model.py @@ -0,0 +1,393 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v009_mark_board_align_no_norm) + - Contains the policy model (v009_mark_board_align_no_norm), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_NODES, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 16, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 80, 'Order embedding size.'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.') + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import GraphConvolution, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + relu = tf.nn.relu + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for _ in range(hps('nb_graph_conv') - 1): + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, gcn_size) + output_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + residual=True, + bias=True)(graph_conv) + + # Last Layer + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, attn_size) + output_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + residual=False, + bias=True)(graph_conv) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v009_mark_board_align_no_norm': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/tests/__init__.py b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/tests/__init__.py new file mode 100644 index 0000000..68e4357 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== \ No newline at end of file diff --git a/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/tests/test_model.py b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/tests/test_model.py new file mode 100644 index 0000000..0851c62 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v009_mark_board_align_no_norm/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v009_mark_board_align_no_norm import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v010_film_board_align_prev_ord/.deprecated b/diplomacy_research/models/policy/order_based/v010_film_board_align_prev_ord/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/__init__.py b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/__init__.py new file mode 100644 index 0000000..4808c67 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v011_board_align_prev_ord_no_norm Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/model.py b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/model.py new file mode 100644 index 0000000..d2ec60b --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/model.py @@ -0,0 +1,425 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v011_board_align_prev_ord_no_norm) + - Contains the policy model (v011_board_align_prev_ord_no_norm), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_NODES, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID, NB_PREV_ORDERS, NB_FEATURES +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 16, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 80, 'Order embedding size.'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.') + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import GraphConvolution, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + relu = tf.nn.relu + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + batch_size = tf.shape(board_state)[0] + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + + # Projecting (if needed) to 'gcn_size' + if board_state.shape[-1].value == NB_FEATURES: + with tf.variable_scope('proj', reuse=tf.AUTO_REUSE): + proj_w = tf.get_variable('W', shape=[1, NB_FEATURES, hps('gcn_size')], dtype=tf.float32) + graph_conv = relu(tf.matmul(board_state, tf.tile(proj_w, [batch_size, 1, 1]))) + else: + graph_conv = board_state + + # First and intermediate layers + for _ in range(hps('nb_graph_conv') - 1): + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, gcn_size) + output_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + residual=True, + bias=True)(graph_conv) + + # Last Layer + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, final_size) + output_dim=hps('attn_size') // 2, + norm_adjacency=norm_adjacency, + activation_fn=relu, + residual=False, + bias=True)(graph_conv) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + from diplomacy_research.utils.tensorflow import tf + assert prev_ord_conv is not None, 'This model requires a prev_ord_conv argument' + return tf.concat([board_0yr_conv, prev_ord_conv], axis=-1) + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + prev_orders_state = to_float(self.features['prev_orders_state']) # (b, NB_PRV_OD, NB_ND, NB_OD_FT) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Concatenating together to share graph convolution weights + board_state_conv = tf.concat([ + tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state)[:, None, :, :], + tf.layers.Dense(units=hps('gcn_size'), activation=relu)(prev_orders_state) + ], axis=1) # (b, 1 + nb_prev, NB_ND, gcn) + + # Aggregating the first 2 dimensions to perform the graph convolutions together + board_state_conv = tf.reshape(board_state_conv, [-1, NB_NODES, hps('gcn_size')]) + board_state_conv = self.encode_board(board_state_conv, name='board_state_conv') + + # Splitting back into (b, 1 + nb_prev, NB_NODES, attn_size / 2) + # Reducing the prev ord conv using avg + board_state_conv = tf.reshape(board_state_conv, [batch_size, + 1 + NB_PREV_ORDERS, + NB_NODES, + hps('attn_size') // 2]) + + # Concatenating the current board conv with the prev ord conv + # The final board_state_conv should be of dimension (b, NB_NODE, attn_size) + board_state_0yr_conv = board_state_conv[:, 0, :, :] + prev_ord_conv = tf.reduce_mean(board_state_conv[:, 1:, :, :], axis=1) + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training, prev_ord_conv) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'prev_ord_conv': prev_ord_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v011_board_align_prev_ord_no_norm': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/tests/__init__.py b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/tests/test_model.py b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/tests/test_model.py new file mode 100644 index 0000000..55ba220 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v011_board_align_prev_ord_no_norm/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v011_board_align_prev_ord_no_norm import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/__init__.py b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/__init__.py new file mode 100644 index 0000000..c8bd3a8 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v012_film_diff_w_board_align_prev_ord Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/model.py b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/model.py new file mode 100644 index 0000000..72426b9 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/model.py @@ -0,0 +1,468 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v012_film_diff_w_board_align_prev_ord) + - Contains the policy model (v012_film_diff_w_board_align_prev_ord), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID, NB_SEASONS, NB_PREV_ORDERS, NB_ORDERS_FEATURES +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 16, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 80, 'Order embedding size.'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.') + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, final_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size') // 2, + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + from diplomacy_research.utils.tensorflow import tf + assert prev_ord_conv is not None, 'This model requires a prev_ord_conv argument' + return tf.concat([board_0yr_conv, prev_ord_conv], axis=-1) + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + prev_orders_state = to_float(self.features['prev_orders_state']) # (b, NB_PRV_OD, NB_ND, NB_OD_FT) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size') // 2] + + # For board_state + board_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + board_film_gammas, board_film_betas = tf.split(board_film_weights, 2, axis=2) # (b, 1, 750) + board_film_gammas = tf.split(board_film_gammas, film_output_dims, axis=2) + board_film_betas = tf.split(board_film_betas, film_output_dims, axis=2) + + # For prev_orders + prev_ord_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + prev_ord_film_weights = tf.tile(prev_ord_film_weights, [NB_PREV_ORDERS, 1, 1]) # (n_pr, 1, 750) + prev_ord_film_gammas, prev_ord_film_betas = tf.split(prev_ord_film_weights, 2, axis=2) + prev_ord_film_gammas = tf.split(prev_ord_film_gammas, film_output_dims, axis=2) + prev_ord_film_betas = tf.split(prev_ord_film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', board_film_gammas) + self.add_output('_board_state_conv_film_betas', board_film_betas) + self.add_output('_prev_orders_conv_film_gammas', prev_ord_film_gammas) + self.add_output('_prev_orders_conv_film_betas', prev_ord_film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + assert hps('attn_size') % 2 == 0 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + + # Encoding prev_orders + prev_orders_state = tf.reshape(prev_orders_state, [batch_size * NB_PREV_ORDERS, + NB_NODES, + NB_ORDERS_FEATURES]) + prev_ord_conv = self.encode_board(prev_orders_state, name='prev_orders_conv') + + # Splitting back into (b, nb_prev, NB_NODES, attn_size // 2) + # Reducing the prev ord conv using avg + prev_ord_conv = tf.reshape(prev_ord_conv, [batch_size, + NB_PREV_ORDERS, + NB_NODES, + hps('attn_size') // 2]) + prev_ord_conv = tf.reduce_mean(prev_ord_conv, axis=1) + + # Concatenating the current board conv with the prev ord conv + # The final board_state_conv should be of dimension (b, NB_NODE, attn_size) + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training, prev_ord_conv) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'prev_ord_conv': prev_ord_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v012_film_diff_w_board_align_prev_ord': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/tests/__init__.py b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/tests/test_model.py b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/tests/test_model.py new file mode 100644 index 0000000..d5ff683 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v012_film_diff_w_board_align_prev_ord/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v012_film_diff_w_board_align_prev_ord import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/__init__.py b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/__init__.py new file mode 100644 index 0000000..adb467c --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v013_board_align_diff_w_prev_ord_no_norm Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/model.py b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/model.py new file mode 100644 index 0000000..4cb56e9 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/model.py @@ -0,0 +1,415 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v013_board_align_diff_w_prev_ord_no_norm) + - Contains the policy model (v013_board_align_diff_w_prev_ord_no_norm), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_NODES, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID, NB_PREV_ORDERS, NB_ORDERS_FEATURES +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 16, 'Number of Graph Conv Layer'), + ('int', 'order_emb_size', 80, 'Order embedding size.'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.') + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import GraphConvolution, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + relu = tf.nn.relu + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for _ in range(hps('nb_graph_conv') - 1): + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, gcn_size) + output_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + residual=True, + bias=True)(graph_conv) + + # Last Layer + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, final_size) + output_dim=hps('attn_size') // 2, + norm_adjacency=norm_adjacency, + activation_fn=relu, + residual=False, + bias=True)(graph_conv) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + from diplomacy_research.utils.tensorflow import tf + assert prev_ord_conv is not None, 'This model requires a prev_ord_conv argument' + return tf.concat([board_0yr_conv, prev_ord_conv], axis=-1) + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + prev_orders_state = to_float(self.features['prev_orders_state']) # (b, NB_PRV_OD, NB_ND, NB_OD_FT) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + assert hps('attn_size') % 2 == 0 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + + # Encoding prev_orders + prev_orders_state = tf.reshape(prev_orders_state, [batch_size * NB_PREV_ORDERS, + NB_NODES, + NB_ORDERS_FEATURES]) + prev_ord_conv = self.encode_board(prev_orders_state, name='prev_orders_conv') + + # Splitting back into (b, nb_prev, NB_NODES, attn_size // 2) + # Reducing the prev ord conv using avg + prev_ord_conv = tf.reshape(prev_ord_conv, [batch_size, + NB_PREV_ORDERS, + NB_NODES, + hps('attn_size') // 2]) + prev_ord_conv = tf.reduce_mean(prev_ord_conv, axis=1) + + # Concatenating the current board conv with the prev ord conv + # The final board_state_conv should be of dimension (b, NB_NODE, attn_size) + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training, prev_ord_conv) + + # Creating order embedding vector (to embed order_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('order_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('lstm_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'prev_ord_conv': prev_ord_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying Dropout to input, attention and output + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('order_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/tests/__init__.py b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/tests/__init__.py new file mode 100644 index 0000000..68e4357 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== \ No newline at end of file diff --git a/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/tests/test_model.py b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/tests/test_model.py new file mode 100644 index 0000000..567eb9d --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v013_board_align_diff_w_prev_ord_no_norm/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v013_board_align_diff_w_prev_ord_no_norm import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/order_based/v014_msg_film_diff_brd_algn_prev_ord/.withheld b/diplomacy_research/models/policy/order_based/v014_msg_film_diff_brd_algn_prev_ord/.withheld new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/__init__.py b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/__init__.py new file mode 100644 index 0000000..96d0286 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v015_film_transformer_gpt Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/model.py b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/model.py new file mode 100644 index 0000000..220f8e0 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/model.py @@ -0,0 +1,524 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v015_film_transformer_gpt) + - Contains the policy model (v015_film_transformer_gpt), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.order_based import OrderBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, \ + ORDER_VOCABULARY_SIZE, MAX_CANDIDATES, PAD_ID, NB_SEASONS, NB_PREV_ORDERS, NB_ORDERS_FEATURES +from diplomacy_research.settings import NB_PARTITIONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 12, 'Number of Graph Conv Layer'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.'), + ('int', 'trsf_ctxt_size', 1000 + NB_SUPPLY_CENTERS, 'The size of the context window.'), + ('int', 'trsf_emb_size', 80, 'The size of the embedding for the vocabulary and the context'), + ('int', 'trsf_nb_heads', 2, 'The number of attention heads to use for transformer'), + ('int', 'trsf_nb_layers', 4, 'The number of layers to use for transformer') + ] + +class PolicyModel(OrderBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, final_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size') // 2, + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + from diplomacy_research.utils.tensorflow import tf + assert prev_ord_conv is not None, 'This model requires a prev_ord_conv argument' + return tf.concat([board_0yr_conv, prev_ord_conv], axis=-1) + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import pad_axis, to_int32, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + prev_orders_state = to_float(self.features['prev_orders_state']) # (b, NB_PRV_OD, NB_ND, NB_OD_FT) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + candidates = self.features['candidates'] # tf.int32 - (b, nb_locs * MAX_CANDIDATES) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding decoder_inputs and candidates + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + candidates = pad_axis(candidates, axis=-1, min_size=MAX_CANDIDATES) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Reshaping candidates + candidates = tf.reshape(candidates, [batch_size, -1, MAX_CANDIDATES]) + candidates = candidates[:, :tf.reduce_max(decoder_lengths), :] # tf.int32 - (b, nb_locs, MAX_CAN) + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size') // 2] + + # For board_state + board_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + board_film_gammas, board_film_betas = tf.split(board_film_weights, 2, axis=2) # (b, 1, 750) + board_film_gammas = tf.split(board_film_gammas, film_output_dims, axis=2) + board_film_betas = tf.split(board_film_betas, film_output_dims, axis=2) + + # For prev_orders + prev_ord_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + prev_ord_film_weights = tf.tile(prev_ord_film_weights, [NB_PREV_ORDERS, 1, 1]) # (n_pr, 1, 750) + prev_ord_film_gammas, prev_ord_film_betas = tf.split(prev_ord_film_weights, 2, axis=2) + prev_ord_film_gammas = tf.split(prev_ord_film_gammas, film_output_dims, axis=2) + prev_ord_film_betas = tf.split(prev_ord_film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', board_film_gammas) + self.add_output('_board_state_conv_film_betas', board_film_betas) + self.add_output('_prev_orders_conv_film_gammas', prev_ord_film_gammas) + self.add_output('_prev_orders_conv_film_betas', prev_ord_film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + assert hps('attn_size') % 2 == 0 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + + # Encoding prev_orders + prev_orders_state = tf.reshape(prev_orders_state, [batch_size * NB_PREV_ORDERS, + NB_NODES, + NB_ORDERS_FEATURES]) + prev_ord_conv = self.encode_board(prev_orders_state, name='prev_orders_conv') + + # Splitting back into (b, nb_prev, NB_NODES, attn_size / 2) + # Reducing the prev ord conv using avg + prev_ord_conv = tf.reshape(prev_ord_conv, [batch_size, + NB_PREV_ORDERS, + NB_NODES, + hps('attn_size') // 2]) + prev_ord_conv = tf.reduce_mean(prev_ord_conv, axis=1) + + # Concatenating the current board conv with the prev ord conv + # The final board_state_conv should be of dimension (b, NB_NODE, attn_size) + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training, prev_ord_conv) + + # Creating policy order embedding vector (to embed order ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('order_embedding_scope'): + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + order_embedding = uniform(name='order_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('trsf_emb_size')], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Creating candidate embedding + with tf.variable_scope('candidate_embedding_scope'): + # embedding: (order_vocab_size, 64) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + partitioner = tf.fixed_size_partitioner(NB_PARTITIONS) if hps('use_partitioner') else None + candidate_embedding = uniform(name='candidate_embedding', + shape=[ORDER_VOCABULARY_SIZE, hps('trsf_emb_size') + 1], + scale=1., + partitioner=partitioner, + caching_device=caching_device) + + # Trimming to the maximum number of candidates + candidate_lengths = tf.reduce_sum(to_int32(tf.math.greater(candidates, PAD_ID)), -1) # int32 - (b,) + max_candidate_length = tf.math.maximum(1, tf.reduce_max(candidate_lengths)) + candidates = candidates[:, :, :max_candidate_length] + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'prev_ord_conv': prev_ord_conv, + 'order_embedding': order_embedding, + 'candidate_embedding': candidate_embedding, + 'candidates': candidates, + 'max_candidate_length': max_candidate_length, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import CandidateBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.models.layers.transformer import TransformerCell + from diplomacy_research.models.layers.wrappers import IdentityCell + from diplomacy_research.models.policy.order_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + order_embedding = self.outputs['order_embedding'] + candidate_embedding = self.outputs['candidate_embedding'] + candidates = self.outputs['candidates'] + max_candidate_length = self.outputs['max_candidate_length'] + + # Creating a smaller position embedding if it's not present in the outputs + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('position_embedding_scope'): + caching_device = self.cluster_config.caching_device if self.cluster_config else None + position_embedding = uniform(name='position_embedding', + shape=[NB_SUPPLY_CENTERS, hps('trsf_emb_size')], + scale=1., + caching_device=caching_device) + + # Past Attentions + past_attentions, message_lengths = None, None + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + feeder_cell = IdentityCell(output_size=hps('trsf_emb_size') + hps('attn_size')) + + # ======== Regular Decoding ======== + # Applying Dropout to input, attention and output + feeder_cell = SeededDropoutWrapper(cell=feeder_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('trsf_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + feeder_cell = StaticAttentionWrapper(cell=feeder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + feeder_cell_init_state = feeder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + sequence_length=decoder_lengths, + candidates=candidates, + time_major=False, + softmax_temperature=temperature) + + # ---- Transformer Cell ---- + trsf_scope = tf.VariableScope(name='policy/training_scope/transformer', reuse=False) + transformer_cell = TransformerCell(nb_layers=hps('trsf_nb_layers'), + nb_heads=hps('trsf_nb_heads'), + word_embedding=order_embedding, + position_embedding=position_embedding, + batch_size=batch_size, + feeder_cell=feeder_cell, + feeder_init_state=feeder_cell_init_state, + past_attentions=past_attentions, + past_seq_lengths=message_lengths, + scope=trsf_scope, + name='transformer') + transformer_cell_init_state = transformer_cell.zero_state(batch_size, tf.float32) + + # ---- Invariants ---- + invariants_map = { + 'past_attentions': tf.TensorShape([None, # batch size + hps('trsf_nb_layers'), # nb_layers + 2, # key, value + hps('trsf_nb_heads'), # nb heads + None, # Seq len + hps('trsf_emb_size') // hps('trsf_nb_heads')])} # Head size + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = NB_SUPPLY_CENTERS + model_decoder = CandidateBasicDecoder(cell=transformer_cell, + helper=helper, + initial_state=transformer_cell_init_state, + max_candidate_length=max_candidate_length, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + invariants_map=invariants_map, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + beam_feeder_cell = IdentityCell(output_size=hps('trsf_emb_size') + hps('attn_size')) + + # Applying Dropout to input, attention and output + beam_feeder_cell = SeededDropoutWrapper(cell=beam_feeder_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('trsf_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + beam_feeder_cell = StaticAttentionWrapper(cell=beam_feeder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + beam_feeder_init_state = beam_feeder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Transformer Cell ---- + trsf_scope = tf.VariableScope(name='policy/training_scope/transformer', reuse=True) + beam_trsf_cell = TransformerCell(nb_layers=hps('trsf_nb_layers'), + nb_heads=hps('trsf_nb_heads'), + word_embedding=order_embedding, + position_embedding=position_embedding, + batch_size=batch_size * hps('beam_width'), + feeder_cell=beam_feeder_cell, + feeder_init_state=beam_feeder_init_state, + past_attentions=tile_beam(past_attentions), + past_seq_lengths=tile_beam(message_lengths), + scope=trsf_scope, + name='transformer') + beam_trsf_cell_init_state = beam_trsf_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=beam_trsf_cell, + order_embedding=order_embedding, + candidate_embedding=candidate_embedding, + candidates=candidates, + sequence_length=decoder_lengths, + initial_state=beam_trsf_cell_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + invariants_map=invariants_map, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + candidate_logits = training_results.rnn_output # (b, dec_len, max_cand_len) + logits_length = tf.shape(candidate_logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Computing ArgMax tokens + argmax_id = to_int32(tf.argmax(candidate_logits, axis=-1)) + max_nb_candidate = tf.shape(candidate_logits)[2] + candidate_ids = \ + tf.reduce_sum(tf.one_hot(argmax_id, max_nb_candidate, dtype=tf.int32) * candidates, axis=-1) + argmax_tokens = to_int32(to_float(candidate_ids) * sequence_mask) + + # Extracting the position of the target candidate + tokens_labels = tf.argmax(to_int32(tf.math.equal(selected_tokens[:, :, None], candidates)), -1) + target_labels = tf.argmax(to_int32(tf.math.equal(decoder_target[:, :, None], candidates)), -1) + + # Log Probs + log_probs = -1. * cross_entropy(logits=candidate_logits, labels=tokens_labels) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=candidate_logits, + targets=target_labels, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/order_based/v015_film_transformer_gpt': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': candidate_logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/tests/__init__.py b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/tests/test_model.py b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/tests/test_model.py new file mode 100644 index 0000000..e9115e1 --- /dev/null +++ b/diplomacy_research/models/policy/order_based/v015_film_transformer_gpt/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v015_film_transformer_gpt import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'order_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/tests/policy_adapter_test_setup.py b/diplomacy_research/models/policy/tests/policy_adapter_test_setup.py new file mode 100644 index 0000000..c8cdb3f --- /dev/null +++ b/diplomacy_research/models/policy/tests/policy_adapter_test_setup.py @@ -0,0 +1,847 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generic class to tests for model and adapter correctness """ +# pylint: disable=too-many-lines +import os +import shutil +import tempfile +import numpy as np +from tornado import gen +from tornado.ioloop import IOLoop +from diplomacy import Game +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.policy.base_policy_model import POLICY_BEAM_WIDTH +from diplomacy_research.models.state_space import extract_state_proto, extract_phase_history_proto, \ + extract_possible_orders_proto, TOKENS_PER_ORDER, get_orderable_locs_for_powers, get_map_powers, NB_NODES, \ + NB_FEATURES +from diplomacy_research.utils.checkpoint import freeze_graph, build_saved_model +from diplomacy_research.utils.cluster import process_fetches_dict +from diplomacy_research.utils.model import int_prod + +class PolicyAdapterTestSetup(): + """ Creates a testable setup to test a model and a constructor """ + + def __init__(self, policy_model_ctor, value_model_ctor, draw_model_ctor, dataset_builder, policy_adapter_ctor, + load_policy_args, load_value_args, load_draw_args, strict=True): + """ Constructor + :param policy_model_ctor: The policy model constructor to create the policy model. + :param value_model_ctor: The value model constructor to create the value model. + :param draw_model_ctor: The draw model constructor to create the draw model. + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param policy_adaptor_ctor: The policy adapter constructor to create the policy adapter + :param load_policy_args: Reference to the callable function required to load policy args + :param load_value_args: Reference to the callable function required to load value args + :param load_draw_args: Reference to the callable function required to load draw args + :param strict: Boolean. Uses strict tests, otherwise allow more variation in results. + :type policy_model_ctor: diplomacy_research.models.policy.base_policy_model.BasePolicyModel.__class__ + :type value_model_ctor: diplomacy_research.models.value.base_value_model.BaseValueModel.__class__ + :type draw_model_ctor: diplomacy_research.models.draw.base_draw_model.BaseDrawModel.__class__ + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type policy_adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + """ + # pylint: disable=too-many-arguments + # Parsing new flags + args = load_policy_args() + if load_value_args is not None: + args += load_value_args() + if load_draw_args is not None: + args += load_draw_args() + self.hparams = self.parse_flags(args) + self.strict = strict + + # Other attributes + self.graph = None + self.sess = None + self.adapter = None + self.queue_dataset = None + self.policy_model_ctor = policy_model_ctor + self.value_model_ctor = value_model_ctor + self.draw_model_ctor = draw_model_ctor + self.dataset_builder = dataset_builder + self.policy_adapter_ctor = policy_adapter_ctor + + def build_model(self): + """ Builds the model """ + from diplomacy_research.utils.tensorflow import tf + graph = tf.Graph() + with graph.as_default(): + + # Creating dataset + self.queue_dataset = QueueDataset(batch_size=self.hparams['batch_size'], + dataset_builder=self.dataset_builder) + + # Creating model and validating + model = self.policy_model_ctor(self.queue_dataset, self.hparams) + if self.value_model_ctor is not None: + model = self.value_model_ctor(model, self.queue_dataset, self.hparams) + if self.draw_model_ctor is not None: + model = self.draw_model_ctor(model, self.queue_dataset, self.hparams) + model.finalize_build() + model.validate() + + # Testing encode_board(), get_board_state_conv() get_board_value() + self.test_encode_board(model) + self.test_get_board_state_conv(model) + self.test_get_board_value(model) + + self.graph = graph + self.sess = tf.Session(graph=graph) + + @staticmethod + def parse_flags(args): + """ Parse flags without calling tf.app.run() """ + define = {'bool': lambda x: bool(x), # pylint: disable=unnecessary-lambda + 'int': lambda x: int(x), # pylint: disable=unnecessary-lambda + 'str': lambda x: str(x), # pylint: disable=unnecessary-lambda + 'float': lambda x: float(x), # pylint: disable=unnecessary-lambda + '---': lambda x: x} # pylint: disable=unnecessary-lambda + + # Keeping a dictionary of parse args to overwrite if provided multiple times + flags = {} + for arg in args: + arg_type, arg_name, arg_value, _ = arg + flags[arg_name] = define[arg_type](arg_value) + if arg_type == '---' and arg_name in flags: + del flags[arg_name] + return flags + + def run_tests(self): + """ Run all tests """ + IOLoop.current().run_sync(self.run_tests_async) + + @gen.coroutine + def run_tests_async(self): + """ Run tests in an asynchronous IO Loop """ + self.build_model() + self.adapter = self.policy_adapter_ctor(self.queue_dataset, self.graph, session=self.sess) + yield self.test_load_from_checkpoint() + self.test_freeze_and_saved_model() + self.test_is_trainable() + self.test_tokenize() + self.test_get_feedable_item() + yield self.test_get_orders() + yield self.test_get_orders_with_beam() + yield self.test_get_orders_with_value() + yield self.test_get_beam_orders() + yield self.test_get_beam_orders_with_value() + yield self.test_get_updated_policy_details() + yield self.test_expand() + yield self.test_get_state_value() + self.test_graph_size() + + @staticmethod + def test_encode_board(model): + """ Tests the encode_board_method """ + from diplomacy_research.utils.tensorflow import tf + global_vars_before = set(tf.global_variables()) + model.encode_board(tf.placeholder(dtype=tf.float32, shape=[None, NB_NODES, NB_FEATURES], name='fake_board'), + name='board_state_conv', + reuse=True) + global_vars_after = set(tf.global_variables()) + allowed_new_vars = {var for var in tf.global_variables() if 'policy' in var.name and '/proj/' in var.name} + assert not global_vars_after - global_vars_before - allowed_new_vars, 'New variables added when encoding board.' + + @staticmethod + def test_get_board_state_conv(model): + """ Tests the get_board_state_conv method """ + from diplomacy_research.utils.tensorflow import tf + fake_board_conv = tf.placeholder(dtype=tf.float32, shape=[None, NB_NODES, NB_FEATURES], name='fake_board_conv') + is_training = tf.placeholder(dtype=tf.bool, shape=(), name='fake_is_training') + model.get_board_state_conv(fake_board_conv, is_training, fake_board_conv) + + @staticmethod + def test_get_board_value(model): + """ Tests the get_board_value method (with and/or without a value function) """ + from diplomacy_research.utils.tensorflow import tf + global_vars_before = set(tf.global_variables()) + board_state = tf.placeholder(dtype=tf.float32, shape=[None, NB_NODES, NB_FEATURES], name='fake_board') + current_power = tf.placeholder(dtype=tf.int32, shape=[None], name='fake_current_power') + model.get_board_value(board_state, current_power, reuse=True) + global_vars_after = set(tf.global_variables()) + assert not global_vars_after - global_vars_before, 'New variables added when getting board value.' + + @gen.coroutine + def test_load_from_checkpoint(self): + """ Checks if the model can be frozen to disk and then loaded back """ + from diplomacy_research.utils.tensorflow import tf + + # Freezing model to disk + temp_dir = tempfile.mkdtemp() + freeze_graph(temp_dir, 0, graph=self.graph, session=self.sess) + + # Rebuilding a new graph and querying a move from the new graph + new_graph = tf.Graph() + with new_graph.as_default(): + new_session = tf.Session(graph=new_graph) + new_dataset = QueueDataset(batch_size=32, + dataset_builder=self.dataset_builder, + no_iterator=True) + new_adapter = self.policy_adapter_ctor(new_dataset, new_graph, new_session) + new_adapter.load_from_checkpoint(os.path.join(temp_dir, 'frozen_graph-v000000000.pb')) + + # Querying moves + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0.} + orders, _ = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **kwargs) + assert orders + + # Deleting tempdir + shutil.rmtree(temp_dir, ignore_errors=True) + + def test_freeze_and_saved_model(self): + """ Tests the freeze_graph and build_saved_model functions """ + freeze_temp_dir = tempfile.mkdtemp() + freeze_graph(freeze_temp_dir, 0, graph=self.graph, session=self.sess) + assert os.path.exists(os.path.join(freeze_temp_dir, 'frozen_graph-v000000000.pb')) + shutil.rmtree(freeze_temp_dir, ignore_errors=True) + + saved_temp_dir = tempfile.mkdtemp() + build_saved_model(saved_temp_dir, + version_id=0, + signature=self.adapter.get_signature(), + proto_fields=self.dataset_builder.get_proto_fields(), + graph=self.graph, + session=self.sess) + assert os.path.exists(os.path.join(saved_temp_dir, '000000000', 'saved_model.pb')) + shutil.rmtree(saved_temp_dir, ignore_errors=True) + + def test_is_trainable(self): + """ Checks if the .is_trainable property works """ + assert self.adapter.is_trainable + + def test_tokenize(self): + """ Checks if .tokenize is implemented """ + tokens = self.adapter.tokenize('A PAR H') + assert tokens + + def test_get_feedable_item(self): + """ Checks if the .get_feedable_item method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0.} + assert self.adapter.feedable_dataset.get_feedable_item(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **kwargs) + + @gen.coroutine + def test_get_orders(self): + """ Checks if the .get_orders method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + temp_0_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0.} + temp_1_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 1., + 'dropout_rate': 0.} + + # Temperature == 1. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_1_kwargs) + else: + fetches = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_1_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_1_kwargs) + + assert (len(orders) == 3 and orders[2] == '') or (len(orders) == 2) + assert (policy_details['locs'] == locs) or (policy_details['locs'] == ['PAR', 'MAR']) + assert (len(policy_details['tokens']) == TOKENS_PER_ORDER * len(policy_details['locs']) # Token-based + or len(policy_details['tokens']) == len(policy_details['locs'])) # Order-based + assert len(policy_details['log_probs']) == len(policy_details['tokens']) + assert policy_details['draw_action'] in (True, False) + assert 0. <= policy_details['draw_prob'] <= 1. + + # Temperature == 0. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_0_kwargs) + else: + fetches = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_0_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_0_kwargs) + + assert (len(orders) == 3 and orders[2] == '') or (len(orders) == 2) + assert (policy_details['locs'] == locs) or (policy_details['locs'] == ['PAR', 'MAR']) + assert (len(policy_details['tokens']) == TOKENS_PER_ORDER * len(policy_details['locs']) # Token-based + or len(policy_details['tokens']) == len(policy_details['locs'])) # Order-based + assert len(policy_details['log_probs']) == len(policy_details['tokens']) + assert policy_details['draw_action'] in (True, False) + assert 0. <= policy_details['draw_prob'] <= 1. + + @gen.coroutine + def test_get_orders_with_beam(self): + """ Checks if the .get_orders method works with beam search """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + temp_0_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'use_beam': True} + temp_1_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 1., + 'dropout_rate': 0., + 'use_beam': True} + + # Temperature == 1. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_1_kwargs) + else: + fetches = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_1_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_1_kwargs) + + assert (len(orders) == 3 and orders[2] == '') or (len(orders) == 2) + assert (len(policy_details['tokens']) == TOKENS_PER_ORDER * len(policy_details['locs']) # Token-based + or len(policy_details['tokens']) == len(policy_details['locs'])) # Order-based + assert len(policy_details['log_probs']) == len(policy_details['tokens']) + assert policy_details['draw_action'] in (True, False) + assert 0. <= policy_details['draw_prob'] <= 1. + + # Temperature == 0. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_0_kwargs) + else: + fetches = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_0_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + orders, policy_details = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_0_kwargs) + + assert (len(orders) == 3 and orders[2] == '') or (len(orders) == 2) + assert (len(policy_details['tokens']) == TOKENS_PER_ORDER * len(policy_details['locs']) # Token-based + or len(policy_details['tokens']) == len(policy_details['locs'])) # Order-based + assert len(policy_details['log_probs']) == len(policy_details['tokens']) + assert policy_details['draw_action'] in (True, False) + assert 0. <= policy_details['draw_prob'] <= 1. + + @gen.coroutine + def test_get_orders_with_value(self): + """ Checks if the .get_orders method with state value works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + temp_0_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'with_state_value': True} + temp_1_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 1., + 'dropout_rate': 0., + 'with_state_value': True} + + # Temperature == 1. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + orders, policy_details, state_value = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_1_kwargs) + else: + fetches = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_1_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + orders, policy_details, state_value = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_1_kwargs) + + assert (len(orders) == 3 and orders[2] == '') or (len(orders) == 2) + assert (policy_details['locs'] == locs) or (policy_details['locs'] == ['PAR', 'MAR']) + assert (len(policy_details['tokens']) == TOKENS_PER_ORDER * len(policy_details['locs']) # Token-based + or len(policy_details['tokens']) == len(policy_details['locs'])) # Order-based + assert len(policy_details['log_probs']) == len(policy_details['tokens']) + assert policy_details['draw_action'] in (True, False) + assert 0. <= policy_details['draw_prob'] <= 1. + assert state_value != 0. + + # Temperature == 0. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + orders, policy_details, state_value = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_0_kwargs) + else: + fetches = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_0_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + orders, policy_details, state_value = yield self.adapter.get_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_0_kwargs) + + assert (len(orders) == 3 and orders[2] == '') or (len(orders) == 2) + assert (policy_details['locs'] == locs) or (policy_details['locs'] == ['PAR', 'MAR']) + assert (len(policy_details['tokens']) == TOKENS_PER_ORDER * len(policy_details['locs']) # Token-based + or len(policy_details['tokens']) == len(policy_details['locs'])) # Order-based + assert len(policy_details['log_probs']) == len(policy_details['tokens']) + assert policy_details['draw_action'] in (True, False) + assert 0. <= policy_details['draw_prob'] <= 1. + assert state_value != 0. + + @gen.coroutine + def test_get_beam_orders(self): + """ Checks if the .get_beam_orders method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + temp_1_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 1., + 'dropout_rate': 0., + 'use_beam': True, + 'with_state_value': True} + + # Temperature == 1. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + beam_orders, beam_probs, state_value = yield self.adapter.get_beam_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_1_kwargs) + else: + fetches = yield self.adapter.get_beam_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_1_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + beam_orders, beam_probs, state_value = yield self.adapter.get_beam_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_1_kwargs) + + assert len(beam_orders) == POLICY_BEAM_WIDTH + assert (len(beam_orders[0]) == 3 and beam_orders[0][2] == '') or len(beam_orders[0]) == 2 + assert len(beam_probs) == POLICY_BEAM_WIDTH + assert state_value != 0. + + @gen.coroutine + def test_get_beam_orders_with_value(self): + """ Checks if the .get_beam_orders method with state value works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + temp_1_kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 1., + 'dropout_rate': 0., + 'use_beam': True} + + # Temperature == 1. + # With and without prefetching + for use_prefetching in (False, True): + if not use_prefetching: + beam_orders, beam_probs = yield self.adapter.get_beam_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **temp_1_kwargs) + else: + fetches = yield self.adapter.get_beam_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **temp_1_kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + beam_orders, beam_probs = yield self.adapter.get_beam_orders(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **temp_1_kwargs) + + assert len(beam_orders) == POLICY_BEAM_WIDTH + assert (len(beam_orders[0]) == 3 and beam_orders[0][2] == '') or len(beam_orders[0]) == 2 + assert len(beam_probs) == POLICY_BEAM_WIDTH + + @gen.coroutine + def test_get_updated_policy_details(self): + """ Checks if the .get_updated_policy_details method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + power_name = 'FRANCE' + kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0.} + + # Testing with and without prefetching + for use_prefetching in (False, True): + orderable_locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + + if not use_prefetching: + submitted_orders, old_policy_details = yield self.adapter.get_orders(orderable_locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + new_details_1 = yield self.adapter.get_updated_policy_details(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + old_policy_details=old_policy_details, + **kwargs) + new_details_2 = yield self.adapter.get_updated_policy_details(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + submitted_orders=submitted_orders, + **kwargs) + else: + fetches = yield self.adapter.get_orders(orderable_locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + prefetch=True, + **kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + submitted_orders, old_policy_details = yield self.adapter.get_orders(orderable_locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **kwargs) + fetches = {} + fetches['a'] = yield self.adapter.get_updated_policy_details(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + old_policy_details=old_policy_details, + prefetch=True, + **kwargs) + fetches['b'] = yield self.adapter.get_updated_policy_details(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + submitted_orders=submitted_orders, + prefetch=True, + **kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + new_details_1 = yield self.adapter.get_updated_policy_details(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + old_policy_details=old_policy_details, + fetches=fetches['a'], + **kwargs) + new_details_2 = yield self.adapter.get_updated_policy_details(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + submitted_orders=submitted_orders, + fetches=fetches['b'], + **kwargs) + + # Validating policy_details using old_policy_details + assert new_details_1['locs'] + assert old_policy_details['locs'] == new_details_1['locs'] + assert old_policy_details['tokens'] == new_details_1['tokens'] + assert len(old_policy_details['log_probs']) == len(new_details_1['log_probs']) + assert old_policy_details['draw_action'] == new_details_1['draw_action'] + assert 0. <= old_policy_details['draw_prob'] <= 1. + assert 0. <= new_details_1['draw_prob'] <= 1. + if self.strict: + assert np.allclose(old_policy_details['log_probs'], new_details_1['log_probs'], atol=1e-4) + + # Validating policy_details using submitted_orders + assert new_details_2['locs'] == new_details_1['locs'] + assert new_details_2['tokens'] == new_details_1['tokens'] + if self.strict: + assert np.allclose(new_details_2['log_probs'], new_details_1['log_probs'], atol=1e-4) + assert new_details_2['draw_action'] in (True, False) + assert 0. <= new_details_2['draw_prob'] <= 1. + + @gen.coroutine + def test_expand(self): + """ Checks if the .expand method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['MAR', 'BUR'] + confirmed_orders = ['A PAR H'] + kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0.} + + # With and without prefetching + for use_prefetching in (False, True): + + if not use_prefetching: + orders_probs_log_probs = yield self.adapter.expand(confirmed_orders, + locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **kwargs) + else: + fetches = yield self.adapter.expand(confirmed_orders, + locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + orders_probs_log_probs = yield self.adapter.expand(confirmed_orders, + locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **kwargs) + + # Validating + assert len(orders_probs_log_probs) == len(locs) + assert len(orders_probs_log_probs['MAR']) > 1 + assert len(orders_probs_log_probs['BUR']) <= 1 + + # Making sure the probability of 'MAR' sums to 1. + cumulative_prob = sum([item.probability for item in orders_probs_log_probs['MAR']]) + assert 0.999 <= cumulative_prob < 1.001, 'Cumulative prob of %.8f does not sum to 1.' % cumulative_prob + + @gen.coroutine + def test_deterministic(self): + """ Makes sure the policy always return the same probs for the same query """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + _, orderable_locs = get_orderable_locs_for_powers(state_proto, get_map_powers(game.map)) + kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0.} + + for power_name in get_map_powers(game.map): + orders_probs_log_probs_1 = yield self.adapter.expand([], + orderable_locs[power_name], + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + orders_probs_log_probs_2 = yield self.adapter.expand([], + orderable_locs[power_name], + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + + for loc in orders_probs_log_probs_1: + assert orders_probs_log_probs_1[loc] == orders_probs_log_probs_2[loc] + + @gen.coroutine + def test_get_state_value(self): + """ Checks if the .get_state_value method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + kwargs = {'player_seed': 0, + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0.} + + # With and without prefetching + for use_prefetching in (False, True): + + if not use_prefetching: + state_value = yield self.adapter.get_state_value(state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **kwargs) + else: + fetches = yield self.adapter.get_state_value(state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + prefetch=True, + **kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + state_value = yield self.adapter.get_state_value(state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + fetches=fetches, + **kwargs) + + assert state_value != 0. + + def test_graph_size(self): + """ Tests the graph size """ + from diplomacy_research.utils.tensorflow import tf + total_size = 0 + for var in self.graph.get_collection(tf.GraphKeys.GLOBAL_VARIABLES): + total_size += int_prod(var.shape.as_list()) * var.dtype.size + total_size_mb = total_size / (1024. ** 2) + assert total_size_mb < 750., 'Graph too large - Maximum: 750MB - Currently: %.2f MB' % total_size_mb diff --git a/diplomacy_research/models/policy/tests/policy_builder_test_setup.py b/diplomacy_research/models/policy/tests/policy_builder_test_setup.py new file mode 100644 index 0000000..4f02212 --- /dev/null +++ b/diplomacy_research/models/policy/tests/policy_builder_test_setup.py @@ -0,0 +1,71 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generic class to tests for policy builder correctness """ +from diplomacy import Game +from diplomacy_research.models.state_space import extract_state_proto, extract_phase_history_proto, \ + extract_possible_orders_proto + +class PolicyBuilderTestSetup(): + """ Creates a testable setup to test a policy dataset builder """ + + def __init__(self, dataset_builder): + """ Constructor + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + """ + self.dataset_builder = dataset_builder + + def run_tests(self): + """ Run all tests """ + self.run_tests_sync() + + def run_tests_sync(self): + """ Run tests """ + self.test_paths() + self.test_get_feedable_item() + self.test_proto_generation_callable() + self.test_required_features() + + def test_paths(self): + """ Checks if the training, validation and index paths are set """ + assert self.dataset_builder.training_dataset_path + assert self.dataset_builder.validation_dataset_path + assert self.dataset_builder.dataset_index_path + + def test_get_feedable_item(self): + """ Checks if the .get_feedable_item method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + locs = ['PAR', 'MAR', 'BUR'] + kwargs = {'player_seed': 0, 'noise': 0., 'temperature': 0., 'dropout_rate': 0.} + assert self.dataset_builder.get_feedable_item(locs, + state_proto, + 'FRANCE', + phase_history_proto, + possible_orders_proto, + **kwargs) + + def test_proto_generation_callable(self): + """ Checks if the .proto_generation_callable is implemented """ + proto_callable = self.dataset_builder.proto_generation_callable + assert callable(proto_callable) + + def test_required_features(self): + """ Checks that features required are present """ + proto_fields = self.dataset_builder.get_proto_fields() + assert 'request_id' in proto_fields + assert 'board_state' in proto_fields + assert 'current_power' in proto_fields diff --git a/diplomacy_research/models/policy/token_based/__init__.py b/diplomacy_research/models/policy/token_based/__init__.py new file mode 100644 index 0000000..8fdb7e6 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/__init__.py @@ -0,0 +1,17 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Token-Based Policy Model """ +from .adapter import PolicyAdapter +from .model import TokenBasedPolicyModel, load_args +from .dataset.base import BaseDatasetBuilder diff --git a/diplomacy_research/models/policy/token_based/adapter.py b/diplomacy_research/models/policy/token_based/adapter.py new file mode 100644 index 0000000..6e93690 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/adapter.py @@ -0,0 +1,730 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" TokenBased Policy Adapter + - Implements an instance of a policy adapter to connect to a token_based model +""" +from collections import OrderedDict +import logging +import numpy as np +from numpy.random import choice +from tornado import gen +from diplomacy_research.models.policy.base_policy_adapter import BasePolicyAdapter +from diplomacy_research.models.policy.base_policy_model import OrderProbTokenLogProbs, TRAINING_DECODER, \ + GREEDY_DECODER, SAMPLE_DECODER +from diplomacy_research.models.policy.token_based.model import TokenBasedPolicyModel +from diplomacy_research.models.state_space import token_to_ix, get_order_tokens, TOKENS_PER_ORDER, GO_ID, EOS_ID, \ + PAD_ID, get_orderable_locs_for_powers, ix_to_token +from diplomacy_research.proto.diplomacy_proto.common_pb2 import MapStringList +from diplomacy_research.utils.cluster import CompletedFuture, process_fetches_dict +from diplomacy_research.utils.model import logsumexp, apply_temperature, strip_keys, assert_normalized + +# Constants +LOGGER = logging.getLogger(__name__) + +class PolicyAdapter(BasePolicyAdapter): + """ Adapter to connect to a TokenBased model """ + + @staticmethod + def get_signature(): + """ Returns the signature of all the possible calls using this adapter + Format: { method_signature_name: {'placeholders': {name: (value, numpy_dtype)}, + 'outputs': [output_name, output_name] } } + e.g. {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs: ['selected_tokens', 'log_probs', 'draw_prob']}} + """ + return {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs': ['selected_tokens', + 'log_probs', + 'draw_prob']}, + 'policy_beam_search': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['beam_tokens', + 'beam_log_probs', + 'draw_prob']}, + 'policy_evaluate_with_state_value': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs': ['selected_tokens', + 'log_probs', + 'draw_prob', + 'state_value']}, + 'policy_beam_search_with_state_value': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['beam_tokens', + 'beam_log_probs', + 'draw_prob', + 'state_value']}, + 'policy_expand': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['logits']}, + 'policy_log_probs': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['log_probs', 'draw_prob']}, + 'policy_get_value': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['state_value']}} + + def tokenize(self, order): + """ Returns the tokens use by the adapter for a specific order """ + try: + tokens = [token_to_ix(order_token) for order_token in get_order_tokens(order)] + [EOS_ID] + tokens += [PAD_ID] * (TOKENS_PER_ORDER - len(tokens)) + return tokens + except KeyError: + LOGGER.warning('[tokenize] Order "%s" is invalid. Skipping.') + return [EOS_ID] + [PAD_ID] * (TOKENS_PER_ORDER - 1) + + def _decode_policy(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Returns the output of the Policy Model decoder + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: Boolean that indicates that we want to use a beam search, + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: A future (fetches) to yield on. + """ + is_prefetching = kwargs.get('prefetch', False) + + # No locations provided, we can return early + if not locs: + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + LOGGER.warning('The method .get_feedable_item() did not return an item to feed to the model.') + LOGGER.warning('Make sure you have provided the correct locs and a list of possible orders') + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Queue + with_state_value = kwargs.get('with_state_value', False) + use_beam = kwargs.get('use_beam', False) + queue_name = {(False, False): 'policy_evaluate', + (False, True): 'policy_evaluate_with_state_value', + (True, False): 'policy_beam_search', + (True, True): 'policy_beam_search_with_state_value'}[(use_beam, with_state_value)] + return self.feedable_dataset.get_results(queue_name, feedable_item, **kwargs) + + @staticmethod + def _process_fetches(decode_fetches): + """ Decodes the fetches returned by self._decode_policy() + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + tokens, log_probs = decode_fetches[:2] + decoded_results = TokenBasedPolicyModel._decode(selected_tokens=np.array([tokens]), # pylint: disable=protected-access + log_probs=np.array([log_probs])) + return decoded_results['decoded_orders'][0] + + @staticmethod + def _process_single_beam_fetches(decode_fetches, temperature=0.): + """ Decodes the beam fetches returned self._decode_policy() - This samples the beam to use based on a temp. + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + beam_tokens, beam_log_probs = decode_fetches[:2] + + # Computing probabilities after applying temperature + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=temperature).tolist() + nb_probs = len(probs) + + # Sampling according to probs + selected_beam_id = choice(range(nb_probs), p=assert_normalized(adj_probs)) + + # Decoding that specific beam + # Assigning probability mass equally over all orders in beam + selected_beam_tokens = np.array([beam_tokens[selected_beam_id]]) + selected_beam_log_probs = np.zeros_like(selected_beam_tokens) + decoded_results = TokenBasedPolicyModel._decode(selected_tokens=selected_beam_tokens, # pylint: disable=protected-access + log_probs=selected_beam_log_probs)['decoded_orders'][0] + + # Adjusting log probs to make it uniform over all locs + nb_locs = len(decoded_results) + adj_log_probs = beam_log_probs[selected_beam_id] / max(1, nb_locs * TOKENS_PER_ORDER) + decoded_results = {loc: OrderProbTokenLogProbs(order=decoded_results[loc].order, + probability=decoded_results[loc].probability, + log_probs=[adj_log_probs] * TOKENS_PER_ORDER) + for loc in decoded_results} + return decoded_results + + @gen.coroutine + def get_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds the orders to submit at each location given the current state + Orderings are calculated by defining an ordering and computing the next unit order conditioned on the + orders already selected + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: Boolean that indicates that we want to use a beam search, + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False and with_state_value=False (default), a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + - if prefetch=False and with_state_value=True, a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + with_state_value = kwargs.get('with_state_value', False) + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + selected_orders = [] + policy_details = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + state_value = 0. + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] + if decode_fetches is None: + return tuple([selected_orders, policy_details] + ([state_value] if with_state_value else [])) + + if kwargs.get('use_beam', False): + results = self._process_single_beam_fetches(decode_fetches, temperature=kwargs.get('temperature', 0.)) + else: + results = self._process_fetches(decode_fetches) + + # Building policy details based on returned locations + for loc in results: + order_prob_token_log_probs = results[loc] + + # Splitting + order = order_prob_token_log_probs.order + log_probs = order_prob_token_log_probs.log_probs + + # Building the policy details + selected_orders += [order] + policy_details['locs'] += [loc] + policy_details['tokens'] += self.tokenize(order) + policy_details['log_probs'] += list(log_probs) + + # Getting draw action and probability + policy_details['draw_action'] = bool(decode_fetches[2] >= 0.5) + policy_details['draw_prob'] = decode_fetches[2] + + # Getting state value + if with_state_value: + state_value = decode_fetches[-1] + + # Returning sampled orders with the policy details + return tuple([selected_orders, policy_details] + ([state_value] if with_state_value else [])) + + @gen.coroutine + def get_beam_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds all the beams with their probabilities returned by the diverse beam search + Beams are ordered by score (highest first). + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False and with_state_value=False (default), a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + - if prefetch=False and with_state_value=True, a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + 3) The state value for the given state + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + with_state_value = kwargs.get('with_state_value', False) + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + use_beam=True, + **strip_keys(kwargs, ['use_beam'])) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + beams, adj_probs, state_value = [], [], 0. + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] # (beam_orders, beam_log_probs, draw, value) + if decode_fetches is None: + return tuple([beams, adj_probs] + ([state_value] if with_state_value else [])) + + # Computing adj probabilities + beam_orders, beam_log_probs = decode_fetches[:2] + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=1.).tolist() + + # Decoding + for beam_candidates in beam_orders: + orders_for_this_candidate = [] + nb_locs = len(beam_candidates) // TOKENS_PER_ORDER + + # Decoding each token + for loc_ix in range(nb_locs): + order_tokens = beam_candidates[loc_ix * TOKENS_PER_ORDER:(loc_ix + 1) * TOKENS_PER_ORDER] + order_str = ' '.join([ix_to_token(token) for token in order_tokens if token > EOS_ID]) + if order_str: + orders_for_this_candidate += [order_str] + beams += [orders_for_this_candidate] + + # Getting state value + if with_state_value: + state_value = decode_fetches[-1] + + # Returning + return tuple([beams, adj_probs] + ([state_value] if with_state_value else [])) + + @gen.coroutine + def get_updated_policy_details(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + old_policy_details=None, submitted_orders=None, **kwargs): + """ Computes the current policy details (locs, tokens, log_probs) under the current model + Either one of 1) old_policy_details or 2) submitted_orders must be submitted to extract the locs and tokens + + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param old_policy_details: (Optional) Some policy details + ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + :param submitted_orders: (Optional) A list of submitted orders ['A PAR - BUR', 'A MAR H'] + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, The corresponding updated policy details + ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + """ + assert self.feedable_dataset.has_queue('policy_log_probs'), 'Unable to get supervised log probs' + + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_updated_policy_details' + + # Setting tokens and actual locs + if old_policy_details: + actual_locs = old_policy_details['locs'] + tokens = old_policy_details['tokens'] + + # Using submitted orders + else: + actual_locs, tokens = [], [] + for order in submitted_orders: + actual_locs += [order.split()[1][:3]] if len(order.split()) >= 2 else [] + tokens += self.tokenize(order) + + # Getting fetches + if not is_postfetching: + + if not old_policy_details and not submitted_orders: + LOGGER.warning('Unable to compute policy details without old policy details or submitted orders.') + ret_val = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + return {'%s/ret_val' % fetch_prefix: CompletedFuture(ret_val)} if is_prefetching else ret_val + + # In adjustment phase, the locs are all the orderable locs + if state_proto.name[-1] == 'A': + locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + elif old_policy_details: + locs = old_policy_details['locs'] + else: + locs = [order.split()[1][:3] for order in submitted_orders if len(order.split()) >= 2] + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + ret_val = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + return {'%s/ret_val' % fetch_prefix: CompletedFuture(ret_val)} if is_prefetching else ret_val + + feedable_item['decoder_inputs'] = [GO_ID] + tokens + feedable_item['decoder_lengths'] = len(tokens) + + # Querying model + queue_name = 'policy_log_probs' + fetches['%s/log_probs_fetches' % fetch_prefix] = self.feedable_dataset.get_results(queue_name, + feedable_item, + **kwargs) + + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Processing fetches + if '%s/ret_val' % fetch_prefix in fetches: + return fetches['%s/ret_val' % fetch_prefix] + + new_log_probs, new_draw_prob = fetches['%s/log_probs_fetches' % fetch_prefix] + new_log_probs = new_log_probs[:len(actual_locs) * TOKENS_PER_ORDER].tolist() + + # Validating + assert submitted_orders is not None or len(new_log_probs) == len(old_policy_details['log_probs']) + + # Returning + return {'locs': actual_locs, + 'tokens': tokens, + 'log_probs': new_log_probs, + 'draw_action': old_policy_details['draw_action'] if old_policy_details else bool(new_draw_prob >= 0.5), + 'draw_prob': new_draw_prob} + + @gen.coroutine + def expand(self, confirmed_orders, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Computes the conditional probability of possible orders for each loc given the confirmed orders. + :param confirmed_orders: The list of orders on which to condition the probs (e.g. ['A PAR H', 'A MAR - SPA'] + :param locs: The locations for which we want to compute probabilities + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the probabilities + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, + A dictionary with every location in locs as key, and a list of tuples where each tuple is composed + of 1) an order, 2) the order conditional probability, 3) the conditional log probs of each token + e.g. {'PAR': [('A PAR H', 0.000, [...]), ('A PAR - BUR', 0.000, [...]), ...]} + """ + # pylint: disable=too-many-nested-blocks + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'expand' + + # Locations + locs = [loc[:3] for loc in locs] + confirmed_locs = [order.split()[1][:3] for order in confirmed_orders] + + # Getting fetches + if not is_postfetching: + + confirmed_tokens = [] + for order in confirmed_orders: + confirmed_tokens += self.tokenize(order) + + # Building a list of conditional probs we want to expand + # e.g. A PAR H, A PAR - MAR, A PAR - BUR + # we want P('H' | 'A PAR'), P('MAR', 'A PAR -'), ... + + # 1) We compute all the prefix (RHS of the prob) and we only expand where count is > 1 + prefix_count = {} # {prefix => count} + for loc in locs: + for order in possible_orders_proto[loc].value: + tokens = [-1 + -1 * locs.index(loc)] + self.tokenize(order) # e.g. [-2, 25, 4, 25, ...] + nb_tokens = len(tokens) + for token_ix in range(1, nb_tokens): + prefix = tuple(tokens[:token_ix]) + prefix_count[prefix] = prefix_count.get(prefix, 0) + 1 + + # 2) Building the list of feedable items only for probs we need to expand + feedable_items = OrderedDict() # {prefix => feedable_item} + items_to_expand = OrderedDict() # {prefix => set of next available token} + for loc in locs: # pylint: disable=too-many-nested-blocks + for order in possible_orders_proto[loc].value: + tokens = [-1 + -1 * locs.index(loc)] + self.tokenize(order) # e.g. [-2, 25, 4, 25, ...] + nb_tokens = len(tokens) + + for token_ix in range(1, nb_tokens): + prefix = tuple(tokens[:token_ix]) + if prefix_count.get(prefix) > 1 and prefix not in feedable_items: + feedable_item = self.feedable_dataset.get_feedable_item(confirmed_locs + [loc], + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + + # The teacher forcing is GO_ID, the confirmed orders prefix, the actual prefix, and a dummy + feedable_item['decoder_inputs'] = [GO_ID] + confirmed_tokens + list(prefix[1:]) + [PAD_ID] + feedable_item['decoder_lengths'] = len(confirmed_tokens) + len(prefix[1:]) + 1 + + # Keeping a list of orders using the prefix + for possible_order in possible_orders_proto[loc].value: + new_tokens = [-1 + -1 * locs.index(loc)] + self.tokenize(possible_order) + if prefix == tuple(new_tokens[:token_ix]): + items_to_expand.setdefault(prefix, set()) + items_to_expand[prefix].add(new_tokens[token_ix]) + + # Storing feedable item + feedable_items[prefix] = feedable_item + + # 3) Removing items_to_expand with only 1 items + # We know for sure the probability will be 100% + for prefix in list(items_to_expand.keys()): + if len(items_to_expand[prefix]) == 1: + del items_to_expand[prefix] + del feedable_items[prefix] + + # 4) Running all the feedable items + queue_name = 'policy_expand' + fetches['%s/items_to_expand' % fetch_prefix] = CompletedFuture(items_to_expand) + fetches['%s/results' % fetch_prefix] = [self.feedable_dataset.get_results(queue_name, item, **kwargs) + for item in feedable_items.values()] + + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Processing fetches + def softmax(softmax_logits): + """ Compute softmax values for the logits """ + e_x = np.exp(softmax_logits - softmax_logits.max(axis=-1, keepdims=True)) + return e_x / e_x.sum(axis=-1, keepdims=True) + + items_to_expand = fetches['%s/items_to_expand' % fetch_prefix] + results = fetches['%s/results' % fetch_prefix] + (logits, ) = zip(*results) + + # 5) Computing probs + probs = {} # {prefix: {loc: prob}} + for prefix, logit in zip(items_to_expand.keys(), logits): + + # IndexError - Ignoring prefix + if TOKENS_PER_ORDER * len(confirmed_locs) + len(prefix) - 1 >= len(logit): + LOGGER.error('Got %d logits, but trying to access logit at index %d. Ignoring prefix.', + len(logit), TOKENS_PER_ORDER * len(confirmed_locs) + len(prefix) - 1) + LOGGER.error('Prefix: %s - Confirmed locs: %s', prefix, confirmed_locs) + continue + + tokens_to_expand = list(sorted(items_to_expand[prefix])) + token_logits = logit[TOKENS_PER_ORDER * len(confirmed_locs) + len(prefix) - 1] + + # Only selecting the logits that we expect + # There is currently a bug in the tokenization that could return additional tokens (Issue #331) + masked_logits = [] + for token in tokens_to_expand: + masked_logits += [token_logits[token]] + token_probs = softmax(np.array(masked_logits, dtype=np.float32)) + + # Computing the correct probabilities + probs[prefix] = {} + for token_ix, token in enumerate(tokens_to_expand): + probs[prefix][token] = token_probs[token_ix] + + # 6) Computing the prob of each order at each location + results = {} + for loc in locs: + results[loc] = [] + + # Processing each possible order + for order in possible_orders_proto[loc].value: + tokens = [-1 + -1 * locs.index(loc)] + self.tokenize(order) + nb_tokens = len(tokens) + order_prob = 1. + order_log_probs = [] + + # Computing the total order probability and each token log probs + for token_ix in range(1, nb_tokens): + prefix = tuple(tokens[:token_ix]) + if prefix in probs and tokens[token_ix] in probs[prefix]: + order_prob *= probs[prefix][tokens[token_ix]] + order_log_probs += [np.log(np.maximum(probs[prefix][tokens[token_ix]], 1e-8))] + else: + order_log_probs += [0.] + + results[loc] += [OrderProbTokenLogProbs(order=order, + probability=order_prob, + log_probs=order_log_probs)] + + # Sorting loc by probability + results[loc] = list(sorted(results[loc], key=lambda item: item.probability, reverse=True)) + + # Returning + return results + + @gen.coroutine + def get_state_value(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, **kwargs): + """ Computes the value of the current state for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, a float representing the value of the state of the game to the specified power + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_state_value' + + # Getting fetches + if not is_postfetching: + + if not self.has_value_model: + LOGGER.error('This model does not have a value function. Returning a value of 0.') + return {'%s/ret_val' % fetch_prefix: CompletedFuture(0.)} if is_prefetching else 0. + + # Finding orderable locations + locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + + # Building a list of empty possible orders + # The value function should at most only use the first step of the decoder (time step 0) + # So, we don't need to apply a mask + if possible_orders_proto is None: + possible_orders_proto = MapStringList().value # pylint: disable=no-member + for loc in locs: + possible_orders_proto[loc].value.extend([]) + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + LOGGER.warning('The method .get_feedable_item() did not return an item to feed to the model.') + LOGGER.warning('Make sure you have provided the correct locs and a list of possible orders') + LOGGER.warning('Returning a value of 0.') + return {'%s/ret_val' % fetch_prefix: CompletedFuture(0.)} if is_prefetching else 0. + + # Selecting queue + queue_name = 'policy_get_value' + fetches['%s/state_value' % fetch_prefix] = self.feedable_dataset.get_results(queue_name, + feedable_item, + **kwargs) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Processing fetches + if '%s/ret_val' % fetch_prefix in fetches: + return fetches['%s/ret_val' % fetch_prefix] + + # Returning the fetched state value + (state_value,) = fetches['%s/state_value' % fetch_prefix] + return state_value diff --git a/diplomacy_research/models/policy/token_based/dataset/__init__.py b/diplomacy_research/models/policy/token_based/dataset/__init__.py new file mode 100644 index 0000000..c388d03 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/__init__.py @@ -0,0 +1,18 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Token Based Builders """ +from .no_press_all import DatasetBuilder as NoPressAllDatasetBuilder +from .no_press_large import DatasetBuilder as NoPressLargeDatasetBuilder +from .no_press_value_all import DatasetBuilder as NoPressValueAllDatasetBuilder +from .no_press_value_large import DatasetBuilder as NoPressValueLargeDatasetBuilder diff --git a/diplomacy_research/models/policy/token_based/dataset/base.py b/diplomacy_research/models/policy/token_based/dataset/base.py new file mode 100644 index 0000000..3e53379 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/base.py @@ -0,0 +1,387 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Token-Based Base Dataset Builder + - Base class responsible for generating the protocol buffers to be used by the model +""" +import logging +import numpy as np +from diplomacy import Map +from diplomacy_research.models.datasets.base_builder import FixedProtoField, VarProtoField, SparseProtoField +from diplomacy_research.models.policy.base_policy_builder import BasePolicyBuilder +from diplomacy_research.models.self_play.reward_functions import DefaultRewardFunction, DEFAULT_GAMMA +from diplomacy_research.models.state_space import get_order_tokens, token_to_ix, get_token_based_mask,\ + proto_to_board_state, get_possible_orders_for_powers, get_issued_orders_for_powers, TOKENS_PER_ORDER, PAD_ID,\ + GO_ID, EOS_ID, VOCABULARY_SIZE, NB_NODES, NB_FEATURES, NB_ORDERS_FEATURES, NB_SUPPLY_CENTERS, \ + POWER_VOCABULARY_KEY_TO_IX, NB_PREV_ORDERS, NB_PREV_ORDERS_HISTORY, get_board_alignments, \ + get_orderable_locs_for_powers, get_current_season, proto_to_prev_orders_state + +# Constants +LOGGER = logging.getLogger(__name__) + +class BaseDatasetBuilder(BasePolicyBuilder): + """ This object is responsible for maintaining the data and feeding it into the model """ + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this dataset builder """ + # 5 tokens for each supply center + # The decoder_input as an additional [GO] token + targets_length = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + + # Creating proto fields + proto_fields = { + 'request_id': FixedProtoField([], None), + 'player_seed': FixedProtoField([], np.int32), + 'board_state': FixedProtoField([NB_NODES, NB_FEATURES], np.uint8), + 'board_alignments': VarProtoField([NB_NODES * targets_length], np.uint8), + 'prev_orders_state': FixedProtoField([NB_PREV_ORDERS, NB_NODES, NB_ORDERS_FEATURES], np.uint8), + 'decoder_inputs': VarProtoField([targets_length + 1], np.int32), + 'decoder_lengths': FixedProtoField([], np.int32), + 'decoder_mask': SparseProtoField([targets_length, VOCABULARY_SIZE, VOCABULARY_SIZE], np.bool), + 'noise': FixedProtoField([], np.float32), + 'temperature': FixedProtoField([], np.float32), + 'dropout_rate': FixedProtoField([], np.float32), + 'current_power': FixedProtoField([], np.int32), + 'current_season': FixedProtoField([], np.int32), + 'draw_target': FixedProtoField([], np.float32), + 'value_target': FixedProtoField([], np.float32) + } + return proto_fields + + @staticmethod + def get_feedable_item(locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Computes and return a feedable item (to be fed into the feedable queue) + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :return: A feedable item, with feature names as key and numpy arrays as values + """ + # pylint: disable=too-many-branches + # Converting to state space + map_object = Map(state_proto.map) + board_state = proto_to_board_state(state_proto, map_object) + + # Building the decoder length + # For adjustment phase, we restrict the number of builds/disbands to what is allowed by the game engine + in_adjustment_phase = state_proto.name[-1] == 'A' + nb_builds = state_proto.builds[power_name].count + nb_homes = len(state_proto.builds[power_name].homes) + + # If we are in adjustment phase, making sure the locs are the orderable locs (and not the policy locs) + if in_adjustment_phase: + orderable_locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + if sorted(locs) != sorted(orderable_locs): + if locs: + LOGGER.warning('Adj. phase requires orderable locs. Got %s. Expected %s.', locs, orderable_locs) + locs = orderable_locs + + # WxxxA - We can build units + # WxxxA - We can disband units + # Other phase + if in_adjustment_phase and nb_builds >= 0: + decoder_length = TOKENS_PER_ORDER * min(nb_builds, nb_homes) + elif in_adjustment_phase and nb_builds < 0: + decoder_length = TOKENS_PER_ORDER * abs(nb_builds) + else: + decoder_length = TOKENS_PER_ORDER * len(locs) + + # Building the decoder mask + coords = set() + if possible_orders_proto: + + # Adjustment phase, we allow all builds / disbands in all positions + if in_adjustment_phase: + + # Building a list of all orders for all locations + adj_orders = [] + for loc in locs: + adj_orders += possible_orders_proto[loc].value + + # Building a list of coordinates for the decoder mask matrix + for loc_ix in range(decoder_length): + coords = get_token_based_mask(adj_orders, offset=loc_ix * TOKENS_PER_ORDER, coords=coords) + + # Regular phase, we mask for each location + else: + for loc_ix, loc in enumerate(locs): + coords = get_token_based_mask(possible_orders_proto[loc].value or [''], + offset=loc_ix * TOKENS_PER_ORDER, + coords=coords) + + # Prev orders state + prev_orders_state = [] + for phase_proto in reversed(phase_history_proto): + if len(prev_orders_state) == NB_PREV_ORDERS: + break + if phase_proto.name[-1] == 'M': + prev_orders_state = [proto_to_prev_orders_state(phase_proto, map_object)] + prev_orders_state + for _ in range(NB_PREV_ORDERS - len(prev_orders_state)): + prev_orders_state = [np.zeros((NB_NODES, NB_ORDERS_FEATURES), dtype=np.uint8)] + prev_orders_state + prev_orders_state = np.array(prev_orders_state) + + # Building (order) decoder inputs [GO_ID] + [PAD_IDs] + decoder_inputs = [GO_ID] + + # kwargs + player_seed = kwargs.get('player_seed', 0) + noise = kwargs.get('noise', 0.) + temperature = kwargs.get('temperature', 0.) + dropout_rate = kwargs.get('dropout_rate', 0.) + + # Building feedable data + item = { + 'player_seed': player_seed, + 'board_state': board_state, + 'board_alignments': get_board_alignments(locs, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=TOKENS_PER_ORDER, + decoder_length=decoder_length), + 'prev_orders_state': prev_orders_state, + 'decoder_inputs': decoder_inputs, + 'decoder_lengths': decoder_length, + 'decoder_mask_indices': coords, + 'noise': noise, + 'temperature': temperature, + 'dropout_rate': dropout_rate, + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(state_proto) + } + + # Returning + return item + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + raise NotImplementedError() + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def get_policy_data(saved_game_proto, power_names, top_victors): + """ Computes the proto to save in tf.train.Example as a training example for the policy network + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param power_names: The list of powers for which we want the policy data + :param top_victors: The list of powers that ended with more than 25% of the supply centers + :return: A dictionary with key: the phase_ix + with value: A dict with the power_name as key and a dict with the example fields as value + """ + # pylint: disable=too-many-branches + nb_phases = len(saved_game_proto.phases) + policy_data = {phase_ix: {} for phase_ix in range(nb_phases - 1)} + game_id = saved_game_proto.id + map_object = Map(saved_game_proto.map) + + # Determining if we have a draw + nb_sc_to_win = len(map_object.scs) // 2 + 1 + has_solo_winner = max([len(saved_game_proto.phases[-1].state.centers[power_name].value) + for power_name in saved_game_proto.phases[-1].state.centers]) >= nb_sc_to_win + survivors = [power_name for power_name in saved_game_proto.phases[-1].state.centers + if saved_game_proto.phases[-1].state.centers[power_name].value] + has_draw = not has_solo_winner and len(survivors) >= 2 + + # Processing all phases (except the last one + current_year = 0 + for phase_ix in range(nb_phases - 1): + + # Building a list of orders of previous phases + previous_orders_states = [np.zeros((NB_NODES, NB_ORDERS_FEATURES), dtype=np.uint8)] * NB_PREV_ORDERS + for phase_proto in saved_game_proto.phases[max(0, phase_ix - NB_PREV_ORDERS_HISTORY):phase_ix]: + if phase_proto.name[-1] == 'M': + previous_orders_states += [proto_to_prev_orders_state(phase_proto, map_object)] + previous_orders_states = previous_orders_states[-NB_PREV_ORDERS:] + prev_orders_state = np.array(previous_orders_states) + + # Parsing each requested power in the specified phase + phase_proto = saved_game_proto.phases[phase_ix] + phase_name = phase_proto.name + state_proto = phase_proto.state + phase_board_state = proto_to_board_state(state_proto, map_object) + + # Increasing year for every spring or when the game is completed + if phase_proto.name == 'COMPLETED' or (phase_proto.name[0] == 'S' and phase_proto.name[-1] == 'M'): + current_year += 1 + + for power_name in power_names: + phase_issued_orders = get_issued_orders_for_powers(phase_proto, [power_name]) + phase_possible_orders = get_possible_orders_for_powers(phase_proto, [power_name]) + phase_draw_target = 1. if has_draw and phase_ix == (nb_phases - 2) and power_name in survivors else 0. + + # Data to use when not learning a policy + blank_policy_data = {'board_state': phase_board_state, + 'prev_orders_state': prev_orders_state, + 'draw_target': phase_draw_target} + + # Power is not a top victor - We don't want to learn a policy from him + if power_name not in top_victors: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Finding the orderable locs + orderable_locations = list(phase_issued_orders[power_name].keys()) + + # Skipping power for this phase if we are only issuing Hold + for order_loc, order in phase_issued_orders[power_name].items(): + order_tokens = get_order_tokens(order) + if len(order_tokens) >= 2 and order_tokens[1] != 'H': + break + else: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Removing orderable locs where orders are not possible (i.e. NO_CHECK games) + for order_loc, order in phase_issued_orders[power_name].items(): + if order not in phase_possible_orders[order_loc]: + if 'NO_CHECK' not in saved_game_proto.rules: + LOGGER.warning('%s not in all possible orders. Phase %s - Game %s.', order, phase_name, game_id) + orderable_locations.remove(order_loc) + + # Determining if we are in an adjustment phase + in_adjustment_phase = state_proto.name[-1] == 'A' + nb_builds = state_proto.builds[power_name].count + nb_homes = len(state_proto.builds[power_name].homes) + + # WxxxA - We can build units + # WxxxA - We can disband units + # Other phase + if in_adjustment_phase and nb_builds >= 0: + decoder_length = TOKENS_PER_ORDER * min(nb_builds, nb_homes) + elif in_adjustment_phase and nb_builds < 0: + decoder_length = TOKENS_PER_ORDER * abs(nb_builds) + else: + decoder_length = TOKENS_PER_ORDER * len(orderable_locations) + + # Not all units were disbanded - Skipping this power as we can't learn the orders properly + if in_adjustment_phase and nb_builds < 0 and len(orderable_locations) < abs(nb_builds): + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Not enough orderable locations for this power, skipping + if not orderable_locations or not decoder_length: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Encoding decoder inputs - Padding each order to 6 tokens + # The decoder length should be a multiple of 6, since each order is padded to 6 tokens + decoder_inputs = [GO_ID] + for loc in orderable_locations[:]: + order = phase_issued_orders[power_name][loc] + try: + tokens = [token_to_ix(order_token) for order_token in get_order_tokens(order)] + [EOS_ID] + tokens += [PAD_ID] * (TOKENS_PER_ORDER - len(tokens)) + decoder_inputs += tokens + except KeyError: + LOGGER.warning('[data_generator] Order "%s" is not valid. Skipping location.', order) + orderable_locations.remove(loc) + + # Adding WAIVE orders + if in_adjustment_phase and nb_builds > 0: + waive_tokens = [token_to_ix('WAIVE'), EOS_ID] + [PAD_ID] * (TOKENS_PER_ORDER - 2) + decoder_inputs += waive_tokens * (min(nb_builds, nb_homes) - len(orderable_locations)) + decoder_length = min(decoder_length, TOKENS_PER_ORDER * NB_SUPPLY_CENTERS) + + # Getting decoder mask + coords = set() + + # Adjustment phase, we allow all builds / disbands in all positions + if in_adjustment_phase: + build_disband_locs = list(get_possible_orders_for_powers(phase_proto, [power_name]).keys()) + phase_board_alignments = get_board_alignments(build_disband_locs, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=TOKENS_PER_ORDER, + decoder_length=decoder_length) + + # Building a list of all orders for all locations + adj_orders = [] + for loc in build_disband_locs: + adj_orders += phase_possible_orders[loc] + + # Not learning builds for BUILD_ANY + if nb_builds > 0 and 'BUILD_ANY' in state_proto.rules: + adj_orders = [] + + # No orders found - Skipping + if not adj_orders: + policy_data[phase_ix][power_name] = blank_policy_data + continue + + # Building a list of coordinates for the decoder mask matrix + for loc_ix in range(decoder_length): + coords = get_token_based_mask(adj_orders, offset=loc_ix * TOKENS_PER_ORDER, coords=coords) + + # Regular phase, we mask for each location + else: + phase_board_alignments = get_board_alignments(orderable_locations, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=TOKENS_PER_ORDER, + decoder_length=decoder_length) + for loc_ix, loc in enumerate(orderable_locations): + coords = get_token_based_mask(phase_possible_orders[loc] or [''], + offset=loc_ix * TOKENS_PER_ORDER, + coords=coords) + + # Saving results + # No need to return temperature, current_power, current_season + policy_data[phase_ix][power_name] = {'board_state': phase_board_state, + 'board_alignments': phase_board_alignments, + 'prev_orders_state': prev_orders_state, + 'decoder_inputs': decoder_inputs, + 'decoder_lengths': decoder_length, + 'decoder_mask_indices': list(sorted(coords)), + 'draw_target': phase_draw_target} + + # Returning + return policy_data + +def get_value_data(saved_game_proto, power_names): + """ Computes the proto to save in tf.train.Example as a training example for the value network + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param power_names: The list of powers for which we want the policy data + :return: A dictionary with key: the phase_ix + with value: A dict with the power_name as key and a dict with the example fields as value + """ + nb_phases = len(saved_game_proto.phases) + value_data = {phase_ix: {} for phase_ix in range(nb_phases - 1)} + + # Computing the value of each phase + for power_name in power_names: + value_targets = [] + current_value = 0. + rewards = DefaultRewardFunction().get_episode_rewards(saved_game_proto, power_name) + for reward in reversed(rewards): + current_value = reward + DEFAULT_GAMMA * current_value + value_targets += [current_value] + value_targets += [0] + + # Computing the value data + for phase_ix in range(nb_phases - 1): + value_data[phase_ix][power_name] = {'value_target': value_targets[phase_ix]} + + # Returning the value of the specified phase for each power + return value_data diff --git a/diplomacy_research/models/policy/token_based/dataset/no_press_all.py b/diplomacy_research/models/policy/token_based/dataset/no_press_all.py new file mode 100644 index 0000000..df713b3 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/no_press_all.py @@ -0,0 +1,121 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Token Based NoPress Builder (All) dataset + - Class responsible for generating the protocol buffers for NoPress (All) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.token_based.dataset.base import BaseDatasetBuilder, get_policy_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, \ + POWER_VOCABULARY_KEY_TO_IX, get_map_powers +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-token_based-no_press_all" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + all_powers = get_map_powers(map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy data for the phase_ix + # (All powers for training - Top victors for evaluation) + policy_data = get_policy_data(saved_game_proto, + power_names=all_powers, + top_victors=top_victors if is_validation_set else all_powers) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in all_powers: + if is_validation_set and power_name not in top_victors: + continue + phase_policy = policy_data[phase_ix][power_name] + + if 'decoder_inputs' not in phase_policy: + continue + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/token_based/dataset/no_press_large.py b/diplomacy_research/models/policy/token_based/dataset/no_press_large.py new file mode 100644 index 0000000..9c45fe1 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/no_press_large.py @@ -0,0 +1,114 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Token Based NoPress Builder (Large) dataset + - Class responsible for generating the protocol buffers for NoPress (Large) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.token_based.dataset.base import BaseDatasetBuilder, get_policy_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, POWER_VOCABULARY_KEY_TO_IX +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-token_based-no_press_large" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy data for the phase_ix + policy_data = get_policy_data(saved_game_proto, power_names=top_victors, top_victors=top_victors) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in top_victors: + phase_policy = policy_data[phase_ix][power_name] + + if 'decoder_inputs' not in phase_policy: + continue + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/token_based/dataset/no_press_value_all.py b/diplomacy_research/models/policy/token_based/dataset/no_press_value_all.py new file mode 100644 index 0000000..b7ddc7a --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/no_press_value_all.py @@ -0,0 +1,122 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Token Based NoPressValue (All) Builder + - Class responsible for generating the protocol buffers for NoPressValue (All) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.token_based.dataset.base import BaseDatasetBuilder, get_policy_data, \ + get_value_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, \ + POWER_VOCABULARY_KEY_TO_IX, get_map_powers +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-token_based-no_press_value_all" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + all_powers = get_map_powers(map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy data for the phase_ix + # (All powers for training - Top victors for evaluation) + policy_data = get_policy_data(saved_game_proto, + power_names=all_powers, + top_victors=top_victors if is_validation_set else all_powers) + value_data = get_value_data(saved_game_proto, all_powers) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in all_powers: + if is_validation_set and power_name not in top_victors: + continue + phase_policy = policy_data[phase_ix][power_name] + phase_value = value_data[phase_ix][power_name] + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + data.update(phase_value) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/token_based/dataset/no_press_value_large.py b/diplomacy_research/models/policy/token_based/dataset/no_press_value_large.py new file mode 100644 index 0000000..7987647 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/no_press_value_large.py @@ -0,0 +1,117 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Token Based NoPressValue (Large) Builder + - Class responsible for generating the protocol buffers for NoPressValue (Large) dataset +""" +import logging +import os +from diplomacy import Map +from diplomacy_research.models.policy.token_based.dataset.base import BaseDatasetBuilder, get_policy_data, \ + get_value_data +from diplomacy_research.models.state_space import get_top_victors, get_current_season, GO_ID, \ + POWER_VOCABULARY_KEY_TO_IX, get_map_powers +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import bytes_to_proto +from diplomacy_research.settings import WORKING_DIR, PROTOBUF_DATE + +# Constants +LOGGER = logging.getLogger(__name__) +DESC = "proto-policy-token_based-no_press_value_large" + +class DatasetBuilder(BaseDatasetBuilder): + """ This object is responsible for maintaining the data and feeding it into the tensorflow model """ + + # Paths as class properties + training_dataset_path = os.path.join(WORKING_DIR, '{}-{}.train.pbz'.format(PROTOBUF_DATE, DESC)) + validation_dataset_path = os.path.join(WORKING_DIR, '{}-{}.valid.pbz'.format(PROTOBUF_DATE, DESC)) + dataset_index_path = os.path.join(WORKING_DIR, '{}-{}.index.pkl'.format(PROTOBUF_DATE, DESC)) + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + return data_generator + + +# ---------- Multiprocessing methods to generate proto buffer ---------------- +def keep_phase_in_dataset(saved_game_proto): + """ Filter function that decides if we should put a phase in the dataset + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :return: A boolean that indicates if we should keep this phase or not. + """ + # Keeping all games on the standard map + if saved_game_proto.map.startswith('standard'): + return True + return False + +def data_generator(saved_game_bytes, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_bytes: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + saved_game_proto = bytes_to_proto(saved_game_bytes, SavedGameProto) + if not keep_phase_in_dataset(saved_game_proto): + return {phase_ix: [] for phase_ix, _ in enumerate(saved_game_proto.phases)} + return root_data_generator(saved_game_proto, is_validation_set) + +def root_data_generator(saved_game_proto, is_validation_set): + """ Converts a dataset game to protocol buffer format + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param is_validation_set: Boolean that indicates if we are generating the validation set (otw. training set) + :return: A dictionary with phase_ix as key and a dictionary {power_name: (msg_len, proto)} as value + """ + # Finding top victors and supply centers at end of game + map_object = Map(saved_game_proto.map) + top_victors = get_top_victors(saved_game_proto, map_object) + all_powers = get_map_powers(map_object) + nb_phases = len(saved_game_proto.phases) + proto_results = {phase_ix: {} for phase_ix in range(nb_phases)} + + # Getting policy and value data for the phase_ix + policy_data = get_policy_data(saved_game_proto, all_powers, top_victors) + value_data = get_value_data(saved_game_proto, all_powers) + + # Building results + for phase_ix in range(nb_phases - 1): + for power_name in all_powers: + phase_policy = policy_data[phase_ix][power_name] + phase_value = value_data[phase_ix][power_name] + + request_id = DatasetBuilder.get_request_id(saved_game_proto, phase_ix, power_name, is_validation_set) + data = {'request_id': request_id, + 'player_seed': 0, + 'decoder_inputs': [GO_ID], + 'noise': 0., + 'temperature': 0., + 'dropout_rate': 0., + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(saved_game_proto.phases[phase_ix].state)} + data.update(phase_policy) + data.update(phase_value) + + # Saving results + proto_result = BaseDatasetBuilder.build_example(data, BaseDatasetBuilder.get_proto_fields()) + proto_results[phase_ix][power_name] = (0, proto_result) + + # Returning data for buffer + return proto_results diff --git a/diplomacy_research/models/policy/token_based/dataset/tests/__init__.py b/diplomacy_research/models/policy/token_based/dataset/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_all_builder.py b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_all_builder.py new file mode 100644 index 0000000..ced7c22 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_all_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPress (All) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.token_based.dataset.no_press_all import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_large_builder.py b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_large_builder.py new file mode 100644 index 0000000..7f24765 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_large_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPress (Large) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.token_based.dataset.no_press_large import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_value_all_builder.py b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_value_all_builder.py new file mode 100644 index 0000000..5273df6 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_value_all_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPressValue (All) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.token_based.dataset.no_press_value_all import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_value_large_builder.py b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_value_large_builder.py new file mode 100644 index 0000000..3a8b39f --- /dev/null +++ b/diplomacy_research/models/policy/token_based/dataset/tests/test_no_press_value_large_builder.py @@ -0,0 +1,26 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the NoPressValue (Large) Dataset Builder """ +from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup +from diplomacy_research.models.policy.token_based.dataset.no_press_value_large import DatasetBuilder +from diplomacy_research.utils.process import run_in_separate_process + +def launch(): + """ Launches the tests """ + testable_class = PolicyBuilderTestSetup(DatasetBuilder()) + testable_class.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=60) diff --git a/diplomacy_research/models/policy/token_based/helper.py b/diplomacy_research/models/policy/token_based/helper.py new file mode 100644 index 0000000..8be45f8 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/helper.py @@ -0,0 +1,433 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Custom Helpers + - Contains custom decoder helper functions for the policy model (Token Based) +""" +import sys +assert 'tensorflow' in sys.modules, 'You need to import TF before importing this module.' + +from diplomacy_research.models.layers.beam_decoder import BeamHelper +from diplomacy_research.models.layers.decoder import MaskedInputs, LARGE_NEGATIVE +from diplomacy_research.models.policy.base_policy_model import TRAINING_DECODER, GREEDY_DECODER, SAMPLE_DECODER +from diplomacy_research.models.state_space import VOCABULARY_SIZE, GO_ID +from diplomacy_research.utils.tensorflow import Helper +from diplomacy_research.utils.tensorflow import _transpose_batch_time +from diplomacy_research.utils.tensorflow import _unstack_ta +from diplomacy_research.utils.tensorflow import dtypes +from diplomacy_research.utils.tensorflow import ops +from diplomacy_research.utils.tensorflow import SparseTensor +from diplomacy_research.utils.tensorflow import tensor_shape +from diplomacy_research.utils.tensorflow import array_ops +from diplomacy_research.utils.tensorflow import gen_array_ops +from diplomacy_research.utils.tensorflow import control_flow_ops +from diplomacy_research.utils.tensorflow import embedding_lookup +from diplomacy_research.utils.tensorflow import math_ops +from diplomacy_research.utils.tensorflow import gen_math_ops +from diplomacy_research.utils.tensorflow import sparse_ops +from diplomacy_research.utils.tensorflow import categorical +from diplomacy_research.utils.tensorflow import nest +from diplomacy_research.utils.tensorflow import rnn_cell_impl + + +def _ensure_int64(tensor): + """ Casts the tensor to tf.int64 """ + if isinstance(tensor, ops.Tensor) and tensor.dtype != dtypes.int64: + tensor = math_ops.cast(tensor, dtypes.int64) + return tensor + +def _slice_mask(mask, slicing, to_float=True, squeeze=False, time_major=False): + """ Returns a sliced mask given the current position and the prev token + :param mask: [SparseTensor] Mask to apply at each time step -- Size: (b, dec_len, vocab_size, vocab_size) + :param slicing: The slicing mask to apply. (-1 means keep entire dim, scalar only keeps the specified index) + :param to_float: Boolean that indicates we also want to parse to float. + :param squeeze: Boolean. If true removes the 1 dim and converts to DenseTensor. + :param time_major: Indicates that the mask was time_major (dec_len, b, vocab_size, vocab_size) + :return: The sliced tensor + """ + if time_major: + slicing = [slicing[1], slicing[0]] + slicing[2:] + dims = array_ops.unstack(mask.dense_shape) + start = [0 if item == -1 else _ensure_int64(item) for item in slicing] + end = [_ensure_int64(dims[index]) if item == -1 else 1 for index, item in enumerate(slicing)] + squeeze_dims = [slice_ix for slice_ix, slice_item in enumerate(slicing) if slice_item != -1] + dense_shape = [None, None, VOCABULARY_SIZE, VOCABULARY_SIZE] + squeezed_shape = [dense_shape[slice_ix] for slice_ix, slice_item in enumerate(slicing) if slice_item == -1] + + sliced_mask = sparse_ops.sparse_slice(mask, start, end) + if to_float or squeeze: + sliced_mask = math_ops.cast(sliced_mask, dtypes.float32) + if squeeze: + sliced_mask = sparse_ops.sparse_reduce_sum(sliced_mask, axis=squeeze_dims) + sliced_mask.set_shape(squeezed_shape) + return sliced_mask + +def _get_embedding_fn(embedding): + """ Returns a callable embedding function """ + return embedding if callable(embedding) else (lambda ids: embedding_lookup(embedding, ids)) + + +# ---------------------------------------- +# TOKEN-BASED HELPER +# ---------------------------------------- +class CustomHelper(Helper): + """ A custom helper that works with teacher forcing, greedy, and sampling. + Concatenates inputs, then applies a linear layer. + Returns -1s for sample_ids where no sampling took place; valid sample id values elsewhere. + """ + def __init__(self, decoder_type, inputs, embedding, sequence_length, mask, input_layer=None, time_major=False, + softmax_temperature=None, seed=None, name=None): + """ Constructor + :param decoder_type: An uint8 representing TRAINING_DECODER, GREEDY_DECODER, or SAMPLE_DECODER + :param inputs: The decoder input (b, dec_len) + :param embedding: The embedding vector + :param sequence_length: The length of each input (b,) + :param mask: [SparseTensor] Mask to apply at each time step -- Size: (b, dec_len, vocab_size, vocab_size) + :param input_layer: Optional. A layer to apply on the inputs + :param time_major: If true indicates that the first dimension is time, otherwise it is batch size + :param softmax_temperature: Optional. Softmax temperature. None or size: (batch_size,) + :param seed: Optional. The sampling seed + :param name: Optional scope name. + """ + # pylint: disable=too-many-arguments + with ops.name_scope(name, "CustomHelper", [inputs, sequence_length, embedding]): + assert isinstance(mask, SparseTensor), 'The mask must be a SparseTensor' + inputs = ops.convert_to_tensor(inputs, name="inputs") + self._inputs = inputs + self._mask = mask + self._time_major = time_major + self._embedding_fn = embedding if callable(embedding) else lambda ids: embedding_lookup(embedding, ids) + if not time_major: + inputs = nest.map_structure(_transpose_batch_time, inputs) + self._input_tas = nest.map_structure(_unstack_ta, inputs) + self._decoder_type = decoder_type + self._sequence_length = ops.convert_to_tensor(sequence_length, name="sequence_length") + if self._sequence_length.get_shape().ndims != 1: + raise ValueError("Expected vector for sequence_length. Shape: %s" % self._sequence_length.get_shape()) + self._input_layer = input_layer if callable(input_layer) else lambda x: x + self._batch_size = array_ops.size(sequence_length) + self._start_inputs = gen_array_ops.fill([self._batch_size], GO_ID) + self._softmax_temperature = softmax_temperature + self._seed = seed + self.vocab_size = VOCABULARY_SIZE + self._zero_inputs = \ + MaskedInputs(inputs=array_ops.zeros_like(self._input_layer(self._embedding_fn(self._start_inputs))), + mask=_slice_mask(self._mask, + slicing=[-1, 0, GO_ID, -1], + squeeze=True, + time_major=self._time_major)) + + # Preventing div by zero + # Adding an extra dim to the matrix, so we can broadcast with the outputs shape + if softmax_temperature is not None: + self._softmax_temperature = gen_math_ops.maximum(1e-10, self._softmax_temperature) + if self._softmax_temperature.get_shape().ndims == 1: + self._softmax_temperature = self._softmax_temperature[:, None] + + @property + def batch_size(self): + """ Returns the batch size """ + return self._batch_size + + @property + def sample_ids_shape(self): + """ Returns the shape of the sample ids """ + return tensor_shape.TensorShape([]) + + @property + def sample_ids_dtype(self): + """ Returns the dtype of the sample ids """ + return dtypes.int32 + + def sample(self, time, outputs, state, name=None): + """ Samples the id for the next time step (or -1 for teacher forcing) """ + with ops.name_scope(name, 'CustomHelperSample', [time, outputs, state]): + + def training(): + """ Selecting training / teacher forcing """ + fill_op = gen_array_ops.fill([array_ops.shape(outputs)[0]], -1) + with ops.control_dependencies([fill_op]): + return array_ops.identity(fill_op) + + def greedy(): + """ Selecting greedy """ + argmax_op = math_ops.argmax(outputs, axis=-1, output_type=dtypes.int32) + with ops.control_dependencies([argmax_op]): + return array_ops.identity(argmax_op) + + def sample(): + """ Sampling """ + logits = outputs if self._softmax_temperature is None else outputs / self._softmax_temperature + sample_id_sampler = categorical.Categorical(logits=logits) + sample_op = sample_id_sampler.sample(seed=self._seed) + with ops.control_dependencies([sample_op]): + return array_ops.identity(sample_op) + + return control_flow_ops.case([(gen_math_ops.equal(self._decoder_type, TRAINING_DECODER), training), + (gen_math_ops.equal(self._decoder_type, GREEDY_DECODER), greedy), + (gen_math_ops.equal(self._decoder_type, SAMPLE_DECODER), sample)], + default=training) + + def initialize(self, name=None): + """ Performs helper initialization (to get initial state) """ + with ops.name_scope(name, 'CustomHelperInitialize'): + finished = gen_math_ops.equal(0, self._sequence_length) + all_finished = math_ops.reduce_all(finished) + + def training_inputs(): + """ Returns the training initial input """ + embed_op = self._embedding_fn(self._input_tas.read(0)) + with ops.control_dependencies([embed_op]): + return array_ops.identity(embed_op) + + def start_inputs(): + """ Returns the GO_ID initial input """ + embed_op = self._embedding_fn(self._start_inputs) + with ops.control_dependencies([embed_op]): + return array_ops.identity(embed_op) + + # Getting initial inputs + initial_inputs = control_flow_ops.case( + [(gen_math_ops.equal(self._decoder_type, TRAINING_DECODER), training_inputs), + (gen_math_ops.equal(self._decoder_type, GREEDY_DECODER), start_inputs), + (gen_math_ops.equal(self._decoder_type, SAMPLE_DECODER), start_inputs)], + default=training_inputs) + + next_inputs = \ + control_flow_ops.cond(all_finished, + lambda: self._zero_inputs, + lambda: MaskedInputs(inputs=self._input_layer(initial_inputs), + mask=_slice_mask(self._mask, + slicing=[-1, 0, GO_ID, -1], + squeeze=True, + time_major=self._time_major))) + return (finished, next_inputs) + + def next_inputs(self, time, outputs, state, sample_ids, name=None): + """ Computes the next inputs at a time step """ + with ops.name_scope(name, 'CustomHelperNextInputs', [time, outputs, state, sample_ids]): + next_time = time + 1 + finished = (next_time >= self._sequence_length) + all_finished = math_ops.reduce_all(finished) + + def get_next_inputs(): + """ Retrieves the inputs for the next time step """ + def get_training_inputs(): + """ Selecting training inputs """ + read_op = self._input_tas.read(next_time) + with ops.control_dependencies([read_op]): + return array_ops.identity(read_op) + + def get_sample_inputs(): + """ Selecting greedy/sample inputs """ + return sample_ids + + inputs_next_step = control_flow_ops.case( + [(gen_math_ops.equal(self._decoder_type, TRAINING_DECODER), get_training_inputs), + (gen_math_ops.equal(self._decoder_type, GREEDY_DECODER), get_sample_inputs), + (gen_math_ops.equal(self._decoder_type, SAMPLE_DECODER), get_sample_inputs)], + default=get_training_inputs) + inputs_emb_next_step = self._input_layer(self._embedding_fn(inputs_next_step)) + + # Applying mask + # inputs_one_hot: (b, 1, VOC, 1) + # mask_t: (b, 1, VOC, VOC) + # next_mask: (b, VOC) -- DenseTensor + inputs_one_hot = array_ops.one_hot(inputs_next_step, self.vocab_size)[:, None, :, None] + mask_t = _slice_mask(self._mask, [-1, next_time, -1, -1], time_major=self._time_major) + next_mask = sparse_ops.sparse_reduce_sum(inputs_one_hot * mask_t, axis=[1, 2]) + next_mask = gen_math_ops.minimum(next_mask, 1.) + next_mask.set_shape([None, self.vocab_size]) + + # Prevents this branch from executing eagerly + with ops.control_dependencies([inputs_emb_next_step, next_mask]): + return MaskedInputs(inputs=array_ops.identity(inputs_emb_next_step), + mask=array_ops.identity(next_mask)) + + next_inputs = control_flow_ops.cond(all_finished, + true_fn=lambda: self._zero_inputs, + false_fn=get_next_inputs) + + # Returning + return (finished, next_inputs, state) + +class CustomBeamHelper(BeamHelper): + """ A helper to feed data in a custom beam search decoder """ + + def __init__(self, cell, embedding, mask, sequence_length, initial_state, beam_width, input_layer=None, + output_layer=None, time_major=False): + """ Initialize the CustomBeamHelper + :param cell: An `RNNCell` instance. + :param embedding: The embedding vector + :param mask: [SparseTensor] Mask to apply at each time step -- Size: (b, dec_len, vocab_size, vocab_size) + :param sequence_length: The length of each input (b,) + :param initial_state: A (possibly nested tuple of...) tensors and TensorArrays. + :param beam_width: Python integer, the number of beams. + :param input_layer: Optional. A layer to apply on the inputs + :param output_layer: Optional. An instance of `tf.layers.Layer`, i.e., `tf.layers.Dense`. Optional layer + to apply to the RNN output prior to storing the result or sampling. + :param time_major: If true indicates that the first dimension is time, otherwise it is batch size. + """ + # pylint: disable=super-init-not-called,too-many-arguments + rnn_cell_impl.assert_like_rnncell('cell', cell) # pylint: disable=protected-access + assert isinstance(mask, SparseTensor), 'The mask must be a SparseTensor' + assert isinstance(beam_width, int), 'beam_width should be a Python integer' + + self._sequence_length = ops.convert_to_tensor(sequence_length, name='sequence_length') + if self._sequence_length.get_shape().ndims != 1: + raise ValueError("Expected vector for sequence_length. Shape: %s" % self._sequence_length.get_shape()) + + self._cell = cell + self._embedding_fn = _get_embedding_fn(embedding) + self._mask = mask + self._time_major = time_major + self.vocab_size = VOCABULARY_SIZE + self._input_layer = input_layer if input_layer is not None else lambda x: x + self._output_layer = output_layer + + self._input_size = embedding.shape[-1] + if input_layer is not None: + self._input_size = self._input_layer.compute_output_shape([None, self._input_size])[-1] + + self._batch_size = array_ops.size(sequence_length) + self._start_tokens = gen_array_ops.fill([self._batch_size * beam_width], GO_ID) + self._end_token = -1 + self._beam_width = beam_width + self._initial_cell_state = nest.map_structure(self._maybe_split_batch_beams, + initial_state, + self._cell.state_size) + self._finished = array_ops.one_hot(array_ops.zeros([self._batch_size], dtype=dtypes.int32), + depth=self._beam_width, + on_value=False, + off_value=True, + dtype=dtypes.bool) + + # zero_mask is (batch, beam, vocab_size) + self._zero_mask = _slice_mask(self._mask, slicing=[-1, 0, GO_ID, -1], squeeze=True, time_major=self._time_major) + self._zero_mask = gen_array_ops.tile(array_ops.expand_dims(self._zero_mask, axis=1), [1, self._beam_width, 1]) + self._zero_inputs = \ + MaskedInputs( + inputs=array_ops.zeros_like( + self._split_batch_beams( + self._input_layer(self._embedding_fn(self._start_tokens)), self._input_size)), + mask=self._zero_mask) + + @property + def beam_width(self): + """ Returns the beam width """ + return self._beam_width + + @property + def batch_size(self): + """ Returns the batch size """ + return self._batch_size + + @property + def output_size(self): + """ Returns the size of the RNN output """ + size = self._cell.output_size + if self._output_layer is None: + return size + + # To use layer's compute_output_shape, we need to convert the RNNCell's output_size entries into shapes + # with an unknown batch size. We then pass this through the layer's compute_output_shape and read off + # all but the first (batch) dimensions to get the output size of the rnn with the layer applied to the top. + output_shape_with_unknown_batch = \ + nest.map_structure(lambda shape: tensor_shape.TensorShape([None]).concatenate(shape), size) + layer_output_shape = self._output_layer.compute_output_shape(output_shape_with_unknown_batch) + return nest.map_structure(lambda shape: shape[1:], layer_output_shape) + + def initialize(self): + """ Initialize the beam helper - Called in beam_decoder.initialize() + :return: `(finished, start_inputs, initial_cell_state)`. + """ + finished, zero_inputs, zero_mask = self._finished, self._zero_inputs, self._zero_mask + all_finished = math_ops.reduce_all(gen_math_ops.equal(0, self._sequence_length)) + initial_inputs = self._embedding_fn(self._start_tokens) + + # Start Inputs + start_inputs = control_flow_ops.cond(all_finished, + lambda: zero_inputs, + lambda: MaskedInputs( + inputs=self._split_batch_beams(self._input_layer(initial_inputs), + self._input_size), + mask=zero_mask)) + + # Returning + return finished, start_inputs, self._initial_cell_state + + def step(self, time, inputs, cell_state): + """ Performs a step using the beam search cell + :param time: The current time step (scalar) + :param inputs: A (structure of) input tensors. + :param state: A (structure of) state tensors and TensorArrays. + :return: `(cell_outputs, next_cell_state)`. + """ + raw_inputs = inputs + inputs, output_mask = raw_inputs.inputs, raw_inputs.mask + inputs = nest.map_structure(lambda inp: self._merge_batch_beams(inp, depth_shape=inp.shape[2:]), inputs) + cell_state = nest.map_structure(self._maybe_merge_batch_beams, cell_state, self._cell.state_size) + cell_outputs, next_cell_state = self._cell(inputs, cell_state) # [batch * beam, out_sz] + next_cell_state = nest.map_structure(self._maybe_split_batch_beams, next_cell_state, self._cell.state_size) + + # Splitting outputs and applying mask + # cell_outputs is [batch, beam, vocab_size] + cell_outputs = self._output_layer(cell_outputs) if self._output_layer is not None else cell_outputs + cell_outputs = nest.map_structure(lambda out: self._split_batch_beams(out, out.shape[1:]), cell_outputs) + cell_outputs = gen_math_ops.add(cell_outputs, (1. - output_mask) * LARGE_NEGATIVE) + + # Returning + return cell_outputs, next_cell_state + + def next_inputs(self, time, inputs, beam_search_output, beam_search_state): + """ Computes the inputs at the next time step given the beam outputs + :param time: The current time step (scalar) + :param inputs: A (structure of) input tensors. + :param beam_search_output: The output of the beam search step + :param beam_search_state: The state after the beam search step + :return: `(beam_search_output, next_inputs)` + :type beam_search_output: beam_search_decoder.BeamSearchDecoderOutput + :type beam_search_state: beam_search_decoder.BeamSearchDecoderState + """ + next_time = time + 1 + all_finished = math_ops.reduce_all(next_time >= self._sequence_length) + sample_ids = beam_search_output.predicted_ids + + def get_next_inputs(): + """ Retrieves the inputs for the next time step """ + inputs_next_step = sample_ids + inputs_emb_next_step = self._input_layer(self._embedding_fn(inputs_next_step)) # [bat, beam, in_sz] + + # Applying mask + # inputs_one_hot: (batch, beam, 1, VOC, 1) + # mask_t: (batch, 1, 1, VOC, VOC) + # next_mask: (batch, beam, VOC) + inputs_one_hot = array_ops.one_hot(inputs_next_step, self.vocab_size)[:, :, None, :, None] + mask_t = sparse_ops.sparse_tensor_to_dense(_slice_mask(self._mask, [-1, next_time, -1, -1], + time_major=self._time_major))[:, None, :, :, :] + mask_t.set_shape([None, 1, 1, self.vocab_size, self.vocab_size]) + next_mask = math_ops.reduce_sum(inputs_one_hot * mask_t, axis=[2, 3]) + next_mask = gen_math_ops.minimum(next_mask, 1.) + + # Prevents this branch from executing eagerly + with ops.control_dependencies([inputs_emb_next_step, next_mask]): + return MaskedInputs(inputs=array_ops.identity(inputs_emb_next_step), + mask=array_ops.identity(next_mask)) + + # Getting next inputs + next_inputs = control_flow_ops.cond(all_finished, + true_fn=lambda: self._zero_inputs, + false_fn=get_next_inputs) + + # Returning + return beam_search_output, next_inputs diff --git a/diplomacy_research/models/policy/token_based/model.py b/diplomacy_research/models/policy/token_based/model.py new file mode 100644 index 0000000..e16577d --- /dev/null +++ b/diplomacy_research/models/policy/token_based/model.py @@ -0,0 +1,569 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (Token Based) + - Contains the parent policy model, to evaluate the best actions given a state +""" +from collections import OrderedDict +import logging +import math +from diplomacy_research.models.policy.base_policy_model import GREEDY_DECODER, TRAINING_DECODER, StatsKey, \ + OrderProbTokenLogProbs, BasePolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import EOS_ID, TOKENS_PER_ORDER, POWER_VOCABULARY_IX_TO_KEY, \ + POWER_VOCABULARY_LIST, NB_SUPPLY_CENTERS, ix_to_token, STANDARD_TOPO_LOCS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + +class TokenBasedPolicyModel(BasePolicyModel): + """ Policy Model """ + + def __init__(self, dataset, hparams): + """ Initialization + :param dataset: The dataset that is used to iterate over the data. + :param hparams: A dictionary of hyper parameters with their values + :type dataset: diplomacy_research.models.datasets.supervised_dataset.SupervisedDataset + :type dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + """ + from diplomacy_research.utils.tensorflow import tf + hps = lambda hparam_name: self.hparams[hparam_name] + BasePolicyModel.__init__(self, dataset, hparams) + + # Learning rate + if not hasattr(self, 'learning_rate') or self.learning_rate is None: + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + self.learning_rate = tf.Variable(float(hps('learning_rate')), trainable=False, dtype=tf.float32) + + # Optimizer + if not hasattr(self, 'optimizer') or self.optimizer is None: + self.optimizer = self.make_optimizer(self.learning_rate) + + # Build ops + self.build_policy() + + # Decay ops + if not hasattr(self, 'decay_learning_rate') or self.decay_learning_rate is None: + self.decay_learning_rate = self.learning_rate.assign(self.placeholders['learning_rate']) + + @property + def _nb_evaluation_loops(self): + """ Contains the number of different evaluation tags we want to compute + This also represent the number of loops we should do over the validation set + Some model wants to calculate different statistics and require multiple pass to do that + + A value of 1 indicates to only run in the main validation loop + A value > 1 indicates to run additional loops only for this model. + """ + return 2 + + @property + def _evaluation_tags(self): + """ List of evaluation tags (1 list of evaluation tag for each evaluation loop) + e.g. [['Acc_1', 'Acc_5', 'Acc_Tokens'], ['Gr_1', 'Gr_5', 'Gr_Tokens']] + """ + return [['[TF]X-Ent', '[TF]Perplexity', '[TF]Acc_1', '[TF]Acc_1_NoHold', '[TF]Acc_Tokens', '[TF]Acc_Player'], + ['[Gr]Acc_1', '[Gr]Acc_1_NoHold', '[Gr]Acc_Tokens', '[Gr]Acc_Player']] + + @property + def _early_stopping_tags(self): + """ List of tags to use to detect early stopping + The tags are a tuple of 1) 'min' or 'max' and 2) the tag's name + e.g. [('max', '[Gr]Acc_1'), ('min', '[TF]Perplexity')] + """ + return [('min', '[TF]Perplexity'), ('max', '[Gr]Acc_1')] + + @property + def _placeholders(self): + """ Return a dictionary of all placeholders needed by the model """ + from diplomacy_research.utils.tensorflow import tf, get_placeholder, get_placeholder_with_default + + # Note: 'decoder_type' needs to have a batch_dim to be compatible with TF Serving + # but will be reduced to a scalar with tf.reduce_max + return { + 'decoder_type': get_placeholder('decoder_type', shape=[None], dtype=tf.uint8), + 'learning_rate': get_placeholder_with_default('learning_rate', 1e-4, shape=(), dtype=tf.float32), + 'dropout_rate': get_placeholder_with_default('dropout_rate', 0., shape=(), dtype=tf.float32), + 'is_training': get_placeholder_with_default('is_training', False, shape=(), dtype=tf.bool), + 'stop_gradient_all': get_placeholder_with_default('stop_gradient_all', False, shape=(), dtype=tf.bool) + } + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + raise NotImplementedError() + + def _get_session_args(self, decode=False, eval_loop_ix=None): + """ Returns a dict of kwargs to feed to session.run + Expected format: {fetches, feed_dict=None} + """ + hps = lambda hparam_name: self.hparams[hparam_name] + + # Detecting if we are doing validation + in_validation, our_validation = False, False + if eval_loop_ix is not None: + in_validation = True + our_validation = eval_loop_ix in self.my_eval_loop_ixs + + # --------- Fetches --------------- + train_fetches = {'optimizer_op': self.outputs['optimizer_op'], + 'policy_loss': self.outputs['policy_loss']} + + eval_fetches = {'policy_loss': self.outputs['policy_loss'], + 'argmax_tokens': self.outputs['argmax_tokens'], + 'log_probs': self.outputs['log_probs'], + 'targets': self.outputs['targets'], + 'current_power': self.features['current_power'], + 'current_season': self.features['current_season'], + 'in_retreat_phase': self.outputs['in_retreat_phase'], + 'request_id': self.features['request_id']} + + # --------- Feed dict -------------- + # Building feed dict + feed_dict = {self.placeholders['decoder_type']: [TRAINING_DECODER], # Batch size of 1 + self.placeholders['is_training']: True, + self.placeholders['stop_gradient_all']: False} + + # Dropout disabled during debug (batch), validation, or decoding (stats) + if self.hparams['debug_batch'] or in_validation or decode: + feed_dict.update({self.placeholders['dropout_rate']: 0.}) + else: + feed_dict.update({self.placeholders['dropout_rate']: hps('dropout_rate')}) + + # --------- Validation Loop -------------- + # Validation Loop - Running one of our validation loops + if our_validation: + decoder_type = {0: TRAINING_DECODER, 1: GREEDY_DECODER}[self.my_eval_loop_ixs.index(eval_loop_ix)] + feed_dict[self.placeholders['decoder_type']] = [decoder_type] # Batch size of 1 + feed_dict[self.placeholders['is_training']] = False + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Validation Loop - Running someone else validation loop + if in_validation: + return {'feed_dict': feed_dict} + + # --------- Training Loop -------------- + # Training Loop - We want to decode the specific batch to display stats + if decode: + decoder_type = TRAINING_DECODER + feed_dict[self.placeholders['decoder_type']] = [decoder_type] # Batch size of 1 + feed_dict[self.placeholders['is_training']] = False + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Training Loop - Training the model + return {'fetches': train_fetches, 'feed_dict': feed_dict} + + @staticmethod + def _decode(**fetches): + """ Performs decoding on the output (token_based model) + :param fetches: A dictionary of fetches from the model. + + Keys can include: + + - selected_tokens / argmax_tokens: [Required] The tokens from the model (Tensor [batch, decoder_length]) + - log_probs: [Required] The log probs from the model (Tensor [batch, decoder_length]) + - policy_loss: The policy loss for the batch. + - targets: The targets from the model (Tensor [batch, length]). Required for evaluation. + - current_power: The current_power from the model (Tensor [batch,]). Required for evaluation. + - current_season: The current_season from the model (Tensor [batch,]). Required for evaluation. + - in_retreat_phase: Boolean that indicates dislodged units are on the map. ([b,]). Required for evaluation. + - request_id: The unique request id for each item in the batch. + + :return: A dictionary of decoded results, including + - 1) decoded_orders: + A list of dictionary (one per batch) where each dict has location as key and a + OrderProbTokenLogProbs tuple as value (i.e. an order, its prob, and the token log probs) + e.g. [{'PAR': (order, prob, log_probs),'MAR': (order, prob, log_probs)}, + {'PAR': (order, prob, log_probs),'MAR': (order, prob, log_probs)}] + - 2) various other keys for evaluation + """ + # Missing the required fetches, returning an empty decoded results + if ('selected_tokens' not in fetches and 'argmax_tokens' not in fetches) or 'log_probs' not in fetches: + return {} + + # tokens: [batch, dec_len] + # log_probs: [batch, dec_len] + # policy_loss: () + # targets: [batch, dec_len] + # current_power: [batch] + # current_season: [batch] + # in_retreat_phase: [batch] + # request_ids: [batch] + tokens = fetches.get('selected_tokens', fetches.get('argmax_tokens')) + log_probs = fetches['log_probs'] + policy_loss = fetches.get('policy_loss', None) + targets = fetches.get('targets', None) + current_power = fetches.get('current_power', None) + current_season = fetches.get('current_season', None) + in_retreat_phase = fetches.get('in_retreat_phase', None) + request_ids = fetches.get('request_id', None) + + # Decoding orders + results = [] + result_tokens = [] + nb_batches = len(tokens) + + # Building all batches + for batch_ix in range(nb_batches): + batch_results = OrderedDict() + batch_results_tokens = OrderedDict() + batch_tokens = tokens[batch_ix] + batch_log_probs = log_probs[batch_ix] + nb_locs = len(batch_tokens) // TOKENS_PER_ORDER + nb_waive = 0 + + # We didn't try to predict orders - Skipping + if not len(batch_tokens) or batch_tokens[0] == [0]: # pylint: disable=len-as-condition + results += [batch_results] + result_tokens += [batch_results_tokens] + continue + + # Decoding each location + for loc_ix in range(nb_locs): + loc_tokens = batch_tokens[loc_ix * TOKENS_PER_ORDER:(loc_ix + 1) * TOKENS_PER_ORDER] + loc_log_probs = batch_log_probs[loc_ix * TOKENS_PER_ORDER:(loc_ix + 1) * TOKENS_PER_ORDER] + loc_order = ' '.join([ix_to_token(token_ix) for token_ix in loc_tokens if token_ix > EOS_ID]) + + # No loc - skipping + if loc_tokens[0] <= EOS_ID or not loc_order: + continue + + # WAIVE orders + if loc_order == 'WAIVE': + loc = 'WAIVE_{}'.format(nb_waive) + nb_waive += 1 + + # Use normal location and skip if already stored + else: + loc = loc_order.split()[1] + if loc in batch_results: + continue + loc = loc[:3] + + # Otherwise, storing order + batch_results[loc] = OrderProbTokenLogProbs(order=loc_order, + probability=1., + log_probs=loc_log_probs) + batch_results_tokens[loc] = loc_tokens + + # Done with batch + results += [batch_results] + result_tokens += [batch_results_tokens] + + # Returning + return {'decoded_orders': results, + 'policy_loss': policy_loss, + 'targets': targets, + 'tokens': result_tokens, + 'current_power': current_power, + 'current_season': current_season, + 'in_retreat_phase': in_retreat_phase, + 'request_id': request_ids, + 'log_probs': log_probs} + + def _evaluate(self, decoded_results, feed_dict, eval_loop_ix, incl_detailed): + """ Calculates the accuracy of the model + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index (-1 for training) + :param incl_detailed: is true if training is over, more statistics can be computed + :return: A tuple consisting of: + 1) An ordered dictionary with result_name as key and (weight, value) as value (Regular results) + 2) An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + # Detecting if it's our evaluation or not + if eval_loop_ix == -1: + eval_loop_ix = 0 + else: + our_validation = eval_loop_ix in self.my_eval_loop_ixs + if not our_validation: + return OrderedDict(), OrderedDict() + eval_loop_ix = self.my_eval_loop_ixs.index(eval_loop_ix) + + # Evaluating + policy_loss = decoded_results['policy_loss'] * TOKENS_PER_ORDER # Avg X-Ent per unit-order + perplexity = math.exp(policy_loss) if policy_loss <= 100 else float('inf') + targets = decoded_results['targets'] + batch_size = targets.shape[0] + nb_locs_per_target = targets.shape[1] // TOKENS_PER_ORDER + decoded_orders = decoded_results['decoded_orders'] + + # Logging an error if perplexity is inf + if perplexity == float('inf'): + for request_id, log_probs in zip(decoded_results['request_id'], decoded_results['log_probs']): + if sum(log_probs) <= -100: + LOGGER.error('Request %s has log probs that causes a -inf perplexity.', request_id) + + # Accuracy + acc_1_num, denom = 0., 0. + acc_1_no_hold_num, denom_no_hold = 0., 0. + nb_tokens_match, nb_tokens_total = 0., 0. + acc_player_num, denom_player = 0., 0. + + # Decoding batch by batch, loc by loc + for batch_ix in range(batch_size): + player_order_mismatch = False + nb_waive = 0 + + # We didn't learn a policy - Skipping + if not len(targets[batch_ix]) or targets[batch_ix][0] == 0: # pylint: disable=len-as-condition + continue + + for loc_ix in range(nb_locs_per_target): + start, stop = loc_ix * TOKENS_PER_ORDER, (loc_ix + 1) * TOKENS_PER_ORDER + decoded_target = ' '.join([ix_to_token(ix) for ix in targets[batch_ix][start:stop] if ix > EOS_ID]) + if not decoded_target: + break + nb_tokens_total += TOKENS_PER_ORDER + + if decoded_target == 'WAIVE': + loc = 'WAIVE_{}'.format(nb_waive) + is_hold_order = False + nb_waive += 1 + else: + loc = decoded_target.split()[1][:3] + is_hold_order = len(decoded_target.split()) <= 2 or decoded_target.split()[2] == 'H' + + # Computing Acc 1 + denom += 1. + if not is_hold_order: + denom_no_hold += 1. + + # Checking if the target is in the decoded results + if loc in decoded_orders[batch_ix] and decoded_orders[batch_ix][loc].order == decoded_target: + acc_1_num += 1. + if not is_hold_order: + acc_1_no_hold_num += 1. + else: + player_order_mismatch = True + + # Computing Acc Tokens + tokenized_targets = targets[batch_ix][start:stop] + tokenized_results = decoded_results['tokens'][batch_ix].get(loc, [-1] * TOKENS_PER_ORDER) + nb_tokens_match += sum([1. for i in range(TOKENS_PER_ORDER) + if tokenized_targets[i] == tokenized_results[i]]) + + # Compute accuracy for this phase + if not player_order_mismatch: + acc_player_num += 1 + denom_player += 1 + + # No orders at all + if not denom: + acc_1 = 1. + acc_1_no_hold = 1. + acc_tokens = 1. + acc_player = 1. + else: + acc_1 = acc_1_num / (denom + 1e-12) + acc_1_no_hold = acc_1_no_hold_num / (denom_no_hold + 1e-12) + acc_tokens = nb_tokens_match / (nb_tokens_total + 1e-12) + acc_player = acc_player_num / (denom_player + 1e-12) + + # Computing detailed statistics + detailed_results = OrderedDict() + if incl_detailed: + detailed_results = self._get_detailed_results(decoded_results, feed_dict, eval_loop_ix) + + # Validating decoder type + decoder_type = [value for tensor, value in feed_dict.items() if 'decoder_type' in tensor.name] + decoder_type = '' if not decoder_type else decoder_type[0][0] + + # 0 - Teacher Forcing results + if eval_loop_ix == 0: + assert decoder_type == TRAINING_DECODER + return OrderedDict({'[TF]X-Ent': (denom, policy_loss), + '[TF]Perplexity': (denom, perplexity), + '[TF]Acc_1': (denom, 100. * acc_1), + '[TF]Acc_1_NoHold': (denom_no_hold, 100. * acc_1_no_hold), + '[TF]Acc_Tokens': (nb_tokens_total, 100. * acc_tokens), + '[TF]Acc_Player': (denom_player, 100. * acc_player)}), detailed_results + + # 1 - Greedy Results + if eval_loop_ix == 1: + assert decoder_type == GREEDY_DECODER + return OrderedDict({'[Gr]Acc_1': (denom, 100. * acc_1), + '[Gr]Acc_1_NoHold': (denom_no_hold, 100. * acc_1_no_hold), + '[Gr]Acc_Tokens': (nb_tokens_total, 100. * acc_tokens), + '[Gr]Acc_Player': (denom_player, 100. * acc_player)}), detailed_results + + # Otherwise, invalid evaluation_loop_ix + raise RuntimeError('Invalid evaluation_loop_ix - Got "%s"' % eval_loop_ix) + + @staticmethod + def _get_detailed_results(decoded_results, feed_dict, evaluation_loop_ix): + """ Computes detailed accuracy statistics for the batch + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index + :return: An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + del feed_dict # Unused args + + targets = decoded_results['targets'] + log_probs = decoded_results['log_probs'] + request_ids = decoded_results['request_id'] + batch_size = targets.shape[0] + nb_locs_per_target = targets.shape[1] // TOKENS_PER_ORDER + decoded_orders = decoded_results['decoded_orders'] + + # Extracting from additional info + for field_name in ['current_power', 'current_season', 'in_retreat_phase']: + if field_name not in decoded_results: + LOGGER.warning('The field "%s" is missing. Cannot compute stats', field_name) + return OrderedDict() + current_power_name = [POWER_VOCABULARY_IX_TO_KEY[current_power] + for current_power in decoded_results['current_power']] + current_season_name = ['SFW'[current_season] for current_season in decoded_results['current_season']] + in_retreat_phase = decoded_results['in_retreat_phase'] + + # Prefix + prefix = '[TF]' if evaluation_loop_ix == 0 else '[Gr]' + + # Building results dict + results = OrderedDict() + results[prefix + 'Accuracy'] = [] + results[prefix + 'LogProbsDetails'] = [{}] # {request_id: (log_probs, mismatch)} + for power_name in POWER_VOCABULARY_LIST: + results[prefix + power_name] = [] + for order_type in ['H', '-', '- VIA', 'S', 'C', 'R', 'B', 'D', 'WAIVE']: + results[prefix + 'Order %s' % order_type] = [] + for season in 'SFW': # Spring, Fall, Winter + results[prefix + 'Season %s' % season] = [] + for phase in 'MRA': # Movement, Retreats, Adjustments + results[prefix + 'Phase %s' % phase] = [] + for position in range(-1, NB_SUPPLY_CENTERS): # Position -1 is used for Adjustment phases + results[prefix + 'Position %d' % position] = [] + for order_loc in sorted(STANDARD_TOPO_LOCS): # Order location + results[prefix + 'Loc %s' % order_loc] = [] + + # Computing accuracy + for batch_ix in range(batch_size): + request_id = request_ids[batch_ix] + player_orders_mismatch = False + nb_waive = 0 + + # We didn't learn a policy - Skipping + if not len(targets[batch_ix]) or targets[batch_ix][0] == 0: # pylint: disable=len-as-condition + continue + + for loc_ix in range(nb_locs_per_target): + start, stop = loc_ix * TOKENS_PER_ORDER, (loc_ix + 1) * TOKENS_PER_ORDER + decoded_target = ' '.join([ix_to_token(ix) for ix in targets[batch_ix][start:stop] if ix > EOS_ID]) + if not decoded_target: + break + + if decoded_target == 'WAIVE': + loc = 'WAIVE_{}'.format(nb_waive) + order_type = 'WAIVE' + nb_waive += 1 + else: + loc = decoded_target.split()[1][:3] + order_type = decoded_target.split()[2] if len(decoded_target.split()) > 2 else 'H' + if order_type == '-' and decoded_target.split()[-1] == 'VIA': + order_type = '- VIA' + + # Determining categories + power_name = current_power_name[batch_ix] + season = current_season_name[batch_ix] + if in_retreat_phase[batch_ix]: + phase = 'R' + order_type = 'R' if order_type in ['-', '- VIA'] else order_type + else: + phase = {'H': 'M', '-': 'M', '- VIA': 'M', 'S': 'M', 'C': 'M', + 'R': 'R', + 'D': 'A', 'B': 'A', 'WAIVE': 'A'}[order_type] + + # Use -1 as position for A phase + position = -1 if phase == 'A' else loc_ix + stats_key = StatsKey(prefix, power_name, order_type, season, phase, position) + + # Computing accuracies + success = int(loc in decoded_orders[batch_ix] and decoded_orders[batch_ix][loc].order == decoded_target) + if not success: + player_orders_mismatch = True + + results[prefix + 'Accuracy'] += [success] + results[prefix + power_name] += [success] + results[prefix + 'Order %s' % order_type] += [success] + results[prefix + 'Season %s' % season] += [success] + results[prefix + 'Phase %s' % phase] += [success] + results[prefix + 'Position %d' % position] += [success] + if order_type != 'WAIVE': + results[prefix + 'Loc %s' % loc] += [success] + results[stats_key] = results.get(stats_key, []) + [success] + + # Storing (log_probs, mismatch) + results[prefix + 'LogProbsDetails'][0][request_id] = (log_probs[batch_ix].sum(), + int(player_orders_mismatch)) + + # Returning results + return results + + @staticmethod + def _post_process_results(detailed_results): + """ Perform post-processing on the detailed results + :param detailed_results: An dictionary which contains detailed evaluation statistics + :return: A dictionary with the post-processed statistics. + """ + # Adding [Gr]SearchFailure (== 1. iff. logprob(label) > logprob(greedy) and greedy != label) + # Adding [TF]Acc_Player and [Gr]Acc_Player + # Removing LogProbsDetails + + # Make sure the detailed results have the correct key (i.e. they have not yet been post-processed) + for prefix in ['[TF]', '[Gr]']: + assert prefix + 'LogProbsDetails' in detailed_results + + # Building a dictionary {request_id: (log_probs, mismatch)} + tf_items, gr_items = {}, {} + for tf_item in detailed_results['[TF]LogProbsDetails']: + tf_items.update(tf_item) + for gr_item in detailed_results['[Gr]LogProbsDetails']: + gr_items.update(gr_item) + + # Making sure we have processed the same number of TF items and Gr items + tf_nb_items = len(tf_items) + gr_nb_items = len(gr_items) + if tf_nb_items != gr_nb_items: + LOGGER.warning('Got a different number of items between [TF] (%d items) and [Gr] (%d items)', + tf_nb_items, gr_nb_items) + + # Computing search failure and mismatch + search_failure, gr_acc_player, tf_acc_player = [], [], [] + for request_id in tf_items: + if request_id not in gr_items: + LOGGER.warning('Item %s was computed using [TF], but is missing for [Gr]. Skipping.', request_id) + continue + + tf_logprobs, tf_mismatch = tf_items[request_id] + gr_logprobs, gr_mismatch = gr_items[request_id] + + # Computing stats + if gr_mismatch: + search_failure += [int(tf_logprobs > gr_logprobs)] + tf_acc_player += [int(not tf_mismatch)] + gr_acc_player += [int(not gr_mismatch)] + + # Removing extra keys and adding new keys + detailed_results['[Gr]SearchFailure'] = search_failure + detailed_results['[TF]Acc_Player'] = tf_acc_player + detailed_results['[Gr]Acc_Player'] = gr_acc_player + del detailed_results['[TF]LogProbsDetails'] + del detailed_results['[Gr]LogProbsDetails'] + + # Returning post-processed results + return detailed_results diff --git a/diplomacy_research/models/policy/token_based/train.py b/diplomacy_research/models/policy/token_based/train.py new file mode 100644 index 0000000..db4e73b --- /dev/null +++ b/diplomacy_research/models/policy/token_based/train.py @@ -0,0 +1,71 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (token_based) + - Contains the training methods for the policy model +""" +import os +from diplomacy_research.models.policy.token_based import PolicyAdapter +from diplomacy_research.models.training.supervised import SupervisedTrainer +from diplomacy_research.utils.cluster import start_distributed_training +from diplomacy_research.utils.cluster_config.supervised import get_cluster_config +from diplomacy_research.utils.model import load_dynamically_from_model_id, load_dataset_builder +from diplomacy_research.utils.model import parse_args_into_flags, run_app +from diplomacy_research.settings import ROOT_DIR + +def main(_): + """ Trains the policy model """ + def start_supervised_training(cluster_config, _): + """ Callable fn to start training """ + SupervisedTrainer(policy_constructor=PolicyModel, + value_constructor=ValueModel, + draw_constructor=DrawModel, + dataset_builder=DatasetBuilder(), + adapter_constructor=PolicyAdapter, + cluster_config=cluster_config, + flags=FLAGS).start() + + # Detecting if we need to start regular or distributed training + start_distributed_training(callable_fn=start_supervised_training, + flags=FLAGS, + get_cluster_config_fn=get_cluster_config, + with_process_pool=False) + +if __name__ == '__main__': + + # Detecting PolicyModel, and load_args + PolicyModel, load_args = load_dynamically_from_model_id(['PolicyModel', 'load_args'], arg_name='model_id') # pylint: disable=invalid-name + + # Detecting ValueModel, and load_args + ValueModel, load_value_args = load_dynamically_from_model_id(['ValueModel', 'load_args'], # pylint: disable=invalid-name + arg_name='value_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'value'), + on_error='ignore') + + # Detecting DrawModel, and load_args + DrawModel, load_draw_args = load_dynamically_from_model_id(['DrawModel', 'load_args'], # pylint: disable=invalid-name + arg_name='draw_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'draw'), + on_error='ignore') + + # Loading args + ARGS = load_args() \ + + (load_value_args() if load_value_args is not None else []) \ + + (load_draw_args() if load_draw_args is not None else []) + FLAGS = parse_args_into_flags(ARGS) + + # Loading DatasetBuilder + DatasetBuilder = load_dataset_builder(FLAGS.dataset) # pylint: disable=invalid-name + + # Running + run_app() diff --git a/diplomacy_research/models/policy/token_based/v001_markovian_no_film/__init__.py b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/__init__.py new file mode 100644 index 0000000..766c728 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v001_markovian_no_film Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/token_based/v001_markovian_no_film/model.py b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/model.py new file mode 100644 index 0000000..0afe45b --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/model.py @@ -0,0 +1,383 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v001_markovian_no_film) + - Contains the policy model (v001_markovian_no_film), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.token_based import TokenBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, VOCABULARY_SIZE, TOKENS_PER_ORDER, \ + NB_SUPPLY_CENTERS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 8, 'Number of Graph Conv Layer'), + ('int', 'word_emb_size', 400, 'Word embedding size.'), + ('int', 'gcn_size', 80, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 400, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 80, 'LSTM decoder attention size.'), + ] + +class PolicyModel(TokenBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import GraphConvolution, preprocess_adjacency + from diplomacy_research.utils.tensorflow import batch_norm + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = board_state + + # First Layer + graph_conv = GraphConvolution(input_dim=graph_conv.shape[-1].value, # (b, NB_NODES, gcn_size) + output_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + bias=True)(graph_conv) + graph_conv = batch_norm(graph_conv, is_training=pholder('is_training'), fused=True) + + # Intermediate Layers + for _ in range(1, hps('nb_graph_conv') - 1): + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, gcn_size) + output_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + bias=True)(graph_conv) + graph_conv = batch_norm(graph_conv, is_training=pholder('is_training'), fused=True) + + # Final Layer + graph_conv = GraphConvolution(input_dim=hps('gcn_size'), # (b, NB_NODES, attn_size) + output_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + activation_fn=None, + bias=True)(graph_conv) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import build_sparse_batched_tensor, pad_axis, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Building decoder mask + decoder_mask_indices = self.features['decoder_mask_indices'] # tf.int64 - (b, 3 * len) + decoder_mask_shape = self.proto_fields['decoder_mask'].shape + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding inputs + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + decoder_mask_indices = pad_axis(decoder_mask_indices, axis=-1, min_size=len(decoder_mask_shape)) + + # Reshaping to (b, len, 3) + # decoder_mask is -- tf.bool (batch, TOK/ORD * NB_SC, VOCAB_SIZE, VOCAB_SIZE) + decoder_mask_indices = tf.reshape(decoder_mask_indices, [batch_size, -1, len(decoder_mask_shape)]) + decoder_mask = build_sparse_batched_tensor(decoder_mask_indices, + value=True, + dtype=tf.bool, + dense_shape=decoder_mask_shape) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating word embedding vector (to embed word_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('word_embedding_scope'): + # embedding: (voc_size, 256) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + word_embedding = uniform(name='word_embedding', + shape=[VOCABULARY_SIZE, hps('word_emb_size')], + scale=1., + caching_device=caching_device) + + # Building output tags + outputs = {'batch_size': batch_size, + 'decoder_inputs': decoder_inputs, + 'decoder_mask': decoder_mask, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'word_embedding': word_embedding, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import AttentionWrapper, BahdanauAttention + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import MaskedBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.token_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_mask = self.outputs['decoder_mask'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + word_embedding = self.outputs['word_embedding'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # decoder output to token + decoder_output_layer = tf.layers.Dense(units=VOCABULARY_SIZE, + activation=None, + kernel_initializer=tf.random_normal_initializer, + use_bias=True) + + # ======== Regular Decoding ======== + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_scope = tf.VariableScope(name='policy/decoder_scope/Attention', reuse=tf.AUTO_REUSE) + attention_mechanism = BahdanauAttention(num_units=hps('attn_size'), + memory=board_state_conv, + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(board_state_conv, axis=1)) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + embedding=word_embedding, + sequence_length=decoder_lengths, + mask=decoder_mask, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + model_decoder = MaskedBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + output_layer=decoder_output_layer, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_mechanism = BahdanauAttention(num_units=hps('attn_size'), + memory=tile_beam(board_state_conv), + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(tile_beam(board_state_conv), + axis=1)) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + embedding=word_embedding, + mask=decoder_mask, + sequence_length=decoder_lengths, + output_layer=decoder_output_layer, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + logits = training_results.rnn_output # (b, dec_len, VOCAB_SIZE) + logits_length = tf.shape(logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Argmax tokens are the most likely token outputted at each position + argmax_tokens = to_int32(to_float(tf.argmax(logits, axis=-1)) * sequence_mask) + log_probs = -1. * cross_entropy(logits=logits, labels=selected_tokens) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=logits, + targets=decoder_target, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/token_based/v001_markovian_no_film': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/token_based/v001_markovian_no_film/tests/__init__.py b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/v001_markovian_no_film/tests/test_model.py b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/tests/test_model.py new file mode 100644 index 0000000..70cf381 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v001_markovian_no_film/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.token_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.token_based.v001_markovian_no_film import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'token_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/token_based/v002_markovian_film/__init__.py b/diplomacy_research/models/policy/token_based/v002_markovian_film/__init__.py new file mode 100644 index 0000000..7faf7a8 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v002_markovian_film/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v002_markovian_film Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/token_based/v002_markovian_film/model.py b/diplomacy_research/models/policy/token_based/v002_markovian_film/model.py new file mode 100644 index 0000000..bf2e117 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v002_markovian_film/model.py @@ -0,0 +1,404 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v002_markovian_film) + - Contains the policy model (v002_markovian_film), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.token_based import TokenBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, VOCABULARY_SIZE, TOKENS_PER_ORDER, \ + NB_SUPPLY_CENTERS, NB_POWERS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 8, 'Number of Graph Conv Layer'), + ('int', 'word_emb_size', 400, 'Word embedding size.'), + ('int', 'power_emb_size', 64, 'Power embedding size.'), + ('int', 'gcn_size', 80, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 400, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 80, 'LSTM decoder attention size.'), + ] + +class PolicyModel(TokenBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, attn_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import build_sparse_batched_tensor, pad_axis, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + current_power = self.features['current_power'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Building decoder mask + decoder_mask_indices = self.features['decoder_mask_indices'] # tf.int64 - (b, 3 * len) + decoder_mask_shape = self.proto_fields['decoder_mask'].shape + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding inputs + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + decoder_mask_indices = pad_axis(decoder_mask_indices, axis=-1, min_size=len(decoder_mask_shape)) + + # Reshaping to (b, len, 3) + # decoder_mask is -- tf.bool (batch, TOK/ORD * NB_SC, VOCAB_SIZE, VOCAB_SIZE) + decoder_mask_indices = tf.reshape(decoder_mask_indices, [batch_size, -1, len(decoder_mask_shape)]) + decoder_mask = build_sparse_batched_tensor(decoder_mask_indices, + value=True, + dtype=tf.bool, + dense_shape=decoder_mask_shape) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size')] + film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(current_power_embedding)[:, None, :] + film_gammas, film_betas = tf.split(film_weights, 2, axis=2) # (b, 1, 750) + film_gammas = tf.split(film_gammas, film_output_dims, axis=2) + film_betas = tf.split(film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', film_gammas) + self.add_output('_board_state_conv_film_betas', film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding the board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating word embedding vector (to embed word_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('word_embedding_scope'): + # embedding: (voc_size, 256) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + word_embedding = uniform(name='word_embedding', + shape=[VOCABULARY_SIZE, hps('word_emb_size')], + scale=1., + caching_device=caching_device) + + # Building output tags + outputs = {'batch_size': batch_size, + 'decoder_inputs': decoder_inputs, + 'decoder_mask': decoder_mask, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'word_embedding': word_embedding, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import AttentionWrapper, ModifiedBahdanauAttention + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import MaskedBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.token_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_mask = self.outputs['decoder_mask'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + word_embedding = self.outputs['word_embedding'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # decoder output to token + decoder_output_layer = tf.layers.Dense(units=VOCABULARY_SIZE, + activation=None, + kernel_initializer=tf.random_normal_initializer, + use_bias=True) + + # ======== Regular Decoding ======== + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_scope = tf.VariableScope(name='policy/decoder_scope/Attention', reuse=tf.AUTO_REUSE) + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=board_state_conv, + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(board_state_conv, axis=1)) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + embedding=word_embedding, + sequence_length=decoder_lengths, + mask=decoder_mask, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + model_decoder = MaskedBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + output_layer=decoder_output_layer, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=tile_beam(board_state_conv), + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + decoder_init_state = decoder_init_state.clone(attention=tf.reduce_mean(tile_beam(board_state_conv), + axis=1)) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + embedding=word_embedding, + mask=decoder_mask, + sequence_length=decoder_lengths, + output_layer=decoder_output_layer, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + logits = training_results.rnn_output # (b, dec_len, VOCAB_SIZE) + logits_length = tf.shape(logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Argmax tokens are the most likely token outputted at each position + argmax_tokens = to_int32(to_float(tf.argmax(logits, axis=-1)) * sequence_mask) + log_probs = -1. * cross_entropy(logits=logits, labels=selected_tokens) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=logits, + targets=decoder_target, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/token_based/v002_markovian_film': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/token_based/v002_markovian_film/tests/__init__.py b/diplomacy_research/models/policy/token_based/v002_markovian_film/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v002_markovian_film/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/v002_markovian_film/tests/test_model.py b/diplomacy_research/models/policy/token_based/v002_markovian_film/tests/test_model.py new file mode 100644 index 0000000..97af967 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v002_markovian_film/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.token_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.token_based.v002_markovian_film import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'token_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/token_based/v003_film_prev_order/.deprecated b/diplomacy_research/models/policy/token_based/v003_film_prev_order/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/token_based/v004_language_model/__init__.py b/diplomacy_research/models/policy/token_based/v004_language_model/__init__.py new file mode 100644 index 0000000..766c728 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v004_language_model/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v001_markovian_no_film Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/token_based/v004_language_model/model.py b/diplomacy_research/models/policy/token_based/v004_language_model/model.py new file mode 100644 index 0000000..ad4bf54 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v004_language_model/model.py @@ -0,0 +1,301 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v004_language_model) + - Only the language model +""" +import logging +from diplomacy_research.models.policy.token_based import TokenBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import VOCABULARY_SIZE, TOKENS_PER_ORDER, NB_SUPPLY_CENTERS, NB_NODES + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'word_emb_size', 256, 'Word embedding size.'), + ('int', 'lstm_size', 128, 'LSTM (Encoder and Decoder) size.'), + ] + +class PolicyModel(TokenBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + # This model doesn't encode the board state - Returning the inputs + del name, reuse # Unused args + return board_state + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + # This model does not support any board state + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import build_sparse_batched_tensor, pad_axis, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Building decoder mask + decoder_mask_indices = self.features['decoder_mask_indices'] # tf.int64 - (b, 3 * len) + decoder_mask_shape = self.proto_fields['decoder_mask'].shape + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding inputs + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + decoder_mask_indices = pad_axis(decoder_mask_indices, axis=-1, min_size=len(decoder_mask_shape)) + + # Reshaping to (b, len, 3) + # decoder_mask is -- tf.bool (batch, TOK/ORD * NB_SC, VOCAB_SIZE, VOCAB_SIZE) + decoder_mask_indices = tf.reshape(decoder_mask_indices, [batch_size, -1, len(decoder_mask_shape)]) + decoder_mask = build_sparse_batched_tensor(decoder_mask_indices, + value=True, + dtype=tf.bool, + dense_shape=decoder_mask_shape) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + + # Creating word embedding vector (to embed word_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('word_embedding_scope'): + # embedding: (voc_size, 256) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + word_embedding = uniform(name='word_embedding', + shape=[VOCABULARY_SIZE, hps('word_emb_size')], + scale=1., + caching_device=caching_device) + + # Building output tags + outputs = {'batch_size': batch_size, + 'decoder_inputs': decoder_inputs, + 'decoder_mask': decoder_mask, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': tf.zeros([batch_size, NB_NODES, 0], dtype=tf.float32), + 'board_state_0yr_conv': tf.zeros([batch_size, NB_NODES, 0], dtype=tf.float32), + 'word_embedding': word_embedding, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import MaskedBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.token_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_mask = self.outputs['decoder_mask'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + word_embedding = self.outputs['word_embedding'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # decoder output to token + decoder_output_layer = tf.layers.Dense(units=VOCABULARY_SIZE, + activation=None, + kernel_initializer=tf.random_normal_initializer, + use_bias=True) + + # ======== Regular Decoding ======== + # Applying dropout to input and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size'), + dtype=tf.float32) + + # Blank initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + embedding=word_embedding, + sequence_length=decoder_lengths, + mask=decoder_mask, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + model_decoder = MaskedBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + output_layer=decoder_output_layer, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size'), + dtype=tf.float32) + + # Blank initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + embedding=word_embedding, + mask=decoder_mask, + sequence_length=decoder_lengths, + output_layer=decoder_output_layer, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + logits = training_results.rnn_output # (b, dec_len, VOCAB_SIZE) + logits_length = tf.shape(logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Argmax tokens are the most likely token outputted at each position + argmax_tokens = to_int32(to_float(tf.argmax(logits, axis=-1)) * sequence_mask) + log_probs = -1. * cross_entropy(logits=logits, labels=selected_tokens) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=logits, + targets=decoder_target, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/token_based/v004_language_model': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/token_based/v004_language_model/tests/__init__.py b/diplomacy_research/models/policy/token_based/v004_language_model/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v004_language_model/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/v004_language_model/tests/test_model.py b/diplomacy_research/models/policy/token_based/v004_language_model/tests/test_model.py new file mode 100644 index 0000000..4521b12 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v004_language_model/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.token_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.token_based.v004_language_model import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'token_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/__init__.py b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/__init__.py new file mode 100644 index 0000000..7389597 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v005_markovian_film_board_align Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/model.py b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/model.py new file mode 100644 index 0000000..e457d43 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/model.py @@ -0,0 +1,412 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v005_markovian_film_board_align) + - Contains the policy model (v005_markovian_film_board_align), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.token_based import TokenBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, VOCABULARY_SIZE, TOKENS_PER_ORDER, \ + NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, NB_SEASONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 8, 'Number of Graph Conv Layer'), + ('int', 'word_emb_size', 400, 'Word embedding size.'), + ('int', 'power_emb_size', 64, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size.'), + ('int', 'gcn_size', 80, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 400, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 80, 'LSTM decoder attention size.') + ] + +class PolicyModel(TokenBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, attn_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import build_sparse_batched_tensor, pad_axis, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Building decoder mask + decoder_mask_indices = self.features['decoder_mask_indices'] # tf.int64 - (b, 3 * len) + decoder_mask_shape = self.proto_fields['decoder_mask'].shape + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding inputs + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + decoder_mask_indices = pad_axis(decoder_mask_indices, axis=-1, min_size=len(decoder_mask_shape)) + + # Reshaping to (b, len, 3) + # decoder_mask is -- tf.bool (batch, TOK/ORD * NB_SC, VOCAB_SIZE, VOCAB_SIZE) + decoder_mask_indices = tf.reshape(decoder_mask_indices, [batch_size, -1, len(decoder_mask_shape)]) + decoder_mask = build_sparse_batched_tensor(decoder_mask_indices, + value=True, + dtype=tf.bool, + dense_shape=decoder_mask_shape) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size')] + film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + film_gammas, film_betas = tf.split(film_weights, 2, axis=2) # (b, 1, 750) + film_gammas = tf.split(film_gammas, film_output_dims, axis=2) + film_betas = tf.split(film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', film_gammas) + self.add_output('_board_state_conv_film_betas', film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating word embedding vector (to embed word_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('word_embedding_scope'): + # embedding: (voc_size, 256) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + word_embedding = uniform(name='word_embedding', + shape=[VOCABULARY_SIZE, hps('word_emb_size')], + scale=1., + caching_device=caching_device) + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_mask': decoder_mask, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'word_embedding': word_embedding, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import MaskedBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.token_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_mask = self.outputs['decoder_mask'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + word_embedding = self.outputs['word_embedding'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # decoder output to token + decoder_output_layer = tf.layers.Dense(units=VOCABULARY_SIZE, + activation=None, + kernel_initializer=tf.random_normal_initializer, + use_bias=True) + + # ======== Regular Decoding ======== + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + embedding=word_embedding, + sequence_length=decoder_lengths, + mask=decoder_mask, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + model_decoder = MaskedBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + output_layer=decoder_output_layer, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + embedding=word_embedding, + mask=decoder_mask, + sequence_length=decoder_lengths, + output_layer=decoder_output_layer, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + logits = training_results.rnn_output # (b, dec_len, VOCAB_SIZE) + logits_length = tf.shape(logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Argmax tokens are the most likely token outputted at each position + argmax_tokens = to_int32(to_float(tf.argmax(logits, axis=-1)) * sequence_mask) + log_probs = -1. * cross_entropy(logits=logits, labels=selected_tokens) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=logits, + targets=decoder_target, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/token_based/v005_markovian_film_board_align': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/tests/__init__.py b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/tests/test_model.py b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/tests/test_model.py new file mode 100644 index 0000000..77edef8 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v005_markovian_film_board_align/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.token_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.token_based.v005_markovian_film_board_align import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'token_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/__init__.py b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/__init__.py new file mode 100644 index 0000000..c794ac1 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v006_markovian_film_both_attn Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/model.py b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/model.py new file mode 100644 index 0000000..bb4b829 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/model.py @@ -0,0 +1,436 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v006_markovian_film_both_attn) + - Contains the policy model (v006_markovian_film_both_attn), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.token_based import TokenBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, VOCABULARY_SIZE, TOKENS_PER_ORDER, \ + NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, NB_SEASONS + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 8, 'Number of Graph Conv Layer'), + ('int', 'word_emb_size', 400, 'Word embedding size.'), + ('int', 'power_emb_size', 64, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size.'), + ('int', 'gcn_size', 80, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 400, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 80, 'LSTM decoder attention size.'), + ] + +class PolicyModel(TokenBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, attn_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + return board_0yr_conv + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import build_sparse_batched_tensor, pad_axis, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Building decoder mask + decoder_mask_indices = self.features['decoder_mask_indices'] # tf.int64 - (b, 3 * len) + decoder_mask_shape = self.proto_fields['decoder_mask'].shape + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding inputs + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + decoder_mask_indices = pad_axis(decoder_mask_indices, axis=-1, min_size=len(decoder_mask_shape)) + + # Reshaping to (b, len, 3) + # decoder_mask is -- tf.bool (batch, TOK/ORD * NB_SC, VOCAB_SIZE, VOCAB_SIZE) + decoder_mask_indices = tf.reshape(decoder_mask_indices, [batch_size, -1, len(decoder_mask_shape)]) + decoder_mask = build_sparse_batched_tensor(decoder_mask_indices, + value=True, + dtype=tf.bool, + dense_shape=decoder_mask_shape) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size')] + film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + film_gammas, film_betas = tf.split(film_weights, 2, axis=2) # (b, 1, 750) + film_gammas = tf.split(film_gammas, film_output_dims, axis=2) + film_betas = tf.split(film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', film_gammas) + self.add_output('_board_state_conv_film_betas', film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training) + + # Creating word embedding vector (to embed word_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('word_embedding_scope'): + # embedding: (voc_size, 256) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + word_embedding = uniform(name='word_embedding', + shape=[VOCABULARY_SIZE, hps('word_emb_size')], + scale=1., + caching_device=caching_device) + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_mask': decoder_mask, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'word_embedding': word_embedding, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import AttentionWrapper, ModifiedBahdanauAttention, \ + StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import MaskedBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.token_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_mask = self.outputs['decoder_mask'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + word_embedding = self.outputs['word_embedding'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # decoder output to token + decoder_output_layer = tf.layers.Dense(units=VOCABULARY_SIZE, + activation=None, + kernel_initializer=tf.random_normal_initializer, + use_bias=True) + + # ======== Regular Decoding ======== + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + 2 * hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_scope = tf.VariableScope(name='policy/decoder_scope/Attention', reuse=tf.AUTO_REUSE) + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=board_state_conv, + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + embedding=word_embedding, + sequence_length=decoder_lengths, + mask=decoder_mask, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + model_decoder = MaskedBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + output_layer=decoder_output_layer, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + 2 * hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # apply attention over location + # curr_state [batch, NB_NODES, attn_size] + attention_mechanism = ModifiedBahdanauAttention(num_units=hps('attn_size'), + memory=tile_beam(board_state_conv), + normalize=True, + name_or_scope=attention_scope) + decoder_cell = AttentionWrapper(cell=decoder_cell, + attention_mechanism=attention_mechanism, + output_attention=False, + name_or_scope=attention_scope) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + embedding=word_embedding, + mask=decoder_mask, + sequence_length=decoder_lengths, + output_layer=decoder_output_layer, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + logits = training_results.rnn_output # (b, dec_len, VOCAB_SIZE) + logits_length = tf.shape(logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Argmax tokens are the most likely token outputted at each position + argmax_tokens = to_int32(to_float(tf.argmax(logits, axis=-1)) * sequence_mask) + log_probs = -1. * cross_entropy(logits=logits, labels=selected_tokens) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=logits, + targets=decoder_target, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/token_based/v006_markovian_film_both_attn': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/tests/__init__.py b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/tests/test_model.py b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/tests/test_model.py new file mode 100644 index 0000000..edb702e --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v006_markovian_film_both_attn/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.token_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.token_based.v006_markovian_film_both_attn import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'token_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/token_based/v007_mark_hier_film_board_align/.deprecated b/diplomacy_research/models/policy/token_based/v007_mark_hier_film_board_align/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/token_based/v008_mark_hier_film_bd_align_self_attn/.deprecated b/diplomacy_research/models/policy/token_based/v008_mark_hier_film_bd_align_self_attn/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/token_based/v009_mark_film_board_align_self_attn/.deprecated b/diplomacy_research/models/policy/token_based/v009_mark_film_board_align_self_attn/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/__init__.py b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/__init__.py new file mode 100644 index 0000000..410a09e --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v010_film_diff_w_board_align_prev_ord Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/model.py b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/model.py new file mode 100644 index 0000000..7f9a56a --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/model.py @@ -0,0 +1,447 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v010_film_diff_w_board_align_prev_ord) + - Contains the policy model (v010_film_diff_w_board_align_prev_ord), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.token_based import TokenBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, VOCABULARY_SIZE, TOKENS_PER_ORDER, \ + NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, NB_SEASONS, NB_PREV_ORDERS, NB_ORDERS_FEATURES + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 16, 'Number of Graph Conv Layer'), + ('int', 'word_emb_size', 80, 'Word embedding size.'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size.'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 200, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.'), + ] + +class PolicyModel(TokenBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, final_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size') // 2, + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + from diplomacy_research.utils.tensorflow import tf + assert prev_ord_conv is not None, 'This model requires a prev_ord_conv argument' + return tf.concat([board_0yr_conv, prev_ord_conv], axis=-1) + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import build_sparse_batched_tensor, pad_axis, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + prev_orders_state = to_float(self.features['prev_orders_state']) # (b, NB_PRV_OD, NB_ND, NB_OD_FT) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Building decoder mask + decoder_mask_indices = self.features['decoder_mask_indices'] # tf.int64 - (b, 3 * len) + decoder_mask_shape = self.proto_fields['decoder_mask'].shape + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding inputs + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + decoder_mask_indices = pad_axis(decoder_mask_indices, axis=-1, min_size=len(decoder_mask_shape)) + + # Reshaping to (b, len, 3) + # decoder_mask is -- tf.bool (batch, TOK/ORD * NB_SC, VOCAB_SIZE, VOCAB_SIZE) + decoder_mask_indices = tf.reshape(decoder_mask_indices, [batch_size, -1, len(decoder_mask_shape)]) + decoder_mask = build_sparse_batched_tensor(decoder_mask_indices, + value=True, + dtype=tf.bool, + dense_shape=decoder_mask_shape) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size') // 2] + + # For board state + board_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + board_film_gammas, board_film_betas = tf.split(board_film_weights, 2, axis=2) # (b, 1, 750) + board_film_gammas = tf.split(board_film_gammas, film_output_dims, axis=2) + board_film_betas = tf.split(board_film_betas, film_output_dims, axis=2) + + # For prev_orders + prev_ord_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + prev_ord_film_weights = tf.tile(prev_ord_film_weights, [NB_PREV_ORDERS, 1, 1]) # (n_pr, 1, 750) + prev_ord_film_gammas, prev_ord_film_betas = tf.split(prev_ord_film_weights, 2, axis=2) + prev_ord_film_gammas = tf.split(prev_ord_film_gammas, film_output_dims, axis=2) + prev_ord_film_betas = tf.split(prev_ord_film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', board_film_gammas) + self.add_output('_board_state_conv_film_betas', board_film_betas) + self.add_output('_prev_orders_conv_film_gammas', prev_ord_film_gammas) + self.add_output('_prev_orders_conv_film_betas', prev_ord_film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + assert hps('attn_size') % 2 == 0 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + + # Encoding prev_orders + prev_orders_state = tf.reshape(prev_orders_state, [batch_size * NB_PREV_ORDERS, + NB_NODES, + NB_ORDERS_FEATURES]) + prev_ord_conv = self.encode_board(prev_orders_state, name='prev_orders_conv') + + # Splitting back into (b, nb_prev, NB_NODES, attn_size // 2) + # Reducing the prev ord conv using avg + prev_ord_conv = tf.reshape(prev_ord_conv, [batch_size, + NB_PREV_ORDERS, + NB_NODES, + hps('attn_size') // 2]) + prev_ord_conv = tf.reduce_mean(prev_ord_conv, axis=1) + + # Concatenating the current board conv with the prev ord conv + # The final board_state_conv should be of dimension (b, NB_NODE, attn_size) + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training, prev_ord_conv) + + # Creating word embedding vector (to embed word_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('word_embedding_scope'): + # embedding: (voc_size, 256) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + word_embedding = uniform(name='word_embedding', + shape=[VOCABULARY_SIZE, hps('word_emb_size')], + scale=1., + caching_device=caching_device) + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_mask': decoder_mask, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'prev_ord_conv': prev_ord_conv, + 'word_embedding': word_embedding, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import MaskedBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.policy.token_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_mask = self.outputs['decoder_mask'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + word_embedding = self.outputs['word_embedding'] + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + lstm_cell = tf.contrib.rnn.LSTMBlockCell(hps('lstm_size')) + + # decoder output to token + decoder_output_layer = tf.layers.Dense(units=VOCABULARY_SIZE, + activation=None, + kernel_initializer=tf.random_normal_initializer, + use_bias=True) + + # ======== Regular Decoding ======== + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + output_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + embedding=word_embedding, + sequence_length=decoder_lengths, + mask=decoder_mask, + time_major=False, + softmax_temperature=temperature) + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + model_decoder = MaskedBasicDecoder(cell=decoder_cell, + helper=helper, + initial_state=decoder_init_state, + output_layer=decoder_output_layer, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + + # Applying dropout to input + attention and to output layer + decoder_cell = SeededDropoutWrapper(cell=lstm_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + output_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('word_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + decoder_cell = StaticAttentionWrapper(cell=decoder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + decoder_init_state = decoder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=decoder_cell, + embedding=word_embedding, + mask=decoder_mask, + sequence_length=decoder_lengths, + output_layer=decoder_output_layer, + initial_state=decoder_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + logits = training_results.rnn_output # (b, dec_len, VOCAB_SIZE) + logits_length = tf.shape(logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Argmax tokens are the most likely token outputted at each position + argmax_tokens = to_int32(to_float(tf.argmax(logits, axis=-1)) * sequence_mask) + log_probs = -1. * cross_entropy(logits=logits, labels=selected_tokens) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=logits, + targets=decoder_target, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/token_based/v010_film_diff_w_board_align_prev_ord': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/tests/__init__.py b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/tests/test_model.py b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/tests/test_model.py new file mode 100644 index 0000000..398338b --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v010_film_diff_w_board_align_prev_ord/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.token_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.token_based.v010_film_diff_w_board_align_prev_ord import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'token_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/__init__.py b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/__init__.py new file mode 100644 index 0000000..41cb001 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v011_film_transformer_gpt Policy Model """ +from .model import PolicyModel, load_args diff --git a/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/model.py b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/model.py new file mode 100644 index 0000000..529e08a --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/model.py @@ -0,0 +1,507 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Policy model (v011_film_transformer_gpt) + - Contains the policy model (v011_film_transformer_gpt), to evaluate the best actions given a state +""" +import logging +from diplomacy_research.models.policy.token_based import TokenBasedPolicyModel, load_args as load_parent_args +from diplomacy_research.models.state_space import get_adjacency_matrix, VOCABULARY_SIZE, TOKENS_PER_ORDER, \ + NB_SUPPLY_CENTERS, NB_POWERS, NB_NODES, NB_SEASONS, NB_PREV_ORDERS, NB_ORDERS_FEATURES + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'nb_graph_conv', 12, 'Number of Graph Conv Layer'), + ('int', 'power_emb_size', 60, 'Power embedding size.'), + ('int', 'season_emb_size', 20, 'Season embedding size.'), + ('int', 'gcn_size', 120, 'Size of graph convolution outputs.'), + ('int', 'attn_size', 120, 'LSTM decoder attention size.'), + ('int', 'trsf_ctxt_size', 1000 + NB_SUPPLY_CENTERS * TOKENS_PER_ORDER, 'Size of the context.'), + ('int', 'trsf_emb_size', 80, 'The size of the embedding for the vocabulary and the context'), + ('int', 'trsf_nb_heads', 2, 'The number of attention heads to use for transformer'), + ('int', 'trsf_nb_layers', 4, 'The number of layers to use for transformer') + ] + +class PolicyModel(TokenBasedPolicyModel): + """ Policy Model """ + + def _encode_board(self, board_state, name, reuse=None): + """ Encodes a board state or prev orders state + :param board_state: The board state / prev orders state to encode - (batch, NB_NODES, initial_features) + :param name: The name to use for the encoding + :param reuse: Whether to reuse or not the weights from another encoding operation + :return: The encoded board state / prev_orders state + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import film_gcn_res_block, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Getting film gammas and betas + film_gammas = self.outputs['_%s_film_gammas' % name] + film_betas = self.outputs['_%s_film_betas' % name] + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + scope = tf.VariableScope(name='policy/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Adding noise to break symmetry + board_state = board_state + tf.random_normal(tf.shape(board_state), stddev=0.01) + graph_conv = tf.layers.Dense(units=hps('gcn_size'), activation=relu)(board_state) + + # First and intermediate layers + for layer_idx in range(hps('nb_graph_conv') - 1): + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, gcn_size) + gamma=film_gammas[layer_idx], + beta=film_betas[layer_idx], + gcn_out_dim=hps('gcn_size'), + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=True) + + # Last layer + graph_conv = film_gcn_res_block(inputs=graph_conv, # (b, NB_NODES, final_size) + gamma=film_gammas[-1], + beta=film_betas[-1], + gcn_out_dim=hps('attn_size') // 2, + norm_adjacency=norm_adjacency, + is_training=pholder('is_training'), + residual=False) + + # Returning + return graph_conv + + def _get_board_state_conv(self, board_0yr_conv, is_training, prev_ord_conv=None): + """ Computes the board state conv to use as the attention target (memory) + + :param board_0yr_conv: The board state encoding of the current (present) board state) + :param is_training: Indicate whether we are doing training or inference + :param prev_ord_conv: Optional. The encoding of the previous orders state. + :return: The board state conv to use as the attention target (memory) + """ + from diplomacy_research.utils.tensorflow import tf + assert prev_ord_conv is not None, 'This model requires a prev_ord_conv argument' + return tf.concat([board_0yr_conv, prev_ord_conv], axis=-1) + + def _build_policy_initial(self): + """ Builds the policy model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.utils.tensorflow import build_sparse_batched_tensor, pad_axis, to_float, to_bool + + if not self.placeholders: + self.placeholders = self.get_placeholders() + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.flt32 - (b, NB_NODES, NB_FEATURES) + board_alignments = to_float(self.features['board_alignments']) # (b, NB_NODES * len) + prev_orders_state = to_float(self.features['prev_orders_state']) # (b, NB_PRV_OD, NB_ND, NB_OD_FT) + decoder_inputs = self.features['decoder_inputs'] # tf.int32 - (b, <= 1 + TOK/ORD * NB_SCS) + decoder_lengths = self.features['decoder_lengths'] # tf.int32 - (b,) + current_power = self.features['current_power'] # tf.int32 - (b,) + current_season = self.features['current_season'] # tf.int32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Batch size + batch_size = tf.shape(board_state)[0] + + # Reshaping board alignments + board_alignments = tf.reshape(board_alignments, [batch_size, -1, NB_NODES]) + board_alignments /= tf.math.maximum(1., tf.reduce_sum(board_alignments, axis=-1, keepdims=True)) + + # Building decoder mask + decoder_mask_indices = self.features['decoder_mask_indices'] # tf.int64 - (b, 3 * len) + decoder_mask_shape = self.proto_fields['decoder_mask'].shape + + # Overriding dropout_rates if pholder('dropout_rate') > 0 + dropout_rates = tf.cond(tf.greater(pholder('dropout_rate'), 0.), + true_fn=lambda: tf.zeros_like(dropout_rates) + pholder('dropout_rate'), + false_fn=lambda: dropout_rates) + + # Padding inputs + board_alignments = pad_axis(board_alignments, axis=1, min_size=tf.reduce_max(decoder_lengths)) + decoder_inputs = pad_axis(decoder_inputs, axis=-1, min_size=2) + decoder_mask_indices = pad_axis(decoder_mask_indices, axis=-1, min_size=len(decoder_mask_shape)) + + # Reshaping to (b, len, 3) + # decoder_mask is -- tf.bool (batch, TOK/ORD * NB_SC, VOCAB_SIZE, VOCAB_SIZE) + decoder_mask_indices = tf.reshape(decoder_mask_indices, [batch_size, -1, len(decoder_mask_shape)]) + decoder_mask = build_sparse_batched_tensor(decoder_mask_indices, + value=True, + dtype=tf.bool, + dense_shape=decoder_mask_shape) + + # Making sure all RNN lengths are at least 1 + # No need to trim, because the fields are variable length + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Placeholders + decoder_type = tf.reduce_max(pholder('decoder_type')) + is_training = pholder('is_training') + + # Computing FiLM Gammas and Betas + with tf.variable_scope('film_scope'): + power_embedding = uniform(name='power_embedding', + shape=[NB_POWERS, hps('power_emb_size')], + scale=1.) + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + current_power_embedding = tf.reduce_sum(power_embedding[None] + * current_power_mask[:, :, None], axis=1) # (b, power_emb) + film_embedding_input = current_power_embedding + + # Also conditioning on current_season + season_embedding = uniform(name='season_embedding', + shape=[NB_SEASONS, hps('season_emb_size')], + scale=1.) + current_season_mask = tf.one_hot(current_season, NB_SEASONS, dtype=tf.float32) + current_season_embedding = tf.reduce_sum(season_embedding[None] # (b,season_emb) + * current_season_mask[:, :, None], axis=1) + film_embedding_input = tf.concat([film_embedding_input, current_season_embedding], axis=1) + + film_output_dims = [hps('gcn_size')] * (hps('nb_graph_conv') - 1) + [hps('attn_size') // 2] + + # For board state + board_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + board_film_gammas, board_film_betas = tf.split(board_film_weights, 2, axis=2) # (b, 1, 750) + board_film_gammas = tf.split(board_film_gammas, film_output_dims, axis=2) + board_film_betas = tf.split(board_film_betas, film_output_dims, axis=2) + + # For prev_orders + prev_ord_film_weights = tf.layers.Dense(units=2 * sum(film_output_dims), # (b, 1, 750) + use_bias=True, + activation=None)(film_embedding_input)[:, None, :] + prev_ord_film_weights = tf.tile(prev_ord_film_weights, [NB_PREV_ORDERS, 1, 1]) # (n_pr, 1, 750) + prev_ord_film_gammas, prev_ord_film_betas = tf.split(prev_ord_film_weights, 2, axis=2) + prev_ord_film_gammas = tf.split(prev_ord_film_gammas, film_output_dims, axis=2) + prev_ord_film_betas = tf.split(prev_ord_film_betas, film_output_dims, axis=2) + + # Storing as temporary output + self.add_output('_board_state_conv_film_gammas', board_film_gammas) + self.add_output('_board_state_conv_film_betas', board_film_betas) + self.add_output('_prev_orders_conv_film_gammas', prev_ord_film_gammas) + self.add_output('_prev_orders_conv_film_betas', prev_ord_film_betas) + + # Creating graph convolution + with tf.variable_scope('graph_conv_scope'): + assert hps('nb_graph_conv') >= 2 + assert hps('attn_size') % 2 == 0 + + # Encoding board state + board_state_0yr_conv = self.encode_board(board_state, name='board_state_conv') + + # Encoding prev_orders + prev_orders_state = tf.reshape(prev_orders_state, [batch_size * NB_PREV_ORDERS, + NB_NODES, + NB_ORDERS_FEATURES]) + prev_ord_conv = self.encode_board(prev_orders_state, name='prev_orders_conv') + + # Splitting back into (b, nb_prev, NB_NODES, attn_size // 2) + # Reducing the prev ord conv using avg + prev_ord_conv = tf.reshape(prev_ord_conv, [batch_size, + NB_PREV_ORDERS, + NB_NODES, + hps('attn_size') // 2]) + prev_ord_conv = tf.reduce_mean(prev_ord_conv, axis=1) + + # Concatenating the current board conv with the prev ord conv + # The final board_state_conv should be of dimension (b, NB_NODE, attn_size) + board_state_conv = self.get_board_state_conv(board_state_0yr_conv, is_training, prev_ord_conv) + + # Creating word embedding vector (to embed word_ix) + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('word_embedding_scope'): + # embedding: (voc_size, 256) + caching_device = self.cluster_config.caching_device if self.cluster_config else None + word_embedding = uniform(name='word_embedding', + shape=[VOCABULARY_SIZE, hps('trsf_emb_size')], + scale=1., + caching_device=caching_device) + + # Building output tags + outputs = {'batch_size': batch_size, + 'board_alignments': board_alignments, + 'decoder_inputs': decoder_inputs, + 'decoder_mask': decoder_mask, + 'decoder_type': decoder_type, + 'raw_decoder_lengths': raw_decoder_lengths, + 'decoder_lengths': decoder_lengths, + 'board_state_conv': board_state_conv, + 'board_state_0yr_conv': board_state_0yr_conv, + 'prev_ord_conv': prev_ord_conv, + 'word_embedding': word_embedding, + 'in_retreat_phase': tf.math.logical_and( # 1) board not empty, 2) disl. units present + tf.reduce_sum(board_state[:], axis=[1, 2]) > 0, + tf.math.logical_not(to_bool(tf.reduce_min(board_state[:, :, 23], -1))))} + + # Adding to graph + self.add_meta_information(outputs) + + def _build_policy_final(self): + """ Builds the policy model (final step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.attention import StaticAttentionWrapper + from diplomacy_research.models.layers.beam_decoder import DiverseBeamSearchDecoder + from diplomacy_research.models.layers.decoder import MaskedBasicDecoder + from diplomacy_research.models.layers.dropout import SeededDropoutWrapper + from diplomacy_research.models.layers.dynamic_decode import dynamic_decode + from diplomacy_research.models.layers.initializers import uniform + from diplomacy_research.models.layers.transformer import TransformerCell + from diplomacy_research.models.layers.wrappers import IdentityCell + from diplomacy_research.models.policy.token_based.helper import CustomHelper, CustomBeamHelper + from diplomacy_research.utils.tensorflow import cross_entropy, sequence_loss, to_int32, to_float, get_tile_beam + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Validates that the context size has not been set for order_based + assert hps('trsf_ctxt_size') != 1000 + NB_SUPPLY_CENTERS, 'Invalid context size for token-based' + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + player_seeds = self.features['player_seed'] # tf.int32 - (b,) + temperature = self.features['temperature'] # tf,flt32 - (b,) + dropout_rates = self.features['dropout_rate'] # tf.flt32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Outputs (from initial steps) + batch_size = self.outputs['batch_size'] + board_alignments = self.outputs['board_alignments'] + decoder_inputs = self.outputs['decoder_inputs'] + decoder_mask = self.outputs['decoder_mask'] + decoder_type = self.outputs['decoder_type'] + raw_decoder_lengths = self.outputs['raw_decoder_lengths'] + decoder_lengths = self.outputs['decoder_lengths'] + board_state_conv = self.outputs['board_state_conv'] + word_embedding = self.outputs['word_embedding'] + + # Creating a smaller position embedding if it's not present in the outputs + # Embeddings needs to be cached locally on the worker, otherwise TF can't compute their gradients + with tf.variable_scope('position_embedding_scope'): + caching_device = self.cluster_config.caching_device if self.cluster_config else None + position_embedding = uniform(name='position_embedding', + shape=[NB_SUPPLY_CENTERS * TOKENS_PER_ORDER, hps('trsf_emb_size')], + scale=1., + caching_device=caching_device) + + # Past Attentions + past_attentions, message_lengths = None, None + + # --- Decoding --- + with tf.variable_scope('decoder_scope', reuse=tf.AUTO_REUSE): + feeder_cell = IdentityCell(output_size=hps('trsf_emb_size') + hps('attn_size')) + + # decoder output to token + decoder_output_layer = tf.layers.Dense(units=VOCABULARY_SIZE, + activation=None, + kernel_initializer=tf.random_normal_initializer, + use_bias=True) + + # ======== Regular Decoding ======== + # Applying dropout to input + attention and to output layer + feeder_cell = SeededDropoutWrapper(cell=feeder_cell, + seeds=player_seeds, + input_keep_probs=1. - dropout_rates, + variational_recurrent=hps('use_v_dropout'), + input_size=hps('trsf_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + feeder_cell = StaticAttentionWrapper(cell=feeder_cell, + memory=board_state_conv, + alignments=board_alignments, + sequence_length=raw_decoder_lengths, + output_attention=False) + + # Setting initial state + feeder_cell_init_state = feeder_cell.zero_state(batch_size, tf.float32) + + # ---- Helper ---- + helper = CustomHelper(decoder_type=decoder_type, + inputs=decoder_inputs[:, :-1], + embedding=word_embedding, + sequence_length=decoder_lengths, + mask=decoder_mask, + time_major=False, + softmax_temperature=temperature) + + # ---- Transformer Cell ---- + trsf_scope = tf.VariableScope(name='policy/training_scope/transformer', reuse=False) + transformer_cell = TransformerCell(nb_layers=hps('trsf_nb_layers'), + nb_heads=hps('trsf_nb_heads'), + word_embedding=word_embedding, + position_embedding=position_embedding, + batch_size=batch_size, + feeder_cell=feeder_cell, + feeder_init_state=feeder_cell_init_state, + past_attentions=past_attentions, + past_seq_lengths=message_lengths, + scope=trsf_scope, + name='transformer') + transformer_cell_init_state = transformer_cell.zero_state(batch_size, tf.float32) + + # ---- Invariants ---- + invariants_map = { + 'past_attentions': tf.TensorShape([None, # batch size + hps('trsf_nb_layers'), # nb_layers + 2, # key, value + hps('trsf_nb_heads'), # nb heads + None, # Seq len + hps('trsf_emb_size') // hps('trsf_nb_heads')])} # Head size + + # ---- Decoder ---- + sequence_mask = tf.sequence_mask(raw_decoder_lengths, + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + maximum_iterations = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS + model_decoder = MaskedBasicDecoder(cell=transformer_cell, + helper=helper, + initial_state=transformer_cell_init_state, + output_layer=decoder_output_layer, + extract_state=True) + training_results, _, _ = dynamic_decode(decoder=model_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + invariants_map=invariants_map, + swap_memory=hps('swap_memory')) + global_vars_after_decoder = set(tf.global_variables()) + + # ======== Beam Search Decoding ======== + tile_beam = get_tile_beam(hps('beam_width')) + beam_feeder_cell = IdentityCell(output_size=hps('trsf_emb_size') + hps('attn_size')) + + # Applying Dropout to input, attention and output + beam_feeder_cell = SeededDropoutWrapper(cell=beam_feeder_cell, + seeds=tile_beam(player_seeds), + input_keep_probs=tile_beam(1. - dropout_rates), + variational_recurrent=hps('use_v_dropout'), + input_size=hps('trsf_emb_size') + hps('attn_size'), + dtype=tf.float32) + + # Apply attention over orderable location at each position + beam_feeder_cell = StaticAttentionWrapper(cell=beam_feeder_cell, + memory=tile_beam(board_state_conv), + alignments=tile_beam(board_alignments), + sequence_length=tile_beam(raw_decoder_lengths), + output_attention=False) + + # Setting initial state + beam_feeder_init_state = beam_feeder_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Transformer Cell ---- + trsf_scope = tf.VariableScope(name='policy/training_scope/transformer', reuse=True) + beam_trsf_cell = TransformerCell(nb_layers=hps('trsf_nb_layers'), + nb_heads=hps('trsf_nb_heads'), + word_embedding=word_embedding, + position_embedding=position_embedding, + batch_size=batch_size * hps('beam_width'), + feeder_cell=beam_feeder_cell, + feeder_init_state=beam_feeder_init_state, + past_attentions=tile_beam(past_attentions), + past_seq_lengths=tile_beam(message_lengths), + scope=trsf_scope, + name='transformer') + beam_trsf_cell_init_state = beam_trsf_cell.zero_state(batch_size * hps('beam_width'), tf.float32) + + # ---- Beam Helper and Decoder ---- + beam_helper = CustomBeamHelper(cell=beam_trsf_cell, + embedding=word_embedding, + mask=decoder_mask, + sequence_length=decoder_lengths, + output_layer=decoder_output_layer, + initial_state=beam_trsf_cell_init_state, + beam_width=hps('beam_width')) + beam_decoder = DiverseBeamSearchDecoder(beam_helper=beam_helper, + sequence_length=decoder_lengths, + nb_groups=hps('beam_groups')) + beam_results, beam_state, _ = dynamic_decode(decoder=beam_decoder, + output_time_major=False, + maximum_iterations=maximum_iterations, + invariants_map=invariants_map, + swap_memory=hps('swap_memory')) + + # Making sure we haven't created new global variables + assert not set(tf.global_variables()) - global_vars_after_decoder, 'New global vars were created' + + # Processing results + logits = training_results.rnn_output # (b, dec_len, VOCAB_SIZE) + logits_length = tf.shape(logits)[1] # dec_len + decoder_target = decoder_inputs[:, 1:1 + logits_length] + + # Selected tokens are the token that was actually fed at the next position + sample_mask = to_float(tf.math.equal(training_results.sample_id, -1)) + selected_tokens = to_int32( + sequence_mask * (sample_mask * to_float(decoder_target) + + (1. - sample_mask) * to_float(training_results.sample_id))) + + # Argmax tokens are the most likely token outputted at each position + argmax_tokens = to_int32(to_float(tf.argmax(logits, axis=-1)) * sequence_mask) + log_probs = -1. * cross_entropy(logits=logits, labels=selected_tokens) * sequence_mask + + # Computing policy loss + with tf.variable_scope('policy_loss'): + policy_loss = sequence_loss(logits=logits, + targets=decoder_target, + weights=sequence_mask, + average_across_batch=True, + average_across_timesteps=True) + policy_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(policy_loss), # pylint: disable=cell-var-from-loop + lambda: policy_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/policy/token_based/v011_film_transformer_gpt': True, + 'targets': decoder_inputs[:, 1:], + 'selected_tokens': selected_tokens, + 'argmax_tokens': argmax_tokens, + 'logits': logits, + 'log_probs': log_probs, + 'beam_tokens': tf.transpose(beam_results.predicted_ids, perm=[0, 2, 1]), # [batch, beam, steps] + 'beam_log_probs': beam_state.log_probs, + 'rnn_states': training_results.rnn_state, + 'policy_loss': policy_loss, + 'draw_prob': self.outputs.get('draw_prob', tf.zeros_like(self.features['draw_target'])), + 'learning_rate': self.learning_rate} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/tests/__init__.py b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/tests/test_model.py b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/tests/test_model.py new file mode 100644 index 0000000..efb0762 --- /dev/null +++ b/diplomacy_research/models/policy/token_based/v011_film_transformer_gpt/tests/test_model.py @@ -0,0 +1,94 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Runs tests for the current model and adapter """ +from diplomacy_research.models.policy.tests.policy_adapter_test_setup import PolicyAdapterTestSetup +from diplomacy_research.models.policy.token_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.token_based.v011_film_transformer_gpt import PolicyModel, load_args +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm as A2CAlgo, load_args as a2c_args +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm as PPOAlgo, load_args as ppo_args +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm as ReinforceAlgo,\ + load_args as reinforce_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, algorithm_ctor, algo_load_args): + """ Constructor """ + AlgorithmSetup.__init__(self, algorithm_ctor, algo_load_args, 'token_based') + + def get_policy_model(self): + """ Returns the PolicyModel """ + return PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return load_args() + +# ----------- Launch Scripts -------------- +def launch_a2c(): + """ Launches tests for a2c """ + test_object = BaseTestClass(A2CAlgo, a2c_args) + test_object.run_tests() + +def launch_ppo(): + """ Launches tests for ppo """ + test_object = BaseTestClass(PPOAlgo, ppo_args) + test_object.run_tests() + +def launch_reinforce(): + """ Launches tests for reinforce """ + test_object = BaseTestClass(ReinforceAlgo, reinforce_args) + test_object.run_tests() + +def launch_adapter(): + """ Launches the tests """ + testable_class = PolicyAdapterTestSetup(policy_model_ctor=PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=BaseDatasetBuilder(), + policy_adapter_ctor=PolicyAdapter, + load_policy_args=load_args, + load_value_args=load_value_args, + load_draw_args=None, + strict=False) + testable_class.run_tests() + +# ----------- Tests -------------- +def test_run_a2c(): + """ Runs the a2c test """ + run_in_separate_process(target=launch_a2c, timeout=240) + +def test_run_ppo(): + """ Runs the ppo test """ + run_in_separate_process(target=launch_ppo, timeout=240) + +def test_run_reinforce(): + """ Runs the reinforce test """ + run_in_separate_process(target=launch_reinforce, timeout=240) + +def test_run_adapter(): + """ Runs the adapter test """ + run_in_separate_process(target=launch_adapter, timeout=240) diff --git a/diplomacy_research/models/self_play/__init__.py b/diplomacy_research/models/self_play/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/self_play/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/self_play/advantages/__init__.py b/diplomacy_research/models/self_play/advantages/__init__.py new file mode 100644 index 0000000..1c3dc19 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/__init__.py @@ -0,0 +1,20 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Advantage Functions + - Computes the targets (e.g. r + gamma * V) and the TD errors for transitions in a saved game +""" +from .gae import GAE +from .monte_carlo import MonteCarlo +from .n_step import NStep +from .v_trace import VTrace diff --git a/diplomacy_research/models/self_play/advantages/base_advantage.py b/diplomacy_research/models/self_play/advantages/base_advantage.py new file mode 100644 index 0000000..04409d8 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/base_advantage.py @@ -0,0 +1,111 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Advantages + - Compute the TD error for a certain number of phases in a saved game / trajectory +""" +from abc import ABCMeta, abstractmethod +import logging +from diplomacy_research.models.self_play.transition import Transition, TransitionDetails +from diplomacy_research.models.state_space import NB_PREV_ORDERS_HISTORY, ALL_POWERS + +# Constants +LOGGER = logging.getLogger(__name__) + +class BaseAdvantage(metaclass=ABCMeta): + """ Base Advantage - Overrided by the different calculation methods """ + + def __init__(self, *, gamma, penalty_per_phase=0.): + """ Constructor + :param gamma: The discount factor to use + :param penalty_per_phase: The penalty to add to each transition. + """ + self.gamma = gamma + self.penalty_per_phase = penalty_per_phase + + @abstractmethod + def get_returns(self, rewards, state_values, last_state_value): + """ Computes the returns for all transitions + :param rewards: A list of rewards received (after each env.step()) + :param state_values: A list of values for each state (before env.step()) + :param last_state_value: The value of the last state + :return: A list of returns (same length as rewards) + """ + raise NotImplementedError() + + @staticmethod + def get_transition_details(saved_game_proto, power_name, **kwargs): + """ Calculates the transition details for the saved game. + :param saved_game_proto: A `.proto.game.SavedGame` object. + :param power_name: The name of the power for which we want the target. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :return: The transition detail for the phase, including: + 1) a `.models.self_play.transition.Transition` transition. + 2) the power that issued orders + 3) the corresponding reward target to be used for the policy gradient update, + 4) the corresponding value target to be used for the critic update, + 5) a list of log importance sampling ratio for each output token or None + 6) the updated (current) log probs for each token in the model + :type transitions: List[diplomacy_research.models.self_play.transition.Transition] + """ + del kwargs # Unused args + transition_details = [] + + # We need at least 2 phases to have 1 transition + nb_phases = len(saved_game_proto.phases) + if nb_phases < 2: + return transition_details + + # Looping over all phases + current_year = 0 + for phase_ix in range(nb_phases - 1): + current_state = saved_game_proto.phases[phase_ix].state + current_phase = saved_game_proto.phases[phase_ix] + policy_details = saved_game_proto.phases[phase_ix].policy # Policy details (locs, tokens, log_probs) + orders = saved_game_proto.phases[phase_ix].orders + phase_history = [saved_game_proto.phases[phase_order_ix] + for phase_order_ix in range(max(0, phase_ix - NB_PREV_ORDERS_HISTORY), phase_ix)] + possible_orders = saved_game_proto.phases[phase_ix].possible_orders + rewards = {power_name: saved_game_proto.rewards[power_name].value[phase_ix] for power_name in ALL_POWERS} + current_return = saved_game_proto.returns[power_name].value[phase_ix] + + # Increasing year for every spring or when the game is completed + if current_phase.name == 'COMPLETED' or (current_phase.name[0] == 'S' and current_phase.name[-1] == 'M'): + current_year += 1 + + # Building transition + transition = Transition(phase_ix=phase_ix, + state=current_state, + phase=current_phase, + policy=policy_details, + rewards=rewards, + orders=orders, + phase_history=phase_history, + possible_orders=possible_orders) + + # Building transition details + transition_details += \ + [TransitionDetails(transition=transition, + power_name=power_name, + draw_action=policy_details[power_name].draw_action, + reward_target=current_return, + value_target=current_return, + log_p_t=None, + log_probs=policy_details[power_name].log_probs)] + + # Returning transition details + return transition_details diff --git a/diplomacy_research/models/self_play/advantages/gae.py b/diplomacy_research/models/self_play/advantages/gae.py new file mode 100644 index 0000000..45f4939 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/gae.py @@ -0,0 +1,62 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generalized Advantage Estimation + - Based on 1506.02438 +""" +import logging +from diplomacy_research.models.self_play.advantages.base_advantage import BaseAdvantage + +# Constants +LOGGER = logging.getLogger(__name__) + +class GAE(BaseAdvantage): + """ Generalized Advantage - Calculates the GAE targets over a full trajectory """ + + def __init__(self, *, lambda_, gamma, penalty_per_phase=0.): + """ Constructor + :param lambda_: The GAE lambda + :param gamma: The discount factor to use + :param penalty_per_phase: The penalty to add to each transition. + """ + BaseAdvantage.__init__(self, gamma=gamma, penalty_per_phase=penalty_per_phase) + self.lambda_ = lambda_ + + def get_returns(self, rewards, state_values, last_state_value): + """ Computes the returns for all transitions + :param rewards: A list of rewards received (after each env.step()) + :param state_values: A list of values for each state (before env.step()) + :param last_state_value: The value of the last state + :return: A list of returns (same length as rewards) + """ + assert len(rewards) == len(state_values), 'Expected rewards to be the same length as state_values' + returns = [] + + # Computing the GAE returns + last_gae_lam = 0 + nb_phases = len(rewards) + adj_rewards = [reward - self.penalty_per_phase for reward in rewards] + + for phase_ix in reversed(range(nb_phases)): + if phase_ix == nb_phases - 1: + next_non_terminal = 0. + next_values = last_state_value + else: + next_non_terminal = 1. + next_values = state_values[phase_ix + 1] + delta = adj_rewards[phase_ix] + self.gamma * next_values * next_non_terminal - state_values[phase_ix] + advantage = last_gae_lam = delta + self.gamma * self.lambda_ * next_non_terminal * last_gae_lam + returns += [advantage + state_values[phase_ix]] + + # Returning + return list(reversed(returns)) diff --git a/diplomacy_research/models/self_play/advantages/monte_carlo.py b/diplomacy_research/models/self_play/advantages/monte_carlo.py new file mode 100644 index 0000000..a8f931f --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/monte_carlo.py @@ -0,0 +1,50 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Monte Carlo Advantage Calculator + - Compute the TD error for a certain number of phases in a saved game / trajectory +""" +import logging +from diplomacy_research.models.self_play.advantages.base_advantage import BaseAdvantage + +# Constants +LOGGER = logging.getLogger(__name__) + +class MonteCarlo(BaseAdvantage): + """ Monte Carlo - Calculates the MC returns by sampling a full trajectory """ + + def __init__(self, *, gamma, penalty_per_phase=0.): + """ Constructor + :param gamma: The discount factor to use + :param penalty_per_phase: The penalty to add to each transition. + """ + BaseAdvantage.__init__(self, gamma=gamma, penalty_per_phase=penalty_per_phase) + + def get_returns(self, rewards, state_values, last_state_value): + """ Computes the returns for all transitions + :param rewards: A list of rewards received (after each env.step()) + :param state_values: A list of values for each state (before env.step()) + :param last_state_value: The value of the last state + :return: A list of returns (same length as rewards) + """ + assert len(rewards) == len(state_values), 'Expected rewards to be the same length as state_values' + del state_values, last_state_value # Unused args - No bootstrapping for Monte Carlo returns + returns = [] + + # Computing the Monte Carlo returns + current_return = 0 + adj_rewards = [reward - self.penalty_per_phase for reward in rewards] + for reward in reversed(adj_rewards): + current_return = reward + self.gamma * current_return + returns += [current_return] + return list(reversed(returns)) diff --git a/diplomacy_research/models/self_play/advantages/n_step.py b/diplomacy_research/models/self_play/advantages/n_step.py new file mode 100644 index 0000000..faee0c4 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/n_step.py @@ -0,0 +1,57 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" N-Phase Advantage Calculator + - Compute the TD error for a certain number of phases in a saved game / trajectory +""" +import logging +from diplomacy_research.models.self_play.advantages.base_advantage import BaseAdvantage + +# Constants +LOGGER = logging.getLogger(__name__) + +class NStep(BaseAdvantage): + """ N-Step - Calculates the N-Step returns over a full trajectory """ + + def __init__(self, *, nb_steps, gamma, penalty_per_phase=0.): + """ Constructor + :param nb_steps: The number of steps (phases) for N-Step. + :param gamma: The discount factor to use + :param penalty_per_phase: The penalty to add to each transition. + """ + BaseAdvantage.__init__(self, gamma=gamma, penalty_per_phase=penalty_per_phase) + self.nb_steps = nb_steps + + def get_returns(self, rewards, state_values, last_state_value): + """ Computes the returns for all transitions + :param rewards: A list of rewards received (after each env.step()) + :param state_values: A list of values for each state (before env.step()) + :param last_state_value: The value of the last state + :return: A list of returns (same length as rewards) + """ + assert len(rewards) == len(state_values), 'Expected rewards to be the same length as state_values' + returns = [] + + # List of final values for bootstrap + bootstrap = state_values + [last_state_value] + adj_rewards = [reward - self.penalty_per_phase for reward in rewards] + + # Computing the N-Step returns + nb_transitions = len(rewards) + for transition_ix in range(nb_transitions): + nb_steps = min(self.nb_steps, nb_transitions - transition_ix) + current_return = bootstrap[transition_ix + nb_steps] + for step_ix in reversed(range(nb_steps)): + current_return = adj_rewards[transition_ix + step_ix] + self.gamma * current_return + returns += [current_return] + return returns diff --git a/diplomacy_research/models/self_play/advantages/tests/advantage_test_setup.py b/diplomacy_research/models/self_play/advantages/tests/advantage_test_setup.py new file mode 100644 index 0000000..bdbdc83 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/tests/advantage_test_setup.py @@ -0,0 +1,178 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generic class to test an advantage """ +import os +import gym +from tornado import gen +from tornado.ioloop import IOLoop +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.gym import LimitNumberYears, RandomizePlayers +from diplomacy_research.models.gym.environment import DoneReason +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v012_film_diff_w_board_align_prev_ord import PolicyModel, load_args +from diplomacy_research.models.self_play.controller import generate_trajectory +from diplomacy_research.models.self_play.reward_functions import DefaultRewardFunction +from diplomacy_research.models.state_space import TOKENS_PER_ORDER, ALL_POWERS +from diplomacy_research.players import RuleBasedPlayer, ModelBasedPlayer +from diplomacy_research.players.rulesets import easy_ruleset +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import read_next_proto, write_proto_to_file + +# Constants +HOME_DIR = os.path.expanduser('~') +if HOME_DIR == '~': + raise RuntimeError('Cannot find home directory. Unable to save cache') + + +class AdvantageSetup(): + """ Tests an advantage """ + + def __init__(self, model_type): + """ Constructor """ + self.saved_game_cache_path = None + self.model_type = model_type + self.adapter = None + self.advantage = None + self.reward_fn = DefaultRewardFunction() + self.graph = None + + def create_advantage(self): + """ Creates the advantage object """ + raise NotImplementedError() + + @staticmethod + def parse_flags(args): + """ Parse flags without calling tf.app.run() """ + define = {'bool': lambda x: bool(x), # pylint: disable=unnecessary-lambda + 'int': lambda x: int(x), # pylint: disable=unnecessary-lambda + 'str': lambda x: str(x), # pylint: disable=unnecessary-lambda + 'float': lambda x: float(x), # pylint: disable=unnecessary-lambda + '---': lambda x: x} # pylint: disable=unnecessary-lambda + + # Keeping a dictionary of parse args to overwrite if provided multiple times + flags = {} + for arg in args: + arg_type, arg_name, arg_value, _ = arg + flags[arg_name] = define[arg_type](arg_value) + if arg_type == '---' and arg_name in flags: + del flags[arg_name] + return flags + + def run_tests(self): + """ Run all tests """ + IOLoop.current().run_sync(self.run_tests_async) + + @gen.coroutine + def run_tests_async(self): + """ Run tests in an asynchronous IO Loop """ + from diplomacy_research.utils.tensorflow import tf + self.graph = tf.Graph() + with self.graph.as_default(): + yield self.build_adapter() + saved_game_proto = yield self.get_saved_game_proto() + + # Testing with a full game + self.test_get_returns(saved_game_proto) + self.test_get_transition_details(saved_game_proto) + + # Testing with a partial game + saved_game_proto.done_reason = DoneReason.NOT_DONE.value + self.test_get_returns(saved_game_proto) + self.test_get_transition_details(saved_game_proto) + + @gen.coroutine + def build_adapter(self): + """ Builds adapter """ + from diplomacy_research.utils.tensorflow import tf + hparams = self.parse_flags(load_args()) + + # Generating model + dataset = QueueDataset(batch_size=32, dataset_builder=BaseDatasetBuilder()) + model = PolicyModel(dataset, hparams) + model.finalize_build() + model.add_meta_information({'state_value': model.outputs['logits'][:, 0, 0]}) + self.adapter = PolicyAdapter(dataset, self.graph, tf.Session(graph=self.graph)) + self.create_advantage() + + # Setting cache path + filename = '%s_savedgame.pbz' % self.model_type + self.saved_game_cache_path = os.path.join(HOME_DIR, '.cache', 'diplomacy', filename) + + def test_get_returns(self, saved_game_proto): + """ Tests the get_returns method """ + reward_fn = DefaultRewardFunction() + + for power_name in ALL_POWERS: + rewards = reward_fn.get_episode_rewards(saved_game_proto, power_name) + state_values = [1.] * len(rewards) + last_state_value = 0. + returns = self.advantage.get_returns(rewards, state_values, last_state_value) + assert len(returns) == len(rewards) + + def test_get_transition_details(self, saved_game_proto): + """ Tests the get_transition_details method """ + for power_name in saved_game_proto.assigned_powers[:-1]: + result = self.advantage.get_transition_details(saved_game_proto, power_name) + assert len(result) == len(saved_game_proto.phases) - 1 # nb_transitions = nb_phases - 1 + for transition_detail in result: + submitted_orders = transition_detail.transition.orders[power_name].value + assert transition_detail.power_name == power_name + assert transition_detail.transition is not None + assert transition_detail.draw_action in (True, False) + assert transition_detail.reward_target is not None + assert transition_detail.value_target is not None + assert len(transition_detail.log_probs) >= 1 or not submitted_orders + + @gen.coroutine + def get_saved_game_proto(self): + """ Tests the generate_saved_game_proto method """ + # Creating players + player = ModelBasedPlayer(self.adapter) + rule_player = RuleBasedPlayer(easy_ruleset) + players = [player, player, player, player, player, player, rule_player] + + def env_constructor(players): + """ Env constructor """ + env = gym.make('DiplomacyEnv-v0') + env = LimitNumberYears(env, 5) + env = RandomizePlayers(env, players) + return env + + # Generating game + saved_game_proto = None + if os.path.exists(self.saved_game_cache_path): + with open(self.saved_game_cache_path, 'rb') as file: + saved_game_proto = read_next_proto(SavedGameProto, file, compressed=True) + + if saved_game_proto is None: + saved_game_proto = yield generate_trajectory(players, self.reward_fn, self.advantage, env_constructor) + with open(self.saved_game_cache_path, 'wb') as file: + write_proto_to_file(file, saved_game_proto, compressed=True) + + # Validating game + assert saved_game_proto.id + assert len(saved_game_proto.phases) >= 10 + + # Validating policy details + for phase in saved_game_proto.phases: + for power_name in phase.policy: + nb_locs = len(phase.policy[power_name].locs) + assert (len(phase.policy[power_name].tokens) == nb_locs * TOKENS_PER_ORDER # Token-based + or len(phase.policy[power_name].tokens) == nb_locs) # Order-based + assert len(phase.policy[power_name].log_probs) == len(phase.policy[power_name].tokens) + assert phase.policy[power_name].draw_action in (True, False) + assert 0. <= phase.policy[power_name].draw_prob <= 1. + + # Returning saved game proto for other tests to use + return saved_game_proto diff --git a/diplomacy_research/models/self_play/advantages/tests/test_gae.py b/diplomacy_research/models/self_play/advantages/tests/test_gae.py new file mode 100644 index 0000000..0ffb8f6 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/tests/test_gae.py @@ -0,0 +1,34 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the GAE Advantage """ +from diplomacy_research.models.self_play.reward_functions import DEFAULT_PENALTY +from diplomacy_research.models.self_play.advantages.gae import GAE +from diplomacy_research.models.self_play.advantages.tests.advantage_test_setup import AdvantageSetup +from diplomacy_research.utils.process import run_in_separate_process + +class GAETestClass(AdvantageSetup): + """ Tests the advantage """ + + def create_advantage(self): + """ Creates the advantage object """ + self.advantage = GAE(lambda_=0.9, gamma=0.99, penalty_per_phase=DEFAULT_PENALTY) + +def launch(): + """ Launches the test """ + test_object = GAETestClass(model_type='order_based') + test_object.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=240) diff --git a/diplomacy_research/models/self_play/advantages/tests/test_monte_carlo.py b/diplomacy_research/models/self_play/advantages/tests/test_monte_carlo.py new file mode 100644 index 0000000..53cbe5a --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/tests/test_monte_carlo.py @@ -0,0 +1,34 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the Monte Carlo Advantage """ +from diplomacy_research.models.self_play.reward_functions import DEFAULT_PENALTY +from diplomacy_research.models.self_play.advantages.monte_carlo import MonteCarlo +from diplomacy_research.models.self_play.advantages.tests.advantage_test_setup import AdvantageSetup +from diplomacy_research.utils.process import run_in_separate_process + +class MonteCarloTestClass(AdvantageSetup): + """ Tests the advantage """ + + def create_advantage(self): + """ Creates the advantage object """ + self.advantage = MonteCarlo(gamma=0.99, penalty_per_phase=DEFAULT_PENALTY) + +def launch(): + """ Launches the test """ + test_object = MonteCarloTestClass(model_type='order_based') + test_object.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=240) diff --git a/diplomacy_research/models/self_play/advantages/tests/test_n_step.py b/diplomacy_research/models/self_play/advantages/tests/test_n_step.py new file mode 100644 index 0000000..20ec235 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/tests/test_n_step.py @@ -0,0 +1,34 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the N-Phase Advantage """ +from diplomacy_research.models.self_play.reward_functions import DEFAULT_PENALTY +from diplomacy_research.models.self_play.advantages.n_step import NStep +from diplomacy_research.models.self_play.advantages.tests.advantage_test_setup import AdvantageSetup +from diplomacy_research.utils.process import run_in_separate_process + +class NStepTestClass(AdvantageSetup): + """ Tests the advantage """ + + def create_advantage(self): + """ Creates the advantage object """ + self.advantage = NStep(nb_steps=15, gamma=0.99, penalty_per_phase=DEFAULT_PENALTY) + +def launch(): + """ Launches the test """ + test_object = NStepTestClass(model_type='order_based') + test_object.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=240) diff --git a/diplomacy_research/models/self_play/advantages/tests/test_v_trace.py b/diplomacy_research/models/self_play/advantages/tests/test_v_trace.py new file mode 100644 index 0000000..fd6c914 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/tests/test_v_trace.py @@ -0,0 +1,34 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the V-Trace Advantage """ +from diplomacy_research.models.self_play.reward_functions import DEFAULT_PENALTY +from diplomacy_research.models.self_play.advantages.v_trace import VTrace +from diplomacy_research.models.self_play.advantages.tests.advantage_test_setup import AdvantageSetup +from diplomacy_research.utils.process import run_in_separate_process + +class VTraceTestClass(AdvantageSetup): + """ Tests the advantage """ + + def create_advantage(self): + """ Creates the advantage object """ + self.advantage = VTrace(lambda_=0.9, gamma=0.99, penalty_per_phase=DEFAULT_PENALTY) + +def launch(): + """ Launches the test """ + test_object = VTraceTestClass(model_type='order_based') + test_object.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=240) diff --git a/diplomacy_research/models/self_play/advantages/v_trace.py b/diplomacy_research/models/self_play/advantages/v_trace.py new file mode 100644 index 0000000..ae563d4 --- /dev/null +++ b/diplomacy_research/models/self_play/advantages/v_trace.py @@ -0,0 +1,172 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" V-Trace + - Based on 1802.01561 (IMPALA: Scalable Distributed Deep-RL with Importance Weighted Actor-Learner Architectures) +""" +import logging +from diplomacy_research.models.self_play.advantages.base_advantage import BaseAdvantage +from diplomacy_research.models.self_play.transition import Transition, TransitionDetails +from diplomacy_research.models.state_space import ALL_POWERS, NB_PREV_ORDERS_HISTORY + +# Constants +LOGGER = logging.getLogger(__name__) + +class VTrace(BaseAdvantage): + """ V-Trace - Calculates the V-Trace targets over a full trajectory """ + + def __init__(self, *, lambda_, gamma, c_bar=1., p_bar=1., penalty_per_phase=0.): + """ Constructor + :param lambda_: The c_ lambda + :param gamma: The discount factor to use + :param c_bar: The parameter c_ has described in the paper. + :param p_bar: The parameter p_ has described in the paper. + :param penalty_per_phase: The penalty to add to each transition. + """ + BaseAdvantage.__init__(self, gamma=gamma, penalty_per_phase=penalty_per_phase) + self.lambda_ = lambda_ + self.c_bar = c_bar + self.p_bar = max(c_bar, p_bar) # To ensure that p_bar >= c_bar + + def _get_vtrace_targets(self, rewards, state_values, last_state_value, rhos=None): + """ Computes the returns and value targets for all transitions + :param rewards: A list of rewards received (after each env.step()) + :param state_values: A list of values for each state (before env.step()) + :param last_state_value: The value of the last state + :param rhos: Optional. List of importance sampling weights. + :return: A list of returns (same length as rewards), and a list of value targets + """ + assert len(rewards) == len(state_values), 'Expected rewards to be the same length as state_values' + assert rhos is None or len(rhos) == len(rewards), 'Expected rhos to be the same length as rewards' + + # Note - Because this is computed on the actors - using log_rhos of 0. (importance sampling weights of 1.) + # The actual adjustment will be done on the learner. + if rhos is None: + rhos = [1.] * len(rewards) + discounts = [self.lambda_] * len(rewards) + clip_rho_threshold = self.p_bar + clip_ph_rho_threshold = self.c_bar + adj_rewards = [reward - self.penalty_per_phase for reward in rewards] + + # Computing V-Trace returns + clipped_rhos = [min(clip_rho_threshold, rho) for rho in rhos] + clipped_pg_rhos = [min(clip_ph_rho_threshold, rho) for rho in rhos] + c_s = [min(1., rho) for rho in rhos] + values_t_plus_1 = state_values[1:] + [last_state_value] + deltas = [clipped_rho * (reward + discount * value_t_plus_1 - value) + for (clipped_rho, reward, discount, value_t_plus_1, value) + in zip(clipped_rhos, adj_rewards, discounts, values_t_plus_1, state_values)] + + # Computation starts from the back + sequences = (reversed(discounts), reversed(c_s), reversed(deltas)) + + # Computing returns + acc = 0. + v_s_minus_v_xs = [] + for discount_t, c_t, delta_t in zip(*sequences): + acc = delta_t + discount_t * c_t * acc + v_s_minus_v_xs += [acc] + v_s_minus_v_xs = list(reversed(v_s_minus_v_xs)) + + # Add V(x_s) to get v_s. + v_s = [vs_minus_v_xs_t + value_t for (vs_minus_v_xs_t, value_t) in zip(v_s_minus_v_xs, state_values)] + v_s_t_plus_1 = v_s[1:] + [last_state_value] + + # Returns for policy gradients + vtrace_returns = [clipped_pg_rho * (reward + discount * v_s_t_plus_1_t) + for (clipped_pg_rho, reward, discount, v_s_t_plus_1_t) + in zip(clipped_pg_rhos, adj_rewards, discounts, v_s_t_plus_1)] + return vtrace_returns, v_s + + def get_returns(self, rewards, state_values, last_state_value): + """ Computes the returns for all transitions + :param rewards: A list of rewards received (after each env.step()) + :param state_values: A list of values for each state (before env.step()) + :param last_state_value: The value of the last state + :return: A list of returns (same length as rewards) + """ + vtrace_returns, _ = self._get_vtrace_targets(rewards, state_values, last_state_value) + return vtrace_returns + + def get_transition_details(self, saved_game_proto, power_name, **kwargs): + """ Calculates the transition details for the saved game. + :param saved_game_proto: A `.proto.game.SavedGame` object. + :param power_name: The name of the power for which we want the target. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :return: The transition detail for the phase, including: + 1) a `.models.self_play.transition.Transition` transition. + 2) the power that issued orders + 3) the corresponding reward target to be used for the policy gradient update, + 4) the corresponding value target to be used for the critic update, + 5) a list of log importance sampling ratio for each output token or None + 6) the updated (current) log probs for each token in the model + :type transitions: List[diplomacy_research.models.self_play.transition.Transition] + """ + del kwargs # Unused args + transition_details = [] + + # We need at least 2 phases to have 1 transition + nb_phases = len(saved_game_proto.phases) + if nb_phases < 2: + return transition_details + + # Recomputing the returns and value targets + rewards = saved_game_proto.rewards[power_name].value + state_values = [phase.state_value[power_name] for phase in saved_game_proto.phases[:-1]] + last_state_value = saved_game_proto.phases[-1].state_value[power_name] + vtrace_returns, value_targets = self._get_vtrace_targets(rewards, state_values, last_state_value) + + # Looping over all phases + current_year = 0 + for phase_ix in range(nb_phases - 1): + current_state = saved_game_proto.phases[phase_ix].state + current_phase = saved_game_proto.phases[phase_ix] + policy_details = saved_game_proto.phases[phase_ix].policy # Policy details (locs, tokens, log_probs) + orders = saved_game_proto.phases[phase_ix].orders + phase_history = [saved_game_proto.phases[phase_order_ix] + for phase_order_ix in range(max(0, phase_ix - NB_PREV_ORDERS_HISTORY), phase_ix)] + possible_orders = saved_game_proto.phases[phase_ix].possible_orders + rewards = {power_name: saved_game_proto.rewards[power_name].value[phase_ix] for power_name in ALL_POWERS} + vtrace_return = vtrace_returns[phase_ix] + value_target = value_targets[phase_ix] + + # Increasing year for every spring or when the game is completed + if current_phase.name == 'COMPLETED' or (current_phase.name[0] == 'S' and current_phase.name[-1] == 'M'): + current_year += 1 + + # Building transition + transition = Transition(phase_ix=phase_ix, + state=current_state, + phase=current_phase, + policy=policy_details, + rewards=rewards, + orders=orders, + phase_history=phase_history, + possible_orders=possible_orders) + + # Building transition details + transition_details += \ + [TransitionDetails(transition=transition, + power_name=power_name, + draw_action=policy_details[power_name].draw_action, + reward_target=vtrace_return, + value_target=value_target, + log_p_t=None, + log_probs=policy_details[power_name].log_probs)] + + # Returning transition details + return transition_details diff --git a/diplomacy_research/models/self_play/algorithms/__init__.py b/diplomacy_research/models/self_play/algorithms/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/self_play/algorithms/a2c/__init__.py b/diplomacy_research/models/self_play/algorithms/a2c/__init__.py new file mode 100644 index 0000000..29ab539 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/a2c/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" A2C Algorithm """ +from .algorithm import A2CAlgorithm as Algorithm, load_args diff --git a/diplomacy_research/models/self_play/algorithms/a2c/algorithm.py b/diplomacy_research/models/self_play/algorithms/a2c/algorithm.py new file mode 100644 index 0000000..e4d071f --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/a2c/algorithm.py @@ -0,0 +1,263 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" A2C Algorithm + - Application of A2C/A3C algorithm (Asynchronous Methods for Deep Reinforcement Learning - 1602.01783) +""" +import logging +import numpy as np +from tornado import gen +from diplomacy_research.models.datasets.base_builder import FixedProtoField +from diplomacy_research.models.policy.base_policy_model import TRAINING_DECODER, GREEDY_DECODER +from diplomacy_research.models.self_play.advantages import NStep, GAE, VTrace +from diplomacy_research.models.self_play.algorithms.base_algorithm import BaseAlgorithm, load_args as load_parent_args +from diplomacy_research.models.training.memory_buffer.barrier import set_barrier_status, wait_for_barrier + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + # Default settings + args = load_parent_args() + [ + ('str', 'advantage_fn', 'n_step', 'The advantage function to use (valid: n_step, gae)'), + ('int', 'nb_steps', 15, 'The number of steps (phases) for the advantage function'), + ('float', 'lambda_', 0.9, 'The value of the lambda parameter to use for GAE'), + ('float', 'c_bar', 1., 'The value of the c_bar parameter for V-Trace'), + ('float', 'p_bar', 1., 'The value of the p_bar parameter for V-Trace'), + + ('float', 'value_coeff', 0.5, 'The coefficient to apply to the value loss'), + ('float', 'draw_coeff', 0.5, 'The coefficient to apply to the draw policy loss'), + ('float', 'entropy_coeff', 0.1, 'The coefficient to apply to the entropy loss'), + ] + return args + +class A2CAlgorithm(BaseAlgorithm): + """ A2C Algorithm - Implements the A2C/A3C algorithm (ArXiv 1602.01783) """ + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this algorithm """ + return {'draw_action': FixedProtoField([], np.bool), + 'draw_target': FixedProtoField([], np.float32), + 'reward_target': FixedProtoField([], np.float32), + 'value_target': FixedProtoField([], np.float32)} + + @staticmethod + def get_evaluation_tags(): + """ Returns a list of fields that are computed during .update() to display in the stats""" + return ['rl_policy_loss', 'rl_value_loss', 'rl_draw_loss', 'rl_entropy_loss', 'rl_total_loss'] + + @staticmethod + def create_advantage_function(hparams, *, gamma, penalty_per_phase=0.): + """ Returns the advantage function to use with this algorithm """ + # N-Step + if hparams['advantage_fn'] in ('n_step', 'nstep'): + return NStep(nb_steps=hparams['nb_steps'], + gamma=gamma, + penalty_per_phase=penalty_per_phase) + + # GAE + if hparams['advantage_fn'] == 'gae': + return GAE(lambda_=hparams['lambda_'], + gamma=gamma, + penalty_per_phase=penalty_per_phase) + + # V-Trace + if hparams['advantage_fn'] in ('v_trace', 'vtrace'): + return VTrace(lambda_=hparams['lambda_'], + c_bar=hparams['c_bar'], + p_bar=hparams['p_bar'], + gamma=gamma, + penalty_per_phase=penalty_per_phase) + + # Invalid advantage fn + raise ValueError('Invalid advantage function. Got %s. Valid values: %s' % + (hparams['advantage_fn'], ['n_step', 'gae', 'v_trace'])) + + def build(self): + """ Builds the RL model using the correct optimizer """ + from diplomacy_research.utils.tensorflow import tf, tfp, normalize, to_float + from diplomacy_research.models.layers.avg_grad_optimizer import AvgGradOptimizer + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.model.hparams[hparam_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + # Placeholders + stop_gradient_all = self.model.placeholders['stop_gradient_all'] + + # Features + decoder_lengths = self.model.features['decoder_lengths'] # tf.int32 - (b,) + draw_action = self.model.features['draw_action'] # tf.bool - (b,) + reward_target = self.model.features['reward_target'] # tf.float32 - (b,) + value_target = self.model.features['value_target'] # tf.float32 - (b,) + # current_power = self.model.features['current_power'] # tf.int32 - (b,) + + # Making sure all RNN lengths are at least 1 + # Trimming to the maximum decoder length in the batch + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Retrieving model outputs + baseline = values = self.model.outputs['state_value'] # (b,) + logits = self.model.outputs['logits'] # (b, dec, VOCAB) + sequence_mask = tf.sequence_mask(raw_decoder_lengths, # (b, dec) + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + + # Computing Baseline Mean Square Error Loss + with tf.variable_scope('baseline_scope'): + baseline_mse_loss = tf.minimum(tf.square(value_target - values), hps('clip_value_threshold')) + baseline_mse_loss = tf.reduce_sum(baseline_mse_loss) # () + + # Calculating policy gradient loss + with tf.variable_scope('policy_gradient_scope'): + log_prob_of_tokens = self.model.outputs['log_probs'] * sequence_mask # (b, dec_len) + + # Calculating loss and optimizer op + advantages = tf.stop_gradient(normalize(reward_target - baseline)) # (b,) + policy_gradient_loss = -tf.reduce_sum(log_prob_of_tokens, axis=-1) * advantages # (b,) + policy_gradient_loss = tf.reduce_mean(policy_gradient_loss) # () + + # Calculating policy gradient for draw action + with tf.variable_scope('draw_gradient_scope'): + draw_action = to_float(draw_action) # (b,) + draw_prob = self.model.outputs['draw_prob'] # (b,) + log_prob_of_draw = draw_action * tf.log(draw_prob) + (1. - draw_action) * tf.log(1. - draw_prob) + draw_gradient_loss = -1. * log_prob_of_draw * advantages # (b,) + draw_gradient_loss = tf.reduce_mean(draw_gradient_loss) # () + + # Calculating entropy loss + with tf.variable_scope('entropy_scope'): + categorial_dist = tfp.distributions.Categorical(logits=logits) + entropy = categorial_dist.entropy() + entropy_loss = -tf.reduce_mean(entropy) # () + + # Scopes + scope = ['policy', 'value', 'draw'] + global_ignored_scope = None if not hps('ignored_scope') else hps('ignored_scope').split(',') + + # Creating A2C Loss + a2c_loss = policy_gradient_loss \ + + hps('value_coeff') * baseline_mse_loss \ + + hps('draw_coeff') * draw_gradient_loss \ + + hps('entropy_coeff') * entropy_loss + a2c_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(a2c_loss), # pylint: disable=cell-var-from-loop + lambda: a2c_loss) # pylint: disable=cell-var-from-loop + cost_and_scope = [(a2c_loss, scope, None)] + + # Creating optimizer op + a2c_op = self.model.create_optimizer_op(cost_and_scope=cost_and_scope, + ignored_scope=global_ignored_scope, + max_gradient_norm=None) # AvgGradOptimizer will clip + + # Getting AvgGradOptimizer.update(version_step) + assert isinstance(self.model.optimizer, AvgGradOptimizer), 'A2C requires gradient averaging' + update_op = self.model.optimizer.update(self.version_step) + init_op = self.model.optimizer.init() + + # Storing outputs + self._add_output('rl_policy_loss', policy_gradient_loss) + self._add_output('rl_value_loss', baseline_mse_loss) + self._add_output('rl_draw_loss', draw_gradient_loss) + self._add_output('rl_entropy_loss', entropy_loss) + self._add_output('rl_total_loss', a2c_loss) + self._add_output('optimizer_op', a2c_op) + self._add_output('update_op', update_op) + self._add_output('init_op', init_op) + + # -------------------------------------- + # Hooks + # -------------------------------------- + def hook_baseline_pre_condition(dataset): + """ Pre-Condition: First queue to run """ + if not hasattr(dataset, 'last_queue') or dataset.last_queue == '': + return True + return False + + def hook_baseline_post_queue(dataset): + """ Post-Queue: Marks the baseline queue as processed """ + dataset.last_queue = 'a2c_policy_baseline' + + def hook_update_pre_condition(dataset): + """ Pre-Condition: last_queue must be baseline """ + if hasattr(dataset, 'last_queue') and dataset.last_queue == 'a2c_policy_baseline': + return True + return False + + def hook_update_pre_queue(dataset): + """ Pre-Queue: Restricts the queue to 1 dequeue maximum """ + dataset.nb_items_to_pull_from_queue = min(dataset.nb_items_to_pull_from_queue, 1) + + def hook_update_post_queue(dataset): + """ Post-Queue: Marks the update as processed """ + dataset.last_queue = 'a2c_update' + + # -------------------------------------- + # Queues + # -------------------------------------- + self.queue_dataset.create_queue('a2c_policy_baseline', + placeholders={self.model.placeholders['decoder_type']: [TRAINING_DECODER]}, + outputs=[self.model.outputs[output_name] + for output_name in ['optimizer_op'] + self.get_evaluation_tags()], + with_status=True, + pre_condition=hook_baseline_pre_condition, + post_queue=hook_baseline_post_queue) + self.queue_dataset.create_queue('a2c_update', + placeholders={self.model.placeholders['decoder_type']: [GREEDY_DECODER]}, + outputs=[self.model.outputs['update_op']], + with_status=True, + pre_condition=hook_update_pre_condition, + pre_queue=hook_update_pre_queue, + post_queue=hook_update_post_queue) + self.queue_dataset.create_queue('optimizer_init', + placeholders={self.model.placeholders['decoder_type']: [GREEDY_DECODER]}, + outputs=[self.model.outputs['init_op']], + with_status=True) + + @gen.coroutine + def update(self, memory_buffer): + """ Calculates the average gradients and applies them + :param memory_buffer: An instance of memory buffer (for distributed training) or None for non-distributed. + :return: A dictionary of results with evaluation_tags as key, and a list as value + :type memory_buffer: diplomacy_research.models.self_play.memory_buffer.MemoryBuffer + """ + assert memory_buffer is not None or self.cluster_config is None, 'Memory buffer required for dist. training' + yield self.sample(queue_name='a2c_policy_baseline') + + # Non-distributed + if not self.cluster_config: + yield self._update('a2c_update') + return self.get_results() + + # Distributed - Non Chief + if not self.cluster_config.is_chief: + set_barrier_status(memory_buffer, 'train', value=1) + return {} + + # Distributed - Chief + nb_learners = self.cluster_config.count('learner') + wait_for_barrier(memory_buffer, barrier_name='train', job_name='learner', min_value=1, min_done=nb_learners - 1) + yield self._update('a2c_update') + return self.get_results() + + @gen.coroutine + def init(self): + """ Initializes the algorithm and its optimizer. """ + yield self._run_init('optimizer_init') diff --git a/diplomacy_research/models/self_play/algorithms/a2c/train.py b/diplomacy_research/models/self_play/algorithms/a2c/train.py new file mode 100644 index 0000000..0d5e498 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/a2c/train.py @@ -0,0 +1,83 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" A2C Algorithm + - Trains a model with the A2C algorithm +""" +import importlib +import os +from diplomacy_research.models.self_play.algorithms.a2c import Algorithm, load_args +from diplomacy_research.models.training.reinforcement import ReinforcementTrainer +from diplomacy_research.settings import ROOT_DIR +from diplomacy_research.utils.cluster import start_distributed_training +from diplomacy_research.utils.cluster_config.reinforcement import get_cluster_config +from diplomacy_research.utils.model import load_dynamically_from_model_id, find_model_type +from diplomacy_research.utils.model import parse_args_into_flags, run_app + +def main(_): + """ Trains the RL model """ + def start_rl_training(cluster_config, process_pool): + """ Callable fn to start training """ + ReinforcementTrainer(policy_constructor=PolicyModel, + value_constructor=ValueModel, + draw_constructor=DrawModel, + dataset_builder_constructor=BaseDatasetBuilder, + adapter_constructor=PolicyAdapter, + algorithm_constructor=Algorithm, + reward_fn=reward_fn, + flags=FLAGS, + cluster_config=cluster_config, + process_pool=process_pool).start() + + # Detecting if we need to start regular or distributed training + start_distributed_training(callable_fn=start_rl_training, + flags=FLAGS, + get_cluster_config_fn=get_cluster_config, + with_process_pool=True) + +if __name__ == '__main__': + + # Finding the root dir of the model type + base_dir, base_import_path = find_model_type() # pylint: disable=invalid-name + + # Loading model_constructor and args + PolicyModel, load_policy_args = load_dynamically_from_model_id(['PolicyModel', 'load_args'], # pylint: disable=invalid-name + arg_name='model_id', + base_dir=base_dir) + + # Detecting ValueModel, and load_args + ValueModel, load_value_args = load_dynamically_from_model_id(['ValueModel', 'load_args'], # pylint: disable=invalid-name + arg_name='value_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'value')) + + # Detecting DrawModel, and load_args + DrawModel, load_draw_args = load_dynamically_from_model_id(['DrawModel', 'load_args'], # pylint: disable=invalid-name + arg_name='draw_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'draw'), + on_error='ignore') + + # Loading args + ARGS = load_policy_args() \ + + load_value_args() \ + + (load_draw_args() if load_draw_args is not None else []) \ + + load_args() + FLAGS = parse_args_into_flags(ARGS) + + # Loading reward functions, policy adapter, and base dataset builder + PolicyAdapter = importlib.import_module('%s' % base_import_path).PolicyAdapter # pylint: disable=invalid-name + BaseDatasetBuilder = importlib.import_module('%s' % base_import_path).BaseDatasetBuilder # pylint: disable=invalid-name + reward_fn = getattr(importlib.import_module('diplomacy_research.models.self_play.reward_functions'), # pylint: disable=invalid-name + FLAGS.reward_fn)() + + # Running + run_app() diff --git a/diplomacy_research/models/self_play/algorithms/base_algorithm.py b/diplomacy_research/models/self_play/algorithms/base_algorithm.py new file mode 100644 index 0000000..78d5d7c --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/base_algorithm.py @@ -0,0 +1,496 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Algorithm + - Represents the base reinforcement learning algorithm +""" +from abc import ABCMeta, abstractmethod +import logging +import math +import random +from tornado import gen +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.self_play.reward_functions import DEFAULT_PENALTY, DEFAULT_GAMMA +from diplomacy_research.models.self_play.transition import ReplaySample, ReplayPriority +from diplomacy_research.models.state_space import GO_ID, get_orderable_locs_for_powers +from diplomacy_research.utils.cluster import yield_with_display +from diplomacy_research.utils.proto import proto_to_dict + +# Constants +LOGGER = logging.getLogger(__name__) +VERSION_STEP = 'VERSION_STEP' + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + # Default settings + args = [ + ('str', 'model_type', 'order_based', 'Policy model family. "token_based", "order_based".'), + ('int', 'value_model_id', -1, 'The model ID of the value function.'), + ('str', 'power', '', 'The name of the power the agent should play (e.g. FRANCE) otherwise randomly assigned'), + ('str', 'mode', '', 'The RL training mode ("supervised", "self-play", "staggered").'), + ('str', 'eval_mode', 'supervised-1', 'The RL evaluation mode ("supervised-1", "supervised-0".)'), + ('float', 'gamma', DEFAULT_GAMMA, 'The discount factor to use'), + ('str', 'advantage_fn', '', 'The advantage function to use with the algorithm (different for each algo)'), + ('str', 'start_strategy', 'beginning', 'Strategy to select initial state. "beginning", "uniform", "backplay"'), + ('str', 'expert_dataset', '', 'A comma-separated list from no_press, press.'), + ('float', 'experience_replay', 0., 'Float between 0 and 1 - % of transitions to sample from replay buffer.'), + ('float', 'replay_alpha', 0.7, 'The alpha value to use to compute the priorities from the memory buffer'), + ('int', 'min_buffer_items', 10000, 'The min. nb of items in the buffer required for experience replay'), + ('int', 'max_buffer_items', 2000000, 'The maximum nb of items to store in the memory buffer'), + ('float', 'penalty_per_phase', DEFAULT_PENALTY, 'The penalty to add per phase'), + ('str', 'reward_fn', 'DefaultRewardFunction', 'The reward function to use'), + ('int', 'max_nb_years', 35, 'The maximum number of years to play before ending a game'), + ('int', 'nb_transitions_per_update', 2500, 'The number of transitions required to update the params.'), + ('int', 'nb_evaluation_games', 100, 'The number of evaluation games per version update'), + ('int', 'nb_thrashing_states', 3, 'If > 0, stops the game if this nb of identical states are detected.'), + ('int', 'update_interval', 30, 'If > 0, actors send partial trajectories after this many seconds.'), + ('bool', 'auto_draw', True, 'Games should be auto-drawn according to the supervised dataset prob.'), + ('bool', 'sync_gradients', True, 'Indicates that gradients are synchronized among RL workers.'), + ('bool', 'avg_gradients', True, 'Indicates that gradients are average across multiple mini-batches.'), + ('float', 'clip_value_threshold', 5., 'The maximum square diff between the prev and curr value of a state'), + ('float', 'dropout_rate', 0., 'The dropout rate to apply to players and opponents during training.'), + ('bool', 'use_beam', True, 'Use the beam search decoder to select orders during training'), + ('int', 'staggered_versions', 500, 'For mode=="staggered", how often to update the opponent version.'), + ('str', 'training_mode', 'reinforcement', 'The current training mode ("supervised" or "reinforcement").'), + ('int', 'eval_every', 125, 'Wait this nb of versions before running evaluation games.'), + ('str', 'eval_reward_fns', 'DrawSizeReward,SumOfSquares,SurvivorWinReward', 'List of rew fns for evaluation'), + ('str', 'ignored_scope', 'message', 'Scope(s) (comma separated) to ignore by the optimizer op.'), + ('float', 'learning_rate', 1e-4, 'Initial learning rate.'), + ('float', 'lr_decay_factor', 1., 'Learning rate decay factor.'), + ('---', 'early_stopping_stop_after', 0, '[Deleting] For supervised learning only.') + ] + + # Returning + return args + +class BaseAlgorithm(metaclass=ABCMeta): + """ Base Algorithm - Abstract class that represents a RL algorithm """ + + # Static Properties + can_do_experience_replay = False + + def __init__(self, queue_dataset, model, hparams): + """ Constructor + :param queue_dataset: The dataset used to feed data into the model + :param model: The underlying supervised model + :param flags: The parsed flags (Tensorflow arguments) + :param hparams: A dictionary of hyper parameters with their values + :type queue_dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + :type model: diplomacy_research.models.policy.base_policy_model.BasePolicyModel + """ + assert isinstance(queue_dataset, QueueDataset), 'Expected a QueueDataset for the RL algorithm' + self.hparams = hparams + self.cluster_config = queue_dataset.cluster_config + self.transition_buffer = [] + self.list_power_phases_per_game = {} # {game_id: [(power_name, phase_ix)]} + self.proto_fields = queue_dataset.proto_fields + self.sample_futures = [] # List of futures from .sample() + + # Building RL model + self.queue_dataset = queue_dataset + self.model = model + self.model.validate() + self.version_step = self.get_or_create_version_step() + self.model.version_step = self.version_step + self.build() + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this algorithm """ + raise NotImplementedError() + + @staticmethod + def get_evaluation_tags(): + """ Returns a list of fields that are computed during .update() to display in the stats""" + return [] + + @staticmethod + def create_advantage_function(hparams, *, gamma, penalty_per_phase=0.): + """ Returns the advantage function to use with this algorithm """ + raise NotImplementedError() + + def get_or_create_version_step(self): + """ Gets or creates the version step """ + version_step_tensor = self._get_version_step() + if version_step_tensor is None: + version_step_tensor = self._create_version_step() + return version_step_tensor + + @abstractmethod + def build(self): + """ Builds the RL model using the correct optimizer """ + raise NotImplementedError() + + @gen.coroutine + def learn(self, saved_games_proto, all_power_phases_ix, advantage_function): + """ Learns (Calculate gradient updates) from transitions in a saved game + :param saved_games_proto: A list of `.proto.game_pb2.SavedGame` protocol buffer instances. + :param all_power_phases_ix: A list of {power_name: [phases_ix]} for learning (1 list per game) + :param advantage_function: An instance of `.models.self_play.advantages`. + :type advantage_function: diplomacy_research.models.self_play.advantages.base_advantage.BaseAdvantage + """ + yield self._learn(saved_games_proto, all_power_phases_ix, advantage_function) + + @gen.coroutine + def sample(self, queue_name, wait_per_mini_batch=False): + """ Samples items from the transition buffer and puts them in the learning queue + :param queue_name: The name of the queue where to put items + :param wait_per_mini_batch: Boolean. If true, yield for each mini-batch, otherwise just put data in queues. + """ + if len(self.transition_buffer) < 2: + LOGGER.warning('Not enough items in the transition buffer to sample(). Expected at least 2.') + return + + # Sampling transition buffer, in full increments of batch_size. + nb_learners = 1 if not self.cluster_config else self.cluster_config.count('learner') + max_items_to_sample = 1.5 * self.hparams['nb_transitions_per_update'] / nb_learners + nb_samples = self.hparams['batch_size'] * \ + (min(max_items_to_sample, len(self.transition_buffer)) // self.hparams['batch_size']) + if nb_samples == 0: + LOGGER.warning('Not enough data in the buffer to sample a full batch of data.') + LOGGER.warning('Got: %d - Wanted batch of: %d.', len(self.transition_buffer), self.hparams['batch_size']) + nb_samples = len(self.transition_buffer) + nb_samples = int(nb_samples) + LOGGER.info('Sampling %d items from the transition buffer.', nb_samples) + + # Sampling + # Waiting for each mini-batch + if wait_per_mini_batch: + batch_size = self.hparams['batch_size'] + nb_batches = int(math.ceil(nb_samples / self.hparams['batch_size'])) + + # Running all mini-batches + for batch_ix in range(nb_batches): + batch_items = [item for item in random.sample(self.transition_buffer, + min(len(self.transition_buffer), batch_size))] + futures = [self.queue_dataset.get_results(queue_name, item) for item in batch_items] + self.queue_dataset.last_queue = '' + yield yield_with_display(futures, every=60, timeout=900) + if (batch_ix) + 1 % 10 == 0 or (batch_ix + 1) == nb_batches: + LOGGER.info('Running mini-batch %d/%d.', batch_ix + 1, nb_batches) + self.sample_futures += futures + + # Setting the entire buffer in memory, without waiting for results + else: + batch_items = [item for item in random.sample(self.transition_buffer, + min(len(self.transition_buffer), nb_samples))] + for item in batch_items: + self.sample_futures += [self.queue_dataset.get_results(queue_name, item)] + + LOGGER.info('Done sampling items from the transition buffer.') + + @abstractmethod + @gen.coroutine + def update(self, memory_buffer): + """ Calculates the average gradients and applies them + :param memory_buffer: An instance of memory buffer (for distributed training) or None for non-distributed. + :return: A dictionary of results with evaluation_tags as key, and a list as value + :type memory_buffer: diplomacy_research.models.self_play.memory_buffer.MemoryBuffer + """ + raise NotImplementedError() + + @gen.coroutine + def init(self): + """ Initializes the algorithm and its optimizer. """ + raise NotImplementedError() + + def get_results(self): + """ Retrieves the evaluation results from the last update / version + :return: A dictionary with evaluation tag as key and a list of results as value + """ + results = {eval_tag: [] for eval_tag in self.get_evaluation_tags()} + + # Processing each future + for future in self.sample_futures: + result = future.result() + if not result: + continue + for eval_tag, eval_result in zip(self.get_evaluation_tags(), result[1:]): + results[eval_tag] += [eval_result] + + # Returning + return results + + @staticmethod + def get_power_phases_ix(saved_game_proto, nb_rl_agents): + """ Computes the list of (power_name, phase_ix) for the given game to learn + :param saved_game_proto: An instance of `.proto.game_pb2.SavedGame` + :param nb_rl_agents: The number of RL agents in the current mode. + :return: A dictionary with power name as key and a list of phase_ix for that power as value + """ + nb_phases = len(saved_game_proto.phases) + rl_powers = saved_game_proto.assigned_powers[:nb_rl_agents] + start_phase_ix = saved_game_proto.start_phase_ix + + # Returning + return {power_name: [phase_ix for phase_ix in range(start_phase_ix, nb_phases - 1)] + for power_name in rl_powers} + + @gen.coroutine + def get_priorities(self, saved_games_proto, advantage_function): + """ Computes the (original) replay priorities for the generated games + :param saved_games_proto: An list of `.proto.game_pb2.SavedGame` protocol buffer instances. + :param advantage_function: An instance of `.models.self_play.advantages`. + :return: A list of `ReplayPriority` objects. + :type advantage_function: diplomacy_research.models.self_play.advantages.base_advantage.BaseAdvantage + :rtype: [diplomacy_research.models.self_play.transition.ReplayPriority] + """ + # Converting games to replay samples + # Only keeping transitions where we know we issued orders + replay_samples = [] + for saved_game_proto in saved_games_proto: + + # Converting [(power, phase_ix)] to {power: [phases_ix]} + list_power_phases = self.list_power_phases_per_game.get(saved_game_proto.id, []) + if list_power_phases: + power_phases_ix = {} + for power_name, phase_ix in list_power_phases: + if power_name not in power_phases_ix: + power_phases_ix[power_name] = [] + power_phases_ix[power_name] += [phase_ix] + replay_samples += [ReplaySample(saved_game_proto, power_phases_ix=power_phases_ix)] + + # Getting new priorities + priorities = yield self.get_new_priorities(replay_samples, advantage_function) + return priorities + + @staticmethod + @gen.coroutine + def get_new_priorities(replay_samples, advantage_function): + """ Computes the new replay priorities for the replay samples retrieved + :param replay_samples: A list of `ReplaySample` objects + :param advantage_function: An instance of `.models.self_play.advantages`. + :return: A list of `ReplayPriority` objects. + :type replay_samples: [diplomacy_research.models.self_play.transition.ReplaySample] + :type advantage_function: diplomacy_research.models.self_play.advantages.base_advantage.BaseAdvantage + :rtype: [diplomacy_research.models.self_play.transition.ReplayPriority] + """ + # --- Currently disabled --- + # --- This method will always return a new priority of 0, because it is too expensive to compute otherwise --- + del advantage_function # Unused args + priorities = [] + for replay_sample in replay_samples: + for power_name in replay_sample.power_phases_ix: + for phase_ix in replay_sample.power_phases_ix[power_name]: + priorities += [ReplayPriority(game_id=replay_sample.saved_game_proto.id, + power_name=power_name, + phase_ix=phase_ix, + priority=0.)] + return priorities + + @gen.coroutine + def clear_buffers(self): + """ Finalizes the version update, clears the buffers and updates the memory buffer if needed """ + self.transition_buffer = [] + self.list_power_phases_per_game = {} + self.sample_futures = [] + + # ------------------------------------- + # --------- Private Methods ---------- + # ------------------------------------- + def _add_placeholder(self, placeholder_name, placeholder_value): + """ Adds a placeholder to the model """ + from diplomacy_research.utils.tensorflow import tf + if not self.model: + LOGGER.warning('Cannot add the placeholder "%s". Model has not been built.', placeholder_name) + return + + # Storing in collection + cached_placeholder = tf.get_collection('placeholder_{}'.format(placeholder_name)) + if not cached_placeholder: + tf.add_to_collection('placeholder_{}'.format(placeholder_name), placeholder_value) + self.model.placeholders[placeholder_name] = placeholder_value + + def _add_output(self, output_name, output_value): + """ Adds an output to the model """ + from diplomacy_research.utils.tensorflow import tf + if not self.model: + LOGGER.warning('Cannot add the output "%s". Model has not been built.', output_name) + + # Storing output in collection + self.model.outputs[output_name] = output_value + tf.add_to_collection(output_name, output_value) + + @staticmethod + def _get_version_step(): + """ Gets the version step tensor """ + from diplomacy_research.utils.tensorflow import tf + graph = tf.get_default_graph() + version_step_tensors = graph.get_collection(VERSION_STEP) + if not version_step_tensors: + return None + if len(version_step_tensors) == 1: + return version_step_tensors[0] + raise RuntimeError('Multiple version step tensors defined') + + @staticmethod + def _create_version_step(): + """ Creates the version step tensor if it doesn't exist """ + from diplomacy_research.utils.tensorflow import tf + if BaseAlgorithm._get_version_step() is not None: + raise ValueError('"version_step" already exists.') + with tf.get_default_graph().name_scope(None): + return tf.get_variable(VERSION_STEP, + shape=(), + dtype=tf.int64, + initializer=tf.zeros_initializer(), + trainable=False, + collections=[tf.GraphKeys.GLOBAL_VARIABLES, VERSION_STEP]) + + @staticmethod + def _post_process_transition_details(transition_details): + """ Performs some post-processing on the transition details. + Required by REINFORCE to compute average rewards + :param transition_details: A list of TransitionDetails named tuple. + Each transition details contains + 1) a `.models.self_play.transition.Transition` transition. + 2) the corresponding reward target to be used for the policy gradient update, + 3) the corresponding value target to be used for the critic update, + 4) a list of log importance sampling ratio for each output token or None + 5) the updated (current) log probs for each token in the model + :return: The updated transition_details + """ + return transition_details + + @gen.coroutine + def _learn(self, saved_games_proto, all_power_phases_ix, advantage_function): + """ Learns (Calculate gradient updates) from transitions in a saved game + :param saved_games_proto: A list of `.proto.game_pb2.SavedGame` protocol buffer instances. + :param all_power_phases_ix: A list of {power_name: [phases_ix]} for learning (1 list per game) + :param advantage_function: An instance of `.models.self_play.advantages`. + :type advantage_function: diplomacy_research.models.self_play.advantages.base_advantage.BaseAdvantage + """ + assert len(saved_games_proto) == len(all_power_phases_ix), 'Expecting one power_phases_ix per game' + + # Stop learning if we have more than 2x the number of target transitions + nb_learners = 1 if not self.cluster_config else self.cluster_config.count('learner') + max_nb_transitions = 2 * self.hparams['nb_transitions_per_update'] / nb_learners + + # Processing each saved game + for saved_game_proto, power_phases_ix in zip(saved_games_proto, all_power_phases_ix): + + power_warned = [] + kwargs = {power_name: proto_to_dict(saved_game_proto.kwargs[power_name]) + for power_name in saved_game_proto.kwargs} + + for power_name, phases_ix in power_phases_ix.items(): + transition_details = advantage_function.get_transition_details(saved_game_proto, power_name, **kwargs) + transition_details = [transition_detail for transition_detail in transition_details + if transition_detail.transition.phase_ix in phases_ix] + transition_details = self._post_process_transition_details(transition_details) + + # Warning if we didn't get all the transition details we asked for + if len(phases_ix) != len(transition_details): + LOGGER.warning('Asked for details of %d transitions. Got %s.', + len(power_phases_ix), len(transition_details)) + + # Looping over the locations on which we want to learn + for transition_detail in transition_details: + transition = transition_detail.transition + power_name = transition_detail.power_name + phase_ix = transition.phase_ix + game_id = transition.state.game_id + + # No orders + if transition.policy is not None \ + and not transition.orders[power_name].value \ + and not transition.policy[power_name].locs: + continue + + # We are missing the details of the policy to learn, issuing a warning + if transition.policy is None \ + or power_name not in transition.policy \ + or not transition.policy[power_name].tokens \ + or (transition.orders[power_name].value and not transition.policy[power_name].log_probs): + if power_name not in power_warned: + LOGGER.warning('The policy details for %s are missing for phase %d (Game %s). Skipping.', + power_name, + phase_ix, + saved_game_proto.id) + power_warned += [power_name] + continue + + # For adjustment phase, we need to use all the orderable locs + if transition.state.name[-1] == 'A': + locs, _ = get_orderable_locs_for_powers(transition.state, [power_name]) + else: + locs = transition.policy[power_name].locs + + # Getting feedable item + item = self.queue_dataset.\ + get_feedable_item(locs=locs, + state_proto=transition.state, + power_name=power_name, + phase_history_proto=transition.phase_history, + possible_orders_proto=transition.possible_orders, + **kwargs[power_name]) + + # No item - Skipping + if not item: + continue + + current_tokens = list(transition.policy[power_name].tokens) + item['decoder_inputs'] = [GO_ID] + current_tokens + item['decoder_lengths'] = len(current_tokens) + + # Algo-specific fields + if 'draw_action' in self.proto_fields: + item['draw_action'] = transition_detail.draw_action + if 'reward_target' in self.proto_fields: + item['reward_target'] = transition_detail.reward_target + if 'value_target' in self.proto_fields: + item['value_target'] = transition_detail.value_target + if 'old_log_probs' in self.proto_fields: + item['old_log_probs'] = transition_detail.log_probs + if 'log_importance_sampling_ratio' in self.proto_fields and transition_detail.log_p_t is not None: + item['log_importance_sampling_ratio'] = transition_detail.log_p_t + + # Storing item + self.transition_buffer.append(item) + self.list_power_phases_per_game.setdefault(game_id, []) + self.list_power_phases_per_game[game_id] += [(power_name, phase_ix)] + + # Max number of transitions reached + if len(self.transition_buffer) >= max_nb_transitions: + return + + @gen.coroutine + def _update(self, update_queue_name): + """ Calculates the average gradients and applies them + :param update_queue_name: The name of the update_op queue + """ + if self.cluster_config and not self.cluster_config.is_chief: + LOGGER.error('Only the chief can run the update() op. Aborting.') + return + if len(self.transition_buffer) < 2: + LOGGER.warning('Not enough items in the transition buffer to update(). Expected at least 2.') + return + + # Setting last queue as '', so learning can start + update_future = self.queue_dataset.get_results(update_queue_name, item={}) + self.queue_dataset.last_queue = '' + yield yield_with_display(update_future, every=120, timeout=1800) + + @gen.coroutine + def _run_init(self, init_queue_name): + """ Runs the algorithm and its optimizer initialization. + :param init_queue_name: The name of the init_op queue + """ + # Continuing with a warning if this operating hangs + try: + update_future = self.queue_dataset.get_results(init_queue_name, item={}) + yield yield_with_display(update_future, every=30, timeout=120) + except TimeoutError: + LOGGER.warning('Unable to init() the accumulators. This might happen if they are already empty.') diff --git a/diplomacy_research/models/self_play/algorithms/ppo/__init__.py b/diplomacy_research/models/self_play/algorithms/ppo/__init__.py new file mode 100644 index 0000000..81870c7 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/ppo/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" PPO Algorithm """ +from .algorithm import PPOAlgorithm as Algorithm, load_args diff --git a/diplomacy_research/models/self_play/algorithms/ppo/algorithm.py b/diplomacy_research/models/self_play/algorithms/ppo/algorithm.py new file mode 100644 index 0000000..a0e314d --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/ppo/algorithm.py @@ -0,0 +1,277 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" PPO Algorithm + - Application of Proximal Policy Optimization (1707.06347) +""" +import logging +import numpy as np +from tornado import gen +from diplomacy_research.models.datasets.base_builder import FixedProtoField, VarProtoField +from diplomacy_research.models.policy.base_policy_model import TRAINING_DECODER, GREEDY_DECODER +from diplomacy_research.models.state_space import TOKENS_PER_ORDER, NB_SUPPLY_CENTERS +from diplomacy_research.models.self_play.advantages import MonteCarlo, NStep, GAE, VTrace +from diplomacy_research.models.self_play.algorithms.base_algorithm import BaseAlgorithm, load_args as load_parent_args +from diplomacy_research.models.training.memory_buffer.barrier import set_barrier_status, wait_for_barrier + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + # Default settings + args = load_parent_args() + [ + ('bool', 'avg_gradients', False, 'For distributed rl training, uses AvgGradOptimizer'), + ('str', 'advantage_fn', 'gae', 'The advantage function to use (valid: monte_carlo, n_step, gae)'), + ('int', 'nb_steps', 15, 'The number of steps (phases) for the advantage function'), + ('float', 'lambda_', 0.9, 'The value of the lambda parameter to use for GAE'), + ('float', 'c_bar', 1., 'The value of the c_bar parameter for V-Trace'), + ('float', 'p_bar', 1., 'The value of the p_bar parameter for V-Trace'), + + ('int', 'nb_mini_epochs', 3, 'The number of mini-epochs to use for parameter updates'), + ('float', 'epsilon', 0.2, 'The epsilon to use to clip the importance sampling ratio.'), + ('float', 'value_coeff', 0.5, 'The coefficient to apply to the value loss'), + ('float', 'draw_coeff', 0.5, 'The coefficient to apply to the draw policy loss'), + ('float', 'entropy_coeff', 0.1, 'The coefficient to apply to the entropy loss'), + ] + return args + +class PPOAlgorithm(BaseAlgorithm): + """ PPO Algorithm - Implements the PPO algorithm (1707.06347) """ + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this algorithm """ + return {'draw_action': FixedProtoField([], np.bool), + 'draw_target': FixedProtoField([], np.float32), + 'reward_target': FixedProtoField([], np.float32), + 'value_target': FixedProtoField([], np.float32), + 'old_log_probs': VarProtoField([TOKENS_PER_ORDER * NB_SUPPLY_CENTERS], np.float32)} + + @staticmethod + def get_evaluation_tags(): + """ Returns a list of fields that are computed during .update() to display in the stats""" + return ['rl_policy_loss', 'rl_value_loss', 'rl_draw_loss', 'rl_entropy_loss', 'rl_total_loss'] + + @staticmethod + def create_advantage_function(hparams, *, gamma, penalty_per_phase=0.): + """ Returns the advantage function to use with this algorithm + :type adapter: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter + :type reward_fn: diplomacy_research.models.self_play.reward_functions.AbstractRewardFunction + """ + # Monte-Carlo + if hparams['advantage_fn'] == 'monte_carlo': + return MonteCarlo(gamma=gamma, + penalty_per_phase=penalty_per_phase) + + # N-Step + if hparams['advantage_fn'] in ['n_step', 'nstep']: + return NStep(nb_steps=hparams['nb_steps'], + gamma=gamma, + penalty_per_phase=penalty_per_phase) + + # GAE + if hparams['advantage_fn'] == 'gae': + return GAE(lambda_=hparams['lambda_'], + gamma=gamma, + penalty_per_phase=penalty_per_phase) + + # V-Trace + if hparams['advantage_fn'] in ('v_trace', 'vtrace'): + return VTrace(lambda_=hparams['lambda_'], + c_bar=hparams['c_bar'], + p_bar=hparams['p_bar'], + gamma=gamma, + penalty_per_phase=penalty_per_phase) + + # Invalid advantage fn + raise ValueError('Invalid advantage function. Got %s. Valid values: %s' % + (hparams['advantage_fn'], ['monte_carlo', 'n_step', 'gae', 'v_trace'])) + + def build(self): + """ Builds the RL model using the correct optimizer """ + from diplomacy_research.utils.tensorflow import tf, tfp, normalize, to_float + from diplomacy_research.models.layers.avg_grad_optimizer import AvgGradOptimizer + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.model.hparams[hparam_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Placeholders + stop_gradient_all = self.model.placeholders['stop_gradient_all'] + + # Features + decoder_lengths = self.model.features['decoder_lengths'] # tf.int32 - (b,) + draw_action = self.model.features['draw_action'] # tf.bool - (b,) + reward_target = self.model.features['reward_target'] # tf.float32 - (b,) + value_target = self.model.features['value_target'] # tf.float32 - (b,) + old_log_probs = self.model.features['old_log_probs'] # tf.float32 - (b, dec_len) + # current_power = self.model.features['current_power'] # tf.int32 - (b,) + + # Making sure all RNN lengths are at least 1 + # Trimming to the maximum decoder length in the batch + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Retrieving model outputs + baseline = values = self.model.outputs['state_value'] # (b,) + logits = self.model.outputs['logits'] # (b, dec, VOCAB) + sequence_mask = tf.sequence_mask(raw_decoder_lengths, # (b, dec) + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + + # Computing Baseline Mean Square Error Loss + with tf.variable_scope('baseline_scope'): + baseline_mse_loss = tf.minimum(tf.square(value_target - values), hps('clip_value_threshold')) + baseline_mse_loss = tf.reduce_sum(baseline_mse_loss) # () + + # Calculating surrogate loss + with tf.variable_scope('policy_gradient_scope'): + new_policy_log_probs = self.model.outputs['log_probs'] * sequence_mask # (b, dec_len) + old_policy_log_probs = old_log_probs * sequence_mask # (b, dec_len) + + new_sum_log_probs = tf.reduce_sum(new_policy_log_probs, axis=-1) # (b,) + old_sum_log_probs = tf.reduce_sum(old_policy_log_probs, axis=-1) # (b,) + + ratio = tf.math.exp(new_sum_log_probs - old_sum_log_probs) # (b,) + clipped_ratio = tf.clip_by_value(ratio, 1. - hps('epsilon'), 1. + hps('epsilon')) # (b,) + advantages = tf.stop_gradient(normalize(reward_target - baseline)) # (b,) + + surrogate_loss_1 = ratio * advantages # (b,) + surrogate_loss_2 = clipped_ratio * advantages # (b,) + surrogate_loss = -tf.reduce_mean(tf.math.minimum(surrogate_loss_1, surrogate_loss_2)) # () + + # Calculating policy gradient for draw action + with tf.variable_scope('draw_gradient_scope'): + draw_action = to_float(draw_action) # (b,) + draw_prob = self.model.outputs['draw_prob'] # (b,) + log_prob_of_draw = draw_action * tf.log(draw_prob) + (1. - draw_action) * tf.log(1. - draw_prob) + draw_gradient_loss = -1. * log_prob_of_draw * advantages # (b,) + draw_gradient_loss = tf.reduce_mean(draw_gradient_loss) # () + + # Calculating entropy loss + with tf.variable_scope('entropy_scope'): + entropy = tfp.distributions.Categorical(logits=logits).entropy() + entropy_loss = -tf.reduce_mean(entropy) # () + + # Scopes + scope = ['policy', 'value', 'draw'] + global_ignored_scope = None if not hps('ignored_scope') else hps('ignored_scope').split(',') + + # Creating PPO loss + ppo_loss = surrogate_loss \ + + hps('value_coeff') * baseline_mse_loss \ + + hps('draw_coeff') * draw_gradient_loss \ + + hps('entropy_coeff') * entropy_loss + ppo_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(ppo_loss), # pylint: disable=cell-var-from-loop + lambda: ppo_loss) # pylint: disable=cell-var-from-loop + cost_and_scope = [(ppo_loss, scope, None)] + + # Creating optimizer op + ppo_op = self.model.create_optimizer_op(cost_and_scope=cost_and_scope, + ignored_scope=global_ignored_scope, + max_gradient_norm=hps('max_gradient_norm')) + + # Making sure we are not using the AvgGradOptimizer, but directly the AdamOptimizer + assert not isinstance(self.model.optimizer, AvgGradOptimizer), 'PPO does not use AvgGradOptimizer' + + # Storing outputs + self._add_output('rl_policy_loss', surrogate_loss) + self._add_output('rl_value_loss', baseline_mse_loss) + self._add_output('rl_draw_loss', draw_gradient_loss) + self._add_output('rl_entropy_loss', entropy_loss) + self._add_output('rl_total_loss', ppo_loss) + self._add_output('optimizer_op', ppo_op) + + # -------------------------------------- + # Hooks + # -------------------------------------- + def hook_baseline_pre_condition(dataset): + """ Pre-Condition: First queue to run """ + if not hasattr(dataset, 'last_queue') or dataset.last_queue == '': + return True + return False + + def hook_baseline_post_queue(dataset): + """ Post-Queue: Marks the baseline queue as processed """ + dataset.last_queue = 'ppo_policy_baseline' + + # -------------------------------------- + # Queues + # -------------------------------------- + self.queue_dataset.create_queue('ppo_policy_baseline', + placeholders={self.model.placeholders['decoder_type']: [TRAINING_DECODER]}, + outputs=[self.model.outputs[output_name] + for output_name in ['optimizer_op'] + self.get_evaluation_tags()], + pre_condition=hook_baseline_pre_condition, + post_queue=hook_baseline_post_queue) + self.queue_dataset.create_queue('ppo_increase_version', + placeholders={self.model.placeholders['decoder_type']: [GREEDY_DECODER]}, + outputs=[tf.assign_add(self.version_step, 1)], + with_status=True) + + @gen.coroutine + def update(self, memory_buffer): + """ Calculates the average gradients and applies them + :param memory_buffer: An instance of memory buffer (for distributed training) or None for non-distributed. + :return: A dictionary of results with evaluation_tags as key, and a list as value + :type memory_buffer: diplomacy_research.models.self_play.memory_buffer.MemoryBuffer + """ + assert memory_buffer is not None or self.cluster_config is None, 'Memory buffer required for dist. training' + for epoch_ix in range(self.hparams['nb_mini_epochs']): + yield self.sample(queue_name='ppo_policy_baseline', wait_per_mini_batch=True) + + # Not distributed - Continuing + if not self.cluster_config: + continue + + # Distributed - Non Chief + # Setting status on barrier and waiting for all learners to complete epoch + if not self.cluster_config.is_chief: + nb_learners = self.cluster_config.count('learner') + set_barrier_status(memory_buffer, 'train', value=epoch_ix + 1) + wait_for_barrier(memory_buffer, + barrier_name='train', + job_name='learner', + min_value=epoch_ix + 1, + min_done=nb_learners) + continue + + # Distributed - Chief + # Waiting for all learners to have completed, then clear barrier + nb_learners = self.cluster_config.count('learner') + wait_for_barrier(memory_buffer, + barrier_name='train', + job_name='learner', + min_value=epoch_ix + 1, + min_done=nb_learners - 1) + set_barrier_status(memory_buffer, 'train', value=epoch_ix + 1) + + # Increasing version if non-distributed or if chief + if not self.cluster_config or self.cluster_config.is_chief: + yield self.queue_dataset.get_results('ppo_increase_version', item={}) + return self.get_results() + + # Returning empty results if distributed and non-chief + return {} + + @gen.coroutine + def init(self): + """ Initializes the algorithm and its optimizer. """ + # PPO does not use gradient accumulator and does not require initialization. diff --git a/diplomacy_research/models/self_play/algorithms/ppo/train.py b/diplomacy_research/models/self_play/algorithms/ppo/train.py new file mode 100644 index 0000000..160131e --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/ppo/train.py @@ -0,0 +1,83 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" PPO Algorithm + - Trains a model with the PPO algorithm +""" +import importlib +import os +from diplomacy_research.models.self_play.algorithms.ppo import Algorithm, load_args +from diplomacy_research.models.training.reinforcement import ReinforcementTrainer +from diplomacy_research.settings import ROOT_DIR +from diplomacy_research.utils.cluster import start_distributed_training +from diplomacy_research.utils.cluster_config.reinforcement import get_cluster_config +from diplomacy_research.utils.model import load_dynamically_from_model_id, find_model_type +from diplomacy_research.utils.model import parse_args_into_flags, run_app + +def main(_): + """ Trains the RL model """ + def start_rl_training(cluster_config, process_pool): + """ Callable fn to start training """ + ReinforcementTrainer(policy_constructor=PolicyModel, + value_constructor=ValueModel, + draw_constructor=DrawModel, + dataset_builder_constructor=BaseDatasetBuilder, + adapter_constructor=PolicyAdapter, + algorithm_constructor=Algorithm, + reward_fn=reward_fn, + flags=FLAGS, + cluster_config=cluster_config, + process_pool=process_pool).start() + + # Detecting if we need to start regular or distributed training + start_distributed_training(callable_fn=start_rl_training, + flags=FLAGS, + get_cluster_config_fn=get_cluster_config, + with_process_pool=True) + +if __name__ == '__main__': + + # Finding the root dir of the model type + base_dir, base_import_path = find_model_type() # pylint: disable=invalid-name + + # Loading model_constructor and args + PolicyModel, load_policy_args = load_dynamically_from_model_id(['PolicyModel', 'load_args'], # pylint: disable=invalid-name + arg_name='model_id', + base_dir=base_dir) + + # Detecting ValueModel, and load_args + ValueModel, load_value_args = load_dynamically_from_model_id(['ValueModel', 'load_args'], # pylint: disable=invalid-name + arg_name='value_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'value')) + + # Detecting DrawModel, and load_args + DrawModel, load_draw_args = load_dynamically_from_model_id(['DrawModel', 'load_args'], # pylint: disable=invalid-name + arg_name='draw_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'draw'), + on_error='ignore') + + # Loading args + ARGS = load_policy_args() \ + + load_value_args() \ + + (load_draw_args() if load_draw_args is not None else []) \ + + load_args() + FLAGS = parse_args_into_flags(ARGS) + + # Loading reward functions, policy adapter, and base dataset builder + PolicyAdapter = importlib.import_module('%s' % base_import_path).PolicyAdapter # pylint: disable=invalid-name + BaseDatasetBuilder = importlib.import_module('%s' % base_import_path).BaseDatasetBuilder # pylint: disable=invalid-name + reward_fn = getattr(importlib.import_module('diplomacy_research.models.self_play.reward_functions'), # pylint: disable=invalid-name + FLAGS.reward_fn)() + + # Running + run_app() diff --git a/diplomacy_research/models/self_play/algorithms/reinforce/__init__.py b/diplomacy_research/models/self_play/algorithms/reinforce/__init__.py new file mode 100644 index 0000000..67ae1e8 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/reinforce/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" REINFORCE Algorithm """ +from .algorithm import ReinforceAlgorithm as Algorithm, load_args diff --git a/diplomacy_research/models/self_play/algorithms/reinforce/algorithm.py b/diplomacy_research/models/self_play/algorithms/reinforce/algorithm.py new file mode 100644 index 0000000..f10bcc7 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/reinforce/algorithm.py @@ -0,0 +1,288 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" REINFORCE Algorithm + - Application of REINFORCE algorithm (Williams, 1992) +""" +import logging +import numpy as np +from tornado import gen +from diplomacy_research.models.datasets.base_builder import FixedProtoField +from diplomacy_research.models.policy.base_policy_model import TRAINING_DECODER, GREEDY_DECODER +from diplomacy_research.models.self_play.advantages import MonteCarlo +from diplomacy_research.models.self_play.algorithms.base_algorithm import BaseAlgorithm, load_args as load_parent_args +from diplomacy_research.models.self_play.transition import TransitionDetails +from diplomacy_research.models.training.memory_buffer.barrier import set_barrier_status, wait_for_barrier + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + # Default settings + args = load_parent_args() + [ + ('str', 'advantage_fn', 'monte_carlo', 'The advantage function to use (valid: monte_carlo)'), + ('float', 'buffer_size', 2.0, 'The size of the buffer (<=100 = x * nb_transitions_per_update else buffer_size'), + ('float', 'draw_coeff', 0.5, 'The coefficient to apply to the draw policy loss'), + ('float', 'entropy_coeff', 0.1, 'The coefficient to apply to the entropy loss'), + ] + return args + +class ReinforceAlgorithm(BaseAlgorithm): + """ REINFORCE Algorithm - Implements the REINFORCE algorithm (Williams, 1992) """ + + def __init__(self, queue_dataset, model, hparams): + """ Constructor + :param feedable_dataset: The feedable dataset used to feed data into the model + :param model: The underlying supervised model + :param flags: The parsed flags (Tensorflow arguments) + :param hparams: A dictionary of hyper parameters with their values + :type queue_dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + :type model: diplomacy_research.models.policy.base_policy_model.BasePolicyModel + """ + BaseAlgorithm.__init__(self, queue_dataset, model, hparams) + self.past_rewards = [] # Maintains a list of value rewards across all states + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this algorithm """ + return {'draw_action': FixedProtoField([], np.bool), + 'draw_target': FixedProtoField([], np.float32), + 'reward_target': FixedProtoField([], np.float32), + 'value_target': FixedProtoField([], np.float32)} + + @staticmethod + def get_evaluation_tags(): + """ Returns a list of fields that are computed during .update() to display in the stats""" + return ['rl_policy_loss', 'rl_draw_loss', 'rl_entropy_loss', 'rl_total_loss'] + + @staticmethod + def create_advantage_function(hparams, *, gamma, penalty_per_phase=0.): + """ Returns the advantage function to use with this algorithm """ + # Monte-Carlo + if hparams['advantage_fn'] == 'monte_carlo': + return MonteCarlo(gamma=gamma, penalty_per_phase=penalty_per_phase) + + # Invalid advantage fn + raise ValueError('Invalid advantage function. Got %s. Valid values: %s' % + (hparams['advantage_fn'], ['monte_carlo'])) + + def build(self): + """ Builds the RL model using the correct optimizer """ + from diplomacy_research.utils.tensorflow import tf, tfp, normalize, to_float + from diplomacy_research.models.layers.avg_grad_optimizer import AvgGradOptimizer + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.model.hparams[hparam_name] + + # Training loop + with tf.variable_scope('policy', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Placeholders + stop_gradient_all = self.model.placeholders['stop_gradient_all'] + + # Features + decoder_lengths = self.model.features['decoder_lengths'] # tf.int32 - (b,) + draw_action = self.model.features['draw_action'] # tf.bool - (b,) + reward_target = self.model.features['reward_target'] # tf.float32 - (b,) + value_target = self.model.features['value_target'] # tf.float32 - (b,) + # current_power = self.model.features['current_power'] # tf.int32 - (b,) + + # Making sure all RNN lengths are at least 1 + # Trimming to the maximum decoder length in the batch + raw_decoder_lengths = decoder_lengths + decoder_lengths = tf.math.maximum(1, decoder_lengths) + + # Retrieving model outputs + # Using a fixed baseline (e.g. moving average) rather than a parameterized value function + baseline = value_target # (b,) + logits = self.model.outputs['logits'] # (b, dec_len, VOCAB_SIZE) + sequence_mask = tf.sequence_mask(raw_decoder_lengths, # (b, dec) + maxlen=tf.reduce_max(decoder_lengths), + dtype=tf.float32) + + # Calculating policy gradient loss + with tf.variable_scope('policy_gradient_scope'): + log_prob_of_tokens = self.model.outputs['log_probs'] * sequence_mask # (b, dec_len) + + # Calculating loss and optimizer op + advantages = tf.stop_gradient(normalize(reward_target - baseline)) # (b,) + policy_gradient_loss = -tf.reduce_sum(log_prob_of_tokens, axis=-1) * advantages # (b,) + policy_gradient_loss = tf.reduce_mean(policy_gradient_loss) # () + + # Calculating policy gradient for draw action + with tf.variable_scope('draw_gradient_scope'): + draw_action = to_float(draw_action) # (b,) + draw_prob = self.model.outputs['draw_prob'] # (b,) + log_prob_of_draw = draw_action * tf.log(draw_prob) + (1. - draw_action) * tf.log(1. - draw_prob) + draw_gradient_loss = -1. * log_prob_of_draw * advantages # (b,) + draw_gradient_loss = tf.reduce_mean(draw_gradient_loss) # () + + # Calculating entropy loss + with tf.variable_scope('entropy_scope'): + categorial_dist = tfp.distributions.Categorical(logits=logits) + entropy = categorial_dist.entropy() + entropy_loss = -tf.reduce_mean(entropy) # () + + # Scopes + scope = ['policy', 'draw'] + global_ignored_scope = [] if not hps('ignored_scope') else hps('ignored_scope').split(',') + global_ignored_scope += ['value'] + + # Creating REINFORCE loss with baseline + reinforce_loss = policy_gradient_loss \ + + hps('draw_coeff') * draw_gradient_loss \ + + hps('entropy_coeff') * entropy_loss + reinforce_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(reinforce_loss), # pylint: disable=cell-var-from-loop + lambda: reinforce_loss) # pylint: disable=cell-var-from-loop + cost_and_scope = [(reinforce_loss, scope, None)] + + # Creating optimizer op + reinforce_op = self.model.create_optimizer_op(cost_and_scope=cost_and_scope, + ignored_scope=global_ignored_scope, + max_gradient_norm=None) # AvgGradOptimizer will clip + + # Getting AvgGradOptimizer.update(version_step) + assert isinstance(self.model.optimizer, AvgGradOptimizer), 'REINFORCE requires gradient averaging' + update_op = self.model.optimizer.update(self.version_step) + init_op = self.model.optimizer.init() + + # Storing outputs + self._add_output('rl_policy_loss', policy_gradient_loss) + self._add_output('rl_draw_loss', draw_gradient_loss) + self._add_output('rl_entropy_loss', entropy_loss) + self._add_output('rl_total_loss', reinforce_loss) + self._add_output('optimizer_op', reinforce_op) + self._add_output('update_op', update_op) + self._add_output('init_op', init_op) + + # -------------------------------------- + # Hooks + # -------------------------------------- + def hook_baseline_pre_condition(dataset): + """ Pre-Condition: First queue to run """ + if not hasattr(dataset, 'last_queue') or dataset.last_queue == '': + return True + return False + + def hook_baseline_post_queue(dataset): + """ Post-Queue: Marks the baseline queue as processed """ + dataset.last_queue = 'reinforce_policy' + + def hook_update_pre_condition(dataset): + """ Pre-Condition: last_queue must be baseline """ + if hasattr(dataset, 'last_queue') and dataset.last_queue == 'reinforce_policy': + return True + return False + + def hook_update_pre_queue(dataset): + """ Pre-Queue: Restricts the queue to 1 dequeue maximum """ + dataset.nb_items_to_pull_from_queue = min(dataset.nb_items_to_pull_from_queue, 1) + + def hook_update_post_queue(dataset): + """ Post-Queue: Marks the update as processed """ + dataset.last_queue = 'reinforce_update' + + # -------------------------------------- + # Queues + # -------------------------------------- + self.queue_dataset.create_queue('reinforce_policy', + placeholders={self.model.placeholders['decoder_type']: [TRAINING_DECODER]}, + outputs=[self.model.outputs[output_name] + for output_name in ['optimizer_op'] + self.get_evaluation_tags()], + with_status=True, + pre_condition=hook_baseline_pre_condition, + post_queue=hook_baseline_post_queue) + self.queue_dataset.create_queue('reinforce_update', + placeholders={self.model.placeholders['decoder_type']: [GREEDY_DECODER]}, + outputs=[self.model.outputs['update_op']], + with_status=True, + pre_condition=hook_update_pre_condition, + pre_queue=hook_update_pre_queue, + post_queue=hook_update_post_queue) + self.queue_dataset.create_queue('optimizer_init', + placeholders={self.model.placeholders['decoder_type']: [GREEDY_DECODER]}, + outputs=[self.model.outputs['init_op']], + with_status=True) + + @gen.coroutine + def update(self, memory_buffer): + """ Calculates the average gradients and applies them + :param memory_buffer: An instance of memory buffer (for distributed training) or None for non-distributed. + :return: A dictionary of results with evaluation_tags as key, and a list as value + :type memory_buffer: diplomacy_research.models.self_play.memory_buffer.MemoryBuffer + """ + assert memory_buffer is not None or self.cluster_config is None, 'Memory buffer required for dist. training' + yield self.sample(queue_name='reinforce_policy') + + # Non-distributed + if not self.cluster_config: + yield self._update('reinforce_update') + return self.get_results() + + # Distributed - Non Chief + if not self.cluster_config.is_chief: + set_barrier_status(memory_buffer, 'train', value=1) + return {} + + # Distributed - Chief + nb_learners = self.cluster_config.count('learner') + wait_for_barrier(memory_buffer, barrier_name='train', job_name='learner', min_value=1, min_done=nb_learners - 1) + yield self._update('reinforce_update') + return self.get_results() + + @gen.coroutine + def init(self): + """ Initializes the algorithm and its optimizer. """ + yield self._run_init('optimizer_init') + + def _post_process_transition_details(self, transition_details): + """ Performs some post-processing on the transition details. + Required by REINFORCE to compute average rewards + :param transition_details: A list of TransitionDetails named tuple. + Each transition details contains + 1) a `.models.self_play.transition.Transition` transition. + 2) the corresponding reward target to be used for the policy gradient update, + 3) the corresponding value target to be used for the critic update, + 4) a list of log importance sampling ratio for each output token or None + 5) the updated (current) log probs for each token in the model + :return: The updated transition_details + """ + # Storing all value_rewards in buffer + for transition_detail in transition_details: + self.past_rewards += [transition_detail.value_target] + + # Computing average reward over the buffer + if self.hparams['buffer_size'] <= 100: + buffer_size = int(self.hparams['buffer_size'] * self.hparams['nb_transitions_per_update']) + else: + buffer_size = int(self.hparams['buffer_size']) + self.past_rewards = self.past_rewards[-buffer_size:] + average_value_target = float(np.mean(self.past_rewards)) + + # Updating the transition details + new_transition_details = [] + for transition_detail in transition_details: + new_transition_details += \ + [TransitionDetails(transition=transition_detail.transition, + power_name=transition_detail.power_name, + draw_action=transition_detail.draw_action, + reward_target=transition_detail.reward_target, + value_target=average_value_target, + log_p_t=transition_detail.log_p_t, + log_probs=transition_detail.log_probs)] + return new_transition_details diff --git a/diplomacy_research/models/self_play/algorithms/reinforce/train.py b/diplomacy_research/models/self_play/algorithms/reinforce/train.py new file mode 100644 index 0000000..420a831 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/reinforce/train.py @@ -0,0 +1,84 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" REINFORCE Algorithm + - Trains a model with the REINFORCE algorithm +""" +import importlib +import logging +import os +from diplomacy_research.models.self_play.algorithms.reinforce import Algorithm, load_args +from diplomacy_research.models.training.reinforcement import ReinforcementTrainer +from diplomacy_research.utils.cluster import start_distributed_training +from diplomacy_research.utils.cluster_config.reinforcement import get_cluster_config +from diplomacy_research.utils.model import load_dynamically_from_model_id, find_model_type +from diplomacy_research.utils.model import parse_args_into_flags, run_app +from diplomacy_research.settings import ROOT_DIR + +# Constants +LOGGER = logging.getLogger('diplomacy_research.models.self_play.algorithms.reinforce.train') + +def main(_): + """ Trains the RL model """ + def start_rl_training(cluster_config, process_pool): + """ Callable fn to start training """ + ReinforcementTrainer(policy_constructor=PolicyModel, + value_constructor=None, + draw_constructor=DrawModel, + dataset_builder_constructor=BaseDatasetBuilder, + adapter_constructor=PolicyAdapter, + algorithm_constructor=Algorithm, + reward_fn=reward_fn, + flags=FLAGS, + cluster_config=cluster_config, + process_pool=process_pool).start() + + # Detecting if we need to start regular or distributed training + start_distributed_training(callable_fn=start_rl_training, + flags=FLAGS, + get_cluster_config_fn=get_cluster_config, + with_process_pool=True) + +if __name__ == '__main__': + + # Finding the root dir of the model type + base_dir, base_import_path = find_model_type() # pylint: disable=invalid-name + + # Loading model_constructor and args + PolicyModel, load_policy_args = load_dynamically_from_model_id(['PolicyModel', 'load_args'], # pylint: disable=invalid-name + arg_name='model_id', + base_dir=base_dir) + + # Detecting DrawModel, and load_args + DrawModel, load_draw_args = load_dynamically_from_model_id(['DrawModel', 'load_args'], # pylint: disable=invalid-name + arg_name='draw_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'draw'), + on_error='ignore') + + # REINFORCE does not use a value model + LOGGER.info('REINFORCE does not a use a parameterized value function. Ignoring "value_model_id".') + + # Loading args + ARGS = load_policy_args() \ + + (load_draw_args() if load_draw_args is not None else []) \ + + load_args() + FLAGS = parse_args_into_flags(ARGS) + + # Loading reward functions, policy adapter, and base dataset builder + PolicyAdapter = importlib.import_module('%s' % base_import_path).PolicyAdapter # pylint: disable=invalid-name + BaseDatasetBuilder = importlib.import_module('%s' % base_import_path).BaseDatasetBuilder # pylint: disable=invalid-name + reward_fn = getattr(importlib.import_module('diplomacy_research.models.self_play.reward_functions'), # pylint: disable=invalid-name + FLAGS.reward_fn)() + + # Running + run_app() diff --git a/diplomacy_research/models/self_play/algorithms/tests/algorithm_test_setup.py b/diplomacy_research/models/self_play/algorithms/tests/algorithm_test_setup.py new file mode 100644 index 0000000..d52868f --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/tests/algorithm_test_setup.py @@ -0,0 +1,250 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generic class to test an algorithm """ +import os +import gym +from tornado import gen +from tornado.ioloop import IOLoop +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.draw.v001_draw_relu import DrawModel, load_args as load_draw_args +from diplomacy_research.models.gym import AutoDraw, LimitNumberYears, RandomizePlayers +from diplomacy_research.models.self_play.controller import generate_trajectory +from diplomacy_research.models.self_play.reward_functions import DefaultRewardFunction, DEFAULT_PENALTY +from diplomacy_research.models.state_space import TOKENS_PER_ORDER +from diplomacy_research.models.value.v004_board_state_conv import ValueModel, load_args as load_value_args +from diplomacy_research.players import RuleBasedPlayer, ModelBasedPlayer +from diplomacy_research.players.rulesets import easy_ruleset +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import read_next_proto, write_proto_to_file + +# Constants +HOME_DIR = os.path.expanduser('~') +if HOME_DIR == '~': + raise RuntimeError('Cannot find home directory. Unable to save cache') + + +class AlgorithmSetup(): + """ Tests an algorithm """ + + def __init__(self, algorithm_ctor, algo_load_args, model_type): + """ Constructor + :param algorithm_ctor: The constructor class for the Algorithm + :param algo_args: The method load_args() for the algorithm + :param model_type: The model type ("order_based", "token_based") of the policy (for caching) + """ + self.saved_game_cache_path = None + self.model_type = model_type + self._algorithm_ctor = algorithm_ctor + self.get_algo_load_args = algo_load_args + self.adapter = None + self.algorithm = None + self.advantage = None + self.reward_fn = DefaultRewardFunction() + self.graph = None + + def create_algorithm(self, feedable_dataset, model, hparams): + """ Creates the algorithm object """ + self.algorithm = self._algorithm_ctor(feedable_dataset, model, hparams) + + @staticmethod + def parse_flags(args): + """ Parse flags without calling tf.app.run() """ + define = {'bool': lambda x: bool(x), # pylint: disable=unnecessary-lambda + 'int': lambda x: int(x), # pylint: disable=unnecessary-lambda + 'str': lambda x: str(x), # pylint: disable=unnecessary-lambda + 'float': lambda x: float(x), # pylint: disable=unnecessary-lambda + '---': lambda x: x} # pylint: disable=unnecessary-lambda + + # Keeping a dictionary of parse args to overwrite if provided multiple times + flags = {} + for arg in args: + arg_type, arg_name, arg_value, _ = arg + flags[arg_name] = define[arg_type](arg_value) + if arg_type == '---' and arg_name in flags: + del flags[arg_name] + return flags + + @staticmethod + def get_policy_model(): + """ Returns the PolicyModel """ + raise NotImplementedError() + + @staticmethod + def get_policy_builder(): + """ Returns the Policy's DatasetBuilder """ + raise NotImplementedError() + + @staticmethod + def get_policy_adapter(): + """ Returns the PolicyAdapter """ + raise NotImplementedError() + + @staticmethod + def get_policy_load_args(): + """ Returns the policy args """ + return [] + + @staticmethod + def get_test_load_args(): + """ Overrides common hparams to speed up tests. """ + return [('int', 'nb_graph_conv', 3, 'Number of Graph Conv Layer'), + ('int', 'word_emb_size', 64, 'Word embedding size.'), + ('int', 'order_emb_size', 64, 'Order embedding size.'), + ('int', 'power_emb_size', 64, 'Power embedding size.'), + ('int', 'season_emb_size', 10, 'Season embedding size.'), + ('int', 'board_emb_size', 40, 'Embedding size for the board state'), + ('int', 'gcn_size', 24, 'Size of graph convolution outputs.'), + ('int', 'lstm_size', 64, 'LSTM (Encoder and Decoder) size.'), + ('int', 'attn_size', 30, 'LSTM decoder attention size.'), + ('int', 'value_embedding_size', 64, 'Embedding size.'), + ('int', 'value_h1_size', 16, 'The size of the first hidden layer in the value calculation'), + ('int', 'value_h2_size', 16, 'The size of the second hidden layer in the value calculation'), + ('bool', 'use_v_dropout', True, 'Use variational dropout (same mask across all time steps)'), + ('bool', 'use_xla', False, 'Use XLA compilation.'), + ('str', 'mode', 'self-play', 'The RL training mode.')] + + def run_tests(self): + """ Run all tests """ + IOLoop.current().run_sync(self.run_tests_async) + + @gen.coroutine + def run_tests_async(self): + """ Run tests in an asynchronous IO Loop """ + from diplomacy_research.utils.tensorflow import tf + self.graph = tf.Graph() + with self.graph.as_default(): + yield self.build_algo_and_adapter() + saved_game_proto = yield self.get_saved_game_proto() + yield self.test_clear_buffers() + yield self.test_learn(saved_game_proto) + assert self.adapter.session.run(self.algorithm.version_step) == 0 + yield self.test_update() + yield self.test_init() + assert self.adapter.session.run(self.algorithm.version_step) == 1 + yield self.test_get_priorities(saved_game_proto) + + @gen.coroutine + def test_learn(self, saved_game_proto): + """ Tests the algorithm learn method """ + power_phases_ix = self.algorithm.get_power_phases_ix(saved_game_proto, 1) + yield self.algorithm.learn([saved_game_proto], [power_phases_ix], self.advantage) + + @gen.coroutine + def test_get_priorities(self, saved_game_proto): + """ Tests the algorithm get_priorities method """ + power_phases_ix = self.algorithm.get_power_phases_ix(saved_game_proto, 1) + yield self.algorithm.clear_buffers() + yield self.algorithm.learn([saved_game_proto], [power_phases_ix], self.advantage) + priorities = yield self.algorithm.get_priorities([saved_game_proto], self.advantage) + assert len(priorities) == len(self.algorithm.list_power_phases_per_game.get(saved_game_proto.id, [])) + + @gen.coroutine + def test_update(self): + """ Tests the algorithm update method """ + results = yield self.algorithm.update(memory_buffer=None) + for eval_tag in self.algorithm.get_evaluation_tags(): + assert eval_tag in results + assert results[eval_tag] + + @gen.coroutine + def test_init(self): + """ Tests the algorithm init method """ + yield self.algorithm.init() + + @gen.coroutine + def test_clear_buffers(self): + """ Tests the algorithm clear_buffers method """ + yield self.algorithm.clear_buffers() + + @gen.coroutine + def build_algo_and_adapter(self): + """ Builds adapter """ + from diplomacy_research.utils.tensorflow import tf + + policy_model_ctor = self.get_policy_model() + dataset_builder_ctor = self.get_policy_builder() + policy_adapter_ctor = self.get_policy_adapter() + extra_proto_fields = self._algorithm_ctor.get_proto_fields() + + hparams = self.parse_flags(self.get_policy_load_args() + + load_value_args() + + load_draw_args() + + self.get_algo_load_args() + + self.get_test_load_args()) + + # Generating model + dataset = QueueDataset(batch_size=32, + dataset_builder=dataset_builder_ctor(extra_proto_fields=extra_proto_fields)) + model = policy_model_ctor(dataset, hparams) + model = ValueModel(model, dataset, hparams) + model = DrawModel(model, dataset, hparams) + model.finalize_build() + self.create_algorithm(dataset, model, hparams) + self.adapter = policy_adapter_ctor(dataset, self.graph, tf.Session(graph=self.graph)) + self.advantage = self._algorithm_ctor.create_advantage_function(hparams, + gamma=0.99, + penalty_per_phase=DEFAULT_PENALTY) + + # Setting cache path + filename = '%s_savedgame.pbz' % self.model_type + self.saved_game_cache_path = os.path.join(HOME_DIR, '.cache', 'diplomacy', filename) + + @gen.coroutine + def get_saved_game_proto(self): + """ Tests the generate_saved_game_proto method """ + # Creating players + player = ModelBasedPlayer(self.adapter) + rule_player = RuleBasedPlayer(easy_ruleset) + players = [player, player, player, player, player, player, rule_player] + + def env_constructor(players): + """ Env constructor """ + env = gym.make('DiplomacyEnv-v0') + env = LimitNumberYears(env, 5) + env = RandomizePlayers(env, players) + env = AutoDraw(env) + return env + + # Generating game + saved_game_proto = None + if os.path.exists(self.saved_game_cache_path): + with open(self.saved_game_cache_path, 'rb') as file: + saved_game_proto = read_next_proto(SavedGameProto, file, compressed=True) + + if saved_game_proto is None: + saved_game_proto = yield generate_trajectory(players, self.reward_fn, self.advantage, env_constructor) + with open(self.saved_game_cache_path, 'wb') as file: + write_proto_to_file(file, saved_game_proto, compressed=True) + + # Validating game + assert saved_game_proto.id + assert len(saved_game_proto.phases) >= 10 + + # Validating policy details + for phase in saved_game_proto.phases: + for power_name in phase.policy: + nb_locs = len(phase.policy[power_name].locs) + assert (len(phase.policy[power_name].tokens) == nb_locs * TOKENS_PER_ORDER # Token-based + or len(phase.policy[power_name].tokens) == nb_locs) # Order-based + assert len(phase.policy[power_name].log_probs) == len(phase.policy[power_name].tokens) + assert phase.policy[power_name].draw_action in (True, False) + assert 0. <= phase.policy[power_name].draw_prob <= 1. + + # Validating rewards + assert saved_game_proto.reward_fn == DefaultRewardFunction().name + for power_name in saved_game_proto.assigned_powers: + assert len(saved_game_proto.rewards[power_name].value) == len(saved_game_proto.phases) - 1 + + # Returning saved game proto for other tests to use + return saved_game_proto diff --git a/diplomacy_research/models/self_play/algorithms/tests/test_a2c.py b/diplomacy_research/models/self_play/algorithms/tests/test_a2c.py new file mode 100644 index 0000000..202cf90 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/tests/test_a2c.py @@ -0,0 +1,67 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the A2C Algorithm """ +from diplomacy_research.models.policy import order_based +from diplomacy_research.models.policy import token_based +import diplomacy_research.models.policy.order_based.v002_markovian_film as order_based_model +import diplomacy_research.models.policy.token_based.v002_markovian_film as token_based_model +from diplomacy_research.models.self_play.algorithms.a2c.algorithm import A2CAlgorithm, load_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, model_type, model_family_path, model_version_path): + """ Constructor """ + AlgorithmSetup.__init__(self, A2CAlgorithm, load_args, model_type) + self._model_family_path = model_family_path + self._model_version_path = model_version_path + + def get_policy_model(self): + """ Returns the PolicyModel """ + return self._model_version_path.PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return self._model_family_path.BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return self._model_family_path.PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return self._model_version_path.load_args() + +# ----------- Launch Scripts -------------- +def launch_order_based(): + """ Launches tests for order based """ + test_object = BaseTestClass('order_based', order_based, order_based_model) + test_object.run_tests() + +def launch_token_based(): + """ Launches tests for token based """ + test_object = BaseTestClass('token_based', token_based, token_based_model) + test_object.run_tests() + +# ----------- Tests -------------- +def test_order_based(): + """ Runs the order_based test """ + run_in_separate_process(target=launch_order_based, timeout=240) + +def test_token_based(): + """ Runs the token_based test """ + run_in_separate_process(target=launch_token_based, timeout=240) diff --git a/diplomacy_research/models/self_play/algorithms/tests/test_ppo.py b/diplomacy_research/models/self_play/algorithms/tests/test_ppo.py new file mode 100644 index 0000000..12fcd98 --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/tests/test_ppo.py @@ -0,0 +1,67 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the PPO Algorithm """ +from diplomacy_research.models.policy import order_based +from diplomacy_research.models.policy import token_based +import diplomacy_research.models.policy.order_based.v002_markovian_film as order_based_model +import diplomacy_research.models.policy.token_based.v002_markovian_film as token_based_model +from diplomacy_research.models.self_play.algorithms.ppo.algorithm import PPOAlgorithm, load_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, model_type, model_family_path, model_version_path): + """ Constructor """ + AlgorithmSetup.__init__(self, PPOAlgorithm, load_args, model_type) + self._model_family_path = model_family_path + self._model_version_path = model_version_path + + def get_policy_model(self): + """ Returns the PolicyModel """ + return self._model_version_path.PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return self._model_family_path.BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return self._model_family_path.PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return self._model_version_path.load_args() + +# ----------- Launch Scripts -------------- +def launch_order_based(): + """ Launches tests for order based """ + test_object = BaseTestClass('order_based', order_based, order_based_model) + test_object.run_tests() + +def launch_token_based(): + """ Launches tests for token based """ + test_object = BaseTestClass('token_based', token_based, token_based_model) + test_object.run_tests() + +# ----------- Tests -------------- +def test_order_based(): + """ Runs the order_based test """ + run_in_separate_process(target=launch_order_based, timeout=240) + +def test_token_based(): + """ Runs the token_based test """ + run_in_separate_process(target=launch_token_based, timeout=240) diff --git a/diplomacy_research/models/self_play/algorithms/tests/test_reinforce.py b/diplomacy_research/models/self_play/algorithms/tests/test_reinforce.py new file mode 100644 index 0000000..4b4a55c --- /dev/null +++ b/diplomacy_research/models/self_play/algorithms/tests/test_reinforce.py @@ -0,0 +1,67 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the REINFORCE Algorithm """ +from diplomacy_research.models.policy import order_based +from diplomacy_research.models.policy import token_based +import diplomacy_research.models.policy.order_based.v002_markovian_film as order_based_model +import diplomacy_research.models.policy.token_based.v002_markovian_film as token_based_model +from diplomacy_research.models.self_play.algorithms.reinforce.algorithm import ReinforceAlgorithm, load_args +from diplomacy_research.models.self_play.algorithms.tests.algorithm_test_setup import AlgorithmSetup +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Testable Class -------------- +class BaseTestClass(AlgorithmSetup): + """ Tests the algorithm """ + def __init__(self, model_type, model_family_path, model_version_path): + """ Constructor """ + AlgorithmSetup.__init__(self, ReinforceAlgorithm, load_args, model_type) + self._model_family_path = model_family_path + self._model_version_path = model_version_path + + def get_policy_model(self): + """ Returns the PolicyModel """ + return self._model_version_path.PolicyModel + + def get_policy_builder(self): + """ Returns the Policy's BaseDatasetBuilder """ + return self._model_family_path.BaseDatasetBuilder + + def get_policy_adapter(self): + """ Returns the PolicyAdapter """ + return self._model_family_path.PolicyAdapter + + def get_policy_load_args(self): + """ Returns the policy args """ + return self._model_version_path.load_args() + +# ----------- Launch Scripts -------------- +def launch_order_based(): + """ Launches tests for order based """ + test_object = BaseTestClass('order_based', order_based, order_based_model) + test_object.run_tests() + +def launch_token_based(): + """ Launches tests for token based """ + test_object = BaseTestClass('token_based', token_based, token_based_model) + test_object.run_tests() + +# ----------- Tests -------------- +def test_order_based(): + """ Runs the order_based test """ + run_in_separate_process(target=launch_order_based, timeout=240) + +def test_token_based(): + """ Runs the token_based test """ + run_in_separate_process(target=launch_token_based, timeout=240) diff --git a/diplomacy_research/models/self_play/controller.py b/diplomacy_research/models/self_play/controller.py new file mode 100644 index 0000000..bca8ed4 --- /dev/null +++ b/diplomacy_research/models/self_play/controller.py @@ -0,0 +1,405 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Controller + This module is responsible for generating self-play trajectories (and returning saved games) +""" +from collections import OrderedDict +from random import shuffle +import time +from diplomacy import Map +import gym +from tornado import gen +from diplomacy_research.models.gym.environment import DiplomacyEnv, DoneReason +from diplomacy_research.models.gym.wrappers import SaveGame, LimitNumberYears, SetInitialState, AssignPlayers, \ + RandomizePlayers, AutoDraw, LoopDetection, SetPlayerSeed +from diplomacy_research.models.state_space import extract_state_proto, extract_phase_history_proto, \ + extract_possible_orders_proto, get_map_powers, proto_to_board_state, proto_to_prev_orders_state, NB_POWERS, \ + NB_PREV_ORDERS_HISTORY +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto, State as StateProto +from diplomacy_research.utils.proto import dict_to_proto, proto_to_bytes, proto_to_zlib, bytes_to_proto + + +def default_env_constructor(players, hparams, power_assignments, set_player_seed, initial_state_bytes): + """ Default gym environment constructor + :param players: A list of instantiated players + :param hparams: A dictionary of hyper parameters with their values + :param power_assignments: Optional. The power name we want to play as. (e.g. 'FRANCE') or a list of powers. + :param set_player_seed: Boolean that indicates that we want to set the player seed on reset(). + :param initial_state_bytes: A `game.State` proto (in bytes format) representing the initial state of the game. + :rtype: diplomacy_research.models.gym.wrappers.DiplomacyWrapper + """ + # The keys should be present in hparams if it's not None + max_nb_years = hparams['max_nb_years'] if hparams else 35 + auto_draw = hparams['auto_draw'] if hparams else False + power = hparams['power'] if hparams else '' + nb_thrashing_states = hparams['nb_thrashing_states'] if hparams else 0 + + env = gym.make('DiplomacyEnv-v0') + env = LimitNumberYears(env, max_nb_years) + + # Loop Detection (Thrashing) + if nb_thrashing_states: + env = LoopDetection(env, threshold=nb_thrashing_states) + + # Auto-Drawing + if auto_draw: + env = AutoDraw(env) + + # Setting initial state + if initial_state_bytes is not None: + env = SetInitialState(env, bytes_to_proto(initial_state_bytes, StateProto)) + + # 1) If power_assignments is a list, using that to assign powers + if isinstance(power_assignments, list): + env = AssignPlayers(env, players, power_assignments) + + # 2a) If power_assignments is a string, using that as our power, and randomly assigning the other powers + # 2b) Using hparams['power'] if it's set. + elif isinstance(power_assignments, str) or power: + our_power = power_assignments if isinstance(power_assignments, str) else power + other_powers = [power_name for power_name in env.get_all_powers_name() if power_name != our_power] + shuffle(other_powers) + env = AssignPlayers(env, players, [our_power] + other_powers) + + # 3) Randomly shuffle the powers + else: + env = RandomizePlayers(env, players) + + # Setting player seed + if set_player_seed: + env = SetPlayerSeed(env, players) + + # Ability to save game / retrieve saved game + env = SaveGame(env) + return env + +def get_saved_game_proto(env, players, stored_board_state, stored_prev_orders_state, stored_possible_orders, + power_variables, start_phase_ix, reward_fn, advantage_fn, is_partial_game): + """ Extracts the saved game proto from the environment to send back to the learner + :param env: The gym environment (needs to implement a SaveGame wrapper) + :param players: A list of instantiated players + :param stored_board_state: A dictionary with phase_name as key and board_state as value + :param stored_prev_orders_state: A dictionary with phase_name as key and prev_orders_state as value + :param stored_possible_orders: A dictionary with phase_name as key and possible orders as value + :param power_variables: A dict containing orders, policy details, values, rewards, returns for each power + :param start_phase_ix: For partial game, the index of the phase from which to start learning + :param reward_fn: The reward function to use to calculate rewards + :param advantage_fn: An instance of `.models.self_play.advantages` + :param is_partial_game: Boolean that indicates that we are processing an incomplete game + :return: The saved game in proto format + """ + # pylint: disable=too-many-arguments + powers = sorted([power_name for power_name in get_map_powers(env.game.map)]) + assigned_powers = env.get_all_powers_name() + + # Computing returns + for power_name in powers: + rewards = power_variables[power_name]['rewards'] + state_values = power_variables[power_name]['state_values'] + last_state_value = power_variables[power_name]['last_state_value'] + power_variables[power_name]['returns'] = advantage_fn.get_returns(rewards, state_values, last_state_value) + + # Retrieving saved game + saved_game = env.get_saved_game() + + # Restoring stored variables on the saved game before converting to proto + for phase_ix, phase in enumerate(saved_game['phases']): + + # Last phase - Only storing state value + if phase_ix == len(saved_game['phases']) - 1: + state_values = {power_name: float(power_variables[power_name]['state_values'][-1]) for power_name in powers} + phase['state_value'] = state_values + break + + # Setting shared fields (board_state, prev_orders_state, possible_orders) + phase['state']['board_state'] = stored_board_state[phase['name']] + if phase['name'][-1] == 'M': + phase['prev_orders_state'] = stored_prev_orders_state[phase['name']] + phase['possible_orders'] = {loc: stored_possible_orders[phase['name']][loc].value + for loc in stored_possible_orders[phase['name']]} + + # Setting orders, policy_details, state_values + phase['orders'] = {power_name: power_variables[power_name]['orders'][phase_ix] for power_name in powers} + phase['policy'] = {power_name: power_variables[power_name]['policy_details'][phase_ix] for power_name in powers} + phase['state_value'] = {power_name: float(power_variables[power_name]['state_values'][phase_ix]) + for power_name in powers} + + # Adding power assignments, done reason, and kwargs + done_reason = env.done_reason.value if env.done_reason is not None else '' + saved_game['done_reason'] = done_reason + saved_game['assigned_powers'] = assigned_powers + saved_game['players'] = [player.name for player in players] + saved_game['kwargs'] = {power_name: players[assigned_powers.index(power_name)].kwargs for power_name in powers} + saved_game['is_partial_game'] = is_partial_game + saved_game['start_phase_ix'] = start_phase_ix if is_partial_game else 0 + saved_game['reward_fn'] = reward_fn.name + saved_game['rewards'] = {power_name: power_variables[power_name]['rewards'] for power_name in powers} + saved_game['returns'] = {power_name: power_variables[power_name]['returns'] for power_name in powers} + + # Returning + return dict_to_proto(saved_game, SavedGameProto) + +@gen.coroutine +def get_step_args(player, state_proto, power_name, phase_history_proto, possible_orders_proto): + """ Gets the arguments required to step through the environment. + :param player: An instantiated player + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :return: A tuple with + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + :type player: diplomacy_research.players.player.Player + """ + if not state_proto.units[power_name].value: + return [], None, 0. + + return (yield player.get_orders_details_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + with_state_value=True)) + +@gen.coroutine +def get_state_value(player, state_proto, power_name, phase_history_proto, possible_orders_proto): + """ Gets the value of the state for the given power (e.g. the last state value) + :param player: An instantiated player + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :return: The state value for the given state + :type player: diplomacy_research.players.player.Player + """ + if not state_proto.units[power_name].value: + return 0. + + return (yield player.get_state_value_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto)) + +@gen.coroutine +def generate_trajectory(players, reward_fn, advantage_fn, env_constructor=None, hparams=None, power_assignments=None, + set_player_seed=None, initial_state_bytes=None, update_interval=0, update_queue=None, + output_format='proto'): + """ Generates a single trajectory (Saved Gamed Proto) for RL (self-play) with the power assigments + :param players: A list of instantiated players + :param reward_fn: The reward function to use to calculate rewards + :param advantage_fn: An instance of `.models.self_play.advantages` + :param env_constructor: A callable to get the OpenAI gym environment (args: players) + :param hparams: A dictionary of hyper parameters with their values + :param power_assignments: Optional. The power name we want to play as. (e.g. 'FRANCE') or a list of powers. + :param set_player_seed: Boolean that indicates that we want to set the player seed on reset(). + :param initial_state_bytes: A `game.State` proto (in bytes format) representing the initial state of the game. + :param update_interval: Optional. If set, a partial saved game is put in the update_queue this every seconds. + :param update_queue: Optional. If update interval is set, partial games will be put in this queue + :param output_format: The output format. One of 'proto', 'bytes', 'zlib' + :return: A SavedGameProto representing the game played (with policy details and power assignments) + Depending on format, the output might be converted to a byte array, or a compressed byte array. + :type players: List[diplomacy_research.players.player.Player] + :type reward_fn: diplomacy_research.models.self_play.reward_functions.AbstractRewardFunction + :type advantage_fn: diplomacy_research.models.self_play.advantages.base_advantage.BaseAdvantage + :type update_queue: multiprocessing.Queue + """ + # pylint: disable=too-many-arguments + assert output_format in ['proto', 'bytes', 'zlib'], 'Format should be "proto", "bytes", "zlib"' + assert len(players) == NB_POWERS + + # Making sure we use the SavedGame wrapper to record the game + if env_constructor: + env = env_constructor(players) + else: + env = default_env_constructor(players, hparams, power_assignments, set_player_seed, initial_state_bytes) + wrapped_env = env + while not isinstance(wrapped_env, DiplomacyEnv): + if isinstance(wrapped_env, SaveGame): + break + wrapped_env = wrapped_env.env + else: + env = SaveGame(env) + + # Detecting if we have a Auto-Draw wrapper + has_auto_draw = False + wrapped_env = env + while not isinstance(wrapped_env, DiplomacyEnv): + if isinstance(wrapped_env, AutoDraw): + has_auto_draw = True + break + wrapped_env = wrapped_env.env + + # Resetting env + env.reset() + + # Timing vars for partial updates + time_last_update = time.time() + year_last_update = 0 + start_phase_ix = 0 + current_phase_ix = 0 + nb_transitions = 0 + + # Cache Variables + powers = sorted([power_name for power_name in get_map_powers(env.game.map)]) + assigned_powers = env.get_all_powers_name() + stored_board_state = OrderedDict() # {phase_name: board_state} + stored_prev_orders_state = OrderedDict() # {phase_name: prev_orders_state} + stored_possible_orders = OrderedDict() # {phase_name: possible_orders} + + power_variables = {power_name: {'orders': [], + 'policy_details': [], + 'state_values': [], + 'rewards': [], + 'returns': [], + 'last_state_value': 0.} for power_name in powers} + + new_state_proto = None + phase_history_proto = [] + map_object = Map(name=env.game.map.name) + + # Generating + while not env.is_done: + state_proto = new_state_proto if new_state_proto is not None else extract_state_proto(env.game) + possible_orders_proto = extract_possible_orders_proto(env.game) + + # Computing board_state + board_state = proto_to_board_state(state_proto, map_object).flatten().tolist() + state_proto.board_state.extend(board_state) + + # Storing possible orders for this phase + current_phase = env.game.get_current_phase() + stored_board_state[current_phase] = board_state + stored_possible_orders[current_phase] = possible_orders_proto + + # Getting orders, policy details, and state value + tasks = [(player, + state_proto, + pow_name, + phase_history_proto[-NB_PREV_ORDERS_HISTORY:], + possible_orders_proto) for player, pow_name in zip(env.players, assigned_powers)] + step_args = yield [get_step_args(*args) for args in tasks] + + # Stepping through env, storing power variables + for power_name, (orders, policy_details, state_value) in zip(assigned_powers, step_args): + if orders: + env.step((power_name, orders)) + nb_transitions += 1 + if has_auto_draw and policy_details is not None: + env.set_draw_prob(power_name, policy_details['draw_prob']) + + # Processing + env.process() + current_phase_ix += 1 + + # Retrieving draw action and saving power variables + for power_name, (orders, policy_details, state_value) in zip(assigned_powers, step_args): + if has_auto_draw and policy_details is not None: + policy_details['draw_action'] = env.get_draw_actions()[power_name] + power_variables[power_name]['orders'] += [orders] + power_variables[power_name]['policy_details'] += [policy_details] + power_variables[power_name]['state_values'] += [state_value] + + # Getting new state + new_state_proto = extract_state_proto(env.game) + + # Storing reward for this transition + done_reason = DoneReason(env.done_reason) if env.done_reason else None + for power_name in powers: + power_variables[power_name]['rewards'] += [reward_fn.get_reward(prev_state_proto=state_proto, + state_proto=new_state_proto, + power_name=power_name, + is_terminal_state=done_reason is not None, + done_reason=done_reason)] + + # Computing prev_orders_state for the previous state + last_phase_proto = extract_phase_history_proto(env.game, nb_previous_phases=1)[-1] + if last_phase_proto.name[-1] == 'M': + prev_orders_state = proto_to_prev_orders_state(last_phase_proto, map_object).flatten().tolist() + stored_prev_orders_state[last_phase_proto.name] = prev_orders_state + last_phase_proto.prev_orders_state.extend(prev_orders_state) + phase_history_proto += [last_phase_proto] + + # Sending partial game if: + # 1) We have update_interval > 0 with an update queue, and + # 2a) The game is completed, or 2b) the update time has elapsted and at least 5 years as passed + has_update_interval = update_interval > 0 and update_queue is not None + game_is_completed = env.is_done + min_time_has_passed = time.time() - time_last_update > update_interval + current_year = 9999 if env.game.get_current_phase() == 'COMPLETED' else int(env.game.get_current_phase()[1:5]) + min_years_have_passed = current_year - year_last_update >= 5 + + if (has_update_interval + and (game_is_completed + or (min_time_has_passed and min_years_have_passed))): + + # Game is completed - last state value is 0 + if game_is_completed: + for power_name in powers: + power_variables[power_name]['last_state_value'] = 0. + + # Otherwise - Querying the model for the value of the last state + else: + tasks = [(player, + new_state_proto, + pow_name, + phase_history_proto[-NB_PREV_ORDERS_HISTORY:], + possible_orders_proto) for player, pow_name in zip(env.players, assigned_powers)] + last_state_values = yield [get_state_value(*args) for args in tasks] + + for power_name, last_state_value in zip(assigned_powers, last_state_values): + power_variables[power_name]['last_state_value'] = last_state_value + + # Getting partial game and sending it on the update_queue + saved_game_proto = get_saved_game_proto(env=env, + players=players, + stored_board_state=stored_board_state, + stored_prev_orders_state=stored_prev_orders_state, + stored_possible_orders=stored_possible_orders, + power_variables=power_variables, + start_phase_ix=start_phase_ix, + reward_fn=reward_fn, + advantage_fn=advantage_fn, + is_partial_game=True) + update_queue.put_nowait((False, nb_transitions, proto_to_bytes(saved_game_proto))) + + # Updating stats + start_phase_ix = current_phase_ix + nb_transitions = 0 + if not env.is_done: + year_last_update = int(env.game.get_current_phase()[1:5]) + + # Since the environment is done (Completed game) - We can leave the last_state_value at 0. + for power_name in powers: + power_variables[power_name]['last_state_value'] = 0. + + # Getting completed game + saved_game_proto = get_saved_game_proto(env=env, + players=players, + stored_board_state=stored_board_state, + stored_prev_orders_state=stored_prev_orders_state, + stored_possible_orders=stored_possible_orders, + power_variables=power_variables, + start_phase_ix=0, + reward_fn=reward_fn, + advantage_fn=advantage_fn, + is_partial_game=False) + + # Converting to correct format + output = {'proto': lambda proto: proto, + 'zlib': proto_to_zlib, + 'bytes': proto_to_bytes}[output_format](saved_game_proto) + + # Returning + return output diff --git a/diplomacy_research/models/self_play/reward_functions.py b/diplomacy_research/models/self_play/reward_functions.py new file mode 100644 index 0000000..61a57c3 --- /dev/null +++ b/diplomacy_research/models/self_play/reward_functions.py @@ -0,0 +1,591 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reward function. + - Collection of reward functions for the gym environment. +""" +from abc import ABCMeta, abstractmethod +import logging +from diplomacy import Map +from diplomacy_research.models.gym.environment import DoneReason +from diplomacy_research.models.state_space import ALL_POWERS + +# Constants +LOGGER = logging.getLogger(__name__) + +class AbstractRewardFunction(metaclass=ABCMeta): + """ Abstract class representing a reward function """ + + @property + @abstractmethod + def name(self): + """ Returns a unique name for the reward function """ + raise NotImplementedError() + + @abstractmethod + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + raise NotImplementedError() + + def get_episode_rewards(self, saved_game_proto, power_name): + """ Compute the list of all rewards for a saved game. + :param saved_game_proto: A `.proto.SavedGame` representation + :param power_name: The name of the power for which we want to compute rewards + :return: A list of rewards (one for each transition in the saved game) + """ + # Restoring cached rewards + if saved_game_proto.reward_fn == self.name and saved_game_proto.rewards[power_name].value: + return list(saved_game_proto.rewards[power_name].value) + + # Otherwise, computing them + episode_rewards = [] + done_reason = DoneReason(saved_game_proto.done_reason) if saved_game_proto.done_reason != '' else None + + # Making sure we have at least 2 phases (1 transition) + nb_phases = len(saved_game_proto.phases) + if nb_phases < 2: + return episode_rewards + + # Computing the reward of each phase (transition) + for phase_ix in range(nb_phases - 1): + current_state = saved_game_proto.phases[phase_ix].state + next_state = saved_game_proto.phases[phase_ix + 1].state + is_terminal = phase_ix == nb_phases - 2 + if is_terminal: + episode_rewards += [self.get_reward(current_state, + next_state, + power_name, + is_terminal_state=True, + done_reason=done_reason)] + else: + episode_rewards += [self.get_reward(current_state, + next_state, + power_name, + is_terminal_state=False, + done_reason=None)] + return episode_rewards + +class NbCentersReward(AbstractRewardFunction): + """ Reward function: greedy supply center. + + This reward function attempts to maximize the number of supply centers in control of a power. + The reward is the number of supply centers in control by the player at the end of the game. + The reward is only given at a terminal state. + """ + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'nb_centers_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + if not is_terminal_state: + return 0. + if done_reason == DoneReason.THRASHED: + return 0. + return len(state_proto.centers[power_name].value) + +class NormNbCentersReward(AbstractRewardFunction): + """ Reward function: greedy supply center. + + This reward function attempts to maximize the number of supply centers in control of a power. + The reward is the number of supply centers in control by the player at the end of the game, divided + by the number of supply centers required to win (to normalize the reward between 0. and 1.). + The reward is only given at a terminal state. + """ + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'norm_nb_centers_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + if not is_terminal_state: + return 0. + if done_reason == DoneReason.THRASHED: + return 0. + + map_object = Map(state_proto.map) + nb_centers_req_for_win = len(map_object.scs) // 2 + 1. + return min(1., max(0., len(state_proto.centers[power_name].value) / nb_centers_req_for_win)) + +class IntNormNbCentersReward(AbstractRewardFunction): + """ Reward function: greedy supply center. + + This reward function attempts to maximize the number of supply centers in control of a power. + The reward is the gain/loss of supply centers between the previous and current phase divided by + the number of supply centers required to win (to normalize the reward between 0. and 1.). + The reward is given at every phase (i.e. it is an intermediary reward). + """ + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'int_norm_nb_centers_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers or power_name not in prev_state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + + map_object = Map(state_proto.map) + nb_centers_req_for_win = len(map_object.scs) // 2 + 1. + current_centers = set(state_proto.centers[power_name].value) + prev_centers = set(prev_state_proto.centers[power_name].value) + sc_diff = len(current_centers) - len(prev_centers) + + if done_reason == DoneReason.THRASHED and current_centers: + return -1. + + return sc_diff / nb_centers_req_for_win + +class CustomIntNbCentersReward(AbstractRewardFunction): + """ Reward function: greedy supply center. + + This reward function attempts to maximize the number of supply centers in control of a power. + The reward is the gain/loss of supply centers between the previous and current phase (+1 / -1) + Gaining or losing a home multiplies by 2x the gains/losses. + The reward is given at every phase (i.e. it is an intermediary reward). + """ + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'custom_int_nb_centers_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers or power_name not in prev_state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + + map_object = Map(state_proto.map) + nb_centers_req_for_win = len(map_object.scs) // 2 + 1. + + homes = map_object.homes[power_name] + current_centers = set(state_proto.centers[power_name].value) + prev_centers = set(prev_state_proto.centers[power_name].value) + gained_centers = current_centers - prev_centers + lost_centers = prev_centers - current_centers + + if done_reason == DoneReason.THRASHED and current_centers: + return -1. * nb_centers_req_for_win + + # Computing reward + reward = 0. + for center in gained_centers: + reward += 2. if center in homes else 1. + for center in lost_centers: + reward -= 2. if center in homes else 1. + return reward + +class CustomIntUnitReward(AbstractRewardFunction): + """ Reward function: greedy supply center. + + This reward function attempts to maximize the number of supply centers in control of a power. + The reward is the gain/loss of supply centers between the previous and current phase (+1 / -1) + The reward is given as soon as a SC is touched (rather than just during the Adjustment phase) + Homes are also +1/-1. + + The reward is given at every phase (i.e. it is an intermediary reward). + """ + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'custom_int_unit_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers or power_name not in prev_state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + + map_object = Map(state_proto.map) + nb_centers_req_for_win = len(map_object.scs) // 2 + 1. + current_centers = set(state_proto.centers[power_name].value) + prev_centers = set(prev_state_proto.centers[power_name].value) + all_scs = map_object.scs + + if done_reason == DoneReason.THRASHED and current_centers: + return -1. * nb_centers_req_for_win + + # Adjusting supply centers for the current phase + # Dislodged units don't count for adjustment + for unit_power in state_proto.units: + if unit_power == power_name: + for unit in state_proto.units[unit_power].value: + if '*' in unit: + continue + unit_loc = unit[2:5] + if unit_loc in all_scs and unit_loc not in current_centers: + current_centers.add(unit_loc) + else: + for unit in state_proto.units[unit_power].value: + if '*' in unit: + continue + unit_loc = unit[2:5] + if unit_loc in all_scs and unit_loc in current_centers: + current_centers.remove(unit_loc) + + # Adjusting supply centers for the previous phase + # Dislodged units don't count for adjustment + for unit_power in prev_state_proto.units: + if unit_power == power_name: + for unit in prev_state_proto.units[unit_power].value: + if '*' in unit: + continue + unit_loc = unit[2:5] + if unit_loc in all_scs and unit_loc not in prev_centers: + prev_centers.add(unit_loc) + else: + for unit in prev_state_proto.units[unit_power].value: + if '*' in unit: + continue + unit_loc = unit[2:5] + if unit_loc in all_scs and unit_loc in prev_centers: + prev_centers.remove(unit_loc) + + # Computing difference + gained_centers = current_centers - prev_centers + lost_centers = prev_centers - current_centers + + # Computing reward + return float(len(gained_centers) - len(lost_centers)) + +class PlusOneMinusOneReward(AbstractRewardFunction): + """ Reward function: Standard win/lose. + + This reward function rewards winning/drawing (1), and gives -1 for losing. + All non-terminal states receive 0. + """ + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'plus_one_minus_one_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + if not is_terminal_state: + return 0. + if done_reason == DoneReason.THRASHED: + return -1. + return -1. if not state_proto.centers[power_name].value else 1. + +class DrawSizeReward(AbstractRewardFunction): + """ Draw Size scoring system. Divides pot size by number of survivors. + + This reward function gives a return of (pot_size / nb_survivors) at the terminal state (0 if eliminated) + All non-terminal states receive 0. + """ + def __init__(self, pot_size=34): + """ Constructor + :param pot_size: The number of points to split across survivors (default to 34, which is the nb of centers) + """ + assert pot_size > 0, 'The size of the pot must be positive.' + self.pot_size = pot_size + + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'draw_size_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + if not is_terminal_state: + return 0. + if done_reason == DoneReason.THRASHED: + return 0. + + map_object = Map(state_proto.map) + nb_centers_req_for_win = len(map_object.scs) // 2 + 1. + victors = [power for power in state_proto.centers + if len(state_proto.centers[power].value) >= nb_centers_req_for_win] + survivors = [power for power in state_proto.centers if state_proto.centers[power].value] + + # if there is a victor, winner takes all + # else survivors get points uniformly + if victors: + split_factor = 1. if power_name in victors else 0. + else: + split_factor = 1. / len(survivors) if power_name in survivors else 0. + return self.pot_size * split_factor + +class ProportionalReward(AbstractRewardFunction): + """ Proportional scoring system. + For win - The winner takes all, the other parties get nothing + For draw - The pot size is divided by the number of nb of sc^i / sum of nb of sc^i. + All non-terminal states receive 0. + """ + def __init__(self, pot_size=34, exponent=1): + """ Constructor + :param pot_size: The number of points to split across survivors (default to 34, which is the nb of centers) + :param exponent: The exponent to use in the draw calculation. + """ + assert pot_size > 0, 'The size of the pot must be positive.' + self.pot_size = pot_size + self.i = exponent + + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'proportional_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + if not is_terminal_state: + return 0. + if done_reason == DoneReason.THRASHED: + return 0. + + map_object = Map(state_proto.map) + nb_centers_req_for_win = len(map_object.scs) // 2 + 1. + victors = [power for power in state_proto.centers + if len(state_proto.centers[power].value) >= nb_centers_req_for_win] + + # if there is a victor, winner takes all + # else survivors get points according to nb_sc^i / sum of nb_sc^i + if victors: + split_factor = 1. if power_name in victors else 0. + else: + denom = {power: len(state_proto.centers[power].value) ** self.i for power in state_proto.centers} + split_factor = denom[power_name] / float(sum(denom.values())) + return self.pot_size * split_factor + +class SumOfSquares(ProportionalReward): + """ Sum of Squares scoring system. + For win - The winner takes all, the other parties get nothing + For draw - The pot size is divided by the number of nb of sc^2 / sum of nb of sc^2. + All non-terminal states receive 0. + """ + def __init__(self, pot_size=34): + """ Constructor + :param pot_size: The number of points to split across survivors (default to 34, which is the nb of centers) + """ + super(SumOfSquares, self).__init__(pot_size=pot_size, exponent=2) + + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'sum_of_squares_reward' + +class SurvivorWinReward(AbstractRewardFunction): + """ If win: + nb excess SC = nb of centers of winner - nb of centers required to win (e.g. 20 - 18) + nb controlled SC = nb of centers owned by all powers - nb excess SC + + Reward for winner = nb of centers required to win / nb controlled SC * pot size + Reward for survivors = nb of centers / nb controlled SC * pot size + + e.g. 20, 6, 4, 2, 1, 0, 0 + nb excess SC = 20 - 18 = 2 + nb controlled SC = 20 + 6 + 4 + 2 + 1 - 2 = 31 + Winner: 18/31 * pot + Others: 6/31 * pot, 4/31 * pot, 2/31 * pot, 1/31 * pot, 0, 0 + + If draw: + Pot is split equally among survivors (independently of nb of SC) + """ + def __init__(self, pot_size=34): + """ Constructor + :param pot_size: The number of points to split across survivors (default to 34, which is the nb of centers) + """ + assert pot_size > 0, 'The size of the pot must be positive.' + self.pot_size = pot_size + + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'survivor_win_reward' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + if power_name not in state_proto.centers: + if power_name not in ALL_POWERS: + LOGGER.error('Unknown power %s. Expected powers are: %s', power_name, ALL_POWERS) + return 0. + if not is_terminal_state: + return 0. + if done_reason == DoneReason.THRASHED: + return 0. + + map_object = Map(state_proto.map) + nb_centers_req_for_win = len(map_object.scs) // 2 + 1. + victors = [power for power in state_proto.centers + if len(state_proto.centers[power].value) >= nb_centers_req_for_win] + + if victors: + nb_scs = {power: len(state_proto.centers[power].value) for power in state_proto.centers} + nb_excess_sc = nb_scs[victors[0]] - nb_centers_req_for_win + nb_controlled_sc = sum(nb_scs.values()) - nb_excess_sc + if power_name in victors: + split_factor = nb_centers_req_for_win / nb_controlled_sc + else: + split_factor = nb_scs[power_name] / nb_controlled_sc + else: + survivors = [power for power in state_proto.centers if state_proto.centers[power].value] + split_factor = 1. / len(survivors) if power_name in survivors else 0. + return self.pot_size * split_factor + +class MixProportionalCustomIntUnitReward(AbstractRewardFunction): + """ 50% of ProportionalReward + 50% of CustomIntUnitReward + """ + def __init__(self): + """ Constructor """ + self.proportional = ProportionalReward() + self.custom_int_unit = CustomIntUnitReward() + + @property + def name(self): + """ Returns a unique name for the reward function """ + return 'mix_proportional_custom_int_unit' + + def get_reward(self, prev_state_proto, state_proto, power_name, is_terminal_state, done_reason): + """ Computes the reward for a given power + :param prev_state_proto: The `.proto.State` representation of the last state of the game (before .process) + :param state_proto: The `.proto.State` representation of the state of the game (after .process) + :param power_name: The name of the power for which to calculate the reward (e.g. 'FRANCE'). + :param is_terminal_state: Boolean flag to indicate we are at a terminal state. + :param done_reason: An instance of DoneReason indicating why the terminal state was reached. + :return: The current reward (float) for power_name. + :type done_reason: diplomacy_research.models.gym.environment.DoneReason | None + """ + assert done_reason is None or isinstance(done_reason, DoneReason), 'done_reason must be a DoneReason object.' + return 0.5 * self.proportional.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state, + done_reason) \ + + 0.5 * self.custom_int_unit.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state, + done_reason) + +# --- Defaults --- +DEFAULT_PENALTY = 0. +DEFAULT_GAMMA = 0.99 + +class DefaultRewardFunction(MixProportionalCustomIntUnitReward): + """ Default reward function class """ diff --git a/diplomacy_research/models/self_play/tests/__init__.py b/diplomacy_research/models/self_play/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/self_play/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/self_play/tests/test_controller.py b/diplomacy_research/models/self_play/tests/test_controller.py new file mode 100644 index 0000000..07daad0 --- /dev/null +++ b/diplomacy_research/models/self_play/tests/test_controller.py @@ -0,0 +1,126 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generic class to test the controller """ +import gym +from tornado import gen +from tornado.ioloop import IOLoop +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.draw.v001_draw_relu import DrawModel, load_args as load_draw_args +from diplomacy_research.models.gym import AutoDraw, LimitNumberYears, RandomizePlayers +from diplomacy_research.models.policy.order_based import PolicyAdapter, BaseDatasetBuilder +from diplomacy_research.models.policy.order_based.v012_film_diff_w_board_align_prev_ord import PolicyModel, load_args +from diplomacy_research.models.self_play.advantages.monte_carlo import MonteCarlo +from diplomacy_research.models.self_play.controller import generate_trajectory +from diplomacy_research.models.self_play.reward_functions import DefaultRewardFunction +from diplomacy_research.models.state_space import TOKENS_PER_ORDER, NB_POWERS +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args as load_value_args +from diplomacy_research.players import RuleBasedPlayer, ModelBasedPlayer +from diplomacy_research.players.rulesets import easy_ruleset +from diplomacy_research.utils.process import run_in_separate_process + +class ControllerSetup(): + """ Tests the controller """ + + @staticmethod + def parse_flags(args): + """ Parse flags without calling tf.app.run() """ + define = {'bool': lambda x: bool(x), # pylint: disable=unnecessary-lambda + 'int': lambda x: int(x), # pylint: disable=unnecessary-lambda + 'str': lambda x: str(x), # pylint: disable=unnecessary-lambda + 'float': lambda x: float(x), # pylint: disable=unnecessary-lambda + '---': lambda x: x} # pylint: disable=unnecessary-lambda + + # Keeping a dictionary of parse args to overwrite if provided multiple times + flags = {} + for arg in args: + arg_type, arg_name, arg_value, _ = arg + flags[arg_name] = define[arg_type](arg_value) + if arg_type == '---' and arg_name in flags: + del flags[arg_name] + return flags + + def run_tests(self): + """ Run all tests """ + IOLoop.current().run_sync(self.run_tests_async) + + @gen.coroutine + def run_tests_async(self): + """ Run tests in an asynchronous IO Loop """ + yield self.test_generate_saved_game_proto() + + @gen.coroutine + def test_generate_saved_game_proto(self): + """ Tests the generate_saved_game_proto method """ + from diplomacy_research.utils.tensorflow import tf + hparams = self.parse_flags(load_args() + load_value_args() + load_draw_args()) + + # Generating model + graph = tf.Graph() + with graph.as_default(): + dataset = QueueDataset(batch_size=32, dataset_builder=BaseDatasetBuilder()) + model = PolicyModel(dataset, hparams) + model = ValueModel(model, dataset, hparams) + model = DrawModel(model, dataset, hparams) + model.finalize_build() + adapter = PolicyAdapter(dataset, graph, tf.Session(graph=graph)) + advantage_fn = MonteCarlo(gamma=0.99) + reward_fn = DefaultRewardFunction() + + # Creating players + player = ModelBasedPlayer(adapter) + rule_player = RuleBasedPlayer(easy_ruleset) + players = [player, player, player, player, player, player, rule_player] + + def env_constructor(players): + """ Env constructor """ + env = gym.make('DiplomacyEnv-v0') + env = LimitNumberYears(env, 5) + env = RandomizePlayers(env, players) + env = AutoDraw(env) + return env + + # Generating game + saved_game_proto = yield generate_trajectory(players, reward_fn, advantage_fn, env_constructor) + + # Validating game + assert saved_game_proto.id + assert len(saved_game_proto.phases) >= 10 + + # Validating policy details + for phase in saved_game_proto.phases: + for power_name in phase.policy: + nb_locs = len(phase.policy[power_name].locs) + assert (len(phase.policy[power_name].tokens) == nb_locs * TOKENS_PER_ORDER # Token-based + or len(phase.policy[power_name].tokens) == nb_locs) # Order-based + assert len(phase.policy[power_name].log_probs) == len(phase.policy[power_name].tokens) + assert phase.policy[power_name].draw_action in (True, False) + assert 0. <= phase.policy[power_name].draw_prob <= 1. + + # Validating assignments + assert len(saved_game_proto.assigned_powers) == NB_POWERS + + # Validating rewards and returns + assert saved_game_proto.reward_fn == DefaultRewardFunction().name + for power_name in saved_game_proto.assigned_powers: + assert len(saved_game_proto.rewards[power_name].value) == len(saved_game_proto.phases) - 1 + assert len(saved_game_proto.returns[power_name].value) == len(saved_game_proto.phases) - 1 + +def launch(): + """ Launches the test """ + test_object = ControllerSetup() + test_object.run_tests() + +def test_run(): + """ Runs the test """ + run_in_separate_process(target=launch, timeout=240) diff --git a/diplomacy_research/models/self_play/tests/test_reward_functions.py b/diplomacy_research/models/self_play/tests/test_reward_functions.py new file mode 100644 index 0000000..4dfc6a2 --- /dev/null +++ b/diplomacy_research/models/self_play/tests/test_reward_functions.py @@ -0,0 +1,868 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Unit tests for reward functions. """ +from diplomacy import Game +from diplomacy_research.models.gym.environment import DoneReason +from diplomacy_research.models.self_play.reward_functions import NbCentersReward, NormNbCentersReward, \ + IntNormNbCentersReward, CustomIntNbCentersReward, CustomIntUnitReward, PlusOneMinusOneReward, \ + DrawSizeReward, ProportionalReward, SumOfSquares, SurvivorWinReward +from diplomacy_research.models.state_space import extract_state_proto + +def test_nb_centers_reward(): + """ Tests for NbCentersReward""" + game = Game() + rew_fn = NbCentersReward() + prev_state_proto = extract_state_proto(game) + state_proto = extract_state_proto(game) + assert rew_fn.name == 'nb_centers_reward' + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 3. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 3. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 3. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 3. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 3. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 4. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 3. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + +def test_norm_centers_reward(): + """ Tests for NormNbCentersReward """ + game = Game() + rew_fn = NormNbCentersReward() + prev_state_proto = extract_state_proto(game) + state_proto = extract_state_proto(game) + assert rew_fn.name == 'norm_nb_centers_reward' + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 3./18 + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 3./18 + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 3./18 + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 3./18 + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 3./18 + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 4./18 + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 3./18 + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + +def test_int_norm_centers_reward(): + """ Tests for InterimNormNbCentersReward """ + game = Game() + rew_fn = IntNormNbCentersReward() + + # Removing one center from FRANCE and adding it to GERMANY + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name == 'FRANCE': + power.centers.remove('PAR') + if power.name == 'GERMANY': + power.centers.append('PAR') + state_proto = extract_state_proto(game) + assert rew_fn.name == 'int_norm_nb_centers_reward' + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == -1. / 18 + assert get_reward('GERMANY', False, None) == 1. / 18 + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == -1. / 18 + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 1. / 18 + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -1. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -1. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -1. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -1. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -1. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -1. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -1. + +def test_custom_int_nb_centers_reward(): + """ Tests for CustomInterimNbCentersReward """ + game = Game() + rew_fn = CustomIntNbCentersReward() + + # Removing one center from FRANCE and adding it to GERMANY + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name == 'FRANCE': + power.centers.remove('PAR') + if power.name == 'GERMANY': + power.centers.append('PAR') + state_proto = extract_state_proto(game) + assert rew_fn.name == 'custom_int_nb_centers_reward' + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == -2. + assert get_reward('GERMANY', False, None) == 1. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == -2. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -18. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -18. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -18. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -18. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -18. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -18. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -18. + + # Reversing + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name == 'FRANCE': + power.centers.append('PAR') + if power.name == 'GERMANY': + power.centers.remove('PAR') + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 2. + assert get_reward('GERMANY', False, None) == -1. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 2. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == -1. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -18. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -18. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -18. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -18. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -18. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -18. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -18. + +def test_custom_int_unit_reward(): + """ Tests for CustomInterimUnitReward """ + game = Game() + rew_fn = CustomIntUnitReward() + + # Issuing orders + prev_state_proto = extract_state_proto(game) + game.set_orders('FRANCE', ['A MAR - SPA', 'A PAR - PIC']) + game.set_orders('AUSTRIA', ['A VIE - TYR']) + game.process() + state_proto = extract_state_proto(game) + assert game.get_current_phase() == 'F1901M' + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # +1 for FRANCE for conquering SPA + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 1. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -18. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -18. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -18. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -18. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -18. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -18. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -18. + + # Issuing orders + prev_state_proto = state_proto + game.set_orders('FRANCE', ['A PIC - BEL', 'A SPA - POR']) + game.set_orders('AUSTRIA', ['F TRI - VEN', 'A TYR S F TRI - VEN']) + game.process() + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # +1 for FRANCE for conquering POR + # -1 for FRANCE for losing SPA + # +1 for FRANCE for conquering BEL + # +1 for AUSTRIA for conquering VEN + # -1 for ITALY for losing VEN + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 1. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 1. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == -1. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == -1. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -18. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -18. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -18. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -18. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -18. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -18. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -18. + + # Issuing orders + prev_state_proto = state_proto + game.set_orders('FRANCE', ['A PIC - BEL', 'A SPA - POR']) + game.set_orders('AUSTRIA', ['F TRI - VEN', 'A TYR S F TRI - VEN']) + game.process() + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # +0 - No new SCs + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -18. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -18. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -18. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -18. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -18. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -18. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -18. + +def test_plus_minus_one_reward(): + """ Tests for PlusOneMinusOneReward """ + game = Game() + rew_fn = PlusOneMinusOneReward() + prev_state_proto = extract_state_proto(game) + state_proto = extract_state_proto(game) + assert rew_fn.name == 'plus_one_minus_one_reward' + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 1. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -1. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -1. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -1. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -1. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -1. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -1. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -1. + + # --- Clearing supply centers + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name != 'FRANCE': + power.clear_units() + power.centers = [] + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason) + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == -1. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == -1. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == 1. + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == -1. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == -1. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == -1. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == -1. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == -1. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == -1. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == -1. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == -1. + assert get_reward('ITALY', True, DoneReason.THRASHED) == -1. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == -1. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == -1. + +def test_draw_size_reward(): + """ Test draw size reward fn """ + game = Game() + pot_size = 20 + rew_fn = DrawSizeReward(pot_size=pot_size) + prev_state_proto = extract_state_proto(game) + state_proto = extract_state_proto(game) + assert rew_fn.name == 'draw_size_reward' + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # --- Clearing supply centers + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name != 'FRANCE' and power.name != 'ITALY': + power.clear_units() + power.centers = [] + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size / 2., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == round(pot_size / 2., 8) + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # Move centers in other countries to FRANCE except ENGLAND + # Winner: FRANCE + # Survivor: FRANCE, ENGLAND + game = Game() + prev_state_proto = extract_state_proto(game) + game.clear_centers() + game.set_centers('FRANCE', ['BUD', 'TRI', 'VIE', 'BRE', 'MAR', 'PAR', 'BER', 'KIE', 'MUN', 'NAP', 'ROM', 'VEN', + 'MOS', 'SEV', 'STP', 'WAR', 'ANK', 'CON', 'SMY']) + game.set_centers('ENGLAND', ['EDI', 'LON', 'LVP']) + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- In terminal state -- Victory + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size, 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + +def test_proportional_reward(): + """ Test sum of squares reward function """ + game = Game() + pot_size = 20 + rew_fn = ProportionalReward(pot_size=pot_size, exponent=2) + prev_state_proto = extract_state_proto(game) + state_proto = extract_state_proto(game) + assert rew_fn.name == 'proportional_reward' + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == round(pot_size * 16/70., 8) + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # --- Clearing supply centers + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name != 'FRANCE' and power.name != 'RUSSIA': + power.clear_units() + power.centers = [] + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/25., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == round(pot_size * 16/25., 8) + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # Move centers in other countries to FRANCE except ENGLAND + # Winner: FRANCE + # Survivor: FRANCE, ENGLAND + game = Game() + prev_state_proto = extract_state_proto(game) + game.clear_centers() + game.set_centers('FRANCE', ['BUD', 'TRI', 'VIE', 'BRE', 'MAR', 'PAR', 'BER', 'KIE', 'MUN', 'NAP', 'ROM', 'VEN', + 'MOS', 'SEV', 'STP', 'WAR', 'ANK', 'CON', 'SMY']) + game.set_centers('ENGLAND', ['EDI', 'LON', 'LVP']) + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- In terminal state -- Victory + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size, 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + +def test_sum_of_squares_reward(): + """ Test sum of squares reward function """ + game = Game() + pot_size = 20 + rew_fn = SumOfSquares(pot_size=pot_size) + prev_state_proto = extract_state_proto(game) + state_proto = extract_state_proto(game) + assert rew_fn.name == 'sum_of_squares_reward' + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == round(pot_size * 16/70., 8) + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/70., 8) + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # --- Clearing supply centers + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name != 'FRANCE' and power.name != 'RUSSIA': + power.clear_units() + power.centers = [] + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size * 9/25., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == round(pot_size * 16/25., 8) + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # Move centers in other countries to FRANCE except ENGLAND + # Winner: FRANCE + # Survivor: FRANCE, ENGLAND + game = Game() + prev_state_proto = extract_state_proto(game) + game.clear_centers() + game.set_centers('FRANCE', ['BUD', 'TRI', 'VIE', 'BRE', 'MAR', 'PAR', 'BER', 'KIE', 'MUN', 'NAP', 'ROM', 'VEN', + 'MOS', 'SEV', 'STP', 'WAR', 'ANK', 'CON', 'SMY']) + game.set_centers('ENGLAND', ['EDI', 'LON', 'LVP']) + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- In terminal state -- Victory + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size, 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + +def test_survivor_win_reward(): + """ Test survivor win reward function """ + game = Game() + pot_size = 20 + rew_fn = SurvivorWinReward(pot_size=pot_size) + prev_state_proto = extract_state_proto(game) + state_proto = extract_state_proto(game) + assert rew_fn.name == 'survivor_win_reward' + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- Not in terminal state + assert get_reward('AUSTRIA', False, None) == 0. + assert get_reward('ENGLAND', False, None) == 0. + assert get_reward('FRANCE', False, None) == 0. + assert get_reward('GERMANY', False, None) == 0. + assert get_reward('ITALY', False, None) == 0. + assert get_reward('RUSSIA', False, None) == 0. + assert get_reward('TURKEY', False, None) == 0. + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == round(pot_size / 7., 8) + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # --- Clearing supply centers + prev_state_proto = extract_state_proto(game) + for power in game.powers.values(): + if power.name != 'FRANCE' and power.name != 'RUSSIA': + power.clear_units() + power.centers = [] + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # --- In terminal state + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size / 2., 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == round(pot_size / 2., 8) + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. + + # Move centers in other countries to FRANCE except ENGLAND + # Winner: FRANCE + # Survivor: FRANCE, ENGLAND + game = Game() + prev_state_proto = extract_state_proto(game) + game.clear_centers() + game.set_centers('FRANCE', ['BUD', 'TRI', 'VIE', 'BRE', 'MAR', 'PAR', 'BER', 'KIE', 'MUN', 'NAP', 'ROM', 'VEN', + 'MOS', 'SEV', 'STP', 'WAR', 'ANK', 'CON', 'SMY']) + game.set_centers('ENGLAND', ['EDI', 'LON', 'LVP']) + state_proto = extract_state_proto(game) + get_reward = lambda power_name, is_terminal, done_reason: round(rew_fn.get_reward(prev_state_proto, + state_proto, + power_name, + is_terminal_state=is_terminal, + done_reason=done_reason), 8) + + # France has 19 SC, 18 to win, 1 excess + # Nb of controlled SC is 19 + 3 - 1 excess = 21 + # Reward for FRANCE is 18 / 21 * pot + # Reward for ENGLAND is 3 / 21 * pot + + # --- In terminal state -- Victory + assert get_reward('AUSTRIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ENGLAND', True, DoneReason.GAME_ENGINE) == round(pot_size * 3./21, 8) + assert get_reward('FRANCE', True, DoneReason.GAME_ENGINE) == round(pot_size * 18./21, 8) + assert get_reward('GERMANY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('ITALY', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('RUSSIA', True, DoneReason.GAME_ENGINE) == 0. + assert get_reward('TURKEY', True, DoneReason.GAME_ENGINE) == 0. + + # --- Thrashing + assert get_reward('AUSTRIA', True, DoneReason.THRASHED) == 0. + assert get_reward('ENGLAND', True, DoneReason.THRASHED) == 0. + assert get_reward('FRANCE', True, DoneReason.THRASHED) == 0. + assert get_reward('GERMANY', True, DoneReason.THRASHED) == 0. + assert get_reward('ITALY', True, DoneReason.THRASHED) == 0. + assert get_reward('RUSSIA', True, DoneReason.THRASHED) == 0. + assert get_reward('TURKEY', True, DoneReason.THRASHED) == 0. diff --git a/diplomacy_research/models/self_play/transition.py b/diplomacy_research/models/self_play/transition.py new file mode 100644 index 0000000..956cf50 --- /dev/null +++ b/diplomacy_research/models/self_play/transition.py @@ -0,0 +1,50 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Transition + - This module is responsible for defining the transition classes +""" +import collections + +class Transition( + collections.namedtuple('Transition', ('phase_ix', # The phase ix + 'state', # The proto representation of the state + 'phase', # The proto representation of the phase + 'policy', # The details of the behaviour policy + 'rewards', # The rewards received by each power + 'orders', # {power => orders during the phase} + 'phase_history', # The phase_history_proto + 'possible_orders'))): # The possible_orders_proto + """ Represents a transition (state, action, reward) for all powers """ + +class TransitionDetails( + collections.namedtuple('TransitionDetails', ('transition', # The transition named tuple + 'power_name', # The power that issued orders + 'draw_action', # Whether the power wanted a draw or not + 'reward_target', # The reward target for the policy update + 'value_target', # The value target for the baseline update + 'log_p_t', # None or the log of the import sampling ratio + 'log_probs'))): # Log probs of each token under the model + """ Contains the details of a transition (as computed by the advantage function) for a specific power """ + +class ReplaySample( + collections.namedtuple('ReplaySample', ('saved_game_proto', # A SavedGameProto instance + 'power_phases_ix'))): # {power_name: [phases_ix]} + """ Contains a saved game proto with a list of prioritized transition ix """ + +class ReplayPriority( + collections.namedtuple('ReplayPriority', ('game_id', # The game id containing a transition priority + 'power_name', # The power issuing orders + 'phase_ix', # The phase ix + 'priority'))): # The priority assigned to the transition/phase + """ Contains the priority for a given transition ix """ diff --git a/diplomacy_research/models/state_space.py b/diplomacy_research/models/state_space.py new file mode 100644 index 0000000..e2ee96e --- /dev/null +++ b/diplomacy_research/models/state_space.py @@ -0,0 +1,1059 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" State Space + - Functions to convert a game, state, or phase to state_space + - Functions to build the adjacency matrix + - List of words in standard vocabulary with a function to convert to/from index. +""" +# pylint: disable=too-many-lines +import base64 +from collections import OrderedDict +import hashlib +import logging +from operator import itemgetter +import os +import pickle +from random import shuffle +import zlib +import numpy as np +from diplomacy import Game +from diplomacy import Map +from diplomacy_research.proto.diplomacy_proto.common_pb2 import MapStringList +from diplomacy_research.proto.diplomacy_proto.game_pb2 import State as StateProto, PhaseHistory as PhaseHistoryProto +from diplomacy_research.utils.proto import dict_to_proto +from diplomacy_research.settings import MOVES_COUNT_DATASET_PATH + +# Constants +LOGGER = logging.getLogger(__name__) +ALL_POWERS = ['AUSTRIA', 'ENGLAND', 'FRANCE', 'GERMANY', 'ITALY', 'RUSSIA', 'TURKEY'] + +# ==================================== +# STATE SPACE (Supervised Learning) +# ==================================== +# +# 75 provinces + 6 coasts (BUL/EC, BUL/SC, SPA/NC, SPA/NC, STP/NC, STP/NC) = 81 nodes +# Note: There is actually 76 provinces, but we excluded SWI (Switzerland) because it is impassable in the game +# Information recorded per node +# ------------------------------- +# Normal Unit Type (3 values): {A, F, None} +# Normal Unit Power (8 values): {AUS, ENG, FRA, GER, ITA, RUS, TUR, None} +# Buildable / Removable (2 values): {Buildable,Removable} (0 or 1) +# Dislodged Unit Type (3 values): {A, F, None} +# Dislodged Unit Power (8 values): {AUS, ENG, FRA, GER, ITA, RUS, TUR, None} +# Area Type (3 values): {LAND, WATER, COAST} +# SC Owning Power (8 values): {AUS, ENG, FRA, GER, ITA, RUS, TUR, None} +# Note: Locations that are not supply centers will be all 0. +# +# State Space Size: 81 x 35 +# +# ==================================== +# PREV ORDERS SPACE (Supervised Learning) +# ==================================== +# +# Note: Only used for Movement phases +# 81 locs (nodes) - Same as state space +# +# Hold: A PAR H -- Issuing: PAR Src: None Dest; None +# Support: A PAR S A MAR -- Issuing: PAR Src: MAR Dest: None +# Support: A PAR S A MAR - BUR -- Issuing: PAR Src: MAR Dest: BUR +# Move A PAR - MAR -- Issuing: PAR Src: None Dest: MAR +# Convoy F MAO C A PAR - LON -- Issuing: MAO Src: PAR Dest: LON +# ------------------------------- +# +# Unit Type (3 values): {A, F, None} +# Issuing Power (8 values): {AUS, ENG, FRA, GER, ITA, RUS, TUR, None} +# Order Type (5 values): {HOLD, MOVE, SUPPORT, CONVOY, None} +# Src Power (8 values): {AUS, ENG, FRA, GER, ITA, RUS, TUR, None} +# Dest Power (8 values): {AUS, ENG, FRA, GER, ITA, RUS, TUR, None} +# SC Owning Power (8 values): {AUS, ENG, FRA, GER, ITA, RUS, TUR, None} +# Note: Locations that are not supply centers will be all 0. +# +# State Space Size: 81 x 40 +# + +# Cache for adjacency matrix and sorted locs +ADJACENCY_MATRIX = {} +SORTED_LOCS = {} + +# Constants +NB_LOCS = 81 +NB_SUPPLY_CENTERS = 34 +NB_FEATURES = 35 +NB_ORDERS_FEATURES = 40 +NB_POWERS = 7 +NB_SEASONS = 3 +NB_TYPES = 2 +NB_NODES = NB_LOCS +TOKENS_PER_ORDER = 5 +MAX_LENGTH_ORDER_PREV_PHASES = 350 +MAX_CANDIDATES = 240 +NB_PREV_ORDERS = 1 # We only feed the last movement phase +NB_PREV_ORDERS_HISTORY = 3 # We need to have an history of at least 3, to get at least 1 movement phase + +def get_sorted_locs(map_object): + """ Returns the list of locations for the given map in sorted order, using topological order + :param map_object: The instantiated map + :return: A sorted list of locations + :type map_object: diplomacy.Map + """ + if map_object.name not in SORTED_LOCS: + key = None if not map_object.name.startswith('standard') else STANDARD_TOPO_LOCS.index + locs = [l.upper() for l in map_object.locs if map_object.area_type(l) != 'SHUT'] + SORTED_LOCS[map_object.name] = sorted(locs, key=key) + return SORTED_LOCS[map_object.name] + +def get_player_seed(game_id, power_name): + """ Returns a unique player seed given a game id and a power name """ + crc_adler32 = zlib.adler32(game_id.encode('utf-8') + power_name.encode('utf-8')) + sha256_hash = hashlib.sha256() + sha256_hash.update(crc_adler32.to_bytes((crc_adler32.bit_length() + 7) // 8, 'big')) + sha256_hash.update(game_id.encode('utf-8')) + return int.from_bytes(sha256_hash.digest()[8:12], 'big') % (2 ** 31 - 1) + +def get_game_id(salt='', previous_id=''): + """ Standardizes the game id format to 72 bits (12 base64 characters) + :param salt: Optional salt. To hash a known string into a deterministic game id. + :param previous_id: Optional. To hash a known string into a deterministic game id. + """ + sha256_hash = hashlib.sha256() + if salt and previous_id: + sha256_hash.update(salt.encode('utf-8')) + sha256_hash.update(previous_id.encode('utf-8')) + else: + sha256_hash.update(os.urandom(32)) + return base64.b64encode(sha256_hash.digest()[-12:], b'-_').decode('utf-8') + +def build_game_from_state_proto(state_proto): + """ Builds a game object from a state_proto """ + game = Game(map_name=state_proto.map, rules=state_proto.rules) + game.set_current_phase(state_proto.name) + + # Setting units + game.clear_units() + for power_name in state_proto.units: + game.set_units(power_name, list(state_proto.units[power_name].value)) + + # Setting centers + game.clear_centers() + for power_name in state_proto.centers: + game.set_centers(power_name, list(state_proto.centers[power_name].value)) + + # Returning + return game + +def extract_state_proto(game): + """ Extracts the state_proto from a diplomacy.Game object + :type game: diplomacy.Game + """ + state = game.get_state() + state['game_id'] = game.game_id + state['map'] = game.map.name + state['rules'] = list(game.rules) + return dict_to_proto(state, StateProto) + +def extract_phase_history_proto(game, nb_previous_phases=NB_PREV_ORDERS_HISTORY): + """ Extracts the phase_history_proto from a diplomacy.Game object + :param game: The diplomacy.Game object + :param nb_previous_phases: Integer. If set, only the last x phases will be returned. + If None, the full history since the beginning of the game is returned. + :return: A list of `.proto.game.PhaseHistory` proto. + :type game: diplomacy.Game + """ + from_phase = None if nb_previous_phases is None else -1 * nb_previous_phases + phase_history = Game.get_phase_history(game, from_phase=from_phase) + return [dict_to_proto(hist.to_dict(), PhaseHistoryProto) for hist in phase_history] + +def extract_possible_orders_proto(game): + """ Extracts the possible_orders_proto from a diplomacy.Game object + :type game: diplomacy.Game + """ + possible_orders = game.get_all_possible_orders() + return dict_to_proto(possible_orders, MapStringList) + +def dict_to_flatten_board_state(state, map_object): + """ Converts a game state to its flatten (list) board state representation. + :param state: A game state. + :param map_object: The instantiated Map object + :return: A flatten (list) representation of the phase (81*35 = 2835) + """ + state_proto = dict_to_proto(state, StateProto) + return proto_to_board_state(state_proto, map_object).flatten().tolist() + +def proto_to_board_state(state_proto, map_object): + """ Converts a `.proto.game.State` proto to its matrix board state representation + :param state_proto: A `.proto.game.State` proto of the state of the game. + :param map_object: The instantiated Map object + :return: The board state (matrix representation) of the phase (81 x 35) + :type map_object: diplomacy.Map + """ + # Retrieving cached version directly from proto + if state_proto.board_state: + if len(state_proto.board_state) == NB_NODES * NB_FEATURES: + return np.array(state_proto.board_state, dtype=np.uint8).reshape(NB_NODES, NB_FEATURES) + LOGGER.warning('Got a cached board state of dimension %d - Expected %d', + len(state_proto.board_state), NB_NODES * NB_FEATURES) + + # Otherwise, computing it + locs = get_sorted_locs(map_object) + scs = sorted([sc.upper() for sc in map_object.scs]) + powers = get_map_powers(map_object) + remaining_scs = scs[:] + + # Sizes + nb_locs = len(locs) + nb_powers = len(powers) + + # Creating matrix components for locations + loc_norm_type_matrix = np.zeros((nb_locs, NB_TYPES + 1), dtype=np.uint8) + loc_norm_power_matrix = np.zeros((nb_locs, nb_powers + 1), dtype=np.uint8) + loc_build_removable_matrix = np.zeros((nb_locs, 2), dtype=np.uint8) + loc_dis_type_matrix = np.zeros((nb_locs, NB_TYPES + 1), dtype=np.uint8) + loc_dis_power_matrix = np.zeros((nb_locs, nb_powers + 1), dtype=np.uint8) + loc_area_type_matrix = np.zeros((nb_locs, 3), dtype=np.uint8) + loc_owner = np.zeros((nb_locs, nb_powers + 1), dtype=np.uint8) + + # Settings units + for power_name in state_proto.units: + build_count = state_proto.builds[power_name].count + + # Marking regular and removable units + for unit in state_proto.units[power_name].value: + # Checking in what phase we are in + is_dislodged = bool(unit[0] == '*') + + # Removing leading * if dislodged + unit = unit[1:] if is_dislodged else unit + loc = unit[2:] + unit_type = unit[0] + loc_ix = locs.index(loc) + + # Calculating unit owner ix and unit type ix + power_ix = powers.index(power_name) + type_ix = 0 if unit_type == 'A' else 1 + if not is_dislodged: + loc_norm_power_matrix[loc_ix, power_ix] = 1 + loc_norm_type_matrix[loc_ix, type_ix] = 1 + else: + loc_dis_power_matrix[loc_ix, power_ix] = 1 + loc_dis_type_matrix[loc_ix, type_ix] = 1 + + # Setting number of removable units + if build_count < 0: + loc_build_removable_matrix[loc_ix, 1] = 1 + + # Also setting the parent location if it's a coast + if '/' in loc: + loc_without_coast = loc[:3] + loc_without_coast_ix = locs.index(loc_without_coast) + if not is_dislodged: + loc_norm_power_matrix[loc_without_coast_ix, power_ix] = 1 + loc_norm_type_matrix[loc_without_coast_ix, type_ix] = 1 + else: + loc_dis_power_matrix[loc_without_coast_ix, power_ix] = 1 + loc_dis_type_matrix[loc_without_coast_ix, type_ix] = 1 + if build_count < 0: + loc_build_removable_matrix[loc_without_coast_ix, 1] = 1 + + # Handling build locations + if build_count > 0: + buildable_locs = [loc for loc in locs if loc[:3] in state_proto.builds[power_name].homes] + + # Marking location as buildable (with no units on it) + for loc in buildable_locs: + loc_ix = locs.index(loc) + + # There are no units on it, so "Normal unit" is None + loc_norm_type_matrix[loc_ix, -1] = 1 + loc_norm_power_matrix[loc_ix, -1] = 1 + loc_build_removable_matrix[loc_ix, 0] = 1 + + # Setting rows with no values to None + loc_norm_type_matrix[(np.sum(loc_norm_type_matrix, axis=1) == 0, -1)] = 1 + loc_norm_power_matrix[(np.sum(loc_norm_power_matrix, axis=1) == 0, -1)] = 1 + loc_dis_type_matrix[(np.sum(loc_dis_type_matrix, axis=1) == 0, -1)] = 1 + loc_dis_power_matrix[(np.sum(loc_dis_power_matrix, axis=1) == 0, -1)] = 1 + + # Setting area type + for loc in locs: + loc_ix = locs.index(loc) + area_type = map_object.area_type(loc) + if area_type in ['PORT', 'COAST']: + area_type_ix = 2 + elif area_type == 'WATER': + area_type_ix = 1 + elif area_type == 'LAND': + area_type_ix = 0 + else: + raise RuntimeError('Unknown area type {}'.format(area_type)) + loc_area_type_matrix[loc_ix, area_type_ix] = 1 + + # Supply center ownership + for power_name in state_proto.centers: + if power_name == 'UNOWNED': + continue + for center in state_proto.centers[power_name].value: + for loc in [map_loc for map_loc in locs if map_loc[:3] == center[:3]]: + if loc[:3] in remaining_scs: + remaining_scs.remove(loc[:3]) + loc_ix = locs.index(loc) + power_ix = powers.index(power_name) + loc_owner[loc_ix, power_ix] = 1 + + # Unowned supply centers + for center in remaining_scs: + for loc in [map_loc for map_loc in locs if map_loc[:3] == center[:3]]: + loc_ix = locs.index(loc) + power_ix = nb_powers + loc_owner[loc_ix, power_ix] = 1 + + # Merging and returning + return np.concatenate([loc_norm_type_matrix, + loc_norm_power_matrix, + loc_build_removable_matrix, + loc_dis_type_matrix, + loc_dis_power_matrix, + loc_area_type_matrix, + loc_owner], + axis=1) + +def dict_to_flatten_prev_orders_state(phase, map_object): + """ Converts a phase to its flatten (list) prev orders state representation. + :param phase: A phase from a saved game. + :param map_object: The instantiated Map object + :return: A flatten (list) representation of the prev orders (81*40 = 3240) + """ + phase_proto = dict_to_proto(phase, PhaseHistoryProto) + return proto_to_prev_orders_state(phase_proto, map_object).flatten().tolist() + +def proto_to_prev_orders_state(phase_proto, map_object): + """ Converts a `.proto.game.PhaseHistory` proto to its matrix prev orders state representation + :param phase_proto: A `.proto.game.PhaseHistory` proto of the phase history of the game. + :param map_object: The instantiated Map object + :return: The prev orders state (matrix representation) of the prev orders (81 x 40) + :type map_object: diplomacy.Map + """ + # Retrieving cached version directly from proto + if phase_proto.prev_orders_state: + if len(phase_proto.prev_orders_state) == NB_NODES * NB_ORDERS_FEATURES: + return np.array(phase_proto.prev_orders_state, dtype=np.uint8).reshape(NB_NODES, NB_ORDERS_FEATURES) + LOGGER.warning('Got a cached prev orders state of dimension %d - Expected %d', + len(phase_proto.prev_orders_state), NB_NODES * NB_ORDERS_FEATURES) + + # Otherwise, computing it + locs = get_sorted_locs(map_object) + powers = get_map_powers(map_object) + scs = sorted([sc.upper() for sc in map_object.scs]) + + # Sizes + nb_locs = len(locs) + nb_powers = len(powers) + + # Not a movement phase + if phase_proto.name[-1] != 'M': + LOGGER.warning('Trying to compute the prev_orders_state of a non-movement phase.') + return np.zeros((NB_NODES, NB_FEATURES), dtype=np.uint8) + + # Creating matrix components for locations + loc_unit_type_matrix = np.zeros((nb_locs, NB_TYPES + 1), dtype=np.uint8) + loc_issuing_power_matrix = np.zeros((nb_locs, nb_powers + 1), dtype=np.uint8) + loc_order_type_matrix = np.zeros((nb_locs, 5), dtype=np.uint8) + loc_src_power_matrix = np.zeros((nb_locs, nb_powers + 1), dtype=np.uint8) + loc_dest_power_matrix = np.zeros((nb_locs, nb_powers + 1), dtype=np.uint8) + loc_sc_owner_matrix = np.zeros((nb_locs, nb_powers + 1), dtype=np.uint8) + + # Storing the owners of each location + # The owner of a location is the unit owner if there is a unit, otherwise the SC owner, otherwise None + owner = {} + for power_name in phase_proto.state.units: + for unit in phase_proto.state.units[power_name].value: + loc = unit.split()[-1] + owner[loc[:3]] = power_name + + # Storing the owners of each center + remaining_scs = scs[:] + for power_name in phase_proto.state.centers: + if power_name == 'UNOWNED': + continue + for center in phase_proto.state.centers[power_name].value: + for loc in [map_loc for map_loc in locs if map_loc[:3] == center[:3]]: + if loc[:3] not in owner: + owner[loc[:3]] = power_name + loc_sc_owner_matrix[locs.index(loc), powers.index(power_name)] = 1 + remaining_scs.remove(center) + for center in remaining_scs: + for loc in [map_loc for map_loc in locs if map_loc[:3] == center[:3]]: + loc_sc_owner_matrix[locs.index(loc), -1] = 1 + + # Parsing each order + for issuing_power_name in phase_proto.orders: + issuing_power_ix = powers.index(issuing_power_name) + + for order in phase_proto.orders[issuing_power_name].value: + word = order.split() + + # Movement phase - Expecting Hold, Move, Support or Convoy + if len(word) <= 2 or word[2] not in 'H-SC': + LOGGER.warning('Unsupported order %s', order) + continue + + # Detecting unit type, loc and order type + unit_type, unit_loc, order_type = word[:3] + unit_type_ix = 0 if unit_type == 'A' else 1 + order_type_ix = 'H-SC'.index(order_type) + + # Adding both with and without coasts + unit_locs = [unit_loc] + if '/' in unit_loc: + unit_locs += [unit_loc[:3]] + + for unit_loc in unit_locs: + unit_loc_ix = locs.index(unit_loc) + + # Setting unit type, loc, order type + loc_unit_type_matrix[unit_loc_ix, unit_type_ix] = 1 + loc_issuing_power_matrix[unit_loc_ix, issuing_power_ix] = 1 + loc_order_type_matrix[unit_loc_ix, order_type_ix] = 1 + + # Hold order + if order_type == 'H': + loc_src_power_matrix[unit_loc_ix, -1] = 1 + loc_dest_power_matrix[unit_loc_ix, -1] = 1 + + # Move order + elif order_type == '-': + dest = word[-1] + dest_power_ix = -1 if dest[:3] not in owner else powers.index(owner[dest[:3]]) + loc_src_power_matrix[unit_loc_ix, -1] = 1 + loc_dest_power_matrix[unit_loc_ix, dest_power_ix] = 1 + + # Support hold + elif order_type == 'S' and '-' not in word: + src = word[-1] + src_power_ix = -1 if src[:3] not in owner else powers.index(owner[src[:3]]) + loc_src_power_matrix[unit_loc_ix, src_power_ix] = 1 + loc_dest_power_matrix[unit_loc_ix, -1] = 1 + + # Support move / Convoy + elif order_type in ('S', 'C') and '-' in word: + src = word[word.index('-') - 1] + dest = word[-1] + src_power_ix = -1 if src[:3] not in owner else powers.index(owner[src[:3]]) + dest_power_ix = -1 if dest[:3] not in owner else powers.index(owner[dest[:3]]) + loc_src_power_matrix[unit_loc_ix, src_power_ix] = 1 + loc_dest_power_matrix[unit_loc_ix, dest_power_ix] = 1 + + # Unknown other + else: + LOGGER.error('Unsupported order - %s', order) + + # Setting rows with no values to None + loc_unit_type_matrix[(np.sum(loc_unit_type_matrix, axis=1) == 0, -1)] = 1 + loc_issuing_power_matrix[(np.sum(loc_issuing_power_matrix, axis=1) == 0, -1)] = 1 + loc_order_type_matrix[(np.sum(loc_order_type_matrix, axis=1) == 0, -1)] = 1 + loc_src_power_matrix[(np.sum(loc_src_power_matrix, axis=1) == 0, -1)] = 1 + loc_dest_power_matrix[(np.sum(loc_dest_power_matrix, axis=1) == 0, -1)] = 1 + + # Adding prev order state at the beginning of the list (to keep the phases in the correct order) + return np.concatenate([loc_unit_type_matrix, + loc_issuing_power_matrix, + loc_order_type_matrix, + loc_src_power_matrix, + loc_dest_power_matrix, + loc_sc_owner_matrix,], axis=1) + +def get_top_victors(saved_game_proto, map_object): + """ Returns a list of the top victors (i.e. owning more than 25% -1 of the centers on the map) + We will only used the orders from these victors for the supervised learning + :param saved_game_proto: A `.proto.game.SavedGame` object from the dataset. + :param map_object: The instantiated Map object + :return: A list of victors (powers) + :type map_object: diplomacy.Map + """ + powers = get_map_powers(map_object) + nb_scs = len(map_object.scs) + min_nb_scs = nb_scs // 4 - 1 + + # Retrieving the number of centers for each power at the end of the game + # Only keeping powers with at least 7 centers + scs_last_phase = saved_game_proto.phases[-1].state.centers + ending_scs = [(power_name, len(scs_last_phase[power_name].value)) for power_name in powers + if len(scs_last_phase[power_name].value) >= min_nb_scs] + ending_scs = sorted(ending_scs, key=itemgetter(1), reverse=True) + + # Not victors found, returning all powers because they all are of similar strength + if not ending_scs: + return powers + return [power_name for power_name, _ in ending_scs] + +def get_orderable_locs_for_powers(state_proto, powers, shuffled=False): + """ Returns a list of all orderable locations and a list of orderable location for each power + :param state_proto: A `.proto.game.State` object. + :param powers: A list of powers for which to retrieve the orderable locations + :param shuffled: Boolean. If true, the orderable locations for each power will be shuffled. + :return: A tuple consisting of: + - A list of all orderable locations for all powers + - A dictionary with the power name as key, and a set of its orderable locations as value + """ + # Detecting if we are in retreats phase + in_retreats_phase = state_proto.name[-1] == 'R' + + # Detecting orderable locations for each top victor + # Not storing coasts for orderable locations + all_orderable_locs = set([]) + orderable_locs = {power_name: set([]) for power_name in powers} + for power_name in powers: + + # Adding build locations + if state_proto.name[-1] == 'A' and state_proto.builds[power_name].count >= 0: + for home in state_proto.builds[power_name].homes: + all_orderable_locs.add(home[:3]) + orderable_locs[power_name].add(home[:3]) + + # Otherwise, adding units (regular and dislodged) + else: + for unit in state_proto.units[power_name].value: + unit_type, unit_loc = unit.split() + if unit_type[0] == '*' and in_retreats_phase: + all_orderable_locs.add(unit_loc[:3]) + orderable_locs[power_name].add(unit_loc[:3]) + elif unit_type[0] != '*' and not in_retreats_phase: + all_orderable_locs.add(unit_loc[:3]) + orderable_locs[power_name].add(unit_loc[:3]) + + # Sorting orderable locations + key = None if not state_proto.map.startswith('standard') else STANDARD_TOPO_LOCS.index + orderable_locs = {power_name: sorted(orderable_locs[power_name], key=key) for power_name in powers} + + # Shuffling list if requested + if shuffled: + for power_name in powers: + shuffle(orderable_locs[power_name]) + + # Returning + return list(sorted(all_orderable_locs, key=key)), orderable_locs + +def get_orders_by_loc(phase_proto, orderable_locations, powers): + """ Returns a dictionary with loc as key and its corresponding order as value + Note: only the locs in orderable_locations are included in the dictionary + + :param phase_proto: A `.proto.game.SavedGame.Phase` object from the dataset. + :param orderable_locations: A list of locs from which we want the orders + :param powers: A list of powers for which to retrieve orders + :return: A dictionary with locs as key, and their corresponding order as value + (e.g. {'PAR': 'A PAR - MAR'}) + """ + orders_by_loc = {} + for power_name in phase_proto.orders: + if power_name not in powers: + continue + for order in phase_proto.orders[power_name].value: + order_loc = order.split()[1] + + # Skipping if not one of the orderable locations + if order_loc not in orderable_locations and order_loc[:3] not in orderable_locations: + continue + + # Adding order to dictionary + # Removing coast from key + orders_by_loc[order_loc[:3]] = order + + # Returning order by location + return orders_by_loc + +def get_issued_orders_for_powers(phase_proto, powers, shuffled=False): + """ Extracts a list of orderable locations and corresponding orders for a list of powers + :param phase_proto: A `.proto.game.SavedGame.Phase` object from the dataset. + :param powers: A list of powers for which we want issued orders + :param shuffled: Boolean. If true, orderable locations are shuffled, otherwise they are sorted alphabetically + :return: A dictionary with the power name as key, and for value a dictionary of: + - orderable location for that power as key (e.g. 'PAR') + - the corresponding order at that location as value (e.g. 'A PAR H') + """ + # Retrieving orderable locations + all_orderable_locs, orderable_locs = get_orderable_locs_for_powers(phase_proto.state, + powers, + shuffled=shuffled) + + # Retrieving orders by loc for orderable locations + orders_by_loc = get_orders_by_loc(phase_proto, all_orderable_locs, powers) + + # Computing list of issued orders for each top victor + issued_orders = OrderedDict() + for power_name in powers: + issued_orders[power_name] = OrderedDict() + for loc in orderable_locs[power_name]: + for issued_order_loc in [order_loc for order_loc in orders_by_loc + if order_loc == loc or (order_loc[:3] == loc[:3] and '/' in order_loc)]: + issued_orders[power_name][issued_order_loc] = orders_by_loc[issued_order_loc] + + # Returning + return issued_orders + +def get_possible_orders_for_powers(phase_proto, powers): + """ Extracts a list of possible orders for all locations where a power could issue an order + :param phase_proto: A `.proto.game.SavedGame.Phase` object from the dataset. + :param powers: A list of powers for which we want the possible orders + :return: A dictionary for each location, the list of possible orders + """ + possible_orders_proto = phase_proto.possible_orders + + # Making sure we have a list of possible orders attached to the phase_proto + # Otherwise, creating a game object to retrieve the possible orders + if not possible_orders_proto: + LOGGER.warning('The list of possible orders was not attached to the phase_proto. Generating it.') + game = build_game_from_state_proto(phase_proto.state) + possible_orders_proto = extract_possible_orders_proto(game) + for loc in possible_orders_proto: + phase_proto.possible_orders[loc].value.extend(possible_orders_proto[loc].value) + + # Getting orderable locations + all_orderable_locations, _ = get_orderable_locs_for_powers(phase_proto.state, powers) + + # Getting possible orders + possible_orders = {} + for loc in all_orderable_locations: + possible_orders_at_loc = list(possible_orders_proto[loc].value) + if possible_orders_at_loc: + possible_orders[loc] = possible_orders_at_loc + + # Returning + return possible_orders + +def get_map_powers(map_object): + """ Returns the list of powers on the map """ + if map_object.name.startswith('standard'): + return ALL_POWERS + return sorted([power_name for power_name in map_object.powers]) + +def get_current_season(state_proto): + """ Returns the index of the current season (0 = S, 1 = F, 2 = W) + :param state_proto: A `.proto.game.State` object. + :return: The integer representation of the current season + """ + season = state_proto.name + if season == 'COMPLETED': + return 0 + if season[0] not in 'SFW': + LOGGER.warning('Unrecognized season %s. Using "Spring" as the current season.', season) + return 0 + return 'SFW'.index(season[0]) + +def get_adjacency_matrix(map_name='standard'): + """ Computes the adjacency matrix for map + :param map_name: The name of the map + :return: A (nb_nodes) x (nb_nodes) matrix + """ + if map_name in ADJACENCY_MATRIX: + return ADJACENCY_MATRIX[map_name] + + # Finding list of all locations + current_map = Map(map_name) + locs = get_sorted_locs(current_map) + adjacencies = np.zeros((len(locs), len(locs)), dtype=np.bool) + + # Building adjacencies between locs + # Coasts are adjacent to their parent location (without coasts) + for i, loc_1 in enumerate(locs): + for j, loc_2 in enumerate(locs): + if current_map.abuts('A', loc_1, '-', loc_2) or current_map.abuts('F', loc_1, '-', loc_2): + adjacencies[i, j] = 1 + if loc_1 != loc_2 and (loc_1[:3] == loc_2 or loc_1 == loc_2[:3]): + adjacencies[i, j] = 1 + + # Storing in cache and returning + ADJACENCY_MATRIX[map_name] = adjacencies + return adjacencies + +def get_board_alignments(locs, in_adjustment_phase, tokens_per_loc, decoder_length): + """ Returns a n list of (NB_NODES vector) representing the alignments (probs) for the locs on the board state + :param locs: The list of locs being outputted by the model + :param in_adjustment_phase: Indicates if we are in A phase (all locs possible at every position) or not. + :param tokens_per_loc: The number of tokens per loc (TOKENS_PER_ORDER for token_based, 1 for order_based). + :param decoder_length: The length of the decoder. + :return: A list of [NB_NODES] vector of probabilities (alignments for each location) + """ + alignments = [] + + # Regular phase + if not in_adjustment_phase: + for loc in locs: + alignment = np.zeros([NB_NODES], dtype=np.uint8) + alignment_index = ALIGNMENTS_INDEX.get(loc[:3], []) + if loc[:3] not in ALIGNMENTS_INDEX: + LOGGER.warning('Location %s is not in the alignments index.', loc) + if alignment_index: + for index in alignment_index: + alignment[index] = 1 + alignments += [alignment] * tokens_per_loc + if decoder_length != len(locs) * tokens_per_loc: + LOGGER.warning('Got %d tokens, but decoder length is %d', len(locs) * tokens_per_loc, decoder_length) + if decoder_length > len(alignments): + LOGGER.warning('Got %d locs, but the decoder length is %d', len(locs), decoder_length) + alignments += [np.zeros([NB_NODES], dtype=np.uint8)] * (decoder_length - len(alignments)) + + # Adjustment phase (All locs at all positions) + else: + alignment = np.zeros([NB_NODES], dtype=np.uint8) + alignment_index = set() + for loc in locs: + if loc[:3] not in ALIGNMENTS_INDEX: + LOGGER.warning('Location %s is not in the alignments index.', loc) + for index in ALIGNMENTS_INDEX.get(loc[:3], []): + alignment_index.add(index) + if alignment_index: + for index in alignment_index: + alignment[index] = 1 + alignments = [alignment] * decoder_length + + # Validating size + if decoder_length != len(alignments): + LOGGER.warning('Got %d alignments, but decoder length is %d', len(alignments), decoder_length) + + # Returning + return alignments + +def get_alignments_index(map_name='standard'): + """ Computes a list of nodes index for each possible location + e.g. if the sorted list of locs is ['BRE', 'MAR', 'PAR'] would return {'BRE': [0], 'MAR': [1], 'PAR': [2]} + """ + current_map = Map(map_name) + sorted_locs = get_sorted_locs(current_map) + alignments_index = {} + + # Computing the index of each loc + for loc in sorted_locs: + if loc[:3] in alignments_index: + continue + alignments_index[loc[:3]] = [index for index, sorted_loc in enumerate(sorted_locs) if loc[:3] == sorted_loc[:3]] + return alignments_index + +def get_token_based_mask(list_possible_orders, offset=0, coords=None): + """ Computes the possible order mask to apply to the decoder of a token-based policy model + :param list_possible_orders: The list of possible orders (e.g. ['A PAR H', 'A PAR - BUR', ...]) + :param offset: An integer offset to add to the position before storing the coords + :param coords: A set of coordinates to which we want add additional masking data + :return: A set of coordinates (x, y, z) for each non-zero value in the matrix. + + ** Note: The dense mask matrix would be of shape: (TOK/ORD, VOCAB_SIZE, VOCAB_SIZE) ** + """ + coords = coords or set() # (position, prev_token, token) + + # Masking possible order mask based on previous token + for order in list_possible_orders: + try: + prev_token = 0 + order_tokens = get_order_tokens(order) + [EOS_TOKEN] + order_tokens += [PAD_TOKEN] * (TOKENS_PER_ORDER - len(order_tokens)) + for position, order_token in enumerate(order_tokens): + token = token_to_ix(order_token) + if position == 0: + coords.add((position + offset, PAD_ID, token)) + coords.add((position + offset, GO_ID, token)) + coords.add((position + offset, EOS_ID, token)) + else: + coords.add((position + offset, prev_token, token)) + prev_token = token + except KeyError: + LOGGER.warning('[get_token_based_mask] Order "%s" is invalid. Skipping.', order) + + # Returning + return coords + +def get_order_based_mask(list_possible_orders, max_length=MAX_CANDIDATES): + """ Returns a list of candidates ids padded to the max length + :param list_possible_orders: The list of possible orders (e.g. ['A PAR H', 'A PAR - BUR', ...]) + :return: A list of candidates padded. (e.g. [1, 50, 252, 0, 0, 0, ...]) + """ + candidates = [order_to_ix(order) for order in list_possible_orders] + candidates = [token for token in candidates if token is not None] + candidates += [PAD_ID] * (max_length - len(candidates)) + if len(candidates) > max_length: + LOGGER.warning('Found %d candidates, but only allowing a maximum of %d', len(candidates), max_length) + candidates = candidates[:max_length] + return candidates + +def get_order_tokens(order): + """ Retrieves the order tokens used in an order + e.g. 'A PAR - MAR' would return ['A PAR', '-', 'MAR'] + """ + # We need to keep 'A', 'F', and '-' in a temporary buffer to concatenate them with the next word + # We replace 'R' orders with '-' + # Tokenization would be: 'A PAR S A MAR - BUR' --> 'A PAR', 'S', 'A MAR', '- BUR' + # 'A PAR R MAR' --> 'A PAR', '- MAR' + buffer, order_tokens = [], [] + for word in order.replace(' R ', ' - ').split(): + buffer += [word] + if word not in ['A', 'F', '-']: + order_tokens += [' '.join(buffer)] + buffer = [] + return order_tokens + +def get_vocabulary(): + """ Returns the list of words in the dictionary + :return: The list of words in the dictionary + """ + map_object = Map() + locs = sorted([loc.upper() for loc in map_object.locs]) + + vocab = [PAD_TOKEN, GO_TOKEN, EOS_TOKEN, DRAW_TOKEN] # Utility tokens + vocab += ['<%s>' % power_name for power_name in get_map_powers(map_object)] # Power names + vocab += ['B', 'C', 'D', 'H', 'S', 'VIA', 'WAIVE'] # Order Tokens (excl '-', 'R') + vocab += ['- %s' % loc for loc in locs] # Locations with '-' + vocab += ['A %s' % loc for loc in locs if map_object.is_valid_unit('A %s' % loc)] # Army Units + vocab += ['F %s' % loc for loc in locs if map_object.is_valid_unit('F %s' % loc)] # Fleet Units + return vocab + +def token_to_ix(order_token): + """ Computes the index of an order token in the vocabulary (i.e. order_token ==> token) + :param order_token: The order token to get the index from (e.g. 'A PAR') + :return: The index of the order token, a.k.a. the corresponding token (e.g. 10) + """ + return VOCABULARY_KEY_TO_IX[order_token] + +def ix_to_token(token): + """ Computes the order token at a given index in the vocabulary (i.e. token ==> order_token) + :param token: The token to convert to an order token (e.g. 10) + :return: The corresponding order_token (e.g. 'A PAR') + """ + return VOCABULARY_IX_TO_KEY[max(0, token)] + +def get_order_frequency_table(): + """ Generates the order frequency table, with orders as key and the number of times the order was + seen in the dataset as value + """ + order_freq = {} + if os.path.exists(MOVES_COUNT_DATASET_PATH): + with open(MOVES_COUNT_DATASET_PATH, 'rb') as order_freq: + order_freq = pickle.load(order_freq) # {move: (nb_no_press, no_press)} + return order_freq + +def get_order_frequency(order, no_press_only): + """ Computes the number of time an order has been seen in the dataset + :param order: The order to check (e.g. 'A PAR H') + :param no_press_only: Boolean flag to indicate we only want the count for no press games. + :return: The number of time the order has been seen in the dataset + :type no_press_only: bool + """ + if order not in ORDER_FREQUENCY: + return 0 + press_count, no_press_count = ORDER_FREQUENCY[order] + return no_press_count if no_press_only else press_count + no_press_count + +def get_power_vocabulary(): + """ Computes a sorted list of powers in the standard map + :return: A list of the powers + """ + standard_map = Map() + return sorted([power_name for power_name in standard_map.powers]) + +def get_order_vocabulary(): + """ Computes the list of all valid orders on the standard map + :return: A sorted list of all valid orders on the standard map + """ + # pylint: disable=too-many-nested-blocks,too-many-branches + categories = ['H', 'D', 'B', '-', 'R', 'SH', 'S-', + '-1', 'S1', 'C1', # Move, Support, Convoy (using 1 fleet) + '-2', 'S2', 'C2', # Move, Support, Convoy (using 2 fleets) + '-3', 'S3', 'C3', # Move, Support, Convoy (using 3 fleets) + '-4', 'S4', 'C4'] # Move, Support, Convoy (using 4 fleets) + orders = {category: set() for category in categories} + map_object = Map() + locs = sorted([loc.upper() for loc in map_object.locs]) + + # All holds, builds, and disbands orders + for loc in locs: + for unit_type in ['A', 'F']: + if map_object.is_valid_unit('%s %s' % (unit_type, loc)): + orders['H'].add('%s %s H' % (unit_type, loc)) + orders['D'].add('%s %s D' % (unit_type, loc)) + + # Allowing builds in all SCs (even though only homes will likely be used) + if loc[:3] in map_object.scs: + orders['B'].add('%s %s B' % (unit_type, loc)) + + # Moves, Retreats, Support Holds + for unit_loc in locs: + for dest in [loc.upper() for loc in map_object.abut_list(unit_loc, incl_no_coast=True)]: + for unit_type in ['A', 'F']: + if not map_object.is_valid_unit('%s %s' % (unit_type, unit_loc)): + continue + + if map_object.abuts(unit_type, unit_loc, '-', dest): + orders['-'].add('%s %s - %s' % (unit_type, unit_loc, dest)) + orders['R'].add('%s %s R %s' % (unit_type, unit_loc, dest)) + + # Making sure we can support destination + if not (map_object.abuts(unit_type, unit_loc, 'S', dest) + or map_object.abuts(unit_type, unit_loc, 'S', dest[:3])): + continue + + # Support Hold + for dest_unit_type in ['A', 'F']: + for coast in ['', '/NC', '/SC', '/EC', '/WC']: + if map_object.is_valid_unit('%s %s%s' % (dest_unit_type, dest, coast)): + orders['SH'].add('%s %s S %s %s%s' % (unit_type, unit_loc, dest_unit_type, dest, coast)) + + # Convoys, Move Via + for nb_fleets in map_object.convoy_paths: + + # Skipping long-term convoys + if nb_fleets > 4: + continue + + for start, fleets, dests in map_object.convoy_paths[nb_fleets]: + for end in dests: + orders['-%d' % nb_fleets].add('A %s - %s VIA' % (start, end)) + orders['-%d' % nb_fleets].add('A %s - %s VIA' % (end, start)) + for fleet_loc in fleets: + orders['C%d' % nb_fleets].add('F %s C A %s - %s' % (fleet_loc, start, end)) + orders['C%d' % nb_fleets].add('F %s C A %s - %s' % (fleet_loc, end, start)) + + # Support Move (Non-Convoyed) + for start_loc in locs: + for dest_loc in [loc.upper() for loc in map_object.abut_list(start_loc, incl_no_coast=True)]: + for support_loc in (map_object.abut_list(dest_loc, incl_no_coast=True) + + map_object.abut_list(dest_loc[:3], incl_no_coast=True)): + support_loc = support_loc.upper() + + # A unit cannot support itself + if support_loc[:3] == start_loc[:3]: + continue + + # Making sure the src unit can move to dest + # and the support unit can also support to dest + for src_unit_type in ['A', 'F']: + for support_unit_type in ['A', 'F']: + if (map_object.abuts(src_unit_type, start_loc, '-', dest_loc) + and map_object.abuts(support_unit_type, support_loc, 'S', dest_loc[:3]) + and map_object.is_valid_unit('%s %s' % (src_unit_type, start_loc)) + and map_object.is_valid_unit('%s %s' % (support_unit_type, support_loc))): + orders['S-'].add('%s %s S %s %s - %s' % + (support_unit_type, support_loc, src_unit_type, start_loc, dest_loc[:3])) + + # Support Move (Convoyed) + for nb_fleets in map_object.convoy_paths: + + # Skipping long-term convoys + if nb_fleets > 4: + continue + + for start_loc, fleets, ends in map_object.convoy_paths[nb_fleets]: + for dest_loc in ends: + for support_loc in map_object.abut_list(dest_loc, incl_no_coast=True): + support_loc = support_loc.upper() + + # A unit cannot support itself + if support_loc[:3] == start_loc[:3]: + continue + + # A fleet cannot support if it convoys + if support_loc in fleets: + continue + + # Making sure the support unit can also support to dest + # And that the support unit is not convoying + for support_unit_type in ['A', 'F']: + if (map_object.abuts(support_unit_type, support_loc, 'S', dest_loc) + and map_object.is_valid_unit('%s %s' % (support_unit_type, support_loc))): + orders['S%d' % nb_fleets].add( + '%s %s S A %s - %s' % (support_unit_type, support_loc, start_loc, dest_loc[:3])) + + # Building the list of final orders + final_orders = [PAD_TOKEN, GO_TOKEN, EOS_TOKEN, DRAW_TOKEN] + final_orders += ['<%s>' % power_name for power_name in get_map_powers(map_object)] + final_orders += ['WAIVE'] + + # Sorting each category + for category in categories: + category_orders = [order for order in orders[category] if order not in final_orders] + final_orders += list(sorted(category_orders, key=lambda value: (value.split()[1], # Sorting by loc + value))) # Then alphabetically + return final_orders + +def order_to_ix(order): + """ Computes the index of an order in the order vocabulary + :param order: The order to get the index from + :return: The index of the order (None if not found) + """ + if order in ORDER_VOCABULARY_KEY_TO_IX: + return ORDER_VOCABULARY_KEY_TO_IX[order] + + # Adjustment for Supporting a move to a coast (stripping the coast) + words = order.split() + if len(words) == 7 and words[2] == 'S' and '/' in words[-1]: + words[-1] = words[-1][:3] + order = ' '.join([word for word in words]) + return ORDER_VOCABULARY_KEY_TO_IX[order] if order in ORDER_VOCABULARY_KEY_TO_IX else None + +def ix_to_order(order_ix): + """ Computes the order at a given index in the order vocabulary + :param order_ix: The index of the order to return + :return: The order at index + """ + return ORDER_VOCABULARY_IX_TO_KEY[max(0, order_ix)] + + +# Vocabulary and constants +PAD_TOKEN = '' +GO_TOKEN = '' +EOS_TOKEN = '' +DRAW_TOKEN = '' + +__VOCABULARY__ = get_vocabulary() +VOCABULARY_IX_TO_KEY = {token_ix: token for token_ix, token in enumerate(__VOCABULARY__)} +VOCABULARY_KEY_TO_IX = {token: token_ix for token_ix, token in enumerate(__VOCABULARY__)} +VOCABULARY_SIZE = len(__VOCABULARY__) +del __VOCABULARY__ + +__ORDER_VOCABULARY__ = get_order_vocabulary() +ORDER_VOCABULARY_IX_TO_KEY = {order_ix: order for order_ix, order in enumerate(__ORDER_VOCABULARY__)} +ORDER_VOCABULARY_KEY_TO_IX = {order: order_ix for order_ix, order in enumerate(__ORDER_VOCABULARY__)} +ORDER_VOCABULARY_SIZE = len(__ORDER_VOCABULARY__) +del __ORDER_VOCABULARY__ + +__POWER_VOCABULARY__ = get_power_vocabulary() +POWER_VOCABULARY_LIST = __POWER_VOCABULARY__ +POWER_VOCABULARY_IX_TO_KEY = {power_ix: power for power_ix, power in enumerate(__POWER_VOCABULARY__)} +POWER_VOCABULARY_KEY_TO_IX = {power: power_ix for power_ix, power in enumerate(__POWER_VOCABULARY__)} +POWER_VOCABULARY_SIZE = len(__POWER_VOCABULARY__) +del __POWER_VOCABULARY__ + +ORDER_FREQUENCY = get_order_frequency_table() + +PAD_ID = token_to_ix(PAD_TOKEN) +GO_ID = token_to_ix(GO_TOKEN) +EOS_ID = token_to_ix(EOS_TOKEN) +DRAW_ID = token_to_ix(DRAW_TOKEN) + +# Predefined location order +STANDARD_TOPO_LOCS = ['YOR', 'EDI', 'LON', 'LVP', 'NTH', 'WAL', 'CLY', + 'NWG', 'ENG', 'IRI', 'NAO', 'BEL', 'DEN', 'HEL', + 'HOL', 'NWY', 'SKA', 'BAR', 'BRE', 'MAO', 'PIC', + 'BUR', 'RUH', 'BAL', 'KIE', 'SWE', 'FIN', 'STP', + 'STP/NC', 'GAS', 'PAR', 'NAF', 'POR', 'SPA', 'SPA/NC', + 'SPA/SC', 'WES', 'MAR', 'MUN', 'BER', 'BOT', 'LVN', + 'PRU', 'STP/SC', 'MOS', 'TUN', 'LYO', 'TYS', 'PIE', + 'BOH', 'SIL', 'TYR', 'WAR', 'SEV', 'UKR', 'ION', + 'TUS', 'NAP', 'ROM', 'VEN', 'GAL', 'VIE', 'TRI', + 'ARM', 'BLA', 'RUM', 'ADR', 'AEG', 'ALB', 'APU', + 'EAS', 'GRE', 'BUD', 'SER', 'ANK', 'SMY', 'SYR', + 'BUL', 'BUL/EC', 'CON', 'BUL/SC'] + +# Caching alignments +ALIGNMENTS_INDEX = get_alignments_index() + +# Validating lengths to avoid accidental changes +assert VOCABULARY_SIZE == 220 +assert ORDER_VOCABULARY_SIZE == 13042 +assert POWER_VOCABULARY_SIZE == 7 diff --git a/diplomacy_research/models/tests/test_state_space.py b/diplomacy_research/models/tests/test_state_space.py new file mode 100644 index 0000000..3417ace --- /dev/null +++ b/diplomacy_research/models/tests/test_state_space.py @@ -0,0 +1,61 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Tests for State Space + - Contains the tests suite for the diplomacy_research.models.state_space object +""" +import numpy as np +from diplomacy import Game +from diplomacy_research.models import state_space + +def test_board_state(): + """ Tests the proto_to_state_space """ + game = Game() + game_map = game.map + state_proto = state_space.extract_state_proto(game) + new_game = state_space.build_game_from_state_proto(state_proto) + + # Retrieving board_state + state_proto_2 = state_space.extract_state_proto(new_game) + board_state_1 = state_space.proto_to_board_state(state_proto, game_map) + board_state_2 = state_space.proto_to_board_state(state_proto_2, game_map) + + # Checking + assert np.allclose(board_state_1, board_state_2) + assert board_state_1.shape == (state_space.NB_NODES, state_space.NB_FEATURES) + assert game.get_hash() == new_game.get_hash() + +def test_adjacency_matrix(): + """ Tests the creation of the adjacency matrix """ + adj_matrix = state_space.get_adjacency_matrix() + assert adj_matrix.shape == (state_space.NB_NODES, state_space.NB_NODES) + +def test_vocabulary(): + """ Tests accessing and converting vocabulary """ + vocabulary = state_space.get_vocabulary() + assert vocabulary + for token in vocabulary: + token_ix = state_space.token_to_ix(token) + new_token = state_space.ix_to_token(token_ix) + assert token == new_token + +def test_power_vocabulary(): + """ Tests accessing and converting power vocabulary """ + power_vocabulary = state_space.get_power_vocabulary() + assert power_vocabulary + +def test_order_frequency(): + """ Tests order frequency """ + # Not testing valid order, because moves dataset might not have been generated. + assert state_space.get_order_frequency('A ZZZ H', no_press_only=True) == 0 + assert state_space.get_order_frequency('A ZZZ H', no_press_only=False) == 0 diff --git a/diplomacy_research/models/training/__init__.py b/diplomacy_research/models/training/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/training/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/training/memory_buffer/__init__.py b/diplomacy_research/models/training/memory_buffer/__init__.py new file mode 100644 index 0000000..058b27c --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer """ +from diplomacy_research.models.training.memory_buffer.memory_buffer import MemoryBuffer diff --git a/diplomacy_research/models/training/memory_buffer/barrier.py b/diplomacy_research/models/training/memory_buffer/barrier.py new file mode 100644 index 0000000..c18aaf3 --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/barrier.py @@ -0,0 +1,149 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer - Barrier + - Class responsible for creating a sync barrier for distributed training on the memory buffer +""" +import logging +import time + +# Constants +LOGGER = logging.getLogger(__name__) +__BARRIER__ = 'barrier.%s' ## [hash] barrier. -> 0 running, 1 done, else nb_epochs +__BARRIER_LAST_CLEARED__ = 'barrier.cleared' ## [hash] barrier.cleared -> last timestamp of clear_barrier +__BARRIER_LOCK__ = 'lock.barrier' + + +def set_barrier_status(buffer, barrier_name, value): + """ Sets our status on the barrier + :param buffer: An instance of the memory buffer. + :param barrier_name: The name of the barrier. (e.g. 'train' or 'eval') + :param value: The value to set on the barrier (e.g. the number of completed epochs) + Typically, a value of 0 means started, a value of 1 means completed + but some algos (e.g. PPO) might require multiple value (one for each mini-epoch) + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + LOGGER.info('[%s] Setting barrier value to %d', barrier_name, value) + token = '%s.%06d' % (buffer.cluster_config.job_name, buffer.cluster_config.task_id) + with buffer.redis.lock(__BARRIER_LOCK__, timeout=120): + buffer.redis.hset(__BARRIER__ % barrier_name, token, value) + +def clear_barrier(buffer, barrier_name, cleared_time=None): + """ Clears the barrier and instructs all workers to continue + :param buffer: An instance of the memory buffer. + :param barrier_name: The name of the barrier. (e.g. 'train' or 'eval') + :param cleared_time: Optional. The time the barrier was cleared (time.time()) + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + if not buffer.cluster_config.is_chief: + return + with buffer.redis.lock(__BARRIER_LOCK__, timeout=120): + cleared_time = cleared_time if cleared_time is not None else int(time.time()) + buffer.redis.delete(__BARRIER__ % barrier_name) + buffer.redis.hset(__BARRIER_LAST_CLEARED__, barrier_name, cleared_time) + LOGGER.info('[%s] Barrier has been cleared at %d', barrier_name, cleared_time) + +def wait_for_barrier(buffer, barrier_name, job_name=None, min_value=1, min_done=1): + """ Waits until the barrier is cleared (or the wait condition is met). + :param buffer: An instance of the memory buffer. + :param barrier_name: The name of the barrier. (e.g. 'train' or 'eval') + :param job_name: If set, only looks at workers performing the specific job (e.g. 'learner', 'actor') + :param min_value: The min value required for the worker to be considered done. + :param min_done: The min number of done worker to stop waiting for the barrier. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + + i.e. if job_name is not set, we wait until clear_barrier() is called. + otherwise, we wait until 1) there are no more pending workers, and + 2) min_done workers of type 'job_name' have set a value of at least min_value. + """ + LOGGER.info('Waiting for barrier [%s] - Job name: %s - Value >= %d - Min done: %d', + barrier_name, job_name, min_value, min_done) + + # Finding the last time that particular barrier was cleared + # If we detect that the timestamp increases, we can assume the barrier was cleared and then recreated. + last_cleared = int(buffer.redis.hget(__BARRIER_LAST_CLEARED__, barrier_name) or time.time()) + last_status = time.time() + + while True: + print_status = False + if time.time() > (last_status + 30): + print_status = True + last_status = time.time() + if can_proceed_through_barrier(buffer, barrier_name, job_name, min_value, min_done, last_cleared, print_status): + break + time.sleep(1.) + LOGGER.info('Done waiting for barrier [%s]. Job name: %s', barrier_name, job_name) + +def can_proceed_through_barrier(buffer, barrier_name, job_name=None, min_value=1, min_done=1, last_cleared=0, + print_status=False): + """ Indicates if the barrier is cleared (or the wait condition is met). + :param buffer: An instance of the memory buffer. + :param barrier_name: The name of the barrier. (e.g. 'train' or 'eval') + :param job_name: If set, only looks at workers performing the specific job (e.g. 'learner', 'actor') + :param min_value: The min value required for the worker to be considered done. + :param min_done: The min number of done worker to stop waiting for the barrier. + :param last_cleared: Optional. The last known timestamp when the barrier was cleared + :param print_status: Boolean that indicates to print the status of the barrier. + :return: A boolean indicating if we can proceed through the barrier + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + + i.e. if job_name is not set, we must wait until clear_barrier() is called before we can proceed. + otherwise, we wait until 1) there are no more pending workers, and + 2) min_done workers of type 'job_name' have set a value of at least min_value. + before proceeding. + """ + nb_done, nb_pending = workers_on_barrier(buffer, barrier_name, job_name, min_value, print_status) + if job_name is not None and (nb_pending + nb_done) > 0 and nb_done >= min_done: + LOGGER.info('[OK] Barrier: %s - Job: %s - Pending: %d - Done: %d - Minimum: %d', + barrier_name, job_name, nb_pending, nb_done, min_done) + return True + if job_name is None and not buffer.redis.exists(__BARRIER__ % barrier_name): + LOGGER.info('[OK] Barrier: %s - Job: None - Barrier has been cleared', barrier_name) + return True + + # Checking if the barrier was last cleared after the last known last_cleared + # This might indicate that the barrier was cleared and then recreated. + if last_cleared > 0: + new_last_cleared = int(buffer.redis.hget(__BARRIER_LAST_CLEARED__, barrier_name) or 0) + if new_last_cleared > last_cleared: + LOGGER.info('[OK] Barrier: %s - Last Cleared: %s - Cleared at: %s', + barrier_name, last_cleared, new_last_cleared) + return True + + # Otherwise, we still need to wait + return False + +def workers_on_barrier(buffer, barrier_name, job_name=None, min_value=1, print_status=False): + """ Returns the number of completed and incomplete workers on the barrier + :param buffer: An instance of the memory buffer. + :param barrier_name: The name of the barrier. (e.g. 'train' or 'eval') + :param job_name: If set, only looks at workers performing the specific job (e.g. 'learner', 'actor') + :param min_value: The min value required for the worker to be considered done. + :param print_status: Boolean that indicates to print the list of workers on the barrier. + :return: A tuple with 1) the number of completed workers (waiting for barrier), + 2) the number of incomplete workers (still working) + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + done, pending = [], [] + key_values = {key.decode('utf-8'): value.decode('utf-8') + for key, value in buffer.redis.hgetall(__BARRIER__ % barrier_name).items()} + for key, value in key_values.items(): + if job_name is None or job_name in key: + if int(value) >= min_value: + done += [key] + else: + pending += [key] + if print_status: + LOGGER.info('[Status] Barrier: %s - Done (%d): %s - Pending (%d): %s', + barrier_name, len(done), done, len(pending), pending) + return len(done), len(pending) diff --git a/diplomacy_research/models/training/memory_buffer/expert_games.py b/diplomacy_research/models/training/memory_buffer/expert_games.py new file mode 100644 index 0000000..e9b2823 --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/expert_games.py @@ -0,0 +1,198 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer - Expert Games + - Class responsible for creating interacting with expert games on the memory buffer +""" +import logging +import os +import pickle +import h5py +from numpy.random import choice, randint +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import zlib_to_proto +from diplomacy_research.settings import DATASET_PATH, DATASET_INDEX_PATH + +# Constants +LOGGER = logging.getLogger(__name__) +__EXPERT_GAME__ = 'expert.%s' ## [key] expert.{game_id} -> saved_game_zlib +__SET_EXPERT_GAMES__ = 'set.expert.games' ## [set] set.expert.games -> set of game_id for expert games + + +def list_expert_games(buffer): + """ Returns a set with the game ids of all expert games in the memory buffer + :param buffer: An instance of the memory buffer. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + return {item.decode('utf-8') for item in buffer.redis.smembers(__SET_EXPERT_GAMES__)} + +def load_expert_games(buffer): + """ Load expert games in the memory buffer + :param buffer: An instance of the memory buffer. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + if buffer.cluster_config and not buffer.cluster_config.is_chief: + return + + # Making sure the dataset index exists on disk + if not os.path.exists(DATASET_INDEX_PATH): + if buffer.hparams['start_strategy'] != 'beginning': + raise RuntimeError('The dataset index path is required for %s' % buffer.hparams['start_strategy']) + LOGGER.warning('Unable to find the dataset index on disk at %s. Skipping', DATASET_INDEX_PATH) + return + + # Build the list of games in the expert dataset + expert_game_ids = set() + with open(DATASET_INDEX_PATH, 'rb') as dataset_index: + dataset_index = pickle.load(dataset_index) + expert_dataset = buffer.hparams['expert_dataset'].split(',') + + # Listing all games in dataset + for dataset_name in expert_dataset: + if dataset_name == 'no_press': + expert_game_ids |= dataset_index.get('standard_no_press', set()) + elif dataset_name == 'press': + expert_game_ids |= dataset_index.get('standard_press_with_msgs', set()) + expert_game_ids |= dataset_index.get('standard_press_without_msgs', set()) + expert_game_ids |= dataset_index.get('standard_public_press', set()) + else: + LOGGER.warning('Unknown expert dataset "%s". Expected "press", or "no_press".', dataset_name) + + # Listing all games in the memory buffer, and computing difference + memory_game_ids = list_expert_games(buffer) + missing_game_ids = list(expert_game_ids - memory_game_ids) + extra_game_ids = list(memory_game_ids - expert_game_ids) + + # Storing missing games + if missing_game_ids: + LOGGER.info('Loading %d expert games in the memory buffer.', len(missing_game_ids)) + nb_games_remaining = len(missing_game_ids) + game_ids, saved_games_zlib = [], [] + with h5py.File(DATASET_PATH) as dataset: + for game_id in missing_game_ids: + game_ids += [game_id] + saved_games_zlib += [dataset[game_id].value.tostring()] + + # Saving mini-batches of 100 games + if len(game_ids) >= 100: + save_expert_games(buffer, saved_games_zlib, game_ids) + nb_games_remaining -= len(game_ids) + game_ids, saved_games_zlib = [], [] + LOGGER.info('%d games still needing to be saved in the memory buffer.', nb_games_remaining) + + # Done transferring all games + save_expert_games(buffer, saved_games_zlib, game_ids) + + # Removing extra games + if extra_game_ids: + LOGGER.info('Removing %d extra expert games from the memory buffer', len(extra_game_ids)) + delete_expert_games(buffer, expert_game_ids) + + # Done + if missing_game_ids or expert_game_ids: + buffer.save() + LOGGER.info('Done saving all %d expert games in the memory buffer.', len(expert_game_ids)) + +def save_expert_games(buffer, saved_games_zlib, game_ids): + """ Stores a series of expert games in compressed saved game proto format + :param buffer: An instance of the memory buffer. + :param saved_games_zlib: List of compressed saved game proto + :param game_ids: List of game ids (same length as list_saved_game_zlib) + :return: Nothing + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + if not game_ids: + LOGGER.warning('Trying to save expert games, but no expert games provided. Skipping.') + return + pipeline = buffer.redis.pipeline() + for game_id, saved_game_zlib in zip(game_ids, saved_games_zlib): + pipeline.set(__EXPERT_GAME__ % game_id, saved_game_zlib, nx=True) # Saving game + pipeline.sadd(__SET_EXPERT_GAMES__, *game_ids) # Adding expert games to set + pipeline.execute() + +def delete_expert_games(buffer, game_ids): + """ Deletes a series of expert games from the memory buffer + :param buffer: An instance of the memory buffer. + :param game_ids: List of game ids to delete + :return: Nothing + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + if not game_ids: + LOGGER.warning('Trying to delete expert games, but no expert games provided. Skipping.') + return + pipeline = buffer.redis.pipeline() + pipeline.delete(*[__EXPERT_GAME__ % game_id for game_id in game_ids]) + pipeline.srem(__SET_EXPERT_GAMES__, *game_ids) + pipeline.execute() + +def get_uniform_initial_states(buffer, nb_states): + """ Returns a list of random states from the expert games + :param buffer: An instance of the memory buffer. + :param nb_states: The number of random states we want. + :return: A list of state_proto to use as the initial state of a game + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + game_ids = [game_id.decode('utf-8') + for game_id in buffer.redis.srandmember(__SET_EXPERT_GAMES__, -1 * nb_states)] # With replacement + saved_games_zlib = buffer.redis.mget([__EXPERT_GAME__ % game_id for game_id in game_ids]) + saved_games_proto = [zlib_to_proto(saved_game_zlib, SavedGameProto) for saved_game_zlib in saved_games_zlib + if saved_game_zlib is not None] + + # No games found + if not saved_games_proto: + raise RuntimeError('Unable to retrieve random states from the memory buffer.') + + # Sampling random states + random_states = [] + while len(random_states) < nb_states: + saved_game_proto = saved_games_proto[choice(len(saved_games_proto))] + random_states += [saved_game_proto.phases[choice(len(saved_game_proto.phases))].state] + return random_states + +def get_backplay_initial_states(buffer, winning_power_names, version_id): + """ Return a list of backplay states from the expert games + :param buffer: An instance of the memory buffer. + :param winning_power_names: A list of the power_name winning the game (e.g. ['AUSTRIA', 'FRANCE', ...]) + :param version_id: Integer. The current version id + :return: A list of state_proto (1 per power) to use as the initial state of a game + """ + buffer.initialize() # To make sure we have a list of won game ids. + version_id = max(0, version_id) + selected_states = {} + + # Sampling a certain nb of games for each power + for power_name in set(winning_power_names): + nb_games = len([1 for pow_name in winning_power_names if pow_name == power_name]) + nb_won_games = len(buffer.won_game_ids[power_name]) + game_ids = [buffer.won_game_ids[power_name][choice(nb_won_games)] for _ in range(nb_games)] + saved_games_zlib = buffer.redis.mget([__EXPERT_GAME__ % game_id for game_id in game_ids]) + saved_games_proto = [zlib_to_proto(saved_game_zlib, SavedGameProto) for saved_game_zlib in saved_games_zlib + if saved_game_zlib is not None] + + # No games found + if not saved_games_proto: + raise RuntimeError('Unable to retrieve expert states from the memory buffer for %s.' % power_name) + + # Selecting states + selected_states[power_name] = [] + while len(selected_states[power_name]) < nb_games: + saved_game_proto = saved_games_proto[choice(len(saved_games_proto))] + min_phase_ix = max(0, len(saved_game_proto.phases) - 5 - version_id // 3) + max_phase_ix = len(saved_game_proto.phases) + selected_states[power_name] += [saved_game_proto.phases[randint(min_phase_ix, max_phase_ix)].state] + + # Re-ordering + backplay_states = [] + for power_name in winning_power_names: + backplay_states += [selected_states[power_name].pop(0)] + return backplay_states diff --git a/diplomacy_research/models/training/memory_buffer/general_ops.py b/diplomacy_research/models/training/memory_buffer/general_ops.py new file mode 100644 index 0000000..52a7c79 --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/general_ops.py @@ -0,0 +1,42 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer - General Ops + - Class responsible for performing general operations (e.g. get/set keys) +""" +import logging + +# Constants +LOGGER = logging.getLogger(__name__) +__VERSION_ID__ = 'version.id' +__LOCK_VERSION_ID__ = 'lock.version.id' + + +# ------------ Version Id ------------ +def set_version_id(buffer, new_version_id): + """ Sets the current version id + :param buffer: An instance of the memory buffer. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + with buffer.redis.lock(__LOCK_VERSION_ID__, timeout=120): + buffer.redis.set(__VERSION_ID__, int(new_version_id)) + +def get_version_id(buffer): + """ Returns the current version id + :param buffer: An instance of the memory buffer. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + version_id = buffer.redis.get(__VERSION_ID__) + if version_id is None: + return 0 + return int(version_id) diff --git a/diplomacy_research/models/training/memory_buffer/memory_buffer.py b/diplomacy_research/models/training/memory_buffer/memory_buffer.py new file mode 100644 index 0000000..51dcd8a --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/memory_buffer.py @@ -0,0 +1,215 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer + - Contains the class for interacting with a Redis server that holds completed games and experience replay +""" +from collections import OrderedDict +import logging +import os +import pickle +from threading import Thread +import time +import redis +from redis.exceptions import BusyLoadingError, ResponseError +from diplomacy_research.models.training.memory_buffer.barrier import __BARRIER__ +from diplomacy_research.models.state_space import ALL_POWERS +from diplomacy_research.utils.process import is_redis_running, start_redis, kill_subprocesses_on_exit +from diplomacy_research.settings import END_SCS_DATASET_PATH, REDIS_DATASET_PATH + +# Constants +LOGGER = logging.getLogger(__name__) +__READY_KEY__ = 'cluster.ready' +__LOCK_READY__ = 'lock.ready' + + +def start_redis_server(trainer, import_db=True): + """ Starts the redis server + :param trainer: A reinforcement learning trainer instance. + :param import_db: Optional. Boolean that indicates to import the pre-loaded game database + """ + import_db_path = None if not import_db else REDIS_DATASET_PATH + + # In distributed mode, we launch in the current process + if trainer.cluster_config: + start_redis(trainer.flags.save_dir, import_db_path=import_db_path) + kill_subprocesses_on_exit() + return + + # Otherwise, we launch in a separate (non-blocking) thread + redis_thread = Thread(target=start_redis, + kwargs={'save_dir': trainer.flags.save_dir, + 'log_file_path': os.path.join(trainer.flags.save_dir, 'redis.log'), + 'import_db_path': import_db_path}) + redis_thread.start() + kill_subprocesses_on_exit() + +class MemoryBuffer(): + """ A simple buffer just used for storing games and experience replay """ + + def __init__(self, cluster_config=None, hparams=None): + """ Constructor + :param cluster_config: The cluster configuration to use to retrieve the server's address. + :param hparams: The hyper-parameters used by the current model. + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + if cluster_config and not cluster_config.count('redis'): + LOGGER.error('Unable to detect Redis server address. Make sure the Redis task is specified in the config.') + raise RuntimeError('Unable to detect Redis address.') + + self.cluster_config = cluster_config + self.hparams = hparams or {} + self.partition_cache = OrderedDict() # (nb_samples, nb_transitions): partition + self.redis = None + self.won_game_ids = {power_name: [] for power_name in ALL_POWERS} + self.initialized = False + + # Storing settings + # min_items: Min nb of items required in the buffer before sampling for experience replay + # max_items: Max nb of items in the buffer. Trimmed in FIFO manner if exceeded. + # alpha: Alpha coefficient to use to compute buckets for sampling. + self.min_items = self.hparams.get('min_buffer_items', 10000) + self.max_items = self.hparams.get('max_buffer_items', 2000000) + self.alpha = self.hparams.get('replay_alpha', 0.7) + self.use_experience_replay = self.hparams.get('experience_replay', 0.) > 0 + + # Connecting to server + self.connect() + + def connect(self): + """ Connects to the Redis server and waits for the database to be ready """ + redis_ip = 'localhost' if not self.cluster_config else self.cluster_config.cluster_spec['redis'][0] + redis_ip = redis_ip.split(':')[0] + + # Making sure redis is running + # Trying to connect every 1 secs for 5 mins + for retry_ix in range(300): + if is_redis_running(redis_ip): + break + if (retry_ix + 1) % 10 == 0: + LOGGER.warning('Redis is not running on %s. Attempt %d / %d', redis_ip, retry_ix + 1, 300) + time.sleep(1) + else: + raise RuntimeError('Redis server is not running. Aborting.') + LOGGER.info('Successfully connected to Redis server.') + + # Creating connection + self.redis = redis.Redis(host=redis_ip, socket_keepalive=True, decode_responses=False, retry_on_timeout=True) + + # Waiting until redis is ready (i.e. done loading database) + for retry_ix in range(120): + try: + info = self.redis.info(section='persistence') + if not info.get('loading', 1): + break + except BusyLoadingError: + continue + if (retry_ix + 1) % 10 == 0: + LOGGER.info('Waiting for redis to finish loading... %d / %d', retry_ix + 1, 120) + time.sleep(1) + else: + LOGGER.error('Redis is still loading after timeout reached. Aborting.') + raise BusyLoadingError('Redis is loading dataset in memory.') + LOGGER.info('Redis has done loading the dataset from disk and is ready.') + + def initialize(self): + """ Performs initialization tasks (i.e. get list of won game ids from disk) """ + if self.initialized: + return + self.initialized = True + + if not os.path.exists(END_SCS_DATASET_PATH): + if self.hparams['start_strategy'] == 'backplay': + raise RuntimeError('Unable to load the nb of supply centers. Required for "backplay". Aborting.') + LOGGER.warning('Unable to load the nb of supply centers from %s. - File not found', END_SCS_DATASET_PATH) + return + + # Loading nb of scs at end of game + with open(END_SCS_DATASET_PATH, 'rb') as end_scs_dataset: + end_scs_dataset = pickle.load(end_scs_dataset) + + # Finding games where each power won + expert_dataset = self.hparams['expert_dataset'].split(',') + for dataset_name in expert_dataset: + for power_name in ALL_POWERS: + if dataset_name == 'no_press': + self.won_game_ids[power_name] += end_scs_dataset['no_press'][power_name][16] + self.won_game_ids[power_name] += end_scs_dataset['no_press'][power_name][17] + self.won_game_ids[power_name] += end_scs_dataset['no_press'][power_name][18] + if dataset_name == 'press': + self.won_game_ids[power_name] += end_scs_dataset['press'][power_name][16] + self.won_game_ids[power_name] += end_scs_dataset['press'][power_name][17] + self.won_game_ids[power_name] += end_scs_dataset['press'][power_name][18] + + @property + def lock(self): + """ Returns the Redis lock """ + return self.redis.lock + + def mark_as_ready(self): + """ Called by the chief to indicate that the cluster is ready to start """ + if not self.cluster_config: + return + if not self.cluster_config.is_chief: + LOGGER.warning('Only the chief can mark the cluster as ready.') + return + + # Marking the cluster as ready + timestamp = int(time.time()) + with self.redis.lock(__LOCK_READY__, timeout=120): + barrier_keys = self.redis.keys(__BARRIER__ % '*') + if barrier_keys: + self.redis.delete(*barrier_keys) + self.redis.set(__READY_KEY__, timestamp, ex=180) # Opening a 3 min window where cluster can start + LOGGER.info('[Chief] The cluster has been marked as ready.') + + def wait_until_ready(self, timeout=3600): + """ Waits until the chief has indicated that the cluster is ready to start """ + # Chief never waits + if not self.cluster_config or self.cluster_config.is_chief: + return + + for retry_ix in range(timeout): + time.sleep(1) + timestamp = int(time.time()) + ready_key_value = self.redis.get(__READY_KEY__) + + # We have a ready key set within the 3 min window + if ready_key_value is not None and abs(timestamp - int(ready_key_value)) <= 180: + break + + # Otherwise, waiting for the ready key to be set. + if retry_ix % 10 == 0: + LOGGER.info('Waiting for chief to mark the cluster as ready... %d / %d', retry_ix, timeout) + else: + LOGGER.error('Waited %d seconds for cluster to be ready. Is the chief online?', timeout) + raise RuntimeError('Cluster was never marked as ready.') + LOGGER.info('Cluster was marked as ready by chief. Continuing.') + + def save(self, sync=False): + """ Saves the buffer to disk """ + try: + if sync: + self.redis.save() + else: + self.redis.bgsave() + except ResponseError: # Save already in progress. + pass + + def clear(self): + """ Deletes the entire memory buffer """ + self.redis.flushall() + + def shutdown(self): + """ Shutdown the redis server """ + self.redis.shutdown() diff --git a/diplomacy_research/models/training/memory_buffer/online_games.py b/diplomacy_research/models/training/memory_buffer/online_games.py new file mode 100644 index 0000000..b7e58c8 --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/online_games.py @@ -0,0 +1,178 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer - Online Games + - Class responsible for saving and handling completed (online) games and partial games played by the RL agents +""" +import logging +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import zlib_to_proto, proto_to_zlib, bytes_to_proto + +# Constants +LOGGER = logging.getLogger(__name__) +__ONLINE_GAME__ = 'games.%s' ## [key] games.{game_id} -> saved_game_zlib +__PARTIAL_GAME__ = 'games.partial.%s' ## [key] games.{game_id}/{last} -> saved_game_zlib +__SET_ONLINE_GAMES__ = 'set.online.games' ## [set] set.online.games -> set of game_id for online games +__SET_PARTIAL_GAMES__ = 'set.partial_games' ## [set] set.partial_games -> set of {game_id}.{last_phase} +__ALL_GAMES__ = 'saved.games' ## [zset] saved.games -> {game_id}/{nb_items}: ts +__PARTIAL_GAME_ID__ = '%s/%s' ## {game_id}/{last_phase} + + +def list_games(buffer, all_games=False, excluding=None, with_completed=True, with_partial=True): + """ Retrieves the list of saved games id that are assigned to this shard + :param buffer: An instance of the memory buffer. + :param all_games: Boolean that indicates we want to return the games for all shards. + :param excluding: Optional. A list of game ids to exclude (e.g. because they already have been retrieved) + :param with_completed: Boolean that indicates we want to include completed games. + :param with_partial: Boolean that indicates we want to include partial games. + :return: A list of game ids matching the specified criteria. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + num_shards, shard_index = 1, 0 + if not all_games and buffer.cluster_config: + assert buffer.cluster_config.job_name == 'learner', 'list_games() should only be used by a learner.' + num_shards = buffer.cluster_config.num_shards + shard_index = buffer.cluster_config.shard_index + + # Retrieving the games proto for the current shard + all_game_ids = [] + if with_completed: + all_game_ids += [game_id.decode('utf-8') for game_id in buffer.redis.smembers(__SET_ONLINE_GAMES__)] + if with_partial: + all_game_ids += [game_id.decode('utf-8') for game_id in buffer.redis.smembers(__SET_PARTIAL_GAMES__)] + excluding = excluding or [] + shard_game_ids = [game_id for game_id in all_game_ids + if hash(game_id) % num_shards == shard_index and game_id not in excluding] + return shard_game_ids + +def save_games(buffer, saved_games_proto=None, saved_games_bytes=None): + """ Stores a series of games in compressed saved game proto format + :param buffer: An instance of the memory buffer. + :param saved_games_bytes: List of saved game (bytes format) (either completed or partial) + :param saved_games_proto: List of saved game proto (either completed or partial) + :return: Nothing + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + assert bool(saved_games_bytes is None) != bool(saved_games_proto is None), 'Expected one of bytes or proto' + saved_games_bytes = saved_games_bytes or [] + saved_games_proto = saved_games_proto or [] + + if saved_games_bytes: + saved_games_proto = [bytes_to_proto(game_bytes, SavedGameProto) for game_bytes in saved_games_bytes] + + # Splitting between completed game ids and partial game ids + completed, partial = [], [] + for saved_game_proto in saved_games_proto: + if not saved_game_proto.is_partial_game: + completed += [saved_game_proto] + else: + partial += [saved_game_proto] + + # No games + if not completed and not partial: + LOGGER.warning('Trying to save saved_games_proto, but no games provided. Skipping.') + return + + # Compressing games + completed_games_zlib = [proto_to_zlib(saved_game_proto) for saved_game_proto in completed] + completed_game_ids = [saved_game_proto.id for saved_game_proto in completed] + + partial_games_zlib = [proto_to_zlib(saved_game_proto) for saved_game_proto in partial] + partial_game_ids = [__PARTIAL_GAME_ID__ % (saved_game_proto.id, saved_game_proto.phases[-1].name) + for saved_game_proto in partial] + + # Saving games + pipeline = buffer.redis.pipeline() + if completed_game_ids: + for game_id, saved_game_zlib in zip(completed_game_ids, completed_games_zlib): + pipeline.set(__ONLINE_GAME__ % game_id, saved_game_zlib) + pipeline.sadd(__SET_ONLINE_GAMES__, *completed_game_ids) + + if partial_game_ids: + for game_id, saved_game_zlib in zip(partial_game_ids, partial_games_zlib): + pipeline.set(__PARTIAL_GAME__ % game_id, saved_game_zlib) + pipeline.sadd(__SET_PARTIAL_GAMES__, *partial_game_ids) + + # Executing + pipeline.execute() + +def get_online_games(buffer, all_games=False, excluding=None, with_completed=True, with_partial=True): + """ Retrieves the saved games proto that are assigned to this shard. + :param buffer: An instance of the memory buffer. + :param all_games: Boolean that indicates we want to return the games for all shards. + :param excluding: Optional. A list of game ids to exclude (e.g. because they already have been retrieved) + :param with_completed: Boolean that indicates we want to include completed games. + :param with_partial: Boolean that indicates we want to include partial games. + :return: Tuple of: + 1) List of saved games proto + 2) List of game ids + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + shard_game_ids = list_games(buffer, + all_games=all_games, + excluding=excluding, + with_completed=with_completed, + with_partial=with_partial) + if not shard_game_ids: + return [], [] + + # Splitting between partial and completed games + completed_game_ids = [game_id for game_id in shard_game_ids if '/' not in game_id] + partial_game_ids = [game_id for game_id in shard_game_ids if '/' in game_id] + + # Retrieving the games + saved_games_proto = [] + if completed_game_ids: + completed_game_zlibs = buffer.redis.mget([__ONLINE_GAME__ % game_id for game_id in completed_game_ids]) + saved_games_proto += [zlib_to_proto(saved_game_zlib, SavedGameProto) + for saved_game_zlib in completed_game_zlibs if saved_game_zlib is not None] + if partial_game_ids: + partial_game_zlibs = buffer.redis.mget([__PARTIAL_GAME__ % game_id for game_id in partial_game_ids]) + saved_games_proto += [zlib_to_proto(saved_game_zlib, SavedGameProto) + for saved_game_zlib in partial_game_zlibs if saved_game_zlib is not None] + + # Returning + return saved_games_proto, completed_game_ids + partial_game_ids + +def mark_games_as_processed(buffer, game_ids): + """ Mark the games as processed, so they don't appear in the list of online games anymore + :param buffer: An instance of the memory buffer. + :param game_ids: List of game ids to mark as processed. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + if not game_ids: + LOGGER.warning('Trying to mark 0 games as processed. Skipping.') + return + + # Splitting between completed and partial game ids + completed_game_ids = [game_id for game_id in game_ids if '/' not in game_id] + partial_game_ids = [game_id for game_id in game_ids if '/' in game_id] + + # Deleting games + pipeline = buffer.redis.pipeline() + if completed_game_ids: + pipeline.srem(__SET_ONLINE_GAMES__, *completed_game_ids) + + if partial_game_ids: + pipeline.srem(__SET_PARTIAL_GAMES__, *partial_game_ids) + pipeline.delete(*[__PARTIAL_GAME__ % game_id for game_id in partial_game_ids]) + + # No experience replay so we can delete the games + # Otherwise, we just delete them from the set + if not buffer.use_experience_replay and completed_game_ids: + pipeline.delete(*[__ONLINE_GAME__ % game_id for game_id in completed_game_ids]) + + # Executing + pipeline.execute() + LOGGER.info('%d completed and %d partial games have been marked as processed', + len(completed_game_ids), len(partial_game_ids)) diff --git a/diplomacy_research/models/training/memory_buffer/priority_replay.py b/diplomacy_research/models/training/memory_buffer/priority_replay.py new file mode 100644 index 0000000..2b9e00a --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/priority_replay.py @@ -0,0 +1,213 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer - Priority Replay + - Class responsible for creating storing and retrieving replay samples with priorities in the memory buffer +""" +import logging +import time +import numpy as np +from numpy.random import randint +from diplomacy_research.models.self_play.transition import ReplaySample +from diplomacy_research.models.training.memory_buffer.online_games import __ONLINE_GAME__, __ALL_GAMES__ +from diplomacy_research.models.state_space import ALL_POWERS +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.proto import zlib_to_proto + +# Constants +LOGGER = logging.getLogger(__name__) +__GAME_NB_ITEMS__ = '%s/%d' ## {game_id}/nb_items +__PRIORITY__ = 'saved.priority' ## [zset] saved.priority -> {game_id}.{pow}.{phase_ix}: abs(td) +__PRIORITY_ITEM_ID__ = '%s.%s.%03d' ## {game_id}.{power_name}.phase_ix + + +def get_replay_samples(buffer, nb_samples): + """ Samples a series of replay samples from the memory buffer. + The buffer must have at least min_items, otherwise no samples are returned + + :param buffer: An instance of the memory buffer. + :param nb_samples: The number of items to sample from the buffer. + :return: A list of ReplaySamples + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + :rtype: [ReplaySample] + """ + partitions = get_partitions(buffer, nb_samples) + + # The buffer is not full enough, skipping. + if not partitions or not nb_samples: + return [] + + # Sampling and retrieving the priority ids + ranks = [randint(start_rank, max(start_rank + 1, end_rank)) for (start_rank, end_rank) in partitions] + pipeline = buffer.redis.pipeline() + for rank in ranks: + pipeline.zrange(__PRIORITY__, start=rank, end=rank) + priority_ids = [zrange_result[0] for zrange_result in pipeline.execute()] + + # Extracting a dictionary of {power_name: [phases_ix]} for each game + power_phases_ix_per_game = {} + for priority_id in priority_ids: # Format: {game_id.power_name.phase_ix} + game_id, power_name, phase_ix = priority_id.split('.') + phase_ix = int(phase_ix) + if game_id not in power_phases_ix_per_game: + power_phases_ix_per_game[game_id] = {} + if power_name not in power_phases_ix_per_game[game_id]: + power_phases_ix_per_game[game_id][power_name] = [] + power_phases_ix_per_game[game_id][power_name] += [phase_ix] + + # Retrieving all saved games zlib + game_ids = list(power_phases_ix_per_game.keys()) + saved_games_zlib = buffer.redis.mget([__ONLINE_GAME__ % game_id for game_id in game_ids]) + saved_games_proto = [zlib_to_proto(saved_game_zlib, SavedGameProto) for saved_game_zlib in saved_games_zlib] + + # Building replay samples + replay_samples, nb_replay_samples = [], 0 + for game_id, saved_game_proto in zip(game_ids, saved_games_proto): + replay_samples += [ReplaySample(saved_game_proto=saved_game_proto, + power_phases_ix=power_phases_ix_per_game[game_id])] + for power_name in power_phases_ix_per_game[game_id]: + nb_replay_samples += len(power_phases_ix_per_game[game_id][power_name]) + + # Returning + LOGGER.info('Sampled %d items from the memory buffer (Target: %d).', nb_replay_samples, nb_samples) + return replay_samples + +def update_priorities(buffer, new_priorities, first_update=False): + """ Update the priorities of transitions + :param buffer: An instance of the memory buffer. + :param new_priorities: List of priorities + :param first_update: Boolean that indicates that the priorities are being added for the first time. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + :type new_priorities: [diplomacy_research.models.self_play.transition.ReplayPriority] + """ + if not new_priorities: + LOGGER.warning('Trying to update priorities, but no priorities provided. Skipping.') + return + + keys_per_game = {} # {game_id: [keys]} + priorities = [] + + # Converting the new priorities + for priority in new_priorities: + priority_key = __PRIORITY_ITEM_ID__ % (priority.game_id, priority.power_name, priority.phase_ix) + priorities += [(priority_key, priority.priority)] + if first_update: + if priority.game_id not in keys_per_game: + keys_per_game[priority.game_id] = [] + keys_per_game[priority.game_id] += [priority_key] + + # Building pipeline + pipeline = buffer.redis.pipeline() + buffer.redis.zadd(__PRIORITY__, **dict(priorities)) + for game_id in keys_per_game: + pipeline.zadd(__ALL_GAMES__, + __GAME_NB_ITEMS__ % (game_id, len(keys_per_game[game_id])), + time.time()) + LOGGER.info('%s the priorities of %d samples in the memory buffer.', + 'Added' if first_update else 'Updated', len(new_priorities)) + pipeline.execute() + +def trim_buffer(buffer): + """ Trim the buffer so that it does not exceed the maximum number of items allowed. + :param buffer: An instance of the memory buffer. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + nb_items = buffer.redis.zcard(__PRIORITY__) + if nb_items < buffer.max_items: + return + + # Retrieving a list of games to possible remove + # Deciding how many games to remove + # Executing the pipeline + while nb_items > buffer.max_items: + list_game_ids = buffer.redis.zrange(__ALL_GAMES__, 0, 99) # 100 games ids ({game_id}/{nb_items}) + + # No game ids found - Error + if not list_game_ids: + LOGGER.error('Unable to trim the buffer - The list of games is empty.') + break + + # Creating pipeline + nb_excess_transitions = nb_items - buffer.max_items + nb_deleted_transitions = 0 + pipeline = buffer.redis.pipeline() + for game_id_nb_items in list_game_ids: + game_id_nb_items = game_id_nb_items.decode('utf-8') + game_id, nb_game_items = game_id_nb_items.split('/') + nb_game_items = int(nb_game_items) + + # We pop the game from the buffer + if nb_excess_transitions > 0: + pipeline.delete(__ONLINE_GAME__ % game_id) + pipeline.zrem(__PRIORITY__, *[__PRIORITY_ITEM_ID__ % (game_id, power_name, item_ix) + for power_name in ALL_POWERS + for item_ix in range(nb_game_items)]) + pipeline.zrem(__ALL_GAMES__, game_id_nb_items) + nb_deleted_transitions += game_id_nb_items + nb_excess_transitions -= game_id_nb_items + + # Otherwise, we can stop + else: + break + + # Executing pipeline + pipeline.execute() + nb_items -= nb_deleted_transitions + +def get_partitions(buffer, nb_samples): + """ Compute nb_samples partitions each of probability 1. / nb_samples from the transitions in the + priority buffer. + - The number of transitions in the buffer is rounded down to the nearest 10k to cache the partitions + + :param buffer: An instance of the memory buffer. + :param nb_samples: The number of partitions to create. + :return: A list of `nb_samples` tuples, each tuple being (start_rank, end_rank) + start_rank is inclusive, but end_rank is exclusive + e.g. [ (0, 3), (3, 5), ... + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + total_transitions = buffer.redis.zcard(__PRIORITY__) + if total_transitions < buffer.min_items: + return None + + # Trying to retrieve from cache + if total_transitions > 10000: + total_transitions = 10000 * (total_transitions // 10000) # Rounding-down to the nearest 10k. + if (nb_samples, total_transitions) in buffer.partition_cache: + return buffer.partition_cache[(nb_samples, total_transitions)] + + # Otherwise, computing and storing in cache + pdf = (np.arange(1, total_transitions + 1)) ** (-buffer.alpha) + pdf /= np.sum(pdf) + cdf = np.cumsum(pdf) + + # Partition index can be obtained as the quotient of cdf / (1 / nb_parts) + assigned_partition = cdf // (1. / nb_samples) + + # Building a list of (start_rank, end_rank) + partitions = [] + last_end_rank = 0 + for partition_ix in range(nb_samples): + after_partition = assigned_partition > partition_ix + start_rank = last_end_rank + end_rank = int(np.argmax(after_partition)) if np.sum(after_partition) else total_transitions + partitions += [(start_rank, end_rank)] + last_end_rank = end_rank + + # Storing in cache + buffer.partition_cache[(nb_samples, total_transitions)] = partitions + while len(buffer.partition_cache) > 5: + del buffer.partition_cache[list(buffer.partition_cache.keys())[0]] + + # Returning + return partitions diff --git a/diplomacy_research/models/training/memory_buffer/queue.py b/diplomacy_research/models/training/memory_buffer/queue.py new file mode 100644 index 0000000..66872f3 --- /dev/null +++ b/diplomacy_research/models/training/memory_buffer/queue.py @@ -0,0 +1,59 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Memory Buffer - Queue + - Class responsible for implementing a queue interface using the memory buffer +""" +import logging + +# Constants +LOGGER = logging.getLogger(__name__) + +class DistributedQueue(): + """ Distributed queue class""" + + def __init__(self, buffer, name): + """ Constructor + :param buffer: An instance of the memory buffer. + :param name: The name of the queue. + :type buffer: diplomacy_research.models.training.memory_buffer.MemoryBuffer + """ + self.buffer = buffer + self.name = name + + def qsize(self): + """ Returns the size of the queue on the buffer """ + return self.buffer.redis.llen(self.name) + + def empty(self): + """ Returns True if the queue is empty. False otherwise. """ + return not self.qsize() + + def put(self, *values): + """ Puts an item into the queue. """ + self.buffer.redis.rpush(self.name, *values) + + def get(self, decode=True): + """ Remove and return an item from the queue """ + item = self.buffer.redis.lpop(self.name) + if isinstance(item, bytes) and decode: + item = item.decode('utf-8') + return item + + def put_nowait(self, *values): + """ Alias for put() """ + return self.put(*values) + + def get_nowait(self): + """ Alias for get() """ + return self.get() diff --git a/diplomacy_research/models/training/reinforcement/__init__.py b/diplomacy_research/models/training/reinforcement/__init__.py new file mode 100644 index 0000000..9bb3773 --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement Training """ +from .trainer import ReinforcementTrainer diff --git a/diplomacy_research/models/training/reinforcement/common.py b/diplomacy_research/models/training/reinforcement/common.py new file mode 100644 index 0000000..f2875f8 --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/common.py @@ -0,0 +1,555 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement Learning - Common Ops + - Class responsible for implementing build operations (common among standalone and distributed training) +""" +import glob +import logging +import os +import shutil +import time +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.self_play.algorithms.base_algorithm import VERSION_STEP +from diplomacy_research.models.state_space import ALL_POWERS +from diplomacy_research.models.training.memory_buffer import general_ops as buffer_gen_ops +from diplomacy_research.proto.diplomacy_proto.game_pb2 import SavedGame as SavedGameProto +from diplomacy_research.utils.checkpoint import build_saved_model +from diplomacy_research.utils.cluster import kill_processes_using_port, is_port_opened +from diplomacy_research.utils.proto import write_proto_to_file, read_next_proto + +# Constants +LOGGER = logging.getLogger(__name__) + + +def build_summaries(trainer): + """ Builds the fields required to log stats in TensorBoard + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import tf, get_placeholder + escape = lambda string: string.replace('[', '.').replace(']', '.') + evaluation_tags = [] + for power_name in ALL_POWERS + ['ALL']: + evaluation_tags += ['%s/%s' % (key, power_name) for key in + ['rew_avg', 'sc_avg', 'win_by_sc', 'most_sc', 'rank', 'nb_years']] + evaluation_tags += ['%s/%s' % (key, power_name) for key in + ['year_at_%d_sc' % nb_sc for nb_sc in range(4, 20, 2)]] + evaluation_tags += ['%s/%s' % (key, power_name) for key in + [reward_fn.name for reward_fn in trainer.eval_reward_fns]] + evaluation_tags += ['%s/%s' % (key, power_name) for key in + ['done_engine', 'done_auto_draw', 'done_thrashing', 'done_phase_limit']] + evaluation_tags += trainer.algorithm.get_evaluation_tags() + evaluation_tags += ['version/player', 'version/opponent'] + evaluation_tags += ['nb_rl_agents', 'nb_steps', 'nb_games', 'versions_per_day', 'mem_usage_mb'] + + dtypes = {'version/player': tf.int64, + 'version/opponent': tf.int64, + 'nb_steps': tf.int64, + 'nb_games': tf.int64} + + # Creating placeholders and summaries + for tag_name in evaluation_tags: + if tag_name not in trainer.placeholders: + trainer.placeholders[tag_name] = get_placeholder(escape(tag_name), + dtype=dtypes.get(tag_name, tf.float32), + shape=(), + for_summary=True) + trainer.summaries[tag_name] = tf.summary.scalar(escape(tag_name), trainer.placeholders[tag_name]) + + # Creating merge op + trainer.merge_op = tf.summary.merge(list(trainer.summaries.values())) + + # Creating writers + os.makedirs(os.path.join(trainer.flags.save_dir, 'summary'), exist_ok=True) + trainer.writers['train'] = tf.summary.FileWriter(os.path.join(trainer.flags.save_dir, 'summary', 'rl_train')) + trainer.writers['eval'] = tf.summary.FileWriter(os.path.join(trainer.flags.save_dir, 'summary', 'rl_eval')) + +def build_model_and_dataset(trainer): + """ Builds the policy, and value model and the dataset + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + trainer.queue_dataset = QueueDataset(batch_size=trainer.flags.batch_size, + dataset_builder=trainer.dataset_builder, + cluster_config=trainer.cluster_config) + + # Policy Model + trainer.model = trainer.policy_constructor(trainer.queue_dataset, trainer.hparams) + + # Value Model + if trainer.value_constructor: + trainer.model = trainer.value_constructor(trainer.model, trainer.queue_dataset, trainer.hparams) + + # Draw Model + if trainer.draw_constructor: + trainer.model = trainer.draw_constructor(trainer.model, trainer.queue_dataset, trainer.hparams) + + # Finalizing and validating + trainer.model.finalize_build() + trainer.model.validate() + + # Adding hooks + session_hook = trainer.queue_dataset.make_session_run_hook() + if session_hook is not None: + trainer.hooks += [session_hook] + +def build_train_server(trainer): + """ Builds the Tensorflow tf.train.Server + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if not trainer.cluster_config: + return + + from diplomacy_research.utils.tensorflow import tf + task_address = trainer.cluster_config.cluster_spec[trainer.cluster_config.job_name][trainer.cluster_config.task_id] + + # Making port is not used by another process + task_port = int(task_address.split(':')[1]) + LOGGER.info('Killing any processes that have port %d opened.', task_port) + kill_processes_using_port(task_port) + + # Starting server + LOGGER.info('Starting server with task id %d - Address: %s', trainer.cluster_config.task_id, task_address) + LOGGER.info('Checking if port %d is already opened: %s', task_port, str(is_port_opened(task_port))) + trainer.server = tf.train.Server(tf.train.ClusterSpec(trainer.cluster_config.cluster_spec), + job_name=trainer.cluster_config.job_name, + task_index=trainer.cluster_config.task_id, + protocol=trainer.cluster_config.protocol) + LOGGER.info('Server successfully started. Trying to contact other nodes...') + +def build_algorithm(trainer): + """ Builds the RL algorithm + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if not trainer.queue_dataset or not trainer.model: + raise RuntimeError('You must build the model and the dataset before building the RL algorithm') + trainer.algorithm = trainer.algorithm_constructor(trainer.queue_dataset, trainer.model, trainer.hparams) + +def build_config_proto(trainer): + """ Builds the session config proto + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import tf + gpu_options = tf.GPUOptions() + if trainer.flags.allow_gpu_growth: + LOGGER.info('"allow_gpu_growth" flag set. GPU memory will not be pre-allocated and will grow as needed.') + gpu_options = tf.GPUOptions(allow_growth=True) + trainer.config_proto = {'allow_soft_placement': True, 'gpu_options': gpu_options} + if trainer.cluster_config and trainer.cluster_config.job_name == 'learner': + trainer.config_proto['device_filters'] = ['/job:ps', '/job:learner'] + if trainer.flags.use_xla: + LOGGER.info('Using XLA to compile the graph.') + graph_options = tf.GraphOptions() + graph_options.optimizer_options.global_jit_level = tf.OptimizerOptions.ON_1 # pylint: disable=no-member + trainer.config_proto['graph_options'] = graph_options + +def build_restore_saver(trainer): + """ Builds the restore saver to restore from a supervised model checkpoint + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if trainer.cluster_config and not trainer.cluster_config.is_chief: + return + if os.path.exists(os.path.join(trainer.flags.save_dir, 'checkpoint')): + checkpoint_file = 'checkpoint' + elif os.path.exists(os.path.join(trainer.flags.save_dir, 'checkpoint.supervised')): + checkpoint_file = 'checkpoint.supervised' + else: + LOGGER.warning('No checkpoints were detected on disk. Unable to load weights') + return + + # Loading TensorFlow + from diplomacy_research.utils.tensorflow import tf, list_variables + + # Detecting if we have a supervised or a RL checkpoint + # Rewriting the checkpoint path to save_dir, so we can copy a supervised folder without modifying the paths. + # If 'version_step' is saved in checkpoint, we have a RL checkpoint, so we can skip this method + ckpt_path = tf.train.get_checkpoint_state(trainer.flags.save_dir, checkpoint_file).model_checkpoint_path # pylint: disable=no-member + ckpt_path = os.path.join(trainer.flags.save_dir, ckpt_path.split('/')[-1]) + if [1 for var, _ in list_variables(ckpt_path) if VERSION_STEP in var]: + return + + # Overwriting checkpoint on disk + with open(os.path.join(trainer.flags.save_dir, checkpoint_file), 'w') as file: + file.write('model_checkpoint_path: "%s"\n' % ckpt_path) + file.write('all_model_checkpoint_paths: "%s"\n' % ckpt_path) + + # Listing vars in model, and vars in checkpoint + global_vars = tf.get_collection_ref(tf.GraphKeys.GLOBAL_VARIABLES) + model_vars = {var.name: tuple(var.shape.as_list()) for var in global_vars} + ckpt_vars = {'%s:0' % var: tuple(shape) for var, shape in list_variables(ckpt_path) + if ('/gradients/' not in var + and '/Adam' not in var + and 'barrier' not in var + and 'beta1_power' not in var + and 'beta2_power' not in var)} + + # Building a set of tuples (var_name, shape) + model_vars_set = {(var_name, var_shape) for var_name, var_shape in model_vars.items()} + ckpt_vars_set = {(var_name, var_shape) for var_name, var_shape in ckpt_vars.items()} + + # Making sure all elements in graph are also in checkpoint, otherwise printing errors + if model_vars_set - ckpt_vars_set: + LOGGER.error('-' * 80) + LOGGER.error('*** Unable to restore some variables from checkpoint. ***') + LOGGER.error('') + + # Elements in graph, but not in checkpoint + for (var_name, model_shape) in sorted(model_vars_set - ckpt_vars_set): + if var_name not in ckpt_vars: + LOGGER.error('Variable "%s" (Shape: %s) is in graph, but not in checkpoint.', var_name, model_shape) + else: + LOGGER.error('Variable "%s" has shape %s in graph, and shape %s in checkpoint.', + var_name, model_shape, ckpt_vars.get(var_name)) + + # Elements in checkpoint, but not in graph + for (var_name, ckpt_shape) in sorted(ckpt_vars_set - model_vars_set): + if var_name not in model_vars: + LOGGER.error('Variable "%s" (Shape: %s) is in checkpoint, but not in graph.', var_name, ckpt_shape) + LOGGER.error('-' * 80) + + # Loading only variables common in both. (& = intersection) + common_vars = [name_shape[0] for name_shape in model_vars_set & ckpt_vars_set] + vars_to_load = [var for var in global_vars if var.name in common_vars] + trainer.restore_saver = tf.train.Saver(var_list=vars_to_load, restore_sequentially=True) + LOGGER.info('Found %d variables to load from the supervised checkpoint.', len(vars_to_load)) + + # Renaming checkpoint to make sure the RL algo doesn't also try to load it. + if checkpoint_file == 'checkpoint': + shutil.move(os.path.join(trainer.flags.save_dir, 'checkpoint'), + os.path.join(trainer.flags.save_dir, 'checkpoint.supervised')) + +def build_hooks(trainer): + """ Adds the hooks required for training + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import ReinforcementStartTrainingHook, RestoreVariableHook + trainer.chief_only_hooks += [RestoreVariableHook(trainer.restore_saver, + trainer.flags.save_dir, + 'checkpoint.supervised'), + ReinforcementStartTrainingHook(trainer)] + +def create_adapter(trainer): + """ Creates an adapter (for the learner) + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import tf + trainer.adapter = trainer.adapter_constructor(trainer.queue_dataset, graph=tf.get_default_graph()) + +def create_advantage(trainer): + """ Creates the advantage function + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + trainer.advantage_fn = \ + trainer.algorithm_constructor.create_advantage_function(trainer.hparams, + gamma=trainer.flags.gamma, + penalty_per_phase=trainer.flags.penalty_per_phase) + +def save_version_model(trainer, version_id=None, wait_for_grpc=False): + """ Builds a saved model for the given graph for inference + :param trainer: A reinforcement learning trainer instance. + :param version_id: Optional. Integer. The version id of the graph to save. Defaults to the current version. + :param wait_for_grpc: If true, waits for the target to be loaded on the localhost TF Serving before returning. + :return: Nothing + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.models.training.reinforcement.serving import wait_for_version + from diplomacy_research.utils.tensorflow import tf + + # Can only save model in standalone mode or while chief in distributed mode + if trainer.cluster_config and not trainer.cluster_config.is_chief: + return + + # Creating output directory + if version_id is None: + version_id = get_version_id(trainer) + output_dir = get_serving_directory(trainer, 'player') + os.makedirs(output_dir, exist_ok=True) + + # Saving model + proto_fields = trainer.dataset_builder.get_proto_fields() + trainer.run_func_without_hooks(trainer.session, + lambda _sess: build_saved_model(saved_model_dir=output_dir, + version_id=version_id, + signature=trainer.signature, + proto_fields=proto_fields, + graph=tf.get_default_graph(), + session=_sess)) + + # Saving opponent + # For version = 0, or if we reached the numbers of version to switch version (in "staggered" mode) + if version_id == 0 or (trainer.flags.mode == 'staggered' + and version_id % trainer.flags.staggered_versions == 0): + create_opponent_from_player(trainer, version_id) + + # Saving checkpoint - Once every 10 mins by default + if (time.time() - trainer.checkpoint_every) >= trainer.last_checkpoint_time: + trainer.last_checkpoint_time = int(time.time()) + checkpoint_save_path = os.path.join(trainer.flags.save_dir, 'rl_model.ckpt') + trainer.run_func_without_hooks(trainer.session, + lambda _sess: trainer.saver.save(_sess, + save_path=checkpoint_save_path, + global_step=version_id)) + + # Waiting for gRPC + if wait_for_grpc: + wait_for_version(trainer, model_name='player', version_id=version_id, timeout=10) + +def create_opponent_from_player(trainer, version_id): + """ Creates an opponent by copying a specific player version id + :param trainer: A reinforcement learning trainer instance. + :param version_id: The version id to copy from the player directory. + :return: Nothing + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + output_dir = get_serving_directory(trainer, 'opponent') + os.makedirs(output_dir, exist_ok=True) + + # Copying into a temp directory and then renaming to avoid serving trying to load an empty folder + src_dir = get_version_directory(trainer, 'player', version_id) + dest_dir = get_version_directory(trainer, 'opponent', version_id) + if not os.path.exists(src_dir): + LOGGER.warning('Unable to find the directory %s to copy the opponent model', src_dir) + shutil.copytree(src_dir, dest_dir + '__') + shutil.move(dest_dir + '__', dest_dir) + +def extract_games_and_power_phases(trainer, learned_games_proto, replay_samples, partial_games_only=False): + """ Extracts games_proto and (power, phase_ix) to use for learning + :param trainer: A reinforcement learning trainer instance. + :param learned_games_proto: A list of `SavedGame` instances from the RL agents. + :param replay_samples: A list of `ReplaySamples` from the memory buffer. + :param partial_games_only: Boolean that indicates to only extract info from partial games. + :return: A tuple consisting of + 1) A list of `SavedGame` instances to use for learning + 2) A list dictionary (one per game) with power_name as key and list of phase_ix as value + e.g. [Game1, Game2, ...] + [{'AUSTRIA': [0, 1, 2], ...}, {'AUSTRIA': [1, 2, 3], ...}] + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + saved_games_proto, power_phases_ix = [], [] + for saved_game_proto in learned_games_proto: + if not saved_game_proto.assigned_powers: + continue + if partial_games_only and not saved_game_proto.is_partial_game: + continue + saved_games_proto += [saved_game_proto] + power_phases_ix += [trainer.algorithm.get_power_phases_ix(saved_game_proto, + get_nb_rl_agents(trainer.flags.mode))] + for replay_sample in replay_samples: + saved_games_proto += [replay_sample.saved_game_proto] + power_phases_ix += [replay_sample.power_phases_ix] + return saved_games_proto, power_phases_ix + +def complete_epoch(trainer): + """ Cleanups at the end of an epoch + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if trainer.cluster_config and not trainer.cluster_config.is_chief: + return + + # Cleaning up + delete_obsolete_versions(trainer) + delete_temp_files(trainer, 'train') + +def load_games_from_folder(trainer, target_dir, pattern, minimum=0, timeout=None, compressed=True): + """ Loads games from disk + :param trainer: A reinforcement learning trainer instance. + :param target_dir: The directory where to load the games from. + :param pattern: The file pattern to use for finding the protobuf file(s). + :param minimum: The minimum number of files expected to match the pattern. + :param timeout: Optional. The timeout (in seconds) to wait for the minimum nb of files to appear. + :param compressed: Boolean. Indicates if the content is compressed + :return: A list of saved game proto + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + saved_games_proto = [] + start_time = int(time.time()) + filenames = glob.glob(os.path.join(target_dir, pattern)) + + # Waiting until timeout + if len(filenames) < minimum and timeout: + while int(time.time()) - start_time < timeout and len(filenames) < minimum: + filenames = glob.glob(os.path.join(target_dir, pattern)) + time.sleep(1.) + + # Minimum number of files not found + if len(filenames) < minimum: + LOGGER.warning('Expected to find %d files on disk using pattern %s. Only found %d.', + minimum, pattern, len(filenames)) + + # Parsing files + for full_filename in filenames: + filename = os.path.basename(full_filename) + with trainer.memory_buffer.lock('lock.file.%s' % filename, timeout=120): + saved_games_proto += load_games_from_file(os.path.join(target_dir, filename), compressed=compressed) + return saved_games_proto + +def load_games_from_file(file_path, compressed=False): + """ Trying to load games stored on disk to resume training + :param file_path: The path to the protocol buffer file where games can be stored + :param compressed: Boolean. Indicates if the content is compressed + :return: A list of `game.SavedGame` proto. + """ + if not os.path.exists(file_path): + return [] + + # Loading file and getting games + saved_games_proto = [] + with open(file_path, 'rb') as file: + while True: + saved_game_proto = read_next_proto(SavedGameProto, file, compressed) + if saved_game_proto is None: + break + saved_games_proto += [saved_game_proto] + return saved_games_proto + +def save_games_to_folder(trainer, saved_games_proto, target_dir, filename): + """ Saves games to disk + :param trainer: A reinforcement learning trainer instance. + :param saved_games_proto: A list of diplomacy_proto.game.SavedGame + :param target_dir: The directory where to save the games. + :param filename: The filename to use for the protobuf file. + :return: Nothing + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if not os.path.exists(target_dir): + os.makedirs(target_dir, exist_ok=True) + + # Saving to temp path, then renaming + temp_path = os.path.join(target_dir, '__' + filename) + output_path = os.path.join(target_dir, filename) + + with trainer.memory_buffer.lock('lock.file.%s' % filename, timeout=120): + with open(temp_path, 'ab') as game_file: + for saved_game_proto in saved_games_proto: + if saved_game_proto.is_partial_game: + continue + write_proto_to_file(game_file, saved_game_proto, compressed=True) + shutil.move(temp_path, output_path) + +def get_versions_on_disk(trainer, model_name): + """ Find the versions saved on disk for the given model name. + :param trainer: A reinforcement learning trainer instance. + :param model_name: The model name to use to find versions on disk (e.g. 'player', 'opponent') + :return: A list of versions found for this model name. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + return list(sorted(next(os.walk(get_serving_directory(trainer, model_name)))[1])) + +def delete_obsolete_versions(trainer, min_to_keep=5): + """ Deleting obsolete player versions on disk to save space + :param trainer: A reinforcement learning trainer instance. + :param min_to_keep: The minimum number of versions to keep + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + player_dir = os.path.join(trainer.flags.save_dir, 'serving', 'player') + player_versions = get_versions_on_disk(trainer, 'player') + + # Keeping the first 2 version and the last 'min_to_keep' + versions_to_keep = {version for version in player_versions[:2]} + versions_to_keep |= {version for version in player_versions[-min_to_keep:]} + + # Finding extra versions + extra_versions = {version for version in player_versions + if int(version) % trainer.flags.eval_every != 1 and version not in versions_to_keep} + + # Deleting the versions + for version in extra_versions: + shutil.rmtree(os.path.join(player_dir, version), ignore_errors=True) + +def delete_temp_files(trainer, current_mode): + """ Deletes temp files on disk + :param trainer: A reinforcement learning trainer instance. + :param current_mode: The current mode (either 'train' or 'eval') + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if current_mode not in ('train', 'eval'): + return + temp_pattern = '.temp_%s*.pb' % current_mode + temp_pattern = os.path.join(trainer.flags.save_dir, 'serving', temp_pattern) + + # Deleting the temp files if present + for file_path in glob.glob(temp_pattern): + if os.path.exists(file_path): + os.unlink(file_path) + +def get_nb_rl_agents(mode): + """ Computes the number of RL agents in each game + :param mode: The number of agents for the current mode (either flags.mode or flags.eval_mode) + :param hparams: The model's hyper-parameters + """ + return {'supervised': 1, # --- train modes --- + 'self-play': len(ALL_POWERS), + 'staggered': 1, + 'supervised-0': 1, # --- eval modes --- + 'supervised-1': 1}[mode] + +def get_version_id(trainer): + """ Returns the current iteration number + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if trainer.cluster_config and trainer.cluster_config.job_name != 'learner': + return buffer_gen_ops.get_version_id(trainer.memory_buffer) + return int(trainer.session.run(trainer.algorithm.version_step)) + +def get_opponent_version_id(trainer): + """ Returns the version id used by the opponent (by looking on disk) + :param trainer: A reinforcement learning trainer instance. + :return: The version being used by the opponent (-1 when N/A (e.g. a rule-based model)) + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if trainer.flags.mode == 'self-play': + return get_version_id(trainer) + if trainer.flags.mode == 'staggered' and trainer.flags.staggered_versions == 1: + return get_version_id(trainer) + if trainer.flags.mode == 'supervised': + return 0 + + # Returning -1 if no models on disk + serving_dir = get_serving_directory(trainer, 'opponent') + if not os.path.exists(serving_dir): + return -1 + + # Finding the max version + for path in sorted(glob.glob(os.path.join(serving_dir, '*')), reverse=True): + version = path.split('/')[-1] + if version.isdigit(): + return int(version) + return -1 + +def get_serving_directory(trainer, target_name): + """ Returns the directory where all serving models should be saved + :param trainer: A reinforcement learning trainer instance. + :param target_name: The name of the model (e.g. 'player', 'opponent') + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + return os.path.join(trainer.flags.save_dir, 'serving', target_name) + +def get_version_directory(trainer, target_name, version_id=None): + """ Returns the directory where the TF Serving version should be saved. + :param trainer: A reinforcement learning trainer instance. + :param target_name: The name of the model (e.g. 'player', 'opponent') + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if version_id is None: + version_id = get_version_id(trainer) + return os.path.join(trainer.flags.save_dir, 'serving', target_name, '%09d' % version_id) diff --git a/diplomacy_research/models/training/reinforcement/distributed.py b/diplomacy_research/models/training/reinforcement/distributed.py new file mode 100644 index 0000000..1d7012b --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/distributed.py @@ -0,0 +1,78 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement - Distributed training + - Class responsible for training a model in a distributed setting +""" +import logging +from tornado import gen +from diplomacy_research.models.training.memory_buffer.memory_buffer import start_redis_server +from diplomacy_research.models.training.reinforcement.common import build_train_server +from diplomacy_research.models.training.reinforcement.distributed_actor import start_distributed_actor +from diplomacy_research.models.training.reinforcement.distributed_learner import start_distributed_learner +from diplomacy_research.models.training.reinforcement.serving import start_tf_serving_server + +# Constants +LOGGER = logging.getLogger(__name__) + + +@gen.coroutine +def start_distributed_training(trainer): + """ Starts training in distributed mode. + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + # Making sure debug (tensorflow and batch) and profile are not set + if trainer.flags.debug: + raise RuntimeError('Debug (TensorFlow) mode is not supported in distributed mode.') + if trainer.flags.debug_batch: + raise RuntimeError('Debug (batch) mode is not supported in distributed mode.') + if trainer.flags.profile: + raise RuntimeError('Profile mode is not supported in distributed mode.') + + # Dispatching + # --- Parameter server --- + if trainer.cluster_config.job_name == 'ps': + start_parameter_server(trainer) + + # --- Actor --- + elif trainer.cluster_config.job_name == 'actor': + yield start_distributed_actor(trainer) + + # --- Learner --- + elif trainer.cluster_config.job_name == 'learner': + yield start_distributed_learner(trainer) + + # --- Evaluator --- + elif trainer.cluster_config.job_name == 'evaluator': + trainer.process_pool.shutdown() # Not yet implemented + trainer.process_pool = None + + # --- Serving --- + elif trainer.cluster_config.job_name == 'serving': + start_tf_serving_server(trainer, force_cpu=False, serving_id=0, config=None) # Config set by actors + + # --- Redis --- + elif trainer.cluster_config.job_name == 'redis': + start_redis_server(trainer) + else: + raise RuntimeError('Invalid configuration detected.') + +def start_parameter_server(trainer): + """ Starts a parameter server + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + build_train_server(trainer) + LOGGER.info('Parameter server is now ready ...') + trainer.server.join() diff --git a/diplomacy_research/models/training/reinforcement/distributed_actor.py b/diplomacy_research/models/training/reinforcement/distributed_actor.py new file mode 100644 index 0000000..7c4570a --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/distributed_actor.py @@ -0,0 +1,57 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement - Distributed Actor + - Class responsible for playing the 'actor' role in the cluster by generating games +""" +import logging +from tornado import gen +from diplomacy_research.models.training.reinforcement.common import create_advantage +from diplomacy_research.models.training.reinforcement.generation import start_training_process +from diplomacy_research.models.training.reinforcement.memory_buffer import build_memory_buffer +from diplomacy_research.models.training.reinforcement.serving import start_tf_serving_server, check_opening_orders, \ + update_serving, wait_for_version, get_training_config + +# Constants +LOGGER = logging.getLogger(__name__) + + +@gen.coroutine +def start_distributed_actor(trainer): + """ Starts an actor + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + # Creating advantage function + create_advantage(trainer) + + # Builds the memory buffer and wait for the cluster to be ready + build_memory_buffer(trainer) + trainer.memory_buffer.wait_until_ready() + + # Creating a serving - Training (endpoint only) + start_tf_serving_server(trainer, + force_cpu=True, + serving_id=0, + config=None, + endpoint_only=True) + + # Wait for model to be loaded + update_serving(trainer, serving_id=0, config=get_training_config(trainer)) + wait_for_version(trainer, serving_id=0, model_name='player') + + # Querying the model to make sure to check if it has been trained + check_opening_orders(trainer, serving_id=0) + + # Launchs the training process to generate training games forever + start_training_process(trainer, block=True) diff --git a/diplomacy_research/models/training/reinforcement/distributed_learner.py b/diplomacy_research/models/training/reinforcement/distributed_learner.py new file mode 100644 index 0000000..bc5c18b --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/distributed_learner.py @@ -0,0 +1,210 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement - Distributed Learner + - Class responsible for playing the 'learner' role in the cluster by updating parameters +""" +import logging +import time +from tornado import gen +from diplomacy_research.models.training.memory_buffer.barrier import set_barrier_status, wait_for_barrier, \ + clear_barrier +from diplomacy_research.models.training.memory_buffer.expert_games import load_expert_games +from diplomacy_research.models.training.memory_buffer.general_ops import set_version_id +from diplomacy_research.models.training.memory_buffer.online_games import get_online_games, mark_games_as_processed +from diplomacy_research.models.training.reinforcement.common import build_model_and_dataset, build_restore_saver, \ + build_algorithm, build_summaries, build_config_proto, build_hooks, create_adapter, create_advantage, \ + build_train_server, complete_epoch, extract_games_and_power_phases, get_version_id, get_version_directory, \ + load_games_from_folder +from diplomacy_research.models.training.reinforcement.generation import get_replay_samples +from diplomacy_research.models.training.reinforcement.memory_buffer import build_memory_buffer, update_priorities +from diplomacy_research.models.training.reinforcement.serving import ensure_model_on_disk, save_version_model +from diplomacy_research.models.training.reinforcement.statistics import reset_stats, update_stats, compile_stats, \ + save_stats, display_progress +from diplomacy_research.settings import SESSION_RUN_TIMEOUT + +# Constants +LOGGER = logging.getLogger(__name__) + + +@gen.coroutine +def start_distributed_learner(trainer): + """ Starts a learner + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import tf + + # Builds the model and the dataset + build_model_and_dataset(trainer) + build_restore_saver(trainer) + build_algorithm(trainer) + build_summaries(trainer) + build_config_proto(trainer) + build_hooks(trainer) + build_train_server(trainer) + create_adapter(trainer) + create_advantage(trainer) + + # Builds the memory buffer and load expert games + build_memory_buffer(trainer) + load_expert_games(trainer.memory_buffer) + + # Creating session and start training + try: + trainer.saver = tf.train.Saver(max_to_keep=5, restore_sequentially=True, pad_step_number=True) + with tf.train.MonitoredTrainingSession(master=trainer.server.target, + is_chief=trainer.cluster_config.is_chief, + checkpoint_dir=trainer.flags.save_dir, + scaffold=tf.train.Scaffold(init_op=tf.global_variables_initializer(), + saver=trainer.saver), + log_step_count_steps=0, + hooks=trainer.hooks, + chief_only_hooks=trainer.chief_only_hooks, + config=tf.ConfigProto(**trainer.config_proto), + save_checkpoint_secs=0, + save_checkpoint_steps=0, + save_summaries_steps=None, + save_summaries_secs=None) as sess: + + # Saving session + trainer.session = sess + trainer.model.sess = sess + LOGGER.info('Session has been successfully created.') + + # Initializing adapter, dataset, and algorithm + trainer.run_func_without_hooks(sess, trainer.adapter.initialize) + trainer.queue_dataset.session = sess # Setting the recoverable session + yield trainer.algorithm.init() + + # Non-Chief - Waits for ready + if not trainer.cluster_config.is_chief: + trainer.memory_buffer.wait_until_ready() + + # Chief - Reset algo and mark as ready + else: + ensure_model_on_disk(trainer) + trainer.memory_buffer.mark_as_ready() + + # Resetting stats + reset_stats(trainer) + + # Training forever + while True: + yield run_training_epoch(trainer) + + # CTRL-C closes the session to force a checkpoint + # Tensorflow will throw a Runtime Error because the session is already closed. + except RuntimeError as error: + if trainer.model.sess is not None and trainer.model.sess._sess is not None: # pylint: disable=protected-access + raise error + +@gen.coroutine +def run_training_epoch(trainer): + """ Runs a training epoch + :param trainer: A reinforcement trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import tf + print('\n=========== TRAINING ===========') + + # Variables + epoch_results = {} + nb_learners = trainer.cluster_config.count('learner') + nb_missing_transitions = -1 + partial_games_only = bool(trainer.flags.update_interval > 0) + set_barrier_status(trainer.memory_buffer, 'train', value=0) + + # Clearing transition buffers + yield trainer.algorithm.clear_buffers() + + # Sampling new replay samples from the memory buffer + if trainer.algorithm_constructor.can_do_experience_replay: + trainer.replay_samples = get_replay_samples(trainer) + + # Getting games from the memory buffer + learned_games_proto, game_ids = get_online_games(trainer.memory_buffer, all_games=False) + saved_games_proto, power_phases_ix = extract_games_and_power_phases(trainer, + learned_games_proto, + trainer.replay_samples, + partial_games_only=partial_games_only) + yield trainer.algorithm.learn(saved_games_proto, power_phases_ix, trainer.advantage_fn) + + # Waiting for additional games - We don't have enough transitions to proceed + while len(trainer.algorithm.transition_buffer) < (trainer.flags.nb_transitions_per_update // nb_learners): + if nb_missing_transitions != trainer.flags.nb_transitions_per_update - len(trainer.algorithm.transition_buffer): + nb_missing_transitions = trainer.flags.nb_transitions_per_update - len(trainer.algorithm.transition_buffer) + LOGGER.info('Waiting for additional games. Missing %d transitions.', nb_missing_transitions) + yield gen.sleep(1.) + + # Getting additional games + new_games_proto, new_game_ids = get_online_games(trainer.memory_buffer, excluding=game_ids, all_games=False) + learned_games_proto += new_games_proto + game_ids += new_game_ids + + # Learning from those games + saved_games_proto, power_phases_ix = extract_games_and_power_phases(trainer, + new_games_proto, + [], + partial_games_only=partial_games_only) + yield trainer.algorithm.learn(saved_games_proto, power_phases_ix, trainer.advantage_fn) + + # Proceeding + LOGGER.info('[Train] Retrieved %d games from Redis', len(learned_games_proto)) + try: + epoch_results = yield trainer.algorithm.update(trainer.memory_buffer) + except (TimeoutError, tf.errors.DeadlineExceededError): + LOGGER.warning('learn/update took more than %d ms to run. Timeout error.', SESSION_RUN_TIMEOUT) + LOGGER.info('[Train] Done updating the model version.') + + # Updating priorities + yield update_priorities(trainer, learned_games_proto, trainer.replay_samples) + trainer.replay_samples = [] + + # Marking games as processed and adjusting factor + mark_games_as_processed(trainer.memory_buffer, game_ids) + + # Non-Chief - Can just wait for chief and return + if not trainer.cluster_config.is_chief: + set_barrier_status(trainer.memory_buffer, 'train', value=1) + wait_for_barrier(trainer.memory_buffer, 'train') + complete_epoch(trainer) + return + + # Chief - Marking learner as done + set_barrier_status(trainer.memory_buffer, 'train', value=1) + + # Updating the model used by the actors + new_version_id = get_version_id(trainer) + save_version_model(trainer) + set_version_id(trainer.memory_buffer, new_version_id) + LOGGER.info('[Train] *** New version available: Version %d ***.', new_version_id) + + # Clearing barrier + clear_barrier(trainer.memory_buffer, 'train') + + # Compiling stats (every 60s by default) + if (time.time() - trainer.stats_every) >= trainer.last_stats_time: + stats_games_proto = load_games_from_folder(trainer, + target_dir=get_version_directory(trainer, 'player'), + pattern='games_learned*.pbz', + minimum=trainer.cluster_config.count('actor'), + timeout=60) + update_stats(trainer, 'train', stats_games_proto, epoch_results=epoch_results) + compile_stats(trainer, 'train') + save_stats(trainer) + trainer.last_stats_time = int(time.time()) + + # Displaying progress and completing + display_progress(trainer) + complete_epoch(trainer) diff --git a/diplomacy_research/models/training/reinforcement/generation.py b/diplomacy_research/models/training/reinforcement/generation.py new file mode 100644 index 0000000..1aa3bc0 --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/generation.py @@ -0,0 +1,362 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement - Generation + - Class responsible for generating games +""" +import collections +import datetime +import logging +import multiprocessing +from queue import Empty as EmptyQueueException +import random +import sys +from threading import Thread +import time +import traceback +from tornado import gen, ioloop +from diplomacy_research.models.self_play.controller import generate_trajectory +from diplomacy_research.models.state_space import ALL_POWERS, NB_POWERS +from diplomacy_research.models.training.memory_buffer import MemoryBuffer, general_ops +from diplomacy_research.models.training.memory_buffer.expert_games import get_uniform_initial_states, \ + get_backplay_initial_states +from diplomacy_research.models.training.memory_buffer.online_games import save_games +from diplomacy_research.models.training.memory_buffer import priority_replay +from diplomacy_research.models.training.reinforcement.common import get_nb_rl_agents +from diplomacy_research.models.training.reinforcement.players import get_train_supervised_players, \ + get_train_self_play_players, get_train_staggered_players +from diplomacy_research.models.training.reinforcement.serving import get_tf_serving_port +from diplomacy_research.utils.proto import write_bytes_to_file, proto_to_bytes + +# Constants +LOGGER = logging.getLogger(__name__) +SPAWN_CONTEXT = multiprocessing.get_context('spawn') +NEW_VERSION = 'new.version' + +class AggregatorConfig( + collections.namedtuple('AggregatorConfig', ('nb_left', # The number of games left to generate + 'nb_total', # The total number of games to generate + 'file_path', # The file path where to save games + 'save_to_buffer'))): # Indicate to save the game to mem. buffer + """ Configuration to pass to the aggregator on a new set of games """ + +@gen.coroutine +def generate_game_on_process(get_players_callable, get_players_kwargs, generate_trajectory_kwargs, queue): + """ Generate a game on the current process + :param get_players_callable: Callable function to get a list of players + :param get_players_kwargs: A dictionary of kwargs to pass to the get_players_callable + :param generate_trajectory_kwargs: A dictionary of kwargs to pass to the method generate_trajectory + :param queue: A multiprocessing queue to save games to disk and display progress. + :return: A saved game in bytes format. + :type queue: multiprocessing.Queue + """ + assert 'tensorflow' not in sys.modules, 'TensorFlow should not be loaded for generate games.' + players = get_players_callable(**get_players_kwargs) + saved_game_bytes = yield generate_trajectory(players, **generate_trajectory_kwargs, output_format='bytes') + queue.put_nowait((True, 0, saved_game_bytes)) # is_full_game, nb_transitions, saved_game_bytes + return saved_game_bytes + +def start_game_process(kwargs): + """ Starts an IO loop for game generation """ + try: + return ioloop.IOLoop().run_sync(lambda: generate_game_on_process(**kwargs)) # pylint: disable=no-value-for-parameter + except KeyboardInterrupt: + pass + except: # pylint: disable=bare-except + LOGGER.error('-' * 32) + LOGGER.error('Exception occurred in process pool.') + traceback.print_exc() + LOGGER.error('-' * 32) + return None + +def start_game_generator(adapter_ctor, dataset_builder_ctor, reward_fn, advantage_fn, hparams, cluster_config, + process_pool, games_queue, transitions_queue): + """ Start the game generator (to generate an infinite number of training games) + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param reward_fn: The reward function to use (Instance of.models.self_play.reward_functions`). + :param advantage_fn: An instance of `.models.self_play.advantages` + :param hparams: A dictionary of hyper-parameters + :param cluster_config: The cluster configuration to use for distributed training + :param process_pool: Optional. A ProcessPoolExecutor that was forked before TF and gRPC were loaded. + :param games_queue: Queue to be used by processes to send games to the aggregator. + :param transitions_queue: Inbound queue to receive the number of transitions and version updates. + :return: Nothing + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type reward_fn: diplomacy_research.models.self_play.reward_functions.AbstractRewardFunction + :type advantage_fn: diplomacy_research.models.self_play.advantages.base_advantage.BaseAdvantage + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + :type process_pool: diplomacy_research.utils.executor.ProcessPoolExecutor + :type games_queue: multiprocessing.Queue + :type transitions_queue: multiprocessing.Queue + """ + # pylint: disable=too-many-arguments + memory_buffer = MemoryBuffer(cluster_config, hparams) + nb_cores = multiprocessing.cpu_count() + futures = [] + + nb_pending_transitions = 0 # For throttling if there are enough transitions for the learner + nb_rl_agents = get_nb_rl_agents(hparams['mode']) + + # 1) Finding the right function to create player + get_players_callable = {'supervised': get_train_supervised_players, + 'self-play': get_train_self_play_players, + 'staggered': get_train_staggered_players}[hparams['mode']] + + # Generating an infinite number of games + while True: + nb_new_transitions = 0 + + # 1) Detecting the number of pending transactions to throttle if necessary + while not transitions_queue.empty(): + item = transitions_queue.get() + if item == NEW_VERSION: + nb_pending_transitions = 0 + nb_cores = multiprocessing.cpu_count() + else: + nb_pending_transitions += nb_rl_agents * item / NB_POWERS + nb_new_transitions += nb_rl_agents * item / NB_POWERS + + futures = [fut for fut in futures if not fut.done()] + nb_games_being_generated = len(futures) + + # Finding the number of games to generate + nb_new_games = nb_cores - nb_games_being_generated + if nb_new_games <= 0: + continue + + # 2) Generating the get_player_kwargs + get_players_kwargs = [{'adapter_ctor': adapter_ctor, + 'dataset_builder_ctor': dataset_builder_ctor, + 'tf_serving_port': get_tf_serving_port(cluster_config, serving_id=0), + 'cluster_config': cluster_config, + 'hparams': hparams}] * nb_new_games + + # 3) Generating gen_trajectory_kwargs + gen_trajectory_kwargs = [] + for _ in range(nb_new_games): + gen_trajectory_kwargs += [{'hparams': hparams, + 'reward_fn': reward_fn, + 'advantage_fn': advantage_fn, + 'power_assignments': hparams.get('power', '') or random.choice(ALL_POWERS), + 'set_player_seed': bool(hparams['dropout_rate']), + 'update_interval': hparams['update_interval'], + 'update_queue': games_queue}] + + # 4) Adding initial states if required + if hparams['start_strategy'] == 'uniform': + initial_states_proto = get_uniform_initial_states(memory_buffer, nb_new_games) + for game_ix, initial_state_proto in enumerate(initial_states_proto): + gen_trajectory_kwargs[game_ix]['initial_state_bytes'] = proto_to_bytes(initial_state_proto) + + elif hparams['start_strategy'] == 'backplay': + winning_power_names = [] + for kwargs in gen_trajectory_kwargs: + if isinstance(kwargs['power_assignments'], list): + winning_power_names += [kwargs['power_assignments'][0]] + else: + winning_power_names += [kwargs['power_assignments']] + version_id = general_ops.get_version_id(memory_buffer) + initial_states_proto = get_backplay_initial_states(memory_buffer, winning_power_names, version_id) + for game_ix, initial_state_proto in enumerate(initial_states_proto): + gen_trajectory_kwargs[game_ix]['initial_state_bytes'] = proto_to_bytes(initial_state_proto) + + # 6) Launching jobs using current pool + tasks = [] + for player_kwargs, trajectory_kwargs in zip(get_players_kwargs, gen_trajectory_kwargs): + tasks += [{'get_players_callable': get_players_callable, + 'get_players_kwargs': player_kwargs, + 'generate_trajectory_kwargs': trajectory_kwargs, + 'queue': games_queue}] + futures += [process_pool.submit(start_game_process, kwargs) for kwargs in tasks] + +def start_aggregator(hparams, cluster_config, games_queue, transitions_queue, display_status=True): + """ Games Aggregator - Displays status every minute and saves games to disk and to memory buffer + :param hparams: A dictionary of hyper-parameters + :param cluster_config: The cluster configuration to use for distributed training + :param games_queue: Inbound queue to receive games from the process pool. + :param transitions_queue: Outbound queue to send transitions and version updates to the generator for throttling + :param display_status: Boolean that indicates to display the status on stdout. + :return: Nothing + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + :type games_queue: multiprocessing.Queue + :type transitions_queue: multiprocessing.Queue + """ + # pylint: disable=too-many-nested-blocks + memory_buffer = MemoryBuffer(cluster_config, hparams) + buffer_file = None + current_config = None # type: AggregatorConfig + new_config = None + nb_left, nb_total, nb_completed = 0, 0, 0 + starting_time = time.time() + last_status_time = time.time() + queue_is_done = False + last_version = -1 + + # Looping forever - New configs will be sent on the queue + while not queue_is_done: + nb_full_games = 0 + + # Dequeuing items from the queue + saved_games_bytes = [] + while True: + try: + item = games_queue.get(False) + if item is None: + queue_is_done = True + break + elif isinstance(item, AggregatorConfig): + new_config = item + break + else: + is_full_game, nb_transitions, saved_game_bytes = item + saved_games_bytes += [saved_game_bytes] + + if is_full_game: + nb_full_games += 1 + + # On a new version, we send 'new.version' on the transition queue + # We also send the nb of transitions, so the generator can throttle when there is enough transitions + # for the current version + if transitions_queue and nb_transitions: + current_version = general_ops.get_version_id(memory_buffer) + if current_version != last_version: + transitions_queue.put_nowait(NEW_VERSION) + last_version = current_version + transitions_queue.put_nowait(nb_transitions) + except EmptyQueueException: + break + + # Processing current games + if saved_games_bytes: + if current_config.save_to_buffer: + save_games(memory_buffer, saved_games_bytes=saved_games_bytes) + for saved_game_bytes in saved_games_bytes: + if buffer_file: + write_bytes_to_file(buffer_file, saved_game_bytes) + if nb_left > 0: + nb_left -= 1 + nb_completed += 1 + + # Printing status + # Case 1 - Generate an infinite number of games + if nb_total == -1 and time.time() - last_status_time >= 60: + last_status_time = time.time() + elapsed_time = last_status_time - starting_time + games_per_day = 24 * 3600. * nb_full_games / max(1., elapsed_time) + if display_status: + LOGGER.info('Current status - Games/day: %.2f', games_per_day) + + # Case 2 - Generate a finite number of games + elif nb_left > 0 and time.time() - last_status_time >= 60: + last_status_time = time.time() + elapsed_time = last_status_time - starting_time + progress = 100. * (nb_total - nb_left) / max(1, nb_total) + eta = datetime.timedelta(seconds=int(elapsed_time / max(1, nb_completed * nb_left))) + if display_status: + LOGGER.info('Current status - %.2f%% (%d/%d) - ETA: %s', progress, nb_total - nb_left, nb_total, eta) + + # Done current batch + if nb_total and not nb_left: + progress = 100. * (nb_total - nb_left) / max(1, nb_total) + if display_status: + LOGGER.info('Done generating games - Progress %.2f%% (%d/%d)', progress, nb_total - nb_left, nb_total) + nb_left, nb_total, nb_completed = 0, 0, 0 + if buffer_file: + buffer_file.close() + buffer_file = None + + # Setting new config + if new_config: + starting_time = time.time() + nb_left, nb_total, nb_completed = new_config.nb_left, new_config.nb_total, 0 + if buffer_file: + buffer_file.close() + buffer_file = None + if new_config.file_path: + buffer_file = open(new_config.file_path, 'ab') + current_config = new_config + if nb_total > 0: + progress = 100. * (nb_total - nb_left) / max(1, nb_total) + if display_status: + LOGGER.info('Generating games - Progress %.2f%% (%d/%d)', progress, nb_total - nb_left, nb_total) + + # Sleeping + if not saved_games_bytes and new_config is None: + time.sleep(0.25) + new_config = None + +def start_training_process(trainer, block=False): + """ Starts a process that will generate an infinite number of training games + :param trainer: A reinforcement learning trainer instance. + :param block: Boolean that indicates that we want to block until the process is completed + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + # Starting aggregator and game generator + if not trainer.aggregator['train']: + + # The to_aggregator queue is used to send games from the process pool to the aggregator + # The to_generator queue is used to send transitions from the aggregator to the generator for throttling + manager = multiprocessing.Manager() + queue_to_aggregator = manager.Queue() + queue_to_generator = manager.Queue() + + # Putting configuration for aggregator -- -1 = infinite games + queue_to_aggregator.put_nowait(AggregatorConfig(nb_left=-1, + nb_total=-1, + file_path=None, + save_to_buffer=True)) + + # Aggregator - Using separate process + trainer.aggregator['train'] = SPAWN_CONTEXT.Process(target=start_aggregator, + kwargs={'hparams': trainer.hparams, + 'cluster_config': trainer.cluster_config, + 'games_queue': queue_to_aggregator, + 'transitions_queue': queue_to_generator, + 'display_status': bool(trainer.cluster_config)}) + trainer.aggregator['train'].start() + + # Generator - Using thread + trainer.train_thread = Thread(target=start_game_generator, + kwargs={'adapter_ctor': trainer.adapter_constructor, + 'dataset_builder_ctor': trainer.dataset_builder_constructor, + 'reward_fn': trainer.reward_fn, + 'advantage_fn': trainer.advantage_fn, + 'hparams': trainer.hparams, + 'cluster_config': trainer.cluster_config, + 'process_pool': trainer.process_pool, + 'games_queue': queue_to_aggregator, + 'transitions_queue': queue_to_generator}) + trainer.train_thread.start() + + # Blocking until thread completes + if block: + trainer.train_thread.join() + +def get_replay_samples(trainer): + """ Retrives a series of replay samples (to use for learning) + :param trainer: A reinforcement learning trainer instance. + :return: A list of `ReplaySample`. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + # Computing the number of samples - Rounding them to the nearest batch size + perc_from_replay = 0. + if trainer.algorithm_constructor.can_do_experience_replay: + perc_from_replay = max(0., min(1., trainer.flags.experience_replay)) + nb_samples = perc_from_replay * trainer.flags.nb_transitions_per_update + nb_samples = int(trainer.flags.batch_size * round(nb_samples / trainer.flags.batch_size)) + + if not nb_samples: + return [] + return priority_replay.get_replay_samples(trainer.memory_buffer, nb_samples) diff --git a/diplomacy_research/models/training/reinforcement/memory_buffer.py b/diplomacy_research/models/training/reinforcement/memory_buffer.py new file mode 100644 index 0000000..6a5164a --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/memory_buffer.py @@ -0,0 +1,54 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement Learning - Memory Buffer + - Class responsible for for interacting with the memory buffer +""" +import logging +from tornado import gen +from diplomacy_research.models.training.memory_buffer import MemoryBuffer +from diplomacy_research.models.training.memory_buffer import priority_replay + +# Constants +LOGGER = logging.getLogger(__name__) + + +def build_memory_buffer(trainer): + """ Builds the memory buffer and connects to it + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + # Creating memory buffer + trainer.memory_buffer = MemoryBuffer(trainer.cluster_config, trainer.hparams) + + # If debug (batch), we need to flush the Redis cache + if trainer.flags.debug_batch and (not trainer.cluster_config or trainer.cluster_config.is_chief): + trainer.memory_buffer.clear() + +@gen.coroutine +def update_priorities(trainer, learned_games_proto, replay_samples): + """ Update the priorities of games and samples in the memory buffer + :param trainer: A reinforcement learning trainer instance. + :param learned_games_proto: A list of `SavedGameProto` representing played games by the RL agents + :param replay_samples: A list of ReplaySamples from the memory buffer. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if not trainer.algorithm_constructor.can_do_experience_replay or not trainer.flags.experience_replay: + return + if learned_games_proto: + new_priorities = yield trainer.algorithm.get_priorities(learned_games_proto, trainer.advantage_fn) + priority_replay.update_priorities(trainer.memory_buffer, new_priorities, first_update=True) + if replay_samples: + new_priorities = yield trainer.algorithm.get_new_priorities(replay_samples, trainer.advantage_fn) + priority_replay.update_priorities(trainer.memory_buffer, new_priorities) + priority_replay.trim_buffer(trainer.memory_buffer) diff --git a/diplomacy_research/models/training/reinforcement/players.py b/diplomacy_research/models/training/reinforcement/players.py new file mode 100644 index 0000000..a4a54c4 --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/players.py @@ -0,0 +1,205 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement - Players Constructors + - Class responsible for returning a list of instantiated players +""" + +import logging +from diplomacy_research.models.datasets.grpc_dataset import GRPCDataset +from diplomacy_research.models.state_space import NB_POWERS +from diplomacy_research.players import ModelBasedPlayer + +# Constants +LOGGER = logging.getLogger(__name__) +DEFAULT_TEMPERATURE = 1. +DEFAULT_NOISE = 0. +DEFAULT_DROPOUT = 0. + +def get_train_supervised_players(adapter_ctor, dataset_builder_ctor, tf_serving_port, cluster_config, hparams): + """ Builds 1 RL player vs 6 supervised opponent + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param tf_serving_port: The port to connect to the TF serving server + :param cluster_config: The cluster configuration to use for distributed training + :param hparams: A dictionary of hyper-parameters. + :return: A list of players + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + player_dataset = GRPCDataset(hostname='localhost', + port=tf_serving_port, + model_name='player', + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + opponent_dataset = GRPCDataset(hostname='localhost', + port=tf_serving_port, + model_name='opponent', + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + + # Adapters + player_adapter = adapter_ctor(player_dataset) + opponent_adapter = adapter_ctor(opponent_dataset) + + # Creating players + players = [] + players += [ModelBasedPlayer(policy_adapter=player_adapter, + temperature=DEFAULT_TEMPERATURE, + noise=DEFAULT_NOISE, + dropout_rate=hparams['dropout_rate'], + use_beam=hparams['use_beam'])] + for _ in range(NB_POWERS - 1): + players += [ModelBasedPlayer(policy_adapter=opponent_adapter, + temperature=DEFAULT_TEMPERATURE, + noise=DEFAULT_NOISE, + dropout_rate=hparams['dropout_rate'], + use_beam=hparams['use_beam'])] + return players + +def get_train_self_play_players(adapter_ctor, dataset_builder_ctor, tf_serving_port, cluster_config, hparams): + """ Build 7 RL players + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param tf_serving_port: The port to connect to the TF serving server + :param cluster_config: The cluster configuration to use for distributed training + :param hparams: A dictionary of hyper-parameters. + :return: A list of players + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + player_dataset = GRPCDataset(hostname='localhost', + port=tf_serving_port, + model_name='player', + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + player_adapter = adapter_ctor(player_dataset) + + # Creating players + players = [] + for _ in range(NB_POWERS): + players += [ModelBasedPlayer(policy_adapter=player_adapter, + temperature=DEFAULT_TEMPERATURE, + noise=DEFAULT_NOISE, + dropout_rate=hparams['dropout_rate'], + use_beam=hparams['use_beam'])] + return players + +def get_train_staggered_players(adapter_ctor, dataset_builder_ctor, tf_serving_port, cluster_config, hparams): + """ Builds 1 RL player vs 6 previous versions + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param tf_serving_port: The port to connect to the TF serving server + :param cluster_config: The cluster configuration to use for distributed training + :param hparams: A dictionary of hyper-parameters. + :return: A list of players + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + return get_train_supervised_players(adapter_ctor=adapter_ctor, + dataset_builder_ctor=dataset_builder_ctor, + tf_serving_port=tf_serving_port, + cluster_config=cluster_config, + hparams=hparams) + +def get_eval_supervised_0_players(adapter_ctor, dataset_builder_ctor, tf_serving_port, cluster_config, hparams): + """ Builds 1 RL player vs 6 supervised (temperature 0) + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param tf_serving_port: The port to connect to the TF serving server + :param cluster_config: The cluster configuration to use for distributed training + :param hparams: A dictionary of hyper-parameters. + :return: A list of players + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + del hparams # Unused args + player_dataset = GRPCDataset(hostname='localhost', + port=tf_serving_port, + model_name='player', + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + opponent_dataset = GRPCDataset(hostname='localhost', + port=tf_serving_port, + model_name='opponent', + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + + # Adapters + player_adapter = adapter_ctor(player_dataset) + opponent_adapter = adapter_ctor(opponent_dataset) + + # Creating players + players = [] + players += [ModelBasedPlayer(policy_adapter=player_adapter, + temperature=DEFAULT_TEMPERATURE, + noise=DEFAULT_NOISE, + dropout_rate=DEFAULT_DROPOUT)] + for _ in range(NB_POWERS - 1): + players += [ModelBasedPlayer(policy_adapter=opponent_adapter, + schedule=[(0.75, 0.1), (1., 1.)], + noise=DEFAULT_NOISE, + dropout_rate=DEFAULT_DROPOUT)] + return players + +def get_eval_supervised_1_players(adapter_ctor, dataset_builder_ctor, tf_serving_port, cluster_config, hparams): + """ Builds 1 RL player vs 6 supervised (temperature 1) + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param tf_serving_port: The port to connect to the TF serving server + :param cluster_config: The cluster configuration to use for distributed training + :param hparams: A dictionary of hyper-parameters. + :return: A list of players + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + del hparams # Unused args + player_dataset = GRPCDataset(hostname='localhost', + port=tf_serving_port, + model_name='player', + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + opponent_dataset = GRPCDataset(hostname='localhost', + port=tf_serving_port, + model_name='opponent', + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + + # Adapters + player_adapter = adapter_ctor(player_dataset) + opponent_adapter = adapter_ctor(opponent_dataset) + + # Creating players + players = [] + players += [ModelBasedPlayer(policy_adapter=player_adapter, + temperature=DEFAULT_TEMPERATURE, + noise=DEFAULT_NOISE, + dropout_rate=DEFAULT_DROPOUT)] + for _ in range(NB_POWERS - 1): + players += [ModelBasedPlayer(policy_adapter=opponent_adapter, + temperature=DEFAULT_TEMPERATURE, + noise=DEFAULT_NOISE, + dropout_rate=DEFAULT_DROPOUT)] + return players diff --git a/diplomacy_research/models/training/reinforcement/serving.py b/diplomacy_research/models/training/reinforcement/serving.py new file mode 100644 index 0000000..f2aae7c --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/serving.py @@ -0,0 +1,520 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement Learning - Serving + - Class responsible for for interacting with the TensorFlow Serving server +""" +import glob +import logging +import math +import multiprocessing +import os +import sys +from threading import Thread +import time +import uuid +from diplomacy import Game +from tornado import gen, ioloop +from diplomacy_research.models.datasets.grpc_dataset import ModelConfig, GRPCDataset +from diplomacy_research.models.training.reinforcement.common import save_version_model +from diplomacy_research.players import ModelBasedPlayer +from diplomacy_research.utils.cluster import kill_processes_using_port, is_port_opened +from diplomacy_research.utils.process import start_tf_serving, BatchingParameters, kill_subprocesses_on_exit +from diplomacy_research.settings import IN_PRODUCTION + +# Constants +LOGGER = logging.getLogger(__name__) +SPAWN_CONTEXT = multiprocessing.get_context('spawn') +RESULT_DICT = {} + +def ensure_model_on_disk(trainer): + """ Makes sure there is at least 1 model on disk, otherwise saves a model for the serving server + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + if trainer.cluster_config and not trainer.cluster_config.is_chief: + return + if not has_tf_serving_model(trainer, 'player'): + save_version_model(trainer, version_id=0) + +def start_tf_serving_server(trainer, force_cpu, serving_id, config, endpoint_only=False): + """ Starts the TF Serving server + :param trainer: A reinforcement learning trainer instance. + :param force_cpu: Boolean that indicates that we want the TF serving server to only use the CPU. + :param serving_id: Integer that represents the serving server id (i.e. when multiple servers are launched) + :param config: The configuration to set on the serving on launch (None to set no config on launch) + :param endpoint_only: Boolean that indicates to only launch a sentinel to send orders to another server. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + assert 'grpc' not in sys.modules, 'gRPC should not be loaded on the main thread.' + + # Making sure we have a model on disk first + ensure_model_on_disk(trainer) + + # Launching sentinel + port = get_tf_serving_port(trainer.cluster_config, serving_id) + trainer.thread_pipes[serving_id], trainer.sentinel_pipes[serving_id] = SPAWN_CONTEXT.Pipe() + trainer.sentinels[serving_id] = \ + SPAWN_CONTEXT.Process(target=start_serving_sentinel, + kwargs={'pipe': trainer.sentinel_pipes[serving_id], + 'port': port, + 'save_dir': trainer.flags.save_dir, + 'force_cpu': force_cpu, + 'config': config, + 'adapter_ctor': trainer.adapter_constructor, + 'dataset_builder_ctor': trainer.dataset_builder_constructor, + 'cluster_config': trainer.cluster_config, + 'endpoint_only': endpoint_only}) + trainer.sentinels[serving_id].start() + + # Waiting for server + for attempt_ix in range(300): + time.sleep(1) + if is_port_opened(port): + break + if (attempt_ix + 1) % 10 == 0: + LOGGER.info('Waiting for TF Serving to load. Attempt %d / %d.', attempt_ix + 1, 300) + else: + LOGGER.error('The TF Serving server did not come online.') + raise RuntimeError('Unable to contact the serving server.') + LOGGER.info('Successfully connected to TF Serving.') + +def get_tf_serving_port(cluster_config, serving_id): + """ Returns the port used by the serving server + :param cluster_config: The cluster configuration to use for distributed training + :param serving_id: Integer that represents the serving server id (i.e. when multiple servers are launched) + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + port = 8500 + if cluster_config and cluster_config.job_name in ['serving', 'actor']: + serving_address = cluster_config.cluster_spec['serving'][cluster_config.task_id] + port = int(serving_address.split(':')[1]) + if serving_id: + port += 2500 + serving_id + return port + +def get_training_config(trainer): + """ Computes the configuration to set on the TF serving server for training + :param trainer: A reinforcement learning trainer instance. + :return: The default TF serving server configuration for training + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + base_path = os.path.join(trainer.flags.save_dir) if IN_PRODUCTION else '/work_dir' + + # All versions uses the latest version for the player + # self-play uses the same version for both the player and the opponent + config = [ModelConfig(name='player', + base_path=os.path.join(base_path, 'serving', 'player'), + version_policy={'latest': 1})] + + # Supervised - Player uses latest version, Opponent uses supervised version + if trainer.flags.mode == 'supervised': + config += [ModelConfig(name='opponent', + base_path=os.path.join(base_path, 'serving', 'opponent'), + version_policy={'specific': 0})] + + # Staggered - Uses the latest opponent version for the opponent + # The opponent version will be updated sporadically + elif trainer.flags.mode == 'staggered': + config += [ModelConfig(name='opponent', + base_path=os.path.join(base_path, 'serving', 'opponent'), + version_policy={'latest': 1})] + + # Self-play - No need for an opponent + elif trainer.flags.mode == 'self-play': + pass + + # Otherwise - Unknown mode + else: + LOGGER.error('Valid RL modes are "supervised", "self-play", "staggered".') + raise ValueError('Unknown RL mode %s. Aborting.' % trainer.flags.mode) + + # Returning configuration + return config + +def get_evaluation_config(trainer): + """ Computes the default configuration to set on the TF serving server for evaluation + :param trainer: A reinforcement learning trainer instance. + :return: The default TF serving server configuration for evaluation + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + base_path = os.path.join(trainer.flags.save_dir) if IN_PRODUCTION else '/work_dir' + + # All versions uses the latest version for the player + # Evaluation always use the supervised model has the opponent + config = [ModelConfig(name='player', + base_path=os.path.join(base_path, 'serving', 'player'), + version_policy={'latest': 1})] + + if trainer.flags.eval_mode in ['supervised-0', 'supervised-1']: + config += [ModelConfig(name='opponent', + base_path=os.path.join(base_path, 'serving', 'opponent'), + version_policy={'specific': 0})] + + # Otherwise - Unknown mode + else: + LOGGER.error('Valid RL eval modes are "supervised-0", "supervised-1".') + raise ValueError('Unknown RL eval mode %s. Aborting.' % trainer.flags.eval_mode) + + # Returning configuration + return config + +def has_tf_serving_model(trainer, model_name): + """ Checks if the specified model name already have a saved model available to load + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + version_folder = os.path.join(trainer.flags.save_dir, 'serving', model_name) + if not os.path.exists(version_folder): + return False + + # Looking for a saved_model.pb + versions = [os.path.join(version_folder, model_version) for model_version in os.listdir(version_folder) + if os.path.isdir(os.path.join(version_folder, model_version))] + for version_path in versions: + if os.path.exists(os.path.join(version_path, 'saved_model.pb')): + return True + + # No saved models found + return False + +def update_serving(trainer, serving_id=0, config=None): + """ Updates the configuration of the TF Serving server + :param trainer: A reinforcement learning trainer instance. + :param serving_id: Integer that represents the serving server id (i.e. when multiple servers are launched) + :param config: The configuration to set on the serving. Uses the training configuration if not provided + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + assert serving_id in trainer.thread_pipes and trainer.thread_pipes[serving_id] is not None, 'Pipe is required.' + if config is None: + config = get_training_config(trainer) + + # Setting a request and sending it to server + request_id = str(uuid.uuid4()) + RESULT_DICT[request_id] = 0 + trainer.thread_pipes[serving_id].send((request_id, 'update', config)) + +def wait_for_version(trainer, model_name, version_id=None, serving_id=0, timeout=10): + """ Waits for a specific version to be loaded on the server + :param trainer: A reinforcement learning trainer instance. + :param model_name: The name of the model to check. (e.g. 'player' or 'opponent') + :param version_id: Optional. The version id to wait for (defaults to the current version if not provided). + :param serving_id: Integer that represents the serving server id (i.e. when multiple servers are launched) + :param timeout: The maximum time to wait for the new version in seconds. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + assert serving_id in trainer.thread_pipes and trainer.thread_pipes[serving_id] is not None, 'Pipe is required.' + request_id = str(uuid.uuid4()) + RESULT_DICT[request_id] = 0 + trainer.thread_pipes[serving_id].send((request_id, 'wait_for_version', {'model_name': model_name, + 'version_id': version_id, + 'timeout': timeout})) + if not wait_for_results(trainer, request_id, timeout): + LOGGER.info('Timeout of %d reached waiting for wait_for_version.', timeout) + +def check_opening_orders(trainer, serving_id=0, timeout=30): + """ Queries the serving server to get the opening orders and compares them to known openings + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + assert serving_id in trainer.thread_pipes and trainer.thread_pipes[serving_id] is not None, 'Pipe is required.' + request_id = str(uuid.uuid4()) + RESULT_DICT[request_id] = 0 + trainer.thread_pipes[serving_id].send((request_id, 'check_opening_orders', None)) + if not wait_for_results(trainer, request_id, timeout): + LOGGER.info('Timeout of %d reached waiting for check_openings.', timeout) + +def wait_for_results(trainer, request_id, timeout): + """ Waits for results from the sentinel + :param trainer: A reinforcement learning trainer instance. + :param request_id: The original request id. + :param timeout: The maximum amount of time to wait for the request. + :return: A boolean that indicates if the request was successfully received within the timeout period. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + start_time = time.time() + while time.time() - start_time < timeout: + for thread_pipe in trainer.thread_pipes.values(): + while thread_pipe.poll(): + item_request_id, item_value = thread_pipe.recv() + RESULT_DICT[item_request_id] = item_value + if RESULT_DICT.get(request_id, 0): + return True + for key, value in RESULT_DICT.items(): + if value and value - time.time() >= 120: + del RESULT_DICT[key] + time.sleep(0.1) + return False + +# -------------------------------------------- +# Sentinel and Tasks +# -------------------------------------------- +def start_serving_sentinel(**kwargs): + """ Starts a sentinel to start and monitor the TF serving server """ + return ioloop.IOLoop().run_sync(lambda: monitor_tf_serving(**kwargs)) # pylint: disable=no-value-for-parameter + +@gen.coroutine +def monitor_tf_serving(pipe, port, save_dir, force_cpu, config, adapter_ctor, dataset_builder_ctor, cluster_config=None, + endpoint_only=False): + """ Launches and monitors a TF serving server and restarts it if trouble is detected. + :param pipe: The multiprocessing pipe to communicate with the main thread + :param port: Integer. The port to use for the TF serving server. + :param save_dir: The current flags.save_dir + :param force_cpu: Boolean that indicates that we want the TF serving server to only use the CPU. + :param config: The configuration to set on the serving on launch (None to set no config on launch) + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param cluster_config: The cluster configuration used for distributed training. + :param endpoint_only: Boolean that indicates to only launch a sentinel to send orders to another server. + + :type pipe: multiprocessing.connection.Pipe + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + # pylint: disable=too-many-arguments + + # Waiting until we have at least 1 model in the save_dir before starting the server + # Raising an exception after 5 mins + for attempt_ix in range(300): + if glob.glob('%s/*/saved_model.pb' % (os.path.join(save_dir, 'serving', 'player'))): + break + time.sleep(1) + if (attempt_ix + 1) % 30 == 0: + LOGGER.info('Waiting for TF model to be saved to disk. Attempt %d / 300.', attempt_ix + 1) + else: + LOGGER.error('The TF model was not detected on disk after 300 seconds. Aborting.') + raise RuntimeError('TF serving not detected on disk') + + # Launching tf serving in a separate thread + if not endpoint_only and not is_port_opened(port): + task_launch_serving(port, save_dir, force_cpu, config, cluster_config) + + # Creating a game to monitor players + game = Game() + + # Creating a model-based player for each configuration received + player_models = [] + if not endpoint_only: + player_models = task_get_player_models(port, config, adapter_ctor, dataset_builder_ctor, cluster_config) + + # Detects if we can monitor and restart the server + monitoring_enabled = bool(player_models) + if not monitoring_enabled and not endpoint_only: + LOGGER.warning('A configuration was not provided. Serving monitoring has been disabled until it is received.') + + # Cannot do the monitoring if the config is not passed + assert player_models or endpoint_only, 'A configuration is required when the serving is not only an endpoint.' + + # Processing tasks and monitoring server + last_status_time = 0 + while True: + + # Monitor server (every 30 secs) + if monitoring_enabled and (time.time() - last_status_time) >= 30: + status_ok = yield task_monitor_serving(player_models, game, port, save_dir, + force_cpu=force_cpu, + config=config, + cluster_config=cluster_config) + if not status_ok: + continue + last_status_time = time.time() + + # Performing requests + while pipe.poll(): + request_id, request_name, request_args = pipe.recv() + + # Check Opening Orders + if request_name == 'check_opening_orders': + yield task_check_openings(player_models) + + # Update Config + elif request_name == 'update': + config = request_args + yield task_set_config(port, config) + + # Regenerating players for serving monitoring + if not endpoint_only: + player_models = task_get_player_models(port=port, + config=config, + adapter_ctor=adapter_ctor, + dataset_builder_ctor=dataset_builder_ctor, + cluster_config=cluster_config) + if not monitoring_enabled and player_models: + LOGGER.info('Serving monitoring is now enabled.') + elif monitoring_enabled and not player_models: + LOGGER.info('Serving monitoring is now disabled.') + monitoring_enabled = bool(player_models) + + # Wait for version + elif request_name == 'wait_for_version': + yield task_wait_for_version(port, **request_args) + + else: + LOGGER.error('Unknown request: %s - Skipping.', request_name) + + # Marking request as processed + pipe.send((request_id, int(time.time()))) + + # Throttling + yield gen.sleep(0.1) + +def task_get_player_models(port, config, adapter_ctor, dataset_builder_ctor, cluster_config): + """ Gets the players to use for monitor the serving server + :param port: Integer. The port to use for the TF serving server. + :param config: The configuration to set on the serving on launch (None to set no config on launch) + :param adapter_ctor: The constructor to build the adapter to query orders, values and policy details + :param dataset_builder_ctor: The constructor of `BaseBuilder` to set the required proto fields + :param cluster_config: The cluster configuration used for distributed training. + :return: A list of tuples (model_name, player) + + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type dataset_builder_ctor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + player_models = [] + if config is None: + return player_models + for model_config in config: + player_dataset = GRPCDataset(hostname='localhost', + port=port, + model_name=model_config.name, + signature=adapter_ctor.get_signature(), + dataset_builder=dataset_builder_ctor(), + cluster_config=cluster_config) + player_adapter = adapter_ctor(player_dataset) + player = ModelBasedPlayer(player_adapter) + player_models += [(model_config.name, player)] + return player_models + +@gen.coroutine +def task_set_config(port, config, nb_retries=30): + """ Sets a new configuration on the serving server + :param port: Integer. The port to use for the TF serving server. + :param config: A ModelConfig named tuple or a list of ModelConfig named tuple + :param nb_retries: The number of times to retry setting the configuration. + """ + if config is None: + return + for _ in range(nb_retries): + if GRPCDataset.set_config('localhost', port, config): + break + yield gen.sleep(1.) + else: + LOGGER.error('Unable to set the configuration on the TF serving server. Tried %d times. Skipping.', nb_retries) + +@gen.coroutine +def task_check_openings(player_models): + """ Check orders for a certain number of player models + :param player_models: A list of tuples with (model_name, player) + """ + print('-' * 80) + for model_name, player in player_models: + print('%s:' % model_name) + yield player.check_openings() + print('-' * 80) + +@gen.coroutine +def task_wait_for_version(port, model_name, version_id, timeout): + """ Waits until the TF serving is done loading a version in memory + :param port: The port used by the TensorFlow Serving server. + :param model_name: The model name that needs to be loaded + :param version_id: The version that should be loaded + :param timeout: The maximum number of seconds to wait. Logs an error if reached. + """ + GRPCDataset.wait_for_model_to_load('localhost', port, model_name, version_id, timeout=timeout + 30) + +@gen.coroutine +def task_monitor_serving(player_models, game, port, save_dir, force_cpu, config, cluster_config, nb_retries=3): + """ Sends a fake request order to the serving to make sure it is still online + :param player_models: A list of tuples with (model_name, player) + :param game: A game object to use to query the serving + :param port: Integer. The port to use for the TF serving server. + :param save_dir: The current flags.save_dir + :param force_cpu: Boolean that indicates that we want the TF serving server to only use the CPU. + :param config: The configuration to set on the serving on launch (None to set no config on launch) + :param cluster_config: The cluster configuration used for distributed training. + :param nb_retries: The nb of retries before restarting the server. + :type game: diplomacy.Game + """ + import grpc + status_ok = True + + # No players + if not player_models: + return status_ok + + # Monitoring the server + _, player = player_models[0] + for _ in range(nb_retries): + try: + orders = yield player.get_orders(game, 'FRANCE', retry_on_failure=False) + if [order for order in orders if order != '']: + break + except grpc.RpcError: + pass + yield gen.sleep(5) + else: + LOGGER.warning('Unable to retrieve orders from the server in the last %d attempts. Restarting it.', nb_retries) + status_ok = False + yield task_launch_serving(port, save_dir, force_cpu, config, cluster_config) + + # Returning the status + return status_ok + +@gen.coroutine +def task_launch_serving(port, save_dir, force_cpu, config, cluster_config=None): + """ Launches (or restarts) a TF serving server + :param port: Integer. The port to use for the TF serving server. + :param save_dir: The current flags.save_dir + :param force_cpu: Launches the tf serving on CPU, otherwise uses GPU when using distributed training. + :param config: The configuration to set on the serving on launch (None to set no config on launch) + :param cluster_config: The cluster configuration used for distributed training. + """ + kill_processes_using_port(port) + kill_subprocesses_on_exit() + + # Computing launch settings + simult_players = multiprocessing.cpu_count() * 7 # launching nb_cpus processes + max_batch_size = 2 ** int(math.log(0.9 * simult_players, 2)) # rounding down to nearest exponent of 2. + batch_timeout = 200000 + batching_parameters = BatchingParameters(max_batch_size=max_batch_size, + batch_timeout_micros=batch_timeout, + max_enqueued_batches=256, + num_batch_threads=multiprocessing.cpu_count(), + pad_variable_length_inputs=True) + + log_file_path = None + if not cluster_config: + log_file_path = os.path.join(save_dir, 'tf_serving_%d.log' % port) + elif get_tf_serving_port(cluster_config, serving_id=0) != port: + log_file_path = os.path.join(save_dir, 'tf_serving_%s_%d.log' % (cluster_config.job_name, port)) + force_cpu = force_cpu or bool(cluster_config is None) + + # Launching + tf_serving_thread = Thread(target=start_tf_serving, + args=(port, save_dir, batching_parameters, cluster_config), + kwargs={'force_cpu': force_cpu, + 'log_file_path': log_file_path}) + tf_serving_thread.start() + + # Waiting for port + for _ in range(120): + if is_port_opened(port): + break + yield gen.sleep(1) + else: + LOGGER.error('Unable to connect to TF Serving after 2 mins.') + + # Setting configuration + yield task_set_config(port, config) diff --git a/diplomacy_research/models/training/reinforcement/standalone.py b/diplomacy_research/models/training/reinforcement/standalone.py new file mode 100644 index 0000000..6432308 --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/standalone.py @@ -0,0 +1,193 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement - Standalone training + - Class responsible for training a model in a non-distributed setting +""" +import logging +import time +from tornado import gen +from diplomacy_research.models.training.memory_buffer.expert_games import load_expert_games +from diplomacy_research.models.training.memory_buffer.general_ops import set_version_id +from diplomacy_research.models.training.memory_buffer.online_games import get_online_games, mark_games_as_processed +from diplomacy_research.models.training.memory_buffer.memory_buffer import start_redis_server +from diplomacy_research.models.training.reinforcement.common import build_model_and_dataset, build_restore_saver, \ + build_algorithm, build_summaries, build_config_proto, build_hooks, create_adapter, create_advantage, \ + extract_games_and_power_phases, save_version_model, save_games_to_folder, complete_epoch, get_version_id, \ + get_version_directory +from diplomacy_research.models.training.reinforcement.generation import start_training_process, get_replay_samples +from diplomacy_research.models.training.reinforcement.memory_buffer import build_memory_buffer, update_priorities +from diplomacy_research.models.training.reinforcement.serving import start_tf_serving_server, check_opening_orders, \ + get_training_config +from diplomacy_research.models.training.reinforcement.statistics import reset_stats, update_stats, compile_stats, \ + save_stats, display_progress +from diplomacy_research.settings import SESSION_RUN_TIMEOUT + +# Constants +LOGGER = logging.getLogger(__name__) + +@gen.coroutine +def start_standalone_training(trainer): + """ Starts training in standalone mode. + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import tf, tf_debug + + # Builds the model and the dataset + build_model_and_dataset(trainer) + build_restore_saver(trainer) + build_algorithm(trainer) + build_summaries(trainer) + build_config_proto(trainer) + build_hooks(trainer) + create_adapter(trainer) + create_advantage(trainer) + + # Start the memory buffer and load expert games + start_redis_server(trainer) + build_memory_buffer(trainer) + load_expert_games(trainer.memory_buffer) + + # Creating session and start training + try: + trainer.saver = tf.train.Saver(max_to_keep=5, restore_sequentially=True, pad_step_number=True) + with tf.train.MonitoredTrainingSession(checkpoint_dir=trainer.flags.save_dir, + scaffold=tf.train.Scaffold(init_op=tf.global_variables_initializer(), + saver=trainer.saver), + log_step_count_steps=0, + hooks=trainer.hooks, + chief_only_hooks=trainer.chief_only_hooks, + config=tf.ConfigProto(**trainer.config_proto), + save_checkpoint_secs=0, + save_checkpoint_steps=0, + save_summaries_steps=None, + save_summaries_secs=None) as sess: + + # Wrapping in a session debugger + if trainer.flags.debug: + sess = tf_debug.LocalCLIDebugWrapperSession(sess) + + # Saving session + trainer.session = sess + trainer.model.sess = sess + LOGGER.info('Session has been successfully created.') + + # Initializing adapter, algorithm, and stats + trainer.run_func_without_hooks(sess, trainer.adapter.initialize) + yield trainer.algorithm.init() + reset_stats(trainer) + + # Starting training serving servers + start_tf_serving_server(trainer, + force_cpu=False, + serving_id=0, + config=get_training_config(trainer)) + + # Querying the model to make sure to check if it has been trained + check_opening_orders(trainer) + + # Launching the training process + start_training_process(trainer, block=False) + + # Training forever + while True: + yield run_training_epoch(trainer) + + # CTRL-C closes the session to force a checkpoint + # Tensorflow will throw a Runtime Error because the session is already closed. + except RuntimeError as error: + if trainer.model.sess is not None and trainer.model.sess._sess is not None: # pylint: disable=protected-access + raise error + +@gen.coroutine +def run_training_epoch(trainer): + """ Runs a training epoch + :param trainer: A reinforcement trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + from diplomacy_research.utils.tensorflow import tf + print('\n=========== TRAINING ===========') + + # Variables + epoch_results = {} + nb_missing_transitions = -1 + partial_games_only = bool(trainer.flags.update_interval) + + # Clearing transition buffers + yield trainer.algorithm.clear_buffers() + + # Sampling new replay samples from the memory buffer + if trainer.algorithm_constructor.can_do_experience_replay: + trainer.replay_samples = get_replay_samples(trainer) + + # Getting games from the memory buffer + learned_games_proto, game_ids = get_online_games(trainer.memory_buffer) + saved_games_proto, power_phases_ix = extract_games_and_power_phases(trainer, + learned_games_proto, + trainer.replay_samples, + partial_games_only=partial_games_only) + yield trainer.algorithm.learn(saved_games_proto, power_phases_ix, trainer.advantage_fn) + + # Waiting for additional games - We don't have enough transitions to proceed + while len(trainer.algorithm.transition_buffer) < trainer.flags.nb_transitions_per_update: + if nb_missing_transitions != trainer.flags.nb_transitions_per_update - len(trainer.algorithm.transition_buffer): + nb_missing_transitions = trainer.flags.nb_transitions_per_update - len(trainer.algorithm.transition_buffer) + LOGGER.info('Waiting for additional games. Missing %d transitions.', nb_missing_transitions) + yield gen.sleep(1.) + + # Getting additional games + new_games_proto, new_game_ids = get_online_games(trainer.memory_buffer, excluding=game_ids) + learned_games_proto += new_games_proto + game_ids += new_game_ids + + # Learning from those games + saved_games_proto, power_phases_ix = extract_games_and_power_phases(trainer, + new_games_proto, + [], + partial_games_only=partial_games_only) + yield trainer.algorithm.learn(saved_games_proto, power_phases_ix, trainer.advantage_fn) + + # Proceeding + LOGGER.info('[Train] Retrieved %d games from Redis', len(learned_games_proto)) + try: + epoch_results = yield trainer.algorithm.update(trainer.memory_buffer) + except (TimeoutError, tf.errors.DeadlineExceededError): + LOGGER.warning('learn/update took more than %d ms to run. Timeout error.', SESSION_RUN_TIMEOUT) + + # Updating priorities + yield update_priorities(trainer, learned_games_proto, trainer.replay_samples) + trainer.replay_samples = [] + + # Saving to disk + new_version_id = get_version_id(trainer) + save_version_model(trainer, wait_for_grpc=True) + set_version_id(trainer.memory_buffer, new_version_id) + + # Marking games as processed + mark_games_as_processed(trainer.memory_buffer, game_ids) + + # Compiling stats (every 60s by default) + if (time.time() - trainer.stats_every) >= trainer.last_stats_time: + update_stats(trainer, 'train', learned_games_proto, epoch_results=epoch_results) + compile_stats(trainer, 'train') + save_stats(trainer) + save_games_to_folder(trainer=trainer, + saved_games_proto=learned_games_proto, + target_dir=get_version_directory(trainer, 'player'), + filename='games_learned.pbz') + trainer.last_stats_time = int(time.time()) + + # Displaying progress and completing + display_progress(trainer) + complete_epoch(trainer) diff --git a/diplomacy_research/models/training/reinforcement/statistics.py b/diplomacy_research/models/training/reinforcement/statistics.py new file mode 100644 index 0000000..d6cfbd3 --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/statistics.py @@ -0,0 +1,306 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement Learning - Statistics + - Class responsible for for computing and displaying RL statistics +""" +import datetime +import logging +import os +import pickle +import resource +import time +import numpy as np +from diplomacy_research.models.gym.environment import DoneReason +from diplomacy_research.models.training.reinforcement.common import get_version_id, get_opponent_version_id, \ + get_nb_rl_agents +from diplomacy_research.models.state_space import NB_SUPPLY_CENTERS, ALL_POWERS + +# Constants +LOGGER = logging.getLogger(__name__) +STATS_FILE_NAME = 'rl_stats.pkl' + + +def reset_stats(trainer): + """ Resets the dictionary of statistics to its initial state + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + trainer.stats = {key: {power_name: {'episode_rewards': [], + 'eval_rewards': {reward_fn.name: [] for reward_fn in trainer.eval_reward_fns}, + 'ending_scs': [], + 'has_won': [], + 'has_most_sc': [], + 'rank': [], + 'nb_years': [], + 'phases_to_reach_sc': {nb_sc: [] for nb_sc in range(4, 20, 2)}, + 'done_reason': [], + 'nb_games': 0} + for power_name in ALL_POWERS + ['ALL']} + for key in ['train', 'eval']} + for key in ['train', 'eval']: + trainer.stats[key].update({'memory_usage': 0, + 'version/player': 0, + 'version/opponent': 0, + 'nb_rl_agents': 0, + 'nb_steps': 0, + 'nb_games': 0, + 'nb_games_last_version': 0}) + + # Loading stats from disk + if os.path.exists(os.path.join(trainer.flags.save_dir, STATS_FILE_NAME)): + with open(os.path.join(trainer.flags.save_dir, STATS_FILE_NAME), 'rb') as stats_file: + trainer.stats = pickle.load(stats_file) + + # Overriding starting_version + trainer.stats['starting_version'] = get_version_id(trainer) + +def save_stats(trainer): + """ Saves statistics to disk """ + with open(os.path.join(trainer.flags.save_dir, STATS_FILE_NAME), 'wb') as stats_file: + pickle.dump(trainer.stats, stats_file, pickle.HIGHEST_PROTOCOL) + +def update_stats(trainer, stats_mode, stats_games_proto, epoch_results=None): + """ Updates the stats from the latest played games + :param trainer: A reinforcement learning trainer instance. + :param stats_mode: One of 'train', or 'eval'. + :param stats_games_proto: A list of `SavedGameProto` instances to use to update the stats + :param epoch_results: A dictionary with evaluation tags as key and a list of value for each mini-batch + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + assert stats_mode in ['train', 'eval'], 'Arg "stats_mode" must be either "train" or "eval".' + + epoch_results = epoch_results or {} + nb_rl_agents = get_nb_rl_agents(trainer.flags.mode if stats_mode == 'train' else trainer.flags.eval_mode) + stats = trainer.stats[stats_mode] + version_id = get_version_id(trainer) + + stats['nb_rl_agents'] = nb_rl_agents + stats['nb_games'] += len(stats_games_proto) + stats['nb_games_last_version'] = len(stats_games_proto) + + # Resetting nb of games + for power_name in ALL_POWERS + ['ALL']: + stats[power_name]['nb_games'] = 0 + + # Computing the total reward, nb of ending sc, if we have won, and if we have the most SC + for saved_game_proto in stats_games_proto: + if not saved_game_proto.phases: + LOGGER.warning('Game %s does not have phases. Skipping stats.', saved_game_proto.id) + continue + centers = saved_game_proto.phases[-1].state.centers + nb_centers = [len(centers[power_name].value) for power_name in saved_game_proto.assigned_powers] + rank = sorted(nb_centers, reverse=True).index(nb_centers[0]) + 1 + stats['nb_steps'] += len(saved_game_proto.phases) * nb_rl_agents + + # Updating the power and the combined stats + for rl_power_name in saved_game_proto.assigned_powers[:nb_rl_agents]: + for power_name in [rl_power_name, 'ALL']: + stats[power_name]['episode_rewards'] += [sum(saved_game_proto.rewards[rl_power_name].value)] + for reward_fn in trainer.eval_reward_fns: + sum_eval_rewards = sum(reward_fn.get_episode_rewards(saved_game_proto, rl_power_name)) + stats[power_name]['eval_rewards'][reward_fn.name] += [sum_eval_rewards] + stats[power_name]['ending_scs'] += [nb_centers[0]] + stats[power_name]['has_won'] += [int(nb_centers[0] >= (NB_SUPPLY_CENTERS // 2 + 1))] + stats[power_name]['has_most_sc'] += [int(nb_centers[0] == max(nb_centers))] + stats[power_name]['rank'] += [rank] + stats[power_name]['done_reason'] += [saved_game_proto.done_reason] + stats[power_name]['nb_games'] += 1 + + # Computing the first year at which we reach the specified number of sc + # We use a default of 35 years if we never reach the number of SC + for saved_game_proto in stats_games_proto: + year_reached = {nb_sc: 35 for nb_sc in range(0, NB_SUPPLY_CENTERS + 1)} + + for rl_power_name in saved_game_proto.assigned_powers[:nb_rl_agents]: + + # Looping through every phase and setting the number of sc there + year = 0 + for phase in saved_game_proto.phases: + nb_sc = len(phase.state.centers[rl_power_name].value) + if phase.name[3:5].isdigit(): + year = int(phase.name[3:5]) + year_reached[nb_sc] = min(year_reached[nb_sc], year) + + # Using the year of the last phase when the game is completed + elif phase.name == 'COMPLETED': + year_reached[nb_sc] = min(year_reached[nb_sc], year) + + # Making sure that if the years reached are in ascending order + # In case we conquered more than 1 sc in a given year + for nb_sc in range(NB_SUPPLY_CENTERS - 1, -1, -1): + year_reached[nb_sc] = min(year_reached[nb_sc], year_reached[nb_sc + 1]) + + # Adding to list + for nb_sc in range(4, 20, 2): + stats[rl_power_name]['phases_to_reach_sc'][nb_sc] += [year_reached[nb_sc]] + stats['ALL']['phases_to_reach_sc'][nb_sc] += [year_reached[nb_sc]] + + # Number of years + # e.g. S1951M - S1901M = 50 yrs + # Some years might be string (e.g. COMPLETED, FORMING), so we need to skip those + for phase in reversed(saved_game_proto.phases): + if phase.name[3:5].isdigit(): + stats[rl_power_name]['nb_years'] += [int(phase.name[3:5]) - 1] + stats['ALL']['nb_years'] += [int(phase.name[3:5]) - 1] + break + else: + stats[rl_power_name]['nb_years'] += [0] + stats['ALL']['nb_years'] += [0] + + # Logging memory usage + stats['memory_usage'] = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 1024 + + # Logging versions + stats['version/player'] = version_id + stats['version/opponent'] = get_opponent_version_id(trainer) if stats_mode == 'train' else 0 + + # Trimming stats dict + for key in stats: + if isinstance(stats[key], list): + stats[key] = stats[key][-1000:] + elif isinstance(stats[key], dict): + for sub_key in stats[key]: + if isinstance(stats[key][sub_key], list): + stats[key][sub_key] = stats[key][sub_key][-1000:] + + # Updating algo evaluation tags + for eval_tag in trainer.algorithm.get_evaluation_tags(): + stats[eval_tag] = epoch_results.get(eval_tag, []) + + # Updating + trainer.stats[stats_mode] = stats + +def compile_stats(trainer, stats_mode): + """ Compile the stats for the last version update to save for Tensorboard + :param trainer: A reinforcement learning trainer instance. + :param stats_mode: One of 'train', or 'eval'. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + assert stats_mode in ['train', 'eval'], 'Arg "training_mode" must be either "train" or "eval".' + nb_rl_agents = get_nb_rl_agents(trainer.flags.mode if stats_mode == 'train' else trainer.flags.eval_mode) + stats = trainer.stats[stats_mode] + version_id = get_version_id(trainer) + + nb_new_games = stats.get('nb_games_last_version', 0) + avg_nb_new_games_per_agent = int(1 + nb_new_games / nb_rl_agents) + if not nb_new_games: + LOGGER.warning('Unable to find games to display stats. Skipping.') + return + current_time = int(time.time()) + + def compute_avg(result_key, pow_name, sub_key=None, factor=1.): + """ Computes the avg result for a power """ + nb_new_power_games = stats[pow_name]['nb_games'] + + # With a sub-key + if sub_key: + if not stats[pow_name][result_key][sub_key]: + return -1 + if not nb_new_power_games: + return factor * np.mean(stats[pow_name][result_key][sub_key][-avg_nb_new_games_per_agent:]) + return factor * np.mean(stats[pow_name][result_key][sub_key][-nb_new_power_games:]) + + # Without a sub-key + if not stats[pow_name][result_key]: + return -1 + if not nb_new_power_games: + return factor * np.mean(stats[pow_name][result_key][-avg_nb_new_games_per_agent:]) + return factor * np.mean(stats[pow_name][result_key][-nb_new_power_games:]) + + # Building a results to convert to a feed dict + feed_dict = {} + for power_name in ALL_POWERS + ['ALL']: + feed_dict['rew_avg/%s' % power_name] = compute_avg('episode_rewards', power_name) + feed_dict['sc_avg/%s' % power_name] = compute_avg('ending_scs', power_name) + feed_dict['win_by_sc/%s' % power_name] = compute_avg('has_won', power_name, factor=100.) + feed_dict['most_sc/%s' % power_name] = compute_avg('has_most_sc', power_name, factor=100.) + feed_dict['nb_years/%s' % power_name] = compute_avg('nb_years', power_name) + feed_dict['rank/%s' % power_name] = compute_avg('rank', power_name) + + # Year to reach x + for nb_sc in range(4, 20, 2): + feed_dict['year_at_%d_sc/%s' % (nb_sc, power_name)] = compute_avg('phases_to_reach_sc', + power_name, + sub_key=nb_sc) + + # Done reason + nb_new_power_games = stats[power_name]['nb_games'] + if not nb_new_power_games: + done_reasons = stats[power_name]['done_reason'][-avg_nb_new_games_per_agent:] + else: + done_reasons = stats[power_name]['done_reason'][-nb_new_power_games:] + + nb_engine = len([1 for reason in done_reasons if reason in ('', DoneReason.GAME_ENGINE.value)]) + nb_auto_draw = len([1 for reason in done_reasons if reason == DoneReason.AUTO_DRAW.value]) + nb_thrashing = len([1 for reason in done_reasons if reason == DoneReason.THRASHED.value]) + nb_phase_limit = len([1 for reason in done_reasons if reason == DoneReason.PHASE_LIMIT.value]) + + feed_dict['done_engine/%s' % power_name] = 100. * nb_engine / max(1, len(done_reasons)) + feed_dict['done_auto_draw/%s' % power_name] = 100. * nb_auto_draw / max(1, len(done_reasons)) + feed_dict['done_thrashing/%s' % power_name] = 100. * nb_thrashing / max(1, len(done_reasons)) + feed_dict['done_phase_limit/%s' % power_name] = 100. * nb_phase_limit / max(1, len(done_reasons)) + + # Additional reward functions + for reward_fn in trainer.eval_reward_fns: + feed_dict['%s/%s' % (reward_fn.name, power_name)] = compute_avg('eval_rewards', + power_name, + sub_key=reward_fn.name) + + # Average versions per day + avg_version_per_day = 24 * 3600. * (version_id - trainer.stats['starting_version']) \ + / float(max(1, current_time - trainer.starting_time)) + + # General attributes + feed_dict['nb_rl_agents'] = stats['nb_rl_agents'] + feed_dict['nb_steps'] = stats['nb_steps'] + feed_dict['nb_games'] = stats['nb_games'] + feed_dict['versions_per_day'] = avg_version_per_day + feed_dict['mem_usage_mb'] = stats['memory_usage'] + feed_dict['version/player'] = stats['version/player'] + feed_dict['version/opponent'] = stats['version/opponent'] + + # Algo evaluation tags + for eval_tag in trainer.algorithm.get_evaluation_tags(): + feed_dict[eval_tag] = np.mean(stats[eval_tag]) if stats[eval_tag] else -1 + + # Tensorboard merge computing + feed_dict = {trainer.placeholders[key]: value for key, value in feed_dict.items()} + summary_op = trainer.run_without_hooks(trainer.session, trainer.merge_op, feed_dict=feed_dict) + + # Writing to disk + writer = trainer.writers[stats_mode] + writer.add_summary(summary_op, version_id) + writer.flush() + +def display_progress(trainer): + """ Display the current progress (version id and number of versions / day) + :param trainer: A reinforcement learning trainer instance. + :type trainer: diplomacy_research.models.training.reinforcement.trainer.ReinforcementTrainer + """ + version_id = get_version_id(trainer) + current_time = int(time.time()) + running_time = datetime.timedelta(seconds=int(current_time - trainer.starting_time)) + + # Average versions per day + avg_version_per_day = 24 * 3600. * (version_id - trainer.stats['starting_version']) \ + / float(max(1, current_time - trainer.starting_time)) + spot_version_per_day = 24 * 3600 / float(max(1, current_time - trainer.last_version_time)) + trainer.last_version_time = current_time + + # Printing message + message = [] + message += ['Version {:09}'.format(version_id)] + message += ['Vers/Day Avg: {:6.2f} - Spot: {:6.2f}'.format(avg_version_per_day, spot_version_per_day)] + message += ['Time {}'.format(running_time)] + print(' | '.join(message)) diff --git a/diplomacy_research/models/training/reinforcement/trainer.py b/diplomacy_research/models/training/reinforcement/trainer.py new file mode 100644 index 0000000..d4216f1 --- /dev/null +++ b/diplomacy_research/models/training/reinforcement/trainer.py @@ -0,0 +1,197 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Reinforcement Trainer + - Contains a trainer class for training reinforcement learning algorithms +""" +import logging +import os +import shutil +import signal +import sys +import time +from tornado import gen, ioloop +from diplomacy_research.models.datasets.queue_dataset import QueueDataset # pylint: disable=unused-import +from diplomacy_research.models.self_play import reward_functions +from diplomacy_research.models.training.memory_buffer import MemoryBuffer # pylint: disable=unused-import +from diplomacy_research.models.training.reinforcement.distributed import start_distributed_training +from diplomacy_research.models.training.reinforcement.serving import get_tf_serving_port +from diplomacy_research.models.training.reinforcement.standalone import start_standalone_training +from diplomacy_research.utils.cluster import is_ioloop_running, kill_processes_using_port + +# Constants +LOGGER = logging.getLogger(__name__) + +class ReinforcementTrainer(): + """ Performs reinforcement learning training on a model """ + # pylint: disable=too-many-instance-attributes + + def __init__(self, policy_constructor, value_constructor, draw_constructor, dataset_builder_constructor, + adapter_constructor, algorithm_constructor, reward_fn, flags, cluster_config, process_pool=None): + """ Constructor + :param policy_constructor: The constructor to create the policy model (used by actors and learners) + :param value_constructor: The constructor to create the value model (used by actors and learners) + :param draw_constructor: The constructor to create the draw model (to accept a draw or not) + :param dataset_builder_constructor: The constructor of `BaseBuilder` to set the required proto fields + :param adapter_constructor: The constructor to build the adapter to query orders, values and policy details + :param algorithm_constructor: The constructor to build the algorithm to train the model + :param reward_fn: The reward function to use (Instance of.models.self_play.reward_functions`). + :param flags: The parsed flags (Tensorflow arguments) + :param cluster_config: The cluster configuration to use for distributed training + :param process_pool: Optional. A ProcessPoolExecutor that was forked before TF and gRPC were loaded. + :type policy_constructor: diplomacy_research.models.policy.base_policy_model.BasePolicyModel.__class__ + :type value_constructor: diplomacy_research.models.value.base_value_model.BaseValueModel.__class__ + :type draw_constructor: diplomacy_research.models.draw.base_draw_model.BaseDrawModel.__class__ + :type dataset_builder_constructor: diplomacy_research.models.datasets.base_builder.BaseBuilder.__class__ + :type adapter_constructor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type algorithm_constructor: diplomacy_research.models.self_play.algorithms.base_algorithm.BaseAlgorithm.__class__ # pylint: disable=line-too-long + :type reward_fn: diplomacy_research.models.self_play.reward_functions.AbstractRewardFunction + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + :type process_pool: diplomacy_research.utils.executor.ProcessPoolExecutor + """ + # pylint: disable=too-many-arguments + self.server = None + self.model = None + self.queue_dataset = None # type: QueueDataset + self.adapter = None + self.algorithm = None + self.reward_fn = reward_fn + self.eval_reward_fns = [getattr(reward_functions, rwd_name)() for rwd_name in flags.eval_reward_fns.split(',')] + self.advantage_fn = None + self.flags = flags + self.cluster_config = cluster_config + self.process_pool = process_pool + self.dataset_builder = dataset_builder_constructor(extra_proto_fields=algorithm_constructor.get_proto_fields()) + self.signature = adapter_constructor.get_signature() + self.proto_fields = self.dataset_builder.proto_fields + + # Constructors + self.policy_constructor = policy_constructor + self.value_constructor = value_constructor + self.draw_constructor = draw_constructor + self.dataset_builder_constructor = dataset_builder_constructor + self.adapter_constructor = adapter_constructor + self.algorithm_constructor = algorithm_constructor + + # Sentinel - Monitors the TF serving server and acts as a proxy to send requests to it + # Aggregator - Receives games from the actors on different processes and saves them to disk / memory_buffer + # There is one sentinel per tf serving server, there might be multiple serving server launched from a process + # So we use a serving_id to differentiate between the different serving_ids + self.sentinels = {} # {serving_id: Process} + self.thread_pipes = {} # {serving_id: Pipe} + self.sentinel_pipes = {} # {serving_id: Pipe} + self.aggregator = {'train': None, 'eval': None} # {'train': Process, 'eval': Process} + + # Train thread is a thread to generate an infinite number of games + # Eval thread is a thread that automatically generates stats every 'x' version updates + self.train_thread = None + self.eval_thread = None + + self.session = None + self.server = None + self.config_proto = None + self.saver = None + self.restore_saver = None + self.memory_buffer = None # type: MemoryBuffer + + # Hooks + self.hooks = [] + self.chief_only_hooks = [] + + # Debug (batch) Mode is not possible for Reinforcement Learning + if self.flags.debug_batch: + LOGGER.warning('Debug (batch) mode in RL mode only clears the checkpoint directory (i.e. save_dir)') + self.set_debug_batch_mode() + + # Validating hparams + assert self.flags.mode in ['supervised', 'self-play', 'staggered'] + assert self.flags.eval_mode in ['supervised-1', 'supervised-0'] + + # Extracting hparams + self.hparams = flags.__dict__ + + # Stats + self.starting_time = int(time.time()) + self.last_version_time = time.time() + self.last_checkpoint_time = 0 + self.last_stats_time = 0 + self.checkpoint_every = 600 + self.stats_every = 60 + self.stats = {} + self.replay_samples = [] + + # Tensorboard + self.placeholders = {} + self.summaries = {} + self.merge_op = None + self.writers = {} + + def set_debug_batch_mode(self): + """ Puts the RL training in debug mode (i.e. only deletes the save_dir folder) """ + if os.path.exists(self.flags.save_dir): + shutil.rmtree(self.flags.save_dir) + + @gen.coroutine + def start(self): + """ Starts training the RL model """ + if not is_ioloop_running(): + ioloop.IOLoop().run_sync(self.start) + return + + # Handling CTRL+C + def signal_handler(*args): + """ Handles SIGINT and SIGTERM signals """ + del args # unused argument + print('INFO - CTRL-C received. Stopping training.') # Not using LOGGER, might be already closed + for sentinel in self.sentinels.values(): + if sentinel is not None: + sentinel.terminate() + for process in self.aggregator.values(): + if process is not None: + process.terminate() + if self.process_pool is not None: + self.process_pool.shutdown() + kill_processes_using_port(get_tf_serving_port(self.cluster_config, serving_id=0)) + kill_processes_using_port(get_tf_serving_port(self.cluster_config, serving_id=1)) + if self.model and getattr(self.model, 'sess', None) is not None: + self.model.sess.close() # Should trigger the SessionRunHooks + sys.exit(0) + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + if not self.cluster_config: + yield start_standalone_training(self) + else: + yield start_distributed_training(self) + + # ---------------------------------------------------- + # Public Methods - Utilities + # ---------------------------------------------------- + @staticmethod + def run_without_hooks(sess, fetches, feed_dict=None): + """ Executes a raw TensorFlow session without executing the registered hooks + :param sess: The wrapped TensorFlow session. + :param fetches: The fetches to retrieve from the session + :param feed_dict: The feed_dict to pass to the session + """ + return ReinforcementTrainer.run_func_without_hooks(sess, lambda _sess: _sess.run(fetches, feed_dict=feed_dict)) + + @staticmethod + def run_func_without_hooks(sess, func): + """ Executes a function that depends on a raw TensorFlow session without hooks + :param sess: The wrapped TensorFlow session. + :param func: A function to execute (args: session [the raw TF session]) + """ + if hasattr(sess, 'run_step_fn'): + return sess.run_step_fn(lambda step_context: func(step_context.session)) + return func(sess) diff --git a/diplomacy_research/models/training/supervised/__init__.py b/diplomacy_research/models/training/supervised/__init__.py new file mode 100644 index 0000000..5bf4472 --- /dev/null +++ b/diplomacy_research/models/training/supervised/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Supervised Training """ +from .trainer import SupervisedTrainer diff --git a/diplomacy_research/models/training/supervised/common.py b/diplomacy_research/models/training/supervised/common.py new file mode 100644 index 0000000..30cf183 --- /dev/null +++ b/diplomacy_research/models/training/supervised/common.py @@ -0,0 +1,429 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Supervised - Common ops + - Class responsible for implementing build operations (common among standalone and distributed training) +""" +from enum import Enum +import logging +import os +import pickle +import shutil +import sys +from threading import Thread +from diplomacy_research.models.base_model import BaseModel +from diplomacy_research.models.datasets.supervised_dataset import SupervisedDataset +from diplomacy_research.models.training.memory_buffer import MemoryBuffer +from diplomacy_research.utils.checkpoint import build_saved_model +from diplomacy_research.utils.cluster import kill_processes_using_port, is_port_opened + +# Constants +LOGGER = logging.getLogger(__name__) + +class ProfilingMode(Enum): + """ Enumeration of profiling modes """ + GRAPH = 'graph' + OPERATION = 'op' + SCOPE = 'scope' + DEVICE = 'device' + +def build_summaries(trainer): + """ Builds the fields required to log stats in TensorBoard + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf, get_placeholder + escape = lambda str: str.replace('[', '.').replace(']', '.') + + # Make sure we already have a model + assert isinstance(trainer.model, BaseModel), 'A model is required to build the summaries' + + # Retrieving evaluation tags + evaluation_tags = trainer.model.get_evaluation_tags() + assert len(evaluation_tags) == trainer.model.nb_evaluation_loops, \ + 'Expected %d evaluation tags, Got %d.' % (trainer.model.nb_evaluation_loops, len(evaluation_tags)) + + # Creating placeholders and summaries + for eval_loop_ix in range(trainer.model.nb_evaluation_loops): + for tag_name in evaluation_tags[eval_loop_ix]: + if tag_name not in trainer.placeholders: + trainer.placeholders[tag_name] = get_placeholder(escape(tag_name), tf.float32, (), for_summary=True) + trainer.summaries[tag_name] = tf.summary.scalar(escape(tag_name), trainer.placeholders[tag_name]) + + # Creating merge_op + for eval_loop_ix in range(trainer.model.nb_evaluation_loops): + merge_summaries = [] + for tag_name in evaluation_tags[eval_loop_ix]: + merge_summaries += [trainer.summaries[tag_name]] + trainer.merge_ops[eval_loop_ix] = tf.summary.merge(merge_summaries) + + # Creating writers + os.makedirs(os.path.join(trainer.flags.save_dir, 'summary'), exist_ok=True) + trainer.writers['train'] = tf.summary.FileWriter(os.path.join(trainer.flags.save_dir, 'summary', 'train')) + trainer.writers['valid'] = tf.summary.FileWriter(os.path.join(trainer.flags.save_dir, 'summary', 'valid')) + trainer.writers['aggreg'] = tf.summary.FileWriter(os.path.join(trainer.flags.save_dir, 'summary', 'aggreg')) + +def build_model_and_dataset(trainer): + """ Builds the model and the dataset + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf + + trainer.supervised_dataset = SupervisedDataset(batch_size=trainer.flags.batch_size, + dataset_builder=trainer.dataset_builder, + checkpoint_dir=trainer.flags.save_dir, + cluster_config=trainer.cluster_config, + debug_batch=trainer.flags.debug_batch, + do_infinite_training=trainer.flags.use_verbs, + perc_epoch_for_training=trainer.flags.perc_epoch_for_training) + + # Policy Model + assert trainer.policy_constructor is not None, 'A policy constructor is required to build the model.' + trainer.model = trainer.policy_constructor(dataset=trainer.supervised_dataset, + hparams=trainer.hparams) + + # Value Model + if trainer.value_constructor: + trainer.model = trainer.value_constructor(parent_model=trainer.model, + dataset=trainer.supervised_dataset, + hparams=trainer.hparams) + + # Draw Model + if trainer.draw_constructor: + trainer.model = trainer.draw_constructor(parent_model=trainer.model, + dataset=trainer.supervised_dataset, + hparams=trainer.hparams) + + # Finalizing and validation + trainer.model.finalize_build() + trainer.model.validate() + + # Building a list of cost, with the scope to optimize + cost_and_scope = [] + + # Sum of individual losses + scope = ['policy'] + ignored_scope = None + total_loss = trainer.flags.policy_coeff * trainer.model.outputs['policy_loss'] + if trainer.value_constructor: + scope += ['value'] + total_loss += trainer.flags.value_coeff * trainer.model.outputs['value_loss'] + if trainer.draw_constructor: + scope += ['draw'] + total_loss += trainer.flags.draw_coeff * trainer.model.outputs['draw_loss'] + total_loss = tf.identity(total_loss, name='total_loss') + cost_and_scope += [(total_loss, scope, ignored_scope)] + + # Creating optimizer + optimizer_op = trainer.model.create_optimizer_op(cost_and_scope, max_gradient_norm=trainer.flags.max_gradient_norm) + trainer.model.add_output('optimizer_op', optimizer_op) + + # Installing hooks + session_hook = trainer.supervised_dataset.make_session_run_hook() + if session_hook is not None: + trainer.hooks += [session_hook] + +def build_train_server(trainer): + """ Builds the Tensorflow tf.train.Server + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + if not trainer.cluster_config: + return + + from diplomacy_research.utils.tensorflow import tf + task_address = trainer.cluster_config.cluster_spec[trainer.cluster_config.job_name][trainer.cluster_config.task_id] + + # Making port is not used by another process + task_port = int(task_address.split(':')[1]) + LOGGER.info('Killing any processes that have port %d opened.', task_port) + kill_processes_using_port(task_port) + + # Starting server + LOGGER.info('Starting server with task id %d - Address: %s', trainer.cluster_config.task_id, task_address) + LOGGER.info('Checking if port %d is already opened: %s', task_port, str(is_port_opened(task_port))) + trainer.server = tf.train.Server(tf.train.ClusterSpec(trainer.cluster_config.cluster_spec), + job_name=trainer.cluster_config.job_name, + task_index=trainer.cluster_config.task_id, + protocol=trainer.cluster_config.protocol) + LOGGER.info('Server successfully started. Trying to contact other nodes...') + +def build_config_proto(trainer): + """ Builds the session config proto + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf + gpu_options = tf.GPUOptions() + if trainer.flags.allow_gpu_growth: + LOGGER.info('"allow_gpu_growth" flag set. GPU memory will not be pre-allocated and will grow as needed.') + gpu_options = tf.GPUOptions(allow_growth=True) + trainer.config_proto = {'allow_soft_placement': True, 'gpu_options': gpu_options} + if trainer.cluster_config: + trainer.config_proto['device_filters'] = ['/job:ps', '/job:worker/task:%d' % trainer.cluster_config.task_id] + if trainer.flags.profile: + trainer.config_proto['log_device_placement'] = True + if trainer.flags.use_xla: + LOGGER.info('Using XLA to compile the graph.') + graph_options = tf.GraphOptions() + graph_options.optimizer_options.global_jit_level = tf.OptimizerOptions.ON_1 # pylint: disable=no-member + trainer.config_proto['graph_options'] = graph_options + +def build_memory_buffer(trainer): + """ Builds the memory buffer (barrier) and connects to it + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + if trainer.cluster_config: + trainer.memory_buffer = MemoryBuffer(trainer.cluster_config, trainer.hparams) + +def save_model(trainer, sess, start_of_epoch=False): + """ Saves the current graph to a saved model checkpoint on disk (using a separate thread) + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session + :param start_of_epoch: Boolean that indicates that we are saving the model at the start of a new epoch. + :return: Nothing + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf + if not isinstance(sess, tf.Session): + trainer.run_func_without_hooks(sess, lambda _sess: save_model(trainer, _sess)) + return + + assert isinstance(sess, tf.Session), 'Session must be a raw TensorFlow session' + version_id = int(trainer.progress[0]) + (0 if start_of_epoch else 1) + output_dir = os.path.join(trainer.flags.save_dir, 'history') + graph = tf.get_default_graph() + model_thread = Thread(target=build_saved_model, + kwargs={'saved_model_dir': output_dir, + 'version_id': version_id, + 'signature': trainer.signature, + 'proto_fields': trainer.dataset_builder.get_proto_fields(), + 'graph': graph, + 'session': sess, + 'history_saver': trainer.history_saver}, + daemon=True) + model_thread.start() + +def decay_rates(trainer, sess): + """ Decays the learning rate exponentially + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session. + :return: Nothing + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + nb_completed_epochs, current_progress = trainer.progress + total_progress = nb_completed_epochs + current_progress + + # Decaying learning rate exponentially + if hasattr(trainer.model, 'decay_learning_rate'): + new_learning_rate = trainer.flags.learning_rate * trainer.flags.lr_decay_factor ** total_progress + trainer.run_without_hooks(sess, + trainer.model.decay_learning_rate, + feed_dict={trainer.model.placeholders['learning_rate']: new_learning_rate}) + trainer.learning_rate = new_learning_rate + +def run_gradient_step(trainer, sess): + """ Runs a regular gradient step in the model + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session. + :return: The step loss + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf + try: + session_args = trainer.model.get_session_args() + fetches = trainer.run_session(sess, session_args) + loss = sum([fetch_value for fetch_name, fetch_value in fetches.items() if 'loss' in fetch_name]) + trainer.supervised_dataset.take_local_step() + trainer.nb_oom_steps = 0 + + # Out of Memory - Skipping batch unless we had 50 consecutive OOM batches + except tf.errors.ResourceExhaustedError as err: + trainer.nb_oom_steps += 1 + LOGGER.warning('run_gradient_step() triggered an ResourceExhaustedError / Out of Memory.') + if trainer.nb_oom_steps >= 50: + raise err + loss = 0. + trainer.supervised_dataset.take_local_step() + + return loss + +def run_profile_step(trainer, sess): + """ Runs a profiling step in the model and starts the profiler if needed + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session. + :return: The step loss and the step number. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf, timeline + + # Making sure a valid profiling mode was provided + assert trainer.flags.profile in [mode.value for mode in ProfilingMode], 'Invalid profiling mode detected.' + + # We can exit here if we are only profiling device placement (no need to run a step) + if trainer.flags.profile == ProfilingMode.DEVICE.value: + LOGGER.info('Done profiling in "device" mode. Exiting.') + trainer.supervised_dataset.close() + sys.exit(0) + + # Starting profiler and creating output directory + if not trainer.profiler: + LOGGER.info('Profiling model in "%s" mode', trainer.flags.profile) + trainer.profiler = tf.profiler.Profiler(sess.graph) + if os.path.exists(os.path.join(trainer.flags.save_dir, 'profile')): + shutil.rmtree(os.path.join(trainer.flags.save_dir, 'profile')) + os.mkdir(os.path.join(trainer.flags.save_dir, 'profile')) + + # Running a profiling step and saving it + trainer.nb_profile_steps += 1 + run_meta = tf.RunMetadata() + session_args = trainer.model.get_session_args() + fetches = trainer.run_session(sess, session_args, run_metadata=run_meta) + loss = sum([fetch_value for fetch_name, fetch_value in fetches.items() if 'loss' in fetch_name]) + trainer.supervised_dataset.take_local_step() + + # Profiling the parameters + if trainer.flags.profile == ProfilingMode.SCOPE.value: + trainer.profiler.add_step(trainer.nb_profile_steps, run_meta) + trainer.profiler.profile_name_scope(options=(tf.profiler.ProfileOptionBuilder.trainable_variables_parameter())) + + # Profiling the op timing + if trainer.flags.profile == ProfilingMode.OPERATION.value: + trainer.profiler.add_step(trainer.nb_profile_steps, run_meta) + opts = tf.profiler.ProfileOptionBuilder.time_and_memory() + trainer.profiler.profile_operations(options=opts) + + # Profile the graph with a timeline + if trainer.flags.profile == ProfilingMode.GRAPH.value: + output_file_path = os.path.join(trainer.flags.save_dir, + 'profile', + 'timeline_%d.json' % trainer.nb_profile_steps) + LOGGER.info('Writing timeline to %s', output_file_path) + fetched_timeline = timeline.Timeline(run_meta.step_stats) # pylint: disable=no-member + chrome_trace = fetched_timeline.generate_chrome_trace_format(run_meta) + with open(output_file_path, 'w') as output_file: + output_file.write(chrome_trace) + + # Returning loss + return loss + +def run_next_decoded_training_batch(trainer, sess): + """ Runs the next training batch and decodes the results + :param trainer: A supervised trainer instance. + :param sess: The Tensorflow session + :return: A tuple of 1) The evaluation_results ordered dictionary from the evaluate() method + 2) The detailed evaluation results ordered dictionary from the evaluate() method + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + return run_next_decoded_batch(trainer, sess, is_training=True) + +def run_next_decoded_validation_batch(trainer, sess, eval_loop_ix): + """ Runs the next validation batch and decodes the results + :param trainer: A supervised trainer instance. + :param sess: The Tensorflow session + :param eval_loop_ix: The index of the validation loop (0-index) if the model supports multiple passes + over the validation set + :return: A tuple of 1) The evaluation_results ordered dictionary from the evaluate() method + 2) The detailed evaluation results ordered dictionary from the evaluate() method + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + return run_next_decoded_batch(trainer, sess, is_training=False, eval_loop_ix=eval_loop_ix) + +def run_next_decoded_batch(trainer, sess, is_training, eval_loop_ix=None): + """ Runs the next batch and decodes the results + :param trainer: A supervised trainer instance. + :param sess: The Tensorflow session + :param is_training: Boolean that indicates if we are in the training or validation set. + :param eval_loop_ix: The index of the validation loop (0-index) if the model supports multiple passes + over the validation set + :return: A tuple of 1) The evaluation_results ordered dictionary from the evaluate() method + 2) The detailed evaluation results ordered dictionary from the evaluate() method + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + session_args = trainer.model.get_session_args(decode=True, eval_loop_ix=eval_loop_ix) + fetches = trainer.run_func_without_hooks(sess, lambda _sess: trainer.run_session(_sess, session_args)) + decoded_results = trainer.model.decode(**fetches) + results, detailed_results = trainer.model.evaluate(decoded_results, + session_args.get('feed_dict', {}), + eval_loop_ix=-1 if is_training else eval_loop_ix, + incl_detailed=not is_training) + trainer.supervised_dataset.take_local_step() + return results, detailed_results + +def load_performance_data(trainer): + """ Loads performance data from disk (to detect early stopping) + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + performance_filename = os.path.join(trainer.flags.save_dir, 'performance.pkl') + if os.path.exists(performance_filename): + with open(performance_filename, 'rb') as performance: + trainer.performance = pickle.load(performance) + +def has_already_early_stopped(trainer): + """ Determines if training has already stopped due to early stopping + :param trainer: A supervised trainer instance. + :return: Boolean that indicates if training has already stopped due to early stopping + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + early_stopping_file = os.path.join(trainer.flags.save_dir, 'stopped_early.txt') + return os.path.exists(early_stopping_file) + +def can_stop_due_to_early_stopping(trainer): + """ Determines if we can stop training due to early stopping + :param trainer: A supervised trainer instance. + :return: Boolean that indicates if we can stop training due to early stopping. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + if has_already_early_stopped(trainer): + LOGGER.info('Early stopping file detected on disk. Stopping early.') + return True + if not trainer.flags.early_stopping_stop_after: + return False + load_performance_data(trainer) + + # Finding the latest model who performed the best on any threshold + latest_epoch = 0 + current_epoch = int(trainer.progress[0]) + 1 + for tag_type, tag_name in trainer.model.get_early_stopping_tags(): + best_value = float('-inf') if tag_type == 'max' else float('inf') + best_epoch = -1 + + # Tag not found in performance data - Skipping + if tag_name not in trainer.performance: + LOGGER.warning('Unable to find tag %s in performance data for early stopping.', tag_name) + continue + + # Finding best epoch + for epoch_ix in range(1, current_epoch + 1): + if epoch_ix not in trainer.performance[tag_name]: + continue + if tag_type == 'max' and trainer.performance[tag_name][epoch_ix] > (1.005 * best_value): + best_value = trainer.performance[tag_name][epoch_ix] + best_epoch = epoch_ix + elif tag_type == 'min' and trainer.performance[tag_name][epoch_ix] < (0.995 * best_value): + best_value = trainer.performance[tag_name][epoch_ix] + best_epoch = epoch_ix + + # Setting latest epoch + LOGGER.info('Best epoch for "%s" is %d', tag_name, best_epoch) + latest_epoch = max(latest_epoch, best_epoch) + + # Stopping if we did 'stop_after' epochs since the latest_epoch + # If stopping early, leaving a file on disk to avoid continuing training if training is restarted + can_stop_early = bool((current_epoch - latest_epoch) >= trainer.flags.early_stopping_stop_after) + if can_stop_early: + open(os.path.join(trainer.flags.save_dir, 'stopped_early.txt'), 'a').close() + return can_stop_early diff --git a/diplomacy_research/models/training/supervised/distributed.py b/diplomacy_research/models/training/supervised/distributed.py new file mode 100644 index 0000000..7c3cf40 --- /dev/null +++ b/diplomacy_research/models/training/supervised/distributed.py @@ -0,0 +1,461 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Supervised - Distributed training + - Class responsible for training a model in a distributed setting +""" +from collections import OrderedDict +import logging +import os +import pickle +import shutil +import time +from diplomacy_research.models.datasets.supervised_dataset import TrainingMode +from diplomacy_research.models.training.memory_buffer.memory_buffer import start_redis_server +from diplomacy_research.models.training.memory_buffer.barrier import clear_barrier, set_barrier_status, \ + workers_on_barrier, wait_for_barrier, can_proceed_through_barrier +from diplomacy_research.models.training.supervised.common import build_model_and_dataset, build_summaries, \ + build_config_proto, build_train_server, build_memory_buffer, decay_rates, save_model, run_gradient_step, \ + run_next_decoded_training_batch, run_next_decoded_validation_batch, load_performance_data, \ + can_stop_due_to_early_stopping +from diplomacy_research.models.training.supervised.statistics import display_training_stats, display_validation_stats, \ + display_final_validation_stats +from diplomacy_research.settings import SESSION_RUN_TIMEOUT + +# Constants +LOGGER = logging.getLogger(__name__) +__TRAIN_BARRIER__ = 'supervised.train' +__EVAL_BARRIER__ = 'supervised.eval' + + +def start_distributed_training(trainer): + """ Starts training in distributed mode. + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + # Making sure debug (tensorflow and batch) and profile are not set + if trainer.flags.debug: + raise RuntimeError('Debug (TensorFlow) mode is not supported in distributed mode.') + if trainer.flags.debug_batch: + raise RuntimeError('Debug (batch) mode is not supported in distributed mode.') + if trainer.flags.profile: + raise RuntimeError('Profile mode is not supported in distributed mode.') + + # Dispatching + if trainer.cluster_config.job_name == 'ps': + start_parameter_server(trainer) + elif trainer.cluster_config.job_name == 'worker': + start_worker(trainer) + elif trainer.cluster_config.job_name == 'redis': + start_redis_server(trainer, import_db=False) + else: + raise RuntimeError('Invalid configuration detected.') + +def start_parameter_server(trainer): + """ Starts a parameter server + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + build_train_server(trainer) + LOGGER.info('Parameter server is now ready ...') + trainer.server.join() + +def start_worker(trainer): + """ Starts a worker + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf, SupervisedStartTrainingHook + + # Builds the model and the dataset + build_model_and_dataset(trainer) + build_summaries(trainer) + build_config_proto(trainer) + build_train_server(trainer) + trainer.chief_only_hooks += [SupervisedStartTrainingHook(trainer)] + + # Builds the memory buffer, so we can use it as a barrier + build_memory_buffer(trainer) + + # Adding SyncReplicas Hook + if isinstance(trainer.model.optimizer, tf.train.SyncReplicasOptimizer): + LOGGER.info('Detected SyncReplicasOptimizer. Automatically adding required hooks.') + session_hook = trainer.model.optimizer.make_session_run_hook(trainer.cluster_config.is_chief) + if session_hook is not None: + trainer.hooks += [session_hook] + + # Starts the session and training loop + try: + saver = tf.train.Saver(max_to_keep=3, restore_sequentially=True, pad_step_number=True) + trainer.history_saver = tf.train.Saver(max_to_keep=999) # To save historical checkpoints in a sep. directory + nb_total_steps_per_epoch = trainer.supervised_dataset.nb_total_steps_per_epoch + + # Clearing both barriers + if trainer.cluster_config.is_chief: + clear_barrier(trainer.memory_buffer, __TRAIN_BARRIER__, cleared_time=0) + clear_barrier(trainer.memory_buffer, __EVAL_BARRIER__, cleared_time=0) + + # Starting monitored training session and restoring model from checkpoint + with tf.train.MonitoredTrainingSession(master=trainer.server.target, + is_chief=trainer.cluster_config.is_chief, + checkpoint_dir=trainer.flags.save_dir, + scaffold=tf.train.Scaffold(init_op=tf.global_variables_initializer(), + saver=saver), + log_step_count_steps=100 * nb_total_steps_per_epoch, + hooks=trainer.hooks, + chief_only_hooks=trainer.chief_only_hooks, + config=tf.ConfigProto(**trainer.config_proto), + save_summaries_steps=None, + save_summaries_secs=None) as sess: + # Saving session + trainer.model.sess = sess + LOGGER.info('Session successfully started.') + + # Restoring dataset status from status file + trainer.supervised_dataset.load_status() + load_performance_data(trainer) + + # Getting status from dataset + trainer.progress = trainer.supervised_dataset.get_progress() + + # Running training + while True: + if hasattr(sess, 'should_stop') and sess.should_stop(): + trainer.supervised_dataset.close() + break + + # Running training epoch, then validation epoch + run_training_epoch(trainer, sess) + run_validation_epoch(trainer, sess) + + # Stops if early stopping is triggered + if can_stop_due_to_early_stopping(trainer): + LOGGER.info('Early stopping criteria triggered. Stopping training.') + break + + # CTRL-C closes the session to force a checkpoint + # Tensorflow will throw a Runtime Error because the session is already closed. + except RuntimeError as error: + if trainer.model.sess is not None and trainer.model.sess._sess is not None: # pylint: disable=protected-access + raise error + else: + LOGGER.info('We have successfully trained the supervised model.') + +def run_training_epoch(trainer, sess): + """ Runs a training epoch + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf + + # Initializing the dataset to use the training set + if trainer.supervised_dataset.is_done: + trainer.supervised_dataset.start_training_mode(sess) + elif not trainer.supervised_dataset.iterator_initialized: + trainer.supervised_dataset.initialize_iterator(sess) + + # If another dataset was loaded from load_status(), skipping Training + if trainer.supervised_dataset.training_mode != TrainingMode.TRAINING: + return + + # Indicating to the barrier that we are starting training + if trainer.cluster_config.is_chief: + clear_barrier(trainer.memory_buffer, __EVAL_BARRIER__) + set_barrier_status(trainer.memory_buffer, __TRAIN_BARRIER__, 0) + done, incomplete = workers_on_barrier(trainer.memory_buffer, __TRAIN_BARRIER__) + LOGGER.info('Starting training - Barrier Status: Done %d - Incomplete: %d', done, incomplete) + + # For the first epoch, we only want to run validation to get an idea of performance with random weights + nb_epochs_completed, _ = trainer.supervised_dataset.get_progress() + if not nb_epochs_completed: + LOGGER.info('Only running validation for the first epoch (to get pre-training performance).') + trainer.supervised_dataset.mark_as_done() + + # Variable for stats and synchronization + done_training = False + done_time = 0 + nb_long_steps = 0 + nb_workers = trainer.cluster_config.count('worker') + trainer.status_time = int(time.time()) + trainer.step_last_status = 0 + last_barrier_status = 0. + + # Running epoch + while True: + current_time = int(time.time()) + + # For barriers, printing status every 30 secs + print_barrier_status = False + if time.time() > (last_barrier_status + 30): + last_barrier_status = time.time() + print_barrier_status = True + + # Checking if we need to stop training, or are done with the current epoch + if hasattr(sess, 'should_stop') and sess.should_stop(): + trainer.supervised_dataset.close() + break + if trainer.supervised_dataset.is_done: + if not done_training: + set_barrier_status(trainer.memory_buffer, __TRAIN_BARRIER__, 1) + done, incomplete = workers_on_barrier(trainer.memory_buffer, __TRAIN_BARRIER__) + LOGGER.info('Waiting for barrier Status: Done %d - Incomplete: %d', done, incomplete) + done_training = True + done_time = time.time() + + # For the first epoch, everyone blocks until all workers have signaled the barrier + # This is to prevent a worker from training before we first run the evaluation loop + if not nb_epochs_completed: + wait_for_barrier(trainer.memory_buffer, __TRAIN_BARRIER__, job_name='worker', min_done=nb_workers) + break + + # Chief can break if everyone has marked as done + if trainer.cluster_config.is_chief and can_proceed_through_barrier(trainer.memory_buffer, + __TRAIN_BARRIER__, + job_name='worker', + min_done=nb_workers, + print_status=print_barrier_status): + break + + # Others can only break when the barrier is cleared + if can_proceed_through_barrier(trainer.memory_buffer, + __TRAIN_BARRIER__, + last_cleared=done_time, + print_status=print_barrier_status): + break + + # OutOfRangeError is thrown when we reach the end of the dataset + try: + run_gradient_step(trainer, sess) + except tf.errors.OutOfRangeError: + trainer.supervised_dataset.mark_as_done() + except tf.errors.DeadlineExceededError: + nb_long_steps += 1 + if nb_long_steps >= 5 or not done_training: + LOGGER.warning('run_gradient_step took more than %d ms to run. Timeout error.', SESSION_RUN_TIMEOUT) + + # Printing status + if (current_time - trainer.status_time) > trainer.status_every \ + or (trainer.supervised_dataset.is_done and not done_training): + + # Updating stats + elasped_time = current_time - trainer.status_time + elapsed_steps = trainer.supervised_dataset.steps_in_current_mode - trainer.step_last_status + trainer.status_time = current_time + trainer.step_last_status = trainer.supervised_dataset.steps_in_current_mode + prev_nb_epochs_completed = trainer.progress[0] + trainer.progress = trainer.supervised_dataset.get_progress() + epoch_eta = 0 + if elapsed_steps > 0: + epoch_eta = int(trainer.supervised_dataset.nb_total_steps_per_epoch * elasped_time / elapsed_steps) + + # Decaying rates + decay_rates(trainer, sess) + + # Displaying status + try: + results, _ = run_next_decoded_training_batch(trainer, sess) + display_training_stats(trainer, sess, results, epoch_eta) + except tf.errors.OutOfRangeError: + trainer.supervised_dataset.mark_as_done() + + # Saving dataset status to disk (to be able to resume) + trainer.supervised_dataset.save_status() + + # Saving model in infinite training + if trainer.supervised_dataset.do_infinite_training \ + and trainer.cluster_config.is_chief \ + and nb_epochs_completed > prev_nb_epochs_completed: + save_model(trainer, sess, start_of_epoch=True) + +def run_validation_epoch(trainer, sess): + """ Runs a validation epoch + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf + + # Initializing the dataset to use the validation set + if trainer.supervised_dataset.training_mode != TrainingMode.VALIDATION: + trainer.supervised_dataset.start_validation_mode(sess) + elif not trainer.supervised_dataset.iterator_initialized: + trainer.supervised_dataset.initialize_iterator(sess) + + # If there are no batches in the validation set, aborting + nb_batches = trainer.supervised_dataset.nb_validation_steps_per_epoch + if not nb_batches: + return + + # Variables for stats + results, detailed_results = OrderedDict(), OrderedDict() + batch_results, batch_detailed_results = OrderedDict(), OrderedDict() + trainer.progress = trainer.supervised_dataset.get_progress() + + # Indicating to the barrier that we are starting training + if trainer.cluster_config.is_chief: + clear_barrier(trainer.memory_buffer, __TRAIN_BARRIER__) + set_barrier_status(trainer.memory_buffer, __EVAL_BARRIER__, 0) + done, incomplete = workers_on_barrier(trainer.memory_buffer, __EVAL_BARRIER__) + LOGGER.info('Starting validation - Barrier Status: Done %d - Incomplete: %d', done, incomplete) + + # For each loop in the validation set + for eval_loop_ix in range(trainer.model.nb_evaluation_loops): + last_status_perc = 0. + + # Making sure the dataset is initialized + if not trainer.supervised_dataset.iterator_initialized or trainer.supervised_dataset.is_done: + trainer.supervised_dataset.initialize_iterator(sess) + + # ---- Starting Validation Epoch ----- + print('-' * 80) + + # Running each batch sequentially + for batch_ix in range(nb_batches): + + # Checking if we need to stop training, or are done with the current eval_loop_ix + if hasattr(sess, 'should_stop') and sess.should_stop(): + trainer.supervised_dataset.close() + break + if trainer.supervised_dataset.is_done: + break + + # Running single batch + try: + batch_results, batch_detailed_results = run_next_decoded_validation_batch(trainer, sess, eval_loop_ix) + trainer.progress = trainer.progress[0], (batch_ix + 1) / max(1, nb_batches) + + # Storing batch results + for result_name, result_value in batch_results.items(): + results.setdefault(result_name, []) + if isinstance(result_value, list): + results[result_name] += result_value + else: + results[result_name] += [result_value] + for result_name, result_value in batch_detailed_results.items(): + assert isinstance(result_value, list), 'Detailed results must be a list.' + detailed_results.setdefault(result_name, []) + detailed_results[result_name] += result_value + + except tf.errors.OutOfRangeError: + trainer.supervised_dataset.mark_as_done() + except tf.errors.DeadlineExceededError: + LOGGER.warning('Validation took more than %d ms to run. Timeout error.', SESSION_RUN_TIMEOUT) + + # Printing status every 10% completed + current_perc_completed = (batch_ix + 1) / max(1., nb_batches) + if current_perc_completed > last_status_perc + 0.10: + last_status_perc = round(current_perc_completed, 1) + display_validation_stats(trainer, sess, batch_results, batch_ix, eval_loop_ix) + trainer.supervised_dataset.save_status() + + # Post-processing eval detailed results + detailed_results = trainer.model.post_process_results(detailed_results) + + # Printing final validation status, and freezing graph + display_final_validation_stats(trainer, sess, results, detailed_results, aggregated=False) + if trainer.cluster_config.is_chief: + save_model(trainer, sess) + trainer.supervised_dataset.mark_as_done() + + # ---- Done Validation Epoch ----- + print('-' * 80) + + # Stopping barrier and dumping results to disk for chief to aggregate + set_barrier_status(trainer.memory_buffer, __EVAL_BARRIER__, 1) + save_results_to_disk(trainer, results, detailed_results) + + # Non-Chief - Wait for chief to do aggregation + if not trainer.cluster_config.is_chief: + done, incomplete = workers_on_barrier(trainer.memory_buffer, __EVAL_BARRIER__) + LOGGER.info('Waiting for barrier Status: Done %d - Incomplete: %d', done, incomplete) + wait_for_barrier(trainer.memory_buffer, __EVAL_BARRIER__) + return + + # Chief - Performs aggregation across all workers + aggregate_results(trainer, sess) + print('-' * 80) + +def save_results_to_disk(trainer, results, detailed_results): + """ Save the validation epoch for each worker to disk + :param trainer: A supervised trainer instance. + :param results: An ordered dict containing a list of (weight, results) obtained during the epoch. + :param detailed_results: An ordered dict containing a list of all details evaluation results. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + nb_tries = 0 + output_filename = 'results.%d.pkl' % trainer.cluster_config.task_id + + # Waiting for file on disk before continuing + while not os.path.exists(output_filename) and nb_tries < 5: + with open(os.path.join(trainer.flags.save_dir, 'validation', output_filename), 'wb') as file: + pickle.dump({'results': results, 'detailed_results': detailed_results}, file, pickle.HIGHEST_PROTOCOL) + time.sleep(5) + nb_tries += 1 + +def aggregate_results(trainer, sess): + """ Aggregating validation results from all workers + :param trainer: A supervised trainer instance. + :param sess: The Tensorflow session. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + results, detailed_results = OrderedDict(), OrderedDict() + + # Waiting for all workers to complete validation before aggregating + done, incomplete = workers_on_barrier(trainer.memory_buffer, __EVAL_BARRIER__) + LOGGER.info('Waiting for workers to aggregate results: Done %d - Incomplete: %d', done, incomplete) + wait_for_barrier(trainer.memory_buffer, __EVAL_BARRIER__, + job_name='worker', + min_done=trainer.cluster_config.num_shards) + + # All workers are done, aggregating results + for worker_id in range(trainer.cluster_config.num_shards): + input_filename = 'results.%d.pkl' % worker_id + input_filename = os.path.join(trainer.flags.save_dir, 'validation', input_filename) + nb_tries = 0 + + # Trying to access file for 60 seconds + while nb_tries < 6: + if os.path.exists(input_filename): + break + nb_tries += 1 + time.sleep(10) + + # File does not exist or is empty, Skipping + if not os.path.exists(input_filename) or not os.path.getsize(input_filename): + LOGGER.warning('Unable to find file %s. Skipping this worker.', input_filename) + continue + + # Loading data and recording evaluation results + try: + with open(input_filename, 'rb') as worker_data: + worker_data = pickle.load(worker_data) + for result_name, result_value in worker_data['results'].items(): + results.setdefault(result_name, []) + results[result_name] += result_value + for result_name, result_value in worker_data['detailed_results'].items(): + detailed_results.setdefault(result_name, []) + detailed_results[result_name] += result_value + except EOFError: + LOGGER.error('The worker file %s is corrupted. Skipping.', input_filename) + + # Deleting file on disk + os.unlink(input_filename) + + # Deleting and recreating validation folder + shutil.rmtree(os.path.join(trainer.flags.save_dir, 'validation')) + os.mkdir(os.path.join(trainer.flags.save_dir, 'validation')) + + # Displaying aggregate data + print('Aggregate data from %d workers' % trainer.cluster_config.num_shards) + display_final_validation_stats(trainer, sess, results, detailed_results, aggregated=True) diff --git a/diplomacy_research/models/training/supervised/standalone.py b/diplomacy_research/models/training/supervised/standalone.py new file mode 100644 index 0000000..0efba4d --- /dev/null +++ b/diplomacy_research/models/training/supervised/standalone.py @@ -0,0 +1,279 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Supervised - Standalone training + - Class responsible for training a model in a non-distributed setting +""" +from collections import OrderedDict +import logging +import sys +import time +from diplomacy_research.models.datasets.supervised_dataset import TrainingMode +from diplomacy_research.models.training.supervised.common import build_model_and_dataset, build_summaries, \ + build_config_proto, decay_rates, save_model, run_gradient_step, run_profile_step, run_next_decoded_training_batch, \ + run_next_decoded_validation_batch, load_performance_data, can_stop_due_to_early_stopping +from diplomacy_research.models.training.supervised.statistics import display_training_stats, display_validation_stats, \ + display_final_validation_stats +from diplomacy_research.settings import SESSION_RUN_TIMEOUT + +# Constants +LOGGER = logging.getLogger(__name__) + +def start_standalone_training(trainer): + """ Starts training in standalone mode. + :param trainer: A supervised trainer instance. + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf, tf_debug + + # Builds the model and the dataset + build_model_and_dataset(trainer) + build_summaries(trainer) + build_config_proto(trainer) + + # Starts the session and training loop + try: + saver = tf.train.Saver(max_to_keep=3, restore_sequentially=True, pad_step_number=True) + trainer.history_saver = tf.train.Saver(max_to_keep=999) # To save historical checkpoints in a sep. directory + nb_total_steps_per_epoch = trainer.supervised_dataset.nb_total_steps_per_epoch + + # Starting monitored training session and restoring model from checkpoint + with tf.train.MonitoredTrainingSession(checkpoint_dir=trainer.flags.save_dir, + scaffold=tf.train.Scaffold(init_op=tf.global_variables_initializer(), + saver=saver), + log_step_count_steps=100 * nb_total_steps_per_epoch, + hooks=trainer.hooks, + chief_only_hooks=trainer.chief_only_hooks, + config=tf.ConfigProto(**trainer.config_proto), + save_summaries_steps=None, + save_summaries_secs=None) as sess: + + # Wrapping in a session debugger + if trainer.flags.debug: + sess = tf_debug.LocalCLIDebugWrapperSession(sess) + + # Saving session + trainer.model.sess = sess + LOGGER.info('Session successfully started.') + + # Restoring dataset status from status file + # If in debug (tensorflow, batch) mode, starting training with TRAINING dataset + if trainer.flags.debug or trainer.flags.debug_batch: + trainer.supervised_dataset.start_training_mode(sess) + else: + trainer.supervised_dataset.load_status() + + # Getting status from dataset + trainer.progress = trainer.supervised_dataset.get_progress() + load_performance_data(trainer) + + # Running training + while True: + if hasattr(sess, 'should_stop') and sess.should_stop(): + trainer.supervised_dataset.close() + break + + # Running training epoch, then validation epoch + run_training_epoch(trainer, sess) + run_validation_epoch(trainer, sess) + + # Stops if early stopping is triggered + if can_stop_due_to_early_stopping(trainer): + LOGGER.info('Early stopping criteria triggered. Stopping training.') + break + + # CTRL-C closes the session to force a checkpoint + # Tensorflow will throw a Runtime Error because the session is already closed. + except RuntimeError as error: + if trainer.model.sess is not None and trainer.model.sess._sess is not None: # pylint: disable=protected-access + raise error + else: + LOGGER.info('We have successfully trained the supervised model.') + +def run_training_epoch(trainer, sess): + """ Runs a training epoch + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf, ALL_ADVICE + + # Initializing the dataset to use the training set + if trainer.supervised_dataset.is_done: + trainer.supervised_dataset.start_training_mode(sess) + elif not trainer.supervised_dataset.iterator_initialized: + trainer.supervised_dataset.initialize_iterator(sess) + + # If another dataset was loaded from load_status(), skipping Training + if trainer.supervised_dataset.training_mode != TrainingMode.TRAINING: + return + + # For the first epoch, we only want to run validation to get an idea of performance with random weights + nb_epochs_completed, _ = trainer.supervised_dataset.get_progress() + if not nb_epochs_completed \ + and not trainer.flags.debug \ + and not trainer.flags.debug_batch \ + and not trainer.flags.profile: + LOGGER.info('Only running validation for the first epoch (to get pre-training performance).') + trainer.supervised_dataset.mark_as_done() + + # Variables for stats + loss = 0. + trainer.status_time = int(time.time()) + trainer.step_last_status = 0 + + # Method to run + method_to_run = run_profile_step if trainer.flags.profile else run_gradient_step + + # Running epoch + while True: + current_time = int(time.time()) + + # Checking if we need to stop training, or are done with the current epoch + if hasattr(sess, 'should_stop') and sess.should_stop(): + trainer.supervised_dataset.close() + break + if trainer.supervised_dataset.is_done: + break + + # OutOfRangeError is thrown when we reach the end of the dataset + try: + loss = method_to_run(trainer, sess) + except tf.errors.OutOfRangeError: + trainer.supervised_dataset.mark_as_done() + except tf.errors.DeadlineExceededError: + LOGGER.warning('%s took more than %d ms to run. Timeout error.', method_to_run, SESSION_RUN_TIMEOUT) + + # Printing status + if (current_time - trainer.status_time) > trainer.status_every or trainer.supervised_dataset.is_done: + + # Updating stats + elasped_time = current_time - trainer.status_time + elapsed_steps = trainer.supervised_dataset.steps_in_current_mode - trainer.step_last_status + trainer.status_time = current_time + trainer.step_last_status = trainer.supervised_dataset.steps_in_current_mode + trainer.progress = trainer.supervised_dataset.get_progress() + epoch_eta = 0 + if elapsed_steps > 0: + epoch_eta = int(trainer.supervised_dataset.nb_total_steps_per_epoch * elasped_time / elapsed_steps) + + # Decaying rates + decay_rates(trainer, sess) + + # Displaying status + try: + results, _ = run_next_decoded_training_batch(trainer, sess) + display_training_stats(trainer, sess, results, epoch_eta) + except tf.errors.OutOfRangeError: + trainer.supervised_dataset.mark_as_done() + + # Saving dataset status to disk (to be able to resume) + trainer.supervised_dataset.save_status() + + # Exiting debug (batch) mode + if trainer.flags.debug_batch and loss < 2e-3: + LOGGER.info('Reached a loss of 0.001 - Successfully converged. Exiting') + trainer.supervised_dataset.close() + sys.exit(0) + + # Exiting profile mode + if trainer.flags.profile: + trainer.profiler.advise(options=ALL_ADVICE) + LOGGER.info('Saved profiling information. Exiting') + trainer.supervised_dataset.close() + sys.exit(0) + +def run_validation_epoch(trainer, sess): + """ Runs a validation epoch + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + from diplomacy_research.utils.tensorflow import tf + + # Initializing the dataset to use the training set + if trainer.supervised_dataset.training_mode != TrainingMode.VALIDATION: + trainer.supervised_dataset.start_validation_mode(sess) + elif not trainer.supervised_dataset.iterator_initialized: + trainer.supervised_dataset.initialize_iterator(sess) + + # If there are no batches in the validation set, aborting + nb_batches = trainer.supervised_dataset.nb_validation_steps_per_epoch + if not nb_batches: + return + + # Variables for stats + results, detailed_results = OrderedDict(), OrderedDict() + batch_results, batch_detailed_results = OrderedDict(), OrderedDict() + trainer.progress = trainer.supervised_dataset.get_progress() + + # For each loop in the validation set + for eval_loop_ix in range(trainer.model.nb_evaluation_loops): + last_status_perc = 0. + + # Making sure the dataset is initialized + if not trainer.supervised_dataset.iterator_initialized or trainer.supervised_dataset.is_done: + trainer.supervised_dataset.initialize_iterator(sess) + + # ---- Starting Validation Epoch ----- + print('-' * 80) + + # Running each batch sequentially + for batch_ix in range(nb_batches): + + # Checking if we need to stop training, or are done with the current eval_loop_ix + if hasattr(sess, 'should_stop') and sess.should_stop(): + trainer.supervised_dataset.close() + break + if trainer.supervised_dataset.is_done: + break + + # Running single batch + try: + batch_results, batch_detailed_results = run_next_decoded_validation_batch(trainer, sess, eval_loop_ix) + trainer.progress = trainer.progress[0], (batch_ix + 1) / max(1, nb_batches) + + # Storing batch results + for result_name, result_value in batch_results.items(): + results.setdefault(result_name, []) + if isinstance(result_value, list): + results[result_name] += result_value + else: + results[result_name] += [result_value] + for result_name, result_value in batch_detailed_results.items(): + assert isinstance(result_value, list), 'Detailed results must be a list.' + detailed_results.setdefault(result_name, []) + detailed_results[result_name] += result_value + + except tf.errors.OutOfRangeError: + trainer.supervised_dataset.mark_as_done() + except tf.errors.DeadlineExceededError: + LOGGER.warning('Validation took more than %d ms to run. Timeout error.', SESSION_RUN_TIMEOUT) + + # Printing status every 10% completed + current_perc_completed = (batch_ix + 1) / max(1., nb_batches) + if current_perc_completed > last_status_perc + 0.10: + last_status_perc = round(current_perc_completed, 1) + display_validation_stats(trainer, sess, batch_results, batch_ix, eval_loop_ix) + trainer.supervised_dataset.save_status() + + # Post-processing detailed results + detailed_results = trainer.model.post_process_results(detailed_results) + + # Printing final validation status, and saving model + display_final_validation_stats(trainer, sess, results, detailed_results, aggregated=False) + save_model(trainer, sess) + trainer.supervised_dataset.mark_as_done() + + # ---- Done Validation Epoch ----- + print('-' * 80) diff --git a/diplomacy_research/models/training/supervised/statistics.py b/diplomacy_research/models/training/supervised/statistics.py new file mode 100644 index 0000000..6eb925d --- /dev/null +++ b/diplomacy_research/models/training/supervised/statistics.py @@ -0,0 +1,260 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Supervised - Statistics + - Class responsible for computing statistics and printing them during training +""" +import datetime +import logging +import os +import pickle +import time +import numpy as np +from diplomacy_research.models.policy.base_policy_model import StatsKey + +# Constants +LOGGER = logging.getLogger(__name__) + +def _get_weighted_average(results): + """ Computes the weighted average results + :param results: An ordered dictionary with result_name as key and (weight, value) as value (or list of (w, v)) + :return: A dictionary with result_name as key, and the weighted value as value + """ + weighted_average = {} + for result_name, result_value in results.items(): + total_weight, total = 0, 0 + if not isinstance(result_value, list): + result_value = [result_value] + for weight, result in result_value: + total_weight += weight + total += weight * result + weighted_average[result_name] = total / total_weight if total_weight else -1 + return weighted_average + +def display_training_stats(trainer, sess, results, epoch_eta): + """ Displays intermediary stats during a training epoch + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session. + :param results: An ordered dictionary with result_name as key and (weight, value) as value + :param epoch_eta: An estimation in seconds of the time required to complete an epoch. + :return: Nothing + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + nb_completed_epochs, current_progress = trainer.progress + current_epoch = int(nb_completed_epochs) + 1 + + # 1) Compute the weighted averages of the results (to adjust for different nb of items per batch) + weighted_average = _get_weighted_average(results) + + # 2) Printing message + current_time = int(time.time()) + running_time = datetime.timedelta(seconds=(current_time - trainer.starting_time)) + epoch_eta = datetime.timedelta(seconds=epoch_eta) + + message = [] + message += ['Epoch {:3} ({:.2f}%)'.format(current_epoch, 100. * current_progress)] + message += ['Step {:09}'.format(trainer.supervised_dataset.steps_in_current_mode)] + for result_name in results: + message += ['{} {:.2f}'.format(result_name, weighted_average[result_name])] + message += ['Learning {:.2e}'.format(trainer.learning_rate)] + message += ['Time/Epoch {}'.format(epoch_eta)] + message += ['Time {}'.format(running_time)] + print(' | '.join(message)) + + # We can exit here if we are a non-chief in a distributed setting + if trainer.cluster_config and not trainer.cluster_config.is_chief: + return + + # 3) Save training summary to disk + feed_dict = {} + current_tags = trainer.model.get_evaluation_tags()[0] + remaining_tags = set(current_tags) + + for result_name in results: + if result_name not in remaining_tags: + continue + remaining_tags.remove(result_name) + feed_dict[trainer.placeholders[result_name]] = weighted_average[result_name] + + if not remaining_tags: + global_step, summary_op = trainer.run_without_hooks(sess, + [trainer.model.global_step, trainer.merge_ops[0]], + feed_dict=feed_dict) + trainer.writers['train'].add_summary(summary_op, global_step) + trainer.writers['train'].flush() + else: + LOGGER.warning('Not writing validation summary. Missing tags: "%s"', remaining_tags) + +def display_validation_stats(trainer, sess, results, batch_ix, eval_loop_ix): + """ Displays intermediary stats during a training epoch + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session. + :param results: An ordered dictionary with result_name as key and (weight, value) as value + :param batch_ix: The current validation batch index. + :param eval_loop_ix: The current validation loop ix (i.e. [0, self.nb_evaluation_loops]) + :return: Nothing + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + nb_epochs_completed, current_progress = trainer.progress + current_epoch = int(nb_epochs_completed) + 1 + + # 1) Compute the weighted averages of the results (to adjust for different nb of items per batch) + weighted_average = _get_weighted_average(results) + + # 2) Printing message + message = [] + message += ['Validation - Epoch {:3} ({:.2f}%)'.format(current_epoch, 100. * current_progress)] + for result_name in results: + message += ['{} {:.2f}'.format(result_name, weighted_average[result_name])] + print(' | '.join(message)) + + # We can exit here if we are a non-chief in a distributed setting + if trainer.cluster_config and not trainer.cluster_config.is_chief: + return + + # 3) Save validation summary to disk + feed_dict = {} + current_tags = trainer.model.get_evaluation_tags()[eval_loop_ix] + remaining_tags = set(current_tags) + + for result_name in results: + if result_name not in remaining_tags: + continue + remaining_tags.remove(result_name) + feed_dict[trainer.placeholders[result_name]] = weighted_average[result_name] + + if not remaining_tags: + global_step, summary_op = trainer.run_without_hooks(sess, + [trainer.model.global_step, + trainer.merge_ops[eval_loop_ix]], + feed_dict=feed_dict) + trainer.writers['valid'].add_summary(summary_op, global_step + batch_ix) + trainer.writers['valid'].flush() + else: + LOGGER.warning('Not writing validation summary. Missing tags: "%s"', remaining_tags) + +def display_final_validation_stats(trainer, sess, results, detailed_results, aggregated=False): + """ Display final results at the end of a validation epoch + :param trainer: A supervised trainer instance. + :param sess: The TensorFlow session. + :param results: An ordered dict containing a list of (weight, results) obtained during the epoch. + :param detailed_results: An ordered dict containing a list of all details evaluation results. + :param aggregated: Boolean that indicates if the results were aggregated from different workers. + :return: Nothing + :type trainer: diplomacy_research.models.training.supervised.trainer.SupervisedTrainer + """ + current_epoch = int(trainer.progress[0]) + 1 + + # --- Utility functions --- + def weighted_average(items): + """ Computes the weighted average """ + total_weight, total = 0, 0 + for weight, item in items: + total_weight += weight + total += weight * item + return total / total_weight if total_weight else -1 + + def min_item(items): + """ Computes the minimum item """ + _, items = zip(*items) + return -1 if not items else np.min(items) + + def max_item(items): + """ Computes the maximum item """ + _, items = zip(*items) + return -1 if not items else np.max(items) + + display_modes = [('Average', weighted_average), + ('Minimum', min_item), + ('Maximum', max_item), + ('Count', len)] + + # 1) Displaying the Average, Minimum, and Maximum for each result + for display_mode_name, display_mode_func in display_modes: + message = [] + message += ['Validation - Epoch {:3} (100.0%){}'.format(current_epoch, ' (All Workers)' if aggregated else '')] + message += [display_mode_name] + for result_name, result_value in results.items(): + message += ['{} {:.2f}'.format(result_name, display_mode_func(result_value))] + print(' | '.join(message)) + + # 2) Displaying the detailed statistics + for result_name, result_value in detailed_results.items(): + # result_name could a be named_tuple + # not printing those, at they are used only to compute joint accuracy + if not result_value or not isinstance(result_name, str): + continue + message = [] + message += ['Validation - Epoch {:3} (100.0%){}'.format(current_epoch, ' (All Workers)' if aggregated else '')] + mean_result_value = 100. * np.mean(result_value) if result_value else -1 + message += ['(Detailed)', '{} (Avg) {:.2f}'.format(result_name, mean_result_value)] + message += ['{} (Count) {}'.format(result_name, len(result_value))] + print(' | '.join(message)) + + # We can exit here if we are a non-chief in a distributed setting + if trainer.cluster_config and not trainer.cluster_config.is_chief: + return + + # 3) Detecting if we need to write aggregated info to disk + write_aggregated = False + if aggregated and trainer.cluster_config and trainer.cluster_config.is_chief: + write_aggregated = True + elif not aggregated and not trainer.cluster_config: + write_aggregated = True + + # 4) Saving validation / aggregated summary info to disk + for eval_loop_ix in range(trainer.model.nb_evaluation_loops): + feed_dict = {} + current_tags = trainer.model.get_evaluation_tags()[eval_loop_ix] + _, early_stopping_tag_names = zip(*trainer.model.get_early_stopping_tags()) + remaining_tags = set(current_tags) + nb_valid_steps_per_epoch = trainer.supervised_dataset.nb_validation_steps_per_epoch + + for result_name, result_value in results.items(): + if result_name not in remaining_tags: + continue + remaining_tags.remove(result_name) + feed_dict[trainer.placeholders[result_name]] = weighted_average(result_value) + if result_name in early_stopping_tag_names: + trainer.performance.setdefault(result_name, {})[current_epoch] = weighted_average(result_value) + + if remaining_tags: + LOGGER.warning('Not writing validation summary. Missing tags: "%s"', remaining_tags) + continue + + global_step, summary_op = trainer.run_without_hooks(sess, + [trainer.model.global_step, + trainer.merge_ops[eval_loop_ix]], + feed_dict=feed_dict) + if not aggregated: + trainer.writers['valid'].add_summary(summary_op, global_step + nb_valid_steps_per_epoch) + trainer.writers['valid'].flush() + if write_aggregated: + trainer.writers['aggreg'].add_summary(summary_op, global_step + nb_valid_steps_per_epoch) + trainer.writers['aggreg'].flush() + + # 5) Writing detailed statistics on disk + if write_aggregated: + os.makedirs(os.path.join(trainer.flags.save_dir, 'statistics'), exist_ok=True) + stats_filename = os.path.join(trainer.flags.save_dir, 'statistics', 'stats_%03d.pkl' % current_epoch) + with open(stats_filename, 'wb') as file: + pickle.dump({key: value for key, value in detailed_results.items() if isinstance(key, StatsKey)}, + file, pickle.HIGHEST_PROTOCOL) + LOGGER.info('Complete statistics for epoch are available at: %s', stats_filename) + + # 6) Writing performance data (for early stopping) on disk + if write_aggregated: + performance_filename = os.path.join(trainer.flags.save_dir, 'performance.pkl') + with open(performance_filename, 'wb') as file: + pickle.dump(trainer.performance, file, pickle.HIGHEST_PROTOCOL) + LOGGER.info('Performance data are available at: %s', performance_filename) diff --git a/diplomacy_research/models/training/supervised/trainer.py b/diplomacy_research/models/training/supervised/trainer.py new file mode 100644 index 0000000..24c2f3b --- /dev/null +++ b/diplomacy_research/models/training/supervised/trainer.py @@ -0,0 +1,192 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Supervised Trainer + - Contains a trainer class for training supervised models +""" +import logging +import os +import shutil +import signal +import sys +import time +from diplomacy_research.models.training.memory_buffer import MemoryBuffer # pylint: disable=unused-import +from diplomacy_research.models.training.supervised.common import has_already_early_stopped +from diplomacy_research.models.training.supervised.distributed import start_distributed_training +from diplomacy_research.models.training.supervised.standalone import start_standalone_training +from diplomacy_research.settings import SESSION_RUN_TIMEOUT + +# Constants +LOGGER = logging.getLogger(__name__) + +class SupervisedTrainer(): + """ Performs supervised training on a model """ + # pylint: disable=too-many-instance-attributes + + def __init__(self, policy_constructor, value_constructor, draw_constructor, dataset_builder, adapter_constructor, + flags, cluster_config=None): + """ Constructor + :param policy_constructor: The constructor to create the policy model + :param value_constructor: Optional. The constructor to create the value model + :param draw_constructor: Optional. The constructor to create the draw model. + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param adapter_constructor: The constructor to build the adapter for the model type. + :param flags: The parsed flags (Tensorflow arguments) + :param cluster_config: Optional. If set, the cluster configuration will be used for distributed training. + :type policy_constructor: diplomacy_research.models.policy.base_policy_model.BasePolicyModel.__class__ + :type value_constructor: diplomacy_research.models.value.base_value_model.BaseValueModel.__class__ + :type draw_constructor: diplomacy_research.models.draw.base_draw_model.BaseDrawModel.__class__ + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type adapter_constructor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + :type cluster_config: diplomacy_research.utils.cluster.ClusterConfig + """ + # pylint: disable=too-many-arguments + self.cluster_config = cluster_config + self.supervised_dataset = None + self.dataset_builder = dataset_builder + self.signature = adapter_constructor.get_signature() + self.model = None + self.server = None + self.config_proto = None + self.policy_constructor = policy_constructor + self.value_constructor = value_constructor + self.draw_constructor = draw_constructor + + # Hooks + self.hooks = [] + self.chief_only_hooks = [] + + # Activating debug (batch) mode if the debug flag is set + self.flags = flags + if self.flags.debug_batch: + self.set_debug_batch_mode() + self.hparams = flags.__dict__ + + # Making sure 'learning_rate' and 'lr_decay_factor' exists: + if not hasattr(self.flags, 'learning_rate'): + raise RuntimeError('Your model is missing a "learning_rate" argument.') + if not hasattr(self.flags, 'lr_decay_factor'): + raise RuntimeError('Your model is missing a "lr_decay_factor" argument.') + + # Supervised settings + self.status_every = 20 if self.flags.debug_batch else 60 + self.history_saver = None + self.progress = (0, 0) # (nb_epochs_completed, current_progress) + + # Recording current rate + self.learning_rate = self.flags.learning_rate if 'learning_rate' in self.flags else 0. + + # Recording starting time + self.starting_time = int(time.time()) + self.status_time = self.starting_time + self.step_last_status = 0 + + # Early stopping + self.performance = {} # {early_stopping_tag: {epoch_number: tag_value}} + + # Profiler settings + self.profiler = None + self.nb_profile_steps = 0 + self.nb_oom_steps = 0 + + # Tensorboard variables + self.placeholders = {} + self.summaries = {} + self.merge_ops = {} + self.writers = {} + + # Memory Buffer (Barrier) + self.memory_buffer = None # type: MemoryBuffer + + def set_debug_batch_mode(self): + """ Puts the supervised training in debug mode (where we are overfitting a single minibatch """ + if self.cluster_config: + LOGGER.error('Debug (batch) mode is not available while using distributed training.') + return + + self.flags.batch_size = 8 + LOGGER.info('Training model in DEBUG (batch) mode - Overfitting a single mini-batch of 8 examples') + + # Disabling dropout + for flag in self.flags.__dict__: + if 'dropout' in flag and not isinstance(getattr(self.flags, flag), bool): + setattr(self.flags, flag, 0.) + LOGGER.info('The flag "%s" has been set to 0 because dropout is disabled in DEBUG (batch) mode.', flag) + + # Deleting training dir + if os.path.exists(self.flags.save_dir): + shutil.rmtree(self.flags.save_dir) + + def start(self): + """ Starts training the supervised model """ + if has_already_early_stopped(self): + LOGGER.info('Model has already triggered early stopping. Exiting.') + return + + # Handling CTRL+C + def signal_handler(*args): + """ Handles SIGINT and SIGTERM signals """ + del args # unused argument + print('INFO - CTRL-C received. Stopping training.') # Not using LOGGER, might be already closed + if self.model.sess: + self.model.sess.close() # Should trigger the SessionRunHooks + sys.exit(0) + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + if not self.cluster_config: + start_standalone_training(self) + else: + start_distributed_training(self) + + # ---------------------------------------------------- + # Public Methods - Utilities + # ---------------------------------------------------- + @staticmethod + def run_without_hooks(sess, fetches, feed_dict=None): + """ Executes a raw TensorFlow session without executing the registered hooks + :param sess: The wrapped TensorFlow session. + :param fetches: The fetches to retrieve from the session + :param feed_dict: The feed_dict to pass to the session + """ + return SupervisedTrainer.run_func_without_hooks(sess, lambda _sess: _sess.run(fetches, feed_dict=feed_dict)) + + @staticmethod + def run_func_without_hooks(sess, func): + """ Executes a function that depends on a raw TensorFlow session without hooks + :param sess: The wrapped TensorFlow session. + :param func: A function to execute (args: session [the raw TF session]) + """ + if hasattr(sess, 'run_step_fn'): + return sess.run_step_fn(lambda step_context: func(step_context.session)) + return func(sess) + + def run_session(self, sess, session_args, run_metadata=None): + """ Executes the session. + :param sess: The wrapped TensorFlow session. + :param session_args: A dictionary with 'fetches' and 'feed_dict' + :param run_metadata: Optional. Metadata to add to the session.run + :return: The fetches + """ + from diplomacy_research.utils.tensorflow import tf + + # Setting options and meta-data + if not self.flags.debug: + session_args['options'] = tf.RunOptions(timeout_in_ms=SESSION_RUN_TIMEOUT) + if run_metadata is not None: + session_args['options'] = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE, # pylint: disable=no-member + timeout_in_ms=SESSION_RUN_TIMEOUT) + session_args['run_metadata'] = run_metadata + + # Running + return sess.run(**session_args) diff --git a/diplomacy_research/models/user_ops/seeded_random.cc b/diplomacy_research/models/user_ops/seeded_random.cc new file mode 100644 index 0000000..45c841b --- /dev/null +++ b/diplomacy_research/models/user_ops/seeded_random.cc @@ -0,0 +1,124 @@ +/** SeededRandom Op + + - Given a vector of seeds, generate a matrix of size (nb_seeds, size) where each row with identical seed is + identical. (e.g. seeds of [10, 5, 10, 5] will have the same 1st and 3rd row, and the same 2nd and 4th row). + - Rows with a seeds of 0, with use the graph seed, then the op seed, then a random seed. + + Attributes: + seed: graph_seed. - The graph seed (defaults to 0) + seed2: op_seed - The seed at the op construction (default to 0) + + Inputs: + seeds (int32): vector of seeds. Batch of seeds used to generate random numbers. Vector length is batch size. + offset (int32): integer to add to seeds as deterministic mask at initialization. + size (int32): output size. Number of values to generate for each seed. + + Output: Matrix of generated random numbers, with shape (batch size, size). +**/ +#include +#include +#include +#include "tensorflow/core/framework/op.h" +#include "tensorflow/core/framework/tensor_shape.h" +#include "tensorflow/core/framework/shape_inference.h" +#include "tensorflow/core/framework/op_kernel.h" +#include "tensorflow/core/framework/function.h" + +#define M 2147483647U +#define A 2147483629U +#define C 2147483587U + +using namespace tensorflow; + +REGISTER_OP("SeededRandom") + .Input("seeds: int32") + .Input("offset: int32") + .Input("size: int32") + .SetIsStateful() // seems necessary to force re-computation even when all inputs are constant. + .Output("output: float") // output format: (batch_size, size) + .Attr("seed: int = 0") + .Attr("seed2: int = 0") + .SetShapeFn([](::tensorflow::shape_inference::InferenceContext* c) { + shape_inference::ShapeHandle seeds_shape; + shape_inference::ShapeHandle size_shape; + TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &seeds_shape)); + TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &size_shape)); + + size_t output_size = 0; + const Tensor* size_tensor = c->input_tensor(2); + if (size_tensor) { output_size = size_tensor->scalar()(); } + + std::vector outputDimensions; + outputDimensions.push_back(c->Dim(seeds_shape, 0)); // Batch size. + outputDimensions.push_back(output_size ? c->MakeDim(output_size) : c->UnknownDim()); // Output size. + c->set_output(0, c->MakeShape(outputDimensions)); + return Status::OK(); + }); + +class SeededRandomOp: public OpKernel { + int _seed; + int _seed2; +public: + explicit SeededRandomOp(OpKernelConstruction* context): OpKernel(context) { + OP_REQUIRES_OK(context, context->GetAttr("seed", &_seed)); + OP_REQUIRES_OK(context, context->GetAttr("seed2", &_seed2)); + } + void Compute(OpKernelContext* context) override { + // Get tensors. + const Tensor& seeds_tensor = context->input(0); + const Tensor& offset_tensor = context->input(1); + const Tensor& size_tensor = context->input(2); + + // Get tensor shapes. + const TensorShape& seeds_shape = seeds_tensor.shape(); + const TensorShape& offset_shape = offset_tensor.shape(); + const TensorShape& size_shape = size_tensor.shape(); + + // Check inputs shapes . + DCHECK_EQ(seeds_shape.dims(), 1); + DCHECK_EQ(offset_shape.dims(), 0); + DCHECK_EQ(size_shape.dims(), 0); + + // Get inputs data. + auto seeds = seeds_tensor.vec(); + auto offset = offset_tensor.scalar()(); + auto output_size = size_tensor.scalar()(); + size_t batch_size = seeds_shape.dim_size(0); + + // Allocate output matrix (shape_prod, batch size). + TensorShape output_shape; + output_shape.AddDim(batch_size); + output_shape.AddDim(output_size); + Tensor* output = NULL; + OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output)); + auto output_matrix = output->matrix(); + + // Generate alternative seeds. + std::vector alt_seeds(batch_size, 0); + std::vector rng(batch_size, 0); + if (_seed || _seed2) { + auto seed = _seed ? _seed : _seed2; + for (size_t i = 0; i < batch_size; ++i) { alt_seeds[i] = seed; } + } else { + std::default_random_engine generator(std::chrono::system_clock::now().time_since_epoch().count()); + std::uniform_int_distribution distribution(0, M - 1); + for (size_t i = 0; i < batch_size; ++i) { alt_seeds[i] = distribution(generator); } + } + + // Initialize RNG. + for (size_t i = 0; i < batch_size; ++i) { + rng[i] = ((seeds(i) ? seeds(i) : alt_seeds[i]) + offset) % M; + } + + // Update RNG and generate output. + for (size_t i = 0; i < batch_size; ++i) { + for (size_t j = 0; j < output_size; ++j) { + rng[i] = (A * rng[i] + C) % M; + output_matrix(i, j) = float(rng[i]) / M; + } + } + } +}; + +REGISTER_KERNEL_BUILDER(Name("SeededRandom").Device(DEVICE_CPU), SeededRandomOp); +REGISTER_OP_NO_GRADIENT("SeededRandom"); diff --git a/diplomacy_research/models/user_ops/tests/test_seeded_random.py b/diplomacy_research/models/user_ops/tests/test_seeded_random.py new file mode 100644 index 0000000..c272184 --- /dev/null +++ b/diplomacy_research/models/user_ops/tests/test_seeded_random.py @@ -0,0 +1,57 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Tests for seeded_random op """ +import numpy as np +from diplomacy_research.utils.process import run_in_separate_process + +def run_seeded_random(): + """ Run tests for seeded_random """ + from diplomacy_research.utils.tensorflow import tf, load_so_by_name + seeded_random_so = load_so_by_name('seeded_random') + sess = tf.InteractiveSession() + seeds = tf.placeholder(shape=[None], dtype=tf.int32) + + # Static shape - With graph seed provided + op_1 = seeded_random_so.seeded_random(seeds=seeds, offset=1, size=100, seed=75, seed2=0) + output_1 = sess.run(op_1, feed_dict={seeds: [12345, 0, 12345, 0]}) + output_2 = sess.run(op_1, feed_dict={seeds: [12345, 0, 12345, 0]}) + assert op_1.shape.as_list() == [None, 100] + assert output_1.shape == (4, 100) + assert output_2.shape == (4, 100) + assert np.allclose(output_1[0], output_1[2]) + assert np.allclose(output_1[0], output_2[0]) + assert np.allclose(output_1[1], output_1[3]) # Since a seed was provided + assert np.allclose(output_2[1], output_2[3]) # Since a seed was provided + assert np.allclose(output_1[1], output_2[1]) # Since a seed was provided + assert np.allclose(output_1[3], output_2[3]) # Since a seed was provided + assert np.all(output_1[0] != output_1[1]) + + # Dynamic shape - No seed + shape = tf.placeholder(shape=(), dtype=tf.int32) + op_2 = seeded_random_so.seeded_random(seeds=seeds, offset=2, size=shape, seed=0, seed2=0) + output_1 = sess.run(op_2, feed_dict={seeds: [12345, 0, 12345, 0], shape: 200}) + output_2 = sess.run(op_2, feed_dict={seeds: [12345, 0, 12345, 0], shape: 200}) + assert op_2.shape.as_list() == [None, None] + assert output_1.shape == (4, 200) + assert output_2.shape == (4, 200) + assert np.allclose(output_1[0], output_1[2]) + assert np.allclose(output_1[0], output_2[0]) + assert np.all(output_1[1] != output_1[3]) + assert np.all(output_2[1] != output_2[3]) + assert np.all(output_1[1] != output_2[1]) + assert np.all(output_1[3] != output_2[3]) + +def test_seeded_random(): + """ Tests for the seeded random op """ + run_in_separate_process(target=run_seeded_random, timeout=30) diff --git a/diplomacy_research/models/value/__init__.py b/diplomacy_research/models/value/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/value/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/value/base_value_model.py b/diplomacy_research/models/value/base_value_model.py new file mode 100644 index 0000000..4792712 --- /dev/null +++ b/diplomacy_research/models/value/base_value_model.py @@ -0,0 +1,190 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Base Value model + - Contains the base value model, which is used by all value models. +""" +from collections import OrderedDict +import logging +import re +from diplomacy_research.models.base_model import BaseModel +from diplomacy_research.settings import NO_PRESS_VALUE_ALL_DATASET + +# Constants +LOGGER = logging.getLogger(__name__) +VALID_TAG = re.compile('^tag/value/v[0-9]{3}_[a-z0-9_]+$') + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return [ + ('str', 'model_type', 'order_based', 'Policy model family. "token_based", "order_based".'), + ('int', 'value_model_id', -1, 'The model ID of the value function.'), + ('str', 'dataset', NO_PRESS_VALUE_ALL_DATASET, 'The dataset builder to use for supervised learning'), + ('bool', 'stop_gradient_value', False, 'Do not propagate the value loss in the policy network'), + ('float', 'dropout_rate', 0.5, 'Default dropout rate %.'), + ('float', 'learning_rate', 1e-3, 'Initial learning rate.'), + ('float', 'lr_decay_factor', 0.93, 'Learning rate decay factor.'), + ('float', 'max_gradient_norm', 5.0, 'Maximum gradient norm.'), + ('float', 'value_coeff', 1.0, 'The coefficient to apply to the value loss') + ] + +class BaseValueModel(BaseModel): + """ Base Value Model""" + + def __init__(self, parent_model, dataset, hparams): + """ Initialization + :param parent_model: A `base_model` to which we are adding features + :param dataset: The dataset that is used to iterate over the data. + :param hparams: A dictionary of hyper parameters with their values + :type parent_model: diplomacy_research.models.base_model.BaseModel + :type dataset: diplomacy_research.models.datasets.supervised_dataset.SupervisedDataset + :type dataset: diplomacy_research.models.datasets.queue_dataset.QueueDataset + """ + BaseModel.__init__(self, parent_model, dataset, hparams) + self.build_value() + + @property + def _nb_evaluation_loops(self): + """ Contains the number of different evaluation tags we want to compute + This also represent the number of loops we should do over the validation set + Some model wants to calculate different statistics and require multiple pass to do that + + A value of 1 indicates to only run in the main validation loop + A value > 1 indicates to run additional loops only for this model. + """ + return 1 + + @property + def _evaluation_tags(self): + """ List of evaluation tags (1 list of evaluation tag for each evaluation loop) + e.g. [['Acc_1', 'Acc_5', 'Acc_Tokens'], ['Gr_1', 'Gr_5', 'Gr_Tokens']] + """ + return [['[Value]L2_Loss']] + + @property + def _early_stopping_tags(self): + """ List of tags to use to detect early stopping + The tags are a tuple of 1) 'min' or 'max' and 2) the tag's name + e.g. [('max', '[Gr]Acc_1'), ('min', '[TF]Perplexity')] + """ + return [('min', '[Value]L2_Loss')] + + @property + def _placeholders(self): + """ Return a dictionary of all placeholders needed by the model """ + from diplomacy_research.utils.tensorflow import tf, get_placeholder_with_default + return { + 'stop_gradient_all': get_placeholder_with_default('stop_gradient_all', False, shape=(), dtype=tf.bool) + } + + def _get_board_value(self, board_state, current_power, name='board_state_value', reuse=None): + """ Computes the estimated value of a board state + :param board_state: The board state - (batch, NB_NODES, NB_FEATURES) + :param current_power: The power for which we want the board value - (batch,) + :param name: The name to use for the operaton + :param reuse: Whether to reuse or not the weights from another operation + :return: The value of the board state for the specified power - (batch,) + """ + raise NotImplementedError() + + def _build_value_initial(self): + """ Builds the value model (initial step) """ + raise NotImplementedError() + + def _build_value_final(self): + """ Builds the value model (final step) """ + + def _get_session_args(self, decode=False, eval_loop_ix=None): + """ Returns a dict of kwargs to feed to session.run + Expected format: {fetches, feed_dict=None} + """ + # Detecting if we are doing validation + in_validation, our_validation = False, False + if eval_loop_ix is not None: + in_validation = True + our_validation = eval_loop_ix in self.my_eval_loop_ixs + + # --------- Fetches --------------- + train_fetches = {'optimizer_op': self.outputs['optimizer_op'], + 'value_loss': self.outputs['value_loss']} + + eval_fetches = {'value_loss': self.outputs['value_loss']} + + # --------- Feed dict -------------- + # Building feed dict + feed_dict = {self.placeholders['stop_gradient_all']: False} + + # --------- Validation Loop -------------- + # Validation Loop - Running one of our validation loops + if our_validation: + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Validation Loop - Running someone else validation loop + if in_validation: + return {'feed_dict': feed_dict} + + # --------- Training Loop -------------- + # Training Loop - We want to decode the specific batch to display stats + if decode: + return {'fetches': eval_fetches, 'feed_dict': feed_dict} + + # Training Loop - Training the model + return {'fetches': train_fetches, 'feed_dict': feed_dict} + + def _validate(self): + """ Validates the built model """ + # Making sure all the required outputs are present + assert 'value_target' in self.features + assert 'state_value' in self.outputs + assert 'value_loss' in self.outputs + assert len(self.outputs['state_value'].shape) == 1 + + # Making sure we have a name tag + for tag in self.outputs: + if VALID_TAG.match(tag): + break + else: + raise RuntimeError('Unable to find a name tag. Format: "tag/value/v000_xxxxxx".') + + @staticmethod + def _decode(**fetches): + """ Performs decoding on the output (value model) + :param fetches: A dictionary of fetches from the model. + :return: A dictionary of decoded results, including various keys for evaluation + """ + if 'value_loss' not in fetches: + return {} + return {'value_loss': fetches['value_loss']} + + def _evaluate(self, decoded_results, feed_dict, eval_loop_ix, incl_detailed): + """ Calculates the accuracy of the model + :param decoded_results: The decoded results (output of _decode() function) + :param feed_dict: The feed dictionary that was given to session.run() + :param eval_loop_ix: The current evaluation loop index + :param incl_detailed: is true if training is over, more statistics can be computed + :return: A tuple consisting of: + 1) An ordered dictionary with result_name as key and (weight, value) as value (Regular results) + 2) An ordered dictionary with result_name as key and a list of result values (Detailed results) + """ + # Detecting if it's our evaluation or not + if eval_loop_ix == -1: + pass + else: + our_validation = eval_loop_ix in self.my_eval_loop_ixs + if not our_validation: + return OrderedDict(), OrderedDict() + + # Returning evaluation results + return OrderedDict({'[Value]L2_Loss': (1, decoded_results['value_loss'])}), OrderedDict() diff --git a/diplomacy_research/models/value/tests/value_model_test_setup.py b/diplomacy_research/models/value/tests/value_model_test_setup.py new file mode 100644 index 0000000..24766bf --- /dev/null +++ b/diplomacy_research/models/value/tests/value_model_test_setup.py @@ -0,0 +1,155 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Generic class to tests for value model correctness """ +from tornado import gen +from tornado.ioloop import IOLoop +from diplomacy import Game +from diplomacy_research.models.datasets.queue_dataset import QueueDataset +from diplomacy_research.models.state_space import extract_state_proto, extract_phase_history_proto, \ + NB_NODES, NB_FEATURES +from diplomacy_research.utils.cluster import process_fetches_dict + + +class ValueModelTestSetup(): + """ Creates a testable setup to test a model and a constructor """ + + def __init__(self, policy_model_ctor, value_model_ctor, draw_model_ctor, dataset_builder, adapter_ctor, + load_policy_args, load_value_args, load_draw_args,): + """ Constructor + :param policy_model_ctor: The policy model constructor to create the policy. + :param value_model_ctor: The value model constructor to create the value model. + :param draw_model_ctor: The draw model constructor to create the draw model. + :param dataset_builder: An instance of `BaseBuilder` containing the proto-fields and generation methods + :param adaptor_ctor: The policy adapter constructor to create the policy adapter + :param load_policy_args: Reference to the callable function required to load policy args + :param load_value_args: Reference to the callable function required to load value args + :param load_draw_args: Reference to the callable function required to load draw args + :type policy_model_ctor: diplomacy_research.models.policy.base_policy_model.BasePolicyModel.__class__ + :type value_model_ctor: diplomacy_research.models.value.base_value_model.BaseValueModel.__class__ + :type draw_model_ctor: diplomacy_research.models.draw.base_draw_model.BaseDrawModel.__class__ + :type dataset_builder: diplomacy_research.models.datasets.base_builder.BaseBuilder + :type adapter_ctor: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter.__class__ + """ + # pylint: disable=too-many-arguments + # Parsing new flags + args = load_policy_args() + args += load_value_args() + if load_draw_args is not None: + args += load_draw_args() + self.hparams = self.parse_flags(args) + + # Other attributes + self.graph = None + self.sess = None + self.adapter = None + self.queue_dataset = None + self.policy_model_ctor = policy_model_ctor + self.value_model_ctor = value_model_ctor + self.draw_model_ctor = draw_model_ctor + self.dataset_builder = dataset_builder + self.adapter_ctor = adapter_ctor + + def build_model(self): + """ Builds the model """ + from diplomacy_research.utils.tensorflow import tf + graph = tf.Graph() + with graph.as_default(): + + # Creating dataset + self.queue_dataset = QueueDataset(batch_size=self.hparams['batch_size'], + dataset_builder=self.dataset_builder) + + # Creating model and validating + model = self.policy_model_ctor(self.queue_dataset, self.hparams) + model = self.value_model_ctor(model, self.queue_dataset, self.hparams) + if self.draw_model_ctor is not None: + model = self.draw_model_ctor(model, self.queue_dataset, self.hparams) + model.finalize_build() + model.validate() + + # Testing get_board_value() + self.test_get_board_value(model) + + self.graph = graph + self.sess = tf.Session(graph=graph) + + @staticmethod + def parse_flags(args): + """ Parse flags without calling tf.app.run() """ + define = {'bool': lambda x: bool(x), # pylint: disable=unnecessary-lambda + 'int': lambda x: int(x), # pylint: disable=unnecessary-lambda + 'str': lambda x: str(x), # pylint: disable=unnecessary-lambda + 'float': lambda x: float(x), # pylint: disable=unnecessary-lambda + '---': lambda x: x} # pylint: disable=unnecessary-lambda + + # Keeping a dictionary of parse args to overwrite if provided multiple times + flags = {} + for arg in args: + arg_type, arg_name, arg_value, _ = arg + flags[arg_name] = define[arg_type](arg_value) + if arg_type == '---' and arg_name in flags: + del flags[arg_name] + return flags + + def run_tests(self): + """ Run all tests """ + IOLoop.current().run_sync(self.run_tests_async) + + @gen.coroutine + def run_tests_async(self): + """ Run tests in an asynchronous IO Loop """ + self.build_model() + self.adapter = self.adapter_ctor(self.queue_dataset, self.graph, session=self.sess) + yield self.test_get_state_value() + + @staticmethod + def test_get_board_value(model): + """ Tests the get_board_value method """ + from diplomacy_research.utils.tensorflow import tf + nb_global_vars_before = len(tf.global_variables()) + board_state = tf.placeholder(dtype=tf.float32, shape=[None, NB_NODES, NB_FEATURES], name='fake_board') + current_power = tf.placeholder(dtype=tf.int32, shape=[None], name='fake_current_power') + model.get_board_value(board_state, current_power, reuse=True) + nb_global_vars_after = len(tf.global_variables()) + assert nb_global_vars_before == nb_global_vars_after, 'New variables added when getting board value.' + + @gen.coroutine + def test_get_state_value(self): + """ Checks if the .get_state_value method works """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + kwargs = {'player_seed': 0, 'noise': 0., 'temperature': 0., 'dropout_rate': 0.} + + # Testing with and without prefetching + for use_prefetching in (False, True): + + if not use_prefetching: + results = yield self.adapter.get_state_value(state_proto, + 'FRANCE', + phase_history_proto, + **kwargs) + else: + fetches = yield self.adapter.get_state_value(state_proto, + 'FRANCE', + phase_history_proto, + prefetch=True, + **kwargs) + fetches = yield process_fetches_dict(self.queue_dataset, fetches) + results = yield self.adapter.get_state_value(state_proto, + 'FRANCE', + phase_history_proto, + fetches=fetches, + **kwargs) + assert results != 0. diff --git a/diplomacy_research/models/value/train.py b/diplomacy_research/models/value/train.py new file mode 100644 index 0000000..6b7856a --- /dev/null +++ b/diplomacy_research/models/value/train.py @@ -0,0 +1,80 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Value model + - Contains the training methods to train jointly a policy and a value network +""" +import importlib +import logging +import os +from diplomacy_research.models.training.supervised import SupervisedTrainer +from diplomacy_research.settings import ROOT_DIR +from diplomacy_research.utils.cluster import start_distributed_training +from diplomacy_research.utils.cluster_config.supervised import get_cluster_config +from diplomacy_research.utils.model import load_dynamically_from_model_id, find_model_type, load_dataset_builder +from diplomacy_research.utils.model import parse_args_into_flags, run_app + +# Constants +LOGGER = logging.getLogger('diplomacy_research.models.value.train') + +def main(_): + """ Trains the policy and value model """ + def start_supervised_training(cluster_config, _): + """ Callable fn to start training """ + SupervisedTrainer(policy_constructor=PolicyModel, + value_constructor=ValueModel, + draw_constructor=DrawModel, + dataset_builder=DatasetBuilder(), + adapter_constructor=PolicyAdapter, + cluster_config=cluster_config, + flags=FLAGS).start() + + # Detecting if we need to start regular or distributed training + start_distributed_training(callable_fn=start_supervised_training, + flags=FLAGS, + get_cluster_config_fn=get_cluster_config, + with_process_pool=False) + +if __name__ == '__main__': + + # Finding the root dir of the model type + base_dir, base_import_path = find_model_type() # pylint: disable=invalid-name + + # Loading model_constructor and args + PolicyModel, load_policy_args = load_dynamically_from_model_id(['PolicyModel', 'load_args'], # pylint: disable=invalid-name + arg_name='model_id', + base_dir=base_dir) + + # Detecting ValueModel, and load_args + ValueModel, load_value_args = load_dynamically_from_model_id(['ValueModel', 'load_args'], # pylint: disable=invalid-name + arg_name='value_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'value')) + + # Detecting DrawModel, and load_args + DrawModel, load_draw_args = load_dynamically_from_model_id(['DrawModel', 'load_args'], # pylint: disable=invalid-name + arg_name='draw_model_id', + base_dir=os.path.join(ROOT_DIR, 'models', 'draw'), + on_error='ignore') + + # Loading args + ARGS = load_policy_args() \ + + load_value_args() \ + + (load_draw_args() if load_draw_args is not None else []) + FLAGS = parse_args_into_flags(ARGS) + + # Loading policy adapter, and dataset builder + PolicyAdapter = importlib.import_module('%s' % base_import_path).PolicyAdapter # pylint: disable=invalid-name + DatasetBuilder = load_dataset_builder(FLAGS.dataset, base_dir=base_dir) # pylint: disable=invalid-name + + # Running + run_app() diff --git a/diplomacy_research/models/value/v001_val_relu_7/__init__.py b/diplomacy_research/models/value/v001_val_relu_7/__init__.py new file mode 100644 index 0000000..61405c6 --- /dev/null +++ b/diplomacy_research/models/value/v001_val_relu_7/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v001_val_relu_7 Value Model """ +from .model import ValueModel, load_args diff --git a/diplomacy_research/models/value/v001_val_relu_7/model.py b/diplomacy_research/models/value/v001_val_relu_7/model.py new file mode 100644 index 0000000..452d21c --- /dev/null +++ b/diplomacy_research/models/value/v001_val_relu_7/model.py @@ -0,0 +1,133 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Value model (v001_val_relu_7) + - Contains the value model +""" +import logging +from diplomacy_research.models.state_space import get_adjacency_matrix, NB_NODES, NB_POWERS +from diplomacy_research.models.value.base_value_model import BaseValueModel, load_args as load_parent_args + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'value_gcn_1_output_size', 25, 'Graph Conv 1 output size.'), + ('int', 'value_embedding_size', 128, 'Embedding size.'), + ('int', 'value_h1_size', 64, 'The size of the first hidden layer in the value calculation'), + ('int', 'value_h2_size', 64, 'The size of the second hidden layer in the value calculation') + ] + +class ValueModel(BaseValueModel): + """ Value Model - Evaluates the value of a state for a given power """ + + def _get_board_value(self, board_state, current_power, name='board_state_value', reuse=None): + """ Computes the estimated value of a board state + :param board_state: The board state - (batch, NB_NODES, NB_FEATURES) + :param current_power: The power for which we want the board value - (batch,) + :param name: The name to use for the operaton + :param reuse: Whether to reuse or not the weights from another operation + :return: The value of the board state for the specified power - (batch,) + """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.models.layers.graph_convolution import GraphConvolution, preprocess_adjacency + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + relu = tf.nn.relu + + # Computing norm adjacency + norm_adjacency = preprocess_adjacency(get_adjacency_matrix()) + norm_adjacency = tf.tile(tf.expand_dims(norm_adjacency, axis=0), [tf.shape(board_state)[0], 1, 1]) + + # Building scope + # No need to use 'stop_gradient_value' - Because this model does not share parameters. + scope = tf.VariableScope(name='value/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + with tf.variable_scope('graph_conv_scope'): + graph_conv = board_state # (b, NB_NODES, NB_FEAT) + graph_conv = GraphConvolution(input_dim=graph_conv.shape[-1].value, # (b, NB_NODES, gcn_1) + output_dim=hps('value_gcn_1_output_size'), + norm_adjacency=norm_adjacency, + activation_fn=relu, + bias=True)(graph_conv) + flat_graph_conv = tf.reshape(graph_conv, shape=[-1, NB_NODES * hps('value_gcn_1_output_size')]) + flat_graph_conv = tf.layers.Dense(units=hps('value_embedding_size'), + activation=relu, + use_bias=True)(flat_graph_conv) # (b, value_emb_size) + + with tf.variable_scope('value_scope'): + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + state_value = flat_graph_conv # (b, value_emb_size) + state_value = tf.layers.Dense(units=hps('value_h1_size'), # (b, value_h1_size) + activation=relu, + use_bias=True)(state_value) + state_value = tf.layers.Dense(units=hps('value_h2_size'), # (b, value_h2_size) + activation=relu, + use_bias=True)(state_value) + state_value = tf.layers.Dense(units=NB_POWERS, # (b, NB_POWERS) + activation=None, + use_bias=True)(state_value) + state_value = tf.reduce_sum(state_value * current_power_mask, axis=1) # (b,) + + # Returning + return state_value + + def _build_value_initial(self): + """ Builds the value model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.utils.tensorflow import to_float + + if not self.placeholders: + self.placeholders = self.get_placeholders() + else: + self.placeholders.update(self.get_placeholders()) + + # Quick function to retrieve hparams and placeholders and function shorthands + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('value', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Features + board_state = to_float(self.features['board_state']) # tf.float32 - (b, NB_NODES, NB_FEATURES) + current_power = self.features['current_power'] # tf.int32 - (b,) + value_target = self.features['value_target'] # tf.float32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Computing value for the current power + state_value = self.get_board_value(board_state, current_power) + + # Computing value loss + with tf.variable_scope('value_loss'): + value_loss = tf.reduce_mean(tf.square(value_target - state_value)) + value_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(value_loss), # pylint: disable=cell-var-from-loop + lambda: value_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/value/v001_val_relu_7': True, + 'state_value': state_value, + 'value_loss': value_loss} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/value/v001_val_relu_7/tests/__init__.py b/diplomacy_research/models/value/v001_val_relu_7/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/value/v001_val_relu_7/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/value/v001_val_relu_7/tests/test_model.py b/diplomacy_research/models/value/v001_val_relu_7/tests/test_model.py new file mode 100644 index 0000000..554582e --- /dev/null +++ b/diplomacy_research/models/value/v001_val_relu_7/tests/test_model.py @@ -0,0 +1,60 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the v001_val_relu_7 ValueModel """ +from diplomacy_research.models.policy import order_based +from diplomacy_research.models.policy import token_based +import diplomacy_research.models.policy.order_based.v005_markovian_film_board_align as order_based_model +import diplomacy_research.models.policy.token_based.v005_markovian_film_board_align as token_based_model +from diplomacy_research.models.value.tests.value_model_test_setup import ValueModelTestSetup +from diplomacy_research.models.value.v001_val_relu_7 import ValueModel, load_args +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Launch Scripts -------------- +def launch_order_based(): + """ Launches tests for order based """ + model_family_path = order_based + model_version_path = order_based_model + test_object = ValueModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=load_args, + load_draw_args=None) + test_object.run_tests() + +def launch_token_based(): + """ Launches tests for token based """ + model_family_path = token_based + model_version_path = token_based_model + test_object = ValueModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=load_args, + load_draw_args=None) + test_object.run_tests() + +# ----------- Tests -------------- +def test_order_based(): + """ Runs the order_based test """ + run_in_separate_process(target=launch_order_based, timeout=120) + +def test_token_based(): + """ Runs the token_based test """ + run_in_separate_process(target=launch_token_based, timeout=120) diff --git a/diplomacy_research/models/value/v002_rnn_state/.deprecated b/diplomacy_research/models/value/v002_rnn_state/.deprecated new file mode 100644 index 0000000..e69de29 diff --git a/diplomacy_research/models/value/v003_rnn_step_0/__init__.py b/diplomacy_research/models/value/v003_rnn_step_0/__init__.py new file mode 100644 index 0000000..4c028cc --- /dev/null +++ b/diplomacy_research/models/value/v003_rnn_step_0/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v003_rnn_step_0 Value Model """ +from .model import ValueModel, load_args diff --git a/diplomacy_research/models/value/v003_rnn_step_0/model.py b/diplomacy_research/models/value/v003_rnn_step_0/model.py new file mode 100644 index 0000000..91ae6b8 --- /dev/null +++ b/diplomacy_research/models/value/v003_rnn_step_0/model.py @@ -0,0 +1,111 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Value model (v003_rnn_step_0) + - Contains the value model +""" +import logging +from diplomacy_research.models.state_space import NB_POWERS +from diplomacy_research.models.value.base_value_model import BaseValueModel, load_args as load_parent_args + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'value_h1_size', 256, 'The size of the first hidden layer in the value calculation'), + ] + +class ValueModel(BaseValueModel): + """ Value Model - Evaluates the value of a state for all powers """ + + def _get_board_value(self, board_state, current_power, name='board_state_value', reuse=None): + """ Computes the estimated value of a board state + :param board_state: The board state - (batch, NB_NODES, NB_FEATURES) + :param current_power: The power for which we want the board value - (batch,) + :param name: The name to use for the operaton + :param reuse: Whether to reuse or not the weights from another operation + :return: The value of the board state for the specified power - (batch,) + """ + from diplomacy_research.utils.tensorflow import tf + LOGGER.warning('This model does not support computing the value of a board state. Returning 0.') + return tf.zeros_like(current_power, dtype=tf.float32) + + def _build_value_initial(self): + """ Builds the value model (initial step) """ + # Skipping - As we need the rnn_states from the policy to compute this value function + + def _build_value_final(self): + """ Builds the value model (final step) """ + from diplomacy_research.utils.tensorflow import tf + + if not self.placeholders: + self.placeholders = self.get_placeholders() + else: + self.placeholders.update(self.get_placeholders()) + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + relu = tf.nn.relu + + # Training loop + with tf.variable_scope('value', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Outputs from the policy model + assert 'rnn_states' in self.outputs + + # Inputs and Features + rnn_states = self.outputs['rnn_states'] + current_power = self.features['current_power'] # tf.int32 - (b,) + value_target = self.features['value_target'] # tf.float32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Computing the value + value_h0 = tf.stop_gradient(rnn_states) if hps('stop_gradient_value') else rnn_states + value_h0_pos_0 = value_h0[:, 0, :] # (b, lstm_size) + + # Linear with relu + # Then linear without relu + value_h1_pos_0 = tf.layers.Dense(units=hps('value_h1_size'), # (b, 256) + use_bias=True, + activation=relu)(value_h0_pos_0) + value_h2_pos_0 = tf.layers.Dense(units=NB_POWERS, # (b, 7) + use_bias=True, + activation=None)(value_h1_pos_0) + + # Computing for the current power + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + state_value = tf.reduce_sum(current_power_mask * value_h2_pos_0, axis=-1) # (b,) + + # Computing value loss + with tf.variable_scope('value_loss'): + value_loss = tf.reduce_mean(tf.square(value_target - state_value)) + value_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(value_loss), # pylint: disable=cell-var-from-loop + lambda: value_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/value/v003_rnn_step_0': True, + 'state_value': state_value, + 'value_loss': value_loss} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/value/v003_rnn_step_0/tests/__init__.py b/diplomacy_research/models/value/v003_rnn_step_0/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/value/v003_rnn_step_0/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/value/v003_rnn_step_0/tests/test_model.py b/diplomacy_research/models/value/v003_rnn_step_0/tests/test_model.py new file mode 100644 index 0000000..f3cc1ea --- /dev/null +++ b/diplomacy_research/models/value/v003_rnn_step_0/tests/test_model.py @@ -0,0 +1,60 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the v003_rnn_step_0 ValueModel """ +from diplomacy_research.models.policy import order_based +from diplomacy_research.models.policy import token_based +import diplomacy_research.models.policy.order_based.v005_markovian_film_board_align as order_based_model +import diplomacy_research.models.policy.token_based.v005_markovian_film_board_align as token_based_model +from diplomacy_research.models.value.tests.value_model_test_setup import ValueModelTestSetup +from diplomacy_research.models.value.v003_rnn_step_0 import ValueModel, load_args +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Launch Scripts -------------- +def launch_order_based(): + """ Launches tests for order based """ + model_family_path = order_based + model_version_path = order_based_model + test_object = ValueModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=load_args, + load_draw_args=None) + test_object.run_tests() + +def launch_token_based(): + """ Launches tests for token based """ + model_family_path = token_based + model_version_path = token_based_model + test_object = ValueModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=load_args, + load_draw_args=None) + test_object.run_tests() + +# ----------- Tests -------------- +def test_order_based(): + """ Runs the order_based test """ + run_in_separate_process(target=launch_order_based, timeout=120) + +def test_token_based(): + """ Runs the token_based test """ + run_in_separate_process(target=launch_token_based, timeout=120) diff --git a/diplomacy_research/models/value/v004_board_state_conv/__init__.py b/diplomacy_research/models/value/v004_board_state_conv/__init__.py new file mode 100644 index 0000000..8f67720 --- /dev/null +++ b/diplomacy_research/models/value/v004_board_state_conv/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" v004_board_state_conv Value Model """ +from .model import ValueModel, load_args diff --git a/diplomacy_research/models/value/v004_board_state_conv/model.py b/diplomacy_research/models/value/v004_board_state_conv/model.py new file mode 100644 index 0000000..1073fec --- /dev/null +++ b/diplomacy_research/models/value/v004_board_state_conv/model.py @@ -0,0 +1,116 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Value model (v004_board_state_conv) + - Contains the value model +""" +import logging +from diplomacy_research.models.state_space import NB_POWERS +from diplomacy_research.models.value.base_value_model import BaseValueModel, load_args as load_parent_args + +# Constants +LOGGER = logging.getLogger(__name__) + +def load_args(): + """ Load possible arguments + :return: A list of tuple (arg_type, arg_name, arg_value, arg_desc) + """ + return load_parent_args() + [ + # Hyperparameters + ('int', 'value_h1_size', 256, 'The size of the first hidden layer in the value calculation'), + ] + +class ValueModel(BaseValueModel): + """ Value Model - Evaluates the value of a state for all powers """ + + def _get_board_value(self, board_state, current_power, name='board_state_value', reuse=None): + """ Computes the estimated value of a board state + :param board_state: The board state - (batch, NB_NODES, NB_FEATURES) + :param current_power: The power for which we want the board value - (batch,) + :param name: The name to use for the operaton + :param reuse: Whether to reuse or not the weights from another operation + :return: The value of the board state for the specified power - (batch,) + """ + from diplomacy_research.utils.tensorflow import tf + + # Quick function to retrieve hparams and placeholders and function shorthands + hps = lambda hparam_name: self.hparams[hparam_name] + relu = tf.nn.relu + + # Building scope + scope = tf.VariableScope(name='value/%s' % name, reuse=reuse) + with tf.variable_scope(scope): + + # Encoding the board state + board_state_conv = self.encode_board(board_state, name='board_state_conv', reuse=True) + board_state_conv = tf.reduce_mean(board_state_conv, axis=1) # (b, conv_size) + + with tf.variable_scope('value_scope'): + current_power_mask = tf.one_hot(current_power, NB_POWERS, dtype=tf.float32) + state_value = tf.stop_gradient(board_state_conv) if hps('stop_gradient_value') else board_state_conv + state_value = tf.layers.Dense(units=hps('value_h1_size'), # (b, value_h1_size) + activation=relu, + use_bias=True)(state_value) + state_value = tf.layers.Dense(units=NB_POWERS, # (b, NB_POWERS) + activation=None, + use_bias=True)(state_value) + state_value = tf.reduce_sum(state_value * current_power_mask, axis=1) # (b,) + + # Returning + return state_value + + def _build_value_initial(self): + """ Builds the value model (initial step) """ + from diplomacy_research.utils.tensorflow import tf + from diplomacy_research.utils.tensorflow import to_float + + if not self.placeholders: + self.placeholders = self.get_placeholders() + else: + self.placeholders.update(self.get_placeholders()) + + # Quick function to retrieve hparams and placeholders and function shorthands + pholder = lambda placeholder_name: self.placeholders[placeholder_name] + + # Training loop + with tf.variable_scope('value', reuse=tf.AUTO_REUSE): + with tf.device(self.cluster_config.worker_device if self.cluster_config else None): + + # Outputs from the policy model + assert 'board_state_conv' in self.outputs and self.outputs['board_state_conv'] is not None + + # Inputs and Features + board_state = to_float(self.features['board_state']) # tf.float32 - (b, NB_NODES, NB_FEATURES) + current_power = self.features['current_power'] # tf.int32 - (b,) + value_target = self.features['value_target'] # tf.float32 - (b,) + + # Placeholders + stop_gradient_all = pholder('stop_gradient_all') + + # Computing value for the current power + state_value = self.get_board_value(board_state, current_power) + + # Computing value loss + with tf.variable_scope('value_loss'): + value_loss = tf.reduce_mean(tf.square(value_target - state_value)) + value_loss = tf.cond(stop_gradient_all, + lambda: tf.stop_gradient(value_loss), # pylint: disable=cell-var-from-loop + lambda: value_loss) # pylint: disable=cell-var-from-loop + + # Building output tags + outputs = {'tag/value/v004_board_state_conv': True, + 'state_value': state_value, + 'value_loss': value_loss} + + # Adding features, placeholders and outputs to graph + self.add_meta_information(outputs) diff --git a/diplomacy_research/models/value/v004_board_state_conv/tests/__init__.py b/diplomacy_research/models/value/v004_board_state_conv/tests/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/models/value/v004_board_state_conv/tests/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/models/value/v004_board_state_conv/tests/test_model.py b/diplomacy_research/models/value/v004_board_state_conv/tests/test_model.py new file mode 100644 index 0000000..d1c281d --- /dev/null +++ b/diplomacy_research/models/value/v004_board_state_conv/tests/test_model.py @@ -0,0 +1,60 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Class to test the v004_board_state_conv ValueModel """ +from diplomacy_research.models.policy import order_based +from diplomacy_research.models.policy import token_based +import diplomacy_research.models.policy.order_based.v005_markovian_film_board_align as order_based_model +import diplomacy_research.models.policy.token_based.v005_markovian_film_board_align as token_based_model +from diplomacy_research.models.value.tests.value_model_test_setup import ValueModelTestSetup +from diplomacy_research.models.value.v004_board_state_conv import ValueModel, load_args +from diplomacy_research.utils.process import run_in_separate_process + + +# ----------- Launch Scripts -------------- +def launch_order_based(): + """ Launches tests for order based """ + model_family_path = order_based + model_version_path = order_based_model + test_object = ValueModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=load_args, + load_draw_args=None) + test_object.run_tests() + +def launch_token_based(): + """ Launches tests for token based """ + model_family_path = token_based + model_version_path = token_based_model + test_object = ValueModelTestSetup(policy_model_ctor=model_version_path.PolicyModel, + value_model_ctor=ValueModel, + draw_model_ctor=None, + dataset_builder=model_family_path.BaseDatasetBuilder(), + adapter_ctor=model_family_path.PolicyAdapter, + load_policy_args=model_version_path.load_args, + load_value_args=load_args, + load_draw_args=None) + test_object.run_tests() + +# ----------- Tests -------------- +def test_order_based(): + """ Runs the order_based test """ + run_in_separate_process(target=launch_order_based, timeout=120) + +def test_token_based(): + """ Runs the token_based test """ + run_in_separate_process(target=launch_token_based, timeout=120) diff --git a/diplomacy_research/players/__init__.py b/diplomacy_research/players/__init__.py new file mode 100644 index 0000000..7f479e6 --- /dev/null +++ b/diplomacy_research/players/__init__.py @@ -0,0 +1,18 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Players """ +from .dummy_player import DummyPlayer +from .random_player import RandomPlayer +from .rule_based_player import RuleBasedPlayer +from .model_based_player import ModelBasedPlayer diff --git a/diplomacy_research/players/benchmark_player.py b/diplomacy_research/players/benchmark_player.py new file mode 100644 index 0000000..f2fe7b6 --- /dev/null +++ b/diplomacy_research/players/benchmark_player.py @@ -0,0 +1,206 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Benchmark Player + - Contains classes to play published against published benchmarks +""" +import logging +import os +from multiprocessing import Process +import shutil +import time +import zipfile +from tornado import gen +from diplomacy import Game +from diplomacy_research.models.datasets.grpc_dataset import GRPCDataset, ModelConfig +from diplomacy_research.players.benchmarks import rl_neurips2019, sl_neurips2019 +from diplomacy_research.players.model_based_player import ModelBasedPlayer +from diplomacy_research.utils.cluster import is_port_opened, kill_processes_using_port +from diplomacy_research.utils.process import start_tf_serving, download_file, kill_subprocesses_on_exit +from diplomacy_research.settings import WORKING_DIR + +# Constants +LOGGER = logging.getLogger(__name__) +PERIOD_SECONDS = 10 +MAX_SENTINEL_CHECKS = 3 +MAX_TIME_BETWEEN_CHECKS = 300 + + +class NeurIPS2019SLPlayer(ModelBasedPlayer): + """ NeurIPS 2019 Supervised Learning Benchmark Player """ + + def __init__(self, temperature=0.1, use_beam=False, port=9501, name=None): + """ Constructor + :param temperature: The temperature to apply to the logits. + :param use_beam: Boolean that indicates that we want to use a beam search. + :param port: The port to use for the tf serving to query the model. + :param name: Optional. The name of this player. + """ + model_url = 'https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/neurips2019-sl_model.zip' + + # Creating serving if port is not open + if not is_port_opened(port): + launch_serving(model_url, port) + + # Creating adapter + grpc_dataset = GRPCDataset(hostname='localhost', + port=port, + model_name='player', + signature=sl_neurips2019.PolicyAdapter.get_signature(), + dataset_builder=sl_neurips2019.BaseDatasetBuilder()) + policy_adapter = sl_neurips2019.PolicyAdapter(grpc_dataset) + + # Building benchmark model + super(NeurIPS2019SLPlayer, self).__init__(policy_adapter=policy_adapter, + temperature=temperature, + use_beam=use_beam, + name=name) + +class NeurIPS2019RLPlayer(ModelBasedPlayer): + """ NeurIPS 2019 Reinforcement Learning Benchmark Player """ + + def __init__(self, temperature=0.1, use_beam=False, port=9502, name=None): + """ Constructor + :param temperature: The temperature to apply to the logits. + :param use_beam: Boolean that indicates that we want to use a beam search. + :param port: The port to use for the tf serving to query the model. + :param name: Optional. The name of this player. + """ + model_url = 'https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/neurips2019-rl_model.zip' + + # Creating serving if port is not open + if not is_port_opened(port): + launch_serving(model_url, port) + + # Creating adapter + grpc_dataset = GRPCDataset(hostname='localhost', + port=port, + model_name='player', + signature=rl_neurips2019.PolicyAdapter.get_signature(), + dataset_builder=rl_neurips2019.BaseDatasetBuilder()) + policy_adapter = rl_neurips2019.PolicyAdapter(grpc_dataset) + + # Building benchmark model + super(NeurIPS2019RLPlayer, self).__init__(policy_adapter=policy_adapter, + temperature=temperature, + use_beam=use_beam, + name=name) + +class WebDiplomacyPlayer(ModelBasedPlayer): + """ WebDiplomacy Player """ + + def __init__(self, temperature=0.1, use_beam=False, port=9503, name=None): + """ Constructor + :param temperature: The temperature to apply to the logits. + :param use_beam: Boolean that indicates that we want to use a beam search. + :param port: The port to use for the tf serving to query the model. + :param name: Optional. The name of this player. + """ + model_url = 'https://f002.backblazeb2.com/file/ppaquette-public/benchmarks/neurips2019-sl_model.zip' + + # Creating serving if port is not open + if not is_port_opened(port): + launch_serving(model_url, port) + + # Creating adapter + grpc_dataset = GRPCDataset(hostname='localhost', + port=port, + model_name='player', + signature=sl_neurips2019.PolicyAdapter.get_signature(), + dataset_builder=sl_neurips2019.BaseDatasetBuilder()) + policy_adapter = sl_neurips2019.PolicyAdapter(grpc_dataset) + + # Building benchmark model + super(WebDiplomacyPlayer, self).__init__(policy_adapter=policy_adapter, + temperature=temperature, + use_beam=use_beam, + name=name) + + +# ------ Utility Methods ------ +def launch_serving(model_url, serving_port, first_launch=True): + """ Launches or relaunches the TF Serving process + :param model_url: The URL to use to download the model + :param serving_port: The port to use for TF serving + :param first_launch: Boolean that indicates if this is the first launch or a relaunch + """ + model_url = model_url or '' + bot_filename = model_url.split('/')[-1] + bot_name = bot_filename.split('.')[0] + bot_directory = os.path.join(WORKING_DIR, 'data', 'bot_%s' % bot_name) + bot_model = os.path.join(bot_directory, bot_filename) + + # If first launch, downloading the model + if first_launch: + shutil.rmtree(bot_directory, ignore_errors=True) + os.makedirs(bot_directory, exist_ok=True) + + # Downloading model + download_file(model_url, bot_model, force=True) + + # Unzipping file + zip_ref = zipfile.ZipFile(bot_model, 'r') + zip_ref.extractall(bot_directory) + zip_ref.close() + + # Otherwise, restarting the serving + elif is_port_opened(serving_port): + kill_processes_using_port(serving_port) + + # Launching a new process + log_file_path = os.path.join(WORKING_DIR, 'data', 'log_serving_%d.txt' % serving_port) + serving_process = Process(target=start_tf_serving, + args=(serving_port, WORKING_DIR), + kwargs={'force_cpu': True, + 'log_file_path': log_file_path}) + serving_process.start() + kill_subprocesses_on_exit() + + # Waiting for port to be opened. + for attempt_ix in range(90): + time.sleep(10) + if is_port_opened(serving_port): + break + LOGGER.info('Waiting for TF Serving to come online. - Attempt %d / %d', attempt_ix + 1, 90) + else: + LOGGER.error('TF Serving is not online after 15 minutes. Aborting.') + raise RuntimeError() + + # Setting configuration + new_config = ModelConfig(name='player', base_path='/work_dir/data/bot_%s' % bot_name, version_policy=None) + for _ in range(30): + if GRPCDataset.set_config('localhost', serving_port, new_config): + LOGGER.info('Configuration set successfully.') + break + time.sleep(5.) + else: + LOGGER.error('Unable to set the configuration file.') + +@gen.coroutine +def check_serving(player, serving_port): + """ Makes sure the current serving process is still active, otherwise restarts it. + :param player: A player object to query the server + :param serving_port: The port to use for TF serving + """ + game = Game() + + # Trying to check orders + for _ in range(MAX_SENTINEL_CHECKS): + orders = yield player.get_orders(game, 'FRANCE') + if orders: + return + + # Could not get orders x times in a row, restarting process + LOGGER.warning('Could not retrieve orders from the serving process after %d attempts.', MAX_SENTINEL_CHECKS) + LOGGER.warning('Restarting TF serving server.') + launch_serving(None, serving_port) diff --git a/diplomacy_research/players/benchmarks/__init__.py b/diplomacy_research/players/benchmarks/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/players/benchmarks/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/players/benchmarks/rl_neurips2019/__init__.py b/diplomacy_research/players/benchmarks/rl_neurips2019/__init__.py new file mode 100644 index 0000000..30b4695 --- /dev/null +++ b/diplomacy_research/players/benchmarks/rl_neurips2019/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +from .adapter import PolicyAdapter +from .dataset_builder import BaseDatasetBuilder diff --git a/diplomacy_research/players/benchmarks/rl_neurips2019/adapter.py b/diplomacy_research/players/benchmarks/rl_neurips2019/adapter.py new file mode 100644 index 0000000..cc6d585 --- /dev/null +++ b/diplomacy_research/players/benchmarks/rl_neurips2019/adapter.py @@ -0,0 +1,324 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" RL (NeurIPS 2019) Policy Adapter + - Implements an instance of a policy adapter to connect to a order_based model +""" +import logging +import numpy as np +from numpy.random import choice +from tornado import gen +from diplomacy_research.models.policy.base_policy_adapter import BasePolicyAdapter +from diplomacy_research.models.policy.base_policy_model import OrderProbTokenLogProbs, TRAINING_DECODER, \ + GREEDY_DECODER, SAMPLE_DECODER +from diplomacy_research.models.policy.order_based.model import OrderBasedPolicyModel +from diplomacy_research.models.state_space import EOS_ID, PAD_ID, order_to_ix, ix_to_order +from diplomacy_research.utils.cluster import CompletedFuture, process_fetches_dict +from diplomacy_research.utils.model import logsumexp, apply_temperature, strip_keys, assert_normalized + +# Constants +LOGGER = logging.getLogger(__name__) + +class PolicyAdapter(BasePolicyAdapter): + """ Adapter to connect to an OrderBased model """ + + @staticmethod + def get_signature(): + """ Returns the signature of all the possible calls using this adapter + Format: { method_signature_name: {'placeholders': {name: (value, numpy_dtype)}, + 'outputs': [output_name, output_name] } } + e.g. {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs: ['selected_tokens', 'log_probs']}} + """ + return {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs': ['selected_tokens', 'log_probs']}, + 'policy_beam_search': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['beam_tokens', 'beam_log_probs']}, + 'policy_expand': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['logits']}, + 'policy_log_probs': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['log_probs']}, + 'policy_get_value': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['state_value']}} + + def tokenize(self, order): + """ Returns the tokens use by the adapter for a specific order """ + return [order_to_ix(order) or PAD_ID] + + def _decode_policy(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Returns the output of the Policy Model decoder + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: Boolean that indicates that we want to use a beam search, + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: A future (fetches) to yield on. + """ + is_prefetching = kwargs.get('prefetch', False) + + # No locations provided, we can return early + if not locs: + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + LOGGER.warning('The method .get_feedable_item() did not return an item to feed to the model.') + LOGGER.warning('Make sure you have provided the correct locs and a list of possible orders') + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Queue + use_beam = kwargs.get('use_beam', False) + queue_name = {False: 'policy_evaluate', + True: 'policy_beam_search'}[use_beam] + return self.feedable_dataset.get_results(queue_name, feedable_item, **kwargs) + + @staticmethod + def _process_fetches(decode_fetches): + """ Decodes the fetches returned by self._decode_policy() + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + tokens, log_probs = decode_fetches[:2] + decoded_results = OrderBasedPolicyModel._decode(selected_tokens=np.array([tokens]), # pylint: disable=protected-access + log_probs=np.array([log_probs])) + return decoded_results['decoded_orders'][0] + + @staticmethod + def _process_single_beam_fetches(decode_fetches, temperature=0.): + """ Decodes the beam fetches returned self._decode_policy() - This samples the beam to use based on a temp. + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + beam_tokens, beam_log_probs = decode_fetches[:2] + + # Computing probabilities after applying temperature + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=temperature).tolist() + nb_probs = len(probs) + + # Sampling according to probs + selected_beam_id = choice(range(nb_probs), p=assert_normalized(adj_probs)) + + # Decoding that specific beam + # Assigning probability mass equally over all orders in beam + selected_beam_tokens = np.array([beam_tokens[selected_beam_id]]) + selected_beam_log_probs = np.zeros_like(selected_beam_tokens) + decoded_results = OrderBasedPolicyModel._decode(selected_tokens=selected_beam_tokens, # pylint: disable=protected-access + log_probs=selected_beam_log_probs)['decoded_orders'][0] + + # Adjusting log probs to make it uniform over all locs + nb_locs = len(decoded_results) + adj_log_probs = beam_log_probs[selected_beam_id] / max(1, nb_locs) + decoded_results = {loc: OrderProbTokenLogProbs(order=decoded_results[loc].order, + probability=decoded_results[loc].probability, + log_probs=[adj_log_probs]) for loc in decoded_results} + return decoded_results + + @gen.coroutine + def get_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds the orders to submit at each location given the current state + Orderings are calculated by defining an ordering and computing the next unit order conditioned on the + orders already selected + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - use_beam: Boolean that indicates that we want to use a beam search, (Default; False) + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + selected_orders = [] + policy_details = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] + if decode_fetches is None: + return selected_orders, policy_details + + if kwargs.get('use_beam', False): + results = self._process_single_beam_fetches(decode_fetches, temperature=kwargs.get('temperature', 0.)) + else: + results = self._process_fetches(decode_fetches) + + # Building policy details based on returned locations + for loc in results: + order_prob_token_log_probs = results[loc] + + # Splitting + order = order_prob_token_log_probs.order + log_probs = order_prob_token_log_probs.log_probs + + # Building the policy details + selected_orders += [order] + policy_details['locs'] += [loc] + policy_details['tokens'] += self.tokenize(order) + policy_details['log_probs'] += list(log_probs) + + # Getting draw action and probability + policy_details['draw_action'] = False + policy_details['draw_prob'] = 0. + + # Returning sampled orders with the policy details + return selected_orders, policy_details + + @gen.coroutine + def get_beam_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds all the beams with their probabilities returned by the diverse beam search + Beams are ordered by score (highest first). + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + use_beam=True, + **strip_keys(kwargs, ['use_beam'])) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + beams, adj_probs = [], [] + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] # (beam_orders, beam_log_probs) + if decode_fetches is None: + return beams, adj_probs + + # Computing adj probabilities + beam_orders, beam_log_probs = decode_fetches[:2] + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=1.).tolist() + + # Decoding + for beam_candidates in beam_orders: + beams += [[ix_to_order(order_ix) for order_ix in beam_candidates if order_ix > EOS_ID]] + + # Returning + return beams, adj_probs + + @gen.coroutine + def get_updated_policy_details(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + old_policy_details=None, submitted_orders=None, **kwargs): + """ Computes the current policy details (locs, tokens, log_probs) under the current model """ + raise RuntimeError('Not available for this benchmark.') + + @gen.coroutine + def expand(self, confirmed_orders, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Computes the conditional probability of possible orders for each loc given the confirmed orders. """ + raise RuntimeError('Not available for this benchmark.') + + @gen.coroutine + def get_state_value(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, **kwargs): + """ Computes the value of the current state for a given power """ + raise RuntimeError('Not available for this benchmark.') diff --git a/diplomacy_research/players/benchmarks/rl_neurips2019/dataset_builder.py b/diplomacy_research/players/benchmarks/rl_neurips2019/dataset_builder.py new file mode 100644 index 0000000..5087f84 --- /dev/null +++ b/diplomacy_research/players/benchmarks/rl_neurips2019/dataset_builder.py @@ -0,0 +1,185 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" RL (NeurIPS 2019) Dataset Builder + - Base class responsible for generating the protocol buffers to be used by the model +""" +import logging +import numpy as np +from diplomacy import Map +from diplomacy_research.models.datasets.base_builder import FixedProtoField, VarProtoField +from diplomacy_research.models.policy.base_policy_builder import BasePolicyBuilder +from diplomacy_research.models.state_space import get_order_based_mask, proto_to_board_state, GO_ID, NB_NODES, \ + NB_SUPPLY_CENTERS, POWER_VOCABULARY_KEY_TO_IX, MAX_CANDIDATES, NB_FEATURES, NB_ORDERS_FEATURES, NB_PREV_ORDERS, \ + get_board_alignments, get_orderable_locs_for_powers, get_current_season, proto_to_prev_orders_state + +# Constants +LOGGER = logging.getLogger(__name__) + +class BaseDatasetBuilder(BasePolicyBuilder): + """ This object is responsible for maintaining the data and feeding it into the model """ + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this dataset builder """ + # Creating proto fields + proto_fields = { + 'request_id': FixedProtoField([], None), + 'player_seed': FixedProtoField([], np.int32), + 'board_state': FixedProtoField([NB_NODES, NB_FEATURES], np.uint8), + 'board_alignments': VarProtoField([NB_NODES * NB_SUPPLY_CENTERS], np.uint8), + 'prev_orders_state': FixedProtoField([NB_PREV_ORDERS, NB_NODES, NB_ORDERS_FEATURES], np.uint8), + 'decoder_inputs': VarProtoField([1 + NB_SUPPLY_CENTERS], np.int32), + 'decoder_lengths': FixedProtoField([], np.int32), + 'candidates': VarProtoField([None, MAX_CANDIDATES], np.int32), + 'noise': FixedProtoField([], np.float32), + 'temperature': FixedProtoField([], np.float32), + 'dropout_rate': FixedProtoField([], np.float32), + 'current_power': FixedProtoField([], np.int32), + 'current_season': FixedProtoField([], np.int32), + 'value_targets': FixedProtoField([], np.float32), + 'context': VarProtoField([256 * 2 * 8], np.float32), + 'messages': VarProtoField([1 + 1000], np.int32), + 'message_lengths': FixedProtoField([], np.int32), + 'senders': VarProtoField([1000], np.uint8), + 'recipients': VarProtoField([1000], np.uint8), + 'next_conversant': FixedProtoField([2], np.int32) + } + return proto_fields + + @staticmethod + def get_feedable_item(locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Computes and return a feedable item (to be fed into the feedable queue) + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :return: A feedable item, with feature names as key and numpy arrays as values + """ + # pylint: disable=too-many-branches + # Converting to state space + map_object = Map(state_proto.map) + board_state = proto_to_board_state(state_proto, map_object) + + # Building the decoder length + # For adjustment phase, we restrict the number of builds/disbands to what is allowed by the game engine + in_adjustment_phase = state_proto.name[-1] == 'A' + nb_builds = state_proto.builds[power_name].count + nb_homes = len(state_proto.builds[power_name].homes) + + # If we are in adjustment phase, making sure the locs are the orderable locs (and not the policy locs) + if in_adjustment_phase: + orderable_locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + if sorted(locs) != sorted(orderable_locs): + if locs: + LOGGER.warning('Adj. phase requires orderable locs. Got %s. Expected %s.', locs, orderable_locs) + locs = orderable_locs + + # WxxxA - We can build units + # WxxxA - We can disband units + # Other phase + if in_adjustment_phase and nb_builds >= 0: + decoder_length = min(nb_builds, nb_homes) + elif in_adjustment_phase and nb_builds < 0: + decoder_length = abs(nb_builds) + else: + decoder_length = len(locs) + + # Computing the candidates for the policy + if possible_orders_proto: + + # Adjustment Phase - Use all possible orders for each location. + if in_adjustment_phase: + + # Building a list of all orders for all locations + adj_orders = [] + for loc in locs: + adj_orders += possible_orders_proto[loc].value + + # Computing the candidates + candidates = [get_order_based_mask(adj_orders)] * decoder_length + + # Regular phase - Compute candidates for each location + else: + candidates = [] + for loc in locs: + candidates += [get_order_based_mask(possible_orders_proto[loc].value)] + + # We don't have possible orders, so we cannot compute candidates + # This might be normal if we are only getting the state value or the next message to send + else: + candidates = [] + for _ in range(decoder_length): + candidates.append([]) + + # Prev orders state + prev_orders_state = [] + for phase_proto in reversed(phase_history_proto): + if len(prev_orders_state) == NB_PREV_ORDERS: + break + if phase_proto.name[-1] == 'M': + prev_orders_state = [proto_to_prev_orders_state(phase_proto, map_object)] + prev_orders_state + for _ in range(NB_PREV_ORDERS - len(prev_orders_state)): + prev_orders_state = [np.zeros((NB_NODES, NB_ORDERS_FEATURES), dtype=np.uint8)] + prev_orders_state + prev_orders_state = np.array(prev_orders_state) + + # Building (order) decoder inputs [GO_ID] + decoder_inputs = [GO_ID] + + # kwargs + player_seed = kwargs.get('player_seed', 0) + noise = kwargs.get('noise', 0.) + temperature = kwargs.get('temperature', 0.) + dropout_rate = kwargs.get('dropout_rate', 0.) + + # Building feedable data + item = { + 'player_seed': player_seed, + 'board_state': board_state, + 'board_alignments': get_board_alignments(locs, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=1, + decoder_length=decoder_length), + 'prev_orders_state': prev_orders_state, + 'decoder_inputs': decoder_inputs, + 'decoder_lengths': decoder_length, + 'candidates': candidates, + 'noise': noise, + 'temperature': temperature, + 'dropout_rate': dropout_rate, + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(state_proto) + } + + # Return + return item + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + raise NotImplementedError() diff --git a/diplomacy_research/players/benchmarks/sl_neurips2019/__init__.py b/diplomacy_research/players/benchmarks/sl_neurips2019/__init__.py new file mode 100644 index 0000000..30b4695 --- /dev/null +++ b/diplomacy_research/players/benchmarks/sl_neurips2019/__init__.py @@ -0,0 +1,15 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +from .adapter import PolicyAdapter +from .dataset_builder import BaseDatasetBuilder diff --git a/diplomacy_research/players/benchmarks/sl_neurips2019/adapter.py b/diplomacy_research/players/benchmarks/sl_neurips2019/adapter.py new file mode 100644 index 0000000..78f9bfd --- /dev/null +++ b/diplomacy_research/players/benchmarks/sl_neurips2019/adapter.py @@ -0,0 +1,322 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" SL (NeurIPS 2019) Policy Adapter + - Implements an instance of a policy adapter to connect to a order_based model +""" +import logging +import numpy as np +from numpy.random import choice +from tornado import gen +from diplomacy_research.models.policy.base_policy_adapter import BasePolicyAdapter +from diplomacy_research.models.policy.base_policy_model import OrderProbTokenLogProbs, TRAINING_DECODER, \ + GREEDY_DECODER, SAMPLE_DECODER +from diplomacy_research.models.policy.order_based.model import OrderBasedPolicyModel +from diplomacy_research.models.state_space import EOS_ID, PAD_ID, order_to_ix, ix_to_order +from diplomacy_research.utils.cluster import CompletedFuture, process_fetches_dict +from diplomacy_research.utils.model import logsumexp, apply_temperature, strip_keys, assert_normalized + +# Constants +LOGGER = logging.getLogger(__name__) + +class PolicyAdapter(BasePolicyAdapter): + """ Adapter to connect to an OrderBased model """ + + @staticmethod + def get_signature(): + """ Returns the signature of all the possible calls using this adapter + Format: { method_signature_name: {'placeholders': {name: (value, numpy_dtype)}, + 'outputs': [output_name, output_name] } } + e.g. {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs: ['selected_tokens', 'log_probs', 'draw_prob']}} + """ + return {'policy_evaluate': {'placeholders': {'decoder_type': ([SAMPLE_DECODER], np.uint8)}, + 'outputs': ['selected_tokens', 'log_probs']}, + 'policy_beam_search': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['beam_tokens', 'beam_log_probs']}, + 'policy_expand': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['logits']}, + 'policy_log_probs': {'placeholders': {'decoder_type': ([TRAINING_DECODER], np.uint8)}, + 'outputs': ['log_probs']}, + 'policy_get_value': {'placeholders': {'decoder_type': ([GREEDY_DECODER], np.uint8)}, + 'outputs': ['state_value']}} + + def tokenize(self, order): + """ Returns the tokens use by the adapter for a specific order """ + return [order_to_ix(order) or PAD_ID] + + def _decode_policy(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Returns the output of the Policy Model decoder + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - use_beam: Boolean that indicates that we want to use a beam search, + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: A future (fetches) to yield on. + """ + is_prefetching = kwargs.get('prefetch', False) + + # No locations provided, we can return early + if not locs: + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Getting feedable item + feedable_item = self.feedable_dataset.get_feedable_item(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + if not feedable_item: + LOGGER.warning('The method .get_feedable_item() did not return an item to feed to the model.') + LOGGER.warning('Make sure you have provided the correct locs and a list of possible orders') + ret_val = None + return CompletedFuture(ret_val) if is_prefetching else ret_val + + # Queue + use_beam = kwargs.get('use_beam', False) + queue_name = {False: 'policy_evaluate', + True: 'policy_beam_search'}[use_beam] + return self.feedable_dataset.get_results(queue_name, feedable_item, **kwargs) + + @staticmethod + def _process_fetches(decode_fetches): + """ Decodes the fetches returned by self._decode_policy() + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + tokens, log_probs = decode_fetches[:2] + decoded_results = OrderBasedPolicyModel._decode(selected_tokens=np.array([tokens]), # pylint: disable=protected-access + log_probs=np.array([log_probs])) + return decoded_results['decoded_orders'][0] + + @staticmethod + def _process_single_beam_fetches(decode_fetches, temperature=0.): + """ Decodes the beam fetches returned self._decode_policy() - This samples the beam to use based on a temp. + :param decode_fetches: The fetches returned by self._decode_policy() + :return: An ordered dict with the location as key, and an OrderProbTokenLogProbs as value + """ + # If we get an empty list, we can't decode it + if not decode_fetches: + return decode_fetches + + beam_tokens, beam_log_probs = decode_fetches[:2] + + # Computing probabilities after applying temperature + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=temperature).tolist() + nb_probs = len(probs) + + # Sampling according to probs + selected_beam_id = choice(range(nb_probs), p=assert_normalized(adj_probs)) + + # Decoding that specific beam + # Assigning probability mass equally over all orders in beam + selected_beam_tokens = np.array([beam_tokens[selected_beam_id]]) + selected_beam_log_probs = np.zeros_like(selected_beam_tokens) + decoded_results = OrderBasedPolicyModel._decode(selected_tokens=selected_beam_tokens, # pylint: disable=protected-access + log_probs=selected_beam_log_probs)['decoded_orders'][0] + + # Adjusting log probs to make it uniform over all locs + nb_locs = len(decoded_results) + adj_log_probs = beam_log_probs[selected_beam_id] / max(1, nb_locs) + decoded_results = {loc: OrderProbTokenLogProbs(order=decoded_results[loc].order, + probability=decoded_results[loc].probability, + log_probs=[adj_log_probs]) for loc in decoded_results} + return decoded_results + + @gen.coroutine + def get_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds the orders to submit at each location given the current state + Orderings are calculated by defining an ordering and computing the next unit order conditioned on the + orders already selected + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - use_beam: Boolean that indicates that we want to use a beam search, (Default; False) + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, a tuple consisting of: + 1) A list of the selected orders + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **kwargs) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + selected_orders = [] + policy_details = {'locs': [], + 'tokens': [], + 'log_probs': [], + 'draw_action': False, + 'draw_prob': 0.} + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] + if decode_fetches is None: + return selected_orders, policy_details + + if kwargs.get('use_beam', False): + results = self._process_single_beam_fetches(decode_fetches, temperature=kwargs.get('temperature', 0.)) + else: + results = self._process_fetches(decode_fetches) + + # Building policy details based on returned locations + for loc in results: + order_prob_token_log_probs = results[loc] + + # Splitting + order = order_prob_token_log_probs.order + log_probs = order_prob_token_log_probs.log_probs + + # Building the policy details + selected_orders += [order] + policy_details['locs'] += [loc] + policy_details['tokens'] += self.tokenize(order) + policy_details['log_probs'] += list(log_probs) + + # Getting draw action and probability + policy_details['draw_action'] = False + policy_details['draw_prob'] = 0. + + # Returning sampled orders with the policy details + return selected_orders, policy_details + + @gen.coroutine + def get_beam_orders(self, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds all the beams with their probabilities returned by the diverse beam search + Beams are ordered by score (highest first). + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + - prefetch: Boolean that indicates to return a dictionary of fetches (str: PrefetchedItem/Future) + - fetches: Dictionary of (str: future_results) that was computed with prefetch=True + :return: + - if prefetch=True, a dictionary of fetches (key as string, value is a future (or list) to yield on) + - if prefetch=False, a tuple consisting of: + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + """ + # Determining if we need to prefetch or postfetch + fetches = kwargs.get('fetches', {}) + is_prefetching = kwargs.get('prefetch', False) + is_postfetching = fetches and not is_prefetching + fetch_prefix = 'get_orders' + + # Getting fetches + if not is_postfetching: + locs = [loc[:3] for loc in locs] + + # Running policy model + fetches['%s/decode_fetches' % fetch_prefix] = self._decode_policy(locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + use_beam=True, + **strip_keys(kwargs, ['use_beam'])) + # Prefetching - We only return the fetches + if is_prefetching: + return fetches + + # Otherwise, we yield on the fetches + fetches = yield process_fetches_dict(self.feedable_dataset, fetches) + + # Variables + beams, adj_probs = [], [] + + # Processing + decode_fetches = fetches['%s/decode_fetches' % fetch_prefix] # (beam_orders, beam_log_probs) + if decode_fetches is None: + return beams, adj_probs + + # Computing adj probabilities + beam_orders, beam_log_probs = decode_fetches[:2] + probs = np.exp(beam_log_probs - logsumexp(beam_log_probs)) + adj_probs = apply_temperature(probs, temperature=1.).tolist() + + # Decoding + for beam_candidates in beam_orders: + beams += [[ix_to_order(order_ix) for order_ix in beam_candidates if order_ix > EOS_ID]] + + # Returning + return beams, adj_probs + + @gen.coroutine + def get_updated_policy_details(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + old_policy_details=None, submitted_orders=None, **kwargs): + """ Computes the current policy details (locs, tokens, log_probs) under the current model """ + raise RuntimeError('Not available for this benchmark.') + + @gen.coroutine + def expand(self, confirmed_orders, locs, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Computes the conditional probability of possible orders for each loc given the confirmed orders. """ + raise RuntimeError('Not available for this benchmark.') + + @gen.coroutine + def get_state_value(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, **kwargs): + """ Computes the value of the current state for a given power """ + raise RuntimeError('Not available for this benchmark.') diff --git a/diplomacy_research/players/benchmarks/sl_neurips2019/dataset_builder.py b/diplomacy_research/players/benchmarks/sl_neurips2019/dataset_builder.py new file mode 100644 index 0000000..14e8f74 --- /dev/null +++ b/diplomacy_research/players/benchmarks/sl_neurips2019/dataset_builder.py @@ -0,0 +1,180 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" SL (NeurIPS 2019) Dataset Builder + - Base class responsible for generating the protocol buffers to be used by the model +""" +import logging +import numpy as np +from diplomacy import Map +from diplomacy_research.models.datasets.base_builder import FixedProtoField, VarProtoField +from diplomacy_research.models.policy.base_policy_builder import BasePolicyBuilder +from diplomacy_research.models.state_space import get_order_based_mask, proto_to_board_state, GO_ID, NB_NODES, \ + NB_SUPPLY_CENTERS, POWER_VOCABULARY_KEY_TO_IX, MAX_CANDIDATES, NB_FEATURES, NB_ORDERS_FEATURES, NB_PREV_ORDERS, \ + get_board_alignments, get_orderable_locs_for_powers, get_current_season, proto_to_prev_orders_state + +# Constants +LOGGER = logging.getLogger(__name__) + +class BaseDatasetBuilder(BasePolicyBuilder): + """ This object is responsible for maintaining the data and feeding it into the model """ + + @staticmethod + def get_proto_fields(): + """ Returns the proto fields used by this dataset builder """ + # Creating proto fields + proto_fields = { + 'request_id': FixedProtoField([], None), + 'player_seed': FixedProtoField([], np.int32), + 'board_state': FixedProtoField([NB_NODES, NB_FEATURES], np.uint8), + 'board_alignments': VarProtoField([NB_NODES * NB_SUPPLY_CENTERS], np.uint8), + 'prev_orders_state': FixedProtoField([NB_PREV_ORDERS, NB_NODES, NB_ORDERS_FEATURES], np.uint8), + 'decoder_inputs': VarProtoField([1 + NB_SUPPLY_CENTERS], np.int32), + 'decoder_lengths': FixedProtoField([], np.int32), + 'candidates': VarProtoField([None, MAX_CANDIDATES], np.int32), + 'noise': FixedProtoField([], np.float32), + 'temperature': FixedProtoField([], np.float32), + 'dropout_rate': FixedProtoField([], np.float32), + 'current_power': FixedProtoField([], np.int32), + 'current_season': FixedProtoField([], np.int32), + 'draw_target': FixedProtoField([], np.float32), + 'value_target': FixedProtoField([], np.float32) + } + return proto_fields + + @staticmethod + def get_feedable_item(locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Computes and return a feedable item (to be fed into the feedable queue) + :param locs: A list of locations for which we want orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :return: A feedable item, with feature names as key and numpy arrays as values + """ + # pylint: disable=too-many-branches + # Converting to state space + map_object = Map(state_proto.map) + board_state = proto_to_board_state(state_proto, map_object) + + # Building the decoder length + # For adjustment phase, we restrict the number of builds/disbands to what is allowed by the game engine + in_adjustment_phase = state_proto.name[-1] == 'A' + nb_builds = state_proto.builds[power_name].count + nb_homes = len(state_proto.builds[power_name].homes) + + # If we are in adjustment phase, making sure the locs are the orderable locs (and not the policy locs) + if in_adjustment_phase: + orderable_locs, _ = get_orderable_locs_for_powers(state_proto, [power_name]) + if sorted(locs) != sorted(orderable_locs): + if locs: + LOGGER.warning('Adj. phase requires orderable locs. Got %s. Expected %s.', locs, orderable_locs) + locs = orderable_locs + + # WxxxA - We can build units + # WxxxA - We can disband units + # Other phase + if in_adjustment_phase and nb_builds >= 0: + decoder_length = min(nb_builds, nb_homes) + elif in_adjustment_phase and nb_builds < 0: + decoder_length = abs(nb_builds) + else: + decoder_length = len(locs) + + # Computing the candidates for the policy + if possible_orders_proto: + + # Adjustment Phase - Use all possible orders for each location. + if in_adjustment_phase: + + # Building a list of all orders for all locations + adj_orders = [] + for loc in locs: + adj_orders += possible_orders_proto[loc].value + + # Computing the candidates + candidates = [get_order_based_mask(adj_orders)] * decoder_length + + # Regular phase - Compute candidates for each location + else: + candidates = [] + for loc in locs: + candidates += [get_order_based_mask(possible_orders_proto[loc].value)] + + # We don't have possible orders, so we cannot compute candidates + # This might be normal if we are only getting the state value or the next message to send + else: + candidates = [] + for _ in range(decoder_length): + candidates.append([]) + + # Prev orders state + prev_orders_state = [] + for phase_proto in reversed(phase_history_proto): + if len(prev_orders_state) == NB_PREV_ORDERS: + break + if phase_proto.name[-1] == 'M': + prev_orders_state = [proto_to_prev_orders_state(phase_proto, map_object)] + prev_orders_state + for _ in range(NB_PREV_ORDERS - len(prev_orders_state)): + prev_orders_state = [np.zeros((NB_NODES, NB_ORDERS_FEATURES), dtype=np.uint8)] + prev_orders_state + prev_orders_state = np.array(prev_orders_state) + + # Building (order) decoder inputs [GO_ID] + decoder_inputs = [GO_ID] + + # kwargs + player_seed = kwargs.get('player_seed', 0) + noise = kwargs.get('noise', 0.) + temperature = kwargs.get('temperature', 0.) + dropout_rate = kwargs.get('dropout_rate', 0.) + + # Building feedable data + item = { + 'player_seed': player_seed, + 'board_state': board_state, + 'board_alignments': get_board_alignments(locs, + in_adjustment_phase=in_adjustment_phase, + tokens_per_loc=1, + decoder_length=decoder_length), + 'prev_orders_state': prev_orders_state, + 'decoder_inputs': decoder_inputs, + 'decoder_lengths': decoder_length, + 'candidates': candidates, + 'noise': noise, + 'temperature': temperature, + 'dropout_rate': dropout_rate, + 'current_power': POWER_VOCABULARY_KEY_TO_IX[power_name], + 'current_season': get_current_season(state_proto) + } + + # Return + return item + + @property + def proto_generation_callable(self): + """ Returns a callable required for proto files generation. + e.g. return generate_proto(saved_game_bytes, is_validation_set) + + Note: Callable args are - saved_game_bytes: A `.proto.game.SavedGame` object from the dataset + - phase_ix: The index of the phase we want to process + - is_validation_set: Boolean that indicates if we are generating the validation set + + Note: Used bytes_to_proto from diplomacy_research.utils.proto to convert bytes to proto + The callable must return a list of tf.train.Example to put in the protocol buffer file + """ + raise NotImplementedError() diff --git a/diplomacy_research/players/dummy_player.py b/diplomacy_research/players/dummy_player.py new file mode 100644 index 0000000..d6ec2dd --- /dev/null +++ b/diplomacy_research/players/dummy_player.py @@ -0,0 +1,78 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Dummy Player + - Contains a class representing a player that chooses to never do anything +""" +import logging +from tornado import gen +from diplomacy_research.players.player import Player + +# Constants +LOGGER = logging.getLogger(__name__) + +class DummyPlayer(Player): + """ Dummy Player Class """ + + @property + def is_trainable(self): + """ Returns a boolean that indicates if the player wants to be trained or not """ + return False + + @gen.coroutine + def get_orders_details_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Gets the orders (and the corresponding policy details) for the locs the power should play. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - with_state_value: Boolean that indicates to also query the value function. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: If with_state_value=False (default), a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + If with_state_value=True, a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + # pylint: disable=unused-argument + if kwargs.get('with_state_value', False): + return [], None, 0. + return [], None + + @gen.coroutine + def get_state_value_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, + **kwargs): + """ Calculates the player's value of the state of the game for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: A float representing the value of the state of the game to the specified power + """ + # pylint: disable=unused-argument + LOGGER.warning('There are no models available to query state value. Returning a value of 0.') + return 0. diff --git a/diplomacy_research/players/model_based_player.py b/diplomacy_research/players/model_based_player.py new file mode 100644 index 0000000..6535f02 --- /dev/null +++ b/diplomacy_research/players/model_based_player.py @@ -0,0 +1,266 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Model-Based Player + - Contains a class representing a player that chooses to move by sampling and conditional + its next move based on already selected orders +""" +import logging +import random +from tornado import gen +from diplomacy import Game +from diplomacy_research.models.state_space import extract_state_proto, extract_phase_history_proto, \ + extract_possible_orders_proto +from diplomacy_research.players.player import Player +from diplomacy_research.utils.model import merge_dicts + +# Constants +LOGGER = logging.getLogger(__name__) + +class ModelBasedPlayer(Player): + """ ModelBased Player Class""" + + def __init__(self, policy_adapter, player_seed=None, noise=None, temperature=None, schedule=None, + dropout_rate=None, use_beam=None, name=None): + """ Constructor + :param policy_adapter: The policy adapter (instance) to evaluate the action to select + :param player_seed: The seed to apply to the player to compute a deterministic mask. + :param noise: The sigma of the additional noise to apply to the intermediate layers. + :param temperature: The temperature to apply to the logits. (Defaults to schedule, otherwise uses 0.) + :param schedule: The temperature schedule to use. List of (prob, temperature) + e.g. [(0.75, 1.), (1., 0.)] means + - 1) 75% chance of using a temperature of 1 + - 2) if not 1), then 100% of using temperature of 0. + :param dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :param use_beam: Boolean that indicates that we want to use a beam search, + :param name: Optional. The name of this player. + :type policy_adapter: diplomacy_research.models.policy.base_policy_adapter.BasePolicyAdapter + """ + # pylint: disable=too-many-arguments + Player.__init__(self, name) + self.policy_adapter = policy_adapter + self._player_seed = player_seed or 0 + self._noise = noise or 0. + self._temperature = None + self._schedule = [(1., 0.)] + self._dropout_rate = dropout_rate or 0. + self._use_beam = use_beam + + # Using a temperature of 1. if using beam search without a temperature + if use_beam and temperature is None: + temperature = 1. + + # Use temperature if provided, otherwise use schedule, otherwise defaults to greedy + if temperature is not None: + self._temperature = temperature + self._schedule = [(1., temperature)] + elif schedule is not None: + self._schedule = schedule + + # ---------- Properties ------------- + @property + def is_trainable(self): + """ Returns a boolean that indicates if the player wants to be trained or not """ + if self.policy_adapter is not None and self.policy_adapter.is_trainable: + return True + return False + + @property + def temperature(self): + """ Getter - temperature """ + if self._temperature is not None: + return self._temperature + + # Otherwise, computing it from schedule + remaining = 1. + weighted_temp = 0. + for prob, temp in self._schedule: + weighted_temp += remaining * prob * temp + remaining -= max(0, remaining * prob) + return weighted_temp + + # ---------- Methods ------------- + @gen.coroutine + def get_beam_orders(self, game, power_names, *, retry_on_failure=True, **kwargs): + """ Finds all the beams with their probabilities returned by the diverse beam search for the selected power(s) + Beams are ordered by score (highest first). + :param game: The game object + :param power_names: A list of power names we are playing, or alternatively a single power name. + :param retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + :return: 1) If power_names is a string, a tuple of beam orders, and of beam probabilities + 2) If power_names is a list, a list of list which contains beam orders and beam probabilities + :type game: diplomacy.Game + """ + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + + # Determining if we have a single or multiple powers + if not isinstance(power_names, list): + is_single_power = True + power_names = [power_names] + else: + is_single_power = False + + # Getting beam orders + beam_orders_probs = yield [self.get_beam_orders_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + retry_on_failure=retry_on_failure, + **kwargs) for power_name in power_names] + beam_orders_probs = beam_orders_probs[0] if is_single_power else beam_orders_probs + return beam_orders_probs + + @gen.coroutine + def get_beam_orders_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Finds all the beams with their probabilities returned by the diverse beam search for the selected power + Beams are ordered by score (highest first). + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want the orders and the state values + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: The seed to apply to the player to compute a deterministic mask. + - noise: The sigma of the additional noise to apply to the intermediate layers (i.e. sigma * epsilon) + - temperature: The temperature to apply to the logits. (Default to 0. for deterministic/greedy) + - dropout_rate: The amount of dropout to apply to the inputs/outputs of the decoder. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return:A tuple consisting of + 1) A list of beams (i.e. a list of selected orders for each beam) + 2) A list of probability (the probability of selecting each beam) + """ + orderable_locs = self.get_orderable_locations(state_proto, power_name) + return (yield self.policy_adapter.get_beam_orders(orderable_locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **self._get_kwargs(**kwargs))) + + @gen.coroutine + def get_orders_details_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Gets the orders (and the corresponding policy details) for the locs the power should play. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - with_state_value: Boolean that indicates to also query the value function. + - use_beam: If set. Override the use_beam to use for the model based player. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: If with_state_value=False (default), a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + If with_state_value=True, a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + orderable_locs = self.get_orderable_locations(state_proto, power_name) + return (yield self.policy_adapter.get_orders(orderable_locs, + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **self._get_kwargs(**kwargs))) + + @gen.coroutine + def get_state_value_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, + **kwargs): + """ Calculates the player's value of the state of the game for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: A float representing the value of the state of the game to the specified power + """ + # Trying to query actor-critic model for state-value + if self.policy_adapter and self.policy_adapter.has_value_model: + return (yield self.policy_adapter.get_state_value(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **self._get_kwargs(**kwargs))) + + # Otherwise, returning 0. with a warning + LOGGER.warning('There are no models available to query state value. Returning a value of 0.') + return 0. + + @gen.coroutine + def get_opening_orders(self): + """ Returns a dictionary of power_name: [orders] for each power + The orders represent the opening orders that would have been submitted by the player + """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + + # Retrieving all orders + # Using default player_seed, noise, temperature, and dropout_rate. + # power_orders is a list of tuples (orders, policy_details) + power_orders = yield [self.policy_adapter.get_orders(self.get_orderable_locations(state_proto, power_name), + state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + retry_on_failure=False) for power_name in game.powers] + return {power_name: orders[0] for power_name, orders in zip(game.powers.keys(), power_orders)} + + def _get_kwargs(self, player_seed=None, noise=None, temperature=None, dropout_rate=None, use_beam=None, + **other_kwargs): + """ Selects between the default value provided at initialization and the potential override in kwargs """ + # Selecting temperature + if temperature is None: + for prob, temp in self._schedule: + if random.random() <= prob: + temperature = temp + break + else: + temperature = 0. + + # Starting with player.kwargs, then overriding fields + kwargs = self.kwargs + if player_seed is not None: + kwargs['player_seed'] = player_seed + if noise is not None: + kwargs['noise'] = noise + kwargs['temperature'] = temperature + if dropout_rate is not None: + kwargs['dropout_rate'] = dropout_rate + + # Setting use_beam + if use_beam is not None: + kwargs['use_beam'] = use_beam + elif self._use_beam is not None: + kwargs['use_beam'] = self._use_beam + + # Merging with other kwargs and returning + return merge_dicts(kwargs, other_kwargs) diff --git a/diplomacy_research/players/player.py b/diplomacy_research/players/player.py new file mode 100644 index 0000000..ab29ff4 --- /dev/null +++ b/diplomacy_research/players/player.py @@ -0,0 +1,361 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Player + - Contains the abstract class representing a player +""" +from abc import abstractmethod, ABCMeta +import logging +from tornado import gen +from diplomacy import Game +from diplomacy_research.models.state_space import extract_state_proto, extract_phase_history_proto, \ + extract_possible_orders_proto, get_orderable_locs_for_powers +from diplomacy_research.utils.model import strip_keys +from diplomacy_research.utils.openings import get_standard_openings + +# Constants +LOGGER = logging.getLogger(__name__) + +class Player(metaclass=ABCMeta): + """ Abstract Player Class """ + + def __init__(self, name=None): + """ Constructor """ + self._player_seed = 0 + self._noise = 0. + self._temperature = 0. + self._dropout_rate = 0. + self.name = name or self.__class__.__name__ + + # ---------- Properties ------------- + @property + @abstractmethod + def is_trainable(self): + """ Returns a boolean that indicates if the player wants to be trained or not """ + raise NotImplementedError() + + @property + def player_seed(self): + """ Getter - player_seed """ + return self._player_seed + + @player_seed.setter + def player_seed(self, value): + """ Setter - player_seed """ + self._player_seed = int(value) + + @property + def noise(self): + """ Getter - noise """ + return self._noise + + @property + def temperature(self): + """ Getter - temperature """ + return self._temperature + + @property + def dropout_rate(self): + """ Getter - dropout_rate """ + return self._dropout_rate + + @property + def kwargs(self): + """ Getter - kwargs""" + return {'player_seed': self.player_seed, + 'noise': self.noise, + 'temperature': self.temperature, + 'dropout_rate': self.dropout_rate} + + # ---------- Methods ------------- + @gen.coroutine + def get_orders(self, game, power_names, *, retry_on_failure=True, **kwargs): + """ Gets the orders the power(s) should play. + :param game: The game object + :param power_names: A list of power names we are playing, or alternatively a single power name. + :param retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - with_draw: If set, also returns whether to accept a draw or not + :return: One of the following: + 1) If power_name is a string and with_draw == False (or is not set): + - A list of orders the power should play + 2) If power_name is a list and with_draw == False (or is not set): + - A list of list, which contains orders for each power + 3) If power_name is a string and with_draw == True: + - A tuple of 1) the list of orders for the power, 2) a boolean to accept a draw or not + 4) If power_name is a list and with_draw == True: + - A list of tuples, each tuple having the list of orders and the draw boolean + :type game: diplomacy.Game + """ + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + + # Determining if we have a single or multiple powers + if not isinstance(power_names, list): + is_single_power = True + power_names = [power_names] + else: + is_single_power = False + + # Getting orders (and optional draw) + orders_with_maybe_draw = yield [self.get_orders_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + retry_on_failure=retry_on_failure, + **kwargs) for power_name in power_names] + + # Returning a single instance, or a list + orders_with_maybe_draw = orders_with_maybe_draw[0] if is_single_power else orders_with_maybe_draw + return orders_with_maybe_draw + + @gen.coroutine + def get_orders_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): + """ Gets the orders the power should play + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - with_draw: If set, also returns if we should accept a draw or not. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: If with_draw is not set or is False: + - the list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + If with_draw is set, a tuple consisting of + 1) the list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) a boolean that indicates if we should accept a draw or not + """ + with_draw = kwargs.get('with_draw', False) + orders, policy_details = yield self.get_orders_details_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **strip_keys(kwargs, ['with_state_value'])) + + # Returning orders, or orders and draw_action + if not with_draw: + return orders + return orders, policy_details['draw_action'] + + @gen.coroutine + def get_policy_details(self, game, power_names, *, retry_on_failure=True, **kwargs): + """ Gets the details of the current policy + :param game: The game object + :param power_names: A list of power names we are playing, or alternatively a single power name. + :param retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + :return: 1) If power_names is a string, the policy details + ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 2) If power_names is a list, a list of policy details, one for each power. + :type game: diplomacy.Game + """ + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + + # Determining if we have a single or multiple powers + if not isinstance(power_names, list): + is_single_power = True + power_names = [power_names] + else: + is_single_power = False + + # Getting policy details + policy_details = yield [self.get_policy_details_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + retry_on_failure=retry_on_failure, + **kwargs) + for power_name in power_names] + policy_details = policy_details[0] if is_single_power else policy_details + return policy_details + + @gen.coroutine + def get_policy_details_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Gets the details of the current policy + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + """ + _, policy_details = yield self.get_orders_details_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + **strip_keys(kwargs, ['with_state_value'])) + return policy_details + + @abstractmethod + @gen.coroutine + def get_orders_details_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Gets the orders (and the corresponding policy details) for the locs the power should play. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - with_state_value: Boolean that indicates to also query the value function. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: If with_state_value=False (default), a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + If with_state_value=True, a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + raise NotImplementedError() + + @gen.coroutine + def get_state_value(self, game, power_names, *, retry_on_failure=True, **kwargs): + """ Calculates the player's value of the state of the game for the given power(s) + :param game: A game object + :param power_names: A list of power names for which we want the value, or alternatively a single power name. + :param retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + :return: 1) If power_names is a string, a single float representing the value of the state for the power + 2) If power_names is a list, a list of floats representing the value for each power. + :type game: diplomacy.Game + """ + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_order_proto = extract_possible_orders_proto(game) + + # Determining if we have a single or multiple powers + if not isinstance(power_names, list): + is_single_power = True + power_names = [power_names] + else: + is_single_power = False + + # Getting state value + state_value = yield [self.get_state_value_with_proto(state_proto, + power_name, + phase_history_proto, + possible_order_proto, + retry_on_failure=retry_on_failure, + **kwargs) + for power_name in power_names] + state_value = state_value[0] if is_single_power else state_value + return state_value + + @abstractmethod + @gen.coroutine + def get_state_value_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, + **kwargs): + """ Calculates the player's value of the state of the game for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: A float representing the value of the state of the game to the specified power + """ + raise NotImplementedError() + + @gen.coroutine + def get_opening_orders(self): + """ Returns a dictionary of power_name: [orders] for each power + The orders represent the opening orders that would have been submitted by the player + """ + game = Game() + state_proto = extract_state_proto(game) + phase_history_proto = extract_phase_history_proto(game) + possible_orders_proto = extract_possible_orders_proto(game) + + # Retrieving all orders + # Not using kwargs - Using default player_seed, noise, temperature, and dropout_rate. + power_orders = yield [self.get_orders_with_proto(state_proto, + power_name, + phase_history_proto, + possible_orders_proto, + retry_on_failure=False) for power_name in game.powers] + return {power_name: orders for power_name, orders in zip(game.powers.keys(), power_orders)} + + @gen.coroutine + def check_openings(self): + """ Validates the opening move of a player against the database of standard openings """ + nb_pass, nb_total = 0, 0 + opening_orders = yield self.get_opening_orders() + + # Validating against database + for power_name in opening_orders: + standard_openings = get_standard_openings(power_name) + normalized_orders = sorted([order for order in opening_orders[power_name] if len(order.split()) >= 2], + key=lambda order_string: order_string.split()[1]) + + # Displaying status + if normalized_orders in standard_openings: + LOGGER.info('%s - OK', power_name) + nb_pass += 1 + else: + LOGGER.info('%s - FAIL -- %s', power_name, normalized_orders) + nb_total += 1 + + # Displaying total success + LOGGER.info('Summary: %d / %d powers submitted orders in the database.', nb_pass, nb_total) + + @staticmethod + def get_nb_centers(state_proto, power_name): + """ Calculates the number of supply centers a power has + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power for which we want the value of the state + :return: A integer representing the number of supply centers the power controls + """ + return len(state_proto.centers[power_name].value) + + @staticmethod + def get_orderable_locations(state_proto, power_name): + """ Calculates the list of locations where unit can receive orders + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power for which we want orderable locations + :return: A list of locations where units can receive orders + """ + _, orderable_locs = get_orderable_locs_for_powers(state_proto, [power_name]) + return orderable_locs[power_name] diff --git a/diplomacy_research/players/random_player.py b/diplomacy_research/players/random_player.py new file mode 100644 index 0000000..83a651d --- /dev/null +++ b/diplomacy_research/players/random_player.py @@ -0,0 +1,173 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Random Player + - Contains a class representing a player that chooses to move randomly +""" +from collections import OrderedDict +import logging +from numpy.random import choice +from tornado import gen +from diplomacy_research.models.state_space import get_order_frequency +from diplomacy_research.players.player import Player + +# Constants +LOGGER = logging.getLogger(__name__) + +class RandomPlayer(Player): + """ Random Player Class """ + + def __init__(self, weighting_func=None, name=None): + """ Constructor + :param weighting_func: Optional. Weighting function (takes phase and order) to use custom weights. + :param name: Optional. The name of this player. + """ + if weighting_func: + name = name or '%s/%s' % (self.__class__.__name__, weighting_func.__name__) + Player.__init__(self, name) + self.weighting_func = weighting_func + + @property + def is_trainable(self): + """ Returns a boolean that indicates if the player wants to be trained or not """ + return False + + @gen.coroutine + def get_orders_details_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Gets the orders (and the corresponding policy details) for the locs the power should play. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - with_state_value: Boolean that indicates to also query the value function. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: If with_state_value=False (default), a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + If with_state_value=True, a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + orderable_locs = self.get_orderable_locations(state_proto, power_name) + + # Calculating the weights of each possible orders of each orderable locations + # possible_orders_probs = {loc: list of probs} + orders_probs_by_loc = self._get_possible_orders_probs(orderable_locs, + state_proto, + possible_orders_proto, + weighting_func=self.weighting_func) + + # Randomly selecting an order at each location according to their weights + orders = [] + for loc in orderable_locs: + orders += [choice(possible_orders_proto[loc].value, p=orders_probs_by_loc[loc])] + + # Returning orders + if kwargs.get('with_state_value', False): + return orders, None, self.get_nb_centers(state_proto, power_name) + return orders, None + + @gen.coroutine + def get_state_value_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, + **kwargs): + """ Calculates the player's value of the state of the game for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: A float representing the value of the state of the game to the specified power + """ + # pylint: disable=unused-argument + LOGGER.warning('There are no models available to query state value. Returning the number of centers.') + return self.get_nb_centers(state_proto, power_name) + + @staticmethod + def _get_possible_orders_probs(orderable_locs, state_proto, possible_orders_proto, weighting_func=None): + """ Calculates the probability of each possible order for each orderable location + :param orderable_locs: The list of orderable locations for power. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param weighting_func: Optional. Weighting function (takes phase and order) to use custom weights. + :return: A dictionary containing locs as key and a list of probs as value + """ + # Getting possible orders for each location + phase_type = state_proto.name[-1] + + # Calculating weights + orders_probs_by_loc = OrderedDict() + for loc in orderable_locs: + loc_possible_orders = possible_orders_proto[loc].value + if loc_possible_orders: + nb_orders = len(loc_possible_orders) + + # Non-Uniform Weight + if weighting_func: + order_probs = [weighting_func(phase_type, order) for order in loc_possible_orders] + order_probs = [prob / sum(order_probs) for prob in order_probs] + # Uniform Weight + else: + order_probs = [1. / nb_orders] * nb_orders + + orders_probs_by_loc[loc] = order_probs + + # Returning + return orders_probs_by_loc + +# =-=-=-=-=--=-=-=-=-=--=-=-=-=-=--=-=-=-=-=--=-=-=-=-=--=-=-=-=-=-- +# Weighting functions + +def weight_by_order_type(phase_type, order): + """ Calculate the new weight for the order using the perc of orders with this order type for the given phase + as calculated in the dataset. (e.g. 20% of orders in a movement phase are H) + :param phase_type: The current phase type ('M', 'R', 'A') + :param order: The order to evaluate + :return: The new weight for the order + """ + # Average of 10,000 games + # M --- ['C: 1.535%', '-: 49.738%', 'D: 0.0%', 'R: 0.0%', 'B: 0.0%', 'H: 19.798%', 'S: 28.929%'] + # R --- ['C: 0.0%', '-: 0.0%', 'D: 2.428%', 'R: 3.213%', 'B: 0.0%', 'H: 94.36%', 'S: 0.0%'] + # A --- ['C: 0.0%', '-: 0.0%', 'D: 3.798%', 'R: 0.0%', 'B: 11.252%', 'H: 84.95%', 'S: 0.0%'] + probs = { + 'M': {'H': 0.19798, '-': 0.49738, 'S': 0.28929, 'C': 0.01535, 'R': 0.00000, 'B': 0.00000, 'D': 0.00000}, + 'R': {'H': 0.94360, '-': 0.00000, 'S': 0.00000, 'C': 0.00000, 'R': 0.03213, 'B': 0.00000, 'D': 0.02427}, + 'A': {'H': 0.84950, '-': 0.00000, 'S': 0.00000, 'C': 0.00000, 'R': 0.00000, 'B': 0.11252, 'D': 0.03798} + } + parts = order.split() + if len(parts) < 3: + return 0.00001 + order_type = parts[2] + if phase_type in probs and order_type in probs[phase_type]: + return probs[phase_type][order_type] + return 0.00001 + +def weight_by_order_freq(phase_type, order): + """ Calculate the new weight for the order using the number of times the order has been seen in the dataset. + :param phase_type: The current phase type ('M', 'R', 'A') + :param order: The order to evaluate + :return: The new weight for the order + """ + del phase_type # Unused argument + return get_order_frequency(order, no_press_only=True) + 1 diff --git a/diplomacy_research/players/rule_based_player.py b/diplomacy_research/players/rule_based_player.py new file mode 100644 index 0000000..67d8586 --- /dev/null +++ b/diplomacy_research/players/rule_based_player.py @@ -0,0 +1,101 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Rule-Based Player + - Contains a class representing a player that follows a specific ruleset to choose its moves +""" +from concurrent.futures import ThreadPoolExecutor +import logging +import os +from tornado import gen, concurrent +from diplomacy_research.players.player import Player + +# Constants +LOGGER = logging.getLogger(__name__) + +class RuleBasedPlayer(Player): + """ Rule-Based Player Class """ + + def __init__(self, ruleset, name=None): + """ Constructor + :param ruleset: The ruleset to use to compute the next moves + :param name: Optional. The name of this player. + """ + name = name or '%s/%s' % (self.__class__.__name__, ruleset.__module__.split('.')[-1]) + Player.__init__(self, name) + max_workers = (os.cpu_count() or 1) * 5 + self.ruleset = ruleset + self.executor = ThreadPoolExecutor(max_workers=max_workers) + + @property + def is_trainable(self): + """ Returns a boolean that indicates if the player wants to be trained or not """ + return False + + @gen.coroutine + def get_orders_details_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Gets the orders (and the corresponding policy details) for the locs the power should play. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - with_state_value: Boolean that indicates to also query the value function. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: If with_state_value=False (default), a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + If with_state_value=True, a tuple consisting of: + 1) The list of orders the power should play (e.g. ['A PAR H', 'A MAR - BUR', ...]) + 2) The policy details ==> {'locs', 'tokens', 'log_probs', 'draw_action', 'draw_prob'} + 3) The state value for the given state + """ + orders = yield self._run_ruleset(state_proto, power_name) + + if kwargs.get('with_state_value', False): + return orders, None, self.get_nb_centers(state_proto, power_name) + return orders, None + + @gen.coroutine + def get_state_value_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, + **kwargs): + """ Calculates the player's value of the state of the game for a given power + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The power name for which we want to retrieve the value + :param phase_history_proto: A list of `.proto.game.PhaseHistory`. This represents prev phases. + :param possible_orders_proto: A `proto.game.PossibleOrders` object representing possible order for each loc. + :param kwargs: Additional optional kwargs: + - player_seed: If set. Override the player_seed to use for the model based player. + - noise: If set. Override the noise to use for the model based player. + - temperature: If set. Override the temperature to use for the model based player. + - dropout_rate: If set. Override the dropout_rate to use for the model based player. + - retry_on_failure: Boolean that indicates to retry querying from the model if an error is encountered. + :return: A float representing the value of the state of the game to the specified power + """ + # pylint: disable=unused-argument + LOGGER.warning('There are no models available to query state value. Returning the number of centers.') + return self.get_nb_centers(state_proto, power_name) + + @concurrent.run_on_executor + def _run_ruleset(self, state_proto, power_name): + """ Gets the move for the given power according to the ruleset. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :return: A list of orders for that power. + """ + return self.ruleset(state_proto, power_name) diff --git a/diplomacy_research/players/rulesets/__init__.py b/diplomacy_research/players/rulesets/__init__.py new file mode 100644 index 0000000..c813fa6 --- /dev/null +++ b/diplomacy_research/players/rulesets/__init__.py @@ -0,0 +1,16 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Rulesets """ +from .dumbbot_ruleset import run_ruleset as dumbbot_ruleset +from .easy_ruleset import run_ruleset as easy_ruleset diff --git a/diplomacy_research/players/rulesets/dumbbot_ruleset.py b/diplomacy_research/players/rulesets/dumbbot_ruleset.py new file mode 100644 index 0000000..91ca6e5 --- /dev/null +++ b/diplomacy_research/players/rulesets/dumbbot_ruleset.py @@ -0,0 +1,757 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" A Python version of David Norman's DumbBot. """ +import collections +import logging +import random +from diplomacy_research.models.state_space import build_game_from_state_proto + +# --- Constants --- +LOGGER = logging.getLogger(__name__) + +# Nb of proximity maps +PROXIMITY_DEPTHS = 10 + +# Shape the power size by ax^2 + bx + c +SIZE_SQUARE_COEFFICIENT = 1. +SIZE_COEFFICIENT = 4. +SIZE_CONSTANT = 16 + +# Importance of attack SC we don't own in spring/fall +SPRING_PROXIMITY_ATTACK_WEIGHT = 700 +FALL_PROXIMITY_ATTACK_WEIGHT = 600 + +# Importance of defending our own center in spring/fall +SPRING_PROXIMITY_DEFENSE_WEIGHT = 300 +FALL_PROXIMITY_DEFENSE_WEIGHT = 400 + +# Importance of proximity_map[n] in Spring/Fall/Building/Disbanding +SPRING_PROXIMITY_WEIGHTS = [100, 1000, 30, 10, 6, 5, 4, 3, 2, 1] +FALL_PROXIMITY_WEIGHTS = [1000, 100, 30, 10, 6, 5, 4, 3, 2, 1] +BUILD_PROXIMITY_WEIGHTS = [1000, 100, 30, 10, 6, 5, 4, 3, 2, 1] +REMOVE_PROXIMITY_WEIGHTS = [1000, 100, 30, 10, 6, 5, 4, 3, 2, 1] + +# Importance of attack strength in Spring/Fall +SPRING_STRENGTH_WEIGHT = 1000 +FALL_STRENGTH_WEIGHT = 1000 + +# Importance of lack of competition in Spring/Fall +SPRING_COMPETITION_WEIGHT = 1000 +FALL_COMPETITION_WEIGHT = 1000 + +# Importance of building in province we need to defend +BUILD_DEFENSE_WEIGHT = 1000 + +# Importance of removing unit we don't need to defend +REMOVE_DEFENSE_WEIGHT = 1000 + +# If not automatic, chance of playing best move if inferior move is nearly as good +ALTERNATIVE_DIFF_MODIFIER = 5 + +# percentage chance of automatically playing the next move +PLAY_ALTERNATIVE = 0.5 + +# --- Named tuples --- +class Factors( + collections.namedtuple('Factors', ('proximity_maps', # A list of maps, with unit as key + 'competition_map', # A dict with province as key + 'strength_map', # A dict with province as key + 'defense_map'))): # A dict with province as key + """ A class to hold all factors computed for the encoding """ + +class FactorWeights( + collections.namedtuple('FactorWeights', ('proximity_weights', + 'competition_weight', + 'strength_weight', + 'defense_weight'))): + """ A class to hold all factor weights used for the encoding """ + + +# --------------------------------- +# MAIN FUNCTION +# --------------------------------- +def run_ruleset(state_proto, power_name): + """ Gets the move for the given power according to the ruleset. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :return: A list of orders for that power. + """ + # Power has been eliminated + if not state_proto.units[power_name].value and not state_proto.centers[power_name].value: + return [] + + # Building the game object + game = build_game_from_state_proto(state_proto) + + # Game is forming / completed + if game.get_current_phase()[0] not in 'SFW': + return [] + + # Encoding the board to factors + dest_unit_value, factors = get_board_factors(game, power_name) + + # Decode orders + return decode_orders(game, power_name, dest_unit_value, factors) + + +# --------------------------------- +# ENCODING +# --------------------------------- +def get_board_factors(game, power_name): + """ Compute destination value by computing various factors + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :return: A tuple consisting of + 1) the dest_unit_value, + 2) the factors + :type game: diplomacy.Game + """ + season = game.get_current_phase()[0] + power = game.get_power(power_name) + + # Compute factors + if season in 'SW': + factors = calculate_factors(game=game, + power_name=power_name, + proximity_attack_weight=SPRING_PROXIMITY_ATTACK_WEIGHT, + proximity_defense_weight=SPRING_PROXIMITY_DEFENSE_WEIGHT) + else: + factors = calculate_factors(game=game, + power_name=power_name, + proximity_attack_weight=FALL_PROXIMITY_ATTACK_WEIGHT, + proximity_defense_weight=FALL_PROXIMITY_DEFENSE_WEIGHT) + + # Computing factor weights + if season == 'S': + factor_weights = FactorWeights(proximity_weights=SPRING_PROXIMITY_WEIGHTS, + competition_weight=SPRING_COMPETITION_WEIGHT, + strength_weight=SPRING_STRENGTH_WEIGHT, + defense_weight=0) + elif season == 'F': + factor_weights = FactorWeights(proximity_weights=FALL_PROXIMITY_WEIGHTS, + competition_weight=FALL_COMPETITION_WEIGHT, + strength_weight=FALL_STRENGTH_WEIGHT, + defense_weight=0) + else: + nb_builds = len(power.centers) - len(power.units) + + # Build + if nb_builds >= 0: + factor_weights = FactorWeights(proximity_weights=BUILD_PROXIMITY_WEIGHTS, + competition_weight=0, + strength_weight=0, + defense_weight=BUILD_DEFENSE_WEIGHT) + # Disband + else: + factor_weights = FactorWeights(proximity_weights=REMOVE_PROXIMITY_WEIGHTS, + competition_weight=0, + strength_weight=0, + defense_weight=REMOVE_DEFENSE_WEIGHT) + + # Computing destination value + dest_unit_value = calculate_dest_unit_value(factors=factors, + factor_weights=factor_weights, + is_winter=(season == 'W')) + + # Returning board factors + return dest_unit_value, factors + +def calculate_factors(game, power_name, proximity_attack_weight, proximity_defense_weight): + """ Compute the proximity_maps, competition_map, and strength_map, as defined in the original C++ code. + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :param proximity_attack_weight: The weight used to compute the importance of attacking. + :param proximity_defense_weight: The weight used to compute the importance of defending. + :return: The factors (proximity_maps, competition_map, strength_map, defense_map) + :type game: diplomacy.Game + :rtype: Factors + """ + # Get attack, defense values + attack_map, defense_map = calculate_attack_defense(game, power_name) + + # List of all possible units + all_units = ['{} {}'.format(unit_type, loc.upper()) + for unit_type in 'AF' + for loc in game.map.locs + if game.map.is_valid_unit('{} {}'.format(unit_type, loc.upper()))] + + # Compute initial proximity value, for all non-dislodged units on the board + init_proximity_map = {} + for unit in all_units: + init_proximity_map[unit] = (attack_map[unit[2:5]] * proximity_attack_weight + + defense_map[unit[2:5]] * proximity_defense_weight) + proximity_maps = [init_proximity_map] + + # Building deeper proximity maps + # For deeper maps, the value of a location is equal to the (sum of adjacent units + self) / 5 + for proximity_depth in range(1, PROXIMITY_DEPTHS): + prev_proximity_map = proximity_maps[proximity_depth - 1] + curr_proximity_map = {unit: 0 for unit in all_units} + + # Updating all units + for unit in all_units: + + # Finding adjacent locations + adj_locs = set() + for dest_coast in game.map.find_coasts(unit[2:5]): + adj_locs |= {loc.upper()[:3] for loc in game.map.abut_list(dest_coast, incl_no_coast=True)} + + # Finding potentially adjacent units + adj_units = [adj_unit for adj_unit in all_units if adj_unit[2:5] in adj_locs] + + # Finding units that could in the current provice + self_units = [self_unit for self_unit in all_units if self_unit[2:5] == unit[2:5]] + + # Computing self contributions + self_contrib = 0 + for self_unit in self_units: + self_contrib = max(self_contrib, prev_proximity_map[self_unit]) + + # Computing other contributions + other_contrib = 0. + for adj_unit in adj_units: + if game.map.abuts(adj_unit[0], adj_unit[2:], '-', unit[2:]) \ + or game.map.abuts(adj_unit[0], adj_unit[2:], '-', unit[2:5]): + other_contrib += prev_proximity_map[adj_unit] + + # Update score + # Dividing by 5, since each location has on average 4 locations (+ itself) + curr_proximity_map[unit] = (self_contrib + other_contrib) / 5. + + # Append proximity map to list + proximity_maps += [curr_proximity_map] + + # Compute adjacent unit counts + adjacent_unit_counts = calculate_adjacent_unit_counts(game) + + # Compute strength and competition map + # Strength map: Number of adjacent units from same power + # Competition map: Largest number of enemy adjacent units + provinces = [loc.upper() for loc in game.map.locs if '/' not in loc] + strength_map = {loc: 0 for loc in provinces} + competition_map = {loc: 0 for loc in provinces} + + for loc in provinces: + for adjacent_power, nb_adjacent_units in adjacent_unit_counts[loc].items(): + if adjacent_power == power_name: + strength_map[loc] = nb_adjacent_units + else: + competition_map[loc] = max(competition_map[loc], nb_adjacent_units) + + # Returning factors + return Factors(proximity_maps=proximity_maps, + competition_map=competition_map, + strength_map=strength_map, + defense_map=defense_map) + +def calculate_attack_defense(game, power_name): + """ Compute the attack and defense maps for the current power. + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :return: A tuple consisting of: + 1) attack_map: Dictionary with province as key and attack weight as value + 2) defense_map: Dictionary with province as key and defense weight as value + :type game: diplomacy.Game + """ + # compute power size + power_sizes = get_power_sizes(game) + + # Compute attack and defense value for each province + provinces = [loc.upper() for loc in game.map.locs if '/' not in loc] + attack_map = {loc: 0 for loc in provinces} + defense_map = {loc: 0 for loc in provinces} + + for power in game.powers.values(): + for loc in power.centers: + + # Not ours, updating attack value by the size of the owning power + if power.name != power_name: + attack_map[loc] = power_sizes[power.name] + + # It's ours, update defense value by the size of the largest enemy which has a unit that can move in + else: + defense_map[loc] = get_defense_value(game=game, + power_name=power_name, + loc=loc, + power_sizes=power_sizes) + + # Returning the attack, defense map + return attack_map, defense_map + +def get_power_sizes(game): + """ Return a dict that with power_name as key and value of its supply center as value. + :param game: An instance of `diplomacy.Game` + :return: A dict for power name as key and A * (nb_sc) ^2 + B * nb_sc + C as value + :type game: diplomacy.Game + """ + A, B, C = SIZE_SQUARE_COEFFICIENT, SIZE_COEFFICIENT, SIZE_CONSTANT # pylint: disable=invalid-name + return {power.name: A * len(power.centers) ** 2 + B * len(power.centers) + C + for power in game.powers.values()} + +def get_defense_value(game, power_name, loc, power_sizes): + """ Compute the defense value of a location (i.e. the power size of the largest power of an adjacent unit) + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :param loc: The location for which we want to compute the defense value. + :param power_sizes: Dictionary with the name of a power as key and (A*nb_sc^2 + B*nb_sc + C) as value + :return: The location defense value. + i.e. the power_size of the largest power with a unit that can move in. + :type game: diplomacy.Game + """ + largest_power_size = 0 + loc_with_coasts = game.map.find_coasts(loc) + + # Finding the largest enemy unit that can move to loc + for power in game.powers.values(): + if power.name == power_name: + continue + for unit in power.units: + for dest in loc_with_coasts: + if game.map.abuts(unit[0], unit[2:], '-', dest): + largest_power_size = max(power_sizes[power.name], largest_power_size) + break + return largest_power_size + +def calculate_adjacent_unit_counts(game): + """ Compute the number of units from a power that are adjacent to each location + :param game: An instance of `diplomacy.Game` + :param units_on_board: A set containing all the units on the board {'A PAR', 'F BRE', ...} + :return: A dict with + - loc as key and a dictionary of power_name as key and nb adj units from power as value + e.g. {'PAR': {'FRANCE': 2, 'ENGLAND': 0, ...}} + if 2 units for FRANCE can move in Paris, but none from England + :type game: diplomacy.Game + """ + provinces = [loc.upper() for loc in game.map.locs if '/' not in loc] + adjacent_unit_counts = {loc: {power_name: set() for power_name in game.powers} for loc in provinces} + + for dest in provinces: + + # Building a list of src locs that could move to dest + src_locs = set() + for dest_coast in game.map.find_coasts(dest): + src_locs |= {loc.upper() for loc in game.map.abut_list(dest_coast, incl_no_coast=True)} + + for src in src_locs: + + # Trying to check if we have an occupant + occupant = game._occupant(src) # STP -> A STP - pylint: disable=protected-access + if occupant is None: + continue + + # Finding if the occupant can move + for dest_coast in game.map.find_coasts(dest): + if game.map.abuts(occupant[0], occupant[2:], '-', dest_coast): + break + else: + continue + + # Increasing the count of the owner + occupant_owner = game._unit_owner(occupant) # pylint: disable=protected-access + adjacent_unit_counts[dest][occupant_owner.name].add(occupant) + + # Returning the adjacent_unit_counts + return {loc: {power_name: len(adjacent_unit_counts[loc][power_name]) for power_name in adjacent_unit_counts[loc]} + for loc in adjacent_unit_counts} + +def calculate_dest_unit_value(factors, factor_weights, is_winter=False): + """ Compute the destination value for each loc + :param factors: An instance of `Factors` + :param factor_weights: An instance of `FactorWeights` + :param is_winter: Whether or not it's in adjustment phase + :return: dest_unit_value. A dict with unit as key, and the unit value as value + :type factors: Factors + :type factor_weights: FactorWeights + """ + assert len(factors.proximity_maps) == len(factor_weights.proximity_weights), 'Different proximity lengths.' + assert len(factors.proximity_maps) == PROXIMITY_DEPTHS, 'Expected %d proximity maps.' % PROXIMITY_DEPTHS + + # Destination value is computed by two parts: + # 1. weighted sum of proximity values + # 2. balance between competition and strength if not winter + # 3. add defense value if winter. + dest_unit_value = {loc: 0 for loc in factors.proximity_maps[0]} + for unit in dest_unit_value: + for prox_ix in range(PROXIMITY_DEPTHS): + dest_unit_value[unit] += factor_weights.proximity_weights[prox_ix] * factors.proximity_maps[prox_ix][unit] + if is_winter: + dest_unit_value[unit] += factor_weights.defense_weight * factors.defense_map[unit[2:5]] + else: + dest_unit_value[unit] += factor_weights.strength_weight * factors.strength_map[unit[2:5]] + dest_unit_value[unit] -= factor_weights.competition_weight * factors.competition_map[unit[2:5]] + return dest_unit_value + + +# --------------------------------- +# DECODING +# --------------------------------- +def decode_orders(game, power_name, dest_unit_value, factors): + """ Decode orders from computed factors + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :param dest_unit_value: A dict with unit as key, and unit value as value + :param factors: An instance of `Factors` + :return: A list of orders + :type factors: Factors + :type game: diplomacy.Game + """ + phase_type = game.get_current_phase()[-1] + + # Movement phase + if phase_type == 'M': + return generate_movement_orders(game, power_name, dest_unit_value, factors) + + # Retreat Phaes + if phase_type == 'R': + return generate_retreat_orders(game, power_name, dest_unit_value) + + # Adjustment + if phase_type == 'A': + power = game.get_power(power_name) + nb_builds = len(power.centers) - len(power.units) + + # Building + if nb_builds >= 0: + return generate_build_orders(game, power_name, dest_unit_value) + + # Disbanding + return generate_disband_orders(game, power_name, dest_unit_value) + + # Otherwise, invalid phase_type + LOGGER.error('Invalid phase type. Got %s. Expected M, R, A', phase_type) + return [] + +def generate_movement_orders(game, power_name, dest_unit_value, factors): + """ Generate movement orders + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :param dest_unit_value: A dict with unit as key, and unit value as value + :param factors: An instance of `Factors` + :return: A list of orders + :type factors: Factors + :type game: diplomacy.Game + """ + # Shuffling units + power = game.get_power(power_name) + unordered_units = power.units[:] + units = power.units[:] + all_units = [unit for unit in dest_unit_value] + random.shuffle(unordered_units) + + # Moving units: {unit: dest} e.g. 'F STP/NC -> BAR' would have {'F STP/NC': 'BAR'} + moving_units = {} + + # Dependencies: List of locations that depend of the key + # e.g. {'PAR': ['MAR', 'BRE']} indicates that MAR and BRE are waiting for (depends on) the PAR order + dependencies = {unit[2:5]: [] for unit in units} + + # List of final orders - {province: order} + orders = {} + + # Generating orders + while unordered_units: + curr_unit = unordered_units.pop(0) + + # Finding adjacent locs + adj_locs = set() + for coast in game.map.find_coasts(curr_unit[2:5]): + adj_locs |= {loc.upper() for loc in game.map.abut_list(coast, incl_no_coast=True)} + + # Building a list of destinations in reverse order (i.e. destination with highest value first) + # Including itself, but excluding dependencies + dest_units = sorted([unit for unit in all_units if unit[2:] in adj_locs + and game.map.abuts(curr_unit[0], curr_unit[2:], '-', unit[2:]) # Valid dest only + and unit[2:5] not in dependencies[curr_unit[2:5]]] # except if waiting + + [curr_unit], # including itself + key=lambda unit: dest_unit_value[unit], + reverse=True) + + # Picking destination + selection_is_okay = False + unit_ordered_to_move = True + while not selection_is_okay: + + # Getting next destination + selected_dest_unit = get_next_item(dest_units, dest_unit_value) + selection_is_okay = True + + # Case 0 - Unit is holding (moving to same location) + if selected_dest_unit[2:5] == curr_unit[2:5]: + orders[curr_unit[2:5]] = '{} H'.format(curr_unit) + break + + # Case 1 - Deal with occupying situation + unit_occupying = [unit for unit in units if unit[2:5] == selected_dest_unit[2:5]] + unit_occupying = None if not unit_occupying else unit_occupying[0] + + # If occupying unit is not ordered, insert current unit back after occupying unit + # since we can't decide yet. + if unit_occupying and unit_occupying[2:5] not in orders: + unordered_units.insert(unordered_units.index(unit_occupying) + 1, curr_unit) + unit_ordered_to_move = False + dependencies[unit_occupying[2:5]] += [curr_unit[2:5]] + + # If occupying unit is not moving + # Check if it needs support, otherwise the destination is not acceptable. + elif unit_occupying and unit_occupying not in moving_units: + if factors.competition_map[unit_occupying[2:5]] > 1: + orders[curr_unit[2:5]] = '{} S {}'.format(curr_unit, unit_occupying) + unit_ordered_to_move = False + else: + selection_is_okay = False + dest_units.remove(selected_dest_unit) + + # Case 2 - Deal with units moving to the same location + if selection_is_okay: + unit_moving = [unit for unit, dest in moving_units.items() if dest[:3] == selected_dest_unit[2:5]] + unit_moving = None if not unit_moving else unit_moving[0] + + # Support is someone already move in and there is competition on that location + # Otherwise, the destination is not acceptable + if unit_moving: + if factors.competition_map[selected_dest_unit[2:5]] > 0: + orders[curr_unit[2:5]] = '{} S {} - {}'.format(curr_unit, + unit_moving, + moving_units[unit_moving][:3]) + unit_ordered_to_move = False + else: + selection_is_okay = False + dest_units.remove(selected_dest_unit) + + # Ready to issue move order + if selection_is_okay and unit_ordered_to_move: + orders[curr_unit[2:5]] = '{} - {}'.format(curr_unit, selected_dest_unit[2:]) + moving_units[curr_unit] = selected_dest_unit[2:] + + # Check for wasted holds + orders = check_wasted_holds(game, orders, moving_units, dest_unit_value, factors) + + # Extract orders from order details + return list(orders.values()) + +def generate_retreat_orders(game, power_name, dest_unit_value): + """ Generate retreat orders + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :param dest_unit_value: A dict with unit as key, and unit value as value + :param factors: An instance of `Factors` + :return: A list of orders + :type factors: Factors + :type game: diplomacy.Game + """ + # Shuffling units + power = game.get_power(power_name) + unordered_units = [unit for unit in power.retreats] + all_units = [unit for unit in dest_unit_value] + random.shuffle(unordered_units) + + # Moving units: {unit: dest} e.g. 'F STP/NC -> BAR' would have {'F STP/NC': 'BAR'} + moving_units = {} + + # List of final orders - {province: order} + orders = {} + + # Generating orders + while unordered_units: + curr_unit = unordered_units.pop(0) + + # Finding adjacent locs + adj_locs = set() + for coast in game.map.find_coasts(curr_unit[2:5]): + adj_locs |= {loc.upper() for loc in game.map.abut_list(coast, incl_no_coast=True)} + + # Building a list of destinations in reverse order (i.e. destination with highest value first) + dest_units = sorted([unit for unit in all_units if unit[2:] in adj_locs + and game.map.abuts(curr_unit[0], curr_unit[2:], '-', unit[2:])], # Valid dest only + key=lambda unit: dest_unit_value[unit], + reverse=True) + + # Picking destination + selection_is_okay = False + while not selection_is_okay: + + # No destination - Disbanding + if not dest_units: + orders[curr_unit[2:5]] = '{} D'.format(curr_unit) + break + + # Getting next destination + selected_dest_unit = get_next_item(dest_units, dest_unit_value) + selection_is_okay = True + + # Selecting next destination if there is already a moving unit + unit_moving = [unit for unit, dest in moving_units.items() if dest[:3] == selected_dest_unit[2:5]] + unit_moving = None if not unit_moving else unit_moving[0] + if unit_moving: + selection_is_okay = False + dest_units.remove(selected_dest_unit) + + # Check if that destination is already occupied + occupant = game._occupant(selected_dest_unit[2:5], any_coast=1) # pylint: disable=protected-access + if occupant: + selection_is_okay = False + dest_units.remove(selected_dest_unit) + + # Otherwise, it's okay to retreat there + if selection_is_okay: + orders[curr_unit[2:5]] = '{} R {}'.format(curr_unit, selected_dest_unit[2:]) + moving_units[curr_unit] = selected_dest_unit[2:] + + # Returning orders + return list(orders.values()) + +def generate_build_orders(game, power_name, dest_unit_value): + """ Generate build orders + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :param dest_unit_value: A dict with unit as key, and unit value as value + :param factors: An instance of `Factors` + :return: A list of orders + :type factors: Factors + :type game: diplomacy.Game + """ + open_homes = game.get_orderable_locations(power_name) + power = game.get_power(power_name) + nb_builds = min(len(open_homes), len(power.centers) - len(power.units)) + + # Getting the list of possible units that can be built + # Sorted by decreasing value + sorted_units = sorted(['{} {}'.format(unit_type, coast) + for unit_type in 'AF' + for loc in open_homes + for coast in game.map.find_coasts(loc) + if game.map.is_valid_unit('{} {}'.format(unit_type, coast))], + key=lambda unit: dest_unit_value[unit], + reverse=True) + + # Generating orders + orders = {} # {province: order} + while len(orders) < nb_builds and sorted_units: + selected_unit = get_next_item(sorted_units, dest_unit_value) + orders[selected_unit[2:5]] = '{} B'.format(selected_unit) + sorted_units = [unit for unit in sorted_units if unit[2:5] != selected_unit[2:5]] + + # Returning + return list(orders.values()) + +def generate_disband_orders(game, power_name, dest_unit_value): + """ Generate disband orders + :param game: An instance of `diplomacy.Game` + :param power_name: The name of the power we are playing + :param dest_unit_value: A dict with unit as key, and unit value as value + :param factors: An instance of `Factors` + :return: A list of orders + :type factors: Factors + :type game: diplomacy.Game + """ + power = game.get_power(power_name) + nb_disbands = abs(len(power.centers) - len(power.units)) + + # Getting the list of units that can be disbanded + # Sorted by increasing value + sorted_units = sorted([unit for unit in power.units], + key=lambda unit: dest_unit_value[unit]) + + # Generating orders + orders = {} # {province: order} + for _ in range(nb_disbands): + selected_unit = get_next_item(sorted_units, dest_unit_value) + orders[selected_unit[2:5]] = '{} D'.format(selected_unit) + sorted_units = [unit for unit in sorted_units if unit != selected_unit] + + # Returning + return list(orders.values()) + +def check_wasted_holds(game, orders, moving_units, dest_unit_value, factors): + """ Replace unnecessary holds with a support if possible + :param game: An instance of `diplomacy.Game` + :param orders: A dictionary with the province as key and the order for the unit at that province as value + :param dest_unit_value: A dict with unit as key, and unit value as value + :param factors: An instance of `Factors` + :return: An updated orders dictionary + :type factors: Factors + :type game: diplomacy.Game + """ + holding_units = [' '.join(order.split()[:2]) for order in orders.values() if order.split()[-1] == 'H'] + for unit in holding_units: + + # Track the best destination we could support + max_dest_value = 0. + other_unit = None + other_unit_dest = None + + # Destinations that the unit can move to + for other_loc in [loc.upper() for loc in game.map.abut_list(unit[2:]) + if game.map.abuts(unit[0], unit[2:], '-', loc.upper())]: + + # There is a moving unit there and it needs support + # Recording unit if it has the best value + unit_moving = [unit for unit, dest in moving_units.items() if dest[:3] == other_loc[:3]] + unit_moving = None if not unit_moving else unit_moving[0] + if unit_moving and factors.competition_map[other_loc[:3]] > 0: + if dest_unit_value[unit_moving] > max_dest_value: + max_dest_value = dest_unit_value[unit_moving] + other_unit_dest = other_loc + other_unit = unit_moving + + # Checking if there is a unit occupying the location, not moving and needing support + unit_occupying = [' '.join(order.split()[:2]) for loc, order in orders.items() if loc == other_loc] + unit_occupying = None if not unit_occupying else unit_occupying[0] + if unit_occupying and unit_occupying not in moving_units and factors.competition_map[other_loc[:3]] > 1: + if dest_unit_value[unit_occupying] > max_dest_value: + max_dest_value = dest_unit_value[unit_occupying] + other_unit_dest = other_loc + other_unit = unit_occupying + + # If there is something worth supporting, changing the H to a S + if max_dest_value > 0: + if other_unit[2:5] == other_unit_dest[:3]: + orders[unit[2:5]] = '{} S {}'.format(unit, other_unit) + else: + orders[unit[2:5]] = '{} S {} - {}'.format(unit, other_unit, other_unit_dest) + + # Returning orders + return orders + +def get_next_item(sorted_units, dest_unit_value): + """ Selects the next destination + :param sorted_units: A sorted list of units (increasing or decreasing) + :param dest_unit_value: A dict with unit as key, and unit value as value + :return: The next item + """ + item_ix = 0 + while True: + + # Last item + if item_ix + 1 == len(sorted_units): + break + + # Determining whether or not to pick the item + curr_item_value = dest_unit_value[sorted_units[item_ix + 0]] + next_item_value = dest_unit_value[sorted_units[item_ix + 1]] + if curr_item_value == 0: + next_chance = 0 + else: + next_chance = abs(curr_item_value - next_item_value) * ALTERNATIVE_DIFF_MODIFIER / curr_item_value + + # Selecting next move + if PLAY_ALTERNATIVE > random.random() >= next_chance: + item_ix += 1 + continue + + # Otherwise, selecting the current move + break + + # Returning the chosen item + return sorted_units[item_ix] diff --git a/diplomacy_research/players/rulesets/easy_ruleset.py b/diplomacy_research/players/rulesets/easy_ruleset.py new file mode 100644 index 0000000..de6c905 --- /dev/null +++ b/diplomacy_research/players/rulesets/easy_ruleset.py @@ -0,0 +1,338 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Easy Ruleset + + Movement phase: + 1) - Hold if unit is on a foreign SC and SC is not captured + 2) - Attack unoccupied enemy SC + 3) - Move to unoccupied enemy territory + 4) - Attack occupied enemy SC + 5) - Attack occupied enemy unit + 6) - Move in direction of closest foreign SC + 7) - Otherwise hold + + Retreat phase: + - Move to state having most friendly surrounding units + - Disband if no retreat locations possible + + Adjustement phase: + - If build, maintain a 60% land, 40% fleet ratio, build in location closest to closest enemy SC first + - If disband, disband units that are further from enemy territory +""" +from operator import itemgetter +from diplomacy_research.models.state_space import build_game_from_state_proto +from diplomacy_research.players.rulesets.utils import get_distance + +def run_ruleset(state_proto, power_name): + """ Gets the move for the given power according to the ruleset. + :param state_proto: A `.proto.game.State` representation of the state of the game. + :param power_name: The name of the power we are playing + :return: A list of orders for that power. + """ + # Power has been eliminated + if not state_proto.units[power_name].value and not state_proto.centers[power_name].value: + return [] + + # Building the game object + game = build_game_from_state_proto(state_proto) + + # Finding orderable locs + orderable_locations = game.get_orderable_locations(power_name) + current_phase_type = state_proto.name[-1] + + # No orders to submit + if not orderable_locations: + return [] + + # Phase selection + if current_phase_type == 'M': + return _run_movement_phase(game, power_name) + if current_phase_type == 'R': + return _run_retreats_phase(game, power_name) + if current_phase_type == 'A': + return _run_adjustment_phase(game, power_name) + + # Otherwise, returning no orders (i.e. game is completed) + return [] + +def _run_movement_phase(game, power_name): + """ Gets the move for the given power according to the ruleset. (for the movement phase) + :param game: The game object + :param power_name: The name of the power we are playing + :return: A list of orders for that power. + :type game: diplomacy.Game + """ + orders = [] + + # Movements phase + # Calculating current center allocations, and friendly and enemy territories + power = game.get_power(power_name) + own_centers = power.centers + other_centers = [center for center in game.map.scs if center not in own_centers] + own_influence = [loc for loc in power.influence if (game.map.area_type(loc) in ['LAND', 'COAST'] + and loc.upper()[:3] not in power.centers)] + other_influence = [loc.upper() for loc in game.map.locs if (game.map.area_type(loc) in ['LAND', 'COAST'] + and loc.upper()[:3] not in game.map.scs + and loc.upper()[:3] not in own_influence)] + + # Calculating locations of enemy units + enemy_units = [] + for other_power in game.powers.values(): + if power != other_power: + enemy_units += [unit for unit in other_power.units] + + # Unoccupied enemy centers and territories + unoccupied_sc = [center for center in other_centers if not [1 for unit in enemy_units if unit[2:5] == center]] + unoccupied_terr = [loc for loc in other_influence if not [1 for unit in enemy_units if unit[2:5] == loc]] + + # Computing list of valid dests + unordered_units = power.units[:] + valid_dests = [loc.upper() for loc in game.map.locs if loc.upper() not in own_centers + own_influence] + + # First ordering units on uncaptured supply center to hold + for unit in unordered_units[:]: + if unit[2:5] in other_centers: + orders += ['{} H'.format(unit)] + unordered_units.remove(unit) + valid_dests = [loc for loc in valid_dests if loc[:3] != unit[2:5]] + + # Second, assigning a priority to every adjacent location + # Priority 1 - Unoccupied enemy SC + # Priority 2 - Unoccupied enemy territory + # Priority 3 - Occupied SC + # Priority 4 - Enemy units + priority = [] + for unit in unordered_units: + for adj_loc in game.map.abut_list(unit[2:], incl_no_coast=True): + adj_loc = adj_loc.upper() + + # Priority 1 - Enemy SC (unoccupied) + if adj_loc[:3] in unoccupied_sc: + priority += [(unit, adj_loc, 1)] + + # Priority 2 - Enemy Territory (unoccupied) + elif adj_loc in unoccupied_terr: + priority += [(unit, adj_loc, 2)] + + # Priority 3 - Occupied SC + elif adj_loc[:3] in other_centers: + priority += [(unit, adj_loc, 3)] + + # Priority 4 - Enemy Units + elif [1 for unit in enemy_units if adj_loc[:3] == unit[2:5]]: + priority += [(unit, adj_loc, 4)] + + # Sorting by priority + priority.sort(key=itemgetter(2)) + + # Assigning orders based on priority + # Only assigning priority 1 and 2 here + for unit, dest, current_priority in priority: + if current_priority > 2: + continue + if unit in unordered_units and dest in valid_dests: + + # Direct move + # Skipping if we can't move there, or if this would create a two-way bounce + if not game.map.abuts(unit[0], unit[2:], '-', dest) or \ + [1 for order in orders if '{} - {}'.format(dest, unit[2:]) in order]: + continue + unordered_units.remove(unit) + valid_dests = [loc for loc in valid_dests if loc[:3] != dest[:3]] + valid_dests += game.map.find_coasts(unit[2:5]) + orders += ['{} - {}'.format(unit, dest)] + continue + + # Moving in direction of closest unoccupied SC or territory + for unit in unordered_units[:]: + dests = [loc.upper() for loc in game.map.abut_list(unit[2:], incl_no_coast=True) + if loc.upper() in valid_dests and not [1 for unit in enemy_units if unit[2:5] == loc.upper()]] + + # No valid dests, skipping + if not dests: + continue + + # Otherwise moving to loc closest to unoccupied SC or territory + dest_distance = [(dest, get_distance(game, unit[0], dest, unoccupied_sc + unoccupied_terr, True)) + for dest in dests] + dest_distance.sort(key=itemgetter(1)) + for dest, _ in dest_distance: + if not game.map.abuts(unit[0], unit[2:], '-', dest) or \ + [1 for order in orders if '{} - {}'.format(dest, unit[2:]) in order]: + continue + + # Moving there + orders += ['{} - {}'.format(unit, dest)] + unordered_units.remove(unit) + valid_dests = [loc for loc in valid_dests if loc[:3] != dest[:3]] + valid_dests += game.map.find_coasts(unit[2:5]) + break + + # Assigning orders based on priority + # Only assigning priority 3+ here + for unit, dest, current_priority in priority: + if current_priority <= 2: + continue + if unit in unordered_units and dest in valid_dests: + + # Direct move + # Skipping if we can't move there, or if this would create a two-way bounce + if not game.map.abuts(unit[0], unit[2:], '-', dest) or \ + [1 for order in orders if '{} - {}'.format(dest, unit[2:]) in order]: + continue + unordered_units.remove(unit) + valid_dests = [loc for loc in valid_dests if loc[:3] != dest[:3]] + valid_dests += game.map.find_coasts(unit[2:5]) + orders += ['{} - {}'.format(unit, dest)] + continue + + # Finally, moving in direction of closest occupied SC + for unit in unordered_units[:]: + dests = [loc.upper() for loc in game.map.abut_list(unit[2:], incl_no_coast=True) + if loc.upper() in valid_dests] + + # No valid dests, holding + if not dests: + unordered_units.remove(unit) + orders += ['{} H'.format(unit)] + continue + + # Otherwise moving to loc closest to unoccupied SC or territory + dest_distance = [(dest, get_distance(game, unit[0], dest, other_centers, True)) for dest in dests] + dest_distance.sort(key=itemgetter(1)) + for dest, _ in dest_distance: + if not game.map.abuts(unit[0], unit[2:], '-', dest) or \ + [1 for order in orders if '{} - {}'.format(dest, unit[2:]) in order]: + continue + + # Moving there + orders += ['{} - {}'.format(unit, dest)] + unordered_units.remove(unit) + valid_dests = [loc for loc in valid_dests if loc[:3] != dest[:3]] + valid_dests += game.map.find_coasts(unit[2:5]) + break + + # Returning orders + return orders + +def _run_retreats_phase(game, power_name): + """ Gets the move for the given power according to the ruleset. (for the retreats phase) + :param game: The game object + :param power_name: The name of the power we are playing + :return: A list of orders for that power. + :type game: diplomacy.Game + """ + orders = [] + + # Retreats phase + power = game.get_power(power_name) + own_units = power.units + for retreating_unit, allowed_locs in power.retreats.items(): + + # No valid retreat locations, disbanding + # If only one location, going there + # Otherwise finding the one with the most nearby friendly units + if not allowed_locs: + orders += ['{} D'.format(retreating_unit)] + + elif len(allowed_locs) == 1: + orders += ['{} R {}'.format(retreating_unit, allowed_locs[0])] + + else: + friends_nearby = [] + for retreat_loc in allowed_locs: + nb_friends = 0 + for neighbour_loc in game.map.abut_list(retreat_loc, incl_no_coast=True): + neighbour_loc = neighbour_loc.upper() + if 'A {}'.format(neighbour_loc) in own_units or 'F {}'.format(neighbour_loc) in own_units: + nb_friends += 1 + friends_nearby += [(retreat_loc, nb_friends)] + friends_nearby.sort(key=itemgetter(1), reverse=True) + orders += ['{} R {}'.format(retreating_unit, friends_nearby[0][0])] + + # Returning + return orders + +def _run_adjustment_phase(game, power_name): + """ Gets the move for the given power according to the ruleset. (for the adjustment phase) + :param game: The game object + :param power_name: The name of the power we are playing + :return: A list of orders for that power. + :type game: diplomacy.Game + """ + orders = [] + + # Adjustment / Build phase + power = game.get_power(power_name) + orderable_locations = game.get_orderable_locations(power_name) + + nb_builds = len(power.centers) - len(power.units) + nb_armies = len([unit for unit in power.units if unit[0] == 'A']) + nb_fleets = len([unit for unit in power.units if unit[0] == 'F']) + + # We can build units + if nb_builds > 0: + # Maintaining a 40% fleet, 60% army + nb_units_after = nb_armies + nb_fleets + nb_builds + fleet_builds = max(0, int(round(nb_units_after * 0.4, 0)) - nb_fleets) + army_builds = nb_builds - fleet_builds + + # Finding our centers and the enemy centers + own_centers = power.centers + other_centers = [center for center in game.map.scs if center not in own_centers] + + # Calculating distance to closest enemy center from every buildable location + build_loc_distance = [(build_loc, min(get_distance(game, 'A', build_loc, other_centers, False), + get_distance(game, 'F', build_loc, other_centers, False))) + for build_loc in orderable_locations] + build_loc_distance.sort(key=itemgetter(1)) + + # Building from units with smallest distance first + for build_loc, _ in build_loc_distance: + area_type = game.map.area_type(build_loc) + if fleet_builds and area_type == 'WATER': + fleet_builds -= 1 + orders += ['F {} B'.format(build_loc)] + elif army_builds and area_type == 'LAND': + army_builds -= 1 + orders += ['A {} B'.format(build_loc)] + else: + if fleet_builds: + fleet_builds -= 1 + orders += ['F {} B'.format(build_loc)] + elif army_builds: + army_builds -= 1 + orders += ['A {} B'.format(build_loc)] + + # We need to disband units + elif nb_builds < 0: + own_influence = [loc for loc in power.influence if (game.map.area_type(loc) in ['LAND', 'COAST'] + and loc.upper()[:3] not in power.centers)] + other_influence = [loc.upper() for loc in game.map.locs if (game.map.area_type(loc) in ['LAND', 'COAST'] + and loc.upper() not in own_influence)] + + # Finding distance to nearest enemy territory + units = power.units + unit_distance = [(unit, get_distance(game, unit[0], unit[2:], other_influence, True)) for unit in units] + unit_distance.sort(key=itemgetter(1), reverse=True) + + # Removing units that are further from enemy territory + nb_disband_left = abs(nb_builds) + for unit, _ in unit_distance: + if nb_disband_left: + orders += ['{} D'.format(unit)] + nb_disband_left -= 1 + + # Returning orders + return orders diff --git a/diplomacy_research/players/rulesets/utils.py b/diplomacy_research/players/rulesets/utils.py new file mode 100644 index 0000000..3a618d7 --- /dev/null +++ b/diplomacy_research/players/rulesets/utils.py @@ -0,0 +1,65 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" Ruleset utils + - Contains various utility functions for the rulesets + +""" +from diplomacy.utils import PriorityDict + +def get_distance(game, unit_type, start, targets, skip_occupied): + """ Calculate the distance from a unit to the closest target + :param game: A `diplomacy.Game` instance. + :param unit_type: The unit type to calculate distance (e.g. 'A' or 'F') + :param start: The start location of the unit (e.g. 'LON') + :param targets: The list of targets (first one reached calculates the distance) + :param skip_occupied: Boolean flag. If set, doesn't calculate distance if a unit is blocking the path + :return: The minimum distance from unit to one of the targets + :type game: diplomacy.Game + """ + visited = [] + if not targets: + return 99999 + + # Modified Djikstra + to_check = PriorityDict() + to_check[start] = 0 + while to_check: + distance, current = to_check.smallest() + del to_check[current] + + # Found smallest distance + if current[:3] in targets: + return distance + + # Marking visited + if current in visited: + continue + visited += [current] + + # Finding neighbors and updating distance + for loc in game.map.abut_list(current, incl_no_coast=True): + loc = loc.upper() + if loc in visited: + continue + elif skip_occupied and (game._unit_owner('A {}'.format(loc[:3]), coast_required=False) # pylint: disable=protected-access + or game._unit_owner('F {}'.format(loc[:3]), coast_required=False)): # pylint: disable=protected-access + continue + + # Calculating distance + if game._abuts(unit_type, current, '-', loc): # pylint: disable=protected-access + loc_distance = to_check[loc] if loc in to_check else 99999 + to_check[loc] = min(distance + 1, loc_distance) + + # Could not find destination + return 99999 diff --git a/diplomacy_research/players/tests/test_player.py b/diplomacy_research/players/tests/test_player.py new file mode 100644 index 0000000..b6c5a6d --- /dev/null +++ b/diplomacy_research/players/tests/test_player.py @@ -0,0 +1,61 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== +""" TestPlayer + - Contains the test cases for the Player object +""" +from tornado import gen +from diplomacy import Game +from diplomacy_research.models.state_space import extract_state_proto +from diplomacy_research.players.player import Player + +class FakePlayer(Player): + """ Test Case Player """ + @property + def is_trainable(self): + """ Test class - See documentation on Player object """ + return False + + @gen.coroutine + def get_orders_details_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto, + **kwargs): + """ Test class - See documentation on Player object """ + + @gen.coroutine + def get_state_value_with_proto(self, state_proto, power_name, phase_history_proto, possible_orders_proto=None, + **kwargs): + """ Test class - See documentation on Player object """ + +def test_get_nb_centers(): + """ Testing if the number of supply centers is correct """ + game = Game() + player = FakePlayer() + state_proto = extract_state_proto(game) + + # Checking every power + power_names = [power_name for power_name in game.powers] + for power_name in power_names: + assert player.get_nb_centers(state_proto, power_name) == len(game.get_power(power_name).centers) + +def test_get_orderable_locations(): + """ Testing if the number of orderable locations is correct """ + game = Game() + player = FakePlayer() + state_proto = extract_state_proto(game) + + # Checking every power + power_names = [power_name for power_name in game.powers] + for power_name in power_names: + expected_locs = [unit.replace('*', '')[2:5] for unit in state_proto.units[power_name].value] + expected_locs += state_proto.builds[power_name].homes + assert sorted(player.get_orderable_locations(state_proto, power_name)) == sorted(expected_locs) diff --git a/diplomacy_research/proto/__init__.py b/diplomacy_research/proto/__init__.py new file mode 100644 index 0000000..17194ce --- /dev/null +++ b/diplomacy_research/proto/__init__.py @@ -0,0 +1,13 @@ +# ============================================================================== +# Copyright 2019 - Philip Paquette +# +# NOTICE: 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. +# ============================================================================== diff --git a/diplomacy_research/proto/cpp_proto.c b/diplomacy_research/proto/cpp_proto.c new file mode 100644 index 0000000..ac0b9bd --- /dev/null +++ b/diplomacy_research/proto/cpp_proto.c @@ -0,0 +1,20 @@ +// Source: http://yz.mit.edu/wp/fast-native-c-protocol-buffers-from-python/ +#include + +static PyMethodDef CppProtoMethods[] = { + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +static struct PyModuleDef cppprotomodule = { + PyModuleDef_HEAD_INIT, + "cpp_proto", /* name of module */ + "", /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + CppProtoMethods +}; + +PyMODINIT_FUNC +PyInit_cpp_proto(void) +{ + return PyModule_Create(&cppprotomodule); +} diff --git a/diplomacy_research/proto/diplomacy_proto/common.pb.cc b/diplomacy_research/proto/diplomacy_proto/common.pb.cc new file mode 100644 index 0000000..398d539 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/common.pb.cc @@ -0,0 +1,2067 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_proto/common.proto + +#include "diplomacy_proto/common.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5fproto_2fcommon_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fcommon_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_StringList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fcommon_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_MapStringList_ValueEntry_DoNotUse; +} // namespace protobuf_diplomacy_5fproto_2fcommon_2eproto +namespace diplomacy_proto { +class StringListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _StringList_default_instance_; +class BytesListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BytesList_default_instance_; +class FloatListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FloatList_default_instance_; +class IntListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _IntList_default_instance_; +class Int64ListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Int64List_default_instance_; +class MapStringList_ValueEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MapStringList_ValueEntry_DoNotUse_default_instance_; +class MapStringListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MapStringList_default_instance_; +} // namespace diplomacy_proto +namespace protobuf_diplomacy_5fproto_2fcommon_2eproto { +static void InitDefaultsStringList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_StringList_default_instance_; + new (ptr) ::diplomacy_proto::StringList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::StringList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_StringList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsStringList}, {}}; + +static void InitDefaultsBytesList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_BytesList_default_instance_; + new (ptr) ::diplomacy_proto::BytesList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::BytesList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_BytesList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsBytesList}, {}}; + +static void InitDefaultsFloatList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_FloatList_default_instance_; + new (ptr) ::diplomacy_proto::FloatList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::FloatList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_FloatList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFloatList}, {}}; + +static void InitDefaultsIntList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_IntList_default_instance_; + new (ptr) ::diplomacy_proto::IntList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::IntList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_IntList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsIntList}, {}}; + +static void InitDefaultsInt64List() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_Int64List_default_instance_; + new (ptr) ::diplomacy_proto::Int64List(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::Int64List::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Int64List = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsInt64List}, {}}; + +static void InitDefaultsMapStringList_ValueEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_MapStringList_ValueEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::MapStringList_ValueEntry_DoNotUse(); + } + ::diplomacy_proto::MapStringList_ValueEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_MapStringList_ValueEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMapStringList_ValueEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsMapStringList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_MapStringList_default_instance_; + new (ptr) ::diplomacy_proto::MapStringList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::MapStringList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_MapStringList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMapStringList}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_MapStringList_ValueEntry_DoNotUse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_StringList.base); + ::google::protobuf::internal::InitSCC(&scc_info_BytesList.base); + ::google::protobuf::internal::InitSCC(&scc_info_FloatList.base); + ::google::protobuf::internal::InitSCC(&scc_info_IntList.base); + ::google::protobuf::internal::InitSCC(&scc_info_Int64List.base); + ::google::protobuf::internal::InitSCC(&scc_info_MapStringList_ValueEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_MapStringList.base); +} + +::google::protobuf::Metadata file_level_metadata[7]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::StringList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::StringList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::BytesList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::BytesList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::FloatList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::FloatList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::IntList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::IntList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Int64List, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Int64List, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::MapStringList_ValueEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::MapStringList_ValueEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::MapStringList_ValueEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::MapStringList_ValueEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::MapStringList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::MapStringList, value_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy_proto::StringList)}, + { 6, -1, sizeof(::diplomacy_proto::BytesList)}, + { 12, -1, sizeof(::diplomacy_proto::FloatList)}, + { 18, -1, sizeof(::diplomacy_proto::IntList)}, + { 24, -1, sizeof(::diplomacy_proto::Int64List)}, + { 30, 37, sizeof(::diplomacy_proto::MapStringList_ValueEntry_DoNotUse)}, + { 39, -1, sizeof(::diplomacy_proto::MapStringList)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy_proto::_StringList_default_instance_), + reinterpret_cast(&::diplomacy_proto::_BytesList_default_instance_), + reinterpret_cast(&::diplomacy_proto::_FloatList_default_instance_), + reinterpret_cast(&::diplomacy_proto::_IntList_default_instance_), + reinterpret_cast(&::diplomacy_proto::_Int64List_default_instance_), + reinterpret_cast(&::diplomacy_proto::_MapStringList_ValueEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_MapStringList_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_proto/common.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\034diplomacy_proto/common.proto\022\017diplomac" + "y_proto\"\033\n\nStringList\022\r\n\005value\030\001 \003(\t\"\032\n\t" + "BytesList\022\r\n\005value\030\001 \003(\014\"\036\n\tFloatList\022\021\n" + "\005value\030\001 \003(\002B\002\020\001\"\034\n\007IntList\022\021\n\005value\030\001 \003" + "(\005B\002\020\001\"\036\n\tInt64List\022\021\n\005value\030\001 \003(\003B\002\020\001\"\224" + "\001\n\rMapStringList\0228\n\005value\030\001 \003(\0132).diplom" + "acy_proto.MapStringList.ValueEntry\032I\n\nVa" + "lueEntry\022\013\n\003key\030\001 \001(\t\022*\n\005value\030\002 \001(\0132\033.d" + "iplomacy_proto.StringList:\0028\001B\003\370\001\001b\006prot" + "o3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 362); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_proto/common.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5fproto_2fcommon_2eproto +namespace diplomacy_proto { + +// =================================================================== + +void StringList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int StringList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +StringList::StringList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.StringList) +} +StringList::StringList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.StringList) +} +StringList::StringList(const StringList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.StringList) +} + +void StringList::SharedCtor() { +} + +StringList::~StringList() { + // @@protoc_insertion_point(destructor:diplomacy_proto.StringList) + SharedDtor(); +} + +void StringList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void StringList::ArenaDtor(void* object) { + StringList* _this = reinterpret_cast< StringList* >(object); + (void)_this; +} +void StringList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void StringList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* StringList::descriptor() { + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const StringList& StringList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base); + return *internal_default_instance(); +} + + +void StringList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.StringList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool StringList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.StringList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated string value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_value())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->value(this->value_size() - 1).data(), + static_cast(this->value(this->value_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.StringList.value")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.StringList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.StringList) + return false; +#undef DO_ +} + +void StringList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.StringList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->value(i).data(), static_cast(this->value(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.StringList.value"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1, this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.StringList) +} + +::google::protobuf::uint8* StringList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.StringList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->value(i).data(), static_cast(this->value(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.StringList.value"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1, this->value(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.StringList) + return target; +} + +size_t StringList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.StringList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string value = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->value_size()); + for (int i = 0, n = this->value_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->value(i)); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StringList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.StringList) + GOOGLE_DCHECK_NE(&from, this); + const StringList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.StringList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.StringList) + MergeFrom(*source); + } +} + +void StringList::MergeFrom(const StringList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.StringList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void StringList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.StringList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StringList::CopyFrom(const StringList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.StringList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StringList::IsInitialized() const { + return true; +} + +void StringList::Swap(StringList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + StringList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void StringList::UnsafeArenaSwap(StringList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void StringList::InternalSwap(StringList* other) { + using std::swap; + value_.InternalSwap(CastToBase(&other->value_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata StringList::GetMetadata() const { + protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void BytesList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BytesList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BytesList::BytesList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_BytesList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.BytesList) +} +BytesList::BytesList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_BytesList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.BytesList) +} +BytesList::BytesList(const BytesList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.BytesList) +} + +void BytesList::SharedCtor() { +} + +BytesList::~BytesList() { + // @@protoc_insertion_point(destructor:diplomacy_proto.BytesList) + SharedDtor(); +} + +void BytesList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void BytesList::ArenaDtor(void* object) { + BytesList* _this = reinterpret_cast< BytesList* >(object); + (void)_this; +} +void BytesList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BytesList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BytesList::descriptor() { + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BytesList& BytesList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_BytesList.base); + return *internal_default_instance(); +} + + +void BytesList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool BytesList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.BytesList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated bytes value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.BytesList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.BytesList) + return false; +#undef DO_ +} + +void BytesList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 1, this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.BytesList) +} + +::google::protobuf::uint8* BytesList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(1, this->value(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.BytesList) + return target; +} + +size_t BytesList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.BytesList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated bytes value = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->value_size()); + for (int i = 0, n = this->value_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->value(i)); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BytesList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.BytesList) + GOOGLE_DCHECK_NE(&from, this); + const BytesList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.BytesList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.BytesList) + MergeFrom(*source); + } +} + +void BytesList::MergeFrom(const BytesList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.BytesList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void BytesList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.BytesList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BytesList::CopyFrom(const BytesList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.BytesList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BytesList::IsInitialized() const { + return true; +} + +void BytesList::Swap(BytesList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BytesList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BytesList::UnsafeArenaSwap(BytesList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BytesList::InternalSwap(BytesList* other) { + using std::swap; + value_.InternalSwap(CastToBase(&other->value_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BytesList::GetMetadata() const { + protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FloatList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FloatList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FloatList::FloatList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_FloatList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.FloatList) +} +FloatList::FloatList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_FloatList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.FloatList) +} +FloatList::FloatList(const FloatList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.FloatList) +} + +void FloatList::SharedCtor() { +} + +FloatList::~FloatList() { + // @@protoc_insertion_point(destructor:diplomacy_proto.FloatList) + SharedDtor(); +} + +void FloatList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void FloatList::ArenaDtor(void* object) { + FloatList* _this = reinterpret_cast< FloatList* >(object); + (void)_this; +} +void FloatList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FloatList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FloatList::descriptor() { + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FloatList& FloatList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_FloatList.base); + return *internal_default_instance(); +} + + +void FloatList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool FloatList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.FloatList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated float value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.FloatList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.FloatList) + return false; +#undef DO_ +} + +void FloatList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.FloatList) +} + +::google::protobuf::uint8* FloatList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.FloatList) + return target; +} + +size_t FloatList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.FloatList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated float value = 1 [packed = true]; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FloatList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.FloatList) + GOOGLE_DCHECK_NE(&from, this); + const FloatList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.FloatList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.FloatList) + MergeFrom(*source); + } +} + +void FloatList::MergeFrom(const FloatList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.FloatList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void FloatList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.FloatList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FloatList::CopyFrom(const FloatList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.FloatList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FloatList::IsInitialized() const { + return true; +} + +void FloatList::Swap(FloatList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FloatList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FloatList::UnsafeArenaSwap(FloatList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FloatList::InternalSwap(FloatList* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FloatList::GetMetadata() const { + protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void IntList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int IntList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +IntList::IntList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_IntList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.IntList) +} +IntList::IntList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_IntList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.IntList) +} +IntList::IntList(const IntList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.IntList) +} + +void IntList::SharedCtor() { +} + +IntList::~IntList() { + // @@protoc_insertion_point(destructor:diplomacy_proto.IntList) + SharedDtor(); +} + +void IntList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void IntList::ArenaDtor(void* object) { + IntList* _this = reinterpret_cast< IntList* >(object); + (void)_this; +} +void IntList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void IntList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* IntList::descriptor() { + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const IntList& IntList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_IntList.base); + return *internal_default_instance(); +} + + +void IntList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.IntList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool IntList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.IntList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.IntList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.IntList) + return false; +#undef DO_ +} + +void IntList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.IntList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + } + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.IntList) +} + +::google::protobuf::uint8* IntList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.IntList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.IntList) + return target; +} + +size_t IntList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.IntList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 value = 1 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->value_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void IntList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.IntList) + GOOGLE_DCHECK_NE(&from, this); + const IntList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.IntList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.IntList) + MergeFrom(*source); + } +} + +void IntList::MergeFrom(const IntList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.IntList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void IntList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.IntList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void IntList::CopyFrom(const IntList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.IntList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool IntList::IsInitialized() const { + return true; +} + +void IntList::Swap(IntList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + IntList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void IntList::UnsafeArenaSwap(IntList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void IntList::InternalSwap(IntList* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata IntList::GetMetadata() const { + protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Int64List::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Int64List::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Int64List::Int64List() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_Int64List.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.Int64List) +} +Int64List::Int64List(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_Int64List.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.Int64List) +} +Int64List::Int64List(const Int64List& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.Int64List) +} + +void Int64List::SharedCtor() { +} + +Int64List::~Int64List() { + // @@protoc_insertion_point(destructor:diplomacy_proto.Int64List) + SharedDtor(); +} + +void Int64List::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Int64List::ArenaDtor(void* object) { + Int64List* _this = reinterpret_cast< Int64List* >(object); + (void)_this; +} +void Int64List::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Int64List::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Int64List::descriptor() { + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Int64List& Int64List::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_Int64List.base); + return *internal_default_instance(); +} + + +void Int64List::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool Int64List::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.Int64List) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.Int64List) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.Int64List) + return false; +#undef DO_ +} + +void Int64List::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + } + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.Int64List) +} + +::google::protobuf::uint8* Int64List::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.Int64List) + return target; +} + +size_t Int64List::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.Int64List) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 value = 1 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->value_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Int64List::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.Int64List) + GOOGLE_DCHECK_NE(&from, this); + const Int64List* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.Int64List) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.Int64List) + MergeFrom(*source); + } +} + +void Int64List::MergeFrom(const Int64List& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.Int64List) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void Int64List::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.Int64List) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Int64List::CopyFrom(const Int64List& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.Int64List) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Int64List::IsInitialized() const { + return true; +} + +void Int64List::Swap(Int64List* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Int64List* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Int64List::UnsafeArenaSwap(Int64List* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Int64List::InternalSwap(Int64List* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Int64List::GetMetadata() const { + protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +MapStringList_ValueEntry_DoNotUse::MapStringList_ValueEntry_DoNotUse() {} +MapStringList_ValueEntry_DoNotUse::MapStringList_ValueEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void MapStringList_ValueEntry_DoNotUse::MergeFrom(const MapStringList_ValueEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata MapStringList_ValueEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[5]; +} +void MapStringList_ValueEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void MapStringList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MapStringList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MapStringList::MapStringList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_MapStringList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.MapStringList) +} +MapStringList::MapStringList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_MapStringList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.MapStringList) +} +MapStringList::MapStringList(const MapStringList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + value_.MergeFrom(from.value_); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.MapStringList) +} + +void MapStringList::SharedCtor() { +} + +MapStringList::~MapStringList() { + // @@protoc_insertion_point(destructor:diplomacy_proto.MapStringList) + SharedDtor(); +} + +void MapStringList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void MapStringList::ArenaDtor(void* object) { + MapStringList* _this = reinterpret_cast< MapStringList* >(object); + (void)_this; +} +void MapStringList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MapStringList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MapStringList::descriptor() { + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MapStringList& MapStringList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_MapStringList.base); + return *internal_default_instance(); +} + + +void MapStringList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.MapStringList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool MapStringList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.MapStringList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + MapStringList_ValueEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + MapStringList_ValueEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(&value_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.MapStringList.ValueEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.MapStringList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.MapStringList) + return false; +#undef DO_ +} + +void MapStringList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.MapStringList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map value = 1; + if (!this->value().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.MapStringList.ValueEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->value().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->value().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->value().begin(); + it != this->value().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(value_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->value().begin(); + it != this->value().end(); ++it) { + entry.reset(value_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.MapStringList) +} + +::google::protobuf::uint8* MapStringList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.MapStringList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map value = 1; + if (!this->value().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.MapStringList.ValueEntry.key"); + } + }; + + if (deterministic && + this->value().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->value().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->value().begin(); + it != this->value().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(value_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->value().begin(); + it != this->value().end(); ++it) { + entry.reset(value_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.MapStringList) + return target; +} + +size_t MapStringList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.MapStringList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map value = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->value_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->value().begin(); + it != this->value().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(value_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MapStringList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.MapStringList) + GOOGLE_DCHECK_NE(&from, this); + const MapStringList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.MapStringList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.MapStringList) + MergeFrom(*source); + } +} + +void MapStringList::MergeFrom(const MapStringList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.MapStringList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void MapStringList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.MapStringList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MapStringList::CopyFrom(const MapStringList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.MapStringList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MapStringList::IsInitialized() const { + return true; +} + +void MapStringList::Swap(MapStringList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MapStringList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MapStringList::UnsafeArenaSwap(MapStringList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MapStringList::InternalSwap(MapStringList* other) { + using std::swap; + value_.Swap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MapStringList::GetMetadata() const { + protobuf_diplomacy_5fproto_2fcommon_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fcommon_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace diplomacy_proto +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::StringList* Arena::CreateMaybeMessage< ::diplomacy_proto::StringList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::StringList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::BytesList* Arena::CreateMaybeMessage< ::diplomacy_proto::BytesList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::BytesList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::FloatList* Arena::CreateMaybeMessage< ::diplomacy_proto::FloatList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::FloatList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::IntList* Arena::CreateMaybeMessage< ::diplomacy_proto::IntList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::IntList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::Int64List* Arena::CreateMaybeMessage< ::diplomacy_proto::Int64List >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::Int64List >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::MapStringList_ValueEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::MapStringList_ValueEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::MapStringList_ValueEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::MapStringList* Arena::CreateMaybeMessage< ::diplomacy_proto::MapStringList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::MapStringList >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_proto/common.pb.h b/diplomacy_research/proto/diplomacy_proto/common.pb.h new file mode 100644 index 0000000..67a76bd --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/common.pb.h @@ -0,0 +1,1179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_proto/common.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5fproto_2fcommon_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5fproto_2fcommon_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fcommon_2eproto + +namespace protobuf_diplomacy_5fproto_2fcommon_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[7]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5fproto_2fcommon_2eproto +namespace diplomacy_proto { +class BytesList; +class BytesListDefaultTypeInternal; +extern BytesListDefaultTypeInternal _BytesList_default_instance_; +class FloatList; +class FloatListDefaultTypeInternal; +extern FloatListDefaultTypeInternal _FloatList_default_instance_; +class Int64List; +class Int64ListDefaultTypeInternal; +extern Int64ListDefaultTypeInternal _Int64List_default_instance_; +class IntList; +class IntListDefaultTypeInternal; +extern IntListDefaultTypeInternal _IntList_default_instance_; +class MapStringList; +class MapStringListDefaultTypeInternal; +extern MapStringListDefaultTypeInternal _MapStringList_default_instance_; +class MapStringList_ValueEntry_DoNotUse; +class MapStringList_ValueEntry_DoNotUseDefaultTypeInternal; +extern MapStringList_ValueEntry_DoNotUseDefaultTypeInternal _MapStringList_ValueEntry_DoNotUse_default_instance_; +class StringList; +class StringListDefaultTypeInternal; +extern StringListDefaultTypeInternal _StringList_default_instance_; +} // namespace diplomacy_proto +namespace google { +namespace protobuf { +template<> ::diplomacy_proto::BytesList* Arena::CreateMaybeMessage<::diplomacy_proto::BytesList>(Arena*); +template<> ::diplomacy_proto::FloatList* Arena::CreateMaybeMessage<::diplomacy_proto::FloatList>(Arena*); +template<> ::diplomacy_proto::Int64List* Arena::CreateMaybeMessage<::diplomacy_proto::Int64List>(Arena*); +template<> ::diplomacy_proto::IntList* Arena::CreateMaybeMessage<::diplomacy_proto::IntList>(Arena*); +template<> ::diplomacy_proto::MapStringList* Arena::CreateMaybeMessage<::diplomacy_proto::MapStringList>(Arena*); +template<> ::diplomacy_proto::MapStringList_ValueEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::MapStringList_ValueEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::StringList* Arena::CreateMaybeMessage<::diplomacy_proto::StringList>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy_proto { + +// =================================================================== + +class StringList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.StringList) */ { + public: + StringList(); + virtual ~StringList(); + + StringList(const StringList& from); + + inline StringList& operator=(const StringList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + StringList(StringList&& from) noexcept + : StringList() { + *this = ::std::move(from); + } + + inline StringList& operator=(StringList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const StringList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StringList* internal_default_instance() { + return reinterpret_cast( + &_StringList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(StringList* other); + void Swap(StringList* other); + friend void swap(StringList& a, StringList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline StringList* New() const final { + return CreateMaybeMessage(NULL); + } + + StringList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const StringList& from); + void MergeFrom(const StringList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StringList* other); + protected: + explicit StringList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + const ::std::string& value(int index) const; + ::std::string* mutable_value(int index); + void set_value(int index, const ::std::string& value); + #if LANG_CXX11 + void set_value(int index, ::std::string&& value); + #endif + void set_value(int index, const char* value); + void set_value(int index, const char* value, size_t size); + ::std::string* add_value(); + void add_value(const ::std::string& value); + #if LANG_CXX11 + void add_value(::std::string&& value); + #endif + void add_value(const char* value); + void add_value(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& value() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.StringList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fcommon_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class BytesList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.BytesList) */ { + public: + BytesList(); + virtual ~BytesList(); + + BytesList(const BytesList& from); + + inline BytesList& operator=(const BytesList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BytesList(BytesList&& from) noexcept + : BytesList() { + *this = ::std::move(from); + } + + inline BytesList& operator=(BytesList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BytesList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BytesList* internal_default_instance() { + return reinterpret_cast( + &_BytesList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(BytesList* other); + void Swap(BytesList* other); + friend void swap(BytesList& a, BytesList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BytesList* New() const final { + return CreateMaybeMessage(NULL); + } + + BytesList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BytesList& from); + void MergeFrom(const BytesList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BytesList* other); + protected: + explicit BytesList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bytes value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + const ::std::string& value(int index) const; + ::std::string* mutable_value(int index); + void set_value(int index, const ::std::string& value); + #if LANG_CXX11 + void set_value(int index, ::std::string&& value); + #endif + void set_value(int index, const char* value); + void set_value(int index, const void* value, size_t size); + ::std::string* add_value(); + void add_value(const ::std::string& value); + #if LANG_CXX11 + void add_value(::std::string&& value); + #endif + void add_value(const char* value); + void add_value(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& value() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.BytesList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fcommon_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FloatList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.FloatList) */ { + public: + FloatList(); + virtual ~FloatList(); + + FloatList(const FloatList& from); + + inline FloatList& operator=(const FloatList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FloatList(FloatList&& from) noexcept + : FloatList() { + *this = ::std::move(from); + } + + inline FloatList& operator=(FloatList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FloatList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FloatList* internal_default_instance() { + return reinterpret_cast( + &_FloatList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(FloatList* other); + void Swap(FloatList* other); + friend void swap(FloatList& a, FloatList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FloatList* New() const final { + return CreateMaybeMessage(NULL); + } + + FloatList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FloatList& from); + void MergeFrom(const FloatList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FloatList* other); + protected: + explicit FloatList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated float value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + float value(int index) const; + void set_value(int index, float value); + void add_value(float value); + const ::google::protobuf::RepeatedField< float >& + value() const; + ::google::protobuf::RepeatedField< float >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.FloatList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< float > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fcommon_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class IntList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.IntList) */ { + public: + IntList(); + virtual ~IntList(); + + IntList(const IntList& from); + + inline IntList& operator=(const IntList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + IntList(IntList&& from) noexcept + : IntList() { + *this = ::std::move(from); + } + + inline IntList& operator=(IntList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const IntList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const IntList* internal_default_instance() { + return reinterpret_cast( + &_IntList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(IntList* other); + void Swap(IntList* other); + friend void swap(IntList& a, IntList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline IntList* New() const final { + return CreateMaybeMessage(NULL); + } + + IntList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const IntList& from); + void MergeFrom(const IntList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(IntList* other); + protected: + explicit IntList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + ::google::protobuf::int32 value(int index) const; + void set_value(int index, ::google::protobuf::int32 value); + void add_value(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + value() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.IntList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fcommon_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Int64List : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.Int64List) */ { + public: + Int64List(); + virtual ~Int64List(); + + Int64List(const Int64List& from); + + inline Int64List& operator=(const Int64List& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Int64List(Int64List&& from) noexcept + : Int64List() { + *this = ::std::move(from); + } + + inline Int64List& operator=(Int64List&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Int64List& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Int64List* internal_default_instance() { + return reinterpret_cast( + &_Int64List_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(Int64List* other); + void Swap(Int64List* other); + friend void swap(Int64List& a, Int64List& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Int64List* New() const final { + return CreateMaybeMessage(NULL); + } + + Int64List* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Int64List& from); + void MergeFrom(const Int64List& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Int64List* other); + protected: + explicit Int64List(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + ::google::protobuf::int64 value(int index) const; + void set_value(int index, ::google::protobuf::int64 value); + void add_value(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + value() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.Int64List) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fcommon_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MapStringList_ValueEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + MapStringList_ValueEntry_DoNotUse(); + MapStringList_ValueEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const MapStringList_ValueEntry_DoNotUse& other); + static const MapStringList_ValueEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_MapStringList_ValueEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class MapStringList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.MapStringList) */ { + public: + MapStringList(); + virtual ~MapStringList(); + + MapStringList(const MapStringList& from); + + inline MapStringList& operator=(const MapStringList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MapStringList(MapStringList&& from) noexcept + : MapStringList() { + *this = ::std::move(from); + } + + inline MapStringList& operator=(MapStringList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MapStringList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MapStringList* internal_default_instance() { + return reinterpret_cast( + &_MapStringList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(MapStringList* other); + void Swap(MapStringList* other); + friend void swap(MapStringList& a, MapStringList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MapStringList* New() const final { + return CreateMaybeMessage(NULL); + } + + MapStringList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MapStringList& from); + void MergeFrom(const MapStringList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MapStringList* other); + protected: + explicit MapStringList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + value() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.MapStringList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + MapStringList_ValueEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fcommon_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// StringList + +// repeated string value = 1; +inline int StringList::value_size() const { + return value_.size(); +} +inline void StringList::clear_value() { + value_.Clear(); +} +inline const ::std::string& StringList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.StringList.value) + return value_.Get(index); +} +inline ::std::string* StringList::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.StringList.value) + return value_.Mutable(index); +} +inline void StringList::set_value(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.StringList.value) + value_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void StringList::set_value(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.StringList.value) + value_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void StringList::set_value(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.StringList.value) +} +inline void StringList::set_value(int index, const char* value, size_t size) { + value_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.StringList.value) +} +inline ::std::string* StringList::add_value() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.StringList.value) + return value_.Add(); +} +inline void StringList::add_value(const ::std::string& value) { + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.StringList.value) +} +#if LANG_CXX11 +inline void StringList::add_value(::std::string&& value) { + value_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.StringList.value) +} +#endif +inline void StringList::add_value(const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.StringList.value) +} +inline void StringList::add_value(const char* value, size_t size) { + value_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.StringList.value) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +StringList::value() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.StringList.value) + return value_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +StringList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.StringList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// BytesList + +// repeated bytes value = 1; +inline int BytesList::value_size() const { + return value_.size(); +} +inline void BytesList::clear_value() { + value_.Clear(); +} +inline const ::std::string& BytesList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.BytesList.value) + return value_.Get(index); +} +inline ::std::string* BytesList::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.BytesList.value) + return value_.Mutable(index); +} +inline void BytesList::set_value(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.BytesList.value) + value_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void BytesList::set_value(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.BytesList.value) + value_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void BytesList::set_value(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.BytesList.value) +} +inline void BytesList::set_value(int index, const void* value, size_t size) { + value_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.BytesList.value) +} +inline ::std::string* BytesList::add_value() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.BytesList.value) + return value_.Add(); +} +inline void BytesList::add_value(const ::std::string& value) { + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.BytesList.value) +} +#if LANG_CXX11 +inline void BytesList::add_value(::std::string&& value) { + value_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.BytesList.value) +} +#endif +inline void BytesList::add_value(const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.BytesList.value) +} +inline void BytesList::add_value(const void* value, size_t size) { + value_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.BytesList.value) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +BytesList::value() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.BytesList.value) + return value_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +BytesList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.BytesList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// FloatList + +// repeated float value = 1 [packed = true]; +inline int FloatList::value_size() const { + return value_.size(); +} +inline void FloatList::clear_value() { + value_.Clear(); +} +inline float FloatList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.FloatList.value) + return value_.Get(index); +} +inline void FloatList::set_value(int index, float value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.FloatList.value) +} +inline void FloatList::add_value(float value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.FloatList.value) +} +inline const ::google::protobuf::RepeatedField< float >& +FloatList::value() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.FloatList.value) + return value_; +} +inline ::google::protobuf::RepeatedField< float >* +FloatList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.FloatList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// IntList + +// repeated int32 value = 1 [packed = true]; +inline int IntList::value_size() const { + return value_.size(); +} +inline void IntList::clear_value() { + value_.Clear(); +} +inline ::google::protobuf::int32 IntList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.IntList.value) + return value_.Get(index); +} +inline void IntList::set_value(int index, ::google::protobuf::int32 value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.IntList.value) +} +inline void IntList::add_value(::google::protobuf::int32 value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.IntList.value) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +IntList::value() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.IntList.value) + return value_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +IntList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.IntList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// Int64List + +// repeated int64 value = 1 [packed = true]; +inline int Int64List::value_size() const { + return value_.size(); +} +inline void Int64List::clear_value() { + value_.Clear(); +} +inline ::google::protobuf::int64 Int64List::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.Int64List.value) + return value_.Get(index); +} +inline void Int64List::set_value(int index, ::google::protobuf::int64 value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.Int64List.value) +} +inline void Int64List::add_value(::google::protobuf::int64 value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.Int64List.value) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +Int64List::value() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.Int64List.value) + return value_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +Int64List::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.Int64List.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// MapStringList + +// map value = 1; +inline int MapStringList::value_size() const { + return value_.size(); +} +inline void MapStringList::clear_value() { + value_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +MapStringList::value() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.MapStringList.value) + return value_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +MapStringList::mutable_value() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.MapStringList.value) + return value_.MutableMap(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace diplomacy_proto + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5fproto_2fcommon_2eproto diff --git a/diplomacy_research/proto/diplomacy_proto/common.proto b/diplomacy_research/proto/diplomacy_proto/common.proto new file mode 100644 index 0000000..c7db961 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/common.proto @@ -0,0 +1,36 @@ +// ============================================================================== +// Copyright 2019 - Philip Paquette +// +// NOTICE: 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. +// ============================================================================== +syntax = "proto3"; +package diplomacy_proto; +option cc_enable_arenas = true; + +// Common proto classes +message StringList { + repeated string value = 1; +} +message BytesList { + repeated bytes value = 1; +} +message FloatList { + repeated float value = 1 [packed = true]; +} +message IntList { + repeated int32 value = 1 [packed = true]; +} +message Int64List { + repeated int64 value = 1 [packed = true]; +} +message MapStringList { + map value = 1; +} diff --git a/diplomacy_research/proto/diplomacy_proto/common_pb2.py b/diplomacy_research/proto/diplomacy_proto/common_pb2.py new file mode 100644 index 0000000..3cc25a0 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/common_pb2.py @@ -0,0 +1,317 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_proto/common.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_proto/common.proto', + package='diplomacy_proto', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n\x1c\x64iplomacy_proto/common.proto\x12\x0f\x64iplomacy_proto\"\x1b\n\nStringList\x12\r\n\x05value\x18\x01 \x03(\t\"\x1a\n\tBytesList\x12\r\n\x05value\x18\x01 \x03(\x0c\"\x1e\n\tFloatList\x12\x11\n\x05value\x18\x01 \x03(\x02\x42\x02\x10\x01\"\x1c\n\x07IntList\x12\x11\n\x05value\x18\x01 \x03(\x05\x42\x02\x10\x01\"\x1e\n\tInt64List\x12\x11\n\x05value\x18\x01 \x03(\x03\x42\x02\x10\x01\"\x94\x01\n\rMapStringList\x12\x38\n\x05value\x18\x01 \x03(\x0b\x32).diplomacy_proto.MapStringList.ValueEntry\x1aI\n\nValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\x42\x03\xf8\x01\x01\x62\x06proto3') +) + + + + +_STRINGLIST = _descriptor.Descriptor( + name='StringList', + full_name='diplomacy_proto.StringList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.StringList.value', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=49, + serialized_end=76, +) + + +_BYTESLIST = _descriptor.Descriptor( + name='BytesList', + full_name='diplomacy_proto.BytesList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.BytesList.value', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=78, + serialized_end=104, +) + + +_FLOATLIST = _descriptor.Descriptor( + name='FloatList', + full_name='diplomacy_proto.FloatList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.FloatList.value', index=0, + number=1, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=106, + serialized_end=136, +) + + +_INTLIST = _descriptor.Descriptor( + name='IntList', + full_name='diplomacy_proto.IntList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.IntList.value', index=0, + number=1, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=138, + serialized_end=166, +) + + +_INT64LIST = _descriptor.Descriptor( + name='Int64List', + full_name='diplomacy_proto.Int64List', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.Int64List.value', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=168, + serialized_end=198, +) + + +_MAPSTRINGLIST_VALUEENTRY = _descriptor.Descriptor( + name='ValueEntry', + full_name='diplomacy_proto.MapStringList.ValueEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.MapStringList.ValueEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.MapStringList.ValueEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=276, + serialized_end=349, +) + +_MAPSTRINGLIST = _descriptor.Descriptor( + name='MapStringList', + full_name='diplomacy_proto.MapStringList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.MapStringList.value', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_MAPSTRINGLIST_VALUEENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=201, + serialized_end=349, +) + +_MAPSTRINGLIST_VALUEENTRY.fields_by_name['value'].message_type = _STRINGLIST +_MAPSTRINGLIST_VALUEENTRY.containing_type = _MAPSTRINGLIST +_MAPSTRINGLIST.fields_by_name['value'].message_type = _MAPSTRINGLIST_VALUEENTRY +DESCRIPTOR.message_types_by_name['StringList'] = _STRINGLIST +DESCRIPTOR.message_types_by_name['BytesList'] = _BYTESLIST +DESCRIPTOR.message_types_by_name['FloatList'] = _FLOATLIST +DESCRIPTOR.message_types_by_name['IntList'] = _INTLIST +DESCRIPTOR.message_types_by_name['Int64List'] = _INT64LIST +DESCRIPTOR.message_types_by_name['MapStringList'] = _MAPSTRINGLIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +StringList = _reflection.GeneratedProtocolMessageType('StringList', (_message.Message,), dict( + DESCRIPTOR = _STRINGLIST, + __module__ = 'diplomacy_proto.common_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.StringList) + )) +_sym_db.RegisterMessage(StringList) + +BytesList = _reflection.GeneratedProtocolMessageType('BytesList', (_message.Message,), dict( + DESCRIPTOR = _BYTESLIST, + __module__ = 'diplomacy_proto.common_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.BytesList) + )) +_sym_db.RegisterMessage(BytesList) + +FloatList = _reflection.GeneratedProtocolMessageType('FloatList', (_message.Message,), dict( + DESCRIPTOR = _FLOATLIST, + __module__ = 'diplomacy_proto.common_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.FloatList) + )) +_sym_db.RegisterMessage(FloatList) + +IntList = _reflection.GeneratedProtocolMessageType('IntList', (_message.Message,), dict( + DESCRIPTOR = _INTLIST, + __module__ = 'diplomacy_proto.common_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.IntList) + )) +_sym_db.RegisterMessage(IntList) + +Int64List = _reflection.GeneratedProtocolMessageType('Int64List', (_message.Message,), dict( + DESCRIPTOR = _INT64LIST, + __module__ = 'diplomacy_proto.common_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.Int64List) + )) +_sym_db.RegisterMessage(Int64List) + +MapStringList = _reflection.GeneratedProtocolMessageType('MapStringList', (_message.Message,), dict( + + ValueEntry = _reflection.GeneratedProtocolMessageType('ValueEntry', (_message.Message,), dict( + DESCRIPTOR = _MAPSTRINGLIST_VALUEENTRY, + __module__ = 'diplomacy_proto.common_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.MapStringList.ValueEntry) + )) + , + DESCRIPTOR = _MAPSTRINGLIST, + __module__ = 'diplomacy_proto.common_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.MapStringList) + )) +_sym_db.RegisterMessage(MapStringList) +_sym_db.RegisterMessage(MapStringList.ValueEntry) + + +DESCRIPTOR._options = None +_FLOATLIST.fields_by_name['value']._options = None +_INTLIST.fields_by_name['value']._options = None +_INT64LIST.fields_by_name['value']._options = None +_MAPSTRINGLIST_VALUEENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_proto/game.pb.cc b/diplomacy_research/proto/diplomacy_proto/game.pb.cc new file mode 100644 index 0000000..075c24e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/game.pb.cc @@ -0,0 +1,6910 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_proto/game.proto + +#include "diplomacy_proto/game.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5fproto_2fcommon_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fcommon_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FloatList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fcommon_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_StringList; +} // namespace protobuf_diplomacy_5fproto_2fcommon_2eproto +namespace protobuf_diplomacy_5fproto_2fgame_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_PhaseHistory_PolicyDetails; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_PhaseHistory_StateValueEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SavedGame_KeywordArgs; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_State_Builds; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_State_CivilDisorderEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_OrdersEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_PolicyEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_PossibleOrdersEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_ResultsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SavedGame_KwargsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SavedGame_ReturnsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SavedGame_RewardsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_State_BuildsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_State_CentersEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_State_HomesEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_State_InfluenceEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_State_UnitsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<6> scc_info_PhaseHistory; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto ::google::protobuf::internal::SCCInfo<6> scc_info_State; +} // namespace protobuf_diplomacy_5fproto_2fgame_2eproto +namespace diplomacy_proto { +class MessageDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Message_default_instance_; +class State_BuildsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_Builds_default_instance_; +class State_UnitsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_UnitsEntry_DoNotUse_default_instance_; +class State_CentersEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_CentersEntry_DoNotUse_default_instance_; +class State_HomesEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_HomesEntry_DoNotUse_default_instance_; +class State_InfluenceEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_InfluenceEntry_DoNotUse_default_instance_; +class State_CivilDisorderEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_CivilDisorderEntry_DoNotUse_default_instance_; +class State_BuildsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_BuildsEntry_DoNotUse_default_instance_; +class StateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _State_default_instance_; +class PhaseHistory_PolicyDetailsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PhaseHistory_PolicyDetails_default_instance_; +class PhaseHistory_OrdersEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PhaseHistory_OrdersEntry_DoNotUse_default_instance_; +class PhaseHistory_ResultsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PhaseHistory_ResultsEntry_DoNotUse_default_instance_; +class PhaseHistory_PolicyEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PhaseHistory_PolicyEntry_DoNotUse_default_instance_; +class PhaseHistory_StateValueEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PhaseHistory_StateValueEntry_DoNotUse_default_instance_; +class PhaseHistory_PossibleOrdersEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PhaseHistory_PossibleOrdersEntry_DoNotUse_default_instance_; +class PhaseHistoryDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PhaseHistory_default_instance_; +class SavedGame_KeywordArgsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SavedGame_KeywordArgs_default_instance_; +class SavedGame_KwargsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SavedGame_KwargsEntry_DoNotUse_default_instance_; +class SavedGame_RewardsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SavedGame_RewardsEntry_DoNotUse_default_instance_; +class SavedGame_ReturnsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SavedGame_ReturnsEntry_DoNotUse_default_instance_; +class SavedGameDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SavedGame_default_instance_; +} // namespace diplomacy_proto +namespace protobuf_diplomacy_5fproto_2fgame_2eproto { +static void InitDefaultsMessage() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_Message_default_instance_; + new (ptr) ::diplomacy_proto::Message(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::Message::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Message = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMessage}, {}}; + +static void InitDefaultsState_Builds() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_Builds_default_instance_; + new (ptr) ::diplomacy_proto::State_Builds(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::State_Builds::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_State_Builds = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsState_Builds}, {}}; + +static void InitDefaultsState_UnitsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_UnitsEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::State_UnitsEntry_DoNotUse(); + } + ::diplomacy_proto::State_UnitsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_State_UnitsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsState_UnitsEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsState_CentersEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_CentersEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::State_CentersEntry_DoNotUse(); + } + ::diplomacy_proto::State_CentersEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_State_CentersEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsState_CentersEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsState_HomesEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_HomesEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::State_HomesEntry_DoNotUse(); + } + ::diplomacy_proto::State_HomesEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_State_HomesEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsState_HomesEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsState_InfluenceEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_InfluenceEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::State_InfluenceEntry_DoNotUse(); + } + ::diplomacy_proto::State_InfluenceEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_State_InfluenceEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsState_InfluenceEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsState_CivilDisorderEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_CivilDisorderEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::State_CivilDisorderEntry_DoNotUse(); + } + ::diplomacy_proto::State_CivilDisorderEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_State_CivilDisorderEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsState_CivilDisorderEntry_DoNotUse}, {}}; + +static void InitDefaultsState_BuildsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_BuildsEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::State_BuildsEntry_DoNotUse(); + } + ::diplomacy_proto::State_BuildsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_State_BuildsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsState_BuildsEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_Builds.base,}}; + +static void InitDefaultsState() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_State_default_instance_; + new (ptr) ::diplomacy_proto::State(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::State::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<6> scc_info_State = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 6, InitDefaultsState}, { + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_UnitsEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_CentersEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_HomesEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_InfluenceEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_CivilDisorderEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_BuildsEntry_DoNotUse.base,}}; + +static void InitDefaultsPhaseHistory_PolicyDetails() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_PhaseHistory_PolicyDetails_default_instance_; + new (ptr) ::diplomacy_proto::PhaseHistory_PolicyDetails(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::PhaseHistory_PolicyDetails::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_PhaseHistory_PolicyDetails = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsPhaseHistory_PolicyDetails}, {}}; + +static void InitDefaultsPhaseHistory_OrdersEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_PhaseHistory_OrdersEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse(); + } + ::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_OrdersEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsPhaseHistory_OrdersEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsPhaseHistory_ResultsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_PhaseHistory_ResultsEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse(); + } + ::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_ResultsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsPhaseHistory_ResultsEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsPhaseHistory_PolicyEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_PhaseHistory_PolicyEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse(); + } + ::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_PolicyEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsPhaseHistory_PolicyEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_PolicyDetails.base,}}; + +static void InitDefaultsPhaseHistory_StateValueEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_PhaseHistory_StateValueEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse(); + } + ::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_PhaseHistory_StateValueEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsPhaseHistory_StateValueEntry_DoNotUse}, {}}; + +static void InitDefaultsPhaseHistory_PossibleOrdersEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_PhaseHistory_PossibleOrdersEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse(); + } + ::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_PhaseHistory_PossibleOrdersEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsPhaseHistory_PossibleOrdersEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_StringList.base,}}; + +static void InitDefaultsPhaseHistory() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_PhaseHistory_default_instance_; + new (ptr) ::diplomacy_proto::PhaseHistory(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::PhaseHistory::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<6> scc_info_PhaseHistory = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 6, InitDefaultsPhaseHistory}, { + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_OrdersEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_ResultsEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_PolicyEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_StateValueEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_PossibleOrdersEntry_DoNotUse.base,}}; + +static void InitDefaultsSavedGame_KeywordArgs() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_SavedGame_KeywordArgs_default_instance_; + new (ptr) ::diplomacy_proto::SavedGame_KeywordArgs(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::SavedGame_KeywordArgs::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SavedGame_KeywordArgs = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSavedGame_KeywordArgs}, {}}; + +static void InitDefaultsSavedGame_KwargsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_SavedGame_KwargsEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse(); + } + ::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SavedGame_KwargsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSavedGame_KwargsEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame_KeywordArgs.base,}}; + +static void InitDefaultsSavedGame_RewardsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_SavedGame_RewardsEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse(); + } + ::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SavedGame_RewardsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSavedGame_RewardsEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_FloatList.base,}}; + +static void InitDefaultsSavedGame_ReturnsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_SavedGame_ReturnsEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse(); + } + ::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SavedGame_ReturnsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSavedGame_ReturnsEntry_DoNotUse}, { + &protobuf_diplomacy_5fproto_2fcommon_2eproto::scc_info_FloatList.base,}}; + +static void InitDefaultsSavedGame() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy_proto::_SavedGame_default_instance_; + new (ptr) ::diplomacy_proto::SavedGame(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy_proto::SavedGame::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_SavedGame = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsSavedGame}, { + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame_KwargsEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame_RewardsEntry_DoNotUse.base, + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame_ReturnsEntry_DoNotUse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Message.base); + ::google::protobuf::internal::InitSCC(&scc_info_State_Builds.base); + ::google::protobuf::internal::InitSCC(&scc_info_State_UnitsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_State_CentersEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_State_HomesEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_State_InfluenceEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_State_CivilDisorderEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_State_BuildsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_State.base); + ::google::protobuf::internal::InitSCC(&scc_info_PhaseHistory_PolicyDetails.base); + ::google::protobuf::internal::InitSCC(&scc_info_PhaseHistory_OrdersEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_PhaseHistory_ResultsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_PhaseHistory_PolicyEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_PhaseHistory_StateValueEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_PhaseHistory_PossibleOrdersEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_PhaseHistory.base); + ::google::protobuf::internal::InitSCC(&scc_info_SavedGame_KeywordArgs.base); + ::google::protobuf::internal::InitSCC(&scc_info_SavedGame_KwargsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_SavedGame_RewardsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_SavedGame_ReturnsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_SavedGame.base); +} + +::google::protobuf::Metadata file_level_metadata[21]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Message, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Message, sender_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Message, recipient_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Message, time_sent_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Message, phase_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Message, message_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::Message, tokens_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_Builds, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_Builds, count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_Builds, homes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_UnitsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_UnitsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_UnitsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_UnitsEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CentersEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CentersEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CentersEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CentersEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_HomesEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_HomesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_HomesEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_HomesEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_InfluenceEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_InfluenceEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_InfluenceEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_InfluenceEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CivilDisorderEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CivilDisorderEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CivilDisorderEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_CivilDisorderEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_BuildsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_BuildsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_BuildsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State_BuildsEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, game_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, map_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, zobrist_hash_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, rules_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, units_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, centers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, homes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, influence_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, civil_disorder_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, builds_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, note_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::State, board_state_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyDetails, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyDetails, locs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyDetails, tokens_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyDetails, log_probs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyDetails, draw_action_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyDetails, draw_prob_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, orders_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, results_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, policy_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, prev_orders_state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, state_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::PhaseHistory, possible_orders_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KeywordArgs, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KeywordArgs, player_seed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KeywordArgs, noise_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KeywordArgs, temperature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KeywordArgs, dropout_rate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, map_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, rules_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, phases_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, done_reason_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, assigned_powers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, players_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, kwargs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, is_partial_game_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, start_phase_ix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, reward_fn_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, rewards_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy_proto::SavedGame, returns_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy_proto::Message)}, + { 11, -1, sizeof(::diplomacy_proto::State_Builds)}, + { 18, 25, sizeof(::diplomacy_proto::State_UnitsEntry_DoNotUse)}, + { 27, 34, sizeof(::diplomacy_proto::State_CentersEntry_DoNotUse)}, + { 36, 43, sizeof(::diplomacy_proto::State_HomesEntry_DoNotUse)}, + { 45, 52, sizeof(::diplomacy_proto::State_InfluenceEntry_DoNotUse)}, + { 54, 61, sizeof(::diplomacy_proto::State_CivilDisorderEntry_DoNotUse)}, + { 63, 70, sizeof(::diplomacy_proto::State_BuildsEntry_DoNotUse)}, + { 72, -1, sizeof(::diplomacy_proto::State)}, + { 90, -1, sizeof(::diplomacy_proto::PhaseHistory_PolicyDetails)}, + { 100, 107, sizeof(::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse)}, + { 109, 116, sizeof(::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse)}, + { 118, 125, sizeof(::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse)}, + { 127, 134, sizeof(::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse)}, + { 136, 143, sizeof(::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse)}, + { 145, -1, sizeof(::diplomacy_proto::PhaseHistory)}, + { 158, -1, sizeof(::diplomacy_proto::SavedGame_KeywordArgs)}, + { 167, 174, sizeof(::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse)}, + { 176, 183, sizeof(::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse)}, + { 185, 192, sizeof(::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse)}, + { 194, -1, sizeof(::diplomacy_proto::SavedGame)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy_proto::_Message_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_Builds_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_UnitsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_CentersEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_HomesEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_InfluenceEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_CivilDisorderEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_BuildsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_State_default_instance_), + reinterpret_cast(&::diplomacy_proto::_PhaseHistory_PolicyDetails_default_instance_), + reinterpret_cast(&::diplomacy_proto::_PhaseHistory_OrdersEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_PhaseHistory_ResultsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_PhaseHistory_PolicyEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_PhaseHistory_StateValueEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_PhaseHistory_PossibleOrdersEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_PhaseHistory_default_instance_), + reinterpret_cast(&::diplomacy_proto::_SavedGame_KeywordArgs_default_instance_), + reinterpret_cast(&::diplomacy_proto::_SavedGame_KwargsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_SavedGame_RewardsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_SavedGame_ReturnsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy_proto::_SavedGame_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_proto/game.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 21); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\032diplomacy_proto/game.proto\022\017diplomacy_" + "proto\032\034diplomacy_proto/common.proto\"s\n\007M" + "essage\022\016\n\006sender\030\001 \001(\t\022\021\n\trecipient\030\002 \001(" + "\t\022\021\n\ttime_sent\030\003 \001(\003\022\r\n\005phase\030\004 \001(\t\022\017\n\007m" + "essage\030\005 \001(\t\022\022\n\006tokens\030\006 \003(\rB\002\020\001\"\250\007\n\005Sta" + "te\022\017\n\007game_id\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\013\n\003map" + "\030\003 \001(\t\022\024\n\014zobrist_hash\030\r \001(\t\022\r\n\005rules\030\004 " + "\003(\t\0220\n\005units\030\005 \003(\0132!.diplomacy_proto.Sta" + "te.UnitsEntry\0224\n\007centers\030\006 \003(\0132#.diploma" + "cy_proto.State.CentersEntry\0220\n\005homes\030\007 \003" + "(\0132!.diplomacy_proto.State.HomesEntry\0228\n" + "\tinfluence\030\010 \003(\0132%.diplomacy_proto.State" + ".InfluenceEntry\022A\n\016civil_disorder\030\t \003(\0132" + ").diplomacy_proto.State.CivilDisorderEnt" + "ry\0222\n\006builds\030\n \003(\0132\".diplomacy_proto.Sta" + "te.BuildsEntry\022\014\n\004note\030\013 \001(\t\022\027\n\013board_st" + "ate\030\014 \003(\rB\002\020\001\032&\n\006Builds\022\r\n\005count\030\001 \001(\005\022\r" + "\n\005homes\030\002 \003(\t\032I\n\nUnitsEntry\022\013\n\003key\030\001 \001(\t" + "\022*\n\005value\030\002 \001(\0132\033.diplomacy_proto.String" + "List:\0028\001\032K\n\014CentersEntry\022\013\n\003key\030\001 \001(\t\022*\n" + "\005value\030\002 \001(\0132\033.diplomacy_proto.StringLis" + "t:\0028\001\032I\n\nHomesEntry\022\013\n\003key\030\001 \001(\t\022*\n\005valu" + "e\030\002 \001(\0132\033.diplomacy_proto.StringList:\0028\001" + "\032M\n\016InfluenceEntry\022\013\n\003key\030\001 \001(\t\022*\n\005value" + "\030\002 \001(\0132\033.diplomacy_proto.StringList:\0028\001\032" + "4\n\022CivilDisorderEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + "lue\030\002 \001(\005:\0028\001\032L\n\013BuildsEntry\022\013\n\003key\030\001 \001(" + "\t\022,\n\005value\030\002 \001(\0132\035.diplomacy_proto.State" + ".Builds:\0028\001\"\217\007\n\014PhaseHistory\022\014\n\004name\030\001 \001" + "(\t\022%\n\005state\030\002 \001(\0132\026.diplomacy_proto.Stat" + "e\0229\n\006orders\030\003 \003(\0132).diplomacy_proto.Phas" + "eHistory.OrdersEntry\022;\n\007results\030\004 \003(\0132*." + "diplomacy_proto.PhaseHistory.ResultsEntr" + "y\0229\n\006policy\030\006 \003(\0132).diplomacy_proto.Phas" + "eHistory.PolicyEntry\022\035\n\021prev_orders_stat" + "e\030\010 \003(\rB\002\020\001\022B\n\013state_value\030\t \003(\0132-.diplo" + "macy_proto.PhaseHistory.StateValueEntry\022" + "J\n\017possible_orders\030\007 \003(\01321.diplomacy_pro" + "to.PhaseHistory.PossibleOrdersEntry\032l\n\rP" + "olicyDetails\022\014\n\004locs\030\001 \003(\t\022\016\n\006tokens\030\002 \003" + "(\005\022\025\n\tlog_probs\030\003 \003(\002B\002\020\001\022\023\n\013draw_action" + "\030\004 \001(\010\022\021\n\tdraw_prob\030\005 \001(\002\032J\n\013OrdersEntry" + "\022\013\n\003key\030\001 \001(\t\022*\n\005value\030\002 \001(\0132\033.diplomacy" + "_proto.StringList:\0028\001\032K\n\014ResultsEntry\022\013\n" + "\003key\030\001 \001(\t\022*\n\005value\030\002 \001(\0132\033.diplomacy_pr" + "oto.StringList:\0028\001\032Z\n\013PolicyEntry\022\013\n\003key" + "\030\001 \001(\t\022:\n\005value\030\002 \001(\0132+.diplomacy_proto." + "PhaseHistory.PolicyDetails:\0028\001\0321\n\017StateV" + "alueEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028" + "\001\032R\n\023PossibleOrdersEntry\022\013\n\003key\030\001 \001(\t\022*\n" + "\005value\030\002 \001(\0132\033.diplomacy_proto.StringLis" + "t:\0028\001\"\344\005\n\tSavedGame\022\n\n\002id\030\001 \001(\t\022\013\n\003map\030\002" + " \001(\t\022\r\n\005rules\030\003 \003(\t\022-\n\006phases\030\004 \003(\0132\035.di" + "plomacy_proto.PhaseHistory\022\023\n\013done_reaso" + "n\030\006 \001(\t\022\027\n\017assigned_powers\030\005 \003(\t\022\017\n\007play" + "ers\030\013 \003(\t\0226\n\006kwargs\030\n \003(\0132&.diplomacy_pr" + "oto.SavedGame.KwargsEntry\022\027\n\017is_partial_" + "game\030\014 \001(\010\022\026\n\016start_phase_ix\030\t \001(\005\022\021\n\tre" + "ward_fn\030\007 \001(\t\0228\n\007rewards\030\010 \003(\0132\'.diploma" + "cy_proto.SavedGame.RewardsEntry\0228\n\007retur" + "ns\030\r \003(\0132\'.diplomacy_proto.SavedGame.Ret" + "urnsEntry\032b\n\013KeywordArgs\022\023\n\013player_seed\030" + "\001 \001(\005\022\r\n\005noise\030\002 \001(\002\022\023\n\013temperature\030\003 \001(" + "\002\022\024\n\014dropout_rate\030\005 \001(\002J\004\010\004\020\005\032U\n\013KwargsE" + "ntry\022\013\n\003key\030\001 \001(\t\0225\n\005value\030\002 \001(\0132&.diplo" + "macy_proto.SavedGame.KeywordArgs:\0028\001\032J\n\014" + "RewardsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\013" + "2\032.diplomacy_proto.FloatList:\0028\001\032J\n\014Retu" + "rnsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.d" + "iplomacy_proto.FloatList:\0028\001B\003\370\001\001b\006proto" + "3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 2801); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_proto/game.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5fproto_2fcommon_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5fproto_2fgame_2eproto +namespace diplomacy_proto { + +// =================================================================== + +void Message::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Message::kSenderFieldNumber; +const int Message::kRecipientFieldNumber; +const int Message::kTimeSentFieldNumber; +const int Message::kPhaseFieldNumber; +const int Message::kMessageFieldNumber; +const int Message::kTokensFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Message::Message() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_Message.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.Message) +} +Message::Message(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + tokens_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_Message.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.Message) +} +Message::Message(const Message& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + tokens_(from.tokens_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + sender_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.sender().size() > 0) { + sender_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sender(), + GetArenaNoVirtual()); + } + recipient_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.recipient().size() > 0) { + recipient_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.recipient(), + GetArenaNoVirtual()); + } + phase_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.phase().size() > 0) { + phase_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.phase(), + GetArenaNoVirtual()); + } + message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.message().size() > 0) { + message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message(), + GetArenaNoVirtual()); + } + time_sent_ = from.time_sent_; + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.Message) +} + +void Message::SharedCtor() { + sender_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + recipient_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + time_sent_ = GOOGLE_LONGLONG(0); +} + +Message::~Message() { + // @@protoc_insertion_point(destructor:diplomacy_proto.Message) + SharedDtor(); +} + +void Message::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + sender_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + recipient_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Message::ArenaDtor(void* object) { + Message* _this = reinterpret_cast< Message* >(object); + (void)_this; +} +void Message::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Message::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Message::descriptor() { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Message& Message::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_Message.base); + return *internal_default_instance(); +} + + +void Message::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.Message) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tokens_.Clear(); + sender_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + recipient_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + phase_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + message_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + time_sent_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool Message::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.Message) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string sender = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_sender())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->sender().data(), static_cast(this->sender().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.Message.sender")); + } else { + goto handle_unusual; + } + break; + } + + // string recipient = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_recipient())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->recipient().data(), static_cast(this->recipient().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.Message.recipient")); + } else { + goto handle_unusual; + } + break; + } + + // int64 time_sent = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &time_sent_))); + } else { + goto handle_unusual; + } + break; + } + + // string phase = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_phase())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->phase().data(), static_cast(this->phase().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.Message.phase")); + } else { + goto handle_unusual; + } + break; + } + + // string message = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->message().data(), static_cast(this->message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.Message.message")); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 tokens = 6 [packed = true]; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_tokens()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 50u, input, this->mutable_tokens()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.Message) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.Message) + return false; +#undef DO_ +} + +void Message::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.Message) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string sender = 1; + if (this->sender().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->sender().data(), static_cast(this->sender().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.sender"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->sender(), output); + } + + // string recipient = 2; + if (this->recipient().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->recipient().data(), static_cast(this->recipient().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.recipient"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->recipient(), output); + } + + // int64 time_sent = 3; + if (this->time_sent() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->time_sent(), output); + } + + // string phase = 4; + if (this->phase().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->phase().data(), static_cast(this->phase().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.phase"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->phase(), output); + } + + // string message = 5; + if (this->message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->message().data(), static_cast(this->message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->message(), output); + } + + // repeated uint32 tokens = 6 [packed = true]; + if (this->tokens_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _tokens_cached_byte_size_)); + } + for (int i = 0, n = this->tokens_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->tokens(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.Message) +} + +::google::protobuf::uint8* Message::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.Message) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string sender = 1; + if (this->sender().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->sender().data(), static_cast(this->sender().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.sender"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->sender(), target); + } + + // string recipient = 2; + if (this->recipient().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->recipient().data(), static_cast(this->recipient().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.recipient"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->recipient(), target); + } + + // int64 time_sent = 3; + if (this->time_sent() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->time_sent(), target); + } + + // string phase = 4; + if (this->phase().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->phase().data(), static_cast(this->phase().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.phase"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->phase(), target); + } + + // string message = 5; + if (this->message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->message().data(), static_cast(this->message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.Message.message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->message(), target); + } + + // repeated uint32 tokens = 6 [packed = true]; + if (this->tokens_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _tokens_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->tokens_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.Message) + return target; +} + +size_t Message::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.Message) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated uint32 tokens = 6 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->tokens_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _tokens_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string sender = 1; + if (this->sender().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->sender()); + } + + // string recipient = 2; + if (this->recipient().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->recipient()); + } + + // string phase = 4; + if (this->phase().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->phase()); + } + + // string message = 5; + if (this->message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->message()); + } + + // int64 time_sent = 3; + if (this->time_sent() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->time_sent()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Message::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.Message) + GOOGLE_DCHECK_NE(&from, this); + const Message* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.Message) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.Message) + MergeFrom(*source); + } +} + +void Message::MergeFrom(const Message& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.Message) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + tokens_.MergeFrom(from.tokens_); + if (from.sender().size() > 0) { + set_sender(from.sender()); + } + if (from.recipient().size() > 0) { + set_recipient(from.recipient()); + } + if (from.phase().size() > 0) { + set_phase(from.phase()); + } + if (from.message().size() > 0) { + set_message(from.message()); + } + if (from.time_sent() != 0) { + set_time_sent(from.time_sent()); + } +} + +void Message::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.Message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Message::CopyFrom(const Message& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.Message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Message::IsInitialized() const { + return true; +} + +void Message::Swap(Message* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Message* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Message::UnsafeArenaSwap(Message* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Message::InternalSwap(Message* other) { + using std::swap; + tokens_.InternalSwap(&other->tokens_); + sender_.Swap(&other->sender_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + recipient_.Swap(&other->recipient_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + phase_.Swap(&other->phase_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + message_.Swap(&other->message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(time_sent_, other->time_sent_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Message::GetMetadata() const { + protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void State_Builds::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int State_Builds::kCountFieldNumber; +const int State_Builds::kHomesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +State_Builds::State_Builds() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_Builds.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.State.Builds) +} +State_Builds::State_Builds(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + homes_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_Builds.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.State.Builds) +} +State_Builds::State_Builds(const State_Builds& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + homes_(from.homes_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + count_ = from.count_; + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.State.Builds) +} + +void State_Builds::SharedCtor() { + count_ = 0; +} + +State_Builds::~State_Builds() { + // @@protoc_insertion_point(destructor:diplomacy_proto.State.Builds) + SharedDtor(); +} + +void State_Builds::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void State_Builds::ArenaDtor(void* object) { + State_Builds* _this = reinterpret_cast< State_Builds* >(object); + (void)_this; +} +void State_Builds::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void State_Builds::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* State_Builds::descriptor() { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const State_Builds& State_Builds::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State_Builds.base); + return *internal_default_instance(); +} + + +void State_Builds::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.State.Builds) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + homes_.Clear(); + count_ = 0; + _internal_metadata_.Clear(); +} + +bool State_Builds::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.State.Builds) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 count = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &count_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated string homes = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_homes())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->homes(this->homes_size() - 1).data(), + static_cast(this->homes(this->homes_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.Builds.homes")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.State.Builds) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.State.Builds) + return false; +#undef DO_ +} + +void State_Builds::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.State.Builds) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 count = 1; + if (this->count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->count(), output); + } + + // repeated string homes = 2; + for (int i = 0, n = this->homes_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->homes(i).data(), static_cast(this->homes(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.Builds.homes"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->homes(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.State.Builds) +} + +::google::protobuf::uint8* State_Builds::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.State.Builds) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 count = 1; + if (this->count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->count(), target); + } + + // repeated string homes = 2; + for (int i = 0, n = this->homes_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->homes(i).data(), static_cast(this->homes(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.Builds.homes"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(2, this->homes(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.State.Builds) + return target; +} + +size_t State_Builds::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.State.Builds) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string homes = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->homes_size()); + for (int i = 0, n = this->homes_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->homes(i)); + } + + // int32 count = 1; + if (this->count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->count()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void State_Builds::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.State.Builds) + GOOGLE_DCHECK_NE(&from, this); + const State_Builds* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.State.Builds) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.State.Builds) + MergeFrom(*source); + } +} + +void State_Builds::MergeFrom(const State_Builds& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.State.Builds) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + homes_.MergeFrom(from.homes_); + if (from.count() != 0) { + set_count(from.count()); + } +} + +void State_Builds::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.State.Builds) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void State_Builds::CopyFrom(const State_Builds& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.State.Builds) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool State_Builds::IsInitialized() const { + return true; +} + +void State_Builds::Swap(State_Builds* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + State_Builds* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void State_Builds::UnsafeArenaSwap(State_Builds* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void State_Builds::InternalSwap(State_Builds* other) { + using std::swap; + homes_.InternalSwap(CastToBase(&other->homes_)); + swap(count_, other->count_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata State_Builds::GetMetadata() const { + protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +State_UnitsEntry_DoNotUse::State_UnitsEntry_DoNotUse() {} +State_UnitsEntry_DoNotUse::State_UnitsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void State_UnitsEntry_DoNotUse::MergeFrom(const State_UnitsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata State_UnitsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[2]; +} +void State_UnitsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +State_CentersEntry_DoNotUse::State_CentersEntry_DoNotUse() {} +State_CentersEntry_DoNotUse::State_CentersEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void State_CentersEntry_DoNotUse::MergeFrom(const State_CentersEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata State_CentersEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[3]; +} +void State_CentersEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +State_HomesEntry_DoNotUse::State_HomesEntry_DoNotUse() {} +State_HomesEntry_DoNotUse::State_HomesEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void State_HomesEntry_DoNotUse::MergeFrom(const State_HomesEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata State_HomesEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[4]; +} +void State_HomesEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +State_InfluenceEntry_DoNotUse::State_InfluenceEntry_DoNotUse() {} +State_InfluenceEntry_DoNotUse::State_InfluenceEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void State_InfluenceEntry_DoNotUse::MergeFrom(const State_InfluenceEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata State_InfluenceEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[5]; +} +void State_InfluenceEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +State_CivilDisorderEntry_DoNotUse::State_CivilDisorderEntry_DoNotUse() {} +State_CivilDisorderEntry_DoNotUse::State_CivilDisorderEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void State_CivilDisorderEntry_DoNotUse::MergeFrom(const State_CivilDisorderEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata State_CivilDisorderEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[6]; +} +void State_CivilDisorderEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +State_BuildsEntry_DoNotUse::State_BuildsEntry_DoNotUse() {} +State_BuildsEntry_DoNotUse::State_BuildsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void State_BuildsEntry_DoNotUse::MergeFrom(const State_BuildsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata State_BuildsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[7]; +} +void State_BuildsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void State::InitAsDefaultInstance() { +} +void State::clear_units() { + units_.Clear(); +} +void State::clear_centers() { + centers_.Clear(); +} +void State::clear_homes() { + homes_.Clear(); +} +void State::clear_influence() { + influence_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int State::kGameIdFieldNumber; +const int State::kNameFieldNumber; +const int State::kMapFieldNumber; +const int State::kZobristHashFieldNumber; +const int State::kRulesFieldNumber; +const int State::kUnitsFieldNumber; +const int State::kCentersFieldNumber; +const int State::kHomesFieldNumber; +const int State::kInfluenceFieldNumber; +const int State::kCivilDisorderFieldNumber; +const int State::kBuildsFieldNumber; +const int State::kNoteFieldNumber; +const int State::kBoardStateFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +State::State() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.State) +} +State::State(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + rules_(arena), + units_(arena), + centers_(arena), + homes_(arena), + influence_(arena), + civil_disorder_(arena), + builds_(arena), + board_state_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.State) +} +State::State(const State& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + rules_(from.rules_), + board_state_(from.board_state_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + units_.MergeFrom(from.units_); + centers_.MergeFrom(from.centers_); + homes_.MergeFrom(from.homes_); + influence_.MergeFrom(from.influence_); + civil_disorder_.MergeFrom(from.civil_disorder_); + builds_.MergeFrom(from.builds_); + game_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.game_id().size() > 0) { + game_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.game_id(), + GetArenaNoVirtual()); + } + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + map_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.map().size() > 0) { + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.map(), + GetArenaNoVirtual()); + } + note_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.note().size() > 0) { + note_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.note(), + GetArenaNoVirtual()); + } + zobrist_hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.zobrist_hash().size() > 0) { + zobrist_hash_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.zobrist_hash(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.State) +} + +void State::SharedCtor() { + game_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + map_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + note_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + zobrist_hash_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +State::~State() { + // @@protoc_insertion_point(destructor:diplomacy_proto.State) + SharedDtor(); +} + +void State::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + game_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + map_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + note_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + zobrist_hash_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void State::ArenaDtor(void* object) { + State* _this = reinterpret_cast< State* >(object); + (void)_this; +} +void State::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void State::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* State::descriptor() { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const State& State::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_State.base); + return *internal_default_instance(); +} + + +void State::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.State) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + rules_.Clear(); + units_.Clear(); + centers_.Clear(); + homes_.Clear(); + influence_.Clear(); + civil_disorder_.Clear(); + builds_.Clear(); + board_state_.Clear(); + game_id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + map_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + note_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + zobrist_hash_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool State::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.State) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string game_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_game_id())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->game_id().data(), static_cast(this->game_id().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.game_id")); + } else { + goto handle_unusual; + } + break; + } + + // string name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.name")); + } else { + goto handle_unusual; + } + break; + } + + // string map = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_map())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->map().data(), static_cast(this->map().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.map")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string rules = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_rules())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rules(this->rules_size() - 1).data(), + static_cast(this->rules(this->rules_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.rules")); + } else { + goto handle_unusual; + } + break; + } + + // map units = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + State_UnitsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + State_UnitsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(&units_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.UnitsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map centers = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + State_CentersEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + State_CentersEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(¢ers_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.CentersEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map homes = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + State_HomesEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + State_HomesEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(&homes_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.HomesEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map influence = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + State_InfluenceEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + State_InfluenceEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(&influence_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.InfluenceEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map civil_disorder = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + State_CivilDisorderEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + State_CivilDisorderEntry_DoNotUse, + ::std::string, ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32, + 0 >, + ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 > > parser(&civil_disorder_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.CivilDisorderEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map builds = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + State_BuildsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + State_BuildsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::State_Builds, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds > > parser(&builds_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.BuildsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // string note = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_note())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->note().data(), static_cast(this->note().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.note")); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 board_state = 12 [packed = true]; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_board_state()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 98u, input, this->mutable_board_state()))); + } else { + goto handle_unusual; + } + break; + } + + // string zobrist_hash = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_zobrist_hash())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->zobrist_hash().data(), static_cast(this->zobrist_hash().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.State.zobrist_hash")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.State) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.State) + return false; +#undef DO_ +} + +void State::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.State) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string game_id = 1; + if (this->game_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->game_id().data(), static_cast(this->game_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.game_id"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->game_id(), output); + } + + // string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->name(), output); + } + + // string map = 3; + if (this->map().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->map().data(), static_cast(this->map().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.map"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->map(), output); + } + + // repeated string rules = 4; + for (int i = 0, n = this->rules_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rules(i).data(), static_cast(this->rules(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.rules"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 4, this->rules(i), output); + } + + // map units = 5; + if (!this->units().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.UnitsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->units().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->units().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->units().begin(); + it != this->units().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(units_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->units().begin(); + it != this->units().end(); ++it) { + entry.reset(units_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map centers = 6; + if (!this->centers().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.CentersEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->centers().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->centers().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->centers().begin(); + it != this->centers().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(centers_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->centers().begin(); + it != this->centers().end(); ++it) { + entry.reset(centers_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map homes = 7; + if (!this->homes().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.HomesEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->homes().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->homes().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->homes().begin(); + it != this->homes().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(homes_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->homes().begin(); + it != this->homes().end(); ++it) { + entry.reset(homes_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map influence = 8; + if (!this->influence().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.InfluenceEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->influence().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->influence().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->influence().begin(); + it != this->influence().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(influence_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->influence().begin(); + it != this->influence().end(); ++it) { + entry.reset(influence_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map civil_disorder = 9; + if (!this->civil_disorder().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.CivilDisorderEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->civil_disorder().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->civil_disorder().size()]); + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::const_iterator + it = this->civil_disorder().begin(); + it != this->civil_disorder().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(civil_disorder_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::const_iterator + it = this->civil_disorder().begin(); + it != this->civil_disorder().end(); ++it) { + entry.reset(civil_disorder_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map builds = 10; + if (!this->builds().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.BuildsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->builds().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->builds().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::const_iterator + it = this->builds().begin(); + it != this->builds().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(builds_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::const_iterator + it = this->builds().begin(); + it != this->builds().end(); ++it) { + entry.reset(builds_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // string note = 11; + if (this->note().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->note().data(), static_cast(this->note().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.note"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 11, this->note(), output); + } + + // repeated uint32 board_state = 12 [packed = true]; + if (this->board_state_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _board_state_cached_byte_size_)); + } + for (int i = 0, n = this->board_state_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->board_state(i), output); + } + + // string zobrist_hash = 13; + if (this->zobrist_hash().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->zobrist_hash().data(), static_cast(this->zobrist_hash().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.zobrist_hash"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 13, this->zobrist_hash(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.State) +} + +::google::protobuf::uint8* State::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.State) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string game_id = 1; + if (this->game_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->game_id().data(), static_cast(this->game_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.game_id"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->game_id(), target); + } + + // string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->name(), target); + } + + // string map = 3; + if (this->map().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->map().data(), static_cast(this->map().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.map"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->map(), target); + } + + // repeated string rules = 4; + for (int i = 0, n = this->rules_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rules(i).data(), static_cast(this->rules(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.rules"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(4, this->rules(i), target); + } + + // map units = 5; + if (!this->units().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.UnitsEntry.key"); + } + }; + + if (deterministic && + this->units().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->units().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->units().begin(); + it != this->units().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(units_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->units().begin(); + it != this->units().end(); ++it) { + entry.reset(units_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map centers = 6; + if (!this->centers().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.CentersEntry.key"); + } + }; + + if (deterministic && + this->centers().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->centers().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->centers().begin(); + it != this->centers().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(centers_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->centers().begin(); + it != this->centers().end(); ++it) { + entry.reset(centers_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map homes = 7; + if (!this->homes().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.HomesEntry.key"); + } + }; + + if (deterministic && + this->homes().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->homes().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->homes().begin(); + it != this->homes().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(homes_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->homes().begin(); + it != this->homes().end(); ++it) { + entry.reset(homes_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map influence = 8; + if (!this->influence().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.InfluenceEntry.key"); + } + }; + + if (deterministic && + this->influence().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->influence().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->influence().begin(); + it != this->influence().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(influence_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->influence().begin(); + it != this->influence().end(); ++it) { + entry.reset(influence_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map civil_disorder = 9; + if (!this->civil_disorder().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.CivilDisorderEntry.key"); + } + }; + + if (deterministic && + this->civil_disorder().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->civil_disorder().size()]); + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::const_iterator + it = this->civil_disorder().begin(); + it != this->civil_disorder().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(civil_disorder_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::const_iterator + it = this->civil_disorder().begin(); + it != this->civil_disorder().end(); ++it) { + entry.reset(civil_disorder_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map builds = 10; + if (!this->builds().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.BuildsEntry.key"); + } + }; + + if (deterministic && + this->builds().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->builds().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::const_iterator + it = this->builds().begin(); + it != this->builds().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(builds_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 10, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::const_iterator + it = this->builds().begin(); + it != this->builds().end(); ++it) { + entry.reset(builds_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 10, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // string note = 11; + if (this->note().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->note().data(), static_cast(this->note().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.note"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 11, this->note(), target); + } + + // repeated uint32 board_state = 12 [packed = true]; + if (this->board_state_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 12, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _board_state_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->board_state_, target); + } + + // string zobrist_hash = 13; + if (this->zobrist_hash().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->zobrist_hash().data(), static_cast(this->zobrist_hash().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.State.zobrist_hash"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 13, this->zobrist_hash(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.State) + return target; +} + +size_t State::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.State) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string rules = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->rules_size()); + for (int i = 0, n = this->rules_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->rules(i)); + } + + // map units = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->units_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->units().begin(); + it != this->units().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(units_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map centers = 6; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->centers_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->centers().begin(); + it != this->centers().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(centers_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map homes = 7; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->homes_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->homes().begin(); + it != this->homes().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(homes_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map influence = 8; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->influence_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->influence().begin(); + it != this->influence().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(influence_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map civil_disorder = 9; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->civil_disorder_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >::const_iterator + it = this->civil_disorder().begin(); + it != this->civil_disorder().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(civil_disorder_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map builds = 10; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->builds_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >::const_iterator + it = this->builds().begin(); + it != this->builds().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(builds_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // repeated uint32 board_state = 12 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->board_state_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _board_state_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string game_id = 1; + if (this->game_id().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->game_id()); + } + + // string name = 2; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string map = 3; + if (this->map().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->map()); + } + + // string note = 11; + if (this->note().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->note()); + } + + // string zobrist_hash = 13; + if (this->zobrist_hash().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->zobrist_hash()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void State::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.State) + GOOGLE_DCHECK_NE(&from, this); + const State* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.State) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.State) + MergeFrom(*source); + } +} + +void State::MergeFrom(const State& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.State) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + rules_.MergeFrom(from.rules_); + units_.MergeFrom(from.units_); + centers_.MergeFrom(from.centers_); + homes_.MergeFrom(from.homes_); + influence_.MergeFrom(from.influence_); + civil_disorder_.MergeFrom(from.civil_disorder_); + builds_.MergeFrom(from.builds_); + board_state_.MergeFrom(from.board_state_); + if (from.game_id().size() > 0) { + set_game_id(from.game_id()); + } + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.map().size() > 0) { + set_map(from.map()); + } + if (from.note().size() > 0) { + set_note(from.note()); + } + if (from.zobrist_hash().size() > 0) { + set_zobrist_hash(from.zobrist_hash()); + } +} + +void State::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.State) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void State::CopyFrom(const State& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.State) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool State::IsInitialized() const { + return true; +} + +void State::Swap(State* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + State* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void State::UnsafeArenaSwap(State* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void State::InternalSwap(State* other) { + using std::swap; + rules_.InternalSwap(CastToBase(&other->rules_)); + units_.Swap(&other->units_); + centers_.Swap(&other->centers_); + homes_.Swap(&other->homes_); + influence_.Swap(&other->influence_); + civil_disorder_.Swap(&other->civil_disorder_); + builds_.Swap(&other->builds_); + board_state_.InternalSwap(&other->board_state_); + game_id_.Swap(&other->game_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + map_.Swap(&other->map_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + note_.Swap(&other->note_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + zobrist_hash_.Swap(&other->zobrist_hash_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata State::GetMetadata() const { + protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void PhaseHistory_PolicyDetails::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PhaseHistory_PolicyDetails::kLocsFieldNumber; +const int PhaseHistory_PolicyDetails::kTokensFieldNumber; +const int PhaseHistory_PolicyDetails::kLogProbsFieldNumber; +const int PhaseHistory_PolicyDetails::kDrawActionFieldNumber; +const int PhaseHistory_PolicyDetails::kDrawProbFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PhaseHistory_PolicyDetails::PhaseHistory_PolicyDetails() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_PolicyDetails.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.PhaseHistory.PolicyDetails) +} +PhaseHistory_PolicyDetails::PhaseHistory_PolicyDetails(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + locs_(arena), + tokens_(arena), + log_probs_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_PolicyDetails.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.PhaseHistory.PolicyDetails) +} +PhaseHistory_PolicyDetails::PhaseHistory_PolicyDetails(const PhaseHistory_PolicyDetails& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + locs_(from.locs_), + tokens_(from.tokens_), + log_probs_(from.log_probs_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&draw_action_, &from.draw_action_, + static_cast(reinterpret_cast(&draw_prob_) - + reinterpret_cast(&draw_action_)) + sizeof(draw_prob_)); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.PhaseHistory.PolicyDetails) +} + +void PhaseHistory_PolicyDetails::SharedCtor() { + ::memset(&draw_action_, 0, static_cast( + reinterpret_cast(&draw_prob_) - + reinterpret_cast(&draw_action_)) + sizeof(draw_prob_)); +} + +PhaseHistory_PolicyDetails::~PhaseHistory_PolicyDetails() { + // @@protoc_insertion_point(destructor:diplomacy_proto.PhaseHistory.PolicyDetails) + SharedDtor(); +} + +void PhaseHistory_PolicyDetails::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void PhaseHistory_PolicyDetails::ArenaDtor(void* object) { + PhaseHistory_PolicyDetails* _this = reinterpret_cast< PhaseHistory_PolicyDetails* >(object); + (void)_this; +} +void PhaseHistory_PolicyDetails::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void PhaseHistory_PolicyDetails::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* PhaseHistory_PolicyDetails::descriptor() { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const PhaseHistory_PolicyDetails& PhaseHistory_PolicyDetails::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory_PolicyDetails.base); + return *internal_default_instance(); +} + + +void PhaseHistory_PolicyDetails::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.PhaseHistory.PolicyDetails) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + locs_.Clear(); + tokens_.Clear(); + log_probs_.Clear(); + ::memset(&draw_action_, 0, static_cast( + reinterpret_cast(&draw_prob_) - + reinterpret_cast(&draw_action_)) + sizeof(draw_prob_)); + _internal_metadata_.Clear(); +} + +bool PhaseHistory_PolicyDetails::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.PhaseHistory.PolicyDetails) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated string locs = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_locs())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->locs(this->locs_size() - 1).data(), + static_cast(this->locs(this->locs_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.PhaseHistory.PolicyDetails.locs")); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 tokens = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_tokens()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 18u, input, this->mutable_tokens()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated float log_probs = 3 [packed = true]; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_log_probs()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 26u, input, this->mutable_log_probs()))); + } else { + goto handle_unusual; + } + break; + } + + // bool draw_action = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &draw_action_))); + } else { + goto handle_unusual; + } + break; + } + + // float draw_prob = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &draw_prob_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.PhaseHistory.PolicyDetails) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.PhaseHistory.PolicyDetails) + return false; +#undef DO_ +} + +void PhaseHistory_PolicyDetails::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.PhaseHistory.PolicyDetails) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string locs = 1; + for (int i = 0, n = this->locs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->locs(i).data(), static_cast(this->locs(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.PolicyDetails.locs"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1, this->locs(i), output); + } + + // repeated int32 tokens = 2; + if (this->tokens_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _tokens_cached_byte_size_)); + } + for (int i = 0, n = this->tokens_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->tokens(i), output); + } + + // repeated float log_probs = 3 [packed = true]; + if (this->log_probs_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _log_probs_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->log_probs().data(), this->log_probs_size(), output); + } + + // bool draw_action = 4; + if (this->draw_action() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->draw_action(), output); + } + + // float draw_prob = 5; + if (this->draw_prob() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->draw_prob(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.PhaseHistory.PolicyDetails) +} + +::google::protobuf::uint8* PhaseHistory_PolicyDetails::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.PhaseHistory.PolicyDetails) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string locs = 1; + for (int i = 0, n = this->locs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->locs(i).data(), static_cast(this->locs(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.PolicyDetails.locs"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1, this->locs(i), target); + } + + // repeated int32 tokens = 2; + if (this->tokens_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _tokens_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->tokens_, target); + } + + // repeated float log_probs = 3 [packed = true]; + if (this->log_probs_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _log_probs_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->log_probs_, target); + } + + // bool draw_action = 4; + if (this->draw_action() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->draw_action(), target); + } + + // float draw_prob = 5; + if (this->draw_prob() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->draw_prob(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.PhaseHistory.PolicyDetails) + return target; +} + +size_t PhaseHistory_PolicyDetails::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.PhaseHistory.PolicyDetails) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string locs = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->locs_size()); + for (int i = 0, n = this->locs_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->locs(i)); + } + + // repeated int32 tokens = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->tokens_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _tokens_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float log_probs = 3 [packed = true]; + { + unsigned int count = static_cast(this->log_probs_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _log_probs_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // bool draw_action = 4; + if (this->draw_action() != 0) { + total_size += 1 + 1; + } + + // float draw_prob = 5; + if (this->draw_prob() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PhaseHistory_PolicyDetails::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.PhaseHistory.PolicyDetails) + GOOGLE_DCHECK_NE(&from, this); + const PhaseHistory_PolicyDetails* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.PhaseHistory.PolicyDetails) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.PhaseHistory.PolicyDetails) + MergeFrom(*source); + } +} + +void PhaseHistory_PolicyDetails::MergeFrom(const PhaseHistory_PolicyDetails& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.PhaseHistory.PolicyDetails) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + locs_.MergeFrom(from.locs_); + tokens_.MergeFrom(from.tokens_); + log_probs_.MergeFrom(from.log_probs_); + if (from.draw_action() != 0) { + set_draw_action(from.draw_action()); + } + if (from.draw_prob() != 0) { + set_draw_prob(from.draw_prob()); + } +} + +void PhaseHistory_PolicyDetails::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.PhaseHistory.PolicyDetails) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PhaseHistory_PolicyDetails::CopyFrom(const PhaseHistory_PolicyDetails& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.PhaseHistory.PolicyDetails) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PhaseHistory_PolicyDetails::IsInitialized() const { + return true; +} + +void PhaseHistory_PolicyDetails::Swap(PhaseHistory_PolicyDetails* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + PhaseHistory_PolicyDetails* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void PhaseHistory_PolicyDetails::UnsafeArenaSwap(PhaseHistory_PolicyDetails* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void PhaseHistory_PolicyDetails::InternalSwap(PhaseHistory_PolicyDetails* other) { + using std::swap; + locs_.InternalSwap(CastToBase(&other->locs_)); + tokens_.InternalSwap(&other->tokens_); + log_probs_.InternalSwap(&other->log_probs_); + swap(draw_action_, other->draw_action_); + swap(draw_prob_, other->draw_prob_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata PhaseHistory_PolicyDetails::GetMetadata() const { + protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +PhaseHistory_OrdersEntry_DoNotUse::PhaseHistory_OrdersEntry_DoNotUse() {} +PhaseHistory_OrdersEntry_DoNotUse::PhaseHistory_OrdersEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void PhaseHistory_OrdersEntry_DoNotUse::MergeFrom(const PhaseHistory_OrdersEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata PhaseHistory_OrdersEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[10]; +} +void PhaseHistory_OrdersEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +PhaseHistory_ResultsEntry_DoNotUse::PhaseHistory_ResultsEntry_DoNotUse() {} +PhaseHistory_ResultsEntry_DoNotUse::PhaseHistory_ResultsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void PhaseHistory_ResultsEntry_DoNotUse::MergeFrom(const PhaseHistory_ResultsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata PhaseHistory_ResultsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[11]; +} +void PhaseHistory_ResultsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +PhaseHistory_PolicyEntry_DoNotUse::PhaseHistory_PolicyEntry_DoNotUse() {} +PhaseHistory_PolicyEntry_DoNotUse::PhaseHistory_PolicyEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void PhaseHistory_PolicyEntry_DoNotUse::MergeFrom(const PhaseHistory_PolicyEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata PhaseHistory_PolicyEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[12]; +} +void PhaseHistory_PolicyEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +PhaseHistory_StateValueEntry_DoNotUse::PhaseHistory_StateValueEntry_DoNotUse() {} +PhaseHistory_StateValueEntry_DoNotUse::PhaseHistory_StateValueEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void PhaseHistory_StateValueEntry_DoNotUse::MergeFrom(const PhaseHistory_StateValueEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata PhaseHistory_StateValueEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[13]; +} +void PhaseHistory_StateValueEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +PhaseHistory_PossibleOrdersEntry_DoNotUse::PhaseHistory_PossibleOrdersEntry_DoNotUse() {} +PhaseHistory_PossibleOrdersEntry_DoNotUse::PhaseHistory_PossibleOrdersEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void PhaseHistory_PossibleOrdersEntry_DoNotUse::MergeFrom(const PhaseHistory_PossibleOrdersEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata PhaseHistory_PossibleOrdersEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[14]; +} +void PhaseHistory_PossibleOrdersEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void PhaseHistory::InitAsDefaultInstance() { + ::diplomacy_proto::_PhaseHistory_default_instance_._instance.get_mutable()->state_ = const_cast< ::diplomacy_proto::State*>( + ::diplomacy_proto::State::internal_default_instance()); +} +void PhaseHistory::unsafe_arena_set_allocated_state( + ::diplomacy_proto::State* state) { + if (GetArenaNoVirtual() == NULL) { + delete state_; + } + state_ = state; + if (state) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.PhaseHistory.state) +} +void PhaseHistory::clear_orders() { + orders_.Clear(); +} +void PhaseHistory::clear_results() { + results_.Clear(); +} +void PhaseHistory::clear_possible_orders() { + possible_orders_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PhaseHistory::kNameFieldNumber; +const int PhaseHistory::kStateFieldNumber; +const int PhaseHistory::kOrdersFieldNumber; +const int PhaseHistory::kResultsFieldNumber; +const int PhaseHistory::kPolicyFieldNumber; +const int PhaseHistory::kPrevOrdersStateFieldNumber; +const int PhaseHistory::kStateValueFieldNumber; +const int PhaseHistory::kPossibleOrdersFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PhaseHistory::PhaseHistory() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.PhaseHistory) +} +PhaseHistory::PhaseHistory(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + orders_(arena), + results_(arena), + policy_(arena), + possible_orders_(arena), + prev_orders_state_(arena), + state_value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.PhaseHistory) +} +PhaseHistory::PhaseHistory(const PhaseHistory& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + prev_orders_state_(from.prev_orders_state_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + orders_.MergeFrom(from.orders_); + results_.MergeFrom(from.results_); + policy_.MergeFrom(from.policy_); + possible_orders_.MergeFrom(from.possible_orders_); + state_value_.MergeFrom(from.state_value_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + if (from.has_state()) { + state_ = new ::diplomacy_proto::State(*from.state_); + } else { + state_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.PhaseHistory) +} + +void PhaseHistory::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + state_ = NULL; +} + +PhaseHistory::~PhaseHistory() { + // @@protoc_insertion_point(destructor:diplomacy_proto.PhaseHistory) + SharedDtor(); +} + +void PhaseHistory::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete state_; +} + +void PhaseHistory::ArenaDtor(void* object) { + PhaseHistory* _this = reinterpret_cast< PhaseHistory* >(object); + (void)_this; +} +void PhaseHistory::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void PhaseHistory::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* PhaseHistory::descriptor() { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const PhaseHistory& PhaseHistory::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_PhaseHistory.base); + return *internal_default_instance(); +} + + +void PhaseHistory::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.PhaseHistory) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + orders_.Clear(); + results_.Clear(); + policy_.Clear(); + possible_orders_.Clear(); + prev_orders_state_.Clear(); + state_value_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && state_ != NULL) { + delete state_; + } + state_ = NULL; + _internal_metadata_.Clear(); +} + +bool PhaseHistory::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.PhaseHistory) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.PhaseHistory.name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy_proto.State state = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_state())); + } else { + goto handle_unusual; + } + break; + } + + // map orders = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + PhaseHistory_OrdersEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + PhaseHistory_OrdersEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(&orders_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.PhaseHistory.OrdersEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map results = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + PhaseHistory_ResultsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + PhaseHistory_ResultsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(&results_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.PhaseHistory.ResultsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map policy = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + PhaseHistory_PolicyEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + PhaseHistory_PolicyEntry_DoNotUse, + ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails > > parser(&policy_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.PhaseHistory.PolicyEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // map possible_orders = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + PhaseHistory_PossibleOrdersEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + PhaseHistory_PossibleOrdersEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList > > parser(&possible_orders_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.PhaseHistory.PossibleOrdersEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 prev_orders_state = 8 [packed = true]; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_prev_orders_state()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 66u, input, this->mutable_prev_orders_state()))); + } else { + goto handle_unusual; + } + break; + } + + // map state_value = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + PhaseHistory_StateValueEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + PhaseHistory_StateValueEntry_DoNotUse, + ::std::string, float, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT, + 0 >, + ::google::protobuf::Map< ::std::string, float > > parser(&state_value_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.PhaseHistory.StateValueEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.PhaseHistory) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.PhaseHistory) + return false; +#undef DO_ +} + +void PhaseHistory::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.PhaseHistory) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // .diplomacy_proto.State state = 2; + if (this->has_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_state(), output); + } + + // map orders = 3; + if (!this->orders().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.OrdersEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->orders().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->orders().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->orders().begin(); + it != this->orders().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(orders_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->orders().begin(); + it != this->orders().end(); ++it) { + entry.reset(orders_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map results = 4; + if (!this->results().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.ResultsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->results().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->results().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->results().begin(); + it != this->results().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(results_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->results().begin(); + it != this->results().end(); ++it) { + entry.reset(results_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map policy = 6; + if (!this->policy().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.PolicyEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->policy().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->policy().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::const_iterator + it = this->policy().begin(); + it != this->policy().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(policy_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::const_iterator + it = this->policy().begin(); + it != this->policy().end(); ++it) { + entry.reset(policy_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map possible_orders = 7; + if (!this->possible_orders().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.PossibleOrdersEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->possible_orders().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->possible_orders().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->possible_orders().begin(); + it != this->possible_orders().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(possible_orders_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->possible_orders().begin(); + it != this->possible_orders().end(); ++it) { + entry.reset(possible_orders_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // repeated uint32 prev_orders_state = 8 [packed = true]; + if (this->prev_orders_state_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _prev_orders_state_cached_byte_size_)); + } + for (int i = 0, n = this->prev_orders_state_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->prev_orders_state(i), output); + } + + // map state_value = 9; + if (!this->state_value().empty()) { + typedef ::google::protobuf::Map< ::std::string, float >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.StateValueEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->state_value().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->state_value().size()]); + typedef ::google::protobuf::Map< ::std::string, float >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, float >::const_iterator + it = this->state_value().begin(); + it != this->state_value().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(state_value_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, float >::const_iterator + it = this->state_value().begin(); + it != this->state_value().end(); ++it) { + entry.reset(state_value_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.PhaseHistory) +} + +::google::protobuf::uint8* PhaseHistory::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.PhaseHistory) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // .diplomacy_proto.State state = 2; + if (this->has_state()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_state(), deterministic, target); + } + + // map orders = 3; + if (!this->orders().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.OrdersEntry.key"); + } + }; + + if (deterministic && + this->orders().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->orders().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->orders().begin(); + it != this->orders().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(orders_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->orders().begin(); + it != this->orders().end(); ++it) { + entry.reset(orders_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map results = 4; + if (!this->results().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.ResultsEntry.key"); + } + }; + + if (deterministic && + this->results().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->results().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->results().begin(); + it != this->results().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(results_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->results().begin(); + it != this->results().end(); ++it) { + entry.reset(results_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map policy = 6; + if (!this->policy().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.PolicyEntry.key"); + } + }; + + if (deterministic && + this->policy().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->policy().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::const_iterator + it = this->policy().begin(); + it != this->policy().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(policy_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::const_iterator + it = this->policy().begin(); + it != this->policy().end(); ++it) { + entry.reset(policy_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map possible_orders = 7; + if (!this->possible_orders().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.PossibleOrdersEntry.key"); + } + }; + + if (deterministic && + this->possible_orders().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->possible_orders().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->possible_orders().begin(); + it != this->possible_orders().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(possible_orders_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->possible_orders().begin(); + it != this->possible_orders().end(); ++it) { + entry.reset(possible_orders_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // repeated uint32 prev_orders_state = 8 [packed = true]; + if (this->prev_orders_state_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 8, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _prev_orders_state_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->prev_orders_state_, target); + } + + // map state_value = 9; + if (!this->state_value().empty()) { + typedef ::google::protobuf::Map< ::std::string, float >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.PhaseHistory.StateValueEntry.key"); + } + }; + + if (deterministic && + this->state_value().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->state_value().size()]); + typedef ::google::protobuf::Map< ::std::string, float >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, float >::const_iterator + it = this->state_value().begin(); + it != this->state_value().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(state_value_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, float >::const_iterator + it = this->state_value().begin(); + it != this->state_value().end(); ++it) { + entry.reset(state_value_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.PhaseHistory) + return target; +} + +size_t PhaseHistory::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.PhaseHistory) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map orders = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->orders_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->orders().begin(); + it != this->orders().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(orders_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map results = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->results_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->results().begin(); + it != this->results().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(results_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map policy = 6; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->policy_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >::const_iterator + it = this->policy().begin(); + it != this->policy().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(policy_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map possible_orders = 7; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->possible_orders_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >::const_iterator + it = this->possible_orders().begin(); + it != this->possible_orders().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(possible_orders_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // repeated uint32 prev_orders_state = 8 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->prev_orders_state_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _prev_orders_state_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // map state_value = 9; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->state_value_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, float >::const_iterator + it = this->state_value().begin(); + it != this->state_value().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(state_value_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy_proto.State state = 2; + if (this->has_state()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *state_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PhaseHistory::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.PhaseHistory) + GOOGLE_DCHECK_NE(&from, this); + const PhaseHistory* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.PhaseHistory) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.PhaseHistory) + MergeFrom(*source); + } +} + +void PhaseHistory::MergeFrom(const PhaseHistory& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.PhaseHistory) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + orders_.MergeFrom(from.orders_); + results_.MergeFrom(from.results_); + policy_.MergeFrom(from.policy_); + possible_orders_.MergeFrom(from.possible_orders_); + prev_orders_state_.MergeFrom(from.prev_orders_state_); + state_value_.MergeFrom(from.state_value_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.has_state()) { + mutable_state()->::diplomacy_proto::State::MergeFrom(from.state()); + } +} + +void PhaseHistory::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.PhaseHistory) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PhaseHistory::CopyFrom(const PhaseHistory& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.PhaseHistory) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PhaseHistory::IsInitialized() const { + return true; +} + +void PhaseHistory::Swap(PhaseHistory* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + PhaseHistory* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void PhaseHistory::UnsafeArenaSwap(PhaseHistory* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void PhaseHistory::InternalSwap(PhaseHistory* other) { + using std::swap; + orders_.Swap(&other->orders_); + results_.Swap(&other->results_); + policy_.Swap(&other->policy_); + possible_orders_.Swap(&other->possible_orders_); + prev_orders_state_.InternalSwap(&other->prev_orders_state_); + state_value_.Swap(&other->state_value_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(state_, other->state_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata PhaseHistory::GetMetadata() const { + protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SavedGame_KeywordArgs::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SavedGame_KeywordArgs::kPlayerSeedFieldNumber; +const int SavedGame_KeywordArgs::kNoiseFieldNumber; +const int SavedGame_KeywordArgs::kTemperatureFieldNumber; +const int SavedGame_KeywordArgs::kDropoutRateFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SavedGame_KeywordArgs::SavedGame_KeywordArgs() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame_KeywordArgs.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.SavedGame.KeywordArgs) +} +SavedGame_KeywordArgs::SavedGame_KeywordArgs(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame_KeywordArgs.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.SavedGame.KeywordArgs) +} +SavedGame_KeywordArgs::SavedGame_KeywordArgs(const SavedGame_KeywordArgs& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&player_seed_, &from.player_seed_, + static_cast(reinterpret_cast(&dropout_rate_) - + reinterpret_cast(&player_seed_)) + sizeof(dropout_rate_)); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.SavedGame.KeywordArgs) +} + +void SavedGame_KeywordArgs::SharedCtor() { + ::memset(&player_seed_, 0, static_cast( + reinterpret_cast(&dropout_rate_) - + reinterpret_cast(&player_seed_)) + sizeof(dropout_rate_)); +} + +SavedGame_KeywordArgs::~SavedGame_KeywordArgs() { + // @@protoc_insertion_point(destructor:diplomacy_proto.SavedGame.KeywordArgs) + SharedDtor(); +} + +void SavedGame_KeywordArgs::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void SavedGame_KeywordArgs::ArenaDtor(void* object) { + SavedGame_KeywordArgs* _this = reinterpret_cast< SavedGame_KeywordArgs* >(object); + (void)_this; +} +void SavedGame_KeywordArgs::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SavedGame_KeywordArgs::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SavedGame_KeywordArgs::descriptor() { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SavedGame_KeywordArgs& SavedGame_KeywordArgs::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame_KeywordArgs.base); + return *internal_default_instance(); +} + + +void SavedGame_KeywordArgs::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.SavedGame.KeywordArgs) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&player_seed_, 0, static_cast( + reinterpret_cast(&dropout_rate_) - + reinterpret_cast(&player_seed_)) + sizeof(dropout_rate_)); + _internal_metadata_.Clear(); +} + +bool SavedGame_KeywordArgs::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.SavedGame.KeywordArgs) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 player_seed = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &player_seed_))); + } else { + goto handle_unusual; + } + break; + } + + // float noise = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &noise_))); + } else { + goto handle_unusual; + } + break; + } + + // float temperature = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &temperature_))); + } else { + goto handle_unusual; + } + break; + } + + // float dropout_rate = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_rate_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.SavedGame.KeywordArgs) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.SavedGame.KeywordArgs) + return false; +#undef DO_ +} + +void SavedGame_KeywordArgs::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.SavedGame.KeywordArgs) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 player_seed = 1; + if (this->player_seed() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->player_seed(), output); + } + + // float noise = 2; + if (this->noise() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->noise(), output); + } + + // float temperature = 3; + if (this->temperature() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->temperature(), output); + } + + // float dropout_rate = 5; + if (this->dropout_rate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->dropout_rate(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.SavedGame.KeywordArgs) +} + +::google::protobuf::uint8* SavedGame_KeywordArgs::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.SavedGame.KeywordArgs) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 player_seed = 1; + if (this->player_seed() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->player_seed(), target); + } + + // float noise = 2; + if (this->noise() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->noise(), target); + } + + // float temperature = 3; + if (this->temperature() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->temperature(), target); + } + + // float dropout_rate = 5; + if (this->dropout_rate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->dropout_rate(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.SavedGame.KeywordArgs) + return target; +} + +size_t SavedGame_KeywordArgs::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.SavedGame.KeywordArgs) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 player_seed = 1; + if (this->player_seed() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->player_seed()); + } + + // float noise = 2; + if (this->noise() != 0) { + total_size += 1 + 4; + } + + // float temperature = 3; + if (this->temperature() != 0) { + total_size += 1 + 4; + } + + // float dropout_rate = 5; + if (this->dropout_rate() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SavedGame_KeywordArgs::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.SavedGame.KeywordArgs) + GOOGLE_DCHECK_NE(&from, this); + const SavedGame_KeywordArgs* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.SavedGame.KeywordArgs) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.SavedGame.KeywordArgs) + MergeFrom(*source); + } +} + +void SavedGame_KeywordArgs::MergeFrom(const SavedGame_KeywordArgs& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.SavedGame.KeywordArgs) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.player_seed() != 0) { + set_player_seed(from.player_seed()); + } + if (from.noise() != 0) { + set_noise(from.noise()); + } + if (from.temperature() != 0) { + set_temperature(from.temperature()); + } + if (from.dropout_rate() != 0) { + set_dropout_rate(from.dropout_rate()); + } +} + +void SavedGame_KeywordArgs::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.SavedGame.KeywordArgs) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SavedGame_KeywordArgs::CopyFrom(const SavedGame_KeywordArgs& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.SavedGame.KeywordArgs) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SavedGame_KeywordArgs::IsInitialized() const { + return true; +} + +void SavedGame_KeywordArgs::Swap(SavedGame_KeywordArgs* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SavedGame_KeywordArgs* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SavedGame_KeywordArgs::UnsafeArenaSwap(SavedGame_KeywordArgs* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SavedGame_KeywordArgs::InternalSwap(SavedGame_KeywordArgs* other) { + using std::swap; + swap(player_seed_, other->player_seed_); + swap(noise_, other->noise_); + swap(temperature_, other->temperature_); + swap(dropout_rate_, other->dropout_rate_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SavedGame_KeywordArgs::GetMetadata() const { + protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +SavedGame_KwargsEntry_DoNotUse::SavedGame_KwargsEntry_DoNotUse() {} +SavedGame_KwargsEntry_DoNotUse::SavedGame_KwargsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void SavedGame_KwargsEntry_DoNotUse::MergeFrom(const SavedGame_KwargsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata SavedGame_KwargsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[17]; +} +void SavedGame_KwargsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +SavedGame_RewardsEntry_DoNotUse::SavedGame_RewardsEntry_DoNotUse() {} +SavedGame_RewardsEntry_DoNotUse::SavedGame_RewardsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void SavedGame_RewardsEntry_DoNotUse::MergeFrom(const SavedGame_RewardsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata SavedGame_RewardsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[18]; +} +void SavedGame_RewardsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +SavedGame_ReturnsEntry_DoNotUse::SavedGame_ReturnsEntry_DoNotUse() {} +SavedGame_ReturnsEntry_DoNotUse::SavedGame_ReturnsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void SavedGame_ReturnsEntry_DoNotUse::MergeFrom(const SavedGame_ReturnsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata SavedGame_ReturnsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[19]; +} +void SavedGame_ReturnsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void SavedGame::InitAsDefaultInstance() { +} +void SavedGame::clear_rewards() { + rewards_.Clear(); +} +void SavedGame::clear_returns() { + returns_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SavedGame::kIdFieldNumber; +const int SavedGame::kMapFieldNumber; +const int SavedGame::kRulesFieldNumber; +const int SavedGame::kPhasesFieldNumber; +const int SavedGame::kDoneReasonFieldNumber; +const int SavedGame::kAssignedPowersFieldNumber; +const int SavedGame::kPlayersFieldNumber; +const int SavedGame::kKwargsFieldNumber; +const int SavedGame::kIsPartialGameFieldNumber; +const int SavedGame::kStartPhaseIxFieldNumber; +const int SavedGame::kRewardFnFieldNumber; +const int SavedGame::kRewardsFieldNumber; +const int SavedGame::kReturnsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SavedGame::SavedGame() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy_proto.SavedGame) +} +SavedGame::SavedGame(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + rules_(arena), + phases_(arena), + assigned_powers_(arena), + rewards_(arena), + kwargs_(arena), + players_(arena), + returns_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy_proto.SavedGame) +} +SavedGame::SavedGame(const SavedGame& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + rules_(from.rules_), + phases_(from.phases_), + assigned_powers_(from.assigned_powers_), + players_(from.players_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + rewards_.MergeFrom(from.rewards_); + kwargs_.MergeFrom(from.kwargs_); + returns_.MergeFrom(from.returns_); + id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.id().size() > 0) { + id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.id(), + GetArenaNoVirtual()); + } + map_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.map().size() > 0) { + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.map(), + GetArenaNoVirtual()); + } + done_reason_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.done_reason().size() > 0) { + done_reason_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.done_reason(), + GetArenaNoVirtual()); + } + reward_fn_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.reward_fn().size() > 0) { + reward_fn_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.reward_fn(), + GetArenaNoVirtual()); + } + ::memcpy(&start_phase_ix_, &from.start_phase_ix_, + static_cast(reinterpret_cast(&is_partial_game_) - + reinterpret_cast(&start_phase_ix_)) + sizeof(is_partial_game_)); + // @@protoc_insertion_point(copy_constructor:diplomacy_proto.SavedGame) +} + +void SavedGame::SharedCtor() { + id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + map_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + done_reason_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + reward_fn_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&start_phase_ix_, 0, static_cast( + reinterpret_cast(&is_partial_game_) - + reinterpret_cast(&start_phase_ix_)) + sizeof(is_partial_game_)); +} + +SavedGame::~SavedGame() { + // @@protoc_insertion_point(destructor:diplomacy_proto.SavedGame) + SharedDtor(); +} + +void SavedGame::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + map_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + done_reason_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + reward_fn_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SavedGame::ArenaDtor(void* object) { + SavedGame* _this = reinterpret_cast< SavedGame* >(object); + (void)_this; +} +void SavedGame::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SavedGame::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SavedGame::descriptor() { + ::protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SavedGame& SavedGame::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5fproto_2fgame_2eproto::scc_info_SavedGame.base); + return *internal_default_instance(); +} + + +void SavedGame::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy_proto.SavedGame) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + rules_.Clear(); + phases_.Clear(); + assigned_powers_.Clear(); + rewards_.Clear(); + kwargs_.Clear(); + players_.Clear(); + returns_.Clear(); + id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + map_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + done_reason_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + reward_fn_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&start_phase_ix_, 0, static_cast( + reinterpret_cast(&is_partial_game_) - + reinterpret_cast(&start_phase_ix_)) + sizeof(is_partial_game_)); + _internal_metadata_.Clear(); +} + +bool SavedGame::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy_proto.SavedGame) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_id())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->id().data(), static_cast(this->id().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.id")); + } else { + goto handle_unusual; + } + break; + } + + // string map = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_map())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->map().data(), static_cast(this->map().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.map")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string rules = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_rules())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rules(this->rules_size() - 1).data(), + static_cast(this->rules(this->rules_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.rules")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy_proto.PhaseHistory phases = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_phases())); + } else { + goto handle_unusual; + } + break; + } + + // repeated string assigned_powers = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_assigned_powers())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->assigned_powers(this->assigned_powers_size() - 1).data(), + static_cast(this->assigned_powers(this->assigned_powers_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.assigned_powers")); + } else { + goto handle_unusual; + } + break; + } + + // string done_reason = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_done_reason())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->done_reason().data(), static_cast(this->done_reason().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.done_reason")); + } else { + goto handle_unusual; + } + break; + } + + // string reward_fn = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_reward_fn())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->reward_fn().data(), static_cast(this->reward_fn().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.reward_fn")); + } else { + goto handle_unusual; + } + break; + } + + // map rewards = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + SavedGame_RewardsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + SavedGame_RewardsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::FloatList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList > > parser(&rewards_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.RewardsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // int32 start_phase_ix = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &start_phase_ix_))); + } else { + goto handle_unusual; + } + break; + } + + // map kwargs = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + SavedGame_KwargsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + SavedGame_KwargsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs > > parser(&kwargs_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.KwargsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string players = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_players())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->players(this->players_size() - 1).data(), + static_cast(this->players(this->players_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.players")); + } else { + goto handle_unusual; + } + break; + } + + // bool is_partial_game = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_partial_game_))); + } else { + goto handle_unusual; + } + break; + } + + // map returns = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) { + SavedGame_ReturnsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + SavedGame_ReturnsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::FloatList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList > > parser(&returns_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy_proto.SavedGame.ReturnsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy_proto.SavedGame) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy_proto.SavedGame) + return false; +#undef DO_ +} + +void SavedGame::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy_proto.SavedGame) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string id = 1; + if (this->id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->id().data(), static_cast(this->id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.id"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->id(), output); + } + + // string map = 2; + if (this->map().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->map().data(), static_cast(this->map().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.map"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->map(), output); + } + + // repeated string rules = 3; + for (int i = 0, n = this->rules_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rules(i).data(), static_cast(this->rules(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.rules"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->rules(i), output); + } + + // repeated .diplomacy_proto.PhaseHistory phases = 4; + for (unsigned int i = 0, + n = static_cast(this->phases_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->phases(static_cast(i)), + output); + } + + // repeated string assigned_powers = 5; + for (int i = 0, n = this->assigned_powers_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->assigned_powers(i).data(), static_cast(this->assigned_powers(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.assigned_powers"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->assigned_powers(i), output); + } + + // string done_reason = 6; + if (this->done_reason().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->done_reason().data(), static_cast(this->done_reason().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.done_reason"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->done_reason(), output); + } + + // string reward_fn = 7; + if (this->reward_fn().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->reward_fn().data(), static_cast(this->reward_fn().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.reward_fn"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->reward_fn(), output); + } + + // map rewards = 8; + if (!this->rewards().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.RewardsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->rewards().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->rewards().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->rewards().begin(); + it != this->rewards().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(rewards_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->rewards().begin(); + it != this->rewards().end(); ++it) { + entry.reset(rewards_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // int32 start_phase_ix = 9; + if (this->start_phase_ix() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->start_phase_ix(), output); + } + + // map kwargs = 10; + if (!this->kwargs().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.KwargsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->kwargs().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->kwargs().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::const_iterator + it = this->kwargs().begin(); + it != this->kwargs().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(kwargs_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::const_iterator + it = this->kwargs().begin(); + it != this->kwargs().end(); ++it) { + entry.reset(kwargs_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // repeated string players = 11; + for (int i = 0, n = this->players_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->players(i).data(), static_cast(this->players(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.players"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 11, this->players(i), output); + } + + // bool is_partial_game = 12; + if (this->is_partial_game() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->is_partial_game(), output); + } + + // map returns = 13; + if (!this->returns().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.ReturnsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->returns().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->returns().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->returns().begin(); + it != this->returns().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(returns_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->returns().begin(); + it != this->returns().end(); ++it) { + entry.reset(returns_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy_proto.SavedGame) +} + +::google::protobuf::uint8* SavedGame::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy_proto.SavedGame) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string id = 1; + if (this->id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->id().data(), static_cast(this->id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.id"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->id(), target); + } + + // string map = 2; + if (this->map().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->map().data(), static_cast(this->map().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.map"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->map(), target); + } + + // repeated string rules = 3; + for (int i = 0, n = this->rules_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rules(i).data(), static_cast(this->rules(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.rules"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->rules(i), target); + } + + // repeated .diplomacy_proto.PhaseHistory phases = 4; + for (unsigned int i = 0, + n = static_cast(this->phases_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->phases(static_cast(i)), deterministic, target); + } + + // repeated string assigned_powers = 5; + for (int i = 0, n = this->assigned_powers_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->assigned_powers(i).data(), static_cast(this->assigned_powers(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.assigned_powers"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(5, this->assigned_powers(i), target); + } + + // string done_reason = 6; + if (this->done_reason().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->done_reason().data(), static_cast(this->done_reason().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.done_reason"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->done_reason(), target); + } + + // string reward_fn = 7; + if (this->reward_fn().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->reward_fn().data(), static_cast(this->reward_fn().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.reward_fn"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->reward_fn(), target); + } + + // map rewards = 8; + if (!this->rewards().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.RewardsEntry.key"); + } + }; + + if (deterministic && + this->rewards().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->rewards().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->rewards().begin(); + it != this->rewards().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(rewards_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->rewards().begin(); + it != this->rewards().end(); ++it) { + entry.reset(rewards_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // int32 start_phase_ix = 9; + if (this->start_phase_ix() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->start_phase_ix(), target); + } + + // map kwargs = 10; + if (!this->kwargs().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.KwargsEntry.key"); + } + }; + + if (deterministic && + this->kwargs().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->kwargs().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::const_iterator + it = this->kwargs().begin(); + it != this->kwargs().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(kwargs_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 10, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::const_iterator + it = this->kwargs().begin(); + it != this->kwargs().end(); ++it) { + entry.reset(kwargs_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 10, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // repeated string players = 11; + for (int i = 0, n = this->players_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->players(i).data(), static_cast(this->players(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.players"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(11, this->players(i), target); + } + + // bool is_partial_game = 12; + if (this->is_partial_game() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->is_partial_game(), target); + } + + // map returns = 13; + if (!this->returns().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy_proto.SavedGame.ReturnsEntry.key"); + } + }; + + if (deterministic && + this->returns().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->returns().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->returns().begin(); + it != this->returns().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(returns_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 13, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->returns().begin(); + it != this->returns().end(); ++it) { + entry.reset(returns_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 13, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy_proto.SavedGame) + return target; +} + +size_t SavedGame::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy_proto.SavedGame) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string rules = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->rules_size()); + for (int i = 0, n = this->rules_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->rules(i)); + } + + // repeated .diplomacy_proto.PhaseHistory phases = 4; + { + unsigned int count = static_cast(this->phases_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->phases(static_cast(i))); + } + } + + // repeated string assigned_powers = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->assigned_powers_size()); + for (int i = 0, n = this->assigned_powers_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->assigned_powers(i)); + } + + // map rewards = 8; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->rewards_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->rewards().begin(); + it != this->rewards().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(rewards_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map kwargs = 10; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->kwargs_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >::const_iterator + it = this->kwargs().begin(); + it != this->kwargs().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(kwargs_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // repeated string players = 11; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->players_size()); + for (int i = 0, n = this->players_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->players(i)); + } + + // map returns = 13; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->returns_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >::const_iterator + it = this->returns().begin(); + it != this->returns().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(returns_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // string id = 1; + if (this->id().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->id()); + } + + // string map = 2; + if (this->map().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->map()); + } + + // string done_reason = 6; + if (this->done_reason().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->done_reason()); + } + + // string reward_fn = 7; + if (this->reward_fn().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->reward_fn()); + } + + // int32 start_phase_ix = 9; + if (this->start_phase_ix() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->start_phase_ix()); + } + + // bool is_partial_game = 12; + if (this->is_partial_game() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SavedGame::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy_proto.SavedGame) + GOOGLE_DCHECK_NE(&from, this); + const SavedGame* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy_proto.SavedGame) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy_proto.SavedGame) + MergeFrom(*source); + } +} + +void SavedGame::MergeFrom(const SavedGame& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy_proto.SavedGame) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + rules_.MergeFrom(from.rules_); + phases_.MergeFrom(from.phases_); + assigned_powers_.MergeFrom(from.assigned_powers_); + rewards_.MergeFrom(from.rewards_); + kwargs_.MergeFrom(from.kwargs_); + players_.MergeFrom(from.players_); + returns_.MergeFrom(from.returns_); + if (from.id().size() > 0) { + set_id(from.id()); + } + if (from.map().size() > 0) { + set_map(from.map()); + } + if (from.done_reason().size() > 0) { + set_done_reason(from.done_reason()); + } + if (from.reward_fn().size() > 0) { + set_reward_fn(from.reward_fn()); + } + if (from.start_phase_ix() != 0) { + set_start_phase_ix(from.start_phase_ix()); + } + if (from.is_partial_game() != 0) { + set_is_partial_game(from.is_partial_game()); + } +} + +void SavedGame::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy_proto.SavedGame) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SavedGame::CopyFrom(const SavedGame& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy_proto.SavedGame) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SavedGame::IsInitialized() const { + return true; +} + +void SavedGame::Swap(SavedGame* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SavedGame* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SavedGame::UnsafeArenaSwap(SavedGame* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SavedGame::InternalSwap(SavedGame* other) { + using std::swap; + rules_.InternalSwap(CastToBase(&other->rules_)); + CastToBase(&phases_)->InternalSwap(CastToBase(&other->phases_)); + assigned_powers_.InternalSwap(CastToBase(&other->assigned_powers_)); + rewards_.Swap(&other->rewards_); + kwargs_.Swap(&other->kwargs_); + players_.InternalSwap(CastToBase(&other->players_)); + returns_.Swap(&other->returns_); + id_.Swap(&other->id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + map_.Swap(&other->map_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + done_reason_.Swap(&other->done_reason_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + reward_fn_.Swap(&other->reward_fn_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(start_phase_ix_, other->start_phase_ix_); + swap(is_partial_game_, other->is_partial_game_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SavedGame::GetMetadata() const { + protobuf_diplomacy_5fproto_2fgame_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5fproto_2fgame_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace diplomacy_proto +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::Message* Arena::CreateMaybeMessage< ::diplomacy_proto::Message >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::Message >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State_Builds* Arena::CreateMaybeMessage< ::diplomacy_proto::State_Builds >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State_Builds >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State_UnitsEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::State_UnitsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State_UnitsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State_CentersEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::State_CentersEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State_CentersEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State_HomesEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::State_HomesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State_HomesEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State_InfluenceEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::State_InfluenceEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State_InfluenceEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State_CivilDisorderEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::State_CivilDisorderEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State_CivilDisorderEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State_BuildsEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::State_BuildsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State_BuildsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::State* Arena::CreateMaybeMessage< ::diplomacy_proto::State >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::State >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::PhaseHistory_PolicyDetails* Arena::CreateMaybeMessage< ::diplomacy_proto::PhaseHistory_PolicyDetails >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::PhaseHistory_PolicyDetails >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::PhaseHistory* Arena::CreateMaybeMessage< ::diplomacy_proto::PhaseHistory >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::PhaseHistory >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::SavedGame_KeywordArgs* Arena::CreateMaybeMessage< ::diplomacy_proto::SavedGame_KeywordArgs >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::SavedGame_KeywordArgs >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy_proto::SavedGame* Arena::CreateMaybeMessage< ::diplomacy_proto::SavedGame >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy_proto::SavedGame >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_proto/game.pb.h b/diplomacy_research/proto/diplomacy_proto/game.pb.h new file mode 100644 index 0000000..73baa22 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/game.pb.h @@ -0,0 +1,4261 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_proto/game.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5fproto_2fgame_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5fproto_2fgame_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_proto/common.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5fproto_2fgame_2eproto + +namespace protobuf_diplomacy_5fproto_2fgame_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[21]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5fproto_2fgame_2eproto +namespace diplomacy_proto { +class Message; +class MessageDefaultTypeInternal; +extern MessageDefaultTypeInternal _Message_default_instance_; +class PhaseHistory; +class PhaseHistoryDefaultTypeInternal; +extern PhaseHistoryDefaultTypeInternal _PhaseHistory_default_instance_; +class PhaseHistory_OrdersEntry_DoNotUse; +class PhaseHistory_OrdersEntry_DoNotUseDefaultTypeInternal; +extern PhaseHistory_OrdersEntry_DoNotUseDefaultTypeInternal _PhaseHistory_OrdersEntry_DoNotUse_default_instance_; +class PhaseHistory_PolicyDetails; +class PhaseHistory_PolicyDetailsDefaultTypeInternal; +extern PhaseHistory_PolicyDetailsDefaultTypeInternal _PhaseHistory_PolicyDetails_default_instance_; +class PhaseHistory_PolicyEntry_DoNotUse; +class PhaseHistory_PolicyEntry_DoNotUseDefaultTypeInternal; +extern PhaseHistory_PolicyEntry_DoNotUseDefaultTypeInternal _PhaseHistory_PolicyEntry_DoNotUse_default_instance_; +class PhaseHistory_PossibleOrdersEntry_DoNotUse; +class PhaseHistory_PossibleOrdersEntry_DoNotUseDefaultTypeInternal; +extern PhaseHistory_PossibleOrdersEntry_DoNotUseDefaultTypeInternal _PhaseHistory_PossibleOrdersEntry_DoNotUse_default_instance_; +class PhaseHistory_ResultsEntry_DoNotUse; +class PhaseHistory_ResultsEntry_DoNotUseDefaultTypeInternal; +extern PhaseHistory_ResultsEntry_DoNotUseDefaultTypeInternal _PhaseHistory_ResultsEntry_DoNotUse_default_instance_; +class PhaseHistory_StateValueEntry_DoNotUse; +class PhaseHistory_StateValueEntry_DoNotUseDefaultTypeInternal; +extern PhaseHistory_StateValueEntry_DoNotUseDefaultTypeInternal _PhaseHistory_StateValueEntry_DoNotUse_default_instance_; +class SavedGame; +class SavedGameDefaultTypeInternal; +extern SavedGameDefaultTypeInternal _SavedGame_default_instance_; +class SavedGame_KeywordArgs; +class SavedGame_KeywordArgsDefaultTypeInternal; +extern SavedGame_KeywordArgsDefaultTypeInternal _SavedGame_KeywordArgs_default_instance_; +class SavedGame_KwargsEntry_DoNotUse; +class SavedGame_KwargsEntry_DoNotUseDefaultTypeInternal; +extern SavedGame_KwargsEntry_DoNotUseDefaultTypeInternal _SavedGame_KwargsEntry_DoNotUse_default_instance_; +class SavedGame_ReturnsEntry_DoNotUse; +class SavedGame_ReturnsEntry_DoNotUseDefaultTypeInternal; +extern SavedGame_ReturnsEntry_DoNotUseDefaultTypeInternal _SavedGame_ReturnsEntry_DoNotUse_default_instance_; +class SavedGame_RewardsEntry_DoNotUse; +class SavedGame_RewardsEntry_DoNotUseDefaultTypeInternal; +extern SavedGame_RewardsEntry_DoNotUseDefaultTypeInternal _SavedGame_RewardsEntry_DoNotUse_default_instance_; +class State; +class StateDefaultTypeInternal; +extern StateDefaultTypeInternal _State_default_instance_; +class State_Builds; +class State_BuildsDefaultTypeInternal; +extern State_BuildsDefaultTypeInternal _State_Builds_default_instance_; +class State_BuildsEntry_DoNotUse; +class State_BuildsEntry_DoNotUseDefaultTypeInternal; +extern State_BuildsEntry_DoNotUseDefaultTypeInternal _State_BuildsEntry_DoNotUse_default_instance_; +class State_CentersEntry_DoNotUse; +class State_CentersEntry_DoNotUseDefaultTypeInternal; +extern State_CentersEntry_DoNotUseDefaultTypeInternal _State_CentersEntry_DoNotUse_default_instance_; +class State_CivilDisorderEntry_DoNotUse; +class State_CivilDisorderEntry_DoNotUseDefaultTypeInternal; +extern State_CivilDisorderEntry_DoNotUseDefaultTypeInternal _State_CivilDisorderEntry_DoNotUse_default_instance_; +class State_HomesEntry_DoNotUse; +class State_HomesEntry_DoNotUseDefaultTypeInternal; +extern State_HomesEntry_DoNotUseDefaultTypeInternal _State_HomesEntry_DoNotUse_default_instance_; +class State_InfluenceEntry_DoNotUse; +class State_InfluenceEntry_DoNotUseDefaultTypeInternal; +extern State_InfluenceEntry_DoNotUseDefaultTypeInternal _State_InfluenceEntry_DoNotUse_default_instance_; +class State_UnitsEntry_DoNotUse; +class State_UnitsEntry_DoNotUseDefaultTypeInternal; +extern State_UnitsEntry_DoNotUseDefaultTypeInternal _State_UnitsEntry_DoNotUse_default_instance_; +} // namespace diplomacy_proto +namespace google { +namespace protobuf { +template<> ::diplomacy_proto::Message* Arena::CreateMaybeMessage<::diplomacy_proto::Message>(Arena*); +template<> ::diplomacy_proto::PhaseHistory* Arena::CreateMaybeMessage<::diplomacy_proto::PhaseHistory>(Arena*); +template<> ::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::PhaseHistory_OrdersEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::PhaseHistory_PolicyDetails* Arena::CreateMaybeMessage<::diplomacy_proto::PhaseHistory_PolicyDetails>(Arena*); +template<> ::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::PhaseHistory_PolicyEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::PhaseHistory_PossibleOrdersEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::PhaseHistory_ResultsEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::PhaseHistory_StateValueEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::SavedGame* Arena::CreateMaybeMessage<::diplomacy_proto::SavedGame>(Arena*); +template<> ::diplomacy_proto::SavedGame_KeywordArgs* Arena::CreateMaybeMessage<::diplomacy_proto::SavedGame_KeywordArgs>(Arena*); +template<> ::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::SavedGame_KwargsEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::SavedGame_ReturnsEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::SavedGame_RewardsEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::State* Arena::CreateMaybeMessage<::diplomacy_proto::State>(Arena*); +template<> ::diplomacy_proto::State_Builds* Arena::CreateMaybeMessage<::diplomacy_proto::State_Builds>(Arena*); +template<> ::diplomacy_proto::State_BuildsEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::State_BuildsEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::State_CentersEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::State_CentersEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::State_CivilDisorderEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::State_CivilDisorderEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::State_HomesEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::State_HomesEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::State_InfluenceEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::State_InfluenceEntry_DoNotUse>(Arena*); +template<> ::diplomacy_proto::State_UnitsEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy_proto::State_UnitsEntry_DoNotUse>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy_proto { + +// =================================================================== + +class Message : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.Message) */ { + public: + Message(); + virtual ~Message(); + + Message(const Message& from); + + inline Message& operator=(const Message& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Message(Message&& from) noexcept + : Message() { + *this = ::std::move(from); + } + + inline Message& operator=(Message&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Message& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Message* internal_default_instance() { + return reinterpret_cast( + &_Message_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(Message* other); + void Swap(Message* other); + friend void swap(Message& a, Message& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Message* New() const final { + return CreateMaybeMessage(NULL); + } + + Message* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Message& from); + void MergeFrom(const Message& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Message* other); + protected: + explicit Message(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated uint32 tokens = 6 [packed = true]; + int tokens_size() const; + void clear_tokens(); + static const int kTokensFieldNumber = 6; + ::google::protobuf::uint32 tokens(int index) const; + void set_tokens(int index, ::google::protobuf::uint32 value); + void add_tokens(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + tokens() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_tokens(); + + // string sender = 1; + void clear_sender(); + static const int kSenderFieldNumber = 1; + const ::std::string& sender() const; + void set_sender(const ::std::string& value); + #if LANG_CXX11 + void set_sender(::std::string&& value); + #endif + void set_sender(const char* value); + void set_sender(const char* value, size_t size); + ::std::string* mutable_sender(); + ::std::string* release_sender(); + void set_allocated_sender(::std::string* sender); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_sender(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_sender( + ::std::string* sender); + + // string recipient = 2; + void clear_recipient(); + static const int kRecipientFieldNumber = 2; + const ::std::string& recipient() const; + void set_recipient(const ::std::string& value); + #if LANG_CXX11 + void set_recipient(::std::string&& value); + #endif + void set_recipient(const char* value); + void set_recipient(const char* value, size_t size); + ::std::string* mutable_recipient(); + ::std::string* release_recipient(); + void set_allocated_recipient(::std::string* recipient); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_recipient(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_recipient( + ::std::string* recipient); + + // string phase = 4; + void clear_phase(); + static const int kPhaseFieldNumber = 4; + const ::std::string& phase() const; + void set_phase(const ::std::string& value); + #if LANG_CXX11 + void set_phase(::std::string&& value); + #endif + void set_phase(const char* value); + void set_phase(const char* value, size_t size); + ::std::string* mutable_phase(); + ::std::string* release_phase(); + void set_allocated_phase(::std::string* phase); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_phase(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_phase( + ::std::string* phase); + + // string message = 5; + void clear_message(); + static const int kMessageFieldNumber = 5; + const ::std::string& message() const; + void set_message(const ::std::string& value); + #if LANG_CXX11 + void set_message(::std::string&& value); + #endif + void set_message(const char* value); + void set_message(const char* value, size_t size); + ::std::string* mutable_message(); + ::std::string* release_message(); + void set_allocated_message(::std::string* message); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_message(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_message( + ::std::string* message); + + // int64 time_sent = 3; + void clear_time_sent(); + static const int kTimeSentFieldNumber = 3; + ::google::protobuf::int64 time_sent() const; + void set_time_sent(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.Message) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > tokens_; + mutable int _tokens_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr sender_; + ::google::protobuf::internal::ArenaStringPtr recipient_; + ::google::protobuf::internal::ArenaStringPtr phase_; + ::google::protobuf::internal::ArenaStringPtr message_; + ::google::protobuf::int64 time_sent_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fgame_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class State_Builds : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.State.Builds) */ { + public: + State_Builds(); + virtual ~State_Builds(); + + State_Builds(const State_Builds& from); + + inline State_Builds& operator=(const State_Builds& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + State_Builds(State_Builds&& from) noexcept + : State_Builds() { + *this = ::std::move(from); + } + + inline State_Builds& operator=(State_Builds&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const State_Builds& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const State_Builds* internal_default_instance() { + return reinterpret_cast( + &_State_Builds_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(State_Builds* other); + void Swap(State_Builds* other); + friend void swap(State_Builds& a, State_Builds& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline State_Builds* New() const final { + return CreateMaybeMessage(NULL); + } + + State_Builds* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const State_Builds& from); + void MergeFrom(const State_Builds& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(State_Builds* other); + protected: + explicit State_Builds(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string homes = 2; + int homes_size() const; + void clear_homes(); + static const int kHomesFieldNumber = 2; + const ::std::string& homes(int index) const; + ::std::string* mutable_homes(int index); + void set_homes(int index, const ::std::string& value); + #if LANG_CXX11 + void set_homes(int index, ::std::string&& value); + #endif + void set_homes(int index, const char* value); + void set_homes(int index, const char* value, size_t size); + ::std::string* add_homes(); + void add_homes(const ::std::string& value); + #if LANG_CXX11 + void add_homes(::std::string&& value); + #endif + void add_homes(const char* value); + void add_homes(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& homes() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_homes(); + + // int32 count = 1; + void clear_count(); + static const int kCountFieldNumber = 1; + ::google::protobuf::int32 count() const; + void set_count(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.State.Builds) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> homes_; + ::google::protobuf::int32 count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fgame_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class State_UnitsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + State_UnitsEntry_DoNotUse(); + State_UnitsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const State_UnitsEntry_DoNotUse& other); + static const State_UnitsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_State_UnitsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class State_CentersEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + State_CentersEntry_DoNotUse(); + State_CentersEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const State_CentersEntry_DoNotUse& other); + static const State_CentersEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_State_CentersEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class State_HomesEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + State_HomesEntry_DoNotUse(); + State_HomesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const State_HomesEntry_DoNotUse& other); + static const State_HomesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_State_HomesEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class State_InfluenceEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + State_InfluenceEntry_DoNotUse(); + State_InfluenceEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const State_InfluenceEntry_DoNotUse& other); + static const State_InfluenceEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_State_InfluenceEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class State_CivilDisorderEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + State_CivilDisorderEntry_DoNotUse(); + State_CivilDisorderEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const State_CivilDisorderEntry_DoNotUse& other); + static const State_CivilDisorderEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_State_CivilDisorderEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class State_BuildsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + State_BuildsEntry_DoNotUse(); + State_BuildsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const State_BuildsEntry_DoNotUse& other); + static const State_BuildsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_State_BuildsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class State : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.State) */ { + public: + State(); + virtual ~State(); + + State(const State& from); + + inline State& operator=(const State& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + State(State&& from) noexcept + : State() { + *this = ::std::move(from); + } + + inline State& operator=(State&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const State& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const State* internal_default_instance() { + return reinterpret_cast( + &_State_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(State* other); + void Swap(State* other); + friend void swap(State& a, State& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline State* New() const final { + return CreateMaybeMessage(NULL); + } + + State* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const State& from); + void MergeFrom(const State& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(State* other); + protected: + explicit State(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef State_Builds Builds; + + // accessors ------------------------------------------------------- + + // repeated string rules = 4; + int rules_size() const; + void clear_rules(); + static const int kRulesFieldNumber = 4; + const ::std::string& rules(int index) const; + ::std::string* mutable_rules(int index); + void set_rules(int index, const ::std::string& value); + #if LANG_CXX11 + void set_rules(int index, ::std::string&& value); + #endif + void set_rules(int index, const char* value); + void set_rules(int index, const char* value, size_t size); + ::std::string* add_rules(); + void add_rules(const ::std::string& value); + #if LANG_CXX11 + void add_rules(::std::string&& value); + #endif + void add_rules(const char* value); + void add_rules(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& rules() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_rules(); + + // map units = 5; + int units_size() const; + void clear_units(); + static const int kUnitsFieldNumber = 5; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + units() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_units(); + + // map centers = 6; + int centers_size() const; + void clear_centers(); + static const int kCentersFieldNumber = 6; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + centers() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_centers(); + + // map homes = 7; + int homes_size() const; + void clear_homes(); + static const int kHomesFieldNumber = 7; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + homes() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_homes(); + + // map influence = 8; + int influence_size() const; + void clear_influence(); + static const int kInfluenceFieldNumber = 8; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + influence() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_influence(); + + // map civil_disorder = 9; + int civil_disorder_size() const; + void clear_civil_disorder(); + static const int kCivilDisorderFieldNumber = 9; + const ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >& + civil_disorder() const; + ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >* + mutable_civil_disorder(); + + // map builds = 10; + int builds_size() const; + void clear_builds(); + static const int kBuildsFieldNumber = 10; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >& + builds() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >* + mutable_builds(); + + // repeated uint32 board_state = 12 [packed = true]; + int board_state_size() const; + void clear_board_state(); + static const int kBoardStateFieldNumber = 12; + ::google::protobuf::uint32 board_state(int index) const; + void set_board_state(int index, ::google::protobuf::uint32 value); + void add_board_state(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + board_state() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_board_state(); + + // string game_id = 1; + void clear_game_id(); + static const int kGameIdFieldNumber = 1; + const ::std::string& game_id() const; + void set_game_id(const ::std::string& value); + #if LANG_CXX11 + void set_game_id(::std::string&& value); + #endif + void set_game_id(const char* value); + void set_game_id(const char* value, size_t size); + ::std::string* mutable_game_id(); + ::std::string* release_game_id(); + void set_allocated_game_id(::std::string* game_id); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_game_id(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_game_id( + ::std::string* game_id); + + // string name = 2; + void clear_name(); + static const int kNameFieldNumber = 2; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string map = 3; + void clear_map(); + static const int kMapFieldNumber = 3; + const ::std::string& map() const; + void set_map(const ::std::string& value); + #if LANG_CXX11 + void set_map(::std::string&& value); + #endif + void set_map(const char* value); + void set_map(const char* value, size_t size); + ::std::string* mutable_map(); + ::std::string* release_map(); + void set_allocated_map(::std::string* map); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_map(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_map( + ::std::string* map); + + // string note = 11; + void clear_note(); + static const int kNoteFieldNumber = 11; + const ::std::string& note() const; + void set_note(const ::std::string& value); + #if LANG_CXX11 + void set_note(::std::string&& value); + #endif + void set_note(const char* value); + void set_note(const char* value, size_t size); + ::std::string* mutable_note(); + ::std::string* release_note(); + void set_allocated_note(::std::string* note); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_note(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_note( + ::std::string* note); + + // string zobrist_hash = 13; + void clear_zobrist_hash(); + static const int kZobristHashFieldNumber = 13; + const ::std::string& zobrist_hash() const; + void set_zobrist_hash(const ::std::string& value); + #if LANG_CXX11 + void set_zobrist_hash(::std::string&& value); + #endif + void set_zobrist_hash(const char* value); + void set_zobrist_hash(const char* value, size_t size); + ::std::string* mutable_zobrist_hash(); + ::std::string* release_zobrist_hash(); + void set_allocated_zobrist_hash(::std::string* zobrist_hash); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_zobrist_hash(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_zobrist_hash( + ::std::string* zobrist_hash); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.State) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> rules_; + ::google::protobuf::internal::MapField< + State_UnitsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > units_; + ::google::protobuf::internal::MapField< + State_CentersEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > centers_; + ::google::protobuf::internal::MapField< + State_HomesEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > homes_; + ::google::protobuf::internal::MapField< + State_InfluenceEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > influence_; + ::google::protobuf::internal::MapField< + State_CivilDisorderEntry_DoNotUse, + ::std::string, ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32, + 0 > civil_disorder_; + ::google::protobuf::internal::MapField< + State_BuildsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::State_Builds, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > builds_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > board_state_; + mutable int _board_state_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr game_id_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr map_; + ::google::protobuf::internal::ArenaStringPtr note_; + ::google::protobuf::internal::ArenaStringPtr zobrist_hash_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fgame_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class PhaseHistory_PolicyDetails : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.PhaseHistory.PolicyDetails) */ { + public: + PhaseHistory_PolicyDetails(); + virtual ~PhaseHistory_PolicyDetails(); + + PhaseHistory_PolicyDetails(const PhaseHistory_PolicyDetails& from); + + inline PhaseHistory_PolicyDetails& operator=(const PhaseHistory_PolicyDetails& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + PhaseHistory_PolicyDetails(PhaseHistory_PolicyDetails&& from) noexcept + : PhaseHistory_PolicyDetails() { + *this = ::std::move(from); + } + + inline PhaseHistory_PolicyDetails& operator=(PhaseHistory_PolicyDetails&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const PhaseHistory_PolicyDetails& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const PhaseHistory_PolicyDetails* internal_default_instance() { + return reinterpret_cast( + &_PhaseHistory_PolicyDetails_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void UnsafeArenaSwap(PhaseHistory_PolicyDetails* other); + void Swap(PhaseHistory_PolicyDetails* other); + friend void swap(PhaseHistory_PolicyDetails& a, PhaseHistory_PolicyDetails& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline PhaseHistory_PolicyDetails* New() const final { + return CreateMaybeMessage(NULL); + } + + PhaseHistory_PolicyDetails* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const PhaseHistory_PolicyDetails& from); + void MergeFrom(const PhaseHistory_PolicyDetails& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PhaseHistory_PolicyDetails* other); + protected: + explicit PhaseHistory_PolicyDetails(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string locs = 1; + int locs_size() const; + void clear_locs(); + static const int kLocsFieldNumber = 1; + const ::std::string& locs(int index) const; + ::std::string* mutable_locs(int index); + void set_locs(int index, const ::std::string& value); + #if LANG_CXX11 + void set_locs(int index, ::std::string&& value); + #endif + void set_locs(int index, const char* value); + void set_locs(int index, const char* value, size_t size); + ::std::string* add_locs(); + void add_locs(const ::std::string& value); + #if LANG_CXX11 + void add_locs(::std::string&& value); + #endif + void add_locs(const char* value); + void add_locs(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& locs() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_locs(); + + // repeated int32 tokens = 2; + int tokens_size() const; + void clear_tokens(); + static const int kTokensFieldNumber = 2; + ::google::protobuf::int32 tokens(int index) const; + void set_tokens(int index, ::google::protobuf::int32 value); + void add_tokens(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + tokens() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_tokens(); + + // repeated float log_probs = 3 [packed = true]; + int log_probs_size() const; + void clear_log_probs(); + static const int kLogProbsFieldNumber = 3; + float log_probs(int index) const; + void set_log_probs(int index, float value); + void add_log_probs(float value); + const ::google::protobuf::RepeatedField< float >& + log_probs() const; + ::google::protobuf::RepeatedField< float >* + mutable_log_probs(); + + // bool draw_action = 4; + void clear_draw_action(); + static const int kDrawActionFieldNumber = 4; + bool draw_action() const; + void set_draw_action(bool value); + + // float draw_prob = 5; + void clear_draw_prob(); + static const int kDrawProbFieldNumber = 5; + float draw_prob() const; + void set_draw_prob(float value); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory.PolicyDetails) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> locs_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > tokens_; + mutable int _tokens_cached_byte_size_; + ::google::protobuf::RepeatedField< float > log_probs_; + mutable int _log_probs_cached_byte_size_; + bool draw_action_; + float draw_prob_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fgame_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class PhaseHistory_OrdersEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + PhaseHistory_OrdersEntry_DoNotUse(); + PhaseHistory_OrdersEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const PhaseHistory_OrdersEntry_DoNotUse& other); + static const PhaseHistory_OrdersEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_PhaseHistory_OrdersEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class PhaseHistory_ResultsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + PhaseHistory_ResultsEntry_DoNotUse(); + PhaseHistory_ResultsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const PhaseHistory_ResultsEntry_DoNotUse& other); + static const PhaseHistory_ResultsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_PhaseHistory_ResultsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class PhaseHistory_PolicyEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + PhaseHistory_PolicyEntry_DoNotUse(); + PhaseHistory_PolicyEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const PhaseHistory_PolicyEntry_DoNotUse& other); + static const PhaseHistory_PolicyEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_PhaseHistory_PolicyEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class PhaseHistory_StateValueEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + PhaseHistory_StateValueEntry_DoNotUse(); + PhaseHistory_StateValueEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const PhaseHistory_StateValueEntry_DoNotUse& other); + static const PhaseHistory_StateValueEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_PhaseHistory_StateValueEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class PhaseHistory_PossibleOrdersEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + PhaseHistory_PossibleOrdersEntry_DoNotUse(); + PhaseHistory_PossibleOrdersEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const PhaseHistory_PossibleOrdersEntry_DoNotUse& other); + static const PhaseHistory_PossibleOrdersEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_PhaseHistory_PossibleOrdersEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class PhaseHistory : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.PhaseHistory) */ { + public: + PhaseHistory(); + virtual ~PhaseHistory(); + + PhaseHistory(const PhaseHistory& from); + + inline PhaseHistory& operator=(const PhaseHistory& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + PhaseHistory(PhaseHistory&& from) noexcept + : PhaseHistory() { + *this = ::std::move(from); + } + + inline PhaseHistory& operator=(PhaseHistory&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const PhaseHistory& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const PhaseHistory* internal_default_instance() { + return reinterpret_cast( + &_PhaseHistory_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void UnsafeArenaSwap(PhaseHistory* other); + void Swap(PhaseHistory* other); + friend void swap(PhaseHistory& a, PhaseHistory& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline PhaseHistory* New() const final { + return CreateMaybeMessage(NULL); + } + + PhaseHistory* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const PhaseHistory& from); + void MergeFrom(const PhaseHistory& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PhaseHistory* other); + protected: + explicit PhaseHistory(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef PhaseHistory_PolicyDetails PolicyDetails; + + // accessors ------------------------------------------------------- + + // map orders = 3; + int orders_size() const; + void clear_orders(); + static const int kOrdersFieldNumber = 3; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + orders() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_orders(); + + // map results = 4; + int results_size() const; + void clear_results(); + static const int kResultsFieldNumber = 4; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + results() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_results(); + + // map policy = 6; + int policy_size() const; + void clear_policy(); + static const int kPolicyFieldNumber = 6; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >& + policy() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >* + mutable_policy(); + + // map possible_orders = 7; + int possible_orders_size() const; + void clear_possible_orders(); + static const int kPossibleOrdersFieldNumber = 7; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& + possible_orders() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* + mutable_possible_orders(); + + // repeated uint32 prev_orders_state = 8 [packed = true]; + int prev_orders_state_size() const; + void clear_prev_orders_state(); + static const int kPrevOrdersStateFieldNumber = 8; + ::google::protobuf::uint32 prev_orders_state(int index) const; + void set_prev_orders_state(int index, ::google::protobuf::uint32 value); + void add_prev_orders_state(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + prev_orders_state() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_prev_orders_state(); + + // map state_value = 9; + int state_value_size() const; + void clear_state_value(); + static const int kStateValueFieldNumber = 9; + const ::google::protobuf::Map< ::std::string, float >& + state_value() const; + ::google::protobuf::Map< ::std::string, float >* + mutable_state_value(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // .diplomacy_proto.State state = 2; + bool has_state() const; + void clear_state(); + static const int kStateFieldNumber = 2; + private: + const ::diplomacy_proto::State& _internal_state() const; + public: + const ::diplomacy_proto::State& state() const; + ::diplomacy_proto::State* release_state(); + ::diplomacy_proto::State* mutable_state(); + void set_allocated_state(::diplomacy_proto::State* state); + void unsafe_arena_set_allocated_state( + ::diplomacy_proto::State* state); + ::diplomacy_proto::State* unsafe_arena_release_state(); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + PhaseHistory_OrdersEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > orders_; + ::google::protobuf::internal::MapField< + PhaseHistory_ResultsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > results_; + ::google::protobuf::internal::MapField< + PhaseHistory_PolicyEntry_DoNotUse, + ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > policy_; + ::google::protobuf::internal::MapField< + PhaseHistory_PossibleOrdersEntry_DoNotUse, + ::std::string, ::diplomacy_proto::StringList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > possible_orders_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > prev_orders_state_; + mutable int _prev_orders_state_cached_byte_size_; + ::google::protobuf::internal::MapField< + PhaseHistory_StateValueEntry_DoNotUse, + ::std::string, float, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT, + 0 > state_value_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::diplomacy_proto::State* state_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fgame_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SavedGame_KeywordArgs : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.SavedGame.KeywordArgs) */ { + public: + SavedGame_KeywordArgs(); + virtual ~SavedGame_KeywordArgs(); + + SavedGame_KeywordArgs(const SavedGame_KeywordArgs& from); + + inline SavedGame_KeywordArgs& operator=(const SavedGame_KeywordArgs& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SavedGame_KeywordArgs(SavedGame_KeywordArgs&& from) noexcept + : SavedGame_KeywordArgs() { + *this = ::std::move(from); + } + + inline SavedGame_KeywordArgs& operator=(SavedGame_KeywordArgs&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SavedGame_KeywordArgs& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SavedGame_KeywordArgs* internal_default_instance() { + return reinterpret_cast( + &_SavedGame_KeywordArgs_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + void UnsafeArenaSwap(SavedGame_KeywordArgs* other); + void Swap(SavedGame_KeywordArgs* other); + friend void swap(SavedGame_KeywordArgs& a, SavedGame_KeywordArgs& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SavedGame_KeywordArgs* New() const final { + return CreateMaybeMessage(NULL); + } + + SavedGame_KeywordArgs* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SavedGame_KeywordArgs& from); + void MergeFrom(const SavedGame_KeywordArgs& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SavedGame_KeywordArgs* other); + protected: + explicit SavedGame_KeywordArgs(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 player_seed = 1; + void clear_player_seed(); + static const int kPlayerSeedFieldNumber = 1; + ::google::protobuf::int32 player_seed() const; + void set_player_seed(::google::protobuf::int32 value); + + // float noise = 2; + void clear_noise(); + static const int kNoiseFieldNumber = 2; + float noise() const; + void set_noise(float value); + + // float temperature = 3; + void clear_temperature(); + static const int kTemperatureFieldNumber = 3; + float temperature() const; + void set_temperature(float value); + + // float dropout_rate = 5; + void clear_dropout_rate(); + static const int kDropoutRateFieldNumber = 5; + float dropout_rate() const; + void set_dropout_rate(float value); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.SavedGame.KeywordArgs) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 player_seed_; + float noise_; + float temperature_; + float dropout_rate_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fgame_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SavedGame_KwargsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + SavedGame_KwargsEntry_DoNotUse(); + SavedGame_KwargsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const SavedGame_KwargsEntry_DoNotUse& other); + static const SavedGame_KwargsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_SavedGame_KwargsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class SavedGame_RewardsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + SavedGame_RewardsEntry_DoNotUse(); + SavedGame_RewardsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const SavedGame_RewardsEntry_DoNotUse& other); + static const SavedGame_RewardsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_SavedGame_RewardsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class SavedGame_ReturnsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + SavedGame_ReturnsEntry_DoNotUse(); + SavedGame_ReturnsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const SavedGame_ReturnsEntry_DoNotUse& other); + static const SavedGame_ReturnsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_SavedGame_ReturnsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class SavedGame : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy_proto.SavedGame) */ { + public: + SavedGame(); + virtual ~SavedGame(); + + SavedGame(const SavedGame& from); + + inline SavedGame& operator=(const SavedGame& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SavedGame(SavedGame&& from) noexcept + : SavedGame() { + *this = ::std::move(from); + } + + inline SavedGame& operator=(SavedGame&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SavedGame& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SavedGame* internal_default_instance() { + return reinterpret_cast( + &_SavedGame_default_instance_); + } + static constexpr int kIndexInFileMessages = + 20; + + void UnsafeArenaSwap(SavedGame* other); + void Swap(SavedGame* other); + friend void swap(SavedGame& a, SavedGame& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SavedGame* New() const final { + return CreateMaybeMessage(NULL); + } + + SavedGame* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SavedGame& from); + void MergeFrom(const SavedGame& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SavedGame* other); + protected: + explicit SavedGame(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef SavedGame_KeywordArgs KeywordArgs; + + // accessors ------------------------------------------------------- + + // repeated string rules = 3; + int rules_size() const; + void clear_rules(); + static const int kRulesFieldNumber = 3; + const ::std::string& rules(int index) const; + ::std::string* mutable_rules(int index); + void set_rules(int index, const ::std::string& value); + #if LANG_CXX11 + void set_rules(int index, ::std::string&& value); + #endif + void set_rules(int index, const char* value); + void set_rules(int index, const char* value, size_t size); + ::std::string* add_rules(); + void add_rules(const ::std::string& value); + #if LANG_CXX11 + void add_rules(::std::string&& value); + #endif + void add_rules(const char* value); + void add_rules(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& rules() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_rules(); + + // repeated .diplomacy_proto.PhaseHistory phases = 4; + int phases_size() const; + void clear_phases(); + static const int kPhasesFieldNumber = 4; + ::diplomacy_proto::PhaseHistory* mutable_phases(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy_proto::PhaseHistory >* + mutable_phases(); + const ::diplomacy_proto::PhaseHistory& phases(int index) const; + ::diplomacy_proto::PhaseHistory* add_phases(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy_proto::PhaseHistory >& + phases() const; + + // repeated string assigned_powers = 5; + int assigned_powers_size() const; + void clear_assigned_powers(); + static const int kAssignedPowersFieldNumber = 5; + const ::std::string& assigned_powers(int index) const; + ::std::string* mutable_assigned_powers(int index); + void set_assigned_powers(int index, const ::std::string& value); + #if LANG_CXX11 + void set_assigned_powers(int index, ::std::string&& value); + #endif + void set_assigned_powers(int index, const char* value); + void set_assigned_powers(int index, const char* value, size_t size); + ::std::string* add_assigned_powers(); + void add_assigned_powers(const ::std::string& value); + #if LANG_CXX11 + void add_assigned_powers(::std::string&& value); + #endif + void add_assigned_powers(const char* value); + void add_assigned_powers(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& assigned_powers() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_assigned_powers(); + + // map rewards = 8; + int rewards_size() const; + void clear_rewards(); + static const int kRewardsFieldNumber = 8; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >& + rewards() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >* + mutable_rewards(); + + // map kwargs = 10; + int kwargs_size() const; + void clear_kwargs(); + static const int kKwargsFieldNumber = 10; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >& + kwargs() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >* + mutable_kwargs(); + + // repeated string players = 11; + int players_size() const; + void clear_players(); + static const int kPlayersFieldNumber = 11; + const ::std::string& players(int index) const; + ::std::string* mutable_players(int index); + void set_players(int index, const ::std::string& value); + #if LANG_CXX11 + void set_players(int index, ::std::string&& value); + #endif + void set_players(int index, const char* value); + void set_players(int index, const char* value, size_t size); + ::std::string* add_players(); + void add_players(const ::std::string& value); + #if LANG_CXX11 + void add_players(::std::string&& value); + #endif + void add_players(const char* value); + void add_players(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& players() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_players(); + + // map returns = 13; + int returns_size() const; + void clear_returns(); + static const int kReturnsFieldNumber = 13; + const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >& + returns() const; + ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >* + mutable_returns(); + + // string id = 1; + void clear_id(); + static const int kIdFieldNumber = 1; + const ::std::string& id() const; + void set_id(const ::std::string& value); + #if LANG_CXX11 + void set_id(::std::string&& value); + #endif + void set_id(const char* value); + void set_id(const char* value, size_t size); + ::std::string* mutable_id(); + ::std::string* release_id(); + void set_allocated_id(::std::string* id); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_id(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_id( + ::std::string* id); + + // string map = 2; + void clear_map(); + static const int kMapFieldNumber = 2; + const ::std::string& map() const; + void set_map(const ::std::string& value); + #if LANG_CXX11 + void set_map(::std::string&& value); + #endif + void set_map(const char* value); + void set_map(const char* value, size_t size); + ::std::string* mutable_map(); + ::std::string* release_map(); + void set_allocated_map(::std::string* map); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_map(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_map( + ::std::string* map); + + // string done_reason = 6; + void clear_done_reason(); + static const int kDoneReasonFieldNumber = 6; + const ::std::string& done_reason() const; + void set_done_reason(const ::std::string& value); + #if LANG_CXX11 + void set_done_reason(::std::string&& value); + #endif + void set_done_reason(const char* value); + void set_done_reason(const char* value, size_t size); + ::std::string* mutable_done_reason(); + ::std::string* release_done_reason(); + void set_allocated_done_reason(::std::string* done_reason); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_done_reason(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_done_reason( + ::std::string* done_reason); + + // string reward_fn = 7; + void clear_reward_fn(); + static const int kRewardFnFieldNumber = 7; + const ::std::string& reward_fn() const; + void set_reward_fn(const ::std::string& value); + #if LANG_CXX11 + void set_reward_fn(::std::string&& value); + #endif + void set_reward_fn(const char* value); + void set_reward_fn(const char* value, size_t size); + ::std::string* mutable_reward_fn(); + ::std::string* release_reward_fn(); + void set_allocated_reward_fn(::std::string* reward_fn); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_reward_fn(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_reward_fn( + ::std::string* reward_fn); + + // int32 start_phase_ix = 9; + void clear_start_phase_ix(); + static const int kStartPhaseIxFieldNumber = 9; + ::google::protobuf::int32 start_phase_ix() const; + void set_start_phase_ix(::google::protobuf::int32 value); + + // bool is_partial_game = 12; + void clear_is_partial_game(); + static const int kIsPartialGameFieldNumber = 12; + bool is_partial_game() const; + void set_is_partial_game(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy_proto.SavedGame) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> rules_; + ::google::protobuf::RepeatedPtrField< ::diplomacy_proto::PhaseHistory > phases_; + ::google::protobuf::RepeatedPtrField< ::std::string> assigned_powers_; + ::google::protobuf::internal::MapField< + SavedGame_RewardsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::FloatList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > rewards_; + ::google::protobuf::internal::MapField< + SavedGame_KwargsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > kwargs_; + ::google::protobuf::RepeatedPtrField< ::std::string> players_; + ::google::protobuf::internal::MapField< + SavedGame_ReturnsEntry_DoNotUse, + ::std::string, ::diplomacy_proto::FloatList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > returns_; + ::google::protobuf::internal::ArenaStringPtr id_; + ::google::protobuf::internal::ArenaStringPtr map_; + ::google::protobuf::internal::ArenaStringPtr done_reason_; + ::google::protobuf::internal::ArenaStringPtr reward_fn_; + ::google::protobuf::int32 start_phase_ix_; + bool is_partial_game_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5fproto_2fgame_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Message + +// string sender = 1; +inline void Message::clear_sender() { + sender_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Message::sender() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.Message.sender) + return sender_.Get(); +} +inline void Message::set_sender(const ::std::string& value) { + + sender_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.Message.sender) +} +#if LANG_CXX11 +inline void Message::set_sender(::std::string&& value) { + + sender_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.Message.sender) +} +#endif +inline void Message::set_sender(const char* value) { + GOOGLE_DCHECK(value != NULL); + + sender_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.Message.sender) +} +inline void Message::set_sender(const char* value, + size_t size) { + + sender_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.Message.sender) +} +inline ::std::string* Message::mutable_sender() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.Message.sender) + return sender_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Message::release_sender() { + // @@protoc_insertion_point(field_release:diplomacy_proto.Message.sender) + + return sender_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Message::set_allocated_sender(::std::string* sender) { + if (sender != NULL) { + + } else { + + } + sender_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), sender, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.Message.sender) +} +inline ::std::string* Message::unsafe_arena_release_sender() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.Message.sender) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return sender_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Message::unsafe_arena_set_allocated_sender( + ::std::string* sender) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (sender != NULL) { + + } else { + + } + sender_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + sender, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.Message.sender) +} + +// string recipient = 2; +inline void Message::clear_recipient() { + recipient_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Message::recipient() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.Message.recipient) + return recipient_.Get(); +} +inline void Message::set_recipient(const ::std::string& value) { + + recipient_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.Message.recipient) +} +#if LANG_CXX11 +inline void Message::set_recipient(::std::string&& value) { + + recipient_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.Message.recipient) +} +#endif +inline void Message::set_recipient(const char* value) { + GOOGLE_DCHECK(value != NULL); + + recipient_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.Message.recipient) +} +inline void Message::set_recipient(const char* value, + size_t size) { + + recipient_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.Message.recipient) +} +inline ::std::string* Message::mutable_recipient() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.Message.recipient) + return recipient_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Message::release_recipient() { + // @@protoc_insertion_point(field_release:diplomacy_proto.Message.recipient) + + return recipient_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Message::set_allocated_recipient(::std::string* recipient) { + if (recipient != NULL) { + + } else { + + } + recipient_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), recipient, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.Message.recipient) +} +inline ::std::string* Message::unsafe_arena_release_recipient() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.Message.recipient) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return recipient_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Message::unsafe_arena_set_allocated_recipient( + ::std::string* recipient) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (recipient != NULL) { + + } else { + + } + recipient_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + recipient, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.Message.recipient) +} + +// int64 time_sent = 3; +inline void Message::clear_time_sent() { + time_sent_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 Message::time_sent() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.Message.time_sent) + return time_sent_; +} +inline void Message::set_time_sent(::google::protobuf::int64 value) { + + time_sent_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.Message.time_sent) +} + +// string phase = 4; +inline void Message::clear_phase() { + phase_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Message::phase() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.Message.phase) + return phase_.Get(); +} +inline void Message::set_phase(const ::std::string& value) { + + phase_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.Message.phase) +} +#if LANG_CXX11 +inline void Message::set_phase(::std::string&& value) { + + phase_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.Message.phase) +} +#endif +inline void Message::set_phase(const char* value) { + GOOGLE_DCHECK(value != NULL); + + phase_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.Message.phase) +} +inline void Message::set_phase(const char* value, + size_t size) { + + phase_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.Message.phase) +} +inline ::std::string* Message::mutable_phase() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.Message.phase) + return phase_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Message::release_phase() { + // @@protoc_insertion_point(field_release:diplomacy_proto.Message.phase) + + return phase_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Message::set_allocated_phase(::std::string* phase) { + if (phase != NULL) { + + } else { + + } + phase_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), phase, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.Message.phase) +} +inline ::std::string* Message::unsafe_arena_release_phase() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.Message.phase) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return phase_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Message::unsafe_arena_set_allocated_phase( + ::std::string* phase) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (phase != NULL) { + + } else { + + } + phase_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + phase, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.Message.phase) +} + +// string message = 5; +inline void Message::clear_message() { + message_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Message::message() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.Message.message) + return message_.Get(); +} +inline void Message::set_message(const ::std::string& value) { + + message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.Message.message) +} +#if LANG_CXX11 +inline void Message::set_message(::std::string&& value) { + + message_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.Message.message) +} +#endif +inline void Message::set_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.Message.message) +} +inline void Message::set_message(const char* value, + size_t size) { + + message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.Message.message) +} +inline ::std::string* Message::mutable_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.Message.message) + return message_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Message::release_message() { + // @@protoc_insertion_point(field_release:diplomacy_proto.Message.message) + + return message_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Message::set_allocated_message(::std::string* message) { + if (message != NULL) { + + } else { + + } + message_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), message, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.Message.message) +} +inline ::std::string* Message::unsafe_arena_release_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.Message.message) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return message_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Message::unsafe_arena_set_allocated_message( + ::std::string* message) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (message != NULL) { + + } else { + + } + message_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + message, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.Message.message) +} + +// repeated uint32 tokens = 6 [packed = true]; +inline int Message::tokens_size() const { + return tokens_.size(); +} +inline void Message::clear_tokens() { + tokens_.Clear(); +} +inline ::google::protobuf::uint32 Message::tokens(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.Message.tokens) + return tokens_.Get(index); +} +inline void Message::set_tokens(int index, ::google::protobuf::uint32 value) { + tokens_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.Message.tokens) +} +inline void Message::add_tokens(::google::protobuf::uint32 value) { + tokens_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.Message.tokens) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Message::tokens() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.Message.tokens) + return tokens_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Message::mutable_tokens() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.Message.tokens) + return &tokens_; +} + +// ------------------------------------------------------------------- + +// State_Builds + +// int32 count = 1; +inline void State_Builds::clear_count() { + count_ = 0; +} +inline ::google::protobuf::int32 State_Builds::count() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.Builds.count) + return count_; +} +inline void State_Builds::set_count(::google::protobuf::int32 value) { + + count_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.State.Builds.count) +} + +// repeated string homes = 2; +inline int State_Builds::homes_size() const { + return homes_.size(); +} +inline void State_Builds::clear_homes() { + homes_.Clear(); +} +inline const ::std::string& State_Builds::homes(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.Builds.homes) + return homes_.Get(index); +} +inline ::std::string* State_Builds::mutable_homes(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.State.Builds.homes) + return homes_.Mutable(index); +} +inline void State_Builds::set_homes(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.State.Builds.homes) + homes_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void State_Builds::set_homes(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.State.Builds.homes) + homes_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void State_Builds::set_homes(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + homes_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.State.Builds.homes) +} +inline void State_Builds::set_homes(int index, const char* value, size_t size) { + homes_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.State.Builds.homes) +} +inline ::std::string* State_Builds::add_homes() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.State.Builds.homes) + return homes_.Add(); +} +inline void State_Builds::add_homes(const ::std::string& value) { + homes_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.State.Builds.homes) +} +#if LANG_CXX11 +inline void State_Builds::add_homes(::std::string&& value) { + homes_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.State.Builds.homes) +} +#endif +inline void State_Builds::add_homes(const char* value) { + GOOGLE_DCHECK(value != NULL); + homes_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.State.Builds.homes) +} +inline void State_Builds::add_homes(const char* value, size_t size) { + homes_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.State.Builds.homes) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +State_Builds::homes() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.State.Builds.homes) + return homes_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +State_Builds::mutable_homes() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.State.Builds.homes) + return &homes_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// State + +// string game_id = 1; +inline void State::clear_game_id() { + game_id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& State::game_id() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.game_id) + return game_id_.Get(); +} +inline void State::set_game_id(const ::std::string& value) { + + game_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.State.game_id) +} +#if LANG_CXX11 +inline void State::set_game_id(::std::string&& value) { + + game_id_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.State.game_id) +} +#endif +inline void State::set_game_id(const char* value) { + GOOGLE_DCHECK(value != NULL); + + game_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.State.game_id) +} +inline void State::set_game_id(const char* value, + size_t size) { + + game_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.State.game_id) +} +inline ::std::string* State::mutable_game_id() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.State.game_id) + return game_id_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* State::release_game_id() { + // @@protoc_insertion_point(field_release:diplomacy_proto.State.game_id) + + return game_id_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void State::set_allocated_game_id(::std::string* game_id) { + if (game_id != NULL) { + + } else { + + } + game_id_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), game_id, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.State.game_id) +} +inline ::std::string* State::unsafe_arena_release_game_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.State.game_id) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return game_id_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void State::unsafe_arena_set_allocated_game_id( + ::std::string* game_id) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (game_id != NULL) { + + } else { + + } + game_id_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + game_id, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.State.game_id) +} + +// string name = 2; +inline void State::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& State::name() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.name) + return name_.Get(); +} +inline void State::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.State.name) +} +#if LANG_CXX11 +inline void State::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.State.name) +} +#endif +inline void State::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.State.name) +} +inline void State::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.State.name) +} +inline ::std::string* State::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.State.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* State::release_name() { + // @@protoc_insertion_point(field_release:diplomacy_proto.State.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void State::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.State.name) +} +inline ::std::string* State::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.State.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void State::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.State.name) +} + +// string map = 3; +inline void State::clear_map() { + map_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& State::map() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.map) + return map_.Get(); +} +inline void State::set_map(const ::std::string& value) { + + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.State.map) +} +#if LANG_CXX11 +inline void State::set_map(::std::string&& value) { + + map_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.State.map) +} +#endif +inline void State::set_map(const char* value) { + GOOGLE_DCHECK(value != NULL); + + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.State.map) +} +inline void State::set_map(const char* value, + size_t size) { + + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.State.map) +} +inline ::std::string* State::mutable_map() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.State.map) + return map_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* State::release_map() { + // @@protoc_insertion_point(field_release:diplomacy_proto.State.map) + + return map_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void State::set_allocated_map(::std::string* map) { + if (map != NULL) { + + } else { + + } + map_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), map, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.State.map) +} +inline ::std::string* State::unsafe_arena_release_map() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.State.map) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return map_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void State::unsafe_arena_set_allocated_map( + ::std::string* map) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (map != NULL) { + + } else { + + } + map_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + map, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.State.map) +} + +// string zobrist_hash = 13; +inline void State::clear_zobrist_hash() { + zobrist_hash_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& State::zobrist_hash() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.zobrist_hash) + return zobrist_hash_.Get(); +} +inline void State::set_zobrist_hash(const ::std::string& value) { + + zobrist_hash_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.State.zobrist_hash) +} +#if LANG_CXX11 +inline void State::set_zobrist_hash(::std::string&& value) { + + zobrist_hash_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.State.zobrist_hash) +} +#endif +inline void State::set_zobrist_hash(const char* value) { + GOOGLE_DCHECK(value != NULL); + + zobrist_hash_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.State.zobrist_hash) +} +inline void State::set_zobrist_hash(const char* value, + size_t size) { + + zobrist_hash_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.State.zobrist_hash) +} +inline ::std::string* State::mutable_zobrist_hash() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.State.zobrist_hash) + return zobrist_hash_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* State::release_zobrist_hash() { + // @@protoc_insertion_point(field_release:diplomacy_proto.State.zobrist_hash) + + return zobrist_hash_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void State::set_allocated_zobrist_hash(::std::string* zobrist_hash) { + if (zobrist_hash != NULL) { + + } else { + + } + zobrist_hash_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), zobrist_hash, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.State.zobrist_hash) +} +inline ::std::string* State::unsafe_arena_release_zobrist_hash() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.State.zobrist_hash) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return zobrist_hash_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void State::unsafe_arena_set_allocated_zobrist_hash( + ::std::string* zobrist_hash) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (zobrist_hash != NULL) { + + } else { + + } + zobrist_hash_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + zobrist_hash, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.State.zobrist_hash) +} + +// repeated string rules = 4; +inline int State::rules_size() const { + return rules_.size(); +} +inline void State::clear_rules() { + rules_.Clear(); +} +inline const ::std::string& State::rules(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.rules) + return rules_.Get(index); +} +inline ::std::string* State::mutable_rules(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.State.rules) + return rules_.Mutable(index); +} +inline void State::set_rules(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.State.rules) + rules_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void State::set_rules(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.State.rules) + rules_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void State::set_rules(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + rules_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.State.rules) +} +inline void State::set_rules(int index, const char* value, size_t size) { + rules_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.State.rules) +} +inline ::std::string* State::add_rules() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.State.rules) + return rules_.Add(); +} +inline void State::add_rules(const ::std::string& value) { + rules_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.State.rules) +} +#if LANG_CXX11 +inline void State::add_rules(::std::string&& value) { + rules_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.State.rules) +} +#endif +inline void State::add_rules(const char* value) { + GOOGLE_DCHECK(value != NULL); + rules_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.State.rules) +} +inline void State::add_rules(const char* value, size_t size) { + rules_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.State.rules) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +State::rules() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.State.rules) + return rules_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +State::mutable_rules() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.State.rules) + return &rules_; +} + +// map units = 5; +inline int State::units_size() const { + return units_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +State::units() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.State.units) + return units_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +State::mutable_units() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.State.units) + return units_.MutableMap(); +} + +// map centers = 6; +inline int State::centers_size() const { + return centers_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +State::centers() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.State.centers) + return centers_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +State::mutable_centers() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.State.centers) + return centers_.MutableMap(); +} + +// map homes = 7; +inline int State::homes_size() const { + return homes_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +State::homes() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.State.homes) + return homes_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +State::mutable_homes() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.State.homes) + return homes_.MutableMap(); +} + +// map influence = 8; +inline int State::influence_size() const { + return influence_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +State::influence() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.State.influence) + return influence_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +State::mutable_influence() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.State.influence) + return influence_.MutableMap(); +} + +// map civil_disorder = 9; +inline int State::civil_disorder_size() const { + return civil_disorder_.size(); +} +inline void State::clear_civil_disorder() { + civil_disorder_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >& +State::civil_disorder() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.State.civil_disorder) + return civil_disorder_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::google::protobuf::int32 >* +State::mutable_civil_disorder() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.State.civil_disorder) + return civil_disorder_.MutableMap(); +} + +// map builds = 10; +inline int State::builds_size() const { + return builds_.size(); +} +inline void State::clear_builds() { + builds_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >& +State::builds() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.State.builds) + return builds_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::State_Builds >* +State::mutable_builds() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.State.builds) + return builds_.MutableMap(); +} + +// string note = 11; +inline void State::clear_note() { + note_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& State::note() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.note) + return note_.Get(); +} +inline void State::set_note(const ::std::string& value) { + + note_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.State.note) +} +#if LANG_CXX11 +inline void State::set_note(::std::string&& value) { + + note_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.State.note) +} +#endif +inline void State::set_note(const char* value) { + GOOGLE_DCHECK(value != NULL); + + note_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.State.note) +} +inline void State::set_note(const char* value, + size_t size) { + + note_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.State.note) +} +inline ::std::string* State::mutable_note() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.State.note) + return note_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* State::release_note() { + // @@protoc_insertion_point(field_release:diplomacy_proto.State.note) + + return note_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void State::set_allocated_note(::std::string* note) { + if (note != NULL) { + + } else { + + } + note_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), note, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.State.note) +} +inline ::std::string* State::unsafe_arena_release_note() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.State.note) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return note_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void State::unsafe_arena_set_allocated_note( + ::std::string* note) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (note != NULL) { + + } else { + + } + note_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + note, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.State.note) +} + +// repeated uint32 board_state = 12 [packed = true]; +inline int State::board_state_size() const { + return board_state_.size(); +} +inline void State::clear_board_state() { + board_state_.Clear(); +} +inline ::google::protobuf::uint32 State::board_state(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.State.board_state) + return board_state_.Get(index); +} +inline void State::set_board_state(int index, ::google::protobuf::uint32 value) { + board_state_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.State.board_state) +} +inline void State::add_board_state(::google::protobuf::uint32 value) { + board_state_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.State.board_state) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +State::board_state() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.State.board_state) + return board_state_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +State::mutable_board_state() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.State.board_state) + return &board_state_; +} + +// ------------------------------------------------------------------- + +// PhaseHistory_PolicyDetails + +// repeated string locs = 1; +inline int PhaseHistory_PolicyDetails::locs_size() const { + return locs_.size(); +} +inline void PhaseHistory_PolicyDetails::clear_locs() { + locs_.Clear(); +} +inline const ::std::string& PhaseHistory_PolicyDetails::locs(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.PolicyDetails.locs) + return locs_.Get(index); +} +inline ::std::string* PhaseHistory_PolicyDetails::mutable_locs(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.PhaseHistory.PolicyDetails.locs) + return locs_.Mutable(index); +} +inline void PhaseHistory_PolicyDetails::set_locs(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.PolicyDetails.locs) + locs_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void PhaseHistory_PolicyDetails::set_locs(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.PolicyDetails.locs) + locs_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void PhaseHistory_PolicyDetails::set_locs(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + locs_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.PhaseHistory.PolicyDetails.locs) +} +inline void PhaseHistory_PolicyDetails::set_locs(int index, const char* value, size_t size) { + locs_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.PhaseHistory.PolicyDetails.locs) +} +inline ::std::string* PhaseHistory_PolicyDetails::add_locs() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.PhaseHistory.PolicyDetails.locs) + return locs_.Add(); +} +inline void PhaseHistory_PolicyDetails::add_locs(const ::std::string& value) { + locs_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.PhaseHistory.PolicyDetails.locs) +} +#if LANG_CXX11 +inline void PhaseHistory_PolicyDetails::add_locs(::std::string&& value) { + locs_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.PhaseHistory.PolicyDetails.locs) +} +#endif +inline void PhaseHistory_PolicyDetails::add_locs(const char* value) { + GOOGLE_DCHECK(value != NULL); + locs_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.PhaseHistory.PolicyDetails.locs) +} +inline void PhaseHistory_PolicyDetails::add_locs(const char* value, size_t size) { + locs_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.PhaseHistory.PolicyDetails.locs) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +PhaseHistory_PolicyDetails::locs() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.PhaseHistory.PolicyDetails.locs) + return locs_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +PhaseHistory_PolicyDetails::mutable_locs() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.PhaseHistory.PolicyDetails.locs) + return &locs_; +} + +// repeated int32 tokens = 2; +inline int PhaseHistory_PolicyDetails::tokens_size() const { + return tokens_.size(); +} +inline void PhaseHistory_PolicyDetails::clear_tokens() { + tokens_.Clear(); +} +inline ::google::protobuf::int32 PhaseHistory_PolicyDetails::tokens(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.PolicyDetails.tokens) + return tokens_.Get(index); +} +inline void PhaseHistory_PolicyDetails::set_tokens(int index, ::google::protobuf::int32 value) { + tokens_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.PolicyDetails.tokens) +} +inline void PhaseHistory_PolicyDetails::add_tokens(::google::protobuf::int32 value) { + tokens_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.PhaseHistory.PolicyDetails.tokens) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +PhaseHistory_PolicyDetails::tokens() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.PhaseHistory.PolicyDetails.tokens) + return tokens_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +PhaseHistory_PolicyDetails::mutable_tokens() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.PhaseHistory.PolicyDetails.tokens) + return &tokens_; +} + +// repeated float log_probs = 3 [packed = true]; +inline int PhaseHistory_PolicyDetails::log_probs_size() const { + return log_probs_.size(); +} +inline void PhaseHistory_PolicyDetails::clear_log_probs() { + log_probs_.Clear(); +} +inline float PhaseHistory_PolicyDetails::log_probs(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.PolicyDetails.log_probs) + return log_probs_.Get(index); +} +inline void PhaseHistory_PolicyDetails::set_log_probs(int index, float value) { + log_probs_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.PolicyDetails.log_probs) +} +inline void PhaseHistory_PolicyDetails::add_log_probs(float value) { + log_probs_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.PhaseHistory.PolicyDetails.log_probs) +} +inline const ::google::protobuf::RepeatedField< float >& +PhaseHistory_PolicyDetails::log_probs() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.PhaseHistory.PolicyDetails.log_probs) + return log_probs_; +} +inline ::google::protobuf::RepeatedField< float >* +PhaseHistory_PolicyDetails::mutable_log_probs() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.PhaseHistory.PolicyDetails.log_probs) + return &log_probs_; +} + +// bool draw_action = 4; +inline void PhaseHistory_PolicyDetails::clear_draw_action() { + draw_action_ = false; +} +inline bool PhaseHistory_PolicyDetails::draw_action() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.PolicyDetails.draw_action) + return draw_action_; +} +inline void PhaseHistory_PolicyDetails::set_draw_action(bool value) { + + draw_action_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.PolicyDetails.draw_action) +} + +// float draw_prob = 5; +inline void PhaseHistory_PolicyDetails::clear_draw_prob() { + draw_prob_ = 0; +} +inline float PhaseHistory_PolicyDetails::draw_prob() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.PolicyDetails.draw_prob) + return draw_prob_; +} +inline void PhaseHistory_PolicyDetails::set_draw_prob(float value) { + + draw_prob_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.PolicyDetails.draw_prob) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// PhaseHistory + +// string name = 1; +inline void PhaseHistory::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& PhaseHistory::name() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.name) + return name_.Get(); +} +inline void PhaseHistory::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.name) +} +#if LANG_CXX11 +inline void PhaseHistory::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.PhaseHistory.name) +} +#endif +inline void PhaseHistory::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.PhaseHistory.name) +} +inline void PhaseHistory::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.PhaseHistory.name) +} +inline ::std::string* PhaseHistory::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.PhaseHistory.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* PhaseHistory::release_name() { + // @@protoc_insertion_point(field_release:diplomacy_proto.PhaseHistory.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void PhaseHistory::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.PhaseHistory.name) +} +inline ::std::string* PhaseHistory::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.PhaseHistory.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void PhaseHistory::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.PhaseHistory.name) +} + +// .diplomacy_proto.State state = 2; +inline bool PhaseHistory::has_state() const { + return this != internal_default_instance() && state_ != NULL; +} +inline void PhaseHistory::clear_state() { + if (GetArenaNoVirtual() == NULL && state_ != NULL) { + delete state_; + } + state_ = NULL; +} +inline const ::diplomacy_proto::State& PhaseHistory::_internal_state() const { + return *state_; +} +inline const ::diplomacy_proto::State& PhaseHistory::state() const { + const ::diplomacy_proto::State* p = state_; + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.state) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy_proto::_State_default_instance_); +} +inline ::diplomacy_proto::State* PhaseHistory::release_state() { + // @@protoc_insertion_point(field_release:diplomacy_proto.PhaseHistory.state) + + ::diplomacy_proto::State* temp = state_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + state_ = NULL; + return temp; +} +inline ::diplomacy_proto::State* PhaseHistory::unsafe_arena_release_state() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.PhaseHistory.state) + + ::diplomacy_proto::State* temp = state_; + state_ = NULL; + return temp; +} +inline ::diplomacy_proto::State* PhaseHistory::mutable_state() { + + if (state_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy_proto::State>(GetArenaNoVirtual()); + state_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy_proto.PhaseHistory.state) + return state_; +} +inline void PhaseHistory::set_allocated_state(::diplomacy_proto::State* state) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete state_; + } + if (state) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(state); + if (message_arena != submessage_arena) { + state = ::google::protobuf::internal::GetOwnedMessage( + message_arena, state, submessage_arena); + } + + } else { + + } + state_ = state; + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.PhaseHistory.state) +} + +// map orders = 3; +inline int PhaseHistory::orders_size() const { + return orders_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +PhaseHistory::orders() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.PhaseHistory.orders) + return orders_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +PhaseHistory::mutable_orders() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.PhaseHistory.orders) + return orders_.MutableMap(); +} + +// map results = 4; +inline int PhaseHistory::results_size() const { + return results_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +PhaseHistory::results() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.PhaseHistory.results) + return results_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +PhaseHistory::mutable_results() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.PhaseHistory.results) + return results_.MutableMap(); +} + +// map policy = 6; +inline int PhaseHistory::policy_size() const { + return policy_.size(); +} +inline void PhaseHistory::clear_policy() { + policy_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >& +PhaseHistory::policy() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.PhaseHistory.policy) + return policy_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::PhaseHistory_PolicyDetails >* +PhaseHistory::mutable_policy() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.PhaseHistory.policy) + return policy_.MutableMap(); +} + +// repeated uint32 prev_orders_state = 8 [packed = true]; +inline int PhaseHistory::prev_orders_state_size() const { + return prev_orders_state_.size(); +} +inline void PhaseHistory::clear_prev_orders_state() { + prev_orders_state_.Clear(); +} +inline ::google::protobuf::uint32 PhaseHistory::prev_orders_state(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.PhaseHistory.prev_orders_state) + return prev_orders_state_.Get(index); +} +inline void PhaseHistory::set_prev_orders_state(int index, ::google::protobuf::uint32 value) { + prev_orders_state_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy_proto.PhaseHistory.prev_orders_state) +} +inline void PhaseHistory::add_prev_orders_state(::google::protobuf::uint32 value) { + prev_orders_state_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.PhaseHistory.prev_orders_state) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +PhaseHistory::prev_orders_state() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.PhaseHistory.prev_orders_state) + return prev_orders_state_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +PhaseHistory::mutable_prev_orders_state() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.PhaseHistory.prev_orders_state) + return &prev_orders_state_; +} + +// map state_value = 9; +inline int PhaseHistory::state_value_size() const { + return state_value_.size(); +} +inline void PhaseHistory::clear_state_value() { + state_value_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, float >& +PhaseHistory::state_value() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.PhaseHistory.state_value) + return state_value_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, float >* +PhaseHistory::mutable_state_value() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.PhaseHistory.state_value) + return state_value_.MutableMap(); +} + +// map possible_orders = 7; +inline int PhaseHistory::possible_orders_size() const { + return possible_orders_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >& +PhaseHistory::possible_orders() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.PhaseHistory.possible_orders) + return possible_orders_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::StringList >* +PhaseHistory::mutable_possible_orders() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.PhaseHistory.possible_orders) + return possible_orders_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// SavedGame_KeywordArgs + +// int32 player_seed = 1; +inline void SavedGame_KeywordArgs::clear_player_seed() { + player_seed_ = 0; +} +inline ::google::protobuf::int32 SavedGame_KeywordArgs::player_seed() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.KeywordArgs.player_seed) + return player_seed_; +} +inline void SavedGame_KeywordArgs::set_player_seed(::google::protobuf::int32 value) { + + player_seed_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.KeywordArgs.player_seed) +} + +// float noise = 2; +inline void SavedGame_KeywordArgs::clear_noise() { + noise_ = 0; +} +inline float SavedGame_KeywordArgs::noise() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.KeywordArgs.noise) + return noise_; +} +inline void SavedGame_KeywordArgs::set_noise(float value) { + + noise_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.KeywordArgs.noise) +} + +// float temperature = 3; +inline void SavedGame_KeywordArgs::clear_temperature() { + temperature_ = 0; +} +inline float SavedGame_KeywordArgs::temperature() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.KeywordArgs.temperature) + return temperature_; +} +inline void SavedGame_KeywordArgs::set_temperature(float value) { + + temperature_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.KeywordArgs.temperature) +} + +// float dropout_rate = 5; +inline void SavedGame_KeywordArgs::clear_dropout_rate() { + dropout_rate_ = 0; +} +inline float SavedGame_KeywordArgs::dropout_rate() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.KeywordArgs.dropout_rate) + return dropout_rate_; +} +inline void SavedGame_KeywordArgs::set_dropout_rate(float value) { + + dropout_rate_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.KeywordArgs.dropout_rate) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// SavedGame + +// string id = 1; +inline void SavedGame::clear_id() { + id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SavedGame::id() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.id) + return id_.Get(); +} +inline void SavedGame::set_id(const ::std::string& value) { + + id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.id) +} +#if LANG_CXX11 +inline void SavedGame::set_id(::std::string&& value) { + + id_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.SavedGame.id) +} +#endif +inline void SavedGame::set_id(const char* value) { + GOOGLE_DCHECK(value != NULL); + + id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.SavedGame.id) +} +inline void SavedGame::set_id(const char* value, + size_t size) { + + id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.SavedGame.id) +} +inline ::std::string* SavedGame::mutable_id() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.id) + return id_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SavedGame::release_id() { + // @@protoc_insertion_point(field_release:diplomacy_proto.SavedGame.id) + + return id_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SavedGame::set_allocated_id(::std::string* id) { + if (id != NULL) { + + } else { + + } + id_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), id, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.SavedGame.id) +} +inline ::std::string* SavedGame::unsafe_arena_release_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.SavedGame.id) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return id_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SavedGame::unsafe_arena_set_allocated_id( + ::std::string* id) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (id != NULL) { + + } else { + + } + id_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + id, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.SavedGame.id) +} + +// string map = 2; +inline void SavedGame::clear_map() { + map_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SavedGame::map() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.map) + return map_.Get(); +} +inline void SavedGame::set_map(const ::std::string& value) { + + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.map) +} +#if LANG_CXX11 +inline void SavedGame::set_map(::std::string&& value) { + + map_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.SavedGame.map) +} +#endif +inline void SavedGame::set_map(const char* value) { + GOOGLE_DCHECK(value != NULL); + + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.SavedGame.map) +} +inline void SavedGame::set_map(const char* value, + size_t size) { + + map_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.SavedGame.map) +} +inline ::std::string* SavedGame::mutable_map() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.map) + return map_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SavedGame::release_map() { + // @@protoc_insertion_point(field_release:diplomacy_proto.SavedGame.map) + + return map_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SavedGame::set_allocated_map(::std::string* map) { + if (map != NULL) { + + } else { + + } + map_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), map, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.SavedGame.map) +} +inline ::std::string* SavedGame::unsafe_arena_release_map() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.SavedGame.map) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return map_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SavedGame::unsafe_arena_set_allocated_map( + ::std::string* map) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (map != NULL) { + + } else { + + } + map_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + map, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.SavedGame.map) +} + +// repeated string rules = 3; +inline int SavedGame::rules_size() const { + return rules_.size(); +} +inline void SavedGame::clear_rules() { + rules_.Clear(); +} +inline const ::std::string& SavedGame::rules(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.rules) + return rules_.Get(index); +} +inline ::std::string* SavedGame::mutable_rules(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.rules) + return rules_.Mutable(index); +} +inline void SavedGame::set_rules(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.rules) + rules_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void SavedGame::set_rules(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.rules) + rules_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void SavedGame::set_rules(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + rules_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.SavedGame.rules) +} +inline void SavedGame::set_rules(int index, const char* value, size_t size) { + rules_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.SavedGame.rules) +} +inline ::std::string* SavedGame::add_rules() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.SavedGame.rules) + return rules_.Add(); +} +inline void SavedGame::add_rules(const ::std::string& value) { + rules_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.SavedGame.rules) +} +#if LANG_CXX11 +inline void SavedGame::add_rules(::std::string&& value) { + rules_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.SavedGame.rules) +} +#endif +inline void SavedGame::add_rules(const char* value) { + GOOGLE_DCHECK(value != NULL); + rules_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.SavedGame.rules) +} +inline void SavedGame::add_rules(const char* value, size_t size) { + rules_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.SavedGame.rules) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SavedGame::rules() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.SavedGame.rules) + return rules_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SavedGame::mutable_rules() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.SavedGame.rules) + return &rules_; +} + +// repeated .diplomacy_proto.PhaseHistory phases = 4; +inline int SavedGame::phases_size() const { + return phases_.size(); +} +inline void SavedGame::clear_phases() { + phases_.Clear(); +} +inline ::diplomacy_proto::PhaseHistory* SavedGame::mutable_phases(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.phases) + return phases_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy_proto::PhaseHistory >* +SavedGame::mutable_phases() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.SavedGame.phases) + return &phases_; +} +inline const ::diplomacy_proto::PhaseHistory& SavedGame::phases(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.phases) + return phases_.Get(index); +} +inline ::diplomacy_proto::PhaseHistory* SavedGame::add_phases() { + // @@protoc_insertion_point(field_add:diplomacy_proto.SavedGame.phases) + return phases_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy_proto::PhaseHistory >& +SavedGame::phases() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.SavedGame.phases) + return phases_; +} + +// string done_reason = 6; +inline void SavedGame::clear_done_reason() { + done_reason_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SavedGame::done_reason() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.done_reason) + return done_reason_.Get(); +} +inline void SavedGame::set_done_reason(const ::std::string& value) { + + done_reason_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.done_reason) +} +#if LANG_CXX11 +inline void SavedGame::set_done_reason(::std::string&& value) { + + done_reason_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.SavedGame.done_reason) +} +#endif +inline void SavedGame::set_done_reason(const char* value) { + GOOGLE_DCHECK(value != NULL); + + done_reason_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.SavedGame.done_reason) +} +inline void SavedGame::set_done_reason(const char* value, + size_t size) { + + done_reason_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.SavedGame.done_reason) +} +inline ::std::string* SavedGame::mutable_done_reason() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.done_reason) + return done_reason_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SavedGame::release_done_reason() { + // @@protoc_insertion_point(field_release:diplomacy_proto.SavedGame.done_reason) + + return done_reason_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SavedGame::set_allocated_done_reason(::std::string* done_reason) { + if (done_reason != NULL) { + + } else { + + } + done_reason_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), done_reason, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.SavedGame.done_reason) +} +inline ::std::string* SavedGame::unsafe_arena_release_done_reason() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.SavedGame.done_reason) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return done_reason_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SavedGame::unsafe_arena_set_allocated_done_reason( + ::std::string* done_reason) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (done_reason != NULL) { + + } else { + + } + done_reason_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + done_reason, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.SavedGame.done_reason) +} + +// repeated string assigned_powers = 5; +inline int SavedGame::assigned_powers_size() const { + return assigned_powers_.size(); +} +inline void SavedGame::clear_assigned_powers() { + assigned_powers_.Clear(); +} +inline const ::std::string& SavedGame::assigned_powers(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.assigned_powers) + return assigned_powers_.Get(index); +} +inline ::std::string* SavedGame::mutable_assigned_powers(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.assigned_powers) + return assigned_powers_.Mutable(index); +} +inline void SavedGame::set_assigned_powers(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.assigned_powers) + assigned_powers_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void SavedGame::set_assigned_powers(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.assigned_powers) + assigned_powers_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void SavedGame::set_assigned_powers(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + assigned_powers_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.SavedGame.assigned_powers) +} +inline void SavedGame::set_assigned_powers(int index, const char* value, size_t size) { + assigned_powers_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.SavedGame.assigned_powers) +} +inline ::std::string* SavedGame::add_assigned_powers() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.SavedGame.assigned_powers) + return assigned_powers_.Add(); +} +inline void SavedGame::add_assigned_powers(const ::std::string& value) { + assigned_powers_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.SavedGame.assigned_powers) +} +#if LANG_CXX11 +inline void SavedGame::add_assigned_powers(::std::string&& value) { + assigned_powers_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.SavedGame.assigned_powers) +} +#endif +inline void SavedGame::add_assigned_powers(const char* value) { + GOOGLE_DCHECK(value != NULL); + assigned_powers_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.SavedGame.assigned_powers) +} +inline void SavedGame::add_assigned_powers(const char* value, size_t size) { + assigned_powers_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.SavedGame.assigned_powers) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SavedGame::assigned_powers() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.SavedGame.assigned_powers) + return assigned_powers_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SavedGame::mutable_assigned_powers() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.SavedGame.assigned_powers) + return &assigned_powers_; +} + +// repeated string players = 11; +inline int SavedGame::players_size() const { + return players_.size(); +} +inline void SavedGame::clear_players() { + players_.Clear(); +} +inline const ::std::string& SavedGame::players(int index) const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.players) + return players_.Get(index); +} +inline ::std::string* SavedGame::mutable_players(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.players) + return players_.Mutable(index); +} +inline void SavedGame::set_players(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.players) + players_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void SavedGame::set_players(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.players) + players_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void SavedGame::set_players(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + players_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.SavedGame.players) +} +inline void SavedGame::set_players(int index, const char* value, size_t size) { + players_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.SavedGame.players) +} +inline ::std::string* SavedGame::add_players() { + // @@protoc_insertion_point(field_add_mutable:diplomacy_proto.SavedGame.players) + return players_.Add(); +} +inline void SavedGame::add_players(const ::std::string& value) { + players_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy_proto.SavedGame.players) +} +#if LANG_CXX11 +inline void SavedGame::add_players(::std::string&& value) { + players_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy_proto.SavedGame.players) +} +#endif +inline void SavedGame::add_players(const char* value) { + GOOGLE_DCHECK(value != NULL); + players_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy_proto.SavedGame.players) +} +inline void SavedGame::add_players(const char* value, size_t size) { + players_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy_proto.SavedGame.players) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SavedGame::players() const { + // @@protoc_insertion_point(field_list:diplomacy_proto.SavedGame.players) + return players_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SavedGame::mutable_players() { + // @@protoc_insertion_point(field_mutable_list:diplomacy_proto.SavedGame.players) + return &players_; +} + +// map kwargs = 10; +inline int SavedGame::kwargs_size() const { + return kwargs_.size(); +} +inline void SavedGame::clear_kwargs() { + kwargs_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >& +SavedGame::kwargs() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.SavedGame.kwargs) + return kwargs_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::SavedGame_KeywordArgs >* +SavedGame::mutable_kwargs() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.SavedGame.kwargs) + return kwargs_.MutableMap(); +} + +// bool is_partial_game = 12; +inline void SavedGame::clear_is_partial_game() { + is_partial_game_ = false; +} +inline bool SavedGame::is_partial_game() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.is_partial_game) + return is_partial_game_; +} +inline void SavedGame::set_is_partial_game(bool value) { + + is_partial_game_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.is_partial_game) +} + +// int32 start_phase_ix = 9; +inline void SavedGame::clear_start_phase_ix() { + start_phase_ix_ = 0; +} +inline ::google::protobuf::int32 SavedGame::start_phase_ix() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.start_phase_ix) + return start_phase_ix_; +} +inline void SavedGame::set_start_phase_ix(::google::protobuf::int32 value) { + + start_phase_ix_ = value; + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.start_phase_ix) +} + +// string reward_fn = 7; +inline void SavedGame::clear_reward_fn() { + reward_fn_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SavedGame::reward_fn() const { + // @@protoc_insertion_point(field_get:diplomacy_proto.SavedGame.reward_fn) + return reward_fn_.Get(); +} +inline void SavedGame::set_reward_fn(const ::std::string& value) { + + reward_fn_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy_proto.SavedGame.reward_fn) +} +#if LANG_CXX11 +inline void SavedGame::set_reward_fn(::std::string&& value) { + + reward_fn_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy_proto.SavedGame.reward_fn) +} +#endif +inline void SavedGame::set_reward_fn(const char* value) { + GOOGLE_DCHECK(value != NULL); + + reward_fn_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy_proto.SavedGame.reward_fn) +} +inline void SavedGame::set_reward_fn(const char* value, + size_t size) { + + reward_fn_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy_proto.SavedGame.reward_fn) +} +inline ::std::string* SavedGame::mutable_reward_fn() { + + // @@protoc_insertion_point(field_mutable:diplomacy_proto.SavedGame.reward_fn) + return reward_fn_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SavedGame::release_reward_fn() { + // @@protoc_insertion_point(field_release:diplomacy_proto.SavedGame.reward_fn) + + return reward_fn_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SavedGame::set_allocated_reward_fn(::std::string* reward_fn) { + if (reward_fn != NULL) { + + } else { + + } + reward_fn_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), reward_fn, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy_proto.SavedGame.reward_fn) +} +inline ::std::string* SavedGame::unsafe_arena_release_reward_fn() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy_proto.SavedGame.reward_fn) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return reward_fn_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SavedGame::unsafe_arena_set_allocated_reward_fn( + ::std::string* reward_fn) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (reward_fn != NULL) { + + } else { + + } + reward_fn_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + reward_fn, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy_proto.SavedGame.reward_fn) +} + +// map rewards = 8; +inline int SavedGame::rewards_size() const { + return rewards_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >& +SavedGame::rewards() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.SavedGame.rewards) + return rewards_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >* +SavedGame::mutable_rewards() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.SavedGame.rewards) + return rewards_.MutableMap(); +} + +// map returns = 13; +inline int SavedGame::returns_size() const { + return returns_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >& +SavedGame::returns() const { + // @@protoc_insertion_point(field_map:diplomacy_proto.SavedGame.returns) + return returns_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy_proto::FloatList >* +SavedGame::mutable_returns() { + // @@protoc_insertion_point(field_mutable_map:diplomacy_proto.SavedGame.returns) + return returns_.MutableMap(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace diplomacy_proto + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5fproto_2fgame_2eproto diff --git a/diplomacy_research/proto/diplomacy_proto/game.proto b/diplomacy_research/proto/diplomacy_proto/game.proto new file mode 100644 index 0000000..939f95e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/game.proto @@ -0,0 +1,94 @@ +// ============================================================================== +// Copyright 2019 - Philip Paquette +// +// NOTICE: 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. +// ============================================================================== +syntax = "proto3"; +package diplomacy_proto; +import "diplomacy_proto/common.proto"; +option cc_enable_arenas = true; + +message Message { + string sender = 1; // Power sending the message or SYSTEM + string recipient = 2; // Power the message or GLOBAL + int64 time_sent = 3; // Timestamp where the message was sent + string phase = 4; // Phase name (e.g. 'S1901M') + string message = 5; // Actual message + repeated uint32 tokens = 6 [packed = true]; // Token representation of message with BOM and EOM +} + +message State { + message Builds { + int32 count = 1; + repeated string homes = 2; + } + + string game_id = 1; // The game id + string name = 2; // Phase name (e.g. 'S1901M') + string map = 3; // Name of the map played (e.g. 'standard') + string zobrist_hash = 13; // Unique hash of the game state + repeated string rules = 4; // List of rules + map units = 5; // Dict of units for each power + map centers = 6; // Dict of centers for each power + map homes = 7; // Dict of homes for each power + map influence = 8; // Dict of influence for each power + map civil_disorder = 9; // Dict of civil disorder for each power + map builds = 10; // Dict of build counts and build locs for each power + string note = 11; // Note to be displayed on the rendered map + repeated uint32 board_state = 12 [packed = true]; // Flatten representation of board_state +} + +message PhaseHistory { + message PolicyDetails { + repeated string locs = 1; // List of locs where orders were issued (e.g. BRE, WAIVE_0) + repeated int32 tokens = 2; // List of tokens outputted by the model + repeated float log_probs = 3 [packed = true]; // List of log probs for each token outputted + bool draw_action = 4; // Whether player wanted to accept a draw or not + float draw_prob = 5; // The model's probability of doing accepting a draw + } + + string name = 1; + State state = 2; + map orders = 3; + map results = 4; + + map policy = 6; + repeated uint32 prev_orders_state = 8 [packed = true]; // Flatten representation of prev_orders_state (M phases) + map state_value = 9; // Value of this state for each power + map possible_orders = 7; // List of possible orders for each power +} + +message SavedGame { + message KeywordArgs { + reserved 4; // [DEPRECATED] 4 = model_name + int32 player_seed = 1; // The player seed used by this power + float noise = 2; // The noise level used by this power + float temperature = 3; // The temperature used by this power + float dropout_rate = 5; // The dropout rate used by this power + } + + string id = 1; + string map = 2; + repeated string rules = 3; + repeated PhaseHistory phases = 4; + string done_reason = 6; // Reason why game was ended. + + repeated string assigned_powers = 5; // List of assigned powers (RL player should be at position 0) + repeated string players = 11; // List of player names (same length as assigned_powers) + map kwargs = 10; // Settings used by each power. + + bool is_partial_game = 12; // Indicates that this is a partial game + int32 start_phase_ix = 9; // For partial traj, the ix of the first phase to use for learning. + + string reward_fn = 7; // Name of the reward function used to compute rewards + map rewards = 8; // List of rewards (no penalty) for each transition for each power + map returns = 13; // List of returns for each transition for each power +} diff --git a/diplomacy_research/proto/diplomacy_proto/game_pb2.py b/diplomacy_research/proto/diplomacy_proto/game_pb2.py new file mode 100644 index 0000000..7a38995 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_proto/game_pb2.py @@ -0,0 +1,1304 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_proto/game.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_proto import common_pb2 as diplomacy__proto_dot_common__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_proto/game.proto', + package='diplomacy_proto', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n\x1a\x64iplomacy_proto/game.proto\x12\x0f\x64iplomacy_proto\x1a\x1c\x64iplomacy_proto/common.proto\"s\n\x07Message\x12\x0e\n\x06sender\x18\x01 \x01(\t\x12\x11\n\trecipient\x18\x02 \x01(\t\x12\x11\n\ttime_sent\x18\x03 \x01(\x03\x12\r\n\x05phase\x18\x04 \x01(\t\x12\x0f\n\x07message\x18\x05 \x01(\t\x12\x12\n\x06tokens\x18\x06 \x03(\rB\x02\x10\x01\"\xa8\x07\n\x05State\x12\x0f\n\x07game_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0b\n\x03map\x18\x03 \x01(\t\x12\x14\n\x0czobrist_hash\x18\r \x01(\t\x12\r\n\x05rules\x18\x04 \x03(\t\x12\x30\n\x05units\x18\x05 \x03(\x0b\x32!.diplomacy_proto.State.UnitsEntry\x12\x34\n\x07\x63\x65nters\x18\x06 \x03(\x0b\x32#.diplomacy_proto.State.CentersEntry\x12\x30\n\x05homes\x18\x07 \x03(\x0b\x32!.diplomacy_proto.State.HomesEntry\x12\x38\n\tinfluence\x18\x08 \x03(\x0b\x32%.diplomacy_proto.State.InfluenceEntry\x12\x41\n\x0e\x63ivil_disorder\x18\t \x03(\x0b\x32).diplomacy_proto.State.CivilDisorderEntry\x12\x32\n\x06\x62uilds\x18\n \x03(\x0b\x32\".diplomacy_proto.State.BuildsEntry\x12\x0c\n\x04note\x18\x0b \x01(\t\x12\x17\n\x0b\x62oard_state\x18\x0c \x03(\rB\x02\x10\x01\x1a&\n\x06\x42uilds\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x12\r\n\x05homes\x18\x02 \x03(\t\x1aI\n\nUnitsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\x1aK\n\x0c\x43\x65ntersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\x1aI\n\nHomesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\x1aM\n\x0eInfluenceEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\x1a\x34\n\x12\x43ivilDisorderEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x1aL\n\x0b\x42uildsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.diplomacy_proto.State.Builds:\x02\x38\x01\"\x8f\x07\n\x0cPhaseHistory\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x05state\x18\x02 \x01(\x0b\x32\x16.diplomacy_proto.State\x12\x39\n\x06orders\x18\x03 \x03(\x0b\x32).diplomacy_proto.PhaseHistory.OrdersEntry\x12;\n\x07results\x18\x04 \x03(\x0b\x32*.diplomacy_proto.PhaseHistory.ResultsEntry\x12\x39\n\x06policy\x18\x06 \x03(\x0b\x32).diplomacy_proto.PhaseHistory.PolicyEntry\x12\x1d\n\x11prev_orders_state\x18\x08 \x03(\rB\x02\x10\x01\x12\x42\n\x0bstate_value\x18\t \x03(\x0b\x32-.diplomacy_proto.PhaseHistory.StateValueEntry\x12J\n\x0fpossible_orders\x18\x07 \x03(\x0b\x32\x31.diplomacy_proto.PhaseHistory.PossibleOrdersEntry\x1al\n\rPolicyDetails\x12\x0c\n\x04locs\x18\x01 \x03(\t\x12\x0e\n\x06tokens\x18\x02 \x03(\x05\x12\x15\n\tlog_probs\x18\x03 \x03(\x02\x42\x02\x10\x01\x12\x13\n\x0b\x64raw_action\x18\x04 \x01(\x08\x12\x11\n\tdraw_prob\x18\x05 \x01(\x02\x1aJ\n\x0bOrdersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\x1aK\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\x1aZ\n\x0bPolicyEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.diplomacy_proto.PhaseHistory.PolicyDetails:\x02\x38\x01\x1a\x31\n\x0fStateValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x1aR\n\x13PossibleOrdersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.diplomacy_proto.StringList:\x02\x38\x01\"\xe4\x05\n\tSavedGame\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0b\n\x03map\x18\x02 \x01(\t\x12\r\n\x05rules\x18\x03 \x03(\t\x12-\n\x06phases\x18\x04 \x03(\x0b\x32\x1d.diplomacy_proto.PhaseHistory\x12\x13\n\x0b\x64one_reason\x18\x06 \x01(\t\x12\x17\n\x0f\x61ssigned_powers\x18\x05 \x03(\t\x12\x0f\n\x07players\x18\x0b \x03(\t\x12\x36\n\x06kwargs\x18\n \x03(\x0b\x32&.diplomacy_proto.SavedGame.KwargsEntry\x12\x17\n\x0fis_partial_game\x18\x0c \x01(\x08\x12\x16\n\x0estart_phase_ix\x18\t \x01(\x05\x12\x11\n\treward_fn\x18\x07 \x01(\t\x12\x38\n\x07rewards\x18\x08 \x03(\x0b\x32\'.diplomacy_proto.SavedGame.RewardsEntry\x12\x38\n\x07returns\x18\r \x03(\x0b\x32\'.diplomacy_proto.SavedGame.ReturnsEntry\x1a\x62\n\x0bKeywordArgs\x12\x13\n\x0bplayer_seed\x18\x01 \x01(\x05\x12\r\n\x05noise\x18\x02 \x01(\x02\x12\x13\n\x0btemperature\x18\x03 \x01(\x02\x12\x14\n\x0c\x64ropout_rate\x18\x05 \x01(\x02J\x04\x08\x04\x10\x05\x1aU\n\x0bKwargsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.diplomacy_proto.SavedGame.KeywordArgs:\x02\x38\x01\x1aJ\n\x0cRewardsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.diplomacy_proto.FloatList:\x02\x38\x01\x1aJ\n\x0cReturnsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.diplomacy_proto.FloatList:\x02\x38\x01\x42\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__proto_dot_common__pb2.DESCRIPTOR,]) + + + + +_MESSAGE = _descriptor.Descriptor( + name='Message', + full_name='diplomacy_proto.Message', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='sender', full_name='diplomacy_proto.Message.sender', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='recipient', full_name='diplomacy_proto.Message.recipient', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='time_sent', full_name='diplomacy_proto.Message.time_sent', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='phase', full_name='diplomacy_proto.Message.phase', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='message', full_name='diplomacy_proto.Message.message', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tokens', full_name='diplomacy_proto.Message.tokens', index=5, + number=6, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=77, + serialized_end=192, +) + + +_STATE_BUILDS = _descriptor.Descriptor( + name='Builds', + full_name='diplomacy_proto.State.Builds', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='count', full_name='diplomacy_proto.State.Builds.count', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='homes', full_name='diplomacy_proto.State.Builds.homes', index=1, + number=2, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=655, + serialized_end=693, +) + +_STATE_UNITSENTRY = _descriptor.Descriptor( + name='UnitsEntry', + full_name='diplomacy_proto.State.UnitsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.State.UnitsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.State.UnitsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=695, + serialized_end=768, +) + +_STATE_CENTERSENTRY = _descriptor.Descriptor( + name='CentersEntry', + full_name='diplomacy_proto.State.CentersEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.State.CentersEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.State.CentersEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=770, + serialized_end=845, +) + +_STATE_HOMESENTRY = _descriptor.Descriptor( + name='HomesEntry', + full_name='diplomacy_proto.State.HomesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.State.HomesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.State.HomesEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=847, + serialized_end=920, +) + +_STATE_INFLUENCEENTRY = _descriptor.Descriptor( + name='InfluenceEntry', + full_name='diplomacy_proto.State.InfluenceEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.State.InfluenceEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.State.InfluenceEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=922, + serialized_end=999, +) + +_STATE_CIVILDISORDERENTRY = _descriptor.Descriptor( + name='CivilDisorderEntry', + full_name='diplomacy_proto.State.CivilDisorderEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.State.CivilDisorderEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.State.CivilDisorderEntry.value', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1001, + serialized_end=1053, +) + +_STATE_BUILDSENTRY = _descriptor.Descriptor( + name='BuildsEntry', + full_name='diplomacy_proto.State.BuildsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.State.BuildsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.State.BuildsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1055, + serialized_end=1131, +) + +_STATE = _descriptor.Descriptor( + name='State', + full_name='diplomacy_proto.State', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='game_id', full_name='diplomacy_proto.State.game_id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy_proto.State.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='map', full_name='diplomacy_proto.State.map', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='zobrist_hash', full_name='diplomacy_proto.State.zobrist_hash', index=3, + number=13, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rules', full_name='diplomacy_proto.State.rules', index=4, + number=4, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='units', full_name='diplomacy_proto.State.units', index=5, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='centers', full_name='diplomacy_proto.State.centers', index=6, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='homes', full_name='diplomacy_proto.State.homes', index=7, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='influence', full_name='diplomacy_proto.State.influence', index=8, + number=8, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='civil_disorder', full_name='diplomacy_proto.State.civil_disorder', index=9, + number=9, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='builds', full_name='diplomacy_proto.State.builds', index=10, + number=10, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='note', full_name='diplomacy_proto.State.note', index=11, + number=11, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='board_state', full_name='diplomacy_proto.State.board_state', index=12, + number=12, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_STATE_BUILDS, _STATE_UNITSENTRY, _STATE_CENTERSENTRY, _STATE_HOMESENTRY, _STATE_INFLUENCEENTRY, _STATE_CIVILDISORDERENTRY, _STATE_BUILDSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=195, + serialized_end=1131, +) + + +_PHASEHISTORY_POLICYDETAILS = _descriptor.Descriptor( + name='PolicyDetails', + full_name='diplomacy_proto.PhaseHistory.PolicyDetails', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='locs', full_name='diplomacy_proto.PhaseHistory.PolicyDetails.locs', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tokens', full_name='diplomacy_proto.PhaseHistory.PolicyDetails.tokens', index=1, + number=2, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='log_probs', full_name='diplomacy_proto.PhaseHistory.PolicyDetails.log_probs', index=2, + number=3, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='draw_action', full_name='diplomacy_proto.PhaseHistory.PolicyDetails.draw_action', index=3, + number=4, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='draw_prob', full_name='diplomacy_proto.PhaseHistory.PolicyDetails.draw_prob', index=4, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1557, + serialized_end=1665, +) + +_PHASEHISTORY_ORDERSENTRY = _descriptor.Descriptor( + name='OrdersEntry', + full_name='diplomacy_proto.PhaseHistory.OrdersEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.PhaseHistory.OrdersEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.PhaseHistory.OrdersEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1667, + serialized_end=1741, +) + +_PHASEHISTORY_RESULTSENTRY = _descriptor.Descriptor( + name='ResultsEntry', + full_name='diplomacy_proto.PhaseHistory.ResultsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.PhaseHistory.ResultsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.PhaseHistory.ResultsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1743, + serialized_end=1818, +) + +_PHASEHISTORY_POLICYENTRY = _descriptor.Descriptor( + name='PolicyEntry', + full_name='diplomacy_proto.PhaseHistory.PolicyEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.PhaseHistory.PolicyEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.PhaseHistory.PolicyEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1820, + serialized_end=1910, +) + +_PHASEHISTORY_STATEVALUEENTRY = _descriptor.Descriptor( + name='StateValueEntry', + full_name='diplomacy_proto.PhaseHistory.StateValueEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.PhaseHistory.StateValueEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.PhaseHistory.StateValueEntry.value', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1912, + serialized_end=1961, +) + +_PHASEHISTORY_POSSIBLEORDERSENTRY = _descriptor.Descriptor( + name='PossibleOrdersEntry', + full_name='diplomacy_proto.PhaseHistory.PossibleOrdersEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.PhaseHistory.PossibleOrdersEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.PhaseHistory.PossibleOrdersEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1963, + serialized_end=2045, +) + +_PHASEHISTORY = _descriptor.Descriptor( + name='PhaseHistory', + full_name='diplomacy_proto.PhaseHistory', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy_proto.PhaseHistory.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='state', full_name='diplomacy_proto.PhaseHistory.state', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='orders', full_name='diplomacy_proto.PhaseHistory.orders', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='results', full_name='diplomacy_proto.PhaseHistory.results', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='policy', full_name='diplomacy_proto.PhaseHistory.policy', index=4, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='prev_orders_state', full_name='diplomacy_proto.PhaseHistory.prev_orders_state', index=5, + number=8, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='state_value', full_name='diplomacy_proto.PhaseHistory.state_value', index=6, + number=9, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='possible_orders', full_name='diplomacy_proto.PhaseHistory.possible_orders', index=7, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_PHASEHISTORY_POLICYDETAILS, _PHASEHISTORY_ORDERSENTRY, _PHASEHISTORY_RESULTSENTRY, _PHASEHISTORY_POLICYENTRY, _PHASEHISTORY_STATEVALUEENTRY, _PHASEHISTORY_POSSIBLEORDERSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1134, + serialized_end=2045, +) + + +_SAVEDGAME_KEYWORDARGS = _descriptor.Descriptor( + name='KeywordArgs', + full_name='diplomacy_proto.SavedGame.KeywordArgs', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='player_seed', full_name='diplomacy_proto.SavedGame.KeywordArgs.player_seed', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='noise', full_name='diplomacy_proto.SavedGame.KeywordArgs.noise', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='temperature', full_name='diplomacy_proto.SavedGame.KeywordArgs.temperature', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dropout_rate', full_name='diplomacy_proto.SavedGame.KeywordArgs.dropout_rate', index=3, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2451, + serialized_end=2549, +) + +_SAVEDGAME_KWARGSENTRY = _descriptor.Descriptor( + name='KwargsEntry', + full_name='diplomacy_proto.SavedGame.KwargsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.SavedGame.KwargsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.SavedGame.KwargsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2551, + serialized_end=2636, +) + +_SAVEDGAME_REWARDSENTRY = _descriptor.Descriptor( + name='RewardsEntry', + full_name='diplomacy_proto.SavedGame.RewardsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.SavedGame.RewardsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.SavedGame.RewardsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2638, + serialized_end=2712, +) + +_SAVEDGAME_RETURNSENTRY = _descriptor.Descriptor( + name='ReturnsEntry', + full_name='diplomacy_proto.SavedGame.ReturnsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy_proto.SavedGame.ReturnsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy_proto.SavedGame.ReturnsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2714, + serialized_end=2788, +) + +_SAVEDGAME = _descriptor.Descriptor( + name='SavedGame', + full_name='diplomacy_proto.SavedGame', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='diplomacy_proto.SavedGame.id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='map', full_name='diplomacy_proto.SavedGame.map', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rules', full_name='diplomacy_proto.SavedGame.rules', index=2, + number=3, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='phases', full_name='diplomacy_proto.SavedGame.phases', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='done_reason', full_name='diplomacy_proto.SavedGame.done_reason', index=4, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='assigned_powers', full_name='diplomacy_proto.SavedGame.assigned_powers', index=5, + number=5, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='players', full_name='diplomacy_proto.SavedGame.players', index=6, + number=11, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='kwargs', full_name='diplomacy_proto.SavedGame.kwargs', index=7, + number=10, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_partial_game', full_name='diplomacy_proto.SavedGame.is_partial_game', index=8, + number=12, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='start_phase_ix', full_name='diplomacy_proto.SavedGame.start_phase_ix', index=9, + number=9, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='reward_fn', full_name='diplomacy_proto.SavedGame.reward_fn', index=10, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rewards', full_name='diplomacy_proto.SavedGame.rewards', index=11, + number=8, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='returns', full_name='diplomacy_proto.SavedGame.returns', index=12, + number=13, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SAVEDGAME_KEYWORDARGS, _SAVEDGAME_KWARGSENTRY, _SAVEDGAME_REWARDSENTRY, _SAVEDGAME_RETURNSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2048, + serialized_end=2788, +) + +_STATE_BUILDS.containing_type = _STATE +_STATE_UNITSENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._STRINGLIST +_STATE_UNITSENTRY.containing_type = _STATE +_STATE_CENTERSENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._STRINGLIST +_STATE_CENTERSENTRY.containing_type = _STATE +_STATE_HOMESENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._STRINGLIST +_STATE_HOMESENTRY.containing_type = _STATE +_STATE_INFLUENCEENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._STRINGLIST +_STATE_INFLUENCEENTRY.containing_type = _STATE +_STATE_CIVILDISORDERENTRY.containing_type = _STATE +_STATE_BUILDSENTRY.fields_by_name['value'].message_type = _STATE_BUILDS +_STATE_BUILDSENTRY.containing_type = _STATE +_STATE.fields_by_name['units'].message_type = _STATE_UNITSENTRY +_STATE.fields_by_name['centers'].message_type = _STATE_CENTERSENTRY +_STATE.fields_by_name['homes'].message_type = _STATE_HOMESENTRY +_STATE.fields_by_name['influence'].message_type = _STATE_INFLUENCEENTRY +_STATE.fields_by_name['civil_disorder'].message_type = _STATE_CIVILDISORDERENTRY +_STATE.fields_by_name['builds'].message_type = _STATE_BUILDSENTRY +_PHASEHISTORY_POLICYDETAILS.containing_type = _PHASEHISTORY +_PHASEHISTORY_ORDERSENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._STRINGLIST +_PHASEHISTORY_ORDERSENTRY.containing_type = _PHASEHISTORY +_PHASEHISTORY_RESULTSENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._STRINGLIST +_PHASEHISTORY_RESULTSENTRY.containing_type = _PHASEHISTORY +_PHASEHISTORY_POLICYENTRY.fields_by_name['value'].message_type = _PHASEHISTORY_POLICYDETAILS +_PHASEHISTORY_POLICYENTRY.containing_type = _PHASEHISTORY +_PHASEHISTORY_STATEVALUEENTRY.containing_type = _PHASEHISTORY +_PHASEHISTORY_POSSIBLEORDERSENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._STRINGLIST +_PHASEHISTORY_POSSIBLEORDERSENTRY.containing_type = _PHASEHISTORY +_PHASEHISTORY.fields_by_name['state'].message_type = _STATE +_PHASEHISTORY.fields_by_name['orders'].message_type = _PHASEHISTORY_ORDERSENTRY +_PHASEHISTORY.fields_by_name['results'].message_type = _PHASEHISTORY_RESULTSENTRY +_PHASEHISTORY.fields_by_name['policy'].message_type = _PHASEHISTORY_POLICYENTRY +_PHASEHISTORY.fields_by_name['state_value'].message_type = _PHASEHISTORY_STATEVALUEENTRY +_PHASEHISTORY.fields_by_name['possible_orders'].message_type = _PHASEHISTORY_POSSIBLEORDERSENTRY +_SAVEDGAME_KEYWORDARGS.containing_type = _SAVEDGAME +_SAVEDGAME_KWARGSENTRY.fields_by_name['value'].message_type = _SAVEDGAME_KEYWORDARGS +_SAVEDGAME_KWARGSENTRY.containing_type = _SAVEDGAME +_SAVEDGAME_REWARDSENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._FLOATLIST +_SAVEDGAME_REWARDSENTRY.containing_type = _SAVEDGAME +_SAVEDGAME_RETURNSENTRY.fields_by_name['value'].message_type = diplomacy__proto_dot_common__pb2._FLOATLIST +_SAVEDGAME_RETURNSENTRY.containing_type = _SAVEDGAME +_SAVEDGAME.fields_by_name['phases'].message_type = _PHASEHISTORY +_SAVEDGAME.fields_by_name['kwargs'].message_type = _SAVEDGAME_KWARGSENTRY +_SAVEDGAME.fields_by_name['rewards'].message_type = _SAVEDGAME_REWARDSENTRY +_SAVEDGAME.fields_by_name['returns'].message_type = _SAVEDGAME_RETURNSENTRY +DESCRIPTOR.message_types_by_name['Message'] = _MESSAGE +DESCRIPTOR.message_types_by_name['State'] = _STATE +DESCRIPTOR.message_types_by_name['PhaseHistory'] = _PHASEHISTORY +DESCRIPTOR.message_types_by_name['SavedGame'] = _SAVEDGAME +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Message = _reflection.GeneratedProtocolMessageType('Message', (_message.Message,), dict( + DESCRIPTOR = _MESSAGE, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.Message) + )) +_sym_db.RegisterMessage(Message) + +State = _reflection.GeneratedProtocolMessageType('State', (_message.Message,), dict( + + Builds = _reflection.GeneratedProtocolMessageType('Builds', (_message.Message,), dict( + DESCRIPTOR = _STATE_BUILDS, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State.Builds) + )) + , + + UnitsEntry = _reflection.GeneratedProtocolMessageType('UnitsEntry', (_message.Message,), dict( + DESCRIPTOR = _STATE_UNITSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State.UnitsEntry) + )) + , + + CentersEntry = _reflection.GeneratedProtocolMessageType('CentersEntry', (_message.Message,), dict( + DESCRIPTOR = _STATE_CENTERSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State.CentersEntry) + )) + , + + HomesEntry = _reflection.GeneratedProtocolMessageType('HomesEntry', (_message.Message,), dict( + DESCRIPTOR = _STATE_HOMESENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State.HomesEntry) + )) + , + + InfluenceEntry = _reflection.GeneratedProtocolMessageType('InfluenceEntry', (_message.Message,), dict( + DESCRIPTOR = _STATE_INFLUENCEENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State.InfluenceEntry) + )) + , + + CivilDisorderEntry = _reflection.GeneratedProtocolMessageType('CivilDisorderEntry', (_message.Message,), dict( + DESCRIPTOR = _STATE_CIVILDISORDERENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State.CivilDisorderEntry) + )) + , + + BuildsEntry = _reflection.GeneratedProtocolMessageType('BuildsEntry', (_message.Message,), dict( + DESCRIPTOR = _STATE_BUILDSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State.BuildsEntry) + )) + , + DESCRIPTOR = _STATE, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.State) + )) +_sym_db.RegisterMessage(State) +_sym_db.RegisterMessage(State.Builds) +_sym_db.RegisterMessage(State.UnitsEntry) +_sym_db.RegisterMessage(State.CentersEntry) +_sym_db.RegisterMessage(State.HomesEntry) +_sym_db.RegisterMessage(State.InfluenceEntry) +_sym_db.RegisterMessage(State.CivilDisorderEntry) +_sym_db.RegisterMessage(State.BuildsEntry) + +PhaseHistory = _reflection.GeneratedProtocolMessageType('PhaseHistory', (_message.Message,), dict( + + PolicyDetails = _reflection.GeneratedProtocolMessageType('PolicyDetails', (_message.Message,), dict( + DESCRIPTOR = _PHASEHISTORY_POLICYDETAILS, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory.PolicyDetails) + )) + , + + OrdersEntry = _reflection.GeneratedProtocolMessageType('OrdersEntry', (_message.Message,), dict( + DESCRIPTOR = _PHASEHISTORY_ORDERSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory.OrdersEntry) + )) + , + + ResultsEntry = _reflection.GeneratedProtocolMessageType('ResultsEntry', (_message.Message,), dict( + DESCRIPTOR = _PHASEHISTORY_RESULTSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory.ResultsEntry) + )) + , + + PolicyEntry = _reflection.GeneratedProtocolMessageType('PolicyEntry', (_message.Message,), dict( + DESCRIPTOR = _PHASEHISTORY_POLICYENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory.PolicyEntry) + )) + , + + StateValueEntry = _reflection.GeneratedProtocolMessageType('StateValueEntry', (_message.Message,), dict( + DESCRIPTOR = _PHASEHISTORY_STATEVALUEENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory.StateValueEntry) + )) + , + + PossibleOrdersEntry = _reflection.GeneratedProtocolMessageType('PossibleOrdersEntry', (_message.Message,), dict( + DESCRIPTOR = _PHASEHISTORY_POSSIBLEORDERSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory.PossibleOrdersEntry) + )) + , + DESCRIPTOR = _PHASEHISTORY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.PhaseHistory) + )) +_sym_db.RegisterMessage(PhaseHistory) +_sym_db.RegisterMessage(PhaseHistory.PolicyDetails) +_sym_db.RegisterMessage(PhaseHistory.OrdersEntry) +_sym_db.RegisterMessage(PhaseHistory.ResultsEntry) +_sym_db.RegisterMessage(PhaseHistory.PolicyEntry) +_sym_db.RegisterMessage(PhaseHistory.StateValueEntry) +_sym_db.RegisterMessage(PhaseHistory.PossibleOrdersEntry) + +SavedGame = _reflection.GeneratedProtocolMessageType('SavedGame', (_message.Message,), dict( + + KeywordArgs = _reflection.GeneratedProtocolMessageType('KeywordArgs', (_message.Message,), dict( + DESCRIPTOR = _SAVEDGAME_KEYWORDARGS, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.SavedGame.KeywordArgs) + )) + , + + KwargsEntry = _reflection.GeneratedProtocolMessageType('KwargsEntry', (_message.Message,), dict( + DESCRIPTOR = _SAVEDGAME_KWARGSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.SavedGame.KwargsEntry) + )) + , + + RewardsEntry = _reflection.GeneratedProtocolMessageType('RewardsEntry', (_message.Message,), dict( + DESCRIPTOR = _SAVEDGAME_REWARDSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.SavedGame.RewardsEntry) + )) + , + + ReturnsEntry = _reflection.GeneratedProtocolMessageType('ReturnsEntry', (_message.Message,), dict( + DESCRIPTOR = _SAVEDGAME_RETURNSENTRY, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.SavedGame.ReturnsEntry) + )) + , + DESCRIPTOR = _SAVEDGAME, + __module__ = 'diplomacy_proto.game_pb2' + # @@protoc_insertion_point(class_scope:diplomacy_proto.SavedGame) + )) +_sym_db.RegisterMessage(SavedGame) +_sym_db.RegisterMessage(SavedGame.KeywordArgs) +_sym_db.RegisterMessage(SavedGame.KwargsEntry) +_sym_db.RegisterMessage(SavedGame.RewardsEntry) +_sym_db.RegisterMessage(SavedGame.ReturnsEntry) + + +DESCRIPTOR._options = None +_MESSAGE.fields_by_name['tokens']._options = None +_STATE_UNITSENTRY._options = None +_STATE_CENTERSENTRY._options = None +_STATE_HOMESENTRY._options = None +_STATE_INFLUENCEENTRY._options = None +_STATE_CIVILDISORDERENTRY._options = None +_STATE_BUILDSENTRY._options = None +_STATE.fields_by_name['board_state']._options = None +_PHASEHISTORY_POLICYDETAILS.fields_by_name['log_probs']._options = None +_PHASEHISTORY_ORDERSENTRY._options = None +_PHASEHISTORY_RESULTSENTRY._options = None +_PHASEHISTORY_POLICYENTRY._options = None +_PHASEHISTORY_STATEVALUEENTRY._options = None +_PHASEHISTORY_POSSIBLEORDERSENTRY._options = None +_PHASEHISTORY.fields_by_name['prev_orders_state']._options = None +_SAVEDGAME_KWARGSENTRY._options = None +_SAVEDGAME_REWARDSENTRY._options = None +_SAVEDGAME_RETURNSENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.cc new file mode 100644 index 0000000..ccb51d6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.cc @@ -0,0 +1,1168 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto + +#include "diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HostTransferMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorMetadata; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { +class TensorMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorMetadata_default_instance_; +class HostTransferMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HostTransferMetadata_default_instance_; +class HostComputeMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HostComputeMetadata_default_instance_; +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto { +static void InitDefaultsTensorMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tf2xla::_TensorMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::tf2xla::TensorMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tf2xla::TensorMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TensorMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTensorMetadata}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base,}}; + +static void InitDefaultsHostTransferMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tf2xla::_HostTransferMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::tf2xla::HostTransferMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tf2xla::HostTransferMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HostTransferMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHostTransferMetadata}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_TensorMetadata.base,}}; + +static void InitDefaultsHostComputeMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tf2xla::_HostComputeMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::tf2xla::HostComputeMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tf2xla::HostComputeMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HostComputeMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHostComputeMetadata}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostTransferMetadata.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TensorMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_HostTransferMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_HostComputeMetadata.base); +} + +::google::protobuf::Metadata file_level_metadata[3]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::TensorMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::TensorMetadata, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::TensorMetadata, shape_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::HostTransferMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::HostTransferMetadata, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::HostTransferMetadata, metadata_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::HostComputeMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::HostComputeMetadata, device_to_host_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::HostComputeMetadata, host_to_device_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tf2xla::TensorMetadata)}, + { 7, -1, sizeof(::diplomacy::tensorflow::tf2xla::HostTransferMetadata)}, + { 14, -1, sizeof(::diplomacy::tensorflow::tf2xla::HostComputeMetadata)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tf2xla::_TensorMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tf2xla::_HostTransferMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tf2xla::_HostComputeMetadata_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n@diplomacy_tensorflow/compiler/tf2xla/h" + "ost_compute_metadata.proto\022\033diplomacy.te" + "nsorflow.tf2xla\0326diplomacy_tensorflow/co" + "re/framework/tensor_shape.proto\032/diploma" + "cy_tensorflow/core/framework/types.proto" + "\"u\n\016TensorMetadata\022,\n\004type\030\001 \001(\0162\036.diplo" + "macy.tensorflow.DataType\0225\n\005shape\030\002 \001(\0132" + "&.diplomacy.tensorflow.TensorShapeProto\"" + "b\n\024HostTransferMetadata\022\013\n\003key\030\001 \001(\t\022=\n\010" + "metadata\030\002 \003(\0132+.diplomacy.tensorflow.tf" + "2xla.TensorMetadata\"\253\001\n\023HostComputeMetad" + "ata\022I\n\016device_to_host\030\001 \003(\01321.diplomacy." + "tensorflow.tf2xla.HostTransferMetadata\022I" + "\n\016host_to_device\030\002 \003(\01321.diplomacy.tenso" + "rflow.tf2xla.HostTransferMetadataB*\n\025org" + ".tensorflow.tf2xlaB\014Tf2XlaProtosP\001\370\001\001b\006p" + "roto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 645); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { + +// =================================================================== + +void TensorMetadata::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tf2xla::_TensorMetadata_default_instance_._instance.get_mutable()->shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); +} +void TensorMetadata::unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.TensorMetadata.shape) +} +void TensorMetadata::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorMetadata::kTypeFieldNumber; +const int TensorMetadata::kShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorMetadata::TensorMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_TensorMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tf2xla.TensorMetadata) +} +TensorMetadata::TensorMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_TensorMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tf2xla.TensorMetadata) +} +TensorMetadata::TensorMetadata(const TensorMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape()) { + shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + type_ = from.type_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tf2xla.TensorMetadata) +} + +void TensorMetadata::SharedCtor() { + ::memset(&shape_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&shape_)) + sizeof(type_)); +} + +TensorMetadata::~TensorMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tf2xla.TensorMetadata) + SharedDtor(); +} + +void TensorMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete shape_; +} + +void TensorMetadata::ArenaDtor(void* object) { + TensorMetadata* _this = reinterpret_cast< TensorMetadata* >(object); + (void)_this; +} +void TensorMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorMetadata& TensorMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_TensorMetadata.base); + return *internal_default_instance(); +} + + +void TensorMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + type_ = 0; + _internal_metadata_.Clear(); +} + +bool TensorMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.DataType type = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tf2xla.TensorMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tf2xla.TensorMetadata) + return false; +#undef DO_ +} + +void TensorMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType type = 1; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->type(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tf2xla.TensorMetadata) +} + +::google::protobuf::uint8* TensorMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType type = 1; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->type(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tf2xla.TensorMetadata) + return target; +} + +size_t TensorMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // .diplomacy.tensorflow.DataType type = 1; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + GOOGLE_DCHECK_NE(&from, this); + const TensorMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tf2xla.TensorMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tf2xla.TensorMetadata) + MergeFrom(*source); + } +} + +void TensorMetadata::MergeFrom(const TensorMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_shape()) { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + } + if (from.type() != 0) { + set_type(from.type()); + } +} + +void TensorMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorMetadata::CopyFrom(const TensorMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tf2xla.TensorMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorMetadata::IsInitialized() const { + return true; +} + +void TensorMetadata::Swap(TensorMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorMetadata::UnsafeArenaSwap(TensorMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorMetadata::InternalSwap(TensorMetadata* other) { + using std::swap; + swap(shape_, other->shape_); + swap(type_, other->type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HostTransferMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HostTransferMetadata::kKeyFieldNumber; +const int HostTransferMetadata::kMetadataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HostTransferMetadata::HostTransferMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostTransferMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tf2xla.HostTransferMetadata) +} +HostTransferMetadata::HostTransferMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostTransferMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tf2xla.HostTransferMetadata) +} +HostTransferMetadata::HostTransferMetadata(const HostTransferMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + metadata_(from.metadata_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.key().size() > 0) { + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tf2xla.HostTransferMetadata) +} + +void HostTransferMetadata::SharedCtor() { + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +HostTransferMetadata::~HostTransferMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + SharedDtor(); +} + +void HostTransferMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HostTransferMetadata::ArenaDtor(void* object) { + HostTransferMetadata* _this = reinterpret_cast< HostTransferMetadata* >(object); + (void)_this; +} +void HostTransferMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HostTransferMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HostTransferMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HostTransferMetadata& HostTransferMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostTransferMetadata.base); + return *internal_default_instance(); +} + + +void HostTransferMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + metadata_.Clear(); + key_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool HostTransferMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string key = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_key())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tf2xla.HostTransferMetadata.key")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.tf2xla.TensorMetadata metadata = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_metadata())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + return false; +#undef DO_ +} + +void HostTransferMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string key = 1; + if (this->key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.HostTransferMetadata.key"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->key(), output); + } + + // repeated .diplomacy.tensorflow.tf2xla.TensorMetadata metadata = 2; + for (unsigned int i = 0, + n = static_cast(this->metadata_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->metadata(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tf2xla.HostTransferMetadata) +} + +::google::protobuf::uint8* HostTransferMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string key = 1; + if (this->key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.HostTransferMetadata.key"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->key(), target); + } + + // repeated .diplomacy.tensorflow.tf2xla.TensorMetadata metadata = 2; + for (unsigned int i = 0, + n = static_cast(this->metadata_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->metadata(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + return target; +} + +size_t HostTransferMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tf2xla.TensorMetadata metadata = 2; + { + unsigned int count = static_cast(this->metadata_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->metadata(static_cast(i))); + } + } + + // string key = 1; + if (this->key().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->key()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HostTransferMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + GOOGLE_DCHECK_NE(&from, this); + const HostTransferMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + MergeFrom(*source); + } +} + +void HostTransferMetadata::MergeFrom(const HostTransferMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + metadata_.MergeFrom(from.metadata_); + if (from.key().size() > 0) { + set_key(from.key()); + } +} + +void HostTransferMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HostTransferMetadata::CopyFrom(const HostTransferMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HostTransferMetadata::IsInitialized() const { + return true; +} + +void HostTransferMetadata::Swap(HostTransferMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HostTransferMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HostTransferMetadata::UnsafeArenaSwap(HostTransferMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HostTransferMetadata::InternalSwap(HostTransferMetadata* other) { + using std::swap; + CastToBase(&metadata_)->InternalSwap(CastToBase(&other->metadata_)); + key_.Swap(&other->key_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HostTransferMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HostComputeMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HostComputeMetadata::kDeviceToHostFieldNumber; +const int HostComputeMetadata::kHostToDeviceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HostComputeMetadata::HostComputeMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostComputeMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tf2xla.HostComputeMetadata) +} +HostComputeMetadata::HostComputeMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + device_to_host_(arena), + host_to_device_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostComputeMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tf2xla.HostComputeMetadata) +} +HostComputeMetadata::HostComputeMetadata(const HostComputeMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + device_to_host_(from.device_to_host_), + host_to_device_(from.host_to_device_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tf2xla.HostComputeMetadata) +} + +void HostComputeMetadata::SharedCtor() { +} + +HostComputeMetadata::~HostComputeMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + SharedDtor(); +} + +void HostComputeMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HostComputeMetadata::ArenaDtor(void* object) { + HostComputeMetadata* _this = reinterpret_cast< HostComputeMetadata* >(object); + (void)_this; +} +void HostComputeMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HostComputeMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HostComputeMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HostComputeMetadata& HostComputeMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostComputeMetadata.base); + return *internal_default_instance(); +} + + +void HostComputeMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + device_to_host_.Clear(); + host_to_device_.Clear(); + _internal_metadata_.Clear(); +} + +bool HostComputeMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata device_to_host = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_device_to_host())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata host_to_device = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_host_to_device())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + return false; +#undef DO_ +} + +void HostComputeMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata device_to_host = 1; + for (unsigned int i = 0, + n = static_cast(this->device_to_host_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->device_to_host(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata host_to_device = 2; + for (unsigned int i = 0, + n = static_cast(this->host_to_device_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->host_to_device(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tf2xla.HostComputeMetadata) +} + +::google::protobuf::uint8* HostComputeMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata device_to_host = 1; + for (unsigned int i = 0, + n = static_cast(this->device_to_host_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->device_to_host(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata host_to_device = 2; + for (unsigned int i = 0, + n = static_cast(this->host_to_device_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->host_to_device(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + return target; +} + +size_t HostComputeMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata device_to_host = 1; + { + unsigned int count = static_cast(this->device_to_host_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->device_to_host(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata host_to_device = 2; + { + unsigned int count = static_cast(this->host_to_device_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->host_to_device(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HostComputeMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + GOOGLE_DCHECK_NE(&from, this); + const HostComputeMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + MergeFrom(*source); + } +} + +void HostComputeMetadata::MergeFrom(const HostComputeMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + device_to_host_.MergeFrom(from.device_to_host_); + host_to_device_.MergeFrom(from.host_to_device_); +} + +void HostComputeMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HostComputeMetadata::CopyFrom(const HostComputeMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HostComputeMetadata::IsInitialized() const { + return true; +} + +void HostComputeMetadata::Swap(HostComputeMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HostComputeMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HostComputeMetadata::UnsafeArenaSwap(HostComputeMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HostComputeMetadata::InternalSwap(HostComputeMetadata* other) { + using std::swap; + CastToBase(&device_to_host_)->InternalSwap(CastToBase(&other->device_to_host_)); + CastToBase(&host_to_device_)->InternalSwap(CastToBase(&other->host_to_device_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HostComputeMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tf2xla::TensorMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tf2xla::TensorMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tf2xla::TensorMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tf2xla::HostComputeMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tf2xla::HostComputeMetadata >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.h new file mode 100644 index 0000000..aac0da9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.h @@ -0,0 +1,768 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[3]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { +class HostComputeMetadata; +class HostComputeMetadataDefaultTypeInternal; +extern HostComputeMetadataDefaultTypeInternal _HostComputeMetadata_default_instance_; +class HostTransferMetadata; +class HostTransferMetadataDefaultTypeInternal; +extern HostTransferMetadataDefaultTypeInternal _HostTransferMetadata_default_instance_; +class TensorMetadata; +class TensorMetadataDefaultTypeInternal; +extern TensorMetadataDefaultTypeInternal _TensorMetadata_default_instance_; +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::HostComputeMetadata>(Arena*); +template<> ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::HostTransferMetadata>(Arena*); +template<> ::diplomacy::tensorflow::tf2xla::TensorMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::TensorMetadata>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { + +// =================================================================== + +class TensorMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tf2xla.TensorMetadata) */ { + public: + TensorMetadata(); + virtual ~TensorMetadata(); + + TensorMetadata(const TensorMetadata& from); + + inline TensorMetadata& operator=(const TensorMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorMetadata(TensorMetadata&& from) noexcept + : TensorMetadata() { + *this = ::std::move(from); + } + + inline TensorMetadata& operator=(TensorMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorMetadata* internal_default_instance() { + return reinterpret_cast( + &_TensorMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TensorMetadata* other); + void Swap(TensorMetadata* other); + friend void swap(TensorMetadata& a, TensorMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorMetadata& from); + void MergeFrom(const TensorMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorMetadata* other); + protected: + explicit TensorMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // .diplomacy.tensorflow.DataType type = 1; + void clear_type(); + static const int kTypeFieldNumber = 1; + ::diplomacy::tensorflow::DataType type() const; + void set_type(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.TensorMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + int type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HostTransferMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tf2xla.HostTransferMetadata) */ { + public: + HostTransferMetadata(); + virtual ~HostTransferMetadata(); + + HostTransferMetadata(const HostTransferMetadata& from); + + inline HostTransferMetadata& operator=(const HostTransferMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HostTransferMetadata(HostTransferMetadata&& from) noexcept + : HostTransferMetadata() { + *this = ::std::move(from); + } + + inline HostTransferMetadata& operator=(HostTransferMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HostTransferMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HostTransferMetadata* internal_default_instance() { + return reinterpret_cast( + &_HostTransferMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(HostTransferMetadata* other); + void Swap(HostTransferMetadata* other); + friend void swap(HostTransferMetadata& a, HostTransferMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HostTransferMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + HostTransferMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HostTransferMetadata& from); + void MergeFrom(const HostTransferMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HostTransferMetadata* other); + protected: + explicit HostTransferMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tf2xla.TensorMetadata metadata = 2; + int metadata_size() const; + void clear_metadata(); + static const int kMetadataFieldNumber = 2; + ::diplomacy::tensorflow::tf2xla::TensorMetadata* mutable_metadata(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::TensorMetadata >* + mutable_metadata(); + const ::diplomacy::tensorflow::tf2xla::TensorMetadata& metadata(int index) const; + ::diplomacy::tensorflow::tf2xla::TensorMetadata* add_metadata(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::TensorMetadata >& + metadata() const; + + // string key = 1; + void clear_key(); + static const int kKeyFieldNumber = 1; + const ::std::string& key() const; + void set_key(const ::std::string& value); + #if LANG_CXX11 + void set_key(::std::string&& value); + #endif + void set_key(const char* value); + void set_key(const char* value, size_t size); + ::std::string* mutable_key(); + ::std::string* release_key(); + void set_allocated_key(::std::string* key); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_key(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_key( + ::std::string* key); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::TensorMetadata > metadata_; + ::google::protobuf::internal::ArenaStringPtr key_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HostComputeMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tf2xla.HostComputeMetadata) */ { + public: + HostComputeMetadata(); + virtual ~HostComputeMetadata(); + + HostComputeMetadata(const HostComputeMetadata& from); + + inline HostComputeMetadata& operator=(const HostComputeMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HostComputeMetadata(HostComputeMetadata&& from) noexcept + : HostComputeMetadata() { + *this = ::std::move(from); + } + + inline HostComputeMetadata& operator=(HostComputeMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HostComputeMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HostComputeMetadata* internal_default_instance() { + return reinterpret_cast( + &_HostComputeMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(HostComputeMetadata* other); + void Swap(HostComputeMetadata* other); + friend void swap(HostComputeMetadata& a, HostComputeMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HostComputeMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + HostComputeMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HostComputeMetadata& from); + void MergeFrom(const HostComputeMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HostComputeMetadata* other); + protected: + explicit HostComputeMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata device_to_host = 1; + int device_to_host_size() const; + void clear_device_to_host(); + static const int kDeviceToHostFieldNumber = 1; + ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* mutable_device_to_host(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >* + mutable_device_to_host(); + const ::diplomacy::tensorflow::tf2xla::HostTransferMetadata& device_to_host(int index) const; + ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* add_device_to_host(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >& + device_to_host() const; + + // repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata host_to_device = 2; + int host_to_device_size() const; + void clear_host_to_device(); + static const int kHostToDeviceFieldNumber = 2; + ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* mutable_host_to_device(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >* + mutable_host_to_device(); + const ::diplomacy::tensorflow::tf2xla::HostTransferMetadata& host_to_device(int index) const; + ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* add_host_to_device(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >& + host_to_device() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata > device_to_host_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata > host_to_device_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TensorMetadata + +// .diplomacy.tensorflow.DataType type = 1; +inline void TensorMetadata::clear_type() { + type_ = 0; +} +inline ::diplomacy::tensorflow::DataType TensorMetadata::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.TensorMetadata.type) + return static_cast< ::diplomacy::tensorflow::DataType >(type_); +} +inline void TensorMetadata::set_type(::diplomacy::tensorflow::DataType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tf2xla.TensorMetadata.type) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 2; +inline bool TensorMetadata::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& TensorMetadata::_internal_shape() const { + return *shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& TensorMetadata::shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.TensorMetadata.shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorMetadata::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.TensorMetadata.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorMetadata::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.TensorMetadata.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorMetadata::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.TensorMetadata.shape) + return shape_; +} +inline void TensorMetadata::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.TensorMetadata.shape) +} + +// ------------------------------------------------------------------- + +// HostTransferMetadata + +// string key = 1; +inline void HostTransferMetadata::clear_key() { + key_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HostTransferMetadata::key() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) + return key_.Get(); +} +inline void HostTransferMetadata::set_key(const ::std::string& value) { + + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) +} +#if LANG_CXX11 +inline void HostTransferMetadata::set_key(::std::string&& value) { + + key_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) +} +#endif +inline void HostTransferMetadata::set_key(const char* value) { + GOOGLE_DCHECK(value != NULL); + + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) +} +inline void HostTransferMetadata::set_key(const char* value, + size_t size) { + + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) +} +inline ::std::string* HostTransferMetadata::mutable_key() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) + return key_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HostTransferMetadata::release_key() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) + + return key_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HostTransferMetadata::set_allocated_key(::std::string* key) { + if (key != NULL) { + + } else { + + } + key_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), key, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) +} +inline ::std::string* HostTransferMetadata::unsafe_arena_release_key() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return key_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HostTransferMetadata::unsafe_arena_set_allocated_key( + ::std::string* key) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (key != NULL) { + + } else { + + } + key_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + key, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.HostTransferMetadata.key) +} + +// repeated .diplomacy.tensorflow.tf2xla.TensorMetadata metadata = 2; +inline int HostTransferMetadata::metadata_size() const { + return metadata_.size(); +} +inline void HostTransferMetadata::clear_metadata() { + metadata_.Clear(); +} +inline ::diplomacy::tensorflow::tf2xla::TensorMetadata* HostTransferMetadata::mutable_metadata(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.HostTransferMetadata.metadata) + return metadata_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::TensorMetadata >* +HostTransferMetadata::mutable_metadata() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tf2xla.HostTransferMetadata.metadata) + return &metadata_; +} +inline const ::diplomacy::tensorflow::tf2xla::TensorMetadata& HostTransferMetadata::metadata(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.HostTransferMetadata.metadata) + return metadata_.Get(index); +} +inline ::diplomacy::tensorflow::tf2xla::TensorMetadata* HostTransferMetadata::add_metadata() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tf2xla.HostTransferMetadata.metadata) + return metadata_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::TensorMetadata >& +HostTransferMetadata::metadata() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tf2xla.HostTransferMetadata.metadata) + return metadata_; +} + +// ------------------------------------------------------------------- + +// HostComputeMetadata + +// repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata device_to_host = 1; +inline int HostComputeMetadata::device_to_host_size() const { + return device_to_host_.size(); +} +inline void HostComputeMetadata::clear_device_to_host() { + device_to_host_.Clear(); +} +inline ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* HostComputeMetadata::mutable_device_to_host(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.HostComputeMetadata.device_to_host) + return device_to_host_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >* +HostComputeMetadata::mutable_device_to_host() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tf2xla.HostComputeMetadata.device_to_host) + return &device_to_host_; +} +inline const ::diplomacy::tensorflow::tf2xla::HostTransferMetadata& HostComputeMetadata::device_to_host(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.HostComputeMetadata.device_to_host) + return device_to_host_.Get(index); +} +inline ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* HostComputeMetadata::add_device_to_host() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tf2xla.HostComputeMetadata.device_to_host) + return device_to_host_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >& +HostComputeMetadata::device_to_host() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tf2xla.HostComputeMetadata.device_to_host) + return device_to_host_; +} + +// repeated .diplomacy.tensorflow.tf2xla.HostTransferMetadata host_to_device = 2; +inline int HostComputeMetadata::host_to_device_size() const { + return host_to_device_.size(); +} +inline void HostComputeMetadata::clear_host_to_device() { + host_to_device_.Clear(); +} +inline ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* HostComputeMetadata::mutable_host_to_device(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.HostComputeMetadata.host_to_device) + return host_to_device_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >* +HostComputeMetadata::mutable_host_to_device() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tf2xla.HostComputeMetadata.host_to_device) + return &host_to_device_; +} +inline const ::diplomacy::tensorflow::tf2xla::HostTransferMetadata& HostComputeMetadata::host_to_device(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.HostComputeMetadata.host_to_device) + return host_to_device_.Get(index); +} +inline ::diplomacy::tensorflow::tf2xla::HostTransferMetadata* HostComputeMetadata::add_host_to_device() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tf2xla.HostComputeMetadata.host_to_device) + return host_to_device_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::HostTransferMetadata >& +HostComputeMetadata::host_to_device() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tf2xla.HostComputeMetadata.host_to_device) + return host_to_device_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto new file mode 100644 index 0000000..08806ba --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tf2xla; +option cc_enable_arenas = true; +option java_outer_classname = "Tf2XlaProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.tf2xla"; + +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +// TensorMetadata indicates the type and shape of a Tensor that is +// part of a host compute transfer. +message TensorMetadata { + DataType type = 1; + TensorShapeProto shape = 2; +} + +// HostTransferMetadata describes a transfer either from host to device +// or device to host. It has a key that is unique to the computation, +// and metadata about the list of tensors being transferred. +message HostTransferMetadata { + // The key used to identify this transfer. + string key = 1; + + // For each Tensor being transferred, its type and shape. + repeated TensorMetadata metadata = 2; +} + +// HostComputeMetadata describes all the sends and recvs +// from all host compute transfer ops in a computation. +message HostComputeMetadata { + // Metadata about each device_to_host transfer + repeated HostTransferMetadata device_to_host = 1; + + // Metadata about each host_to_device transfer + repeated HostTransferMetadata host_to_device = 2; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata_pb2.py new file mode 100644 index 0000000..e5a4180 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata_pb2.py @@ -0,0 +1,177 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto', + package='diplomacy.tensorflow.tf2xla', + syntax='proto3', + serialized_options=_b('\n\025org.tensorflow.tf2xlaB\014Tf2XlaProtosP\001\370\001\001'), + serialized_pb=_b('\n@diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto\x12\x1b\x64iplomacy.tensorflow.tf2xla\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"u\n\x0eTensorMetadata\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\x12\x35\n\x05shape\x18\x02 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProto\"b\n\x14HostTransferMetadata\x12\x0b\n\x03key\x18\x01 \x01(\t\x12=\n\x08metadata\x18\x02 \x03(\x0b\x32+.diplomacy.tensorflow.tf2xla.TensorMetadata\"\xab\x01\n\x13HostComputeMetadata\x12I\n\x0e\x64\x65vice_to_host\x18\x01 \x03(\x0b\x32\x31.diplomacy.tensorflow.tf2xla.HostTransferMetadata\x12I\n\x0ehost_to_device\x18\x02 \x03(\x0b\x32\x31.diplomacy.tensorflow.tf2xla.HostTransferMetadataB*\n\x15org.tensorflow.tf2xlaB\x0cTf2XlaProtosP\x01\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + + +_TENSORMETADATA = _descriptor.Descriptor( + name='TensorMetadata', + full_name='diplomacy.tensorflow.tf2xla.TensorMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.tf2xla.TensorMetadata.type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.tf2xla.TensorMetadata.shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=202, + serialized_end=319, +) + + +_HOSTTRANSFERMETADATA = _descriptor.Descriptor( + name='HostTransferMetadata', + full_name='diplomacy.tensorflow.tf2xla.HostTransferMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.tf2xla.HostTransferMetadata.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata', full_name='diplomacy.tensorflow.tf2xla.HostTransferMetadata.metadata', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=321, + serialized_end=419, +) + + +_HOSTCOMPUTEMETADATA = _descriptor.Descriptor( + name='HostComputeMetadata', + full_name='diplomacy.tensorflow.tf2xla.HostComputeMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device_to_host', full_name='diplomacy.tensorflow.tf2xla.HostComputeMetadata.device_to_host', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='host_to_device', full_name='diplomacy.tensorflow.tf2xla.HostComputeMetadata.host_to_device', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=422, + serialized_end=593, +) + +_TENSORMETADATA.fields_by_name['type'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_TENSORMETADATA.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_HOSTTRANSFERMETADATA.fields_by_name['metadata'].message_type = _TENSORMETADATA +_HOSTCOMPUTEMETADATA.fields_by_name['device_to_host'].message_type = _HOSTTRANSFERMETADATA +_HOSTCOMPUTEMETADATA.fields_by_name['host_to_device'].message_type = _HOSTTRANSFERMETADATA +DESCRIPTOR.message_types_by_name['TensorMetadata'] = _TENSORMETADATA +DESCRIPTOR.message_types_by_name['HostTransferMetadata'] = _HOSTTRANSFERMETADATA +DESCRIPTOR.message_types_by_name['HostComputeMetadata'] = _HOSTCOMPUTEMETADATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TensorMetadata = _reflection.GeneratedProtocolMessageType('TensorMetadata', (_message.Message,), dict( + DESCRIPTOR = _TENSORMETADATA, + __module__ = 'diplomacy_tensorflow.compiler.tf2xla.host_compute_metadata_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.TensorMetadata) + )) +_sym_db.RegisterMessage(TensorMetadata) + +HostTransferMetadata = _reflection.GeneratedProtocolMessageType('HostTransferMetadata', (_message.Message,), dict( + DESCRIPTOR = _HOSTTRANSFERMETADATA, + __module__ = 'diplomacy_tensorflow.compiler.tf2xla.host_compute_metadata_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.HostTransferMetadata) + )) +_sym_db.RegisterMessage(HostTransferMetadata) + +HostComputeMetadata = _reflection.GeneratedProtocolMessageType('HostComputeMetadata', (_message.Message,), dict( + DESCRIPTOR = _HOSTCOMPUTEMETADATA, + __module__ = 'diplomacy_tensorflow.compiler.tf2xla.host_compute_metadata_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.HostComputeMetadata) + )) +_sym_db.RegisterMessage(HostComputeMetadata) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.pb.cc new file mode 100644 index 0000000..0e64f0b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.pb.cc @@ -0,0 +1,1653 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto + +#include "diplomacy_tensorflow/compiler/tf2xla/tf2xla.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TensorId; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Fetch; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Feed; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { +class TensorIdDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorId_default_instance_; +class FeedDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Feed_default_instance_; +class FetchDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Fetch_default_instance_; +class ConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Config_default_instance_; +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto { +static void InitDefaultsTensorId() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tf2xla::_TensorId_default_instance_; + new (ptr) ::diplomacy::tensorflow::tf2xla::TensorId(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tf2xla::TensorId::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TensorId = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTensorId}, {}}; + +static void InitDefaultsFeed() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tf2xla::_Feed_default_instance_; + new (ptr) ::diplomacy::tensorflow::tf2xla::Feed(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tf2xla::Feed::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_Feed = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFeed}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_TensorId.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base,}}; + +static void InitDefaultsFetch() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tf2xla::_Fetch_default_instance_; + new (ptr) ::diplomacy::tensorflow::tf2xla::Fetch(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tf2xla::Fetch::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Fetch = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFetch}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_TensorId.base,}}; + +static void InitDefaultsConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tf2xla::_Config_default_instance_; + new (ptr) ::diplomacy::tensorflow::tf2xla::Config(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tf2xla::Config::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_Config = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Feed.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Fetch.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TensorId.base); + ::google::protobuf::internal::InitSCC(&scc_info_Feed.base); + ::google::protobuf::internal::InitSCC(&scc_info_Fetch.base); + ::google::protobuf::internal::InitSCC(&scc_info_Config.base); +} + +::google::protobuf::Metadata file_level_metadata[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::TensorId, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::TensorId, node_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::TensorId, output_index_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Feed, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Feed, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Feed, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Feed, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Feed, type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Fetch, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Fetch, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Fetch, name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Config, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Config, feed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tf2xla::Config, fetch_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tf2xla::TensorId)}, + { 7, -1, sizeof(::diplomacy::tensorflow::tf2xla::Feed)}, + { 16, -1, sizeof(::diplomacy::tensorflow::tf2xla::Fetch)}, + { 23, -1, sizeof(::diplomacy::tensorflow::tf2xla::Config)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tf2xla::_TensorId_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tf2xla::_Feed_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tf2xla::_Fetch_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tf2xla::_Config_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n1diplomacy_tensorflow/compiler/tf2xla/t" + "f2xla.proto\022\033diplomacy.tensorflow.tf2xla" + "\0326diplomacy_tensorflow/core/framework/te" + "nsor_shape.proto\032/diplomacy_tensorflow/c" + "ore/framework/types.proto\"3\n\010TensorId\022\021\n" + "\tnode_name\030\001 \001(\t\022\024\n\014output_index\030\002 \001(\003\"\254" + "\001\n\004Feed\0221\n\002id\030\001 \001(\0132%.diplomacy.tensorfl" + "ow.tf2xla.TensorId\0225\n\005shape\030\002 \001(\0132&.dipl" + "omacy.tensorflow.TensorShapeProto\022\014\n\004nam" + "e\030\003 \001(\t\022,\n\004type\030\004 \001(\0162\036.diplomacy.tensor" + "flow.DataType\"H\n\005Fetch\0221\n\002id\030\001 \001(\0132%.dip" + "lomacy.tensorflow.tf2xla.TensorId\022\014\n\004nam" + "e\030\002 \001(\t\"l\n\006Config\022/\n\004feed\030\001 \003(\0132!.diplom" + "acy.tensorflow.tf2xla.Feed\0221\n\005fetch\030\002 \003(" + "\0132\".diplomacy.tensorflow.tf2xla.FetchB*\n" + "\025org.tensorflow.tf2xlaB\014Tf2XlaProtosP\001\370\001" + "\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 649); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { + +// =================================================================== + +void TensorId::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorId::kNodeNameFieldNumber; +const int TensorId::kOutputIndexFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorId::TensorId() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_TensorId.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tf2xla.TensorId) +} +TensorId::TensorId(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_TensorId.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tf2xla.TensorId) +} +TensorId::TensorId(const TensorId& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.node_name().size() > 0) { + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node_name(), + GetArenaNoVirtual()); + } + output_index_ = from.output_index_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tf2xla.TensorId) +} + +void TensorId::SharedCtor() { + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_index_ = GOOGLE_LONGLONG(0); +} + +TensorId::~TensorId() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tf2xla.TensorId) + SharedDtor(); +} + +void TensorId::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + node_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void TensorId::ArenaDtor(void* object) { + TensorId* _this = reinterpret_cast< TensorId* >(object); + (void)_this; +} +void TensorId::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorId::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorId::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorId& TensorId::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_TensorId.base); + return *internal_default_instance(); +} + + +void TensorId::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tf2xla.TensorId) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + output_index_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool TensorId::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tf2xla.TensorId) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string node_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_node_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tf2xla.TensorId.node_name")); + } else { + goto handle_unusual; + } + break; + } + + // int64 output_index = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &output_index_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tf2xla.TensorId) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tf2xla.TensorId) + return false; +#undef DO_ +} + +void TensorId::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tf2xla.TensorId) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string node_name = 1; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.TensorId.node_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->node_name(), output); + } + + // int64 output_index = 2; + if (this->output_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->output_index(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tf2xla.TensorId) +} + +::google::protobuf::uint8* TensorId::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tf2xla.TensorId) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string node_name = 1; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.TensorId.node_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->node_name(), target); + } + + // int64 output_index = 2; + if (this->output_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->output_index(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tf2xla.TensorId) + return target; +} + +size_t TensorId::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tf2xla.TensorId) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string node_name = 1; + if (this->node_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->node_name()); + } + + // int64 output_index = 2; + if (this->output_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->output_index()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorId::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tf2xla.TensorId) + GOOGLE_DCHECK_NE(&from, this); + const TensorId* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tf2xla.TensorId) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tf2xla.TensorId) + MergeFrom(*source); + } +} + +void TensorId::MergeFrom(const TensorId& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tf2xla.TensorId) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.node_name().size() > 0) { + set_node_name(from.node_name()); + } + if (from.output_index() != 0) { + set_output_index(from.output_index()); + } +} + +void TensorId::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tf2xla.TensorId) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorId::CopyFrom(const TensorId& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tf2xla.TensorId) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorId::IsInitialized() const { + return true; +} + +void TensorId::Swap(TensorId* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorId* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorId::UnsafeArenaSwap(TensorId* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorId::InternalSwap(TensorId* other) { + using std::swap; + node_name_.Swap(&other->node_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(output_index_, other->output_index_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorId::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Feed::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tf2xla::_Feed_default_instance_._instance.get_mutable()->id_ = const_cast< ::diplomacy::tensorflow::tf2xla::TensorId*>( + ::diplomacy::tensorflow::tf2xla::TensorId::internal_default_instance()); + ::diplomacy::tensorflow::tf2xla::_Feed_default_instance_._instance.get_mutable()->shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); +} +void Feed::unsafe_arena_set_allocated_id( + ::diplomacy::tensorflow::tf2xla::TensorId* id) { + if (GetArenaNoVirtual() == NULL) { + delete id_; + } + id_ = id; + if (id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.Feed.id) +} +void Feed::unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.Feed.shape) +} +void Feed::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Feed::kIdFieldNumber; +const int Feed::kShapeFieldNumber; +const int Feed::kNameFieldNumber; +const int Feed::kTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Feed::Feed() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Feed.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tf2xla.Feed) +} +Feed::Feed(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Feed.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tf2xla.Feed) +} +Feed::Feed(const Feed& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + if (from.has_id()) { + id_ = new ::diplomacy::tensorflow::tf2xla::TensorId(*from.id_); + } else { + id_ = NULL; + } + if (from.has_shape()) { + shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + type_ = from.type_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tf2xla.Feed) +} + +void Feed::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&id_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&id_)) + sizeof(type_)); +} + +Feed::~Feed() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tf2xla.Feed) + SharedDtor(); +} + +void Feed::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete id_; + if (this != internal_default_instance()) delete shape_; +} + +void Feed::ArenaDtor(void* object) { + Feed* _this = reinterpret_cast< Feed* >(object); + (void)_this; +} +void Feed::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Feed::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Feed::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Feed& Feed::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Feed.base); + return *internal_default_instance(); +} + + +void Feed::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tf2xla.Feed) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && id_ != NULL) { + delete id_; + } + id_ = NULL; + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + type_ = 0; + _internal_metadata_.Clear(); +} + +bool Feed::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tf2xla.Feed) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_id())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // string name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tf2xla.Feed.name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType type = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tf2xla.Feed) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tf2xla.Feed) + return false; +#undef DO_ +} + +void Feed::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tf2xla.Feed) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + if (this->has_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_id(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape(), output); + } + + // string name = 3; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.Feed.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->name(), output); + } + + // .diplomacy.tensorflow.DataType type = 4; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->type(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tf2xla.Feed) +} + +::google::protobuf::uint8* Feed::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tf2xla.Feed) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + if (this->has_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_id(), deterministic, target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape(), deterministic, target); + } + + // string name = 3; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.Feed.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->name(), target); + } + + // .diplomacy.tensorflow.DataType type = 4; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->type(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tf2xla.Feed) + return target; +} + +size_t Feed::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tf2xla.Feed) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 3; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + if (this->has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *id_); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // .diplomacy.tensorflow.DataType type = 4; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Feed::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tf2xla.Feed) + GOOGLE_DCHECK_NE(&from, this); + const Feed* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tf2xla.Feed) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tf2xla.Feed) + MergeFrom(*source); + } +} + +void Feed::MergeFrom(const Feed& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tf2xla.Feed) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.has_id()) { + mutable_id()->::diplomacy::tensorflow::tf2xla::TensorId::MergeFrom(from.id()); + } + if (from.has_shape()) { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + } + if (from.type() != 0) { + set_type(from.type()); + } +} + +void Feed::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tf2xla.Feed) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Feed::CopyFrom(const Feed& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tf2xla.Feed) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Feed::IsInitialized() const { + return true; +} + +void Feed::Swap(Feed* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Feed* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Feed::UnsafeArenaSwap(Feed* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Feed::InternalSwap(Feed* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(id_, other->id_); + swap(shape_, other->shape_); + swap(type_, other->type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Feed::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Fetch::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tf2xla::_Fetch_default_instance_._instance.get_mutable()->id_ = const_cast< ::diplomacy::tensorflow::tf2xla::TensorId*>( + ::diplomacy::tensorflow::tf2xla::TensorId::internal_default_instance()); +} +void Fetch::unsafe_arena_set_allocated_id( + ::diplomacy::tensorflow::tf2xla::TensorId* id) { + if (GetArenaNoVirtual() == NULL) { + delete id_; + } + id_ = id; + if (id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.Fetch.id) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Fetch::kIdFieldNumber; +const int Fetch::kNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Fetch::Fetch() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Fetch.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tf2xla.Fetch) +} +Fetch::Fetch(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Fetch.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tf2xla.Fetch) +} +Fetch::Fetch(const Fetch& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + if (from.has_id()) { + id_ = new ::diplomacy::tensorflow::tf2xla::TensorId(*from.id_); + } else { + id_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tf2xla.Fetch) +} + +void Fetch::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + id_ = NULL; +} + +Fetch::~Fetch() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tf2xla.Fetch) + SharedDtor(); +} + +void Fetch::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete id_; +} + +void Fetch::ArenaDtor(void* object) { + Fetch* _this = reinterpret_cast< Fetch* >(object); + (void)_this; +} +void Fetch::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Fetch::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Fetch::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Fetch& Fetch::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Fetch.base); + return *internal_default_instance(); +} + + +void Fetch::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tf2xla.Fetch) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && id_ != NULL) { + delete id_; + } + id_ = NULL; + _internal_metadata_.Clear(); +} + +bool Fetch::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tf2xla.Fetch) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_id())); + } else { + goto handle_unusual; + } + break; + } + + // string name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tf2xla.Fetch.name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tf2xla.Fetch) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tf2xla.Fetch) + return false; +#undef DO_ +} + +void Fetch::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tf2xla.Fetch) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + if (this->has_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_id(), output); + } + + // string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.Fetch.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tf2xla.Fetch) +} + +::google::protobuf::uint8* Fetch::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tf2xla.Fetch) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + if (this->has_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_id(), deterministic, target); + } + + // string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tf2xla.Fetch.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tf2xla.Fetch) + return target; +} + +size_t Fetch::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tf2xla.Fetch) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 2; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + if (this->has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *id_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Fetch::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tf2xla.Fetch) + GOOGLE_DCHECK_NE(&from, this); + const Fetch* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tf2xla.Fetch) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tf2xla.Fetch) + MergeFrom(*source); + } +} + +void Fetch::MergeFrom(const Fetch& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tf2xla.Fetch) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.has_id()) { + mutable_id()->::diplomacy::tensorflow::tf2xla::TensorId::MergeFrom(from.id()); + } +} + +void Fetch::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tf2xla.Fetch) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Fetch::CopyFrom(const Fetch& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tf2xla.Fetch) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Fetch::IsInitialized() const { + return true; +} + +void Fetch::Swap(Fetch* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Fetch* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Fetch::UnsafeArenaSwap(Fetch* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Fetch::InternalSwap(Fetch* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(id_, other->id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Fetch::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Config::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Config::kFeedFieldNumber; +const int Config::kFetchFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Config::Config() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Config.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tf2xla.Config) +} +Config::Config(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + feed_(arena), + fetch_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Config.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tf2xla.Config) +} +Config::Config(const Config& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + feed_(from.feed_), + fetch_(from.fetch_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tf2xla.Config) +} + +void Config::SharedCtor() { +} + +Config::~Config() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tf2xla.Config) + SharedDtor(); +} + +void Config::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Config::ArenaDtor(void* object) { + Config* _this = reinterpret_cast< Config* >(object); + (void)_this; +} +void Config::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Config::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Config::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Config& Config::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::scc_info_Config.base); + return *internal_default_instance(); +} + + +void Config::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tf2xla.Config) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feed_.Clear(); + fetch_.Clear(); + _internal_metadata_.Clear(); +} + +bool Config::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tf2xla.Config) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tf2xla.Feed feed = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_feed())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.tf2xla.Fetch fetch = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_fetch())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tf2xla.Config) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tf2xla.Config) + return false; +#undef DO_ +} + +void Config::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tf2xla.Config) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tf2xla.Feed feed = 1; + for (unsigned int i = 0, + n = static_cast(this->feed_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->feed(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.tf2xla.Fetch fetch = 2; + for (unsigned int i = 0, + n = static_cast(this->fetch_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->fetch(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tf2xla.Config) +} + +::google::protobuf::uint8* Config::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tf2xla.Config) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tf2xla.Feed feed = 1; + for (unsigned int i = 0, + n = static_cast(this->feed_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->feed(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.tf2xla.Fetch fetch = 2; + for (unsigned int i = 0, + n = static_cast(this->fetch_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->fetch(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tf2xla.Config) + return target; +} + +size_t Config::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tf2xla.Config) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tf2xla.Feed feed = 1; + { + unsigned int count = static_cast(this->feed_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->feed(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.tf2xla.Fetch fetch = 2; + { + unsigned int count = static_cast(this->fetch_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->fetch(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Config::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tf2xla.Config) + GOOGLE_DCHECK_NE(&from, this); + const Config* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tf2xla.Config) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tf2xla.Config) + MergeFrom(*source); + } +} + +void Config::MergeFrom(const Config& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tf2xla.Config) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feed_.MergeFrom(from.feed_); + fetch_.MergeFrom(from.fetch_); +} + +void Config::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tf2xla.Config) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Config::CopyFrom(const Config& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tf2xla.Config) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Config::IsInitialized() const { + return true; +} + +void Config::Swap(Config* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Config* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Config::UnsafeArenaSwap(Config* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Config::InternalSwap(Config* other) { + using std::swap; + CastToBase(&feed_)->InternalSwap(CastToBase(&other->feed_)); + CastToBase(&fetch_)->InternalSwap(CastToBase(&other->fetch_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Config::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tf2xla::TensorId* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tf2xla::TensorId >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tf2xla::TensorId >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tf2xla::Feed* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tf2xla::Feed >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tf2xla::Feed >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tf2xla::Fetch* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tf2xla::Fetch >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tf2xla::Fetch >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tf2xla::Config* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tf2xla::Config >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tf2xla::Config >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.pb.h new file mode 100644 index 0000000..1d9e0c0 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.pb.h @@ -0,0 +1,1227 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { +class Config; +class ConfigDefaultTypeInternal; +extern ConfigDefaultTypeInternal _Config_default_instance_; +class Feed; +class FeedDefaultTypeInternal; +extern FeedDefaultTypeInternal _Feed_default_instance_; +class Fetch; +class FetchDefaultTypeInternal; +extern FetchDefaultTypeInternal _Fetch_default_instance_; +class TensorId; +class TensorIdDefaultTypeInternal; +extern TensorIdDefaultTypeInternal _TensorId_default_instance_; +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tf2xla::Config* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::Config>(Arena*); +template<> ::diplomacy::tensorflow::tf2xla::Feed* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::Feed>(Arena*); +template<> ::diplomacy::tensorflow::tf2xla::Fetch* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::Fetch>(Arena*); +template<> ::diplomacy::tensorflow::tf2xla::TensorId* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::TensorId>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tf2xla { + +// =================================================================== + +class TensorId : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tf2xla.TensorId) */ { + public: + TensorId(); + virtual ~TensorId(); + + TensorId(const TensorId& from); + + inline TensorId& operator=(const TensorId& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorId(TensorId&& from) noexcept + : TensorId() { + *this = ::std::move(from); + } + + inline TensorId& operator=(TensorId&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorId& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorId* internal_default_instance() { + return reinterpret_cast( + &_TensorId_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TensorId* other); + void Swap(TensorId* other); + friend void swap(TensorId& a, TensorId& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorId* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorId* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorId& from); + void MergeFrom(const TensorId& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorId* other); + protected: + explicit TensorId(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string node_name = 1; + void clear_node_name(); + static const int kNodeNameFieldNumber = 1; + const ::std::string& node_name() const; + void set_node_name(const ::std::string& value); + #if LANG_CXX11 + void set_node_name(::std::string&& value); + #endif + void set_node_name(const char* value); + void set_node_name(const char* value, size_t size); + ::std::string* mutable_node_name(); + ::std::string* release_node_name(); + void set_allocated_node_name(::std::string* node_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_node_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_node_name( + ::std::string* node_name); + + // int64 output_index = 2; + void clear_output_index(); + static const int kOutputIndexFieldNumber = 2; + ::google::protobuf::int64 output_index() const; + void set_output_index(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.TensorId) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr node_name_; + ::google::protobuf::int64 output_index_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Feed : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tf2xla.Feed) */ { + public: + Feed(); + virtual ~Feed(); + + Feed(const Feed& from); + + inline Feed& operator=(const Feed& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Feed(Feed&& from) noexcept + : Feed() { + *this = ::std::move(from); + } + + inline Feed& operator=(Feed&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Feed& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Feed* internal_default_instance() { + return reinterpret_cast( + &_Feed_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(Feed* other); + void Swap(Feed* other); + friend void swap(Feed& a, Feed& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Feed* New() const final { + return CreateMaybeMessage(NULL); + } + + Feed* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Feed& from); + void MergeFrom(const Feed& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Feed* other); + protected: + explicit Feed(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 3; + void clear_name(); + static const int kNameFieldNumber = 3; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + bool has_id() const; + void clear_id(); + static const int kIdFieldNumber = 1; + private: + const ::diplomacy::tensorflow::tf2xla::TensorId& _internal_id() const; + public: + const ::diplomacy::tensorflow::tf2xla::TensorId& id() const; + ::diplomacy::tensorflow::tf2xla::TensorId* release_id(); + ::diplomacy::tensorflow::tf2xla::TensorId* mutable_id(); + void set_allocated_id(::diplomacy::tensorflow::tf2xla::TensorId* id); + void unsafe_arena_set_allocated_id( + ::diplomacy::tensorflow::tf2xla::TensorId* id); + ::diplomacy::tensorflow::tf2xla::TensorId* unsafe_arena_release_id(); + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // .diplomacy.tensorflow.DataType type = 4; + void clear_type(); + static const int kTypeFieldNumber = 4; + ::diplomacy::tensorflow::DataType type() const; + void set_type(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.Feed) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::diplomacy::tensorflow::tf2xla::TensorId* id_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + int type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Fetch : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tf2xla.Fetch) */ { + public: + Fetch(); + virtual ~Fetch(); + + Fetch(const Fetch& from); + + inline Fetch& operator=(const Fetch& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Fetch(Fetch&& from) noexcept + : Fetch() { + *this = ::std::move(from); + } + + inline Fetch& operator=(Fetch&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Fetch& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Fetch* internal_default_instance() { + return reinterpret_cast( + &_Fetch_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(Fetch* other); + void Swap(Fetch* other); + friend void swap(Fetch& a, Fetch& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Fetch* New() const final { + return CreateMaybeMessage(NULL); + } + + Fetch* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Fetch& from); + void MergeFrom(const Fetch& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Fetch* other); + protected: + explicit Fetch(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 2; + void clear_name(); + static const int kNameFieldNumber = 2; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // .diplomacy.tensorflow.tf2xla.TensorId id = 1; + bool has_id() const; + void clear_id(); + static const int kIdFieldNumber = 1; + private: + const ::diplomacy::tensorflow::tf2xla::TensorId& _internal_id() const; + public: + const ::diplomacy::tensorflow::tf2xla::TensorId& id() const; + ::diplomacy::tensorflow::tf2xla::TensorId* release_id(); + ::diplomacy::tensorflow::tf2xla::TensorId* mutable_id(); + void set_allocated_id(::diplomacy::tensorflow::tf2xla::TensorId* id); + void unsafe_arena_set_allocated_id( + ::diplomacy::tensorflow::tf2xla::TensorId* id); + ::diplomacy::tensorflow::tf2xla::TensorId* unsafe_arena_release_id(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.Fetch) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::diplomacy::tensorflow::tf2xla::TensorId* id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Config : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tf2xla.Config) */ { + public: + Config(); + virtual ~Config(); + + Config(const Config& from); + + inline Config& operator=(const Config& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Config(Config&& from) noexcept + : Config() { + *this = ::std::move(from); + } + + inline Config& operator=(Config&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Config& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Config* internal_default_instance() { + return reinterpret_cast( + &_Config_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(Config* other); + void Swap(Config* other); + friend void swap(Config& a, Config& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Config* New() const final { + return CreateMaybeMessage(NULL); + } + + Config* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Config& from); + void MergeFrom(const Config& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Config* other); + protected: + explicit Config(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tf2xla.Feed feed = 1; + int feed_size() const; + void clear_feed(); + static const int kFeedFieldNumber = 1; + ::diplomacy::tensorflow::tf2xla::Feed* mutable_feed(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Feed >* + mutable_feed(); + const ::diplomacy::tensorflow::tf2xla::Feed& feed(int index) const; + ::diplomacy::tensorflow::tf2xla::Feed* add_feed(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Feed >& + feed() const; + + // repeated .diplomacy.tensorflow.tf2xla.Fetch fetch = 2; + int fetch_size() const; + void clear_fetch(); + static const int kFetchFieldNumber = 2; + ::diplomacy::tensorflow::tf2xla::Fetch* mutable_fetch(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Fetch >* + mutable_fetch(); + const ::diplomacy::tensorflow::tf2xla::Fetch& fetch(int index) const; + ::diplomacy::tensorflow::tf2xla::Fetch* add_fetch(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Fetch >& + fetch() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.Config) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Feed > feed_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Fetch > fetch_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TensorId + +// string node_name = 1; +inline void TensorId::clear_node_name() { + node_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& TensorId::node_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.TensorId.node_name) + return node_name_.Get(); +} +inline void TensorId::set_node_name(const ::std::string& value) { + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tf2xla.TensorId.node_name) +} +#if LANG_CXX11 +inline void TensorId::set_node_name(::std::string&& value) { + + node_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tf2xla.TensorId.node_name) +} +#endif +inline void TensorId::set_node_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tf2xla.TensorId.node_name) +} +inline void TensorId::set_node_name(const char* value, + size_t size) { + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tf2xla.TensorId.node_name) +} +inline ::std::string* TensorId::mutable_node_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.TensorId.node_name) + return node_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* TensorId::release_node_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.TensorId.node_name) + + return node_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void TensorId::set_allocated_node_name(::std::string* node_name) { + if (node_name != NULL) { + + } else { + + } + node_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), node_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.TensorId.node_name) +} +inline ::std::string* TensorId::unsafe_arena_release_node_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.TensorId.node_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return node_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void TensorId::unsafe_arena_set_allocated_node_name( + ::std::string* node_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (node_name != NULL) { + + } else { + + } + node_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + node_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.TensorId.node_name) +} + +// int64 output_index = 2; +inline void TensorId::clear_output_index() { + output_index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 TensorId::output_index() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.TensorId.output_index) + return output_index_; +} +inline void TensorId::set_output_index(::google::protobuf::int64 value) { + + output_index_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tf2xla.TensorId.output_index) +} + +// ------------------------------------------------------------------- + +// Feed + +// .diplomacy.tensorflow.tf2xla.TensorId id = 1; +inline bool Feed::has_id() const { + return this != internal_default_instance() && id_ != NULL; +} +inline void Feed::clear_id() { + if (GetArenaNoVirtual() == NULL && id_ != NULL) { + delete id_; + } + id_ = NULL; +} +inline const ::diplomacy::tensorflow::tf2xla::TensorId& Feed::_internal_id() const { + return *id_; +} +inline const ::diplomacy::tensorflow::tf2xla::TensorId& Feed::id() const { + const ::diplomacy::tensorflow::tf2xla::TensorId* p = id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Feed.id) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tf2xla::_TensorId_default_instance_); +} +inline ::diplomacy::tensorflow::tf2xla::TensorId* Feed::release_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.Feed.id) + + ::diplomacy::tensorflow::tf2xla::TensorId* temp = id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + id_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tf2xla::TensorId* Feed::unsafe_arena_release_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.Feed.id) + + ::diplomacy::tensorflow::tf2xla::TensorId* temp = id_; + id_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tf2xla::TensorId* Feed::mutable_id() { + + if (id_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::TensorId>(GetArenaNoVirtual()); + id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.Feed.id) + return id_; +} +inline void Feed::set_allocated_id(::diplomacy::tensorflow::tf2xla::TensorId* id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete id_; + } + if (id) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(id); + if (message_arena != submessage_arena) { + id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, id, submessage_arena); + } + + } else { + + } + id_ = id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.Feed.id) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 2; +inline bool Feed::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& Feed::_internal_shape() const { + return *shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& Feed::shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Feed.shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* Feed::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.Feed.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* Feed::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.Feed.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* Feed::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.Feed.shape) + return shape_; +} +inline void Feed::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.Feed.shape) +} + +// string name = 3; +inline void Feed::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Feed::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Feed.name) + return name_.Get(); +} +inline void Feed::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tf2xla.Feed.name) +} +#if LANG_CXX11 +inline void Feed::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tf2xla.Feed.name) +} +#endif +inline void Feed::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tf2xla.Feed.name) +} +inline void Feed::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tf2xla.Feed.name) +} +inline ::std::string* Feed::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.Feed.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Feed::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.Feed.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Feed::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.Feed.name) +} +inline ::std::string* Feed::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.Feed.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Feed::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.Feed.name) +} + +// .diplomacy.tensorflow.DataType type = 4; +inline void Feed::clear_type() { + type_ = 0; +} +inline ::diplomacy::tensorflow::DataType Feed::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Feed.type) + return static_cast< ::diplomacy::tensorflow::DataType >(type_); +} +inline void Feed::set_type(::diplomacy::tensorflow::DataType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tf2xla.Feed.type) +} + +// ------------------------------------------------------------------- + +// Fetch + +// .diplomacy.tensorflow.tf2xla.TensorId id = 1; +inline bool Fetch::has_id() const { + return this != internal_default_instance() && id_ != NULL; +} +inline void Fetch::clear_id() { + if (GetArenaNoVirtual() == NULL && id_ != NULL) { + delete id_; + } + id_ = NULL; +} +inline const ::diplomacy::tensorflow::tf2xla::TensorId& Fetch::_internal_id() const { + return *id_; +} +inline const ::diplomacy::tensorflow::tf2xla::TensorId& Fetch::id() const { + const ::diplomacy::tensorflow::tf2xla::TensorId* p = id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Fetch.id) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tf2xla::_TensorId_default_instance_); +} +inline ::diplomacy::tensorflow::tf2xla::TensorId* Fetch::release_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.Fetch.id) + + ::diplomacy::tensorflow::tf2xla::TensorId* temp = id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + id_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tf2xla::TensorId* Fetch::unsafe_arena_release_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.Fetch.id) + + ::diplomacy::tensorflow::tf2xla::TensorId* temp = id_; + id_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tf2xla::TensorId* Fetch::mutable_id() { + + if (id_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::TensorId>(GetArenaNoVirtual()); + id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.Fetch.id) + return id_; +} +inline void Fetch::set_allocated_id(::diplomacy::tensorflow::tf2xla::TensorId* id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete id_; + } + if (id) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(id); + if (message_arena != submessage_arena) { + id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, id, submessage_arena); + } + + } else { + + } + id_ = id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.Fetch.id) +} + +// string name = 2; +inline void Fetch::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Fetch::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Fetch.name) + return name_.Get(); +} +inline void Fetch::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tf2xla.Fetch.name) +} +#if LANG_CXX11 +inline void Fetch::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tf2xla.Fetch.name) +} +#endif +inline void Fetch::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tf2xla.Fetch.name) +} +inline void Fetch::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tf2xla.Fetch.name) +} +inline ::std::string* Fetch::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.Fetch.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Fetch::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tf2xla.Fetch.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Fetch::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tf2xla.Fetch.name) +} +inline ::std::string* Fetch::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tf2xla.Fetch.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Fetch::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tf2xla.Fetch.name) +} + +// ------------------------------------------------------------------- + +// Config + +// repeated .diplomacy.tensorflow.tf2xla.Feed feed = 1; +inline int Config::feed_size() const { + return feed_.size(); +} +inline void Config::clear_feed() { + feed_.Clear(); +} +inline ::diplomacy::tensorflow::tf2xla::Feed* Config::mutable_feed(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.Config.feed) + return feed_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Feed >* +Config::mutable_feed() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tf2xla.Config.feed) + return &feed_; +} +inline const ::diplomacy::tensorflow::tf2xla::Feed& Config::feed(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Config.feed) + return feed_.Get(index); +} +inline ::diplomacy::tensorflow::tf2xla::Feed* Config::add_feed() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tf2xla.Config.feed) + return feed_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Feed >& +Config::feed() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tf2xla.Config.feed) + return feed_; +} + +// repeated .diplomacy.tensorflow.tf2xla.Fetch fetch = 2; +inline int Config::fetch_size() const { + return fetch_.size(); +} +inline void Config::clear_fetch() { + fetch_.Clear(); +} +inline ::diplomacy::tensorflow::tf2xla::Fetch* Config::mutable_fetch(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tf2xla.Config.fetch) + return fetch_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Fetch >* +Config::mutable_fetch() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tf2xla.Config.fetch) + return &fetch_; +} +inline const ::diplomacy::tensorflow::tf2xla::Fetch& Config::fetch(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tf2xla.Config.fetch) + return fetch_.Get(index); +} +inline ::diplomacy::tensorflow::tf2xla::Fetch* Config::add_fetch() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tf2xla.Config.fetch) + return fetch_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tf2xla::Fetch >& +Config::fetch() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tf2xla.Config.fetch) + return fetch_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tf2xla +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2ftf2xla_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto new file mode 100644 index 0000000..b0c028a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tf2xla; +option cc_enable_arenas = true; +option java_outer_classname = "Tf2XlaProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.tf2xla"; + +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +// TensorId identifies a tensor in a TensorFlow graph, by specifying the output +// index of a particular node in the graph. If the output of the named node +// feeds into other node(s), this corresponds to one or more edges. Otherwise +// it doesn't correspond to any existing edges at all, e.g. for output nodes. +message TensorId { + string node_name = 1; + int64 output_index = 2; +}; + +// Feed represents a single feed tensor in the graph, which corresponds to an +// input argument for the generated computation. +message Feed { + TensorId id = 1; + TensorShapeProto shape = 2; + string name = 3; // Optional name for generated code. + + // Optional data type. This is not normally required, as the graph itself + // contains this information. However, if the node being fed is an op that is + // not linked into the binary, then the type cannot be inferred from the node; + // in this case, the type should be set here. + DataType type = 4; +}; + +// Fetch represents a single fetch tensor in the graph, which corresponds to an +// output argument for the generated computation. +message Fetch { + TensorId id = 1; + string name = 2; // Optional name for generated code. +}; + +// Config represents configuration information for tf2xla conversion. +message Config { + // Each feed is a positional input argument for the generated computation. + // The order of each entry matches the order of each input argument. + repeated Feed feed = 1; + // Each fetch is a positional output argument for the generated computation. + // The order of each entry matches the order of each output argument. + repeated Fetch fetch = 2; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla_pb2.py new file mode 100644 index 0000000..7002c66 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/tf2xla/tf2xla_pb2.py @@ -0,0 +1,238 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto', + package='diplomacy.tensorflow.tf2xla', + syntax='proto3', + serialized_options=_b('\n\025org.tensorflow.tf2xlaB\014Tf2XlaProtosP\001\370\001\001'), + serialized_pb=_b('\n1diplomacy_tensorflow/compiler/tf2xla/tf2xla.proto\x12\x1b\x64iplomacy.tensorflow.tf2xla\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"3\n\x08TensorId\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x14\n\x0coutput_index\x18\x02 \x01(\x03\"\xac\x01\n\x04\x46\x65\x65\x64\x12\x31\n\x02id\x18\x01 \x01(\x0b\x32%.diplomacy.tensorflow.tf2xla.TensorId\x12\x35\n\x05shape\x18\x02 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProto\x12\x0c\n\x04name\x18\x03 \x01(\t\x12,\n\x04type\x18\x04 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\"H\n\x05\x46\x65tch\x12\x31\n\x02id\x18\x01 \x01(\x0b\x32%.diplomacy.tensorflow.tf2xla.TensorId\x12\x0c\n\x04name\x18\x02 \x01(\t\"l\n\x06\x43onfig\x12/\n\x04\x66\x65\x65\x64\x18\x01 \x03(\x0b\x32!.diplomacy.tensorflow.tf2xla.Feed\x12\x31\n\x05\x66\x65tch\x18\x02 \x03(\x0b\x32\".diplomacy.tensorflow.tf2xla.FetchB*\n\x15org.tensorflow.tf2xlaB\x0cTf2XlaProtosP\x01\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + + +_TENSORID = _descriptor.Descriptor( + name='TensorId', + full_name='diplomacy.tensorflow.tf2xla.TensorId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_name', full_name='diplomacy.tensorflow.tf2xla.TensorId.node_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_index', full_name='diplomacy.tensorflow.tf2xla.TensorId.output_index', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=187, + serialized_end=238, +) + + +_FEED = _descriptor.Descriptor( + name='Feed', + full_name='diplomacy.tensorflow.tf2xla.Feed', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='diplomacy.tensorflow.tf2xla.Feed.id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.tf2xla.Feed.shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.tf2xla.Feed.name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.tf2xla.Feed.type', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=241, + serialized_end=413, +) + + +_FETCH = _descriptor.Descriptor( + name='Fetch', + full_name='diplomacy.tensorflow.tf2xla.Fetch', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='diplomacy.tensorflow.tf2xla.Fetch.id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.tf2xla.Fetch.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=415, + serialized_end=487, +) + + +_CONFIG = _descriptor.Descriptor( + name='Config', + full_name='diplomacy.tensorflow.tf2xla.Config', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feed', full_name='diplomacy.tensorflow.tf2xla.Config.feed', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fetch', full_name='diplomacy.tensorflow.tf2xla.Config.fetch', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=489, + serialized_end=597, +) + +_FEED.fields_by_name['id'].message_type = _TENSORID +_FEED.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_FEED.fields_by_name['type'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_FETCH.fields_by_name['id'].message_type = _TENSORID +_CONFIG.fields_by_name['feed'].message_type = _FEED +_CONFIG.fields_by_name['fetch'].message_type = _FETCH +DESCRIPTOR.message_types_by_name['TensorId'] = _TENSORID +DESCRIPTOR.message_types_by_name['Feed'] = _FEED +DESCRIPTOR.message_types_by_name['Fetch'] = _FETCH +DESCRIPTOR.message_types_by_name['Config'] = _CONFIG +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TensorId = _reflection.GeneratedProtocolMessageType('TensorId', (_message.Message,), dict( + DESCRIPTOR = _TENSORID, + __module__ = 'diplomacy_tensorflow.compiler.tf2xla.tf2xla_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.TensorId) + )) +_sym_db.RegisterMessage(TensorId) + +Feed = _reflection.GeneratedProtocolMessageType('Feed', (_message.Message,), dict( + DESCRIPTOR = _FEED, + __module__ = 'diplomacy_tensorflow.compiler.tf2xla.tf2xla_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.Feed) + )) +_sym_db.RegisterMessage(Feed) + +Fetch = _reflection.GeneratedProtocolMessageType('Fetch', (_message.Message,), dict( + DESCRIPTOR = _FETCH, + __module__ = 'diplomacy_tensorflow.compiler.tf2xla.tf2xla_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.Fetch) + )) +_sym_db.RegisterMessage(Fetch) + +Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), dict( + DESCRIPTOR = _CONFIG, + __module__ = 'diplomacy_tensorflow.compiler.tf2xla.tf2xla_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tf2xla.Config) + )) +_sym_db.RegisterMessage(Config) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.pb.cc new file mode 100644 index 0000000..790f8a9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.pb.cc @@ -0,0 +1,118 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto + +#include "diplomacy_tensorflow/compiler/xla/rpc/xla_service.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace xla { +} // namespace xla +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto { +void InitDefaults() { +} + +const ::google::protobuf::uint32 TableStruct::offsets[1] = {}; +static const ::google::protobuf::internal::MigrationSchema* schemas = NULL; +static const ::google::protobuf::Message* const* file_default_instances = NULL; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto", schemas, file_default_instances, TableStruct::offsets, + NULL, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n7diplomacy_tensorflow/compiler/xla/rpc/" + "xla_service.proto\022\003xla\032+diplomacy_tensor" + "flow/compiler/xla/xla.proto2\352\n\n\nXlaServi" + "ce\022\?\n\nUnregister\022\026.xla.UnregisterRequest" + "\032\027.xla.UnregisterResponse\"\000\022Q\n\020Deconstru" + "ctTuple\022\034.xla.DeconstructTupleRequest\032\035." + "xla.DeconstructTupleResponse\"\000\0223\n\006Unpack" + "\022\022.xla.UnpackRequest\032\023.xla.UnpackRespons" + "e\"\000\0229\n\010GetShape\022\024.xla.GetShapeRequest\032\025." + "xla.GetShapeResponse\"\000\022^\n\030GetComputation" + "GraphStats\022!.xla.ComputationGraphStatsRe" + "quest\032\035.xla.ComputationStatsResponse\"\000\0229" + "\n\010LoadData\022\024.xla.LoadDataRequest\032\025.xla.L" + "oadDataResponse\"\000\022Q\n\020TransferToClient\022\034." + "xla.TransferToClientRequest\032\035.xla.Transf" + "erToClientResponse\"\000\022Q\n\020TransferToServer" + "\022\034.xla.TransferToServerRequest\032\035.xla.Tra" + "nsferToServerResponse\"\000\022Q\n\020TransferToInf" + "eed\022\034.xla.TransferToInfeedRequest\032\035.xla." + "TransferToInfeedResponse\"\000\022Z\n\023TransferFr" + "omOutfeed\022\037.xla.TransferFromOutfeedReque" + "st\032 .xla.TransferFromOutfeedResponse\"\000\022B" + "\n\013ResetDevice\022\027.xla.ResetDeviceRequest\032\030" + ".xla.ResetDeviceResponse\"\000\022X\n\024ComputeCon" + "stantGraph\022 .xla.ComputeConstantGraphReq" + "uest\032\034.xla.ComputeConstantResponse\"\000\022Q\n\020" + "GetDeviceHandles\022\034.xla.GetDeviceHandlesR" + "equest\032\035.xla.GetDeviceHandlesResponse\"\000\022" + "Z\n\023CreateChannelHandle\022\037.xla.CreateChann" + "elHandleRequest\032 .xla.CreateChannelHandl" + "eResponse\"\000\0226\n\007Compile\022\023.xla.CompileRequ" + "est\032\024.xla.CompileResponse\"\000\0226\n\007Execute\022\023" + ".xla.ExecuteRequest\032\024.xla.ExecuteRespons" + "e\"\000\022X\n\024ExecuteGraphParallel\022 .xla.Execut" + "eGraphParallelRequest\032\034.xla.ExecuteParal" + "lelResponse\"\000\022Q\n\020WaitForExecution\022\034.xla." + "WaitForExecutionRequest\032\035.xla.WaitForExe" + "cutionResponse\"\000b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1504); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto +namespace xla { + +// @@protoc_insertion_point(namespace_scope) +} // namespace xla +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.pb.h new file mode 100644 index 0000000..40aaa63 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.pb.h @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include "diplomacy_tensorflow/compiler/xla/xla.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto +namespace xla { +} // namespace xla +namespace xla { + +// =================================================================== + + +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace xla + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2frpc_2fxla_5fservice_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto new file mode 100644 index 0000000..6ad8b25 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto @@ -0,0 +1,151 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +// XLA service API. +// +// Users 1) build up computations and 2) create allocations via this API. +// Computations are composed of data flowing between arbitrarily-sized +// vector-oriented operations. +// +// Users build up computations using a ComputationHandle, and talk about +// allocations using GlobalDataHandles. +// +// There are currently no checkpointing capabilities or distribution/replication +// guarantees. The service runs on a single machine (e.g. one task) and that is +// its failure domain. +// +// Canonical example of "alpha * X + Y": +// * Make a computation. +// * Add alpha and X and Y as parameters. +// * Request the multiplication of alpha and X. +// * Request the addition of that result and Y. +// +// Then, pass the computation and appropriately shaped inputs to the XLA +// service's Execute method, which provides a result as a GlobalDataHandle. +// +// All data in XLA computations are conceptually immutable. +// +// Note: this API is subject to change / refinement over time -- use the +// provided client libraries to insulate code from changes to this service API. + +syntax = "proto3"; + +import "diplomacy_tensorflow/compiler/xla/xla.proto"; + +package xla; + +service XlaService { + ///////////////////////// + // Global data requests + + // Unregisters a global allocation. + // + // If the handle given is not currently allocated, a NOT_FOUND status is + // returned. + rpc Unregister(UnregisterRequest) returns (UnregisterResponse) { + } + + // Deconstructs a tuple. Returns a newly created GlobalDataHandle for each + // element in the tuple. + rpc DeconstructTuple(DeconstructTupleRequest) + returns (DeconstructTupleResponse) { + } + + // Unpack requests that a global data handle, with a tuple shape, has global + // data handles created for each of its constituent members. This is the + // equivalent of the "destructuring assignment" present in various programming + // languages. + rpc Unpack(UnpackRequest) returns (UnpackResponse) { + } + + // Requests the shape of the referenced global data. + rpc GetShape(GetShapeRequest) returns (GetShapeResponse) { + } + + // Requests the statistics of the given computation. + rpc GetComputationGraphStats(ComputationGraphStatsRequest) + returns (ComputationStatsResponse) { + } + + // Loads a variable number of values with a given element type from ColumnIO. + rpc LoadData(LoadDataRequest) returns (LoadDataResponse) { + } + + // Transfers the given global data to the client in the form of a Literal. + rpc TransferToClient(TransferToClientRequest) + returns (TransferToClientResponse) { + } + + // Transfers the given literal to the server to be stored in a global + // allocation, which is returned. + rpc TransferToServer(TransferToServerRequest) + returns (TransferToServerResponse) { + } + + // Transfers the given literal to the Infeed buffer of the device. + rpc TransferToInfeed(TransferToInfeedRequest) + returns (TransferToInfeedResponse) { + } + + // Transferred literal from the Outfeed buffer of the device. + rpc TransferFromOutfeed(TransferFromOutfeedRequest) + returns (TransferFromOutfeedResponse) { + } + + // Resets the device, clearing all existing state on the device. + rpc ResetDevice(ResetDeviceRequest) returns (ResetDeviceResponse) { + } + + // Computes the value of a constant expression. The request contains the + // computation graph for the constant expression. + rpc ComputeConstantGraph(ComputeConstantGraphRequest) + returns (ComputeConstantResponse) { + } + + // Requests one or more device handles from the target. The returned device + // handles can be used to specify the device on which to execute computations + // or transfer data. + rpc GetDeviceHandles(GetDeviceHandlesRequest) + returns (GetDeviceHandlesResponse) { + } + + // Creates a channel handle that can be used to transfer data between + // two computations via a pair of Send and Recv instructions. + rpc CreateChannelHandle(CreateChannelHandleRequest) + returns (CreateChannelHandleResponse) { + } + + // Compiles the provided computation into executable. Returns the handle of + // the executable. + rpc Compile(CompileRequest) returns (CompileResponse) {} + + // Invokes the provided executable with the provided global data passed as + // immutable arguments. The request contains the handle to the executable. + // Returns global data output and execution timing. + rpc Execute(ExecuteRequest) returns (ExecuteResponse) {} + + // Invokes the provided list of computations in parallel with the provided + // global data for each computation. Returns a list of global data output and + // execution timing. + rpc ExecuteGraphParallel(ExecuteGraphParallelRequest) + returns (ExecuteParallelResponse) { + } + + // Waits until the given execution (aysnchronously launched) is complete, and + // returns the global data output. + rpc WaitForExecution(WaitForExecutionRequest) + returns (WaitForExecutionResponse) { + } +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service_pb2.py new file mode 100644 index 0000000..9a36aee --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/rpc/xla_service_pb2.py @@ -0,0 +1,209 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.compiler.xla import xla_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto', + package='xla', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n7diplomacy_tensorflow/compiler/xla/rpc/xla_service.proto\x12\x03xla\x1a+diplomacy_tensorflow/compiler/xla/xla.proto2\xea\n\n\nXlaService\x12?\n\nUnregister\x12\x16.xla.UnregisterRequest\x1a\x17.xla.UnregisterResponse\"\x00\x12Q\n\x10\x44\x65\x63onstructTuple\x12\x1c.xla.DeconstructTupleRequest\x1a\x1d.xla.DeconstructTupleResponse\"\x00\x12\x33\n\x06Unpack\x12\x12.xla.UnpackRequest\x1a\x13.xla.UnpackResponse\"\x00\x12\x39\n\x08GetShape\x12\x14.xla.GetShapeRequest\x1a\x15.xla.GetShapeResponse\"\x00\x12^\n\x18GetComputationGraphStats\x12!.xla.ComputationGraphStatsRequest\x1a\x1d.xla.ComputationStatsResponse\"\x00\x12\x39\n\x08LoadData\x12\x14.xla.LoadDataRequest\x1a\x15.xla.LoadDataResponse\"\x00\x12Q\n\x10TransferToClient\x12\x1c.xla.TransferToClientRequest\x1a\x1d.xla.TransferToClientResponse\"\x00\x12Q\n\x10TransferToServer\x12\x1c.xla.TransferToServerRequest\x1a\x1d.xla.TransferToServerResponse\"\x00\x12Q\n\x10TransferToInfeed\x12\x1c.xla.TransferToInfeedRequest\x1a\x1d.xla.TransferToInfeedResponse\"\x00\x12Z\n\x13TransferFromOutfeed\x12\x1f.xla.TransferFromOutfeedRequest\x1a .xla.TransferFromOutfeedResponse\"\x00\x12\x42\n\x0bResetDevice\x12\x17.xla.ResetDeviceRequest\x1a\x18.xla.ResetDeviceResponse\"\x00\x12X\n\x14\x43omputeConstantGraph\x12 .xla.ComputeConstantGraphRequest\x1a\x1c.xla.ComputeConstantResponse\"\x00\x12Q\n\x10GetDeviceHandles\x12\x1c.xla.GetDeviceHandlesRequest\x1a\x1d.xla.GetDeviceHandlesResponse\"\x00\x12Z\n\x13\x43reateChannelHandle\x12\x1f.xla.CreateChannelHandleRequest\x1a .xla.CreateChannelHandleResponse\"\x00\x12\x36\n\x07\x43ompile\x12\x13.xla.CompileRequest\x1a\x14.xla.CompileResponse\"\x00\x12\x36\n\x07\x45xecute\x12\x13.xla.ExecuteRequest\x1a\x14.xla.ExecuteResponse\"\x00\x12X\n\x14\x45xecuteGraphParallel\x12 .xla.ExecuteGraphParallelRequest\x1a\x1c.xla.ExecuteParallelResponse\"\x00\x12Q\n\x10WaitForExecution\x12\x1c.xla.WaitForExecutionRequest\x1a\x1d.xla.WaitForExecutionResponse\"\x00\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2.DESCRIPTOR,]) + + + +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_XLASERVICE = _descriptor.ServiceDescriptor( + name='XlaService', + full_name='xla.XlaService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=110, + serialized_end=1496, + methods=[ + _descriptor.MethodDescriptor( + name='Unregister', + full_name='xla.XlaService.Unregister', + index=0, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._UNREGISTERREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._UNREGISTERRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='DeconstructTuple', + full_name='xla.XlaService.DeconstructTuple', + index=1, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._DECONSTRUCTTUPLEREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._DECONSTRUCTTUPLERESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='Unpack', + full_name='xla.XlaService.Unpack', + index=2, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._UNPACKREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._UNPACKRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='GetShape', + full_name='xla.XlaService.GetShape', + index=3, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._GETSHAPEREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._GETSHAPERESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='GetComputationGraphStats', + full_name='xla.XlaService.GetComputationGraphStats', + index=4, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._COMPUTATIONGRAPHSTATSREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._COMPUTATIONSTATSRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='LoadData', + full_name='xla.XlaService.LoadData', + index=5, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._LOADDATAREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._LOADDATARESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='TransferToClient', + full_name='xla.XlaService.TransferToClient', + index=6, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERTOCLIENTREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERTOCLIENTRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='TransferToServer', + full_name='xla.XlaService.TransferToServer', + index=7, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERTOSERVERREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERTOSERVERRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='TransferToInfeed', + full_name='xla.XlaService.TransferToInfeed', + index=8, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERTOINFEEDREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERTOINFEEDRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='TransferFromOutfeed', + full_name='xla.XlaService.TransferFromOutfeed', + index=9, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERFROMOUTFEEDREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._TRANSFERFROMOUTFEEDRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='ResetDevice', + full_name='xla.XlaService.ResetDevice', + index=10, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._RESETDEVICEREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._RESETDEVICERESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='ComputeConstantGraph', + full_name='xla.XlaService.ComputeConstantGraph', + index=11, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._COMPUTECONSTANTGRAPHREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._COMPUTECONSTANTRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='GetDeviceHandles', + full_name='xla.XlaService.GetDeviceHandles', + index=12, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._GETDEVICEHANDLESREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._GETDEVICEHANDLESRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='CreateChannelHandle', + full_name='xla.XlaService.CreateChannelHandle', + index=13, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._CREATECHANNELHANDLEREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._CREATECHANNELHANDLERESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='Compile', + full_name='xla.XlaService.Compile', + index=14, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._COMPILEREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._COMPILERESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='Execute', + full_name='xla.XlaService.Execute', + index=15, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._EXECUTEREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._EXECUTERESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='ExecuteGraphParallel', + full_name='xla.XlaService.ExecuteGraphParallel', + index=16, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._EXECUTEGRAPHPARALLELREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._EXECUTEPARALLELRESPONSE, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='WaitForExecution', + full_name='xla.XlaService.WaitForExecution', + index=17, + containing_service=None, + input_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._WAITFOREXECUTIONREQUEST, + output_type=diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._WAITFOREXECUTIONRESPONSE, + serialized_options=None, + ), +]) +_sym_db.RegisterServiceDescriptor(_XLASERVICE) + +DESCRIPTOR.services_by_name['XlaService'] = _XLASERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.pb.cc new file mode 100644 index 0000000..a86d52a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.pb.cc @@ -0,0 +1,498 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto + +#include "diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace xla { +namespace gpu { +class CudnnConvBackendConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CudnnConvBackendConfig_default_instance_; +} // namespace gpu +} // namespace xla +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto { +static void InitDefaultsCudnnConvBackendConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::gpu::_CudnnConvBackendConfig_default_instance_; + new (ptr) ::xla::gpu::CudnnConvBackendConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::gpu::CudnnConvBackendConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CudnnConvBackendConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCudnnConvBackendConfig}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_CudnnConvBackendConfig.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::gpu::CudnnConvBackendConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::gpu::CudnnConvBackendConfig, algorithm_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::gpu::CudnnConvBackendConfig, tensor_ops_enabled_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::gpu::CudnnConvBackendConfig, conv_result_scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::gpu::CudnnConvBackendConfig, activation_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::gpu::CudnnConvBackendConfig, side_input_scale_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::xla::gpu::CudnnConvBackendConfig)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::xla::gpu::_CudnnConvBackendConfig_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nCdiplomacy_tensorflow/compiler/xla/serv" + "ice/gpu/backend_configs.proto\022\007xla.gpu\"\225" + "\001\n\026CudnnConvBackendConfig\022\021\n\talgorithm\030\001" + " \001(\003\022\032\n\022tensor_ops_enabled\030\002 \001(\010\022\031\n\021conv" + "_result_scale\030\004 \001(\001\022\027\n\017activation_mode\030\003" + " \001(\003\022\030\n\020side_input_scale\030\005 \001(\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 238); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto +namespace xla { +namespace gpu { + +// =================================================================== + +void CudnnConvBackendConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CudnnConvBackendConfig::kAlgorithmFieldNumber; +const int CudnnConvBackendConfig::kTensorOpsEnabledFieldNumber; +const int CudnnConvBackendConfig::kConvResultScaleFieldNumber; +const int CudnnConvBackendConfig::kActivationModeFieldNumber; +const int CudnnConvBackendConfig::kSideInputScaleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CudnnConvBackendConfig::CudnnConvBackendConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto::scc_info_CudnnConvBackendConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.gpu.CudnnConvBackendConfig) +} +CudnnConvBackendConfig::CudnnConvBackendConfig(const CudnnConvBackendConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&algorithm_, &from.algorithm_, + static_cast(reinterpret_cast(&tensor_ops_enabled_) - + reinterpret_cast(&algorithm_)) + sizeof(tensor_ops_enabled_)); + // @@protoc_insertion_point(copy_constructor:xla.gpu.CudnnConvBackendConfig) +} + +void CudnnConvBackendConfig::SharedCtor() { + ::memset(&algorithm_, 0, static_cast( + reinterpret_cast(&tensor_ops_enabled_) - + reinterpret_cast(&algorithm_)) + sizeof(tensor_ops_enabled_)); +} + +CudnnConvBackendConfig::~CudnnConvBackendConfig() { + // @@protoc_insertion_point(destructor:xla.gpu.CudnnConvBackendConfig) + SharedDtor(); +} + +void CudnnConvBackendConfig::SharedDtor() { +} + +void CudnnConvBackendConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CudnnConvBackendConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CudnnConvBackendConfig& CudnnConvBackendConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto::scc_info_CudnnConvBackendConfig.base); + return *internal_default_instance(); +} + + +void CudnnConvBackendConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.gpu.CudnnConvBackendConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&algorithm_, 0, static_cast( + reinterpret_cast(&tensor_ops_enabled_) - + reinterpret_cast(&algorithm_)) + sizeof(tensor_ops_enabled_)); + _internal_metadata_.Clear(); +} + +bool CudnnConvBackendConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.gpu.CudnnConvBackendConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 algorithm = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &algorithm_))); + } else { + goto handle_unusual; + } + break; + } + + // bool tensor_ops_enabled = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &tensor_ops_enabled_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 activation_mode = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &activation_mode_))); + } else { + goto handle_unusual; + } + break; + } + + // double conv_result_scale = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(33u /* 33 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &conv_result_scale_))); + } else { + goto handle_unusual; + } + break; + } + + // double side_input_scale = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(41u /* 41 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &side_input_scale_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.gpu.CudnnConvBackendConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.gpu.CudnnConvBackendConfig) + return false; +#undef DO_ +} + +void CudnnConvBackendConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.gpu.CudnnConvBackendConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 algorithm = 1; + if (this->algorithm() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->algorithm(), output); + } + + // bool tensor_ops_enabled = 2; + if (this->tensor_ops_enabled() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->tensor_ops_enabled(), output); + } + + // int64 activation_mode = 3; + if (this->activation_mode() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->activation_mode(), output); + } + + // double conv_result_scale = 4; + if (this->conv_result_scale() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(4, this->conv_result_scale(), output); + } + + // double side_input_scale = 5; + if (this->side_input_scale() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(5, this->side_input_scale(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.gpu.CudnnConvBackendConfig) +} + +::google::protobuf::uint8* CudnnConvBackendConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.gpu.CudnnConvBackendConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 algorithm = 1; + if (this->algorithm() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->algorithm(), target); + } + + // bool tensor_ops_enabled = 2; + if (this->tensor_ops_enabled() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->tensor_ops_enabled(), target); + } + + // int64 activation_mode = 3; + if (this->activation_mode() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->activation_mode(), target); + } + + // double conv_result_scale = 4; + if (this->conv_result_scale() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(4, this->conv_result_scale(), target); + } + + // double side_input_scale = 5; + if (this->side_input_scale() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(5, this->side_input_scale(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.gpu.CudnnConvBackendConfig) + return target; +} + +size_t CudnnConvBackendConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.gpu.CudnnConvBackendConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 algorithm = 1; + if (this->algorithm() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->algorithm()); + } + + // int64 activation_mode = 3; + if (this->activation_mode() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->activation_mode()); + } + + // double conv_result_scale = 4; + if (this->conv_result_scale() != 0) { + total_size += 1 + 8; + } + + // double side_input_scale = 5; + if (this->side_input_scale() != 0) { + total_size += 1 + 8; + } + + // bool tensor_ops_enabled = 2; + if (this->tensor_ops_enabled() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CudnnConvBackendConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.gpu.CudnnConvBackendConfig) + GOOGLE_DCHECK_NE(&from, this); + const CudnnConvBackendConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.gpu.CudnnConvBackendConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.gpu.CudnnConvBackendConfig) + MergeFrom(*source); + } +} + +void CudnnConvBackendConfig::MergeFrom(const CudnnConvBackendConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.gpu.CudnnConvBackendConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.algorithm() != 0) { + set_algorithm(from.algorithm()); + } + if (from.activation_mode() != 0) { + set_activation_mode(from.activation_mode()); + } + if (from.conv_result_scale() != 0) { + set_conv_result_scale(from.conv_result_scale()); + } + if (from.side_input_scale() != 0) { + set_side_input_scale(from.side_input_scale()); + } + if (from.tensor_ops_enabled() != 0) { + set_tensor_ops_enabled(from.tensor_ops_enabled()); + } +} + +void CudnnConvBackendConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.gpu.CudnnConvBackendConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CudnnConvBackendConfig::CopyFrom(const CudnnConvBackendConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.gpu.CudnnConvBackendConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CudnnConvBackendConfig::IsInitialized() const { + return true; +} + +void CudnnConvBackendConfig::Swap(CudnnConvBackendConfig* other) { + if (other == this) return; + InternalSwap(other); +} +void CudnnConvBackendConfig::InternalSwap(CudnnConvBackendConfig* other) { + using std::swap; + swap(algorithm_, other->algorithm_); + swap(activation_mode_, other->activation_mode_); + swap(conv_result_scale_, other->conv_result_scale_); + swap(side_input_scale_, other->side_input_scale_); + swap(tensor_ops_enabled_, other->tensor_ops_enabled_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CudnnConvBackendConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace gpu +} // namespace xla +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::gpu::CudnnConvBackendConfig* Arena::CreateMaybeMessage< ::xla::gpu::CudnnConvBackendConfig >(Arena* arena) { + return Arena::CreateInternal< ::xla::gpu::CudnnConvBackendConfig >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.pb.h new file mode 100644 index 0000000..239f5af --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.pb.h @@ -0,0 +1,286 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto +namespace xla { +namespace gpu { +class CudnnConvBackendConfig; +class CudnnConvBackendConfigDefaultTypeInternal; +extern CudnnConvBackendConfigDefaultTypeInternal _CudnnConvBackendConfig_default_instance_; +} // namespace gpu +} // namespace xla +namespace google { +namespace protobuf { +template<> ::xla::gpu::CudnnConvBackendConfig* Arena::CreateMaybeMessage<::xla::gpu::CudnnConvBackendConfig>(Arena*); +} // namespace protobuf +} // namespace google +namespace xla { +namespace gpu { + +// =================================================================== + +class CudnnConvBackendConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.gpu.CudnnConvBackendConfig) */ { + public: + CudnnConvBackendConfig(); + virtual ~CudnnConvBackendConfig(); + + CudnnConvBackendConfig(const CudnnConvBackendConfig& from); + + inline CudnnConvBackendConfig& operator=(const CudnnConvBackendConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CudnnConvBackendConfig(CudnnConvBackendConfig&& from) noexcept + : CudnnConvBackendConfig() { + *this = ::std::move(from); + } + + inline CudnnConvBackendConfig& operator=(CudnnConvBackendConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const CudnnConvBackendConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CudnnConvBackendConfig* internal_default_instance() { + return reinterpret_cast( + &_CudnnConvBackendConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(CudnnConvBackendConfig* other); + friend void swap(CudnnConvBackendConfig& a, CudnnConvBackendConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CudnnConvBackendConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + CudnnConvBackendConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CudnnConvBackendConfig& from); + void MergeFrom(const CudnnConvBackendConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CudnnConvBackendConfig* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 algorithm = 1; + void clear_algorithm(); + static const int kAlgorithmFieldNumber = 1; + ::google::protobuf::int64 algorithm() const; + void set_algorithm(::google::protobuf::int64 value); + + // int64 activation_mode = 3; + void clear_activation_mode(); + static const int kActivationModeFieldNumber = 3; + ::google::protobuf::int64 activation_mode() const; + void set_activation_mode(::google::protobuf::int64 value); + + // double conv_result_scale = 4; + void clear_conv_result_scale(); + static const int kConvResultScaleFieldNumber = 4; + double conv_result_scale() const; + void set_conv_result_scale(double value); + + // double side_input_scale = 5; + void clear_side_input_scale(); + static const int kSideInputScaleFieldNumber = 5; + double side_input_scale() const; + void set_side_input_scale(double value); + + // bool tensor_ops_enabled = 2; + void clear_tensor_ops_enabled(); + static const int kTensorOpsEnabledFieldNumber = 2; + bool tensor_ops_enabled() const; + void set_tensor_ops_enabled(bool value); + + // @@protoc_insertion_point(class_scope:xla.gpu.CudnnConvBackendConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int64 algorithm_; + ::google::protobuf::int64 activation_mode_; + double conv_result_scale_; + double side_input_scale_; + bool tensor_ops_enabled_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// CudnnConvBackendConfig + +// int64 algorithm = 1; +inline void CudnnConvBackendConfig::clear_algorithm() { + algorithm_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CudnnConvBackendConfig::algorithm() const { + // @@protoc_insertion_point(field_get:xla.gpu.CudnnConvBackendConfig.algorithm) + return algorithm_; +} +inline void CudnnConvBackendConfig::set_algorithm(::google::protobuf::int64 value) { + + algorithm_ = value; + // @@protoc_insertion_point(field_set:xla.gpu.CudnnConvBackendConfig.algorithm) +} + +// bool tensor_ops_enabled = 2; +inline void CudnnConvBackendConfig::clear_tensor_ops_enabled() { + tensor_ops_enabled_ = false; +} +inline bool CudnnConvBackendConfig::tensor_ops_enabled() const { + // @@protoc_insertion_point(field_get:xla.gpu.CudnnConvBackendConfig.tensor_ops_enabled) + return tensor_ops_enabled_; +} +inline void CudnnConvBackendConfig::set_tensor_ops_enabled(bool value) { + + tensor_ops_enabled_ = value; + // @@protoc_insertion_point(field_set:xla.gpu.CudnnConvBackendConfig.tensor_ops_enabled) +} + +// double conv_result_scale = 4; +inline void CudnnConvBackendConfig::clear_conv_result_scale() { + conv_result_scale_ = 0; +} +inline double CudnnConvBackendConfig::conv_result_scale() const { + // @@protoc_insertion_point(field_get:xla.gpu.CudnnConvBackendConfig.conv_result_scale) + return conv_result_scale_; +} +inline void CudnnConvBackendConfig::set_conv_result_scale(double value) { + + conv_result_scale_ = value; + // @@protoc_insertion_point(field_set:xla.gpu.CudnnConvBackendConfig.conv_result_scale) +} + +// int64 activation_mode = 3; +inline void CudnnConvBackendConfig::clear_activation_mode() { + activation_mode_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CudnnConvBackendConfig::activation_mode() const { + // @@protoc_insertion_point(field_get:xla.gpu.CudnnConvBackendConfig.activation_mode) + return activation_mode_; +} +inline void CudnnConvBackendConfig::set_activation_mode(::google::protobuf::int64 value) { + + activation_mode_ = value; + // @@protoc_insertion_point(field_set:xla.gpu.CudnnConvBackendConfig.activation_mode) +} + +// double side_input_scale = 5; +inline void CudnnConvBackendConfig::clear_side_input_scale() { + side_input_scale_ = 0; +} +inline double CudnnConvBackendConfig::side_input_scale() const { + // @@protoc_insertion_point(field_get:xla.gpu.CudnnConvBackendConfig.side_input_scale) + return side_input_scale_; +} +inline void CudnnConvBackendConfig::set_side_input_scale(double value) { + + side_input_scale_ = value; + // @@protoc_insertion_point(field_set:xla.gpu.CudnnConvBackendConfig.side_input_scale) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace gpu +} // namespace xla + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fgpu_2fbackend_5fconfigs_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto new file mode 100644 index 0000000..78e14d8 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package xla.gpu; + +// Backend configs for XLA:GPU. +// +// These are metadata that the GPU backend attaches to HloInstrucitons and later +// uses during e.g. codegen. +// +// Remember that proto3 doesn't give clients a way to tell the difference +// between a field not being present and a field having the default value. +// Choose your defaults carefully. +// +// No guarantee is made about the stability of these protos. +// +// See HloInstruction::backend_config() for more info. + +// Backend config for a convolution that runs through cudnn. +message CudnnConvBackendConfig { + // Opaque algorithm number of cudnn algorithm chosen for this conv. + int64 algorithm = 1; + + // Whether we may use tensor cores when running this conv. Even if this is + // true, cudnn may choose not to use tensor cores, e.g. because the GPU or + // selected algorithm doesn't support it. + bool tensor_ops_enabled = 2; + + // The scaling factor multiplied with the convolution result. + double conv_result_scale = 4; + + // Below are the fields related to cuDNN's fused convolution. Refer to + // CudnnConvParams for their meanings. + + // The requested activation (e.g. relu) after the convolution. It is with type + // stream_executor::dnn::ActivationMode. + int64 activation_mode = 3; + + // The scaling factor multiplied with the side input. If no side input buffer + // is provided, this field must be 0. + double side_input_scale = 5; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs_pb2.py new file mode 100644 index 0000000..db48808 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs_pb2.py @@ -0,0 +1,97 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto', + package='xla.gpu', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nCdiplomacy_tensorflow/compiler/xla/service/gpu/backend_configs.proto\x12\x07xla.gpu\"\x95\x01\n\x16\x43udnnConvBackendConfig\x12\x11\n\talgorithm\x18\x01 \x01(\x03\x12\x1a\n\x12tensor_ops_enabled\x18\x02 \x01(\x08\x12\x19\n\x11\x63onv_result_scale\x18\x04 \x01(\x01\x12\x17\n\x0f\x61\x63tivation_mode\x18\x03 \x01(\x03\x12\x18\n\x10side_input_scale\x18\x05 \x01(\x01\x62\x06proto3') +) + + + + +_CUDNNCONVBACKENDCONFIG = _descriptor.Descriptor( + name='CudnnConvBackendConfig', + full_name='xla.gpu.CudnnConvBackendConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='algorithm', full_name='xla.gpu.CudnnConvBackendConfig.algorithm', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_ops_enabled', full_name='xla.gpu.CudnnConvBackendConfig.tensor_ops_enabled', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='conv_result_scale', full_name='xla.gpu.CudnnConvBackendConfig.conv_result_scale', index=2, + number=4, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='activation_mode', full_name='xla.gpu.CudnnConvBackendConfig.activation_mode', index=3, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='side_input_scale', full_name='xla.gpu.CudnnConvBackendConfig.side_input_scale', index=4, + number=5, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=230, +) + +DESCRIPTOR.message_types_by_name['CudnnConvBackendConfig'] = _CUDNNCONVBACKENDCONFIG +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +CudnnConvBackendConfig = _reflection.GeneratedProtocolMessageType('CudnnConvBackendConfig', (_message.Message,), dict( + DESCRIPTOR = _CUDNNCONVBACKENDCONFIG, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.gpu.backend_configs_pb2' + # @@protoc_insertion_point(class_scope:xla.gpu.CudnnConvBackendConfig) + )) +_sym_db.RegisterMessage(CudnnConvBackendConfig) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.pb.cc new file mode 100644 index 0000000..d73e6d8 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.pb.cc @@ -0,0 +1,11873 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/service/hlo.proto + +#include "diplomacy_tensorflow/compiler/xla/service/hlo.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_BufferAllocationProto_Assigned; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DynamicParameterBindingProto_Binding; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HeapSimulatorTrace_Event; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HloInputOutputAliasProto_AliasEntryProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HloInstructionProto_SliceDimensions; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HloScheduleProto_InstructionSequence; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_LogicalBufferProto_Location; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<14> scc_info_HloInstructionProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_BufferAllocationProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_BufferAssignmentProto_BufferAlias; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DynamicParameterBindingProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HeapSimulatorTrace; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HloInputOutputAliasProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HloScheduleProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HloScheduleProto_SequencesEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LogicalBufferProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_HloComputationProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_HloProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_BufferAssignmentProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<5> scc_info_HloModuleProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ConvolutionDimensionNumbers; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DotDimensionNumbers; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GatherDimensionNumbers; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_OpMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_PrecisionConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ReplicaGroup; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ScatterDimensionNumbers; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SourceTarget; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LiteralProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_OpSharding; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_PaddingConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ProgramShapeProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ShapeProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Window; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto +namespace xla { +class HloInstructionProto_SliceDimensionsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloInstructionProto_SliceDimensions_default_instance_; +class HloInstructionProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloInstructionProto_default_instance_; +class HloComputationProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloComputationProto_default_instance_; +class HloScheduleProto_InstructionSequenceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloScheduleProto_InstructionSequence_default_instance_; +class HloScheduleProto_SequencesEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloScheduleProto_SequencesEntry_DoNotUse_default_instance_; +class HloScheduleProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloScheduleProto_default_instance_; +class HloInputOutputAliasProto_AliasEntryProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloInputOutputAliasProto_AliasEntryProto_default_instance_; +class HloInputOutputAliasProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloInputOutputAliasProto_default_instance_; +class DynamicParameterBindingProto_BindingDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DynamicParameterBindingProto_Binding_default_instance_; +class DynamicParameterBindingProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DynamicParameterBindingProto_default_instance_; +class HloModuleProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloModuleProto_default_instance_; +class LogicalBufferProto_LocationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LogicalBufferProto_Location_default_instance_; +class LogicalBufferProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LogicalBufferProto_default_instance_; +class BufferAllocationProto_AssignedDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BufferAllocationProto_Assigned_default_instance_; +class BufferAllocationProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BufferAllocationProto_default_instance_; +class HeapSimulatorTrace_EventDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HeapSimulatorTrace_Event_default_instance_; +class HeapSimulatorTraceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HeapSimulatorTrace_default_instance_; +class HloModuleGroupProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloModuleGroupProto_default_instance_; +class BufferAssignmentProto_BufferAliasDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BufferAssignmentProto_BufferAlias_default_instance_; +class BufferAssignmentProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BufferAssignmentProto_default_instance_; +class HloProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloProto_default_instance_; +class HloSnapshotDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloSnapshot_default_instance_; +} // namespace xla +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto { +static void InitDefaultsHloInstructionProto_SliceDimensions() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloInstructionProto_SliceDimensions_default_instance_; + new (ptr) ::xla::HloInstructionProto_SliceDimensions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloInstructionProto_SliceDimensions::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HloInstructionProto_SliceDimensions = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHloInstructionProto_SliceDimensions}, {}}; + +static void InitDefaultsHloInstructionProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloInstructionProto_default_instance_; + new (ptr) ::xla::HloInstructionProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloInstructionProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<14> scc_info_HloInstructionProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 14, InitDefaultsHloInstructionProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpMetadata.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_Window.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ConvolutionDimensionNumbers.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto_SliceDimensions.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DotDimensionNumbers.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GatherDimensionNumbers.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpSharding.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ReplicaGroup.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ScatterDimensionNumbers.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PrecisionConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_SourceTarget.base,}}; + +static void InitDefaultsHloComputationProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloComputationProto_default_instance_; + new (ptr) ::xla::HloComputationProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloComputationProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_HloComputationProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsHloComputationProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ProgramShapeProto.base,}}; + +static void InitDefaultsHloScheduleProto_InstructionSequence() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloScheduleProto_InstructionSequence_default_instance_; + new (ptr) ::xla::HloScheduleProto_InstructionSequence(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloScheduleProto_InstructionSequence::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HloScheduleProto_InstructionSequence = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHloScheduleProto_InstructionSequence}, {}}; + +static void InitDefaultsHloScheduleProto_SequencesEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloScheduleProto_SequencesEntry_DoNotUse_default_instance_; + new (ptr) ::xla::HloScheduleProto_SequencesEntry_DoNotUse(); + } + ::xla::HloScheduleProto_SequencesEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HloScheduleProto_SequencesEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHloScheduleProto_SequencesEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto_InstructionSequence.base,}}; + +static void InitDefaultsHloScheduleProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloScheduleProto_default_instance_; + new (ptr) ::xla::HloScheduleProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloScheduleProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HloScheduleProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHloScheduleProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto_SequencesEntry_DoNotUse.base,}}; + +static void InitDefaultsHloInputOutputAliasProto_AliasEntryProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloInputOutputAliasProto_AliasEntryProto_default_instance_; + new (ptr) ::xla::HloInputOutputAliasProto_AliasEntryProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloInputOutputAliasProto_AliasEntryProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HloInputOutputAliasProto_AliasEntryProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHloInputOutputAliasProto_AliasEntryProto}, {}}; + +static void InitDefaultsHloInputOutputAliasProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloInputOutputAliasProto_default_instance_; + new (ptr) ::xla::HloInputOutputAliasProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloInputOutputAliasProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HloInputOutputAliasProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHloInputOutputAliasProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto_AliasEntryProto.base,}}; + +static void InitDefaultsDynamicParameterBindingProto_Binding() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DynamicParameterBindingProto_Binding_default_instance_; + new (ptr) ::xla::DynamicParameterBindingProto_Binding(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DynamicParameterBindingProto_Binding::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DynamicParameterBindingProto_Binding = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDynamicParameterBindingProto_Binding}, {}}; + +static void InitDefaultsDynamicParameterBindingProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DynamicParameterBindingProto_default_instance_; + new (ptr) ::xla::DynamicParameterBindingProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DynamicParameterBindingProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DynamicParameterBindingProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDynamicParameterBindingProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto_Binding.base,}}; + +static void InitDefaultsHloModuleProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloModuleProto_default_instance_; + new (ptr) ::xla::HloModuleProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloModuleProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<5> scc_info_HloModuleProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 5, InitDefaultsHloModuleProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloComputationProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ProgramShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto.base,}}; + +static void InitDefaultsLogicalBufferProto_Location() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_LogicalBufferProto_Location_default_instance_; + new (ptr) ::xla::LogicalBufferProto_Location(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::LogicalBufferProto_Location::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_LogicalBufferProto_Location = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLogicalBufferProto_Location}, {}}; + +static void InitDefaultsLogicalBufferProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_LogicalBufferProto_default_instance_; + new (ptr) ::xla::LogicalBufferProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::LogicalBufferProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_LogicalBufferProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsLogicalBufferProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto_Location.base,}}; + +static void InitDefaultsBufferAllocationProto_Assigned() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_BufferAllocationProto_Assigned_default_instance_; + new (ptr) ::xla::BufferAllocationProto_Assigned(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::BufferAllocationProto_Assigned::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_BufferAllocationProto_Assigned = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsBufferAllocationProto_Assigned}, {}}; + +static void InitDefaultsBufferAllocationProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_BufferAllocationProto_default_instance_; + new (ptr) ::xla::BufferAllocationProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::BufferAllocationProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_BufferAllocationProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsBufferAllocationProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto_Assigned.base,}}; + +static void InitDefaultsHeapSimulatorTrace_Event() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HeapSimulatorTrace_Event_default_instance_; + new (ptr) ::xla::HeapSimulatorTrace_Event(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HeapSimulatorTrace_Event::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HeapSimulatorTrace_Event = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHeapSimulatorTrace_Event}, {}}; + +static void InitDefaultsHeapSimulatorTrace() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HeapSimulatorTrace_default_instance_; + new (ptr) ::xla::HeapSimulatorTrace(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HeapSimulatorTrace::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HeapSimulatorTrace = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHeapSimulatorTrace}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace_Event.base,}}; + +static void InitDefaultsHloModuleGroupProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloModuleGroupProto_default_instance_; + new (ptr) ::xla::HloModuleGroupProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloModuleGroupProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HloModuleGroupProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHloModuleGroupProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base,}}; + +static void InitDefaultsBufferAssignmentProto_BufferAlias() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_BufferAssignmentProto_BufferAlias_default_instance_; + new (ptr) ::xla::BufferAssignmentProto_BufferAlias(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::BufferAssignmentProto_BufferAlias::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_BufferAssignmentProto_BufferAlias = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsBufferAssignmentProto_BufferAlias}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto_Location.base,}}; + +static void InitDefaultsBufferAssignmentProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_BufferAssignmentProto_default_instance_; + new (ptr) ::xla::BufferAssignmentProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::BufferAssignmentProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_BufferAssignmentProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsBufferAssignmentProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto_BufferAlias.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace.base,}}; + +static void InitDefaultsHloProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloProto_default_instance_; + new (ptr) ::xla::HloProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_HloProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsHloProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto.base,}}; + +static void InitDefaultsHloSnapshot() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloSnapshot_default_instance_; + new (ptr) ::xla::HloSnapshot(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloSnapshot::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_HloSnapshot = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsHloSnapshot}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_HloInstructionProto_SliceDimensions.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloInstructionProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloComputationProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloScheduleProto_InstructionSequence.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloScheduleProto_SequencesEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloScheduleProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloInputOutputAliasProto_AliasEntryProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloInputOutputAliasProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_DynamicParameterBindingProto_Binding.base); + ::google::protobuf::internal::InitSCC(&scc_info_DynamicParameterBindingProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloModuleProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_LogicalBufferProto_Location.base); + ::google::protobuf::internal::InitSCC(&scc_info_LogicalBufferProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_BufferAllocationProto_Assigned.base); + ::google::protobuf::internal::InitSCC(&scc_info_BufferAllocationProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HeapSimulatorTrace_Event.base); + ::google::protobuf::internal::InitSCC(&scc_info_HeapSimulatorTrace.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloModuleGroupProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_BufferAssignmentProto_BufferAlias.base); + ::google::protobuf::internal::InitSCC(&scc_info_BufferAssignmentProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloSnapshot.base); +} + +::google::protobuf::Metadata file_level_metadata[22]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto_SliceDimensions, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto_SliceDimensions, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto_SliceDimensions, limit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto_SliceDimensions, stride_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, opcode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, literal_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, parameter_number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, fusion_kind_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, tuple_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, window_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, convolution_dimension_numbers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, feature_group_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, slice_dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, exponent_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, mantissa_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, dynamic_slice_sizes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, padding_config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, outfeed_config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, distribution_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, epsilon_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, feature_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, channel_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, infeed_config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, custom_call_target_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, custom_call_opaque_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, outfeed_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, dot_dimension_numbers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, fft_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, fft_length_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, gather_dimension_numbers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, gather_slice_sizes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, channel_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, cost_estimate_ns_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, operand_ids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, control_predecessor_ids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, called_computation_ids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, sharding_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, backend_config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, replica_groups_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, all_reduce_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, cross_replica_sum_barrier_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, is_host_transfer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, scatter_dimension_numbers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, precision_config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, source_target_pairs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, domain_entry_sharding_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, domain_exit_sharding_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, constrain_layout_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInstructionProto, operand_shapes_with_layout_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloComputationProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloComputationProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloComputationProto, instructions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloComputationProto, program_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloComputationProto, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloComputationProto, root_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto_InstructionSequence, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto_InstructionSequence, instruction_ids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto_SequencesEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto_SequencesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto_SequencesEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto_SequencesEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloScheduleProto, sequences_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInputOutputAliasProto_AliasEntryProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInputOutputAliasProto_AliasEntryProto, output_shape_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInputOutputAliasProto_AliasEntryProto, parameter_number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInputOutputAliasProto_AliasEntryProto, parameter_shape_index_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInputOutputAliasProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloInputOutputAliasProto, entries_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto_Binding, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto_Binding, dynamic_param_num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto_Binding, dynamic_param_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto_Binding, target_param_num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto_Binding, target_param_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto_Binding, target_param_dim_num_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DynamicParameterBindingProto, entries_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, entry_computation_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, entry_computation_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, computations_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, host_program_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, schedule_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, input_output_alias_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleProto, dynamic_parameter_binding_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto_Location, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto_Location, computation_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto_Location, instruction_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto_Location, shape_index_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto, defined_at_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LogicalBufferProto, color_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto_Assigned, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto_Assigned, logical_buffer_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto_Assigned, offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto_Assigned, size_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, is_thread_local_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, is_tuple_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, is_entry_computation_parameter_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, is_constant_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, parameter_number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, parameter_shape_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, maybe_live_out_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, color_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAllocationProto, assigned_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace_Event, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace_Event, kind_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace_Event, buffer_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace_Event, computation_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace_Event, instruction_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace_Event, share_with_canonical_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace, events_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HeapSimulatorTrace, whole_module_simulation_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleGroupProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleGroupProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloModuleGroupProto, hlo_modules_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto_BufferAlias, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto_BufferAlias, source_buffer_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto_BufferAlias, location_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto, logical_buffers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto, buffer_aliases_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto, buffer_allocations_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::BufferAssignmentProto, heap_simulator_traces_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProto, hlo_module_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProto, buffer_assignment_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloSnapshot, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloSnapshot, hlo_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloSnapshot, arguments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloSnapshot, result_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloSnapshot, execution_platform_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::xla::HloInstructionProto_SliceDimensions)}, + { 8, -1, sizeof(::xla::HloInstructionProto)}, + { 63, -1, sizeof(::xla::HloComputationProto)}, + { 73, -1, sizeof(::xla::HloScheduleProto_InstructionSequence)}, + { 79, 86, sizeof(::xla::HloScheduleProto_SequencesEntry_DoNotUse)}, + { 88, -1, sizeof(::xla::HloScheduleProto)}, + { 94, -1, sizeof(::xla::HloInputOutputAliasProto_AliasEntryProto)}, + { 102, -1, sizeof(::xla::HloInputOutputAliasProto)}, + { 108, -1, sizeof(::xla::DynamicParameterBindingProto_Binding)}, + { 118, -1, sizeof(::xla::DynamicParameterBindingProto)}, + { 124, -1, sizeof(::xla::HloModuleProto)}, + { 138, -1, sizeof(::xla::LogicalBufferProto_Location)}, + { 146, -1, sizeof(::xla::LogicalBufferProto)}, + { 155, -1, sizeof(::xla::BufferAllocationProto_Assigned)}, + { 163, -1, sizeof(::xla::BufferAllocationProto)}, + { 179, -1, sizeof(::xla::HeapSimulatorTrace_Event)}, + { 189, -1, sizeof(::xla::HeapSimulatorTrace)}, + { 196, -1, sizeof(::xla::HloModuleGroupProto)}, + { 203, -1, sizeof(::xla::BufferAssignmentProto_BufferAlias)}, + { 210, -1, sizeof(::xla::BufferAssignmentProto)}, + { 219, -1, sizeof(::xla::HloProto)}, + { 226, -1, sizeof(::xla::HloSnapshot)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::xla::_HloInstructionProto_SliceDimensions_default_instance_), + reinterpret_cast(&::xla::_HloInstructionProto_default_instance_), + reinterpret_cast(&::xla::_HloComputationProto_default_instance_), + reinterpret_cast(&::xla::_HloScheduleProto_InstructionSequence_default_instance_), + reinterpret_cast(&::xla::_HloScheduleProto_SequencesEntry_DoNotUse_default_instance_), + reinterpret_cast(&::xla::_HloScheduleProto_default_instance_), + reinterpret_cast(&::xla::_HloInputOutputAliasProto_AliasEntryProto_default_instance_), + reinterpret_cast(&::xla::_HloInputOutputAliasProto_default_instance_), + reinterpret_cast(&::xla::_DynamicParameterBindingProto_Binding_default_instance_), + reinterpret_cast(&::xla::_DynamicParameterBindingProto_default_instance_), + reinterpret_cast(&::xla::_HloModuleProto_default_instance_), + reinterpret_cast(&::xla::_LogicalBufferProto_Location_default_instance_), + reinterpret_cast(&::xla::_LogicalBufferProto_default_instance_), + reinterpret_cast(&::xla::_BufferAllocationProto_Assigned_default_instance_), + reinterpret_cast(&::xla::_BufferAllocationProto_default_instance_), + reinterpret_cast(&::xla::_HeapSimulatorTrace_Event_default_instance_), + reinterpret_cast(&::xla::_HeapSimulatorTrace_default_instance_), + reinterpret_cast(&::xla::_HloModuleGroupProto_default_instance_), + reinterpret_cast(&::xla::_BufferAssignmentProto_BufferAlias_default_instance_), + reinterpret_cast(&::xla::_BufferAssignmentProto_default_instance_), + reinterpret_cast(&::xla::_HloProto_default_instance_), + reinterpret_cast(&::xla::_HloSnapshot_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/xla/service/hlo.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 22); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n3diplomacy_tensorflow/compiler/xla/serv" + "ice/hlo.proto\022\003xla\0320diplomacy_tensorflow" + "/compiler/xla/xla_data.proto\"\371\016\n\023HloInst" + "ructionProto\022\014\n\004name\030\001 \001(\t\022\016\n\006opcode\030\002 \001" + "(\t\022\036\n\005shape\030\003 \001(\0132\017.xla.ShapeProto\022!\n\010me" + "tadata\030\007 \001(\0132\017.xla.OpMetadata\022\"\n\007literal" + "\030\010 \001(\0132\021.xla.LiteralProto\022\030\n\020parameter_n" + "umber\030\t \001(\003\022\023\n\013fusion_kind\030\013 \001(\t\022\023\n\013tupl" + "e_index\030\r \001(\003\022\022\n\ndimensions\030\016 \003(\003\022\033\n\006win" + "dow\030\017 \001(\0132\013.xla.Window\022G\n\035convolution_di" + "mension_numbers\030\020 \001(\0132 .xla.ConvolutionD" + "imensionNumbers\022\033\n\023feature_group_count\0302" + " \001(\003\022B\n\020slice_dimensions\030\021 \003(\0132(.xla.Hlo" + "InstructionProto.SliceDimensions\022\025\n\rexpo" + "nent_bits\030\022 \001(\005\022\025\n\rmantissa_bits\030\023 \001(\005\022\033" + "\n\023dynamic_slice_sizes\030\024 \003(\003\022*\n\016padding_c" + "onfig\030\025 \001(\0132\022.xla.PaddingConfig\022\026\n\016outfe" + "ed_config\030\026 \001(\014\022-\n\014distribution\030\027 \001(\0162\027." + "xla.RandomDistribution\022\017\n\007epsilon\030\030 \001(\002\022" + "\025\n\rfeature_index\030\031 \001(\003\022\022\n\nchannel_id\030\032 \001" + "(\003\022\025\n\rinfeed_config\030\033 \001(\014\022\032\n\022custom_call" + "_target\030\034 \001(\t\022\032\n\022custom_call_opaque\0305 \001(" + "\t\022&\n\routfeed_shape\030\035 \001(\0132\017.xla.ShapeProt" + "o\0227\n\025dot_dimension_numbers\030\036 \001(\0132\030.xla.D" + "otDimensionNumbers\022\036\n\010fft_type\030\037 \001(\0162\014.x" + "la.FftType\022\022\n\nfft_length\030 \003(\003\022=\n\030gather" + "_dimension_numbers\030! \001(\0132\033.xla.GatherDim" + "ensionNumbers\022\032\n\022gather_slice_sizes\030\" \003(" + "\003\022\024\n\014channel_name\030) \001(\t\022\030\n\020cost_estimate" + "_ns\030* \001(\003\022\n\n\002id\030# \001(\003\022\023\n\013operand_ids\030$ \003" + "(\003\022\037\n\027control_predecessor_ids\030% \003(\003\022\036\n\026c" + "alled_computation_ids\030& \003(\003\022!\n\010sharding\030" + "( \001(\0132\017.xla.OpSharding\022\026\n\016backend_config" + "\030+ \001(\t\022)\n\016replica_groups\0301 \003(\0132\021.xla.Rep" + "licaGroup\022\025\n\rall_reduce_id\030- \001(\003\022!\n\031cros" + "s_replica_sum_barrier\030. \001(\t\022\030\n\020is_host_t" + "ransfer\030/ \001(\010\022\?\n\031scatter_dimension_numbe" + "rs\0300 \001(\0132\034.xla.ScatterDimensionNumbers\022." + "\n\020precision_config\0303 \001(\0132\024.xla.Precision" + "Config\022.\n\023source_target_pairs\0304 \003(\0132\021.xl" + "a.SourceTarget\022.\n\025domain_entry_sharding\030" + "6 \001(\0132\017.xla.OpSharding\022-\n\024domain_exit_sh" + "arding\0307 \001(\0132\017.xla.OpSharding\022\030\n\020constra" + "in_layout\0308 \001(\010\0223\n\032operand_shapes_with_l" + "ayout\0309 \003(\0132\017.xla.ShapeProto\032\?\n\017SliceDim" + "ensions\022\r\n\005start\030\001 \001(\003\022\r\n\005limit\030\002 \001(\003\022\016\n" + "\006stride\030\003 \001(\003J\004\010\n\020\013J\004\010\014\020\rJ\004\010\004\020\005J\004\010\005\020\006J\004\010" + "\006\020\007J\004\010,\020-R\016parameter_nameR\036fused_instruc" + "tions_computationR\roperand_namesR\031contro" + "l_predecessor_namesR\030called_computation_" + "namesR\021replica_group_ids\"\260\001\n\023HloComputat" + "ionProto\022\014\n\004name\030\001 \001(\t\022.\n\014instructions\030\002" + " \003(\0132\030.xla.HloInstructionProto\022-\n\rprogra" + "m_shape\030\004 \001(\0132\026.xla.ProgramShapeProto\022\n\n" + "\002id\030\005 \001(\003\022\017\n\007root_id\030\006 \001(\003J\004\010\003\020\004R\troot_n" + "ame\"\330\001\n\020HloScheduleProto\0227\n\tsequences\030\001 " + "\003(\0132$.xla.HloScheduleProto.SequencesEntr" + "y\032.\n\023InstructionSequence\022\027\n\017instruction_" + "ids\030\001 \003(\003\032[\n\016SequencesEntry\022\013\n\003key\030\001 \001(\003" + "\0228\n\005value\030\002 \001(\0132).xla.HloScheduleProto.I" + "nstructionSequence:\0028\001\"\302\001\n\030HloInputOutpu" + "tAliasProto\022>\n\007entries\030\001 \003(\0132-.xla.HloIn" + "putOutputAliasProto.AliasEntryProto\032f\n\017A" + "liasEntryProto\022\032\n\022output_shape_index\030\001 \003" + "(\003\022\030\n\020parameter_number\030\002 \001(\003\022\035\n\025paramete" + "r_shape_index\030\003 \003(\003\"\362\001\n\034DynamicParameter" + "BindingProto\022:\n\007entries\030\001 \003(\0132).xla.Dyna" + "micParameterBindingProto.Binding\032\225\001\n\007Bin" + "ding\022\031\n\021dynamic_param_num\030\001 \001(\003\022\033\n\023dynam" + "ic_param_index\030\002 \003(\003\022\030\n\020target_param_num" + "\030\003 \001(\003\022\032\n\022target_param_index\030\004 \003(\003\022\034\n\024ta" + "rget_param_dim_num\030\005 \001(\003\"\366\002\n\016HloModulePr" + "oto\022\014\n\004name\030\001 \001(\t\022\036\n\026entry_computation_n" + "ame\030\002 \001(\t\022\034\n\024entry_computation_id\030\006 \001(\003\022" + ".\n\014computations\030\003 \003(\0132\030.xla.HloComputati" + "onProto\0222\n\022host_program_shape\030\004 \001(\0132\026.xl" + "a.ProgramShapeProto\022\n\n\002id\030\005 \001(\003\022\'\n\010sched" + "ule\030\007 \001(\0132\025.xla.HloScheduleProto\0229\n\022inpu" + "t_output_alias\030\010 \001(\0132\035.xla.HloInputOutpu" + "tAliasProto\022D\n\031dynamic_parameter_binding" + "\030\t \001(\0132!.xla.DynamicParameterBindingProt" + "o\"\310\001\n\022LogicalBufferProto\022\n\n\002id\030\001 \001(\003\022\014\n\004" + "size\030\002 \001(\003\0224\n\ndefined_at\030\003 \001(\0132 .xla.Log" + "icalBufferProto.Location\022\r\n\005color\030\004 \001(\003\032" + "S\n\010Location\022\030\n\020computation_name\030\001 \001(\t\022\030\n" + "\020instruction_name\030\002 \001(\t\022\023\n\013shape_index\030\003" + " \003(\003\"\370\002\n\025BufferAllocationProto\022\r\n\005index\030" + "\001 \001(\003\022\014\n\004size\030\002 \001(\003\022\027\n\017is_thread_local\030\003" + " \001(\010\022\020\n\010is_tuple\030\013 \001(\010\022&\n\036is_entry_compu" + "tation_parameter\030\005 \001(\010\022\023\n\013is_constant\030\014 " + "\001(\010\022\030\n\020parameter_number\030\006 \001(\003\022\035\n\025paramet" + "er_shape_index\030\n \003(\003\022\026\n\016maybe_live_out\030\007" + " \001(\010\022\r\n\005color\030\010 \001(\003\0225\n\010assigned\030\t \003(\0132#." + "xla.BufferAllocationProto.Assigned\032C\n\010As" + "signed\022\031\n\021logical_buffer_id\030\001 \001(\003\022\016\n\006off" + "set\030\002 \001(\003\022\014\n\004size\030\003 \001(\003\"\265\002\n\022HeapSimulato" + "rTrace\022-\n\006events\030\001 \003(\0132\035.xla.HeapSimulat" + "orTrace.Event\022\037\n\027whole_module_simulation" + "\030\002 \001(\010\032\316\001\n\005Event\0220\n\004kind\030\001 \001(\0162\".xla.Hea" + "pSimulatorTrace.Event.Kind\022\021\n\tbuffer_id\030" + "\002 \001(\003\022\030\n\020computation_name\030\003 \001(\t\022\030\n\020instr" + "uction_name\030\004 \001(\t\022\037\n\027share_with_canonica" + "l_id\030\005 \001(\003\"+\n\004Kind\022\t\n\005ALLOC\020\000\022\010\n\004FREE\020\001\022" + "\016\n\nSHARE_WITH\020\002\"M\n\023HloModuleGroupProto\022\014" + "\n\004name\030\001 \001(\t\022(\n\013hlo_modules\030\002 \003(\0132\023.xla." + "HloModuleProto\"\326\002\n\025BufferAssignmentProto" + "\0220\n\017logical_buffers\030\001 \003(\0132\027.xla.LogicalB" + "ufferProto\022>\n\016buffer_aliases\030\002 \003(\0132&.xla" + ".BufferAssignmentProto.BufferAlias\0226\n\022bu" + "ffer_allocations\030\003 \003(\0132\032.xla.BufferAlloc" + "ationProto\0226\n\025heap_simulator_traces\030\004 \003(" + "\0132\027.xla.HeapSimulatorTrace\032[\n\013BufferAlia" + "s\022\030\n\020source_buffer_id\030\001 \001(\003\0222\n\010location\030" + "\002 \001(\0132 .xla.LogicalBufferProto.Location\"" + "~\n\010HloProto\022\'\n\nhlo_module\030\001 \001(\0132\023.xla.Hl" + "oModuleProto\0225\n\021buffer_assignment\030\003 \001(\0132" + "\032.xla.BufferAssignmentProtoJ\004\010\002\020\003R\014hlo_o" + "rdering\"\216\001\n\013HloSnapshot\022\032\n\003hlo\030\001 \001(\0132\r.x" + "la.HloProto\022$\n\targuments\030\002 \003(\0132\021.xla.Lit" + "eralProto\022!\n\006result\030\003 \001(\0132\021.xla.LiteralP" + "roto\022\032\n\022execution_platform\030\004 \001(\tB\003\370\001\001b\006p" + "roto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 4845); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/xla/service/hlo.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto +namespace xla { +const ::google::protobuf::EnumDescriptor* HeapSimulatorTrace_Event_Kind_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_enum_descriptors[0]; +} +bool HeapSimulatorTrace_Event_Kind_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event::ALLOC; +const HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event::FREE; +const HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event::SHARE_WITH; +const HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event::Kind_MIN; +const HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event::Kind_MAX; +const int HeapSimulatorTrace_Event::Kind_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void HloInstructionProto_SliceDimensions::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloInstructionProto_SliceDimensions::kStartFieldNumber; +const int HloInstructionProto_SliceDimensions::kLimitFieldNumber; +const int HloInstructionProto_SliceDimensions::kStrideFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloInstructionProto_SliceDimensions::HloInstructionProto_SliceDimensions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto_SliceDimensions.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloInstructionProto.SliceDimensions) +} +HloInstructionProto_SliceDimensions::HloInstructionProto_SliceDimensions(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto_SliceDimensions.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloInstructionProto.SliceDimensions) +} +HloInstructionProto_SliceDimensions::HloInstructionProto_SliceDimensions(const HloInstructionProto_SliceDimensions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&start_, &from.start_, + static_cast(reinterpret_cast(&stride_) - + reinterpret_cast(&start_)) + sizeof(stride_)); + // @@protoc_insertion_point(copy_constructor:xla.HloInstructionProto.SliceDimensions) +} + +void HloInstructionProto_SliceDimensions::SharedCtor() { + ::memset(&start_, 0, static_cast( + reinterpret_cast(&stride_) - + reinterpret_cast(&start_)) + sizeof(stride_)); +} + +HloInstructionProto_SliceDimensions::~HloInstructionProto_SliceDimensions() { + // @@protoc_insertion_point(destructor:xla.HloInstructionProto.SliceDimensions) + SharedDtor(); +} + +void HloInstructionProto_SliceDimensions::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HloInstructionProto_SliceDimensions::ArenaDtor(void* object) { + HloInstructionProto_SliceDimensions* _this = reinterpret_cast< HloInstructionProto_SliceDimensions* >(object); + (void)_this; +} +void HloInstructionProto_SliceDimensions::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloInstructionProto_SliceDimensions::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloInstructionProto_SliceDimensions::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloInstructionProto_SliceDimensions& HloInstructionProto_SliceDimensions::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto_SliceDimensions.base); + return *internal_default_instance(); +} + + +void HloInstructionProto_SliceDimensions::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloInstructionProto.SliceDimensions) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&start_, 0, static_cast( + reinterpret_cast(&stride_) - + reinterpret_cast(&start_)) + sizeof(stride_)); + _internal_metadata_.Clear(); +} + +bool HloInstructionProto_SliceDimensions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloInstructionProto.SliceDimensions) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 start = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &start_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 limit = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &limit_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 stride = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &stride_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloInstructionProto.SliceDimensions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloInstructionProto.SliceDimensions) + return false; +#undef DO_ +} + +void HloInstructionProto_SliceDimensions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloInstructionProto.SliceDimensions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 start = 1; + if (this->start() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->start(), output); + } + + // int64 limit = 2; + if (this->limit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->limit(), output); + } + + // int64 stride = 3; + if (this->stride() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->stride(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloInstructionProto.SliceDimensions) +} + +::google::protobuf::uint8* HloInstructionProto_SliceDimensions::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloInstructionProto.SliceDimensions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 start = 1; + if (this->start() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->start(), target); + } + + // int64 limit = 2; + if (this->limit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->limit(), target); + } + + // int64 stride = 3; + if (this->stride() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->stride(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloInstructionProto.SliceDimensions) + return target; +} + +size_t HloInstructionProto_SliceDimensions::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloInstructionProto.SliceDimensions) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 start = 1; + if (this->start() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->start()); + } + + // int64 limit = 2; + if (this->limit() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->limit()); + } + + // int64 stride = 3; + if (this->stride() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->stride()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloInstructionProto_SliceDimensions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloInstructionProto.SliceDimensions) + GOOGLE_DCHECK_NE(&from, this); + const HloInstructionProto_SliceDimensions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloInstructionProto.SliceDimensions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloInstructionProto.SliceDimensions) + MergeFrom(*source); + } +} + +void HloInstructionProto_SliceDimensions::MergeFrom(const HloInstructionProto_SliceDimensions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloInstructionProto.SliceDimensions) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.start() != 0) { + set_start(from.start()); + } + if (from.limit() != 0) { + set_limit(from.limit()); + } + if (from.stride() != 0) { + set_stride(from.stride()); + } +} + +void HloInstructionProto_SliceDimensions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloInstructionProto.SliceDimensions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloInstructionProto_SliceDimensions::CopyFrom(const HloInstructionProto_SliceDimensions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloInstructionProto.SliceDimensions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloInstructionProto_SliceDimensions::IsInitialized() const { + return true; +} + +void HloInstructionProto_SliceDimensions::Swap(HloInstructionProto_SliceDimensions* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloInstructionProto_SliceDimensions* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloInstructionProto_SliceDimensions::UnsafeArenaSwap(HloInstructionProto_SliceDimensions* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloInstructionProto_SliceDimensions::InternalSwap(HloInstructionProto_SliceDimensions* other) { + using std::swap; + swap(start_, other->start_); + swap(limit_, other->limit_); + swap(stride_, other->stride_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloInstructionProto_SliceDimensions::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloInstructionProto::InitAsDefaultInstance() { + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->shape_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->metadata_ = const_cast< ::xla::OpMetadata*>( + ::xla::OpMetadata::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->literal_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->window_ = const_cast< ::xla::Window*>( + ::xla::Window::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->convolution_dimension_numbers_ = const_cast< ::xla::ConvolutionDimensionNumbers*>( + ::xla::ConvolutionDimensionNumbers::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->padding_config_ = const_cast< ::xla::PaddingConfig*>( + ::xla::PaddingConfig::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->outfeed_shape_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->dot_dimension_numbers_ = const_cast< ::xla::DotDimensionNumbers*>( + ::xla::DotDimensionNumbers::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->gather_dimension_numbers_ = const_cast< ::xla::GatherDimensionNumbers*>( + ::xla::GatherDimensionNumbers::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->sharding_ = const_cast< ::xla::OpSharding*>( + ::xla::OpSharding::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->scatter_dimension_numbers_ = const_cast< ::xla::ScatterDimensionNumbers*>( + ::xla::ScatterDimensionNumbers::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->precision_config_ = const_cast< ::xla::PrecisionConfig*>( + ::xla::PrecisionConfig::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->domain_entry_sharding_ = const_cast< ::xla::OpSharding*>( + ::xla::OpSharding::internal_default_instance()); + ::xla::_HloInstructionProto_default_instance_._instance.get_mutable()->domain_exit_sharding_ = const_cast< ::xla::OpSharding*>( + ::xla::OpSharding::internal_default_instance()); +} +void HloInstructionProto::unsafe_arena_set_allocated_shape( + ::xla::ShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.shape) +} +void HloInstructionProto::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_metadata( + ::xla::OpMetadata* metadata) { + if (GetArenaNoVirtual() == NULL) { + delete metadata_; + } + metadata_ = metadata; + if (metadata) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.metadata) +} +void HloInstructionProto::clear_metadata() { + if (GetArenaNoVirtual() == NULL && metadata_ != NULL) { + delete metadata_; + } + metadata_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_literal( + ::xla::LiteralProto* literal) { + if (GetArenaNoVirtual() == NULL) { + delete literal_; + } + literal_ = literal; + if (literal) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.literal) +} +void HloInstructionProto::clear_literal() { + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_window( + ::xla::Window* window) { + if (GetArenaNoVirtual() == NULL) { + delete window_; + } + window_ = window; + if (window) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.window) +} +void HloInstructionProto::clear_window() { + if (GetArenaNoVirtual() == NULL && window_ != NULL) { + delete window_; + } + window_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_convolution_dimension_numbers( + ::xla::ConvolutionDimensionNumbers* convolution_dimension_numbers) { + if (GetArenaNoVirtual() == NULL) { + delete convolution_dimension_numbers_; + } + convolution_dimension_numbers_ = convolution_dimension_numbers; + if (convolution_dimension_numbers) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.convolution_dimension_numbers) +} +void HloInstructionProto::clear_convolution_dimension_numbers() { + if (GetArenaNoVirtual() == NULL && convolution_dimension_numbers_ != NULL) { + delete convolution_dimension_numbers_; + } + convolution_dimension_numbers_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_padding_config( + ::xla::PaddingConfig* padding_config) { + if (GetArenaNoVirtual() == NULL) { + delete padding_config_; + } + padding_config_ = padding_config; + if (padding_config) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.padding_config) +} +void HloInstructionProto::clear_padding_config() { + if (GetArenaNoVirtual() == NULL && padding_config_ != NULL) { + delete padding_config_; + } + padding_config_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_outfeed_shape( + ::xla::ShapeProto* outfeed_shape) { + if (GetArenaNoVirtual() == NULL) { + delete outfeed_shape_; + } + outfeed_shape_ = outfeed_shape; + if (outfeed_shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.outfeed_shape) +} +void HloInstructionProto::clear_outfeed_shape() { + if (GetArenaNoVirtual() == NULL && outfeed_shape_ != NULL) { + delete outfeed_shape_; + } + outfeed_shape_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_dot_dimension_numbers( + ::xla::DotDimensionNumbers* dot_dimension_numbers) { + if (GetArenaNoVirtual() == NULL) { + delete dot_dimension_numbers_; + } + dot_dimension_numbers_ = dot_dimension_numbers; + if (dot_dimension_numbers) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.dot_dimension_numbers) +} +void HloInstructionProto::clear_dot_dimension_numbers() { + if (GetArenaNoVirtual() == NULL && dot_dimension_numbers_ != NULL) { + delete dot_dimension_numbers_; + } + dot_dimension_numbers_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_gather_dimension_numbers( + ::xla::GatherDimensionNumbers* gather_dimension_numbers) { + if (GetArenaNoVirtual() == NULL) { + delete gather_dimension_numbers_; + } + gather_dimension_numbers_ = gather_dimension_numbers; + if (gather_dimension_numbers) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.gather_dimension_numbers) +} +void HloInstructionProto::clear_gather_dimension_numbers() { + if (GetArenaNoVirtual() == NULL && gather_dimension_numbers_ != NULL) { + delete gather_dimension_numbers_; + } + gather_dimension_numbers_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_sharding( + ::xla::OpSharding* sharding) { + if (GetArenaNoVirtual() == NULL) { + delete sharding_; + } + sharding_ = sharding; + if (sharding) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.sharding) +} +void HloInstructionProto::clear_sharding() { + if (GetArenaNoVirtual() == NULL && sharding_ != NULL) { + delete sharding_; + } + sharding_ = NULL; +} +void HloInstructionProto::clear_replica_groups() { + replica_groups_.Clear(); +} +void HloInstructionProto::unsafe_arena_set_allocated_scatter_dimension_numbers( + ::xla::ScatterDimensionNumbers* scatter_dimension_numbers) { + if (GetArenaNoVirtual() == NULL) { + delete scatter_dimension_numbers_; + } + scatter_dimension_numbers_ = scatter_dimension_numbers; + if (scatter_dimension_numbers) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.scatter_dimension_numbers) +} +void HloInstructionProto::clear_scatter_dimension_numbers() { + if (GetArenaNoVirtual() == NULL && scatter_dimension_numbers_ != NULL) { + delete scatter_dimension_numbers_; + } + scatter_dimension_numbers_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_precision_config( + ::xla::PrecisionConfig* precision_config) { + if (GetArenaNoVirtual() == NULL) { + delete precision_config_; + } + precision_config_ = precision_config; + if (precision_config) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.precision_config) +} +void HloInstructionProto::clear_precision_config() { + if (GetArenaNoVirtual() == NULL && precision_config_ != NULL) { + delete precision_config_; + } + precision_config_ = NULL; +} +void HloInstructionProto::clear_source_target_pairs() { + source_target_pairs_.Clear(); +} +void HloInstructionProto::unsafe_arena_set_allocated_domain_entry_sharding( + ::xla::OpSharding* domain_entry_sharding) { + if (GetArenaNoVirtual() == NULL) { + delete domain_entry_sharding_; + } + domain_entry_sharding_ = domain_entry_sharding; + if (domain_entry_sharding) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.domain_entry_sharding) +} +void HloInstructionProto::clear_domain_entry_sharding() { + if (GetArenaNoVirtual() == NULL && domain_entry_sharding_ != NULL) { + delete domain_entry_sharding_; + } + domain_entry_sharding_ = NULL; +} +void HloInstructionProto::unsafe_arena_set_allocated_domain_exit_sharding( + ::xla::OpSharding* domain_exit_sharding) { + if (GetArenaNoVirtual() == NULL) { + delete domain_exit_sharding_; + } + domain_exit_sharding_ = domain_exit_sharding; + if (domain_exit_sharding) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.domain_exit_sharding) +} +void HloInstructionProto::clear_domain_exit_sharding() { + if (GetArenaNoVirtual() == NULL && domain_exit_sharding_ != NULL) { + delete domain_exit_sharding_; + } + domain_exit_sharding_ = NULL; +} +void HloInstructionProto::clear_operand_shapes_with_layout() { + operand_shapes_with_layout_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloInstructionProto::kNameFieldNumber; +const int HloInstructionProto::kOpcodeFieldNumber; +const int HloInstructionProto::kShapeFieldNumber; +const int HloInstructionProto::kMetadataFieldNumber; +const int HloInstructionProto::kLiteralFieldNumber; +const int HloInstructionProto::kParameterNumberFieldNumber; +const int HloInstructionProto::kFusionKindFieldNumber; +const int HloInstructionProto::kTupleIndexFieldNumber; +const int HloInstructionProto::kDimensionsFieldNumber; +const int HloInstructionProto::kWindowFieldNumber; +const int HloInstructionProto::kConvolutionDimensionNumbersFieldNumber; +const int HloInstructionProto::kFeatureGroupCountFieldNumber; +const int HloInstructionProto::kSliceDimensionsFieldNumber; +const int HloInstructionProto::kExponentBitsFieldNumber; +const int HloInstructionProto::kMantissaBitsFieldNumber; +const int HloInstructionProto::kDynamicSliceSizesFieldNumber; +const int HloInstructionProto::kPaddingConfigFieldNumber; +const int HloInstructionProto::kOutfeedConfigFieldNumber; +const int HloInstructionProto::kDistributionFieldNumber; +const int HloInstructionProto::kEpsilonFieldNumber; +const int HloInstructionProto::kFeatureIndexFieldNumber; +const int HloInstructionProto::kChannelIdFieldNumber; +const int HloInstructionProto::kInfeedConfigFieldNumber; +const int HloInstructionProto::kCustomCallTargetFieldNumber; +const int HloInstructionProto::kCustomCallOpaqueFieldNumber; +const int HloInstructionProto::kOutfeedShapeFieldNumber; +const int HloInstructionProto::kDotDimensionNumbersFieldNumber; +const int HloInstructionProto::kFftTypeFieldNumber; +const int HloInstructionProto::kFftLengthFieldNumber; +const int HloInstructionProto::kGatherDimensionNumbersFieldNumber; +const int HloInstructionProto::kGatherSliceSizesFieldNumber; +const int HloInstructionProto::kChannelNameFieldNumber; +const int HloInstructionProto::kCostEstimateNsFieldNumber; +const int HloInstructionProto::kIdFieldNumber; +const int HloInstructionProto::kOperandIdsFieldNumber; +const int HloInstructionProto::kControlPredecessorIdsFieldNumber; +const int HloInstructionProto::kCalledComputationIdsFieldNumber; +const int HloInstructionProto::kShardingFieldNumber; +const int HloInstructionProto::kBackendConfigFieldNumber; +const int HloInstructionProto::kReplicaGroupsFieldNumber; +const int HloInstructionProto::kAllReduceIdFieldNumber; +const int HloInstructionProto::kCrossReplicaSumBarrierFieldNumber; +const int HloInstructionProto::kIsHostTransferFieldNumber; +const int HloInstructionProto::kScatterDimensionNumbersFieldNumber; +const int HloInstructionProto::kPrecisionConfigFieldNumber; +const int HloInstructionProto::kSourceTargetPairsFieldNumber; +const int HloInstructionProto::kDomainEntryShardingFieldNumber; +const int HloInstructionProto::kDomainExitShardingFieldNumber; +const int HloInstructionProto::kConstrainLayoutFieldNumber; +const int HloInstructionProto::kOperandShapesWithLayoutFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloInstructionProto::HloInstructionProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloInstructionProto) +} +HloInstructionProto::HloInstructionProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dimensions_(arena), + slice_dimensions_(arena), + dynamic_slice_sizes_(arena), + fft_length_(arena), + gather_slice_sizes_(arena), + operand_ids_(arena), + control_predecessor_ids_(arena), + called_computation_ids_(arena), + replica_groups_(arena), + source_target_pairs_(arena), + operand_shapes_with_layout_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloInstructionProto) +} +HloInstructionProto::HloInstructionProto(const HloInstructionProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dimensions_(from.dimensions_), + slice_dimensions_(from.slice_dimensions_), + dynamic_slice_sizes_(from.dynamic_slice_sizes_), + fft_length_(from.fft_length_), + gather_slice_sizes_(from.gather_slice_sizes_), + operand_ids_(from.operand_ids_), + control_predecessor_ids_(from.control_predecessor_ids_), + called_computation_ids_(from.called_computation_ids_), + replica_groups_(from.replica_groups_), + source_target_pairs_(from.source_target_pairs_), + operand_shapes_with_layout_(from.operand_shapes_with_layout_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + opcode_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.opcode().size() > 0) { + opcode_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.opcode(), + GetArenaNoVirtual()); + } + fusion_kind_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.fusion_kind().size() > 0) { + fusion_kind_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.fusion_kind(), + GetArenaNoVirtual()); + } + outfeed_config_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.outfeed_config().size() > 0) { + outfeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.outfeed_config(), + GetArenaNoVirtual()); + } + infeed_config_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.infeed_config().size() > 0) { + infeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.infeed_config(), + GetArenaNoVirtual()); + } + custom_call_target_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.custom_call_target().size() > 0) { + custom_call_target_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.custom_call_target(), + GetArenaNoVirtual()); + } + channel_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.channel_name().size() > 0) { + channel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.channel_name(), + GetArenaNoVirtual()); + } + backend_config_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.backend_config().size() > 0) { + backend_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.backend_config(), + GetArenaNoVirtual()); + } + cross_replica_sum_barrier_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.cross_replica_sum_barrier().size() > 0) { + cross_replica_sum_barrier_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.cross_replica_sum_barrier(), + GetArenaNoVirtual()); + } + custom_call_opaque_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.custom_call_opaque().size() > 0) { + custom_call_opaque_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.custom_call_opaque(), + GetArenaNoVirtual()); + } + if (from.has_shape()) { + shape_ = new ::xla::ShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + if (from.has_metadata()) { + metadata_ = new ::xla::OpMetadata(*from.metadata_); + } else { + metadata_ = NULL; + } + if (from.has_literal()) { + literal_ = new ::xla::LiteralProto(*from.literal_); + } else { + literal_ = NULL; + } + if (from.has_window()) { + window_ = new ::xla::Window(*from.window_); + } else { + window_ = NULL; + } + if (from.has_convolution_dimension_numbers()) { + convolution_dimension_numbers_ = new ::xla::ConvolutionDimensionNumbers(*from.convolution_dimension_numbers_); + } else { + convolution_dimension_numbers_ = NULL; + } + if (from.has_padding_config()) { + padding_config_ = new ::xla::PaddingConfig(*from.padding_config_); + } else { + padding_config_ = NULL; + } + if (from.has_outfeed_shape()) { + outfeed_shape_ = new ::xla::ShapeProto(*from.outfeed_shape_); + } else { + outfeed_shape_ = NULL; + } + if (from.has_dot_dimension_numbers()) { + dot_dimension_numbers_ = new ::xla::DotDimensionNumbers(*from.dot_dimension_numbers_); + } else { + dot_dimension_numbers_ = NULL; + } + if (from.has_gather_dimension_numbers()) { + gather_dimension_numbers_ = new ::xla::GatherDimensionNumbers(*from.gather_dimension_numbers_); + } else { + gather_dimension_numbers_ = NULL; + } + if (from.has_sharding()) { + sharding_ = new ::xla::OpSharding(*from.sharding_); + } else { + sharding_ = NULL; + } + if (from.has_scatter_dimension_numbers()) { + scatter_dimension_numbers_ = new ::xla::ScatterDimensionNumbers(*from.scatter_dimension_numbers_); + } else { + scatter_dimension_numbers_ = NULL; + } + if (from.has_precision_config()) { + precision_config_ = new ::xla::PrecisionConfig(*from.precision_config_); + } else { + precision_config_ = NULL; + } + if (from.has_domain_entry_sharding()) { + domain_entry_sharding_ = new ::xla::OpSharding(*from.domain_entry_sharding_); + } else { + domain_entry_sharding_ = NULL; + } + if (from.has_domain_exit_sharding()) { + domain_exit_sharding_ = new ::xla::OpSharding(*from.domain_exit_sharding_); + } else { + domain_exit_sharding_ = NULL; + } + ::memcpy(¶meter_number_, &from.parameter_number_, + static_cast(reinterpret_cast(&feature_group_count_) - + reinterpret_cast(¶meter_number_)) + sizeof(feature_group_count_)); + // @@protoc_insertion_point(copy_constructor:xla.HloInstructionProto) +} + +void HloInstructionProto::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + opcode_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + fusion_kind_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + outfeed_config_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + infeed_config_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + custom_call_target_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + channel_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + backend_config_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + cross_replica_sum_barrier_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + custom_call_opaque_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&shape_, 0, static_cast( + reinterpret_cast(&feature_group_count_) - + reinterpret_cast(&shape_)) + sizeof(feature_group_count_)); +} + +HloInstructionProto::~HloInstructionProto() { + // @@protoc_insertion_point(destructor:xla.HloInstructionProto) + SharedDtor(); +} + +void HloInstructionProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + opcode_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + fusion_kind_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + outfeed_config_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + infeed_config_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + custom_call_target_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + channel_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + backend_config_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + cross_replica_sum_barrier_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + custom_call_opaque_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete shape_; + if (this != internal_default_instance()) delete metadata_; + if (this != internal_default_instance()) delete literal_; + if (this != internal_default_instance()) delete window_; + if (this != internal_default_instance()) delete convolution_dimension_numbers_; + if (this != internal_default_instance()) delete padding_config_; + if (this != internal_default_instance()) delete outfeed_shape_; + if (this != internal_default_instance()) delete dot_dimension_numbers_; + if (this != internal_default_instance()) delete gather_dimension_numbers_; + if (this != internal_default_instance()) delete sharding_; + if (this != internal_default_instance()) delete scatter_dimension_numbers_; + if (this != internal_default_instance()) delete precision_config_; + if (this != internal_default_instance()) delete domain_entry_sharding_; + if (this != internal_default_instance()) delete domain_exit_sharding_; +} + +void HloInstructionProto::ArenaDtor(void* object) { + HloInstructionProto* _this = reinterpret_cast< HloInstructionProto* >(object); + (void)_this; +} +void HloInstructionProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloInstructionProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloInstructionProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloInstructionProto& HloInstructionProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInstructionProto.base); + return *internal_default_instance(); +} + + +void HloInstructionProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloInstructionProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dimensions_.Clear(); + slice_dimensions_.Clear(); + dynamic_slice_sizes_.Clear(); + fft_length_.Clear(); + gather_slice_sizes_.Clear(); + operand_ids_.Clear(); + control_predecessor_ids_.Clear(); + called_computation_ids_.Clear(); + replica_groups_.Clear(); + source_target_pairs_.Clear(); + operand_shapes_with_layout_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + opcode_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + fusion_kind_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + outfeed_config_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + infeed_config_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + custom_call_target_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + channel_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + backend_config_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + cross_replica_sum_barrier_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + custom_call_opaque_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + if (GetArenaNoVirtual() == NULL && metadata_ != NULL) { + delete metadata_; + } + metadata_ = NULL; + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; + if (GetArenaNoVirtual() == NULL && window_ != NULL) { + delete window_; + } + window_ = NULL; + if (GetArenaNoVirtual() == NULL && convolution_dimension_numbers_ != NULL) { + delete convolution_dimension_numbers_; + } + convolution_dimension_numbers_ = NULL; + if (GetArenaNoVirtual() == NULL && padding_config_ != NULL) { + delete padding_config_; + } + padding_config_ = NULL; + if (GetArenaNoVirtual() == NULL && outfeed_shape_ != NULL) { + delete outfeed_shape_; + } + outfeed_shape_ = NULL; + if (GetArenaNoVirtual() == NULL && dot_dimension_numbers_ != NULL) { + delete dot_dimension_numbers_; + } + dot_dimension_numbers_ = NULL; + if (GetArenaNoVirtual() == NULL && gather_dimension_numbers_ != NULL) { + delete gather_dimension_numbers_; + } + gather_dimension_numbers_ = NULL; + if (GetArenaNoVirtual() == NULL && sharding_ != NULL) { + delete sharding_; + } + sharding_ = NULL; + if (GetArenaNoVirtual() == NULL && scatter_dimension_numbers_ != NULL) { + delete scatter_dimension_numbers_; + } + scatter_dimension_numbers_ = NULL; + if (GetArenaNoVirtual() == NULL && precision_config_ != NULL) { + delete precision_config_; + } + precision_config_ = NULL; + if (GetArenaNoVirtual() == NULL && domain_entry_sharding_ != NULL) { + delete domain_entry_sharding_; + } + domain_entry_sharding_ = NULL; + if (GetArenaNoVirtual() == NULL && domain_exit_sharding_ != NULL) { + delete domain_exit_sharding_; + } + domain_exit_sharding_ = NULL; + ::memset(¶meter_number_, 0, static_cast( + reinterpret_cast(&feature_group_count_) - + reinterpret_cast(¶meter_number_)) + sizeof(feature_group_count_)); + _internal_metadata_.Clear(); +} + +bool HloInstructionProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloInstructionProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.name")); + } else { + goto handle_unusual; + } + break; + } + + // string opcode = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_opcode())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->opcode().data(), static_cast(this->opcode().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.opcode")); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ShapeProto shape = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.OpMetadata metadata = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_metadata())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.LiteralProto literal = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_literal())); + } else { + goto handle_unusual; + } + break; + } + + // int64 parameter_number = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, ¶meter_number_))); + } else { + goto handle_unusual; + } + break; + } + + // string fusion_kind = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_fusion_kind())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->fusion_kind().data(), static_cast(this->fusion_kind().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.fusion_kind")); + } else { + goto handle_unusual; + } + break; + } + + // int64 tuple_index = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &tuple_index_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 dimensions = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 114u, input, this->mutable_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.Window window = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_window())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ConvolutionDimensionNumbers convolution_dimension_numbers = 16; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(130u /* 130 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_convolution_dimension_numbers())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HloInstructionProto.SliceDimensions slice_dimensions = 17; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(138u /* 138 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_slice_dimensions())); + } else { + goto handle_unusual; + } + break; + } + + // int32 exponent_bits = 18; + case 18: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(144u /* 144 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &exponent_bits_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 mantissa_bits = 19; + case 19: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(152u /* 152 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &mantissa_bits_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 dynamic_slice_sizes = 20; + case 20: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(162u /* 162 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dynamic_slice_sizes()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(160u /* 160 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 2, 162u, input, this->mutable_dynamic_slice_sizes()))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.PaddingConfig padding_config = 21; + case 21: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(170u /* 170 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_padding_config())); + } else { + goto handle_unusual; + } + break; + } + + // bytes outfeed_config = 22; + case 22: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(178u /* 178 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_outfeed_config())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.RandomDistribution distribution = 23; + case 23: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(184u /* 184 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_distribution(static_cast< ::xla::RandomDistribution >(value)); + } else { + goto handle_unusual; + } + break; + } + + // float epsilon = 24; + case 24: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(197u /* 197 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &epsilon_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 feature_index = 25; + case 25: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(200u /* 200 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &feature_index_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 channel_id = 26; + case 26: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(208u /* 208 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &channel_id_))); + } else { + goto handle_unusual; + } + break; + } + + // bytes infeed_config = 27; + case 27: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(218u /* 218 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_infeed_config())); + } else { + goto handle_unusual; + } + break; + } + + // string custom_call_target = 28; + case 28: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(226u /* 226 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_custom_call_target())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->custom_call_target().data(), static_cast(this->custom_call_target().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.custom_call_target")); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ShapeProto outfeed_shape = 29; + case 29: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(234u /* 234 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_outfeed_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DotDimensionNumbers dot_dimension_numbers = 30; + case 30: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(242u /* 242 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dot_dimension_numbers())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.FftType fft_type = 31; + case 31: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(248u /* 248 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_fft_type(static_cast< ::xla::FftType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 fft_length = 32; + case 32: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(2u /* 258 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_fft_length()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(0u /* 256 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 2, 258u, input, this->mutable_fft_length()))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.GatherDimensionNumbers gather_dimension_numbers = 33; + case 33: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 266 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_gather_dimension_numbers())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 gather_slice_sizes = 34; + case 34: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 274 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_gather_slice_sizes()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 272 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 2, 274u, input, this->mutable_gather_slice_sizes()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 id = 35; + case 35: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 280 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 operand_ids = 36; + case 36: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 290 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_operand_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 288 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 2, 290u, input, this->mutable_operand_ids()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 control_predecessor_ids = 37; + case 37: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 298 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_control_predecessor_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 296 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 2, 298u, input, this->mutable_control_predecessor_ids()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 called_computation_ids = 38; + case 38: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 306 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_called_computation_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 304 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 2, 306u, input, this->mutable_called_computation_ids()))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.OpSharding sharding = 40; + case 40: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 322 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sharding())); + } else { + goto handle_unusual; + } + break; + } + + // string channel_name = 41; + case 41: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 330 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_channel_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->channel_name().data(), static_cast(this->channel_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.channel_name")); + } else { + goto handle_unusual; + } + break; + } + + // int64 cost_estimate_ns = 42; + case 42: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 336 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &cost_estimate_ns_))); + } else { + goto handle_unusual; + } + break; + } + + // string backend_config = 43; + case 43: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 346 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_backend_config())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->backend_config().data(), static_cast(this->backend_config().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.backend_config")); + } else { + goto handle_unusual; + } + break; + } + + // int64 all_reduce_id = 45; + case 45: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(104u /* 360 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &all_reduce_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string cross_replica_sum_barrier = 46; + case 46: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(114u /* 370 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_cross_replica_sum_barrier())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->cross_replica_sum_barrier().data(), static_cast(this->cross_replica_sum_barrier().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.cross_replica_sum_barrier")); + } else { + goto handle_unusual; + } + break; + } + + // bool is_host_transfer = 47; + case 47: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(120u /* 376 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_host_transfer_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ScatterDimensionNumbers scatter_dimension_numbers = 48; + case 48: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(130u /* 386 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_scatter_dimension_numbers())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.ReplicaGroup replica_groups = 49; + case 49: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(138u /* 394 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_replica_groups())); + } else { + goto handle_unusual; + } + break; + } + + // int64 feature_group_count = 50; + case 50: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(144u /* 400 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &feature_group_count_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.PrecisionConfig precision_config = 51; + case 51: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(154u /* 410 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_precision_config())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.SourceTarget source_target_pairs = 52; + case 52: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(162u /* 418 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_source_target_pairs())); + } else { + goto handle_unusual; + } + break; + } + + // string custom_call_opaque = 53; + case 53: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(170u /* 426 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_custom_call_opaque())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->custom_call_opaque().data(), static_cast(this->custom_call_opaque().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloInstructionProto.custom_call_opaque")); + } else { + goto handle_unusual; + } + break; + } + + // .xla.OpSharding domain_entry_sharding = 54; + case 54: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(178u /* 434 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_domain_entry_sharding())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.OpSharding domain_exit_sharding = 55; + case 55: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(186u /* 442 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_domain_exit_sharding())); + } else { + goto handle_unusual; + } + break; + } + + // bool constrain_layout = 56; + case 56: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(192u /* 448 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &constrain_layout_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.ShapeProto operand_shapes_with_layout = 57; + case 57: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(202u /* 458 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_operand_shapes_with_layout())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloInstructionProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloInstructionProto) + return false; +#undef DO_ +} + +void HloInstructionProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloInstructionProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string opcode = 2; + if (this->opcode().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->opcode().data(), static_cast(this->opcode().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.opcode"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->opcode(), output); + } + + // .xla.ShapeProto shape = 3; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_shape(), output); + } + + // .xla.OpMetadata metadata = 7; + if (this->has_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->_internal_metadata(), output); + } + + // .xla.LiteralProto literal = 8; + if (this->has_literal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_literal(), output); + } + + // int64 parameter_number = 9; + if (this->parameter_number() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(9, this->parameter_number(), output); + } + + // string fusion_kind = 11; + if (this->fusion_kind().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->fusion_kind().data(), static_cast(this->fusion_kind().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.fusion_kind"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 11, this->fusion_kind(), output); + } + + // int64 tuple_index = 13; + if (this->tuple_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(13, this->tuple_index(), output); + } + + // repeated int64 dimensions = 14; + if (this->dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(14, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->dimensions(i), output); + } + + // .xla.Window window = 15; + if (this->has_window()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 15, this->_internal_window(), output); + } + + // .xla.ConvolutionDimensionNumbers convolution_dimension_numbers = 16; + if (this->has_convolution_dimension_numbers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 16, this->_internal_convolution_dimension_numbers(), output); + } + + // repeated .xla.HloInstructionProto.SliceDimensions slice_dimensions = 17; + for (unsigned int i = 0, + n = static_cast(this->slice_dimensions_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 17, + this->slice_dimensions(static_cast(i)), + output); + } + + // int32 exponent_bits = 18; + if (this->exponent_bits() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->exponent_bits(), output); + } + + // int32 mantissa_bits = 19; + if (this->mantissa_bits() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(19, this->mantissa_bits(), output); + } + + // repeated int64 dynamic_slice_sizes = 20; + if (this->dynamic_slice_sizes_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(20, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _dynamic_slice_sizes_cached_byte_size_)); + } + for (int i = 0, n = this->dynamic_slice_sizes_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->dynamic_slice_sizes(i), output); + } + + // .xla.PaddingConfig padding_config = 21; + if (this->has_padding_config()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 21, this->_internal_padding_config(), output); + } + + // bytes outfeed_config = 22; + if (this->outfeed_config().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 22, this->outfeed_config(), output); + } + + // .xla.RandomDistribution distribution = 23; + if (this->distribution() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 23, this->distribution(), output); + } + + // float epsilon = 24; + if (this->epsilon() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(24, this->epsilon(), output); + } + + // int64 feature_index = 25; + if (this->feature_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(25, this->feature_index(), output); + } + + // int64 channel_id = 26; + if (this->channel_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(26, this->channel_id(), output); + } + + // bytes infeed_config = 27; + if (this->infeed_config().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 27, this->infeed_config(), output); + } + + // string custom_call_target = 28; + if (this->custom_call_target().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->custom_call_target().data(), static_cast(this->custom_call_target().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.custom_call_target"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 28, this->custom_call_target(), output); + } + + // .xla.ShapeProto outfeed_shape = 29; + if (this->has_outfeed_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 29, this->_internal_outfeed_shape(), output); + } + + // .xla.DotDimensionNumbers dot_dimension_numbers = 30; + if (this->has_dot_dimension_numbers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 30, this->_internal_dot_dimension_numbers(), output); + } + + // .xla.FftType fft_type = 31; + if (this->fft_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 31, this->fft_type(), output); + } + + // repeated int64 fft_length = 32; + if (this->fft_length_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(32, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _fft_length_cached_byte_size_)); + } + for (int i = 0, n = this->fft_length_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->fft_length(i), output); + } + + // .xla.GatherDimensionNumbers gather_dimension_numbers = 33; + if (this->has_gather_dimension_numbers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 33, this->_internal_gather_dimension_numbers(), output); + } + + // repeated int64 gather_slice_sizes = 34; + if (this->gather_slice_sizes_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(34, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _gather_slice_sizes_cached_byte_size_)); + } + for (int i = 0, n = this->gather_slice_sizes_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->gather_slice_sizes(i), output); + } + + // int64 id = 35; + if (this->id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(35, this->id(), output); + } + + // repeated int64 operand_ids = 36; + if (this->operand_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(36, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _operand_ids_cached_byte_size_)); + } + for (int i = 0, n = this->operand_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->operand_ids(i), output); + } + + // repeated int64 control_predecessor_ids = 37; + if (this->control_predecessor_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(37, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _control_predecessor_ids_cached_byte_size_)); + } + for (int i = 0, n = this->control_predecessor_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->control_predecessor_ids(i), output); + } + + // repeated int64 called_computation_ids = 38; + if (this->called_computation_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(38, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _called_computation_ids_cached_byte_size_)); + } + for (int i = 0, n = this->called_computation_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->called_computation_ids(i), output); + } + + // .xla.OpSharding sharding = 40; + if (this->has_sharding()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 40, this->_internal_sharding(), output); + } + + // string channel_name = 41; + if (this->channel_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->channel_name().data(), static_cast(this->channel_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.channel_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 41, this->channel_name(), output); + } + + // int64 cost_estimate_ns = 42; + if (this->cost_estimate_ns() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(42, this->cost_estimate_ns(), output); + } + + // string backend_config = 43; + if (this->backend_config().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->backend_config().data(), static_cast(this->backend_config().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.backend_config"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 43, this->backend_config(), output); + } + + // int64 all_reduce_id = 45; + if (this->all_reduce_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(45, this->all_reduce_id(), output); + } + + // string cross_replica_sum_barrier = 46; + if (this->cross_replica_sum_barrier().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->cross_replica_sum_barrier().data(), static_cast(this->cross_replica_sum_barrier().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.cross_replica_sum_barrier"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 46, this->cross_replica_sum_barrier(), output); + } + + // bool is_host_transfer = 47; + if (this->is_host_transfer() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(47, this->is_host_transfer(), output); + } + + // .xla.ScatterDimensionNumbers scatter_dimension_numbers = 48; + if (this->has_scatter_dimension_numbers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 48, this->_internal_scatter_dimension_numbers(), output); + } + + // repeated .xla.ReplicaGroup replica_groups = 49; + for (unsigned int i = 0, + n = static_cast(this->replica_groups_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 49, + this->replica_groups(static_cast(i)), + output); + } + + // int64 feature_group_count = 50; + if (this->feature_group_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(50, this->feature_group_count(), output); + } + + // .xla.PrecisionConfig precision_config = 51; + if (this->has_precision_config()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 51, this->_internal_precision_config(), output); + } + + // repeated .xla.SourceTarget source_target_pairs = 52; + for (unsigned int i = 0, + n = static_cast(this->source_target_pairs_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 52, + this->source_target_pairs(static_cast(i)), + output); + } + + // string custom_call_opaque = 53; + if (this->custom_call_opaque().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->custom_call_opaque().data(), static_cast(this->custom_call_opaque().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.custom_call_opaque"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 53, this->custom_call_opaque(), output); + } + + // .xla.OpSharding domain_entry_sharding = 54; + if (this->has_domain_entry_sharding()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 54, this->_internal_domain_entry_sharding(), output); + } + + // .xla.OpSharding domain_exit_sharding = 55; + if (this->has_domain_exit_sharding()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 55, this->_internal_domain_exit_sharding(), output); + } + + // bool constrain_layout = 56; + if (this->constrain_layout() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(56, this->constrain_layout(), output); + } + + // repeated .xla.ShapeProto operand_shapes_with_layout = 57; + for (unsigned int i = 0, + n = static_cast(this->operand_shapes_with_layout_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 57, + this->operand_shapes_with_layout(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloInstructionProto) +} + +::google::protobuf::uint8* HloInstructionProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloInstructionProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string opcode = 2; + if (this->opcode().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->opcode().data(), static_cast(this->opcode().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.opcode"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->opcode(), target); + } + + // .xla.ShapeProto shape = 3; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_shape(), deterministic, target); + } + + // .xla.OpMetadata metadata = 7; + if (this->has_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->_internal_metadata(), deterministic, target); + } + + // .xla.LiteralProto literal = 8; + if (this->has_literal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_literal(), deterministic, target); + } + + // int64 parameter_number = 9; + if (this->parameter_number() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(9, this->parameter_number(), target); + } + + // string fusion_kind = 11; + if (this->fusion_kind().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->fusion_kind().data(), static_cast(this->fusion_kind().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.fusion_kind"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 11, this->fusion_kind(), target); + } + + // int64 tuple_index = 13; + if (this->tuple_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(13, this->tuple_index(), target); + } + + // repeated int64 dimensions = 14; + if (this->dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 14, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->dimensions_, target); + } + + // .xla.Window window = 15; + if (this->has_window()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 15, this->_internal_window(), deterministic, target); + } + + // .xla.ConvolutionDimensionNumbers convolution_dimension_numbers = 16; + if (this->has_convolution_dimension_numbers()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 16, this->_internal_convolution_dimension_numbers(), deterministic, target); + } + + // repeated .xla.HloInstructionProto.SliceDimensions slice_dimensions = 17; + for (unsigned int i = 0, + n = static_cast(this->slice_dimensions_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 17, this->slice_dimensions(static_cast(i)), deterministic, target); + } + + // int32 exponent_bits = 18; + if (this->exponent_bits() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(18, this->exponent_bits(), target); + } + + // int32 mantissa_bits = 19; + if (this->mantissa_bits() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(19, this->mantissa_bits(), target); + } + + // repeated int64 dynamic_slice_sizes = 20; + if (this->dynamic_slice_sizes_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 20, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _dynamic_slice_sizes_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->dynamic_slice_sizes_, target); + } + + // .xla.PaddingConfig padding_config = 21; + if (this->has_padding_config()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 21, this->_internal_padding_config(), deterministic, target); + } + + // bytes outfeed_config = 22; + if (this->outfeed_config().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 22, this->outfeed_config(), target); + } + + // .xla.RandomDistribution distribution = 23; + if (this->distribution() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 23, this->distribution(), target); + } + + // float epsilon = 24; + if (this->epsilon() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(24, this->epsilon(), target); + } + + // int64 feature_index = 25; + if (this->feature_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(25, this->feature_index(), target); + } + + // int64 channel_id = 26; + if (this->channel_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(26, this->channel_id(), target); + } + + // bytes infeed_config = 27; + if (this->infeed_config().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 27, this->infeed_config(), target); + } + + // string custom_call_target = 28; + if (this->custom_call_target().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->custom_call_target().data(), static_cast(this->custom_call_target().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.custom_call_target"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 28, this->custom_call_target(), target); + } + + // .xla.ShapeProto outfeed_shape = 29; + if (this->has_outfeed_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 29, this->_internal_outfeed_shape(), deterministic, target); + } + + // .xla.DotDimensionNumbers dot_dimension_numbers = 30; + if (this->has_dot_dimension_numbers()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 30, this->_internal_dot_dimension_numbers(), deterministic, target); + } + + // .xla.FftType fft_type = 31; + if (this->fft_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 31, this->fft_type(), target); + } + + // repeated int64 fft_length = 32; + if (this->fft_length_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 32, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _fft_length_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->fft_length_, target); + } + + // .xla.GatherDimensionNumbers gather_dimension_numbers = 33; + if (this->has_gather_dimension_numbers()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 33, this->_internal_gather_dimension_numbers(), deterministic, target); + } + + // repeated int64 gather_slice_sizes = 34; + if (this->gather_slice_sizes_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 34, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _gather_slice_sizes_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->gather_slice_sizes_, target); + } + + // int64 id = 35; + if (this->id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(35, this->id(), target); + } + + // repeated int64 operand_ids = 36; + if (this->operand_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 36, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _operand_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->operand_ids_, target); + } + + // repeated int64 control_predecessor_ids = 37; + if (this->control_predecessor_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 37, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _control_predecessor_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->control_predecessor_ids_, target); + } + + // repeated int64 called_computation_ids = 38; + if (this->called_computation_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 38, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _called_computation_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->called_computation_ids_, target); + } + + // .xla.OpSharding sharding = 40; + if (this->has_sharding()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 40, this->_internal_sharding(), deterministic, target); + } + + // string channel_name = 41; + if (this->channel_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->channel_name().data(), static_cast(this->channel_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.channel_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 41, this->channel_name(), target); + } + + // int64 cost_estimate_ns = 42; + if (this->cost_estimate_ns() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(42, this->cost_estimate_ns(), target); + } + + // string backend_config = 43; + if (this->backend_config().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->backend_config().data(), static_cast(this->backend_config().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.backend_config"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 43, this->backend_config(), target); + } + + // int64 all_reduce_id = 45; + if (this->all_reduce_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(45, this->all_reduce_id(), target); + } + + // string cross_replica_sum_barrier = 46; + if (this->cross_replica_sum_barrier().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->cross_replica_sum_barrier().data(), static_cast(this->cross_replica_sum_barrier().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.cross_replica_sum_barrier"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 46, this->cross_replica_sum_barrier(), target); + } + + // bool is_host_transfer = 47; + if (this->is_host_transfer() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(47, this->is_host_transfer(), target); + } + + // .xla.ScatterDimensionNumbers scatter_dimension_numbers = 48; + if (this->has_scatter_dimension_numbers()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 48, this->_internal_scatter_dimension_numbers(), deterministic, target); + } + + // repeated .xla.ReplicaGroup replica_groups = 49; + for (unsigned int i = 0, + n = static_cast(this->replica_groups_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 49, this->replica_groups(static_cast(i)), deterministic, target); + } + + // int64 feature_group_count = 50; + if (this->feature_group_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(50, this->feature_group_count(), target); + } + + // .xla.PrecisionConfig precision_config = 51; + if (this->has_precision_config()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 51, this->_internal_precision_config(), deterministic, target); + } + + // repeated .xla.SourceTarget source_target_pairs = 52; + for (unsigned int i = 0, + n = static_cast(this->source_target_pairs_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 52, this->source_target_pairs(static_cast(i)), deterministic, target); + } + + // string custom_call_opaque = 53; + if (this->custom_call_opaque().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->custom_call_opaque().data(), static_cast(this->custom_call_opaque().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloInstructionProto.custom_call_opaque"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 53, this->custom_call_opaque(), target); + } + + // .xla.OpSharding domain_entry_sharding = 54; + if (this->has_domain_entry_sharding()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 54, this->_internal_domain_entry_sharding(), deterministic, target); + } + + // .xla.OpSharding domain_exit_sharding = 55; + if (this->has_domain_exit_sharding()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 55, this->_internal_domain_exit_sharding(), deterministic, target); + } + + // bool constrain_layout = 56; + if (this->constrain_layout() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(56, this->constrain_layout(), target); + } + + // repeated .xla.ShapeProto operand_shapes_with_layout = 57; + for (unsigned int i = 0, + n = static_cast(this->operand_shapes_with_layout_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 57, this->operand_shapes_with_layout(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloInstructionProto) + return target; +} + +size_t HloInstructionProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloInstructionProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 dimensions = 14; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .xla.HloInstructionProto.SliceDimensions slice_dimensions = 17; + { + unsigned int count = static_cast(this->slice_dimensions_size()); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->slice_dimensions(static_cast(i))); + } + } + + // repeated int64 dynamic_slice_sizes = 20; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->dynamic_slice_sizes_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dynamic_slice_sizes_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 fft_length = 32; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->fft_length_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _fft_length_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 gather_slice_sizes = 34; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->gather_slice_sizes_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _gather_slice_sizes_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 operand_ids = 36; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->operand_ids_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _operand_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 control_predecessor_ids = 37; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->control_predecessor_ids_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _control_predecessor_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 called_computation_ids = 38; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->called_computation_ids_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _called_computation_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .xla.ReplicaGroup replica_groups = 49; + { + unsigned int count = static_cast(this->replica_groups_size()); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->replica_groups(static_cast(i))); + } + } + + // repeated .xla.SourceTarget source_target_pairs = 52; + { + unsigned int count = static_cast(this->source_target_pairs_size()); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->source_target_pairs(static_cast(i))); + } + } + + // repeated .xla.ShapeProto operand_shapes_with_layout = 57; + { + unsigned int count = static_cast(this->operand_shapes_with_layout_size()); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->operand_shapes_with_layout(static_cast(i))); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string opcode = 2; + if (this->opcode().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->opcode()); + } + + // string fusion_kind = 11; + if (this->fusion_kind().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->fusion_kind()); + } + + // bytes outfeed_config = 22; + if (this->outfeed_config().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->outfeed_config()); + } + + // bytes infeed_config = 27; + if (this->infeed_config().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->infeed_config()); + } + + // string custom_call_target = 28; + if (this->custom_call_target().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->custom_call_target()); + } + + // string channel_name = 41; + if (this->channel_name().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->channel_name()); + } + + // string backend_config = 43; + if (this->backend_config().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->backend_config()); + } + + // string cross_replica_sum_barrier = 46; + if (this->cross_replica_sum_barrier().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->cross_replica_sum_barrier()); + } + + // string custom_call_opaque = 53; + if (this->custom_call_opaque().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->custom_call_opaque()); + } + + // .xla.ShapeProto shape = 3; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // .xla.OpMetadata metadata = 7; + if (this->has_metadata()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *metadata_); + } + + // .xla.LiteralProto literal = 8; + if (this->has_literal()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *literal_); + } + + // .xla.Window window = 15; + if (this->has_window()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *window_); + } + + // .xla.ConvolutionDimensionNumbers convolution_dimension_numbers = 16; + if (this->has_convolution_dimension_numbers()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *convolution_dimension_numbers_); + } + + // .xla.PaddingConfig padding_config = 21; + if (this->has_padding_config()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *padding_config_); + } + + // .xla.ShapeProto outfeed_shape = 29; + if (this->has_outfeed_shape()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *outfeed_shape_); + } + + // .xla.DotDimensionNumbers dot_dimension_numbers = 30; + if (this->has_dot_dimension_numbers()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *dot_dimension_numbers_); + } + + // .xla.GatherDimensionNumbers gather_dimension_numbers = 33; + if (this->has_gather_dimension_numbers()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *gather_dimension_numbers_); + } + + // .xla.OpSharding sharding = 40; + if (this->has_sharding()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *sharding_); + } + + // .xla.ScatterDimensionNumbers scatter_dimension_numbers = 48; + if (this->has_scatter_dimension_numbers()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *scatter_dimension_numbers_); + } + + // .xla.PrecisionConfig precision_config = 51; + if (this->has_precision_config()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *precision_config_); + } + + // .xla.OpSharding domain_entry_sharding = 54; + if (this->has_domain_entry_sharding()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *domain_entry_sharding_); + } + + // .xla.OpSharding domain_exit_sharding = 55; + if (this->has_domain_exit_sharding()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *domain_exit_sharding_); + } + + // int64 parameter_number = 9; + if (this->parameter_number() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->parameter_number()); + } + + // int64 tuple_index = 13; + if (this->tuple_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->tuple_index()); + } + + // int32 exponent_bits = 18; + if (this->exponent_bits() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->exponent_bits()); + } + + // int32 mantissa_bits = 19; + if (this->mantissa_bits() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->mantissa_bits()); + } + + // .xla.RandomDistribution distribution = 23; + if (this->distribution() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->distribution()); + } + + // float epsilon = 24; + if (this->epsilon() != 0) { + total_size += 2 + 4; + } + + // int64 feature_index = 25; + if (this->feature_index() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->feature_index()); + } + + // int64 channel_id = 26; + if (this->channel_id() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->channel_id()); + } + + // int64 id = 35; + if (this->id() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + // int64 cost_estimate_ns = 42; + if (this->cost_estimate_ns() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->cost_estimate_ns()); + } + + // .xla.FftType fft_type = 31; + if (this->fft_type() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->fft_type()); + } + + // bool is_host_transfer = 47; + if (this->is_host_transfer() != 0) { + total_size += 2 + 1; + } + + // bool constrain_layout = 56; + if (this->constrain_layout() != 0) { + total_size += 2 + 1; + } + + // int64 all_reduce_id = 45; + if (this->all_reduce_id() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->all_reduce_id()); + } + + // int64 feature_group_count = 50; + if (this->feature_group_count() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->feature_group_count()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloInstructionProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloInstructionProto) + GOOGLE_DCHECK_NE(&from, this); + const HloInstructionProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloInstructionProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloInstructionProto) + MergeFrom(*source); + } +} + +void HloInstructionProto::MergeFrom(const HloInstructionProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloInstructionProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dimensions_.MergeFrom(from.dimensions_); + slice_dimensions_.MergeFrom(from.slice_dimensions_); + dynamic_slice_sizes_.MergeFrom(from.dynamic_slice_sizes_); + fft_length_.MergeFrom(from.fft_length_); + gather_slice_sizes_.MergeFrom(from.gather_slice_sizes_); + operand_ids_.MergeFrom(from.operand_ids_); + control_predecessor_ids_.MergeFrom(from.control_predecessor_ids_); + called_computation_ids_.MergeFrom(from.called_computation_ids_); + replica_groups_.MergeFrom(from.replica_groups_); + source_target_pairs_.MergeFrom(from.source_target_pairs_); + operand_shapes_with_layout_.MergeFrom(from.operand_shapes_with_layout_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.opcode().size() > 0) { + set_opcode(from.opcode()); + } + if (from.fusion_kind().size() > 0) { + set_fusion_kind(from.fusion_kind()); + } + if (from.outfeed_config().size() > 0) { + set_outfeed_config(from.outfeed_config()); + } + if (from.infeed_config().size() > 0) { + set_infeed_config(from.infeed_config()); + } + if (from.custom_call_target().size() > 0) { + set_custom_call_target(from.custom_call_target()); + } + if (from.channel_name().size() > 0) { + set_channel_name(from.channel_name()); + } + if (from.backend_config().size() > 0) { + set_backend_config(from.backend_config()); + } + if (from.cross_replica_sum_barrier().size() > 0) { + set_cross_replica_sum_barrier(from.cross_replica_sum_barrier()); + } + if (from.custom_call_opaque().size() > 0) { + set_custom_call_opaque(from.custom_call_opaque()); + } + if (from.has_shape()) { + mutable_shape()->::xla::ShapeProto::MergeFrom(from.shape()); + } + if (from.has_metadata()) { + mutable_metadata()->::xla::OpMetadata::MergeFrom(from.metadata()); + } + if (from.has_literal()) { + mutable_literal()->::xla::LiteralProto::MergeFrom(from.literal()); + } + if (from.has_window()) { + mutable_window()->::xla::Window::MergeFrom(from.window()); + } + if (from.has_convolution_dimension_numbers()) { + mutable_convolution_dimension_numbers()->::xla::ConvolutionDimensionNumbers::MergeFrom(from.convolution_dimension_numbers()); + } + if (from.has_padding_config()) { + mutable_padding_config()->::xla::PaddingConfig::MergeFrom(from.padding_config()); + } + if (from.has_outfeed_shape()) { + mutable_outfeed_shape()->::xla::ShapeProto::MergeFrom(from.outfeed_shape()); + } + if (from.has_dot_dimension_numbers()) { + mutable_dot_dimension_numbers()->::xla::DotDimensionNumbers::MergeFrom(from.dot_dimension_numbers()); + } + if (from.has_gather_dimension_numbers()) { + mutable_gather_dimension_numbers()->::xla::GatherDimensionNumbers::MergeFrom(from.gather_dimension_numbers()); + } + if (from.has_sharding()) { + mutable_sharding()->::xla::OpSharding::MergeFrom(from.sharding()); + } + if (from.has_scatter_dimension_numbers()) { + mutable_scatter_dimension_numbers()->::xla::ScatterDimensionNumbers::MergeFrom(from.scatter_dimension_numbers()); + } + if (from.has_precision_config()) { + mutable_precision_config()->::xla::PrecisionConfig::MergeFrom(from.precision_config()); + } + if (from.has_domain_entry_sharding()) { + mutable_domain_entry_sharding()->::xla::OpSharding::MergeFrom(from.domain_entry_sharding()); + } + if (from.has_domain_exit_sharding()) { + mutable_domain_exit_sharding()->::xla::OpSharding::MergeFrom(from.domain_exit_sharding()); + } + if (from.parameter_number() != 0) { + set_parameter_number(from.parameter_number()); + } + if (from.tuple_index() != 0) { + set_tuple_index(from.tuple_index()); + } + if (from.exponent_bits() != 0) { + set_exponent_bits(from.exponent_bits()); + } + if (from.mantissa_bits() != 0) { + set_mantissa_bits(from.mantissa_bits()); + } + if (from.distribution() != 0) { + set_distribution(from.distribution()); + } + if (from.epsilon() != 0) { + set_epsilon(from.epsilon()); + } + if (from.feature_index() != 0) { + set_feature_index(from.feature_index()); + } + if (from.channel_id() != 0) { + set_channel_id(from.channel_id()); + } + if (from.id() != 0) { + set_id(from.id()); + } + if (from.cost_estimate_ns() != 0) { + set_cost_estimate_ns(from.cost_estimate_ns()); + } + if (from.fft_type() != 0) { + set_fft_type(from.fft_type()); + } + if (from.is_host_transfer() != 0) { + set_is_host_transfer(from.is_host_transfer()); + } + if (from.constrain_layout() != 0) { + set_constrain_layout(from.constrain_layout()); + } + if (from.all_reduce_id() != 0) { + set_all_reduce_id(from.all_reduce_id()); + } + if (from.feature_group_count() != 0) { + set_feature_group_count(from.feature_group_count()); + } +} + +void HloInstructionProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloInstructionProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloInstructionProto::CopyFrom(const HloInstructionProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloInstructionProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloInstructionProto::IsInitialized() const { + return true; +} + +void HloInstructionProto::Swap(HloInstructionProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloInstructionProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloInstructionProto::UnsafeArenaSwap(HloInstructionProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloInstructionProto::InternalSwap(HloInstructionProto* other) { + using std::swap; + dimensions_.InternalSwap(&other->dimensions_); + CastToBase(&slice_dimensions_)->InternalSwap(CastToBase(&other->slice_dimensions_)); + dynamic_slice_sizes_.InternalSwap(&other->dynamic_slice_sizes_); + fft_length_.InternalSwap(&other->fft_length_); + gather_slice_sizes_.InternalSwap(&other->gather_slice_sizes_); + operand_ids_.InternalSwap(&other->operand_ids_); + control_predecessor_ids_.InternalSwap(&other->control_predecessor_ids_); + called_computation_ids_.InternalSwap(&other->called_computation_ids_); + CastToBase(&replica_groups_)->InternalSwap(CastToBase(&other->replica_groups_)); + CastToBase(&source_target_pairs_)->InternalSwap(CastToBase(&other->source_target_pairs_)); + CastToBase(&operand_shapes_with_layout_)->InternalSwap(CastToBase(&other->operand_shapes_with_layout_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + opcode_.Swap(&other->opcode_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + fusion_kind_.Swap(&other->fusion_kind_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + outfeed_config_.Swap(&other->outfeed_config_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + infeed_config_.Swap(&other->infeed_config_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + custom_call_target_.Swap(&other->custom_call_target_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + channel_name_.Swap(&other->channel_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + backend_config_.Swap(&other->backend_config_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + cross_replica_sum_barrier_.Swap(&other->cross_replica_sum_barrier_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + custom_call_opaque_.Swap(&other->custom_call_opaque_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(shape_, other->shape_); + swap(metadata_, other->metadata_); + swap(literal_, other->literal_); + swap(window_, other->window_); + swap(convolution_dimension_numbers_, other->convolution_dimension_numbers_); + swap(padding_config_, other->padding_config_); + swap(outfeed_shape_, other->outfeed_shape_); + swap(dot_dimension_numbers_, other->dot_dimension_numbers_); + swap(gather_dimension_numbers_, other->gather_dimension_numbers_); + swap(sharding_, other->sharding_); + swap(scatter_dimension_numbers_, other->scatter_dimension_numbers_); + swap(precision_config_, other->precision_config_); + swap(domain_entry_sharding_, other->domain_entry_sharding_); + swap(domain_exit_sharding_, other->domain_exit_sharding_); + swap(parameter_number_, other->parameter_number_); + swap(tuple_index_, other->tuple_index_); + swap(exponent_bits_, other->exponent_bits_); + swap(mantissa_bits_, other->mantissa_bits_); + swap(distribution_, other->distribution_); + swap(epsilon_, other->epsilon_); + swap(feature_index_, other->feature_index_); + swap(channel_id_, other->channel_id_); + swap(id_, other->id_); + swap(cost_estimate_ns_, other->cost_estimate_ns_); + swap(fft_type_, other->fft_type_); + swap(is_host_transfer_, other->is_host_transfer_); + swap(constrain_layout_, other->constrain_layout_); + swap(all_reduce_id_, other->all_reduce_id_); + swap(feature_group_count_, other->feature_group_count_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloInstructionProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloComputationProto::InitAsDefaultInstance() { + ::xla::_HloComputationProto_default_instance_._instance.get_mutable()->program_shape_ = const_cast< ::xla::ProgramShapeProto*>( + ::xla::ProgramShapeProto::internal_default_instance()); +} +void HloComputationProto::unsafe_arena_set_allocated_program_shape( + ::xla::ProgramShapeProto* program_shape) { + if (GetArenaNoVirtual() == NULL) { + delete program_shape_; + } + program_shape_ = program_shape; + if (program_shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloComputationProto.program_shape) +} +void HloComputationProto::clear_program_shape() { + if (GetArenaNoVirtual() == NULL && program_shape_ != NULL) { + delete program_shape_; + } + program_shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloComputationProto::kNameFieldNumber; +const int HloComputationProto::kInstructionsFieldNumber; +const int HloComputationProto::kProgramShapeFieldNumber; +const int HloComputationProto::kIdFieldNumber; +const int HloComputationProto::kRootIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloComputationProto::HloComputationProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloComputationProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloComputationProto) +} +HloComputationProto::HloComputationProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + instructions_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloComputationProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloComputationProto) +} +HloComputationProto::HloComputationProto(const HloComputationProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + instructions_(from.instructions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + if (from.has_program_shape()) { + program_shape_ = new ::xla::ProgramShapeProto(*from.program_shape_); + } else { + program_shape_ = NULL; + } + ::memcpy(&id_, &from.id_, + static_cast(reinterpret_cast(&root_id_) - + reinterpret_cast(&id_)) + sizeof(root_id_)); + // @@protoc_insertion_point(copy_constructor:xla.HloComputationProto) +} + +void HloComputationProto::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&program_shape_, 0, static_cast( + reinterpret_cast(&root_id_) - + reinterpret_cast(&program_shape_)) + sizeof(root_id_)); +} + +HloComputationProto::~HloComputationProto() { + // @@protoc_insertion_point(destructor:xla.HloComputationProto) + SharedDtor(); +} + +void HloComputationProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete program_shape_; +} + +void HloComputationProto::ArenaDtor(void* object) { + HloComputationProto* _this = reinterpret_cast< HloComputationProto* >(object); + (void)_this; +} +void HloComputationProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloComputationProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloComputationProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloComputationProto& HloComputationProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloComputationProto.base); + return *internal_default_instance(); +} + + +void HloComputationProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloComputationProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + instructions_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && program_shape_ != NULL) { + delete program_shape_; + } + program_shape_ = NULL; + ::memset(&id_, 0, static_cast( + reinterpret_cast(&root_id_) - + reinterpret_cast(&id_)) + sizeof(root_id_)); + _internal_metadata_.Clear(); +} + +bool HloComputationProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloComputationProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloComputationProto.name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HloInstructionProto instructions = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_instructions())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ProgramShapeProto program_shape = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_program_shape())); + } else { + goto handle_unusual; + } + break; + } + + // int64 id = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 root_id = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &root_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloComputationProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloComputationProto) + return false; +#undef DO_ +} + +void HloComputationProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloComputationProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloComputationProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .xla.HloInstructionProto instructions = 2; + for (unsigned int i = 0, + n = static_cast(this->instructions_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->instructions(static_cast(i)), + output); + } + + // .xla.ProgramShapeProto program_shape = 4; + if (this->has_program_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_program_shape(), output); + } + + // int64 id = 5; + if (this->id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->id(), output); + } + + // int64 root_id = 6; + if (this->root_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->root_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloComputationProto) +} + +::google::protobuf::uint8* HloComputationProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloComputationProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloComputationProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .xla.HloInstructionProto instructions = 2; + for (unsigned int i = 0, + n = static_cast(this->instructions_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->instructions(static_cast(i)), deterministic, target); + } + + // .xla.ProgramShapeProto program_shape = 4; + if (this->has_program_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_program_shape(), deterministic, target); + } + + // int64 id = 5; + if (this->id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->id(), target); + } + + // int64 root_id = 6; + if (this->root_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->root_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloComputationProto) + return target; +} + +size_t HloComputationProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloComputationProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HloInstructionProto instructions = 2; + { + unsigned int count = static_cast(this->instructions_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->instructions(static_cast(i))); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .xla.ProgramShapeProto program_shape = 4; + if (this->has_program_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *program_shape_); + } + + // int64 id = 5; + if (this->id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + // int64 root_id = 6; + if (this->root_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->root_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloComputationProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloComputationProto) + GOOGLE_DCHECK_NE(&from, this); + const HloComputationProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloComputationProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloComputationProto) + MergeFrom(*source); + } +} + +void HloComputationProto::MergeFrom(const HloComputationProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloComputationProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + instructions_.MergeFrom(from.instructions_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.has_program_shape()) { + mutable_program_shape()->::xla::ProgramShapeProto::MergeFrom(from.program_shape()); + } + if (from.id() != 0) { + set_id(from.id()); + } + if (from.root_id() != 0) { + set_root_id(from.root_id()); + } +} + +void HloComputationProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloComputationProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloComputationProto::CopyFrom(const HloComputationProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloComputationProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloComputationProto::IsInitialized() const { + return true; +} + +void HloComputationProto::Swap(HloComputationProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloComputationProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloComputationProto::UnsafeArenaSwap(HloComputationProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloComputationProto::InternalSwap(HloComputationProto* other) { + using std::swap; + CastToBase(&instructions_)->InternalSwap(CastToBase(&other->instructions_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(program_shape_, other->program_shape_); + swap(id_, other->id_); + swap(root_id_, other->root_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloComputationProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloScheduleProto_InstructionSequence::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloScheduleProto_InstructionSequence::kInstructionIdsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloScheduleProto_InstructionSequence::HloScheduleProto_InstructionSequence() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto_InstructionSequence.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloScheduleProto.InstructionSequence) +} +HloScheduleProto_InstructionSequence::HloScheduleProto_InstructionSequence(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + instruction_ids_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto_InstructionSequence.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloScheduleProto.InstructionSequence) +} +HloScheduleProto_InstructionSequence::HloScheduleProto_InstructionSequence(const HloScheduleProto_InstructionSequence& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + instruction_ids_(from.instruction_ids_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.HloScheduleProto.InstructionSequence) +} + +void HloScheduleProto_InstructionSequence::SharedCtor() { +} + +HloScheduleProto_InstructionSequence::~HloScheduleProto_InstructionSequence() { + // @@protoc_insertion_point(destructor:xla.HloScheduleProto.InstructionSequence) + SharedDtor(); +} + +void HloScheduleProto_InstructionSequence::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HloScheduleProto_InstructionSequence::ArenaDtor(void* object) { + HloScheduleProto_InstructionSequence* _this = reinterpret_cast< HloScheduleProto_InstructionSequence* >(object); + (void)_this; +} +void HloScheduleProto_InstructionSequence::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloScheduleProto_InstructionSequence::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloScheduleProto_InstructionSequence::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloScheduleProto_InstructionSequence& HloScheduleProto_InstructionSequence::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto_InstructionSequence.base); + return *internal_default_instance(); +} + + +void HloScheduleProto_InstructionSequence::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloScheduleProto.InstructionSequence) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + instruction_ids_.Clear(); + _internal_metadata_.Clear(); +} + +bool HloScheduleProto_InstructionSequence::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloScheduleProto.InstructionSequence) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 instruction_ids = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_instruction_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_instruction_ids()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloScheduleProto.InstructionSequence) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloScheduleProto.InstructionSequence) + return false; +#undef DO_ +} + +void HloScheduleProto_InstructionSequence::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloScheduleProto.InstructionSequence) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 instruction_ids = 1; + if (this->instruction_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _instruction_ids_cached_byte_size_)); + } + for (int i = 0, n = this->instruction_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->instruction_ids(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloScheduleProto.InstructionSequence) +} + +::google::protobuf::uint8* HloScheduleProto_InstructionSequence::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloScheduleProto.InstructionSequence) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 instruction_ids = 1; + if (this->instruction_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _instruction_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->instruction_ids_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloScheduleProto.InstructionSequence) + return target; +} + +size_t HloScheduleProto_InstructionSequence::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloScheduleProto.InstructionSequence) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 instruction_ids = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->instruction_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _instruction_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloScheduleProto_InstructionSequence::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloScheduleProto.InstructionSequence) + GOOGLE_DCHECK_NE(&from, this); + const HloScheduleProto_InstructionSequence* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloScheduleProto.InstructionSequence) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloScheduleProto.InstructionSequence) + MergeFrom(*source); + } +} + +void HloScheduleProto_InstructionSequence::MergeFrom(const HloScheduleProto_InstructionSequence& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloScheduleProto.InstructionSequence) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + instruction_ids_.MergeFrom(from.instruction_ids_); +} + +void HloScheduleProto_InstructionSequence::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloScheduleProto.InstructionSequence) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloScheduleProto_InstructionSequence::CopyFrom(const HloScheduleProto_InstructionSequence& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloScheduleProto.InstructionSequence) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloScheduleProto_InstructionSequence::IsInitialized() const { + return true; +} + +void HloScheduleProto_InstructionSequence::Swap(HloScheduleProto_InstructionSequence* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloScheduleProto_InstructionSequence* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloScheduleProto_InstructionSequence::UnsafeArenaSwap(HloScheduleProto_InstructionSequence* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloScheduleProto_InstructionSequence::InternalSwap(HloScheduleProto_InstructionSequence* other) { + using std::swap; + instruction_ids_.InternalSwap(&other->instruction_ids_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloScheduleProto_InstructionSequence::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +HloScheduleProto_SequencesEntry_DoNotUse::HloScheduleProto_SequencesEntry_DoNotUse() {} +HloScheduleProto_SequencesEntry_DoNotUse::HloScheduleProto_SequencesEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void HloScheduleProto_SequencesEntry_DoNotUse::MergeFrom(const HloScheduleProto_SequencesEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata HloScheduleProto_SequencesEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[4]; +} +void HloScheduleProto_SequencesEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void HloScheduleProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloScheduleProto::kSequencesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloScheduleProto::HloScheduleProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloScheduleProto) +} +HloScheduleProto::HloScheduleProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + sequences_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloScheduleProto) +} +HloScheduleProto::HloScheduleProto(const HloScheduleProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + sequences_.MergeFrom(from.sequences_); + // @@protoc_insertion_point(copy_constructor:xla.HloScheduleProto) +} + +void HloScheduleProto::SharedCtor() { +} + +HloScheduleProto::~HloScheduleProto() { + // @@protoc_insertion_point(destructor:xla.HloScheduleProto) + SharedDtor(); +} + +void HloScheduleProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HloScheduleProto::ArenaDtor(void* object) { + HloScheduleProto* _this = reinterpret_cast< HloScheduleProto* >(object); + (void)_this; +} +void HloScheduleProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloScheduleProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloScheduleProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloScheduleProto& HloScheduleProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloScheduleProto.base); + return *internal_default_instance(); +} + + +void HloScheduleProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloScheduleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + sequences_.Clear(); + _internal_metadata_.Clear(); +} + +bool HloScheduleProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloScheduleProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map sequences = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + HloScheduleProto_SequencesEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + HloScheduleProto_SequencesEntry_DoNotUse, + ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence > > parser(&sequences_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloScheduleProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloScheduleProto) + return false; +#undef DO_ +} + +void HloScheduleProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloScheduleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map sequences = 1; + if (!this->sequences().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::int64, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (output->IsSerializationDeterministic() && + this->sequences().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->sequences().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::const_iterator + it = this->sequences().begin(); + it != this->sequences().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(sequences_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::const_iterator + it = this->sequences().begin(); + it != this->sequences().end(); ++it) { + entry.reset(sequences_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloScheduleProto) +} + +::google::protobuf::uint8* HloScheduleProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloScheduleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map sequences = 1; + if (!this->sequences().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::int64, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (deterministic && + this->sequences().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->sequences().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::const_iterator + it = this->sequences().begin(); + it != this->sequences().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(sequences_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::const_iterator + it = this->sequences().begin(); + it != this->sequences().end(); ++it) { + entry.reset(sequences_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloScheduleProto) + return target; +} + +size_t HloScheduleProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloScheduleProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map sequences = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->sequences_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >::const_iterator + it = this->sequences().begin(); + it != this->sequences().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(sequences_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloScheduleProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloScheduleProto) + GOOGLE_DCHECK_NE(&from, this); + const HloScheduleProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloScheduleProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloScheduleProto) + MergeFrom(*source); + } +} + +void HloScheduleProto::MergeFrom(const HloScheduleProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloScheduleProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + sequences_.MergeFrom(from.sequences_); +} + +void HloScheduleProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloScheduleProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloScheduleProto::CopyFrom(const HloScheduleProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloScheduleProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloScheduleProto::IsInitialized() const { + return true; +} + +void HloScheduleProto::Swap(HloScheduleProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloScheduleProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloScheduleProto::UnsafeArenaSwap(HloScheduleProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloScheduleProto::InternalSwap(HloScheduleProto* other) { + using std::swap; + sequences_.Swap(&other->sequences_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloScheduleProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloInputOutputAliasProto_AliasEntryProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloInputOutputAliasProto_AliasEntryProto::kOutputShapeIndexFieldNumber; +const int HloInputOutputAliasProto_AliasEntryProto::kParameterNumberFieldNumber; +const int HloInputOutputAliasProto_AliasEntryProto::kParameterShapeIndexFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloInputOutputAliasProto_AliasEntryProto::HloInputOutputAliasProto_AliasEntryProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto_AliasEntryProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloInputOutputAliasProto.AliasEntryProto) +} +HloInputOutputAliasProto_AliasEntryProto::HloInputOutputAliasProto_AliasEntryProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + output_shape_index_(arena), + parameter_shape_index_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto_AliasEntryProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloInputOutputAliasProto.AliasEntryProto) +} +HloInputOutputAliasProto_AliasEntryProto::HloInputOutputAliasProto_AliasEntryProto(const HloInputOutputAliasProto_AliasEntryProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + output_shape_index_(from.output_shape_index_), + parameter_shape_index_(from.parameter_shape_index_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + parameter_number_ = from.parameter_number_; + // @@protoc_insertion_point(copy_constructor:xla.HloInputOutputAliasProto.AliasEntryProto) +} + +void HloInputOutputAliasProto_AliasEntryProto::SharedCtor() { + parameter_number_ = GOOGLE_LONGLONG(0); +} + +HloInputOutputAliasProto_AliasEntryProto::~HloInputOutputAliasProto_AliasEntryProto() { + // @@protoc_insertion_point(destructor:xla.HloInputOutputAliasProto.AliasEntryProto) + SharedDtor(); +} + +void HloInputOutputAliasProto_AliasEntryProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HloInputOutputAliasProto_AliasEntryProto::ArenaDtor(void* object) { + HloInputOutputAliasProto_AliasEntryProto* _this = reinterpret_cast< HloInputOutputAliasProto_AliasEntryProto* >(object); + (void)_this; +} +void HloInputOutputAliasProto_AliasEntryProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloInputOutputAliasProto_AliasEntryProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloInputOutputAliasProto_AliasEntryProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloInputOutputAliasProto_AliasEntryProto& HloInputOutputAliasProto_AliasEntryProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto_AliasEntryProto.base); + return *internal_default_instance(); +} + + +void HloInputOutputAliasProto_AliasEntryProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloInputOutputAliasProto.AliasEntryProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + output_shape_index_.Clear(); + parameter_shape_index_.Clear(); + parameter_number_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool HloInputOutputAliasProto_AliasEntryProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloInputOutputAliasProto.AliasEntryProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 output_shape_index = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_output_shape_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_output_shape_index()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 parameter_number = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, ¶meter_number_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 parameter_shape_index = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_parameter_shape_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_parameter_shape_index()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloInputOutputAliasProto.AliasEntryProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloInputOutputAliasProto.AliasEntryProto) + return false; +#undef DO_ +} + +void HloInputOutputAliasProto_AliasEntryProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloInputOutputAliasProto.AliasEntryProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 output_shape_index = 1; + if (this->output_shape_index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _output_shape_index_cached_byte_size_)); + } + for (int i = 0, n = this->output_shape_index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->output_shape_index(i), output); + } + + // int64 parameter_number = 2; + if (this->parameter_number() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->parameter_number(), output); + } + + // repeated int64 parameter_shape_index = 3; + if (this->parameter_shape_index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _parameter_shape_index_cached_byte_size_)); + } + for (int i = 0, n = this->parameter_shape_index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->parameter_shape_index(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloInputOutputAliasProto.AliasEntryProto) +} + +::google::protobuf::uint8* HloInputOutputAliasProto_AliasEntryProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloInputOutputAliasProto.AliasEntryProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 output_shape_index = 1; + if (this->output_shape_index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _output_shape_index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->output_shape_index_, target); + } + + // int64 parameter_number = 2; + if (this->parameter_number() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->parameter_number(), target); + } + + // repeated int64 parameter_shape_index = 3; + if (this->parameter_shape_index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _parameter_shape_index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->parameter_shape_index_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloInputOutputAliasProto.AliasEntryProto) + return target; +} + +size_t HloInputOutputAliasProto_AliasEntryProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloInputOutputAliasProto.AliasEntryProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 output_shape_index = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->output_shape_index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _output_shape_index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 parameter_shape_index = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->parameter_shape_index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _parameter_shape_index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 parameter_number = 2; + if (this->parameter_number() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->parameter_number()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloInputOutputAliasProto_AliasEntryProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloInputOutputAliasProto.AliasEntryProto) + GOOGLE_DCHECK_NE(&from, this); + const HloInputOutputAliasProto_AliasEntryProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloInputOutputAliasProto.AliasEntryProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloInputOutputAliasProto.AliasEntryProto) + MergeFrom(*source); + } +} + +void HloInputOutputAliasProto_AliasEntryProto::MergeFrom(const HloInputOutputAliasProto_AliasEntryProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloInputOutputAliasProto.AliasEntryProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + output_shape_index_.MergeFrom(from.output_shape_index_); + parameter_shape_index_.MergeFrom(from.parameter_shape_index_); + if (from.parameter_number() != 0) { + set_parameter_number(from.parameter_number()); + } +} + +void HloInputOutputAliasProto_AliasEntryProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloInputOutputAliasProto.AliasEntryProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloInputOutputAliasProto_AliasEntryProto::CopyFrom(const HloInputOutputAliasProto_AliasEntryProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloInputOutputAliasProto.AliasEntryProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloInputOutputAliasProto_AliasEntryProto::IsInitialized() const { + return true; +} + +void HloInputOutputAliasProto_AliasEntryProto::Swap(HloInputOutputAliasProto_AliasEntryProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloInputOutputAliasProto_AliasEntryProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloInputOutputAliasProto_AliasEntryProto::UnsafeArenaSwap(HloInputOutputAliasProto_AliasEntryProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloInputOutputAliasProto_AliasEntryProto::InternalSwap(HloInputOutputAliasProto_AliasEntryProto* other) { + using std::swap; + output_shape_index_.InternalSwap(&other->output_shape_index_); + parameter_shape_index_.InternalSwap(&other->parameter_shape_index_); + swap(parameter_number_, other->parameter_number_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloInputOutputAliasProto_AliasEntryProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloInputOutputAliasProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloInputOutputAliasProto::kEntriesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloInputOutputAliasProto::HloInputOutputAliasProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloInputOutputAliasProto) +} +HloInputOutputAliasProto::HloInputOutputAliasProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + entries_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloInputOutputAliasProto) +} +HloInputOutputAliasProto::HloInputOutputAliasProto(const HloInputOutputAliasProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + entries_(from.entries_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.HloInputOutputAliasProto) +} + +void HloInputOutputAliasProto::SharedCtor() { +} + +HloInputOutputAliasProto::~HloInputOutputAliasProto() { + // @@protoc_insertion_point(destructor:xla.HloInputOutputAliasProto) + SharedDtor(); +} + +void HloInputOutputAliasProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HloInputOutputAliasProto::ArenaDtor(void* object) { + HloInputOutputAliasProto* _this = reinterpret_cast< HloInputOutputAliasProto* >(object); + (void)_this; +} +void HloInputOutputAliasProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloInputOutputAliasProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloInputOutputAliasProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloInputOutputAliasProto& HloInputOutputAliasProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloInputOutputAliasProto.base); + return *internal_default_instance(); +} + + +void HloInputOutputAliasProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloInputOutputAliasProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + entries_.Clear(); + _internal_metadata_.Clear(); +} + +bool HloInputOutputAliasProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloInputOutputAliasProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.HloInputOutputAliasProto.AliasEntryProto entries = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_entries())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloInputOutputAliasProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloInputOutputAliasProto) + return false; +#undef DO_ +} + +void HloInputOutputAliasProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloInputOutputAliasProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.HloInputOutputAliasProto.AliasEntryProto entries = 1; + for (unsigned int i = 0, + n = static_cast(this->entries_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->entries(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloInputOutputAliasProto) +} + +::google::protobuf::uint8* HloInputOutputAliasProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloInputOutputAliasProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.HloInputOutputAliasProto.AliasEntryProto entries = 1; + for (unsigned int i = 0, + n = static_cast(this->entries_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->entries(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloInputOutputAliasProto) + return target; +} + +size_t HloInputOutputAliasProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloInputOutputAliasProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HloInputOutputAliasProto.AliasEntryProto entries = 1; + { + unsigned int count = static_cast(this->entries_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->entries(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloInputOutputAliasProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloInputOutputAliasProto) + GOOGLE_DCHECK_NE(&from, this); + const HloInputOutputAliasProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloInputOutputAliasProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloInputOutputAliasProto) + MergeFrom(*source); + } +} + +void HloInputOutputAliasProto::MergeFrom(const HloInputOutputAliasProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloInputOutputAliasProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + entries_.MergeFrom(from.entries_); +} + +void HloInputOutputAliasProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloInputOutputAliasProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloInputOutputAliasProto::CopyFrom(const HloInputOutputAliasProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloInputOutputAliasProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloInputOutputAliasProto::IsInitialized() const { + return true; +} + +void HloInputOutputAliasProto::Swap(HloInputOutputAliasProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloInputOutputAliasProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloInputOutputAliasProto::UnsafeArenaSwap(HloInputOutputAliasProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloInputOutputAliasProto::InternalSwap(HloInputOutputAliasProto* other) { + using std::swap; + CastToBase(&entries_)->InternalSwap(CastToBase(&other->entries_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloInputOutputAliasProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DynamicParameterBindingProto_Binding::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DynamicParameterBindingProto_Binding::kDynamicParamNumFieldNumber; +const int DynamicParameterBindingProto_Binding::kDynamicParamIndexFieldNumber; +const int DynamicParameterBindingProto_Binding::kTargetParamNumFieldNumber; +const int DynamicParameterBindingProto_Binding::kTargetParamIndexFieldNumber; +const int DynamicParameterBindingProto_Binding::kTargetParamDimNumFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DynamicParameterBindingProto_Binding::DynamicParameterBindingProto_Binding() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto_Binding.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DynamicParameterBindingProto.Binding) +} +DynamicParameterBindingProto_Binding::DynamicParameterBindingProto_Binding(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dynamic_param_index_(arena), + target_param_index_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto_Binding.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.DynamicParameterBindingProto.Binding) +} +DynamicParameterBindingProto_Binding::DynamicParameterBindingProto_Binding(const DynamicParameterBindingProto_Binding& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dynamic_param_index_(from.dynamic_param_index_), + target_param_index_(from.target_param_index_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&dynamic_param_num_, &from.dynamic_param_num_, + static_cast(reinterpret_cast(&target_param_dim_num_) - + reinterpret_cast(&dynamic_param_num_)) + sizeof(target_param_dim_num_)); + // @@protoc_insertion_point(copy_constructor:xla.DynamicParameterBindingProto.Binding) +} + +void DynamicParameterBindingProto_Binding::SharedCtor() { + ::memset(&dynamic_param_num_, 0, static_cast( + reinterpret_cast(&target_param_dim_num_) - + reinterpret_cast(&dynamic_param_num_)) + sizeof(target_param_dim_num_)); +} + +DynamicParameterBindingProto_Binding::~DynamicParameterBindingProto_Binding() { + // @@protoc_insertion_point(destructor:xla.DynamicParameterBindingProto.Binding) + SharedDtor(); +} + +void DynamicParameterBindingProto_Binding::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DynamicParameterBindingProto_Binding::ArenaDtor(void* object) { + DynamicParameterBindingProto_Binding* _this = reinterpret_cast< DynamicParameterBindingProto_Binding* >(object); + (void)_this; +} +void DynamicParameterBindingProto_Binding::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DynamicParameterBindingProto_Binding::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DynamicParameterBindingProto_Binding::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DynamicParameterBindingProto_Binding& DynamicParameterBindingProto_Binding::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto_Binding.base); + return *internal_default_instance(); +} + + +void DynamicParameterBindingProto_Binding::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DynamicParameterBindingProto.Binding) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dynamic_param_index_.Clear(); + target_param_index_.Clear(); + ::memset(&dynamic_param_num_, 0, static_cast( + reinterpret_cast(&target_param_dim_num_) - + reinterpret_cast(&dynamic_param_num_)) + sizeof(target_param_dim_num_)); + _internal_metadata_.Clear(); +} + +bool DynamicParameterBindingProto_Binding::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DynamicParameterBindingProto.Binding) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 dynamic_param_num = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &dynamic_param_num_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 dynamic_param_index = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dynamic_param_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_dynamic_param_index()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 target_param_num = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &target_param_num_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 target_param_index = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_target_param_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 34u, input, this->mutable_target_param_index()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 target_param_dim_num = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &target_param_dim_num_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DynamicParameterBindingProto.Binding) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DynamicParameterBindingProto.Binding) + return false; +#undef DO_ +} + +void DynamicParameterBindingProto_Binding::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DynamicParameterBindingProto.Binding) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 dynamic_param_num = 1; + if (this->dynamic_param_num() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->dynamic_param_num(), output); + } + + // repeated int64 dynamic_param_index = 2; + if (this->dynamic_param_index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _dynamic_param_index_cached_byte_size_)); + } + for (int i = 0, n = this->dynamic_param_index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->dynamic_param_index(i), output); + } + + // int64 target_param_num = 3; + if (this->target_param_num() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->target_param_num(), output); + } + + // repeated int64 target_param_index = 4; + if (this->target_param_index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _target_param_index_cached_byte_size_)); + } + for (int i = 0, n = this->target_param_index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->target_param_index(i), output); + } + + // int64 target_param_dim_num = 5; + if (this->target_param_dim_num() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->target_param_dim_num(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DynamicParameterBindingProto.Binding) +} + +::google::protobuf::uint8* DynamicParameterBindingProto_Binding::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DynamicParameterBindingProto.Binding) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 dynamic_param_num = 1; + if (this->dynamic_param_num() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->dynamic_param_num(), target); + } + + // repeated int64 dynamic_param_index = 2; + if (this->dynamic_param_index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _dynamic_param_index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->dynamic_param_index_, target); + } + + // int64 target_param_num = 3; + if (this->target_param_num() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->target_param_num(), target); + } + + // repeated int64 target_param_index = 4; + if (this->target_param_index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _target_param_index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->target_param_index_, target); + } + + // int64 target_param_dim_num = 5; + if (this->target_param_dim_num() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->target_param_dim_num(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DynamicParameterBindingProto.Binding) + return target; +} + +size_t DynamicParameterBindingProto_Binding::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DynamicParameterBindingProto.Binding) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 dynamic_param_index = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->dynamic_param_index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dynamic_param_index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 target_param_index = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->target_param_index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _target_param_index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 dynamic_param_num = 1; + if (this->dynamic_param_num() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->dynamic_param_num()); + } + + // int64 target_param_num = 3; + if (this->target_param_num() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->target_param_num()); + } + + // int64 target_param_dim_num = 5; + if (this->target_param_dim_num() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->target_param_dim_num()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DynamicParameterBindingProto_Binding::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DynamicParameterBindingProto.Binding) + GOOGLE_DCHECK_NE(&from, this); + const DynamicParameterBindingProto_Binding* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DynamicParameterBindingProto.Binding) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DynamicParameterBindingProto.Binding) + MergeFrom(*source); + } +} + +void DynamicParameterBindingProto_Binding::MergeFrom(const DynamicParameterBindingProto_Binding& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DynamicParameterBindingProto.Binding) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dynamic_param_index_.MergeFrom(from.dynamic_param_index_); + target_param_index_.MergeFrom(from.target_param_index_); + if (from.dynamic_param_num() != 0) { + set_dynamic_param_num(from.dynamic_param_num()); + } + if (from.target_param_num() != 0) { + set_target_param_num(from.target_param_num()); + } + if (from.target_param_dim_num() != 0) { + set_target_param_dim_num(from.target_param_dim_num()); + } +} + +void DynamicParameterBindingProto_Binding::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DynamicParameterBindingProto.Binding) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DynamicParameterBindingProto_Binding::CopyFrom(const DynamicParameterBindingProto_Binding& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DynamicParameterBindingProto.Binding) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DynamicParameterBindingProto_Binding::IsInitialized() const { + return true; +} + +void DynamicParameterBindingProto_Binding::Swap(DynamicParameterBindingProto_Binding* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DynamicParameterBindingProto_Binding* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DynamicParameterBindingProto_Binding::UnsafeArenaSwap(DynamicParameterBindingProto_Binding* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DynamicParameterBindingProto_Binding::InternalSwap(DynamicParameterBindingProto_Binding* other) { + using std::swap; + dynamic_param_index_.InternalSwap(&other->dynamic_param_index_); + target_param_index_.InternalSwap(&other->target_param_index_); + swap(dynamic_param_num_, other->dynamic_param_num_); + swap(target_param_num_, other->target_param_num_); + swap(target_param_dim_num_, other->target_param_dim_num_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DynamicParameterBindingProto_Binding::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DynamicParameterBindingProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DynamicParameterBindingProto::kEntriesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DynamicParameterBindingProto::DynamicParameterBindingProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DynamicParameterBindingProto) +} +DynamicParameterBindingProto::DynamicParameterBindingProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + entries_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.DynamicParameterBindingProto) +} +DynamicParameterBindingProto::DynamicParameterBindingProto(const DynamicParameterBindingProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + entries_(from.entries_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.DynamicParameterBindingProto) +} + +void DynamicParameterBindingProto::SharedCtor() { +} + +DynamicParameterBindingProto::~DynamicParameterBindingProto() { + // @@protoc_insertion_point(destructor:xla.DynamicParameterBindingProto) + SharedDtor(); +} + +void DynamicParameterBindingProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DynamicParameterBindingProto::ArenaDtor(void* object) { + DynamicParameterBindingProto* _this = reinterpret_cast< DynamicParameterBindingProto* >(object); + (void)_this; +} +void DynamicParameterBindingProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DynamicParameterBindingProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DynamicParameterBindingProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DynamicParameterBindingProto& DynamicParameterBindingProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_DynamicParameterBindingProto.base); + return *internal_default_instance(); +} + + +void DynamicParameterBindingProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DynamicParameterBindingProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + entries_.Clear(); + _internal_metadata_.Clear(); +} + +bool DynamicParameterBindingProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DynamicParameterBindingProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.DynamicParameterBindingProto.Binding entries = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_entries())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DynamicParameterBindingProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DynamicParameterBindingProto) + return false; +#undef DO_ +} + +void DynamicParameterBindingProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DynamicParameterBindingProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.DynamicParameterBindingProto.Binding entries = 1; + for (unsigned int i = 0, + n = static_cast(this->entries_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->entries(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DynamicParameterBindingProto) +} + +::google::protobuf::uint8* DynamicParameterBindingProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DynamicParameterBindingProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.DynamicParameterBindingProto.Binding entries = 1; + for (unsigned int i = 0, + n = static_cast(this->entries_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->entries(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DynamicParameterBindingProto) + return target; +} + +size_t DynamicParameterBindingProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DynamicParameterBindingProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.DynamicParameterBindingProto.Binding entries = 1; + { + unsigned int count = static_cast(this->entries_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->entries(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DynamicParameterBindingProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DynamicParameterBindingProto) + GOOGLE_DCHECK_NE(&from, this); + const DynamicParameterBindingProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DynamicParameterBindingProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DynamicParameterBindingProto) + MergeFrom(*source); + } +} + +void DynamicParameterBindingProto::MergeFrom(const DynamicParameterBindingProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DynamicParameterBindingProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + entries_.MergeFrom(from.entries_); +} + +void DynamicParameterBindingProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DynamicParameterBindingProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DynamicParameterBindingProto::CopyFrom(const DynamicParameterBindingProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DynamicParameterBindingProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DynamicParameterBindingProto::IsInitialized() const { + return true; +} + +void DynamicParameterBindingProto::Swap(DynamicParameterBindingProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DynamicParameterBindingProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DynamicParameterBindingProto::UnsafeArenaSwap(DynamicParameterBindingProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DynamicParameterBindingProto::InternalSwap(DynamicParameterBindingProto* other) { + using std::swap; + CastToBase(&entries_)->InternalSwap(CastToBase(&other->entries_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DynamicParameterBindingProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloModuleProto::InitAsDefaultInstance() { + ::xla::_HloModuleProto_default_instance_._instance.get_mutable()->host_program_shape_ = const_cast< ::xla::ProgramShapeProto*>( + ::xla::ProgramShapeProto::internal_default_instance()); + ::xla::_HloModuleProto_default_instance_._instance.get_mutable()->schedule_ = const_cast< ::xla::HloScheduleProto*>( + ::xla::HloScheduleProto::internal_default_instance()); + ::xla::_HloModuleProto_default_instance_._instance.get_mutable()->input_output_alias_ = const_cast< ::xla::HloInputOutputAliasProto*>( + ::xla::HloInputOutputAliasProto::internal_default_instance()); + ::xla::_HloModuleProto_default_instance_._instance.get_mutable()->dynamic_parameter_binding_ = const_cast< ::xla::DynamicParameterBindingProto*>( + ::xla::DynamicParameterBindingProto::internal_default_instance()); +} +void HloModuleProto::unsafe_arena_set_allocated_host_program_shape( + ::xla::ProgramShapeProto* host_program_shape) { + if (GetArenaNoVirtual() == NULL) { + delete host_program_shape_; + } + host_program_shape_ = host_program_shape; + if (host_program_shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloModuleProto.host_program_shape) +} +void HloModuleProto::clear_host_program_shape() { + if (GetArenaNoVirtual() == NULL && host_program_shape_ != NULL) { + delete host_program_shape_; + } + host_program_shape_ = NULL; +} +void HloModuleProto::unsafe_arena_set_allocated_schedule( + ::xla::HloScheduleProto* schedule) { + if (GetArenaNoVirtual() == NULL) { + delete schedule_; + } + schedule_ = schedule; + if (schedule) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloModuleProto.schedule) +} +void HloModuleProto::unsafe_arena_set_allocated_input_output_alias( + ::xla::HloInputOutputAliasProto* input_output_alias) { + if (GetArenaNoVirtual() == NULL) { + delete input_output_alias_; + } + input_output_alias_ = input_output_alias; + if (input_output_alias) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloModuleProto.input_output_alias) +} +void HloModuleProto::unsafe_arena_set_allocated_dynamic_parameter_binding( + ::xla::DynamicParameterBindingProto* dynamic_parameter_binding) { + if (GetArenaNoVirtual() == NULL) { + delete dynamic_parameter_binding_; + } + dynamic_parameter_binding_ = dynamic_parameter_binding; + if (dynamic_parameter_binding) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloModuleProto.dynamic_parameter_binding) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloModuleProto::kNameFieldNumber; +const int HloModuleProto::kEntryComputationNameFieldNumber; +const int HloModuleProto::kEntryComputationIdFieldNumber; +const int HloModuleProto::kComputationsFieldNumber; +const int HloModuleProto::kHostProgramShapeFieldNumber; +const int HloModuleProto::kIdFieldNumber; +const int HloModuleProto::kScheduleFieldNumber; +const int HloModuleProto::kInputOutputAliasFieldNumber; +const int HloModuleProto::kDynamicParameterBindingFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloModuleProto::HloModuleProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloModuleProto) +} +HloModuleProto::HloModuleProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + computations_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloModuleProto) +} +HloModuleProto::HloModuleProto(const HloModuleProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + computations_(from.computations_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + entry_computation_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.entry_computation_name().size() > 0) { + entry_computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.entry_computation_name(), + GetArenaNoVirtual()); + } + if (from.has_host_program_shape()) { + host_program_shape_ = new ::xla::ProgramShapeProto(*from.host_program_shape_); + } else { + host_program_shape_ = NULL; + } + if (from.has_schedule()) { + schedule_ = new ::xla::HloScheduleProto(*from.schedule_); + } else { + schedule_ = NULL; + } + if (from.has_input_output_alias()) { + input_output_alias_ = new ::xla::HloInputOutputAliasProto(*from.input_output_alias_); + } else { + input_output_alias_ = NULL; + } + if (from.has_dynamic_parameter_binding()) { + dynamic_parameter_binding_ = new ::xla::DynamicParameterBindingProto(*from.dynamic_parameter_binding_); + } else { + dynamic_parameter_binding_ = NULL; + } + ::memcpy(&id_, &from.id_, + static_cast(reinterpret_cast(&entry_computation_id_) - + reinterpret_cast(&id_)) + sizeof(entry_computation_id_)); + // @@protoc_insertion_point(copy_constructor:xla.HloModuleProto) +} + +void HloModuleProto::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + entry_computation_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&host_program_shape_, 0, static_cast( + reinterpret_cast(&entry_computation_id_) - + reinterpret_cast(&host_program_shape_)) + sizeof(entry_computation_id_)); +} + +HloModuleProto::~HloModuleProto() { + // @@protoc_insertion_point(destructor:xla.HloModuleProto) + SharedDtor(); +} + +void HloModuleProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + entry_computation_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete host_program_shape_; + if (this != internal_default_instance()) delete schedule_; + if (this != internal_default_instance()) delete input_output_alias_; + if (this != internal_default_instance()) delete dynamic_parameter_binding_; +} + +void HloModuleProto::ArenaDtor(void* object) { + HloModuleProto* _this = reinterpret_cast< HloModuleProto* >(object); + (void)_this; +} +void HloModuleProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloModuleProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloModuleProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloModuleProto& HloModuleProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base); + return *internal_default_instance(); +} + + +void HloModuleProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloModuleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + computations_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + entry_computation_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && host_program_shape_ != NULL) { + delete host_program_shape_; + } + host_program_shape_ = NULL; + if (GetArenaNoVirtual() == NULL && schedule_ != NULL) { + delete schedule_; + } + schedule_ = NULL; + if (GetArenaNoVirtual() == NULL && input_output_alias_ != NULL) { + delete input_output_alias_; + } + input_output_alias_ = NULL; + if (GetArenaNoVirtual() == NULL && dynamic_parameter_binding_ != NULL) { + delete dynamic_parameter_binding_; + } + dynamic_parameter_binding_ = NULL; + ::memset(&id_, 0, static_cast( + reinterpret_cast(&entry_computation_id_) - + reinterpret_cast(&id_)) + sizeof(entry_computation_id_)); + _internal_metadata_.Clear(); +} + +bool HloModuleProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloModuleProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloModuleProto.name")); + } else { + goto handle_unusual; + } + break; + } + + // string entry_computation_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_entry_computation_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->entry_computation_name().data(), static_cast(this->entry_computation_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloModuleProto.entry_computation_name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HloComputationProto computations = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_computations())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ProgramShapeProto host_program_shape = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_host_program_shape())); + } else { + goto handle_unusual; + } + break; + } + + // int64 id = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 entry_computation_id = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &entry_computation_id_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.HloScheduleProto schedule = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_schedule())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.HloInputOutputAliasProto input_output_alias = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_input_output_alias())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DynamicParameterBindingProto dynamic_parameter_binding = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dynamic_parameter_binding())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloModuleProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloModuleProto) + return false; +#undef DO_ +} + +void HloModuleProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloModuleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloModuleProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string entry_computation_name = 2; + if (this->entry_computation_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->entry_computation_name().data(), static_cast(this->entry_computation_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloModuleProto.entry_computation_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->entry_computation_name(), output); + } + + // repeated .xla.HloComputationProto computations = 3; + for (unsigned int i = 0, + n = static_cast(this->computations_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->computations(static_cast(i)), + output); + } + + // .xla.ProgramShapeProto host_program_shape = 4; + if (this->has_host_program_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_host_program_shape(), output); + } + + // int64 id = 5; + if (this->id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->id(), output); + } + + // int64 entry_computation_id = 6; + if (this->entry_computation_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->entry_computation_id(), output); + } + + // .xla.HloScheduleProto schedule = 7; + if (this->has_schedule()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->_internal_schedule(), output); + } + + // .xla.HloInputOutputAliasProto input_output_alias = 8; + if (this->has_input_output_alias()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_input_output_alias(), output); + } + + // .xla.DynamicParameterBindingProto dynamic_parameter_binding = 9; + if (this->has_dynamic_parameter_binding()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->_internal_dynamic_parameter_binding(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloModuleProto) +} + +::google::protobuf::uint8* HloModuleProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloModuleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloModuleProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string entry_computation_name = 2; + if (this->entry_computation_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->entry_computation_name().data(), static_cast(this->entry_computation_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloModuleProto.entry_computation_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->entry_computation_name(), target); + } + + // repeated .xla.HloComputationProto computations = 3; + for (unsigned int i = 0, + n = static_cast(this->computations_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->computations(static_cast(i)), deterministic, target); + } + + // .xla.ProgramShapeProto host_program_shape = 4; + if (this->has_host_program_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_host_program_shape(), deterministic, target); + } + + // int64 id = 5; + if (this->id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->id(), target); + } + + // int64 entry_computation_id = 6; + if (this->entry_computation_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->entry_computation_id(), target); + } + + // .xla.HloScheduleProto schedule = 7; + if (this->has_schedule()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->_internal_schedule(), deterministic, target); + } + + // .xla.HloInputOutputAliasProto input_output_alias = 8; + if (this->has_input_output_alias()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_input_output_alias(), deterministic, target); + } + + // .xla.DynamicParameterBindingProto dynamic_parameter_binding = 9; + if (this->has_dynamic_parameter_binding()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 9, this->_internal_dynamic_parameter_binding(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloModuleProto) + return target; +} + +size_t HloModuleProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloModuleProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HloComputationProto computations = 3; + { + unsigned int count = static_cast(this->computations_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->computations(static_cast(i))); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string entry_computation_name = 2; + if (this->entry_computation_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->entry_computation_name()); + } + + // .xla.ProgramShapeProto host_program_shape = 4; + if (this->has_host_program_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *host_program_shape_); + } + + // .xla.HloScheduleProto schedule = 7; + if (this->has_schedule()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *schedule_); + } + + // .xla.HloInputOutputAliasProto input_output_alias = 8; + if (this->has_input_output_alias()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *input_output_alias_); + } + + // .xla.DynamicParameterBindingProto dynamic_parameter_binding = 9; + if (this->has_dynamic_parameter_binding()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *dynamic_parameter_binding_); + } + + // int64 id = 5; + if (this->id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + // int64 entry_computation_id = 6; + if (this->entry_computation_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->entry_computation_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloModuleProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloModuleProto) + GOOGLE_DCHECK_NE(&from, this); + const HloModuleProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloModuleProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloModuleProto) + MergeFrom(*source); + } +} + +void HloModuleProto::MergeFrom(const HloModuleProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloModuleProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + computations_.MergeFrom(from.computations_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.entry_computation_name().size() > 0) { + set_entry_computation_name(from.entry_computation_name()); + } + if (from.has_host_program_shape()) { + mutable_host_program_shape()->::xla::ProgramShapeProto::MergeFrom(from.host_program_shape()); + } + if (from.has_schedule()) { + mutable_schedule()->::xla::HloScheduleProto::MergeFrom(from.schedule()); + } + if (from.has_input_output_alias()) { + mutable_input_output_alias()->::xla::HloInputOutputAliasProto::MergeFrom(from.input_output_alias()); + } + if (from.has_dynamic_parameter_binding()) { + mutable_dynamic_parameter_binding()->::xla::DynamicParameterBindingProto::MergeFrom(from.dynamic_parameter_binding()); + } + if (from.id() != 0) { + set_id(from.id()); + } + if (from.entry_computation_id() != 0) { + set_entry_computation_id(from.entry_computation_id()); + } +} + +void HloModuleProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloModuleProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloModuleProto::CopyFrom(const HloModuleProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloModuleProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloModuleProto::IsInitialized() const { + return true; +} + +void HloModuleProto::Swap(HloModuleProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloModuleProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloModuleProto::UnsafeArenaSwap(HloModuleProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloModuleProto::InternalSwap(HloModuleProto* other) { + using std::swap; + CastToBase(&computations_)->InternalSwap(CastToBase(&other->computations_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + entry_computation_name_.Swap(&other->entry_computation_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(host_program_shape_, other->host_program_shape_); + swap(schedule_, other->schedule_); + swap(input_output_alias_, other->input_output_alias_); + swap(dynamic_parameter_binding_, other->dynamic_parameter_binding_); + swap(id_, other->id_); + swap(entry_computation_id_, other->entry_computation_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloModuleProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LogicalBufferProto_Location::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LogicalBufferProto_Location::kComputationNameFieldNumber; +const int LogicalBufferProto_Location::kInstructionNameFieldNumber; +const int LogicalBufferProto_Location::kShapeIndexFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LogicalBufferProto_Location::LogicalBufferProto_Location() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto_Location.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.LogicalBufferProto.Location) +} +LogicalBufferProto_Location::LogicalBufferProto_Location(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + shape_index_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto_Location.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.LogicalBufferProto.Location) +} +LogicalBufferProto_Location::LogicalBufferProto_Location(const LogicalBufferProto_Location& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + shape_index_(from.shape_index_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + computation_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.computation_name().size() > 0) { + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.computation_name(), + GetArenaNoVirtual()); + } + instruction_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.instruction_name().size() > 0) { + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.instruction_name(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:xla.LogicalBufferProto.Location) +} + +void LogicalBufferProto_Location::SharedCtor() { + computation_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + instruction_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +LogicalBufferProto_Location::~LogicalBufferProto_Location() { + // @@protoc_insertion_point(destructor:xla.LogicalBufferProto.Location) + SharedDtor(); +} + +void LogicalBufferProto_Location::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + computation_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + instruction_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void LogicalBufferProto_Location::ArenaDtor(void* object) { + LogicalBufferProto_Location* _this = reinterpret_cast< LogicalBufferProto_Location* >(object); + (void)_this; +} +void LogicalBufferProto_Location::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LogicalBufferProto_Location::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LogicalBufferProto_Location::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LogicalBufferProto_Location& LogicalBufferProto_Location::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto_Location.base); + return *internal_default_instance(); +} + + +void LogicalBufferProto_Location::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.LogicalBufferProto.Location) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + shape_index_.Clear(); + computation_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + instruction_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool LogicalBufferProto_Location::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.LogicalBufferProto.Location) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string computation_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_computation_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->computation_name().data(), static_cast(this->computation_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.LogicalBufferProto.Location.computation_name")); + } else { + goto handle_unusual; + } + break; + } + + // string instruction_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_instruction_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->instruction_name().data(), static_cast(this->instruction_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.LogicalBufferProto.Location.instruction_name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 shape_index = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_shape_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_shape_index()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.LogicalBufferProto.Location) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.LogicalBufferProto.Location) + return false; +#undef DO_ +} + +void LogicalBufferProto_Location::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.LogicalBufferProto.Location) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string computation_name = 1; + if (this->computation_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->computation_name().data(), static_cast(this->computation_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LogicalBufferProto.Location.computation_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->computation_name(), output); + } + + // string instruction_name = 2; + if (this->instruction_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->instruction_name().data(), static_cast(this->instruction_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LogicalBufferProto.Location.instruction_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->instruction_name(), output); + } + + // repeated int64 shape_index = 3; + if (this->shape_index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _shape_index_cached_byte_size_)); + } + for (int i = 0, n = this->shape_index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->shape_index(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.LogicalBufferProto.Location) +} + +::google::protobuf::uint8* LogicalBufferProto_Location::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.LogicalBufferProto.Location) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string computation_name = 1; + if (this->computation_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->computation_name().data(), static_cast(this->computation_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LogicalBufferProto.Location.computation_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->computation_name(), target); + } + + // string instruction_name = 2; + if (this->instruction_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->instruction_name().data(), static_cast(this->instruction_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LogicalBufferProto.Location.instruction_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->instruction_name(), target); + } + + // repeated int64 shape_index = 3; + if (this->shape_index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _shape_index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->shape_index_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.LogicalBufferProto.Location) + return target; +} + +size_t LogicalBufferProto_Location::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.LogicalBufferProto.Location) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 shape_index = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->shape_index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _shape_index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string computation_name = 1; + if (this->computation_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->computation_name()); + } + + // string instruction_name = 2; + if (this->instruction_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->instruction_name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LogicalBufferProto_Location::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.LogicalBufferProto.Location) + GOOGLE_DCHECK_NE(&from, this); + const LogicalBufferProto_Location* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.LogicalBufferProto.Location) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.LogicalBufferProto.Location) + MergeFrom(*source); + } +} + +void LogicalBufferProto_Location::MergeFrom(const LogicalBufferProto_Location& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.LogicalBufferProto.Location) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + shape_index_.MergeFrom(from.shape_index_); + if (from.computation_name().size() > 0) { + set_computation_name(from.computation_name()); + } + if (from.instruction_name().size() > 0) { + set_instruction_name(from.instruction_name()); + } +} + +void LogicalBufferProto_Location::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.LogicalBufferProto.Location) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LogicalBufferProto_Location::CopyFrom(const LogicalBufferProto_Location& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.LogicalBufferProto.Location) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LogicalBufferProto_Location::IsInitialized() const { + return true; +} + +void LogicalBufferProto_Location::Swap(LogicalBufferProto_Location* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LogicalBufferProto_Location* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LogicalBufferProto_Location::UnsafeArenaSwap(LogicalBufferProto_Location* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LogicalBufferProto_Location::InternalSwap(LogicalBufferProto_Location* other) { + using std::swap; + shape_index_.InternalSwap(&other->shape_index_); + computation_name_.Swap(&other->computation_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + instruction_name_.Swap(&other->instruction_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LogicalBufferProto_Location::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LogicalBufferProto::InitAsDefaultInstance() { + ::xla::_LogicalBufferProto_default_instance_._instance.get_mutable()->defined_at_ = const_cast< ::xla::LogicalBufferProto_Location*>( + ::xla::LogicalBufferProto_Location::internal_default_instance()); +} +void LogicalBufferProto::unsafe_arena_set_allocated_defined_at( + ::xla::LogicalBufferProto_Location* defined_at) { + if (GetArenaNoVirtual() == NULL) { + delete defined_at_; + } + defined_at_ = defined_at; + if (defined_at) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LogicalBufferProto.defined_at) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LogicalBufferProto::kIdFieldNumber; +const int LogicalBufferProto::kSizeFieldNumber; +const int LogicalBufferProto::kDefinedAtFieldNumber; +const int LogicalBufferProto::kColorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LogicalBufferProto::LogicalBufferProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.LogicalBufferProto) +} +LogicalBufferProto::LogicalBufferProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.LogicalBufferProto) +} +LogicalBufferProto::LogicalBufferProto(const LogicalBufferProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_defined_at()) { + defined_at_ = new ::xla::LogicalBufferProto_Location(*from.defined_at_); + } else { + defined_at_ = NULL; + } + ::memcpy(&id_, &from.id_, + static_cast(reinterpret_cast(&color_) - + reinterpret_cast(&id_)) + sizeof(color_)); + // @@protoc_insertion_point(copy_constructor:xla.LogicalBufferProto) +} + +void LogicalBufferProto::SharedCtor() { + ::memset(&defined_at_, 0, static_cast( + reinterpret_cast(&color_) - + reinterpret_cast(&defined_at_)) + sizeof(color_)); +} + +LogicalBufferProto::~LogicalBufferProto() { + // @@protoc_insertion_point(destructor:xla.LogicalBufferProto) + SharedDtor(); +} + +void LogicalBufferProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete defined_at_; +} + +void LogicalBufferProto::ArenaDtor(void* object) { + LogicalBufferProto* _this = reinterpret_cast< LogicalBufferProto* >(object); + (void)_this; +} +void LogicalBufferProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LogicalBufferProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LogicalBufferProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LogicalBufferProto& LogicalBufferProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_LogicalBufferProto.base); + return *internal_default_instance(); +} + + +void LogicalBufferProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.LogicalBufferProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && defined_at_ != NULL) { + delete defined_at_; + } + defined_at_ = NULL; + ::memset(&id_, 0, static_cast( + reinterpret_cast(&color_) - + reinterpret_cast(&id_)) + sizeof(color_)); + _internal_metadata_.Clear(); +} + +bool LogicalBufferProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.LogicalBufferProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 size = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &size_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.LogicalBufferProto.Location defined_at = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_defined_at())); + } else { + goto handle_unusual; + } + break; + } + + // int64 color = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &color_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.LogicalBufferProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.LogicalBufferProto) + return false; +#undef DO_ +} + +void LogicalBufferProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.LogicalBufferProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 id = 1; + if (this->id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output); + } + + // int64 size = 2; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->size(), output); + } + + // .xla.LogicalBufferProto.Location defined_at = 3; + if (this->has_defined_at()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_defined_at(), output); + } + + // int64 color = 4; + if (this->color() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->color(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.LogicalBufferProto) +} + +::google::protobuf::uint8* LogicalBufferProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.LogicalBufferProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 id = 1; + if (this->id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target); + } + + // int64 size = 2; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->size(), target); + } + + // .xla.LogicalBufferProto.Location defined_at = 3; + if (this->has_defined_at()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_defined_at(), deterministic, target); + } + + // int64 color = 4; + if (this->color() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->color(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.LogicalBufferProto) + return target; +} + +size_t LogicalBufferProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.LogicalBufferProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LogicalBufferProto.Location defined_at = 3; + if (this->has_defined_at()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *defined_at_); + } + + // int64 id = 1; + if (this->id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + // int64 size = 2; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->size()); + } + + // int64 color = 4; + if (this->color() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->color()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LogicalBufferProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.LogicalBufferProto) + GOOGLE_DCHECK_NE(&from, this); + const LogicalBufferProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.LogicalBufferProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.LogicalBufferProto) + MergeFrom(*source); + } +} + +void LogicalBufferProto::MergeFrom(const LogicalBufferProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.LogicalBufferProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_defined_at()) { + mutable_defined_at()->::xla::LogicalBufferProto_Location::MergeFrom(from.defined_at()); + } + if (from.id() != 0) { + set_id(from.id()); + } + if (from.size() != 0) { + set_size(from.size()); + } + if (from.color() != 0) { + set_color(from.color()); + } +} + +void LogicalBufferProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.LogicalBufferProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LogicalBufferProto::CopyFrom(const LogicalBufferProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.LogicalBufferProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LogicalBufferProto::IsInitialized() const { + return true; +} + +void LogicalBufferProto::Swap(LogicalBufferProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LogicalBufferProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LogicalBufferProto::UnsafeArenaSwap(LogicalBufferProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LogicalBufferProto::InternalSwap(LogicalBufferProto* other) { + using std::swap; + swap(defined_at_, other->defined_at_); + swap(id_, other->id_); + swap(size_, other->size_); + swap(color_, other->color_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LogicalBufferProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void BufferAllocationProto_Assigned::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BufferAllocationProto_Assigned::kLogicalBufferIdFieldNumber; +const int BufferAllocationProto_Assigned::kOffsetFieldNumber; +const int BufferAllocationProto_Assigned::kSizeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BufferAllocationProto_Assigned::BufferAllocationProto_Assigned() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto_Assigned.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.BufferAllocationProto.Assigned) +} +BufferAllocationProto_Assigned::BufferAllocationProto_Assigned(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto_Assigned.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.BufferAllocationProto.Assigned) +} +BufferAllocationProto_Assigned::BufferAllocationProto_Assigned(const BufferAllocationProto_Assigned& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&logical_buffer_id_, &from.logical_buffer_id_, + static_cast(reinterpret_cast(&size_) - + reinterpret_cast(&logical_buffer_id_)) + sizeof(size_)); + // @@protoc_insertion_point(copy_constructor:xla.BufferAllocationProto.Assigned) +} + +void BufferAllocationProto_Assigned::SharedCtor() { + ::memset(&logical_buffer_id_, 0, static_cast( + reinterpret_cast(&size_) - + reinterpret_cast(&logical_buffer_id_)) + sizeof(size_)); +} + +BufferAllocationProto_Assigned::~BufferAllocationProto_Assigned() { + // @@protoc_insertion_point(destructor:xla.BufferAllocationProto.Assigned) + SharedDtor(); +} + +void BufferAllocationProto_Assigned::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void BufferAllocationProto_Assigned::ArenaDtor(void* object) { + BufferAllocationProto_Assigned* _this = reinterpret_cast< BufferAllocationProto_Assigned* >(object); + (void)_this; +} +void BufferAllocationProto_Assigned::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BufferAllocationProto_Assigned::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BufferAllocationProto_Assigned::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BufferAllocationProto_Assigned& BufferAllocationProto_Assigned::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto_Assigned.base); + return *internal_default_instance(); +} + + +void BufferAllocationProto_Assigned::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.BufferAllocationProto.Assigned) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&logical_buffer_id_, 0, static_cast( + reinterpret_cast(&size_) - + reinterpret_cast(&logical_buffer_id_)) + sizeof(size_)); + _internal_metadata_.Clear(); +} + +bool BufferAllocationProto_Assigned::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.BufferAllocationProto.Assigned) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 logical_buffer_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &logical_buffer_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 offset = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &offset_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 size = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &size_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.BufferAllocationProto.Assigned) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.BufferAllocationProto.Assigned) + return false; +#undef DO_ +} + +void BufferAllocationProto_Assigned::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.BufferAllocationProto.Assigned) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 logical_buffer_id = 1; + if (this->logical_buffer_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->logical_buffer_id(), output); + } + + // int64 offset = 2; + if (this->offset() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->offset(), output); + } + + // int64 size = 3; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.BufferAllocationProto.Assigned) +} + +::google::protobuf::uint8* BufferAllocationProto_Assigned::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.BufferAllocationProto.Assigned) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 logical_buffer_id = 1; + if (this->logical_buffer_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->logical_buffer_id(), target); + } + + // int64 offset = 2; + if (this->offset() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->offset(), target); + } + + // int64 size = 3; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->size(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.BufferAllocationProto.Assigned) + return target; +} + +size_t BufferAllocationProto_Assigned::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.BufferAllocationProto.Assigned) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 logical_buffer_id = 1; + if (this->logical_buffer_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->logical_buffer_id()); + } + + // int64 offset = 2; + if (this->offset() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->offset()); + } + + // int64 size = 3; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->size()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BufferAllocationProto_Assigned::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.BufferAllocationProto.Assigned) + GOOGLE_DCHECK_NE(&from, this); + const BufferAllocationProto_Assigned* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.BufferAllocationProto.Assigned) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.BufferAllocationProto.Assigned) + MergeFrom(*source); + } +} + +void BufferAllocationProto_Assigned::MergeFrom(const BufferAllocationProto_Assigned& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.BufferAllocationProto.Assigned) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.logical_buffer_id() != 0) { + set_logical_buffer_id(from.logical_buffer_id()); + } + if (from.offset() != 0) { + set_offset(from.offset()); + } + if (from.size() != 0) { + set_size(from.size()); + } +} + +void BufferAllocationProto_Assigned::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.BufferAllocationProto.Assigned) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BufferAllocationProto_Assigned::CopyFrom(const BufferAllocationProto_Assigned& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.BufferAllocationProto.Assigned) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BufferAllocationProto_Assigned::IsInitialized() const { + return true; +} + +void BufferAllocationProto_Assigned::Swap(BufferAllocationProto_Assigned* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BufferAllocationProto_Assigned* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BufferAllocationProto_Assigned::UnsafeArenaSwap(BufferAllocationProto_Assigned* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BufferAllocationProto_Assigned::InternalSwap(BufferAllocationProto_Assigned* other) { + using std::swap; + swap(logical_buffer_id_, other->logical_buffer_id_); + swap(offset_, other->offset_); + swap(size_, other->size_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BufferAllocationProto_Assigned::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void BufferAllocationProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BufferAllocationProto::kIndexFieldNumber; +const int BufferAllocationProto::kSizeFieldNumber; +const int BufferAllocationProto::kIsThreadLocalFieldNumber; +const int BufferAllocationProto::kIsTupleFieldNumber; +const int BufferAllocationProto::kIsEntryComputationParameterFieldNumber; +const int BufferAllocationProto::kIsConstantFieldNumber; +const int BufferAllocationProto::kParameterNumberFieldNumber; +const int BufferAllocationProto::kParameterShapeIndexFieldNumber; +const int BufferAllocationProto::kMaybeLiveOutFieldNumber; +const int BufferAllocationProto::kColorFieldNumber; +const int BufferAllocationProto::kAssignedFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BufferAllocationProto::BufferAllocationProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.BufferAllocationProto) +} +BufferAllocationProto::BufferAllocationProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + assigned_(arena), + parameter_shape_index_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.BufferAllocationProto) +} +BufferAllocationProto::BufferAllocationProto(const BufferAllocationProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + assigned_(from.assigned_), + parameter_shape_index_(from.parameter_shape_index_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&index_, &from.index_, + static_cast(reinterpret_cast(&color_) - + reinterpret_cast(&index_)) + sizeof(color_)); + // @@protoc_insertion_point(copy_constructor:xla.BufferAllocationProto) +} + +void BufferAllocationProto::SharedCtor() { + ::memset(&index_, 0, static_cast( + reinterpret_cast(&color_) - + reinterpret_cast(&index_)) + sizeof(color_)); +} + +BufferAllocationProto::~BufferAllocationProto() { + // @@protoc_insertion_point(destructor:xla.BufferAllocationProto) + SharedDtor(); +} + +void BufferAllocationProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void BufferAllocationProto::ArenaDtor(void* object) { + BufferAllocationProto* _this = reinterpret_cast< BufferAllocationProto* >(object); + (void)_this; +} +void BufferAllocationProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BufferAllocationProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BufferAllocationProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BufferAllocationProto& BufferAllocationProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAllocationProto.base); + return *internal_default_instance(); +} + + +void BufferAllocationProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.BufferAllocationProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + assigned_.Clear(); + parameter_shape_index_.Clear(); + ::memset(&index_, 0, static_cast( + reinterpret_cast(&color_) - + reinterpret_cast(&index_)) + sizeof(color_)); + _internal_metadata_.Clear(); +} + +bool BufferAllocationProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.BufferAllocationProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 index = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &index_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 size = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &size_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_thread_local = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_thread_local_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_entry_computation_parameter = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_entry_computation_parameter_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 parameter_number = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, ¶meter_number_))); + } else { + goto handle_unusual; + } + break; + } + + // bool maybe_live_out = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &maybe_live_out_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 color = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &color_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.BufferAllocationProto.Assigned assigned = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_assigned())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 parameter_shape_index = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_parameter_shape_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 82u, input, this->mutable_parameter_shape_index()))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_tuple = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_tuple_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_constant = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_constant_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.BufferAllocationProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.BufferAllocationProto) + return false; +#undef DO_ +} + +void BufferAllocationProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.BufferAllocationProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 index = 1; + if (this->index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->index(), output); + } + + // int64 size = 2; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->size(), output); + } + + // bool is_thread_local = 3; + if (this->is_thread_local() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->is_thread_local(), output); + } + + // bool is_entry_computation_parameter = 5; + if (this->is_entry_computation_parameter() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->is_entry_computation_parameter(), output); + } + + // int64 parameter_number = 6; + if (this->parameter_number() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->parameter_number(), output); + } + + // bool maybe_live_out = 7; + if (this->maybe_live_out() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->maybe_live_out(), output); + } + + // int64 color = 8; + if (this->color() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(8, this->color(), output); + } + + // repeated .xla.BufferAllocationProto.Assigned assigned = 9; + for (unsigned int i = 0, + n = static_cast(this->assigned_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, + this->assigned(static_cast(i)), + output); + } + + // repeated int64 parameter_shape_index = 10; + if (this->parameter_shape_index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _parameter_shape_index_cached_byte_size_)); + } + for (int i = 0, n = this->parameter_shape_index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->parameter_shape_index(i), output); + } + + // bool is_tuple = 11; + if (this->is_tuple() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->is_tuple(), output); + } + + // bool is_constant = 12; + if (this->is_constant() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->is_constant(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.BufferAllocationProto) +} + +::google::protobuf::uint8* BufferAllocationProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.BufferAllocationProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 index = 1; + if (this->index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->index(), target); + } + + // int64 size = 2; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->size(), target); + } + + // bool is_thread_local = 3; + if (this->is_thread_local() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->is_thread_local(), target); + } + + // bool is_entry_computation_parameter = 5; + if (this->is_entry_computation_parameter() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->is_entry_computation_parameter(), target); + } + + // int64 parameter_number = 6; + if (this->parameter_number() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->parameter_number(), target); + } + + // bool maybe_live_out = 7; + if (this->maybe_live_out() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->maybe_live_out(), target); + } + + // int64 color = 8; + if (this->color() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(8, this->color(), target); + } + + // repeated .xla.BufferAllocationProto.Assigned assigned = 9; + for (unsigned int i = 0, + n = static_cast(this->assigned_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 9, this->assigned(static_cast(i)), deterministic, target); + } + + // repeated int64 parameter_shape_index = 10; + if (this->parameter_shape_index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _parameter_shape_index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->parameter_shape_index_, target); + } + + // bool is_tuple = 11; + if (this->is_tuple() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(11, this->is_tuple(), target); + } + + // bool is_constant = 12; + if (this->is_constant() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->is_constant(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.BufferAllocationProto) + return target; +} + +size_t BufferAllocationProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.BufferAllocationProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.BufferAllocationProto.Assigned assigned = 9; + { + unsigned int count = static_cast(this->assigned_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->assigned(static_cast(i))); + } + } + + // repeated int64 parameter_shape_index = 10; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->parameter_shape_index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _parameter_shape_index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 index = 1; + if (this->index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->index()); + } + + // int64 size = 2; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->size()); + } + + // int64 parameter_number = 6; + if (this->parameter_number() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->parameter_number()); + } + + // bool maybe_live_out = 7; + if (this->maybe_live_out() != 0) { + total_size += 1 + 1; + } + + // bool is_thread_local = 3; + if (this->is_thread_local() != 0) { + total_size += 1 + 1; + } + + // bool is_tuple = 11; + if (this->is_tuple() != 0) { + total_size += 1 + 1; + } + + // bool is_entry_computation_parameter = 5; + if (this->is_entry_computation_parameter() != 0) { + total_size += 1 + 1; + } + + // bool is_constant = 12; + if (this->is_constant() != 0) { + total_size += 1 + 1; + } + + // int64 color = 8; + if (this->color() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->color()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BufferAllocationProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.BufferAllocationProto) + GOOGLE_DCHECK_NE(&from, this); + const BufferAllocationProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.BufferAllocationProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.BufferAllocationProto) + MergeFrom(*source); + } +} + +void BufferAllocationProto::MergeFrom(const BufferAllocationProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.BufferAllocationProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + assigned_.MergeFrom(from.assigned_); + parameter_shape_index_.MergeFrom(from.parameter_shape_index_); + if (from.index() != 0) { + set_index(from.index()); + } + if (from.size() != 0) { + set_size(from.size()); + } + if (from.parameter_number() != 0) { + set_parameter_number(from.parameter_number()); + } + if (from.maybe_live_out() != 0) { + set_maybe_live_out(from.maybe_live_out()); + } + if (from.is_thread_local() != 0) { + set_is_thread_local(from.is_thread_local()); + } + if (from.is_tuple() != 0) { + set_is_tuple(from.is_tuple()); + } + if (from.is_entry_computation_parameter() != 0) { + set_is_entry_computation_parameter(from.is_entry_computation_parameter()); + } + if (from.is_constant() != 0) { + set_is_constant(from.is_constant()); + } + if (from.color() != 0) { + set_color(from.color()); + } +} + +void BufferAllocationProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.BufferAllocationProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BufferAllocationProto::CopyFrom(const BufferAllocationProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.BufferAllocationProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BufferAllocationProto::IsInitialized() const { + return true; +} + +void BufferAllocationProto::Swap(BufferAllocationProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BufferAllocationProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BufferAllocationProto::UnsafeArenaSwap(BufferAllocationProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BufferAllocationProto::InternalSwap(BufferAllocationProto* other) { + using std::swap; + CastToBase(&assigned_)->InternalSwap(CastToBase(&other->assigned_)); + parameter_shape_index_.InternalSwap(&other->parameter_shape_index_); + swap(index_, other->index_); + swap(size_, other->size_); + swap(parameter_number_, other->parameter_number_); + swap(maybe_live_out_, other->maybe_live_out_); + swap(is_thread_local_, other->is_thread_local_); + swap(is_tuple_, other->is_tuple_); + swap(is_entry_computation_parameter_, other->is_entry_computation_parameter_); + swap(is_constant_, other->is_constant_); + swap(color_, other->color_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BufferAllocationProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HeapSimulatorTrace_Event::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HeapSimulatorTrace_Event::kKindFieldNumber; +const int HeapSimulatorTrace_Event::kBufferIdFieldNumber; +const int HeapSimulatorTrace_Event::kComputationNameFieldNumber; +const int HeapSimulatorTrace_Event::kInstructionNameFieldNumber; +const int HeapSimulatorTrace_Event::kShareWithCanonicalIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HeapSimulatorTrace_Event::HeapSimulatorTrace_Event() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace_Event.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HeapSimulatorTrace.Event) +} +HeapSimulatorTrace_Event::HeapSimulatorTrace_Event(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace_Event.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HeapSimulatorTrace.Event) +} +HeapSimulatorTrace_Event::HeapSimulatorTrace_Event(const HeapSimulatorTrace_Event& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + computation_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.computation_name().size() > 0) { + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.computation_name(), + GetArenaNoVirtual()); + } + instruction_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.instruction_name().size() > 0) { + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.instruction_name(), + GetArenaNoVirtual()); + } + ::memcpy(&buffer_id_, &from.buffer_id_, + static_cast(reinterpret_cast(&kind_) - + reinterpret_cast(&buffer_id_)) + sizeof(kind_)); + // @@protoc_insertion_point(copy_constructor:xla.HeapSimulatorTrace.Event) +} + +void HeapSimulatorTrace_Event::SharedCtor() { + computation_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + instruction_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&buffer_id_, 0, static_cast( + reinterpret_cast(&kind_) - + reinterpret_cast(&buffer_id_)) + sizeof(kind_)); +} + +HeapSimulatorTrace_Event::~HeapSimulatorTrace_Event() { + // @@protoc_insertion_point(destructor:xla.HeapSimulatorTrace.Event) + SharedDtor(); +} + +void HeapSimulatorTrace_Event::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + computation_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + instruction_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HeapSimulatorTrace_Event::ArenaDtor(void* object) { + HeapSimulatorTrace_Event* _this = reinterpret_cast< HeapSimulatorTrace_Event* >(object); + (void)_this; +} +void HeapSimulatorTrace_Event::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HeapSimulatorTrace_Event::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HeapSimulatorTrace_Event::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HeapSimulatorTrace_Event& HeapSimulatorTrace_Event::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace_Event.base); + return *internal_default_instance(); +} + + +void HeapSimulatorTrace_Event::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HeapSimulatorTrace.Event) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + computation_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + instruction_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&buffer_id_, 0, static_cast( + reinterpret_cast(&kind_) - + reinterpret_cast(&buffer_id_)) + sizeof(kind_)); + _internal_metadata_.Clear(); +} + +bool HeapSimulatorTrace_Event::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HeapSimulatorTrace.Event) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HeapSimulatorTrace.Event.Kind kind = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_kind(static_cast< ::xla::HeapSimulatorTrace_Event_Kind >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int64 buffer_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &buffer_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string computation_name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_computation_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->computation_name().data(), static_cast(this->computation_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HeapSimulatorTrace.Event.computation_name")); + } else { + goto handle_unusual; + } + break; + } + + // string instruction_name = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_instruction_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->instruction_name().data(), static_cast(this->instruction_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HeapSimulatorTrace.Event.instruction_name")); + } else { + goto handle_unusual; + } + break; + } + + // int64 share_with_canonical_id = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &share_with_canonical_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HeapSimulatorTrace.Event) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HeapSimulatorTrace.Event) + return false; +#undef DO_ +} + +void HeapSimulatorTrace_Event::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HeapSimulatorTrace.Event) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HeapSimulatorTrace.Event.Kind kind = 1; + if (this->kind() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->kind(), output); + } + + // int64 buffer_id = 2; + if (this->buffer_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->buffer_id(), output); + } + + // string computation_name = 3; + if (this->computation_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->computation_name().data(), static_cast(this->computation_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HeapSimulatorTrace.Event.computation_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->computation_name(), output); + } + + // string instruction_name = 4; + if (this->instruction_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->instruction_name().data(), static_cast(this->instruction_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HeapSimulatorTrace.Event.instruction_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->instruction_name(), output); + } + + // int64 share_with_canonical_id = 5; + if (this->share_with_canonical_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->share_with_canonical_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HeapSimulatorTrace.Event) +} + +::google::protobuf::uint8* HeapSimulatorTrace_Event::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HeapSimulatorTrace.Event) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HeapSimulatorTrace.Event.Kind kind = 1; + if (this->kind() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->kind(), target); + } + + // int64 buffer_id = 2; + if (this->buffer_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->buffer_id(), target); + } + + // string computation_name = 3; + if (this->computation_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->computation_name().data(), static_cast(this->computation_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HeapSimulatorTrace.Event.computation_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->computation_name(), target); + } + + // string instruction_name = 4; + if (this->instruction_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->instruction_name().data(), static_cast(this->instruction_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HeapSimulatorTrace.Event.instruction_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->instruction_name(), target); + } + + // int64 share_with_canonical_id = 5; + if (this->share_with_canonical_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->share_with_canonical_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HeapSimulatorTrace.Event) + return target; +} + +size_t HeapSimulatorTrace_Event::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HeapSimulatorTrace.Event) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string computation_name = 3; + if (this->computation_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->computation_name()); + } + + // string instruction_name = 4; + if (this->instruction_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->instruction_name()); + } + + // int64 buffer_id = 2; + if (this->buffer_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->buffer_id()); + } + + // int64 share_with_canonical_id = 5; + if (this->share_with_canonical_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->share_with_canonical_id()); + } + + // .xla.HeapSimulatorTrace.Event.Kind kind = 1; + if (this->kind() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->kind()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HeapSimulatorTrace_Event::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HeapSimulatorTrace.Event) + GOOGLE_DCHECK_NE(&from, this); + const HeapSimulatorTrace_Event* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HeapSimulatorTrace.Event) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HeapSimulatorTrace.Event) + MergeFrom(*source); + } +} + +void HeapSimulatorTrace_Event::MergeFrom(const HeapSimulatorTrace_Event& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HeapSimulatorTrace.Event) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.computation_name().size() > 0) { + set_computation_name(from.computation_name()); + } + if (from.instruction_name().size() > 0) { + set_instruction_name(from.instruction_name()); + } + if (from.buffer_id() != 0) { + set_buffer_id(from.buffer_id()); + } + if (from.share_with_canonical_id() != 0) { + set_share_with_canonical_id(from.share_with_canonical_id()); + } + if (from.kind() != 0) { + set_kind(from.kind()); + } +} + +void HeapSimulatorTrace_Event::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HeapSimulatorTrace.Event) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HeapSimulatorTrace_Event::CopyFrom(const HeapSimulatorTrace_Event& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HeapSimulatorTrace.Event) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HeapSimulatorTrace_Event::IsInitialized() const { + return true; +} + +void HeapSimulatorTrace_Event::Swap(HeapSimulatorTrace_Event* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HeapSimulatorTrace_Event* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HeapSimulatorTrace_Event::UnsafeArenaSwap(HeapSimulatorTrace_Event* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HeapSimulatorTrace_Event::InternalSwap(HeapSimulatorTrace_Event* other) { + using std::swap; + computation_name_.Swap(&other->computation_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + instruction_name_.Swap(&other->instruction_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(buffer_id_, other->buffer_id_); + swap(share_with_canonical_id_, other->share_with_canonical_id_); + swap(kind_, other->kind_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HeapSimulatorTrace_Event::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HeapSimulatorTrace::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HeapSimulatorTrace::kEventsFieldNumber; +const int HeapSimulatorTrace::kWholeModuleSimulationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HeapSimulatorTrace::HeapSimulatorTrace() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HeapSimulatorTrace) +} +HeapSimulatorTrace::HeapSimulatorTrace(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + events_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HeapSimulatorTrace) +} +HeapSimulatorTrace::HeapSimulatorTrace(const HeapSimulatorTrace& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + events_(from.events_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + whole_module_simulation_ = from.whole_module_simulation_; + // @@protoc_insertion_point(copy_constructor:xla.HeapSimulatorTrace) +} + +void HeapSimulatorTrace::SharedCtor() { + whole_module_simulation_ = false; +} + +HeapSimulatorTrace::~HeapSimulatorTrace() { + // @@protoc_insertion_point(destructor:xla.HeapSimulatorTrace) + SharedDtor(); +} + +void HeapSimulatorTrace::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HeapSimulatorTrace::ArenaDtor(void* object) { + HeapSimulatorTrace* _this = reinterpret_cast< HeapSimulatorTrace* >(object); + (void)_this; +} +void HeapSimulatorTrace::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HeapSimulatorTrace::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HeapSimulatorTrace::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HeapSimulatorTrace& HeapSimulatorTrace::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HeapSimulatorTrace.base); + return *internal_default_instance(); +} + + +void HeapSimulatorTrace::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HeapSimulatorTrace) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + events_.Clear(); + whole_module_simulation_ = false; + _internal_metadata_.Clear(); +} + +bool HeapSimulatorTrace::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HeapSimulatorTrace) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.HeapSimulatorTrace.Event events = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_events())); + } else { + goto handle_unusual; + } + break; + } + + // bool whole_module_simulation = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &whole_module_simulation_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HeapSimulatorTrace) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HeapSimulatorTrace) + return false; +#undef DO_ +} + +void HeapSimulatorTrace::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HeapSimulatorTrace) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.HeapSimulatorTrace.Event events = 1; + for (unsigned int i = 0, + n = static_cast(this->events_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->events(static_cast(i)), + output); + } + + // bool whole_module_simulation = 2; + if (this->whole_module_simulation() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->whole_module_simulation(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HeapSimulatorTrace) +} + +::google::protobuf::uint8* HeapSimulatorTrace::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HeapSimulatorTrace) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.HeapSimulatorTrace.Event events = 1; + for (unsigned int i = 0, + n = static_cast(this->events_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->events(static_cast(i)), deterministic, target); + } + + // bool whole_module_simulation = 2; + if (this->whole_module_simulation() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->whole_module_simulation(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HeapSimulatorTrace) + return target; +} + +size_t HeapSimulatorTrace::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HeapSimulatorTrace) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HeapSimulatorTrace.Event events = 1; + { + unsigned int count = static_cast(this->events_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->events(static_cast(i))); + } + } + + // bool whole_module_simulation = 2; + if (this->whole_module_simulation() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HeapSimulatorTrace::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HeapSimulatorTrace) + GOOGLE_DCHECK_NE(&from, this); + const HeapSimulatorTrace* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HeapSimulatorTrace) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HeapSimulatorTrace) + MergeFrom(*source); + } +} + +void HeapSimulatorTrace::MergeFrom(const HeapSimulatorTrace& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HeapSimulatorTrace) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + events_.MergeFrom(from.events_); + if (from.whole_module_simulation() != 0) { + set_whole_module_simulation(from.whole_module_simulation()); + } +} + +void HeapSimulatorTrace::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HeapSimulatorTrace) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HeapSimulatorTrace::CopyFrom(const HeapSimulatorTrace& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HeapSimulatorTrace) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HeapSimulatorTrace::IsInitialized() const { + return true; +} + +void HeapSimulatorTrace::Swap(HeapSimulatorTrace* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HeapSimulatorTrace* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HeapSimulatorTrace::UnsafeArenaSwap(HeapSimulatorTrace* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HeapSimulatorTrace::InternalSwap(HeapSimulatorTrace* other) { + using std::swap; + CastToBase(&events_)->InternalSwap(CastToBase(&other->events_)); + swap(whole_module_simulation_, other->whole_module_simulation_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HeapSimulatorTrace::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloModuleGroupProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloModuleGroupProto::kNameFieldNumber; +const int HloModuleGroupProto::kHloModulesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloModuleGroupProto::HloModuleGroupProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleGroupProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloModuleGroupProto) +} +HloModuleGroupProto::HloModuleGroupProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + hlo_modules_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleGroupProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloModuleGroupProto) +} +HloModuleGroupProto::HloModuleGroupProto(const HloModuleGroupProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + hlo_modules_(from.hlo_modules_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:xla.HloModuleGroupProto) +} + +void HloModuleGroupProto::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +HloModuleGroupProto::~HloModuleGroupProto() { + // @@protoc_insertion_point(destructor:xla.HloModuleGroupProto) + SharedDtor(); +} + +void HloModuleGroupProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HloModuleGroupProto::ArenaDtor(void* object) { + HloModuleGroupProto* _this = reinterpret_cast< HloModuleGroupProto* >(object); + (void)_this; +} +void HloModuleGroupProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloModuleGroupProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloModuleGroupProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloModuleGroupProto& HloModuleGroupProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleGroupProto.base); + return *internal_default_instance(); +} + + +void HloModuleGroupProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloModuleGroupProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + hlo_modules_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool HloModuleGroupProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloModuleGroupProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloModuleGroupProto.name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HloModuleProto hlo_modules = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_hlo_modules())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloModuleGroupProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloModuleGroupProto) + return false; +#undef DO_ +} + +void HloModuleGroupProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloModuleGroupProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloModuleGroupProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .xla.HloModuleProto hlo_modules = 2; + for (unsigned int i = 0, + n = static_cast(this->hlo_modules_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->hlo_modules(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloModuleGroupProto) +} + +::google::protobuf::uint8* HloModuleGroupProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloModuleGroupProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloModuleGroupProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .xla.HloModuleProto hlo_modules = 2; + for (unsigned int i = 0, + n = static_cast(this->hlo_modules_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->hlo_modules(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloModuleGroupProto) + return target; +} + +size_t HloModuleGroupProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloModuleGroupProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HloModuleProto hlo_modules = 2; + { + unsigned int count = static_cast(this->hlo_modules_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->hlo_modules(static_cast(i))); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloModuleGroupProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloModuleGroupProto) + GOOGLE_DCHECK_NE(&from, this); + const HloModuleGroupProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloModuleGroupProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloModuleGroupProto) + MergeFrom(*source); + } +} + +void HloModuleGroupProto::MergeFrom(const HloModuleGroupProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloModuleGroupProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + hlo_modules_.MergeFrom(from.hlo_modules_); + if (from.name().size() > 0) { + set_name(from.name()); + } +} + +void HloModuleGroupProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloModuleGroupProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloModuleGroupProto::CopyFrom(const HloModuleGroupProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloModuleGroupProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloModuleGroupProto::IsInitialized() const { + return true; +} + +void HloModuleGroupProto::Swap(HloModuleGroupProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloModuleGroupProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloModuleGroupProto::UnsafeArenaSwap(HloModuleGroupProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloModuleGroupProto::InternalSwap(HloModuleGroupProto* other) { + using std::swap; + CastToBase(&hlo_modules_)->InternalSwap(CastToBase(&other->hlo_modules_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloModuleGroupProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void BufferAssignmentProto_BufferAlias::InitAsDefaultInstance() { + ::xla::_BufferAssignmentProto_BufferAlias_default_instance_._instance.get_mutable()->location_ = const_cast< ::xla::LogicalBufferProto_Location*>( + ::xla::LogicalBufferProto_Location::internal_default_instance()); +} +void BufferAssignmentProto_BufferAlias::unsafe_arena_set_allocated_location( + ::xla::LogicalBufferProto_Location* location) { + if (GetArenaNoVirtual() == NULL) { + delete location_; + } + location_ = location; + if (location) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.BufferAssignmentProto.BufferAlias.location) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BufferAssignmentProto_BufferAlias::kSourceBufferIdFieldNumber; +const int BufferAssignmentProto_BufferAlias::kLocationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BufferAssignmentProto_BufferAlias::BufferAssignmentProto_BufferAlias() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto_BufferAlias.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.BufferAssignmentProto.BufferAlias) +} +BufferAssignmentProto_BufferAlias::BufferAssignmentProto_BufferAlias(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto_BufferAlias.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.BufferAssignmentProto.BufferAlias) +} +BufferAssignmentProto_BufferAlias::BufferAssignmentProto_BufferAlias(const BufferAssignmentProto_BufferAlias& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_location()) { + location_ = new ::xla::LogicalBufferProto_Location(*from.location_); + } else { + location_ = NULL; + } + source_buffer_id_ = from.source_buffer_id_; + // @@protoc_insertion_point(copy_constructor:xla.BufferAssignmentProto.BufferAlias) +} + +void BufferAssignmentProto_BufferAlias::SharedCtor() { + ::memset(&location_, 0, static_cast( + reinterpret_cast(&source_buffer_id_) - + reinterpret_cast(&location_)) + sizeof(source_buffer_id_)); +} + +BufferAssignmentProto_BufferAlias::~BufferAssignmentProto_BufferAlias() { + // @@protoc_insertion_point(destructor:xla.BufferAssignmentProto.BufferAlias) + SharedDtor(); +} + +void BufferAssignmentProto_BufferAlias::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete location_; +} + +void BufferAssignmentProto_BufferAlias::ArenaDtor(void* object) { + BufferAssignmentProto_BufferAlias* _this = reinterpret_cast< BufferAssignmentProto_BufferAlias* >(object); + (void)_this; +} +void BufferAssignmentProto_BufferAlias::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BufferAssignmentProto_BufferAlias::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BufferAssignmentProto_BufferAlias::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BufferAssignmentProto_BufferAlias& BufferAssignmentProto_BufferAlias::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto_BufferAlias.base); + return *internal_default_instance(); +} + + +void BufferAssignmentProto_BufferAlias::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.BufferAssignmentProto.BufferAlias) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && location_ != NULL) { + delete location_; + } + location_ = NULL; + source_buffer_id_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool BufferAssignmentProto_BufferAlias::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.BufferAssignmentProto.BufferAlias) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 source_buffer_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &source_buffer_id_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.LogicalBufferProto.Location location = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_location())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.BufferAssignmentProto.BufferAlias) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.BufferAssignmentProto.BufferAlias) + return false; +#undef DO_ +} + +void BufferAssignmentProto_BufferAlias::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.BufferAssignmentProto.BufferAlias) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 source_buffer_id = 1; + if (this->source_buffer_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->source_buffer_id(), output); + } + + // .xla.LogicalBufferProto.Location location = 2; + if (this->has_location()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_location(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.BufferAssignmentProto.BufferAlias) +} + +::google::protobuf::uint8* BufferAssignmentProto_BufferAlias::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.BufferAssignmentProto.BufferAlias) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 source_buffer_id = 1; + if (this->source_buffer_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->source_buffer_id(), target); + } + + // .xla.LogicalBufferProto.Location location = 2; + if (this->has_location()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_location(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.BufferAssignmentProto.BufferAlias) + return target; +} + +size_t BufferAssignmentProto_BufferAlias::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.BufferAssignmentProto.BufferAlias) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LogicalBufferProto.Location location = 2; + if (this->has_location()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *location_); + } + + // int64 source_buffer_id = 1; + if (this->source_buffer_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->source_buffer_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BufferAssignmentProto_BufferAlias::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.BufferAssignmentProto.BufferAlias) + GOOGLE_DCHECK_NE(&from, this); + const BufferAssignmentProto_BufferAlias* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.BufferAssignmentProto.BufferAlias) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.BufferAssignmentProto.BufferAlias) + MergeFrom(*source); + } +} + +void BufferAssignmentProto_BufferAlias::MergeFrom(const BufferAssignmentProto_BufferAlias& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.BufferAssignmentProto.BufferAlias) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_location()) { + mutable_location()->::xla::LogicalBufferProto_Location::MergeFrom(from.location()); + } + if (from.source_buffer_id() != 0) { + set_source_buffer_id(from.source_buffer_id()); + } +} + +void BufferAssignmentProto_BufferAlias::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.BufferAssignmentProto.BufferAlias) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BufferAssignmentProto_BufferAlias::CopyFrom(const BufferAssignmentProto_BufferAlias& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.BufferAssignmentProto.BufferAlias) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BufferAssignmentProto_BufferAlias::IsInitialized() const { + return true; +} + +void BufferAssignmentProto_BufferAlias::Swap(BufferAssignmentProto_BufferAlias* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BufferAssignmentProto_BufferAlias* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BufferAssignmentProto_BufferAlias::UnsafeArenaSwap(BufferAssignmentProto_BufferAlias* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BufferAssignmentProto_BufferAlias::InternalSwap(BufferAssignmentProto_BufferAlias* other) { + using std::swap; + swap(location_, other->location_); + swap(source_buffer_id_, other->source_buffer_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BufferAssignmentProto_BufferAlias::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void BufferAssignmentProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BufferAssignmentProto::kLogicalBuffersFieldNumber; +const int BufferAssignmentProto::kBufferAliasesFieldNumber; +const int BufferAssignmentProto::kBufferAllocationsFieldNumber; +const int BufferAssignmentProto::kHeapSimulatorTracesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BufferAssignmentProto::BufferAssignmentProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.BufferAssignmentProto) +} +BufferAssignmentProto::BufferAssignmentProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + logical_buffers_(arena), + buffer_aliases_(arena), + buffer_allocations_(arena), + heap_simulator_traces_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.BufferAssignmentProto) +} +BufferAssignmentProto::BufferAssignmentProto(const BufferAssignmentProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + logical_buffers_(from.logical_buffers_), + buffer_aliases_(from.buffer_aliases_), + buffer_allocations_(from.buffer_allocations_), + heap_simulator_traces_(from.heap_simulator_traces_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.BufferAssignmentProto) +} + +void BufferAssignmentProto::SharedCtor() { +} + +BufferAssignmentProto::~BufferAssignmentProto() { + // @@protoc_insertion_point(destructor:xla.BufferAssignmentProto) + SharedDtor(); +} + +void BufferAssignmentProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void BufferAssignmentProto::ArenaDtor(void* object) { + BufferAssignmentProto* _this = reinterpret_cast< BufferAssignmentProto* >(object); + (void)_this; +} +void BufferAssignmentProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BufferAssignmentProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BufferAssignmentProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BufferAssignmentProto& BufferAssignmentProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_BufferAssignmentProto.base); + return *internal_default_instance(); +} + + +void BufferAssignmentProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.BufferAssignmentProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + logical_buffers_.Clear(); + buffer_aliases_.Clear(); + buffer_allocations_.Clear(); + heap_simulator_traces_.Clear(); + _internal_metadata_.Clear(); +} + +bool BufferAssignmentProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.BufferAssignmentProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.LogicalBufferProto logical_buffers = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_logical_buffers())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.BufferAssignmentProto.BufferAlias buffer_aliases = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_buffer_aliases())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.BufferAllocationProto buffer_allocations = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_buffer_allocations())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HeapSimulatorTrace heap_simulator_traces = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_heap_simulator_traces())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.BufferAssignmentProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.BufferAssignmentProto) + return false; +#undef DO_ +} + +void BufferAssignmentProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.BufferAssignmentProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.LogicalBufferProto logical_buffers = 1; + for (unsigned int i = 0, + n = static_cast(this->logical_buffers_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->logical_buffers(static_cast(i)), + output); + } + + // repeated .xla.BufferAssignmentProto.BufferAlias buffer_aliases = 2; + for (unsigned int i = 0, + n = static_cast(this->buffer_aliases_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->buffer_aliases(static_cast(i)), + output); + } + + // repeated .xla.BufferAllocationProto buffer_allocations = 3; + for (unsigned int i = 0, + n = static_cast(this->buffer_allocations_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->buffer_allocations(static_cast(i)), + output); + } + + // repeated .xla.HeapSimulatorTrace heap_simulator_traces = 4; + for (unsigned int i = 0, + n = static_cast(this->heap_simulator_traces_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->heap_simulator_traces(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.BufferAssignmentProto) +} + +::google::protobuf::uint8* BufferAssignmentProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.BufferAssignmentProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.LogicalBufferProto logical_buffers = 1; + for (unsigned int i = 0, + n = static_cast(this->logical_buffers_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->logical_buffers(static_cast(i)), deterministic, target); + } + + // repeated .xla.BufferAssignmentProto.BufferAlias buffer_aliases = 2; + for (unsigned int i = 0, + n = static_cast(this->buffer_aliases_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->buffer_aliases(static_cast(i)), deterministic, target); + } + + // repeated .xla.BufferAllocationProto buffer_allocations = 3; + for (unsigned int i = 0, + n = static_cast(this->buffer_allocations_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->buffer_allocations(static_cast(i)), deterministic, target); + } + + // repeated .xla.HeapSimulatorTrace heap_simulator_traces = 4; + for (unsigned int i = 0, + n = static_cast(this->heap_simulator_traces_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->heap_simulator_traces(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.BufferAssignmentProto) + return target; +} + +size_t BufferAssignmentProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.BufferAssignmentProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.LogicalBufferProto logical_buffers = 1; + { + unsigned int count = static_cast(this->logical_buffers_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->logical_buffers(static_cast(i))); + } + } + + // repeated .xla.BufferAssignmentProto.BufferAlias buffer_aliases = 2; + { + unsigned int count = static_cast(this->buffer_aliases_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->buffer_aliases(static_cast(i))); + } + } + + // repeated .xla.BufferAllocationProto buffer_allocations = 3; + { + unsigned int count = static_cast(this->buffer_allocations_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->buffer_allocations(static_cast(i))); + } + } + + // repeated .xla.HeapSimulatorTrace heap_simulator_traces = 4; + { + unsigned int count = static_cast(this->heap_simulator_traces_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->heap_simulator_traces(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BufferAssignmentProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.BufferAssignmentProto) + GOOGLE_DCHECK_NE(&from, this); + const BufferAssignmentProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.BufferAssignmentProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.BufferAssignmentProto) + MergeFrom(*source); + } +} + +void BufferAssignmentProto::MergeFrom(const BufferAssignmentProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.BufferAssignmentProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + logical_buffers_.MergeFrom(from.logical_buffers_); + buffer_aliases_.MergeFrom(from.buffer_aliases_); + buffer_allocations_.MergeFrom(from.buffer_allocations_); + heap_simulator_traces_.MergeFrom(from.heap_simulator_traces_); +} + +void BufferAssignmentProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.BufferAssignmentProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BufferAssignmentProto::CopyFrom(const BufferAssignmentProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.BufferAssignmentProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BufferAssignmentProto::IsInitialized() const { + return true; +} + +void BufferAssignmentProto::Swap(BufferAssignmentProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BufferAssignmentProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BufferAssignmentProto::UnsafeArenaSwap(BufferAssignmentProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BufferAssignmentProto::InternalSwap(BufferAssignmentProto* other) { + using std::swap; + CastToBase(&logical_buffers_)->InternalSwap(CastToBase(&other->logical_buffers_)); + CastToBase(&buffer_aliases_)->InternalSwap(CastToBase(&other->buffer_aliases_)); + CastToBase(&buffer_allocations_)->InternalSwap(CastToBase(&other->buffer_allocations_)); + CastToBase(&heap_simulator_traces_)->InternalSwap(CastToBase(&other->heap_simulator_traces_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BufferAssignmentProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloProto::InitAsDefaultInstance() { + ::xla::_HloProto_default_instance_._instance.get_mutable()->hlo_module_ = const_cast< ::xla::HloModuleProto*>( + ::xla::HloModuleProto::internal_default_instance()); + ::xla::_HloProto_default_instance_._instance.get_mutable()->buffer_assignment_ = const_cast< ::xla::BufferAssignmentProto*>( + ::xla::BufferAssignmentProto::internal_default_instance()); +} +void HloProto::unsafe_arena_set_allocated_hlo_module( + ::xla::HloModuleProto* hlo_module) { + if (GetArenaNoVirtual() == NULL) { + delete hlo_module_; + } + hlo_module_ = hlo_module; + if (hlo_module) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloProto.hlo_module) +} +void HloProto::unsafe_arena_set_allocated_buffer_assignment( + ::xla::BufferAssignmentProto* buffer_assignment) { + if (GetArenaNoVirtual() == NULL) { + delete buffer_assignment_; + } + buffer_assignment_ = buffer_assignment; + if (buffer_assignment) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloProto.buffer_assignment) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloProto::kHloModuleFieldNumber; +const int HloProto::kBufferAssignmentFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloProto::HloProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloProto) +} +HloProto::HloProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloProto) +} +HloProto::HloProto(const HloProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_hlo_module()) { + hlo_module_ = new ::xla::HloModuleProto(*from.hlo_module_); + } else { + hlo_module_ = NULL; + } + if (from.has_buffer_assignment()) { + buffer_assignment_ = new ::xla::BufferAssignmentProto(*from.buffer_assignment_); + } else { + buffer_assignment_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.HloProto) +} + +void HloProto::SharedCtor() { + ::memset(&hlo_module_, 0, static_cast( + reinterpret_cast(&buffer_assignment_) - + reinterpret_cast(&hlo_module_)) + sizeof(buffer_assignment_)); +} + +HloProto::~HloProto() { + // @@protoc_insertion_point(destructor:xla.HloProto) + SharedDtor(); +} + +void HloProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete hlo_module_; + if (this != internal_default_instance()) delete buffer_assignment_; +} + +void HloProto::ArenaDtor(void* object) { + HloProto* _this = reinterpret_cast< HloProto* >(object); + (void)_this; +} +void HloProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloProto& HloProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloProto.base); + return *internal_default_instance(); +} + + +void HloProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && hlo_module_ != NULL) { + delete hlo_module_; + } + hlo_module_ = NULL; + if (GetArenaNoVirtual() == NULL && buffer_assignment_ != NULL) { + delete buffer_assignment_; + } + buffer_assignment_ = NULL; + _internal_metadata_.Clear(); +} + +bool HloProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HloModuleProto hlo_module = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_hlo_module())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.BufferAssignmentProto buffer_assignment = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_buffer_assignment())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloProto) + return false; +#undef DO_ +} + +void HloProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto hlo_module = 1; + if (this->has_hlo_module()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_hlo_module(), output); + } + + // .xla.BufferAssignmentProto buffer_assignment = 3; + if (this->has_buffer_assignment()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_buffer_assignment(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloProto) +} + +::google::protobuf::uint8* HloProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto hlo_module = 1; + if (this->has_hlo_module()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_hlo_module(), deterministic, target); + } + + // .xla.BufferAssignmentProto buffer_assignment = 3; + if (this->has_buffer_assignment()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_buffer_assignment(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloProto) + return target; +} + +size_t HloProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.HloModuleProto hlo_module = 1; + if (this->has_hlo_module()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *hlo_module_); + } + + // .xla.BufferAssignmentProto buffer_assignment = 3; + if (this->has_buffer_assignment()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *buffer_assignment_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloProto) + GOOGLE_DCHECK_NE(&from, this); + const HloProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloProto) + MergeFrom(*source); + } +} + +void HloProto::MergeFrom(const HloProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_hlo_module()) { + mutable_hlo_module()->::xla::HloModuleProto::MergeFrom(from.hlo_module()); + } + if (from.has_buffer_assignment()) { + mutable_buffer_assignment()->::xla::BufferAssignmentProto::MergeFrom(from.buffer_assignment()); + } +} + +void HloProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloProto::CopyFrom(const HloProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloProto::IsInitialized() const { + return true; +} + +void HloProto::Swap(HloProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloProto::UnsafeArenaSwap(HloProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloProto::InternalSwap(HloProto* other) { + using std::swap; + swap(hlo_module_, other->hlo_module_); + swap(buffer_assignment_, other->buffer_assignment_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloSnapshot::InitAsDefaultInstance() { + ::xla::_HloSnapshot_default_instance_._instance.get_mutable()->hlo_ = const_cast< ::xla::HloProto*>( + ::xla::HloProto::internal_default_instance()); + ::xla::_HloSnapshot_default_instance_._instance.get_mutable()->result_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); +} +void HloSnapshot::unsafe_arena_set_allocated_hlo( + ::xla::HloProto* hlo) { + if (GetArenaNoVirtual() == NULL) { + delete hlo_; + } + hlo_ = hlo; + if (hlo) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloSnapshot.hlo) +} +void HloSnapshot::clear_arguments() { + arguments_.Clear(); +} +void HloSnapshot::unsafe_arena_set_allocated_result( + ::xla::LiteralProto* result) { + if (GetArenaNoVirtual() == NULL) { + delete result_; + } + result_ = result; + if (result) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloSnapshot.result) +} +void HloSnapshot::clear_result() { + if (GetArenaNoVirtual() == NULL && result_ != NULL) { + delete result_; + } + result_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloSnapshot::kHloFieldNumber; +const int HloSnapshot::kArgumentsFieldNumber; +const int HloSnapshot::kResultFieldNumber; +const int HloSnapshot::kExecutionPlatformFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloSnapshot::HloSnapshot() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloSnapshot.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloSnapshot) +} +HloSnapshot::HloSnapshot(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + arguments_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloSnapshot.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloSnapshot) +} +HloSnapshot::HloSnapshot(const HloSnapshot& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + arguments_(from.arguments_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + execution_platform_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.execution_platform().size() > 0) { + execution_platform_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.execution_platform(), + GetArenaNoVirtual()); + } + if (from.has_hlo()) { + hlo_ = new ::xla::HloProto(*from.hlo_); + } else { + hlo_ = NULL; + } + if (from.has_result()) { + result_ = new ::xla::LiteralProto(*from.result_); + } else { + result_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.HloSnapshot) +} + +void HloSnapshot::SharedCtor() { + execution_platform_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&hlo_, 0, static_cast( + reinterpret_cast(&result_) - + reinterpret_cast(&hlo_)) + sizeof(result_)); +} + +HloSnapshot::~HloSnapshot() { + // @@protoc_insertion_point(destructor:xla.HloSnapshot) + SharedDtor(); +} + +void HloSnapshot::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + execution_platform_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete hlo_; + if (this != internal_default_instance()) delete result_; +} + +void HloSnapshot::ArenaDtor(void* object) { + HloSnapshot* _this = reinterpret_cast< HloSnapshot* >(object); + (void)_this; +} +void HloSnapshot::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloSnapshot::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloSnapshot::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloSnapshot& HloSnapshot::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloSnapshot.base); + return *internal_default_instance(); +} + + +void HloSnapshot::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloSnapshot) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + arguments_.Clear(); + execution_platform_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && hlo_ != NULL) { + delete hlo_; + } + hlo_ = NULL; + if (GetArenaNoVirtual() == NULL && result_ != NULL) { + delete result_; + } + result_ = NULL; + _internal_metadata_.Clear(); +} + +bool HloSnapshot::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloSnapshot) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HloProto hlo = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_hlo())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.LiteralProto arguments = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_arguments())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.LiteralProto result = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_result())); + } else { + goto handle_unusual; + } + break; + } + + // string execution_platform = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_execution_platform())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->execution_platform().data(), static_cast(this->execution_platform().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloSnapshot.execution_platform")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloSnapshot) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloSnapshot) + return false; +#undef DO_ +} + +void HloSnapshot::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloSnapshot) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloProto hlo = 1; + if (this->has_hlo()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_hlo(), output); + } + + // repeated .xla.LiteralProto arguments = 2; + for (unsigned int i = 0, + n = static_cast(this->arguments_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->arguments(static_cast(i)), + output); + } + + // .xla.LiteralProto result = 3; + if (this->has_result()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_result(), output); + } + + // string execution_platform = 4; + if (this->execution_platform().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->execution_platform().data(), static_cast(this->execution_platform().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloSnapshot.execution_platform"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->execution_platform(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloSnapshot) +} + +::google::protobuf::uint8* HloSnapshot::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloSnapshot) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloProto hlo = 1; + if (this->has_hlo()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_hlo(), deterministic, target); + } + + // repeated .xla.LiteralProto arguments = 2; + for (unsigned int i = 0, + n = static_cast(this->arguments_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->arguments(static_cast(i)), deterministic, target); + } + + // .xla.LiteralProto result = 3; + if (this->has_result()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_result(), deterministic, target); + } + + // string execution_platform = 4; + if (this->execution_platform().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->execution_platform().data(), static_cast(this->execution_platform().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloSnapshot.execution_platform"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->execution_platform(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloSnapshot) + return target; +} + +size_t HloSnapshot::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloSnapshot) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.LiteralProto arguments = 2; + { + unsigned int count = static_cast(this->arguments_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->arguments(static_cast(i))); + } + } + + // string execution_platform = 4; + if (this->execution_platform().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->execution_platform()); + } + + // .xla.HloProto hlo = 1; + if (this->has_hlo()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *hlo_); + } + + // .xla.LiteralProto result = 3; + if (this->has_result()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *result_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloSnapshot::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloSnapshot) + GOOGLE_DCHECK_NE(&from, this); + const HloSnapshot* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloSnapshot) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloSnapshot) + MergeFrom(*source); + } +} + +void HloSnapshot::MergeFrom(const HloSnapshot& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloSnapshot) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + arguments_.MergeFrom(from.arguments_); + if (from.execution_platform().size() > 0) { + set_execution_platform(from.execution_platform()); + } + if (from.has_hlo()) { + mutable_hlo()->::xla::HloProto::MergeFrom(from.hlo()); + } + if (from.has_result()) { + mutable_result()->::xla::LiteralProto::MergeFrom(from.result()); + } +} + +void HloSnapshot::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloSnapshot) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloSnapshot::CopyFrom(const HloSnapshot& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloSnapshot) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloSnapshot::IsInitialized() const { + return true; +} + +void HloSnapshot::Swap(HloSnapshot* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloSnapshot* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloSnapshot::UnsafeArenaSwap(HloSnapshot* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloSnapshot::InternalSwap(HloSnapshot* other) { + using std::swap; + CastToBase(&arguments_)->InternalSwap(CastToBase(&other->arguments_)); + execution_platform_.Swap(&other->execution_platform_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(hlo_, other->hlo_); + swap(result_, other->result_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloSnapshot::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace xla +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloInstructionProto_SliceDimensions* Arena::CreateMaybeMessage< ::xla::HloInstructionProto_SliceDimensions >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloInstructionProto_SliceDimensions >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloInstructionProto* Arena::CreateMaybeMessage< ::xla::HloInstructionProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloInstructionProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloComputationProto* Arena::CreateMaybeMessage< ::xla::HloComputationProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloComputationProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloScheduleProto_InstructionSequence* Arena::CreateMaybeMessage< ::xla::HloScheduleProto_InstructionSequence >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloScheduleProto_InstructionSequence >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloScheduleProto_SequencesEntry_DoNotUse* Arena::CreateMaybeMessage< ::xla::HloScheduleProto_SequencesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloScheduleProto_SequencesEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloScheduleProto* Arena::CreateMaybeMessage< ::xla::HloScheduleProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloScheduleProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloInputOutputAliasProto_AliasEntryProto* Arena::CreateMaybeMessage< ::xla::HloInputOutputAliasProto_AliasEntryProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloInputOutputAliasProto_AliasEntryProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloInputOutputAliasProto* Arena::CreateMaybeMessage< ::xla::HloInputOutputAliasProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloInputOutputAliasProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DynamicParameterBindingProto_Binding* Arena::CreateMaybeMessage< ::xla::DynamicParameterBindingProto_Binding >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::DynamicParameterBindingProto_Binding >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DynamicParameterBindingProto* Arena::CreateMaybeMessage< ::xla::DynamicParameterBindingProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::DynamicParameterBindingProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloModuleProto* Arena::CreateMaybeMessage< ::xla::HloModuleProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloModuleProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::LogicalBufferProto_Location* Arena::CreateMaybeMessage< ::xla::LogicalBufferProto_Location >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::LogicalBufferProto_Location >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::LogicalBufferProto* Arena::CreateMaybeMessage< ::xla::LogicalBufferProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::LogicalBufferProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::BufferAllocationProto_Assigned* Arena::CreateMaybeMessage< ::xla::BufferAllocationProto_Assigned >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::BufferAllocationProto_Assigned >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::BufferAllocationProto* Arena::CreateMaybeMessage< ::xla::BufferAllocationProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::BufferAllocationProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HeapSimulatorTrace_Event* Arena::CreateMaybeMessage< ::xla::HeapSimulatorTrace_Event >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HeapSimulatorTrace_Event >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HeapSimulatorTrace* Arena::CreateMaybeMessage< ::xla::HeapSimulatorTrace >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HeapSimulatorTrace >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloModuleGroupProto* Arena::CreateMaybeMessage< ::xla::HloModuleGroupProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloModuleGroupProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::BufferAssignmentProto_BufferAlias* Arena::CreateMaybeMessage< ::xla::BufferAssignmentProto_BufferAlias >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::BufferAssignmentProto_BufferAlias >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::BufferAssignmentProto* Arena::CreateMaybeMessage< ::xla::BufferAssignmentProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::BufferAssignmentProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloProto* Arena::CreateMaybeMessage< ::xla::HloProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloSnapshot* Arena::CreateMaybeMessage< ::xla::HloSnapshot >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloSnapshot >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.pb.h new file mode 100644 index 0000000..3429e83 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.pb.h @@ -0,0 +1,8819 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/service/hlo.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include +#include "diplomacy_tensorflow/compiler/xla/xla_data.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[22]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto +namespace xla { +class BufferAllocationProto; +class BufferAllocationProtoDefaultTypeInternal; +extern BufferAllocationProtoDefaultTypeInternal _BufferAllocationProto_default_instance_; +class BufferAllocationProto_Assigned; +class BufferAllocationProto_AssignedDefaultTypeInternal; +extern BufferAllocationProto_AssignedDefaultTypeInternal _BufferAllocationProto_Assigned_default_instance_; +class BufferAssignmentProto; +class BufferAssignmentProtoDefaultTypeInternal; +extern BufferAssignmentProtoDefaultTypeInternal _BufferAssignmentProto_default_instance_; +class BufferAssignmentProto_BufferAlias; +class BufferAssignmentProto_BufferAliasDefaultTypeInternal; +extern BufferAssignmentProto_BufferAliasDefaultTypeInternal _BufferAssignmentProto_BufferAlias_default_instance_; +class DynamicParameterBindingProto; +class DynamicParameterBindingProtoDefaultTypeInternal; +extern DynamicParameterBindingProtoDefaultTypeInternal _DynamicParameterBindingProto_default_instance_; +class DynamicParameterBindingProto_Binding; +class DynamicParameterBindingProto_BindingDefaultTypeInternal; +extern DynamicParameterBindingProto_BindingDefaultTypeInternal _DynamicParameterBindingProto_Binding_default_instance_; +class HeapSimulatorTrace; +class HeapSimulatorTraceDefaultTypeInternal; +extern HeapSimulatorTraceDefaultTypeInternal _HeapSimulatorTrace_default_instance_; +class HeapSimulatorTrace_Event; +class HeapSimulatorTrace_EventDefaultTypeInternal; +extern HeapSimulatorTrace_EventDefaultTypeInternal _HeapSimulatorTrace_Event_default_instance_; +class HloComputationProto; +class HloComputationProtoDefaultTypeInternal; +extern HloComputationProtoDefaultTypeInternal _HloComputationProto_default_instance_; +class HloInputOutputAliasProto; +class HloInputOutputAliasProtoDefaultTypeInternal; +extern HloInputOutputAliasProtoDefaultTypeInternal _HloInputOutputAliasProto_default_instance_; +class HloInputOutputAliasProto_AliasEntryProto; +class HloInputOutputAliasProto_AliasEntryProtoDefaultTypeInternal; +extern HloInputOutputAliasProto_AliasEntryProtoDefaultTypeInternal _HloInputOutputAliasProto_AliasEntryProto_default_instance_; +class HloInstructionProto; +class HloInstructionProtoDefaultTypeInternal; +extern HloInstructionProtoDefaultTypeInternal _HloInstructionProto_default_instance_; +class HloInstructionProto_SliceDimensions; +class HloInstructionProto_SliceDimensionsDefaultTypeInternal; +extern HloInstructionProto_SliceDimensionsDefaultTypeInternal _HloInstructionProto_SliceDimensions_default_instance_; +class HloModuleGroupProto; +class HloModuleGroupProtoDefaultTypeInternal; +extern HloModuleGroupProtoDefaultTypeInternal _HloModuleGroupProto_default_instance_; +class HloModuleProto; +class HloModuleProtoDefaultTypeInternal; +extern HloModuleProtoDefaultTypeInternal _HloModuleProto_default_instance_; +class HloProto; +class HloProtoDefaultTypeInternal; +extern HloProtoDefaultTypeInternal _HloProto_default_instance_; +class HloScheduleProto; +class HloScheduleProtoDefaultTypeInternal; +extern HloScheduleProtoDefaultTypeInternal _HloScheduleProto_default_instance_; +class HloScheduleProto_InstructionSequence; +class HloScheduleProto_InstructionSequenceDefaultTypeInternal; +extern HloScheduleProto_InstructionSequenceDefaultTypeInternal _HloScheduleProto_InstructionSequence_default_instance_; +class HloScheduleProto_SequencesEntry_DoNotUse; +class HloScheduleProto_SequencesEntry_DoNotUseDefaultTypeInternal; +extern HloScheduleProto_SequencesEntry_DoNotUseDefaultTypeInternal _HloScheduleProto_SequencesEntry_DoNotUse_default_instance_; +class HloSnapshot; +class HloSnapshotDefaultTypeInternal; +extern HloSnapshotDefaultTypeInternal _HloSnapshot_default_instance_; +class LogicalBufferProto; +class LogicalBufferProtoDefaultTypeInternal; +extern LogicalBufferProtoDefaultTypeInternal _LogicalBufferProto_default_instance_; +class LogicalBufferProto_Location; +class LogicalBufferProto_LocationDefaultTypeInternal; +extern LogicalBufferProto_LocationDefaultTypeInternal _LogicalBufferProto_Location_default_instance_; +} // namespace xla +namespace google { +namespace protobuf { +template<> ::xla::BufferAllocationProto* Arena::CreateMaybeMessage<::xla::BufferAllocationProto>(Arena*); +template<> ::xla::BufferAllocationProto_Assigned* Arena::CreateMaybeMessage<::xla::BufferAllocationProto_Assigned>(Arena*); +template<> ::xla::BufferAssignmentProto* Arena::CreateMaybeMessage<::xla::BufferAssignmentProto>(Arena*); +template<> ::xla::BufferAssignmentProto_BufferAlias* Arena::CreateMaybeMessage<::xla::BufferAssignmentProto_BufferAlias>(Arena*); +template<> ::xla::DynamicParameterBindingProto* Arena::CreateMaybeMessage<::xla::DynamicParameterBindingProto>(Arena*); +template<> ::xla::DynamicParameterBindingProto_Binding* Arena::CreateMaybeMessage<::xla::DynamicParameterBindingProto_Binding>(Arena*); +template<> ::xla::HeapSimulatorTrace* Arena::CreateMaybeMessage<::xla::HeapSimulatorTrace>(Arena*); +template<> ::xla::HeapSimulatorTrace_Event* Arena::CreateMaybeMessage<::xla::HeapSimulatorTrace_Event>(Arena*); +template<> ::xla::HloComputationProto* Arena::CreateMaybeMessage<::xla::HloComputationProto>(Arena*); +template<> ::xla::HloInputOutputAliasProto* Arena::CreateMaybeMessage<::xla::HloInputOutputAliasProto>(Arena*); +template<> ::xla::HloInputOutputAliasProto_AliasEntryProto* Arena::CreateMaybeMessage<::xla::HloInputOutputAliasProto_AliasEntryProto>(Arena*); +template<> ::xla::HloInstructionProto* Arena::CreateMaybeMessage<::xla::HloInstructionProto>(Arena*); +template<> ::xla::HloInstructionProto_SliceDimensions* Arena::CreateMaybeMessage<::xla::HloInstructionProto_SliceDimensions>(Arena*); +template<> ::xla::HloModuleGroupProto* Arena::CreateMaybeMessage<::xla::HloModuleGroupProto>(Arena*); +template<> ::xla::HloModuleProto* Arena::CreateMaybeMessage<::xla::HloModuleProto>(Arena*); +template<> ::xla::HloProto* Arena::CreateMaybeMessage<::xla::HloProto>(Arena*); +template<> ::xla::HloScheduleProto* Arena::CreateMaybeMessage<::xla::HloScheduleProto>(Arena*); +template<> ::xla::HloScheduleProto_InstructionSequence* Arena::CreateMaybeMessage<::xla::HloScheduleProto_InstructionSequence>(Arena*); +template<> ::xla::HloScheduleProto_SequencesEntry_DoNotUse* Arena::CreateMaybeMessage<::xla::HloScheduleProto_SequencesEntry_DoNotUse>(Arena*); +template<> ::xla::HloSnapshot* Arena::CreateMaybeMessage<::xla::HloSnapshot>(Arena*); +template<> ::xla::LogicalBufferProto* Arena::CreateMaybeMessage<::xla::LogicalBufferProto>(Arena*); +template<> ::xla::LogicalBufferProto_Location* Arena::CreateMaybeMessage<::xla::LogicalBufferProto_Location>(Arena*); +} // namespace protobuf +} // namespace google +namespace xla { + +enum HeapSimulatorTrace_Event_Kind { + HeapSimulatorTrace_Event_Kind_ALLOC = 0, + HeapSimulatorTrace_Event_Kind_FREE = 1, + HeapSimulatorTrace_Event_Kind_SHARE_WITH = 2, + HeapSimulatorTrace_Event_Kind_HeapSimulatorTrace_Event_Kind_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + HeapSimulatorTrace_Event_Kind_HeapSimulatorTrace_Event_Kind_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool HeapSimulatorTrace_Event_Kind_IsValid(int value); +const HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event_Kind_Kind_MIN = HeapSimulatorTrace_Event_Kind_ALLOC; +const HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event_Kind_Kind_MAX = HeapSimulatorTrace_Event_Kind_SHARE_WITH; +const int HeapSimulatorTrace_Event_Kind_Kind_ARRAYSIZE = HeapSimulatorTrace_Event_Kind_Kind_MAX + 1; + +const ::google::protobuf::EnumDescriptor* HeapSimulatorTrace_Event_Kind_descriptor(); +inline const ::std::string& HeapSimulatorTrace_Event_Kind_Name(HeapSimulatorTrace_Event_Kind value) { + return ::google::protobuf::internal::NameOfEnum( + HeapSimulatorTrace_Event_Kind_descriptor(), value); +} +inline bool HeapSimulatorTrace_Event_Kind_Parse( + const ::std::string& name, HeapSimulatorTrace_Event_Kind* value) { + return ::google::protobuf::internal::ParseNamedEnum( + HeapSimulatorTrace_Event_Kind_descriptor(), name, value); +} +// =================================================================== + +class HloInstructionProto_SliceDimensions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloInstructionProto.SliceDimensions) */ { + public: + HloInstructionProto_SliceDimensions(); + virtual ~HloInstructionProto_SliceDimensions(); + + HloInstructionProto_SliceDimensions(const HloInstructionProto_SliceDimensions& from); + + inline HloInstructionProto_SliceDimensions& operator=(const HloInstructionProto_SliceDimensions& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloInstructionProto_SliceDimensions(HloInstructionProto_SliceDimensions&& from) noexcept + : HloInstructionProto_SliceDimensions() { + *this = ::std::move(from); + } + + inline HloInstructionProto_SliceDimensions& operator=(HloInstructionProto_SliceDimensions&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloInstructionProto_SliceDimensions& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloInstructionProto_SliceDimensions* internal_default_instance() { + return reinterpret_cast( + &_HloInstructionProto_SliceDimensions_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(HloInstructionProto_SliceDimensions* other); + void Swap(HloInstructionProto_SliceDimensions* other); + friend void swap(HloInstructionProto_SliceDimensions& a, HloInstructionProto_SliceDimensions& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloInstructionProto_SliceDimensions* New() const final { + return CreateMaybeMessage(NULL); + } + + HloInstructionProto_SliceDimensions* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloInstructionProto_SliceDimensions& from); + void MergeFrom(const HloInstructionProto_SliceDimensions& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloInstructionProto_SliceDimensions* other); + protected: + explicit HloInstructionProto_SliceDimensions(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 start = 1; + void clear_start(); + static const int kStartFieldNumber = 1; + ::google::protobuf::int64 start() const; + void set_start(::google::protobuf::int64 value); + + // int64 limit = 2; + void clear_limit(); + static const int kLimitFieldNumber = 2; + ::google::protobuf::int64 limit() const; + void set_limit(::google::protobuf::int64 value); + + // int64 stride = 3; + void clear_stride(); + static const int kStrideFieldNumber = 3; + ::google::protobuf::int64 stride() const; + void set_stride(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloInstructionProto.SliceDimensions) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 start_; + ::google::protobuf::int64 limit_; + ::google::protobuf::int64 stride_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloInstructionProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloInstructionProto) */ { + public: + HloInstructionProto(); + virtual ~HloInstructionProto(); + + HloInstructionProto(const HloInstructionProto& from); + + inline HloInstructionProto& operator=(const HloInstructionProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloInstructionProto(HloInstructionProto&& from) noexcept + : HloInstructionProto() { + *this = ::std::move(from); + } + + inline HloInstructionProto& operator=(HloInstructionProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloInstructionProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloInstructionProto* internal_default_instance() { + return reinterpret_cast( + &_HloInstructionProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(HloInstructionProto* other); + void Swap(HloInstructionProto* other); + friend void swap(HloInstructionProto& a, HloInstructionProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloInstructionProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloInstructionProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloInstructionProto& from); + void MergeFrom(const HloInstructionProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloInstructionProto* other); + protected: + explicit HloInstructionProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HloInstructionProto_SliceDimensions SliceDimensions; + + // accessors ------------------------------------------------------- + + // repeated int64 dimensions = 14; + int dimensions_size() const; + void clear_dimensions(); + static const int kDimensionsFieldNumber = 14; + ::google::protobuf::int64 dimensions(int index) const; + void set_dimensions(int index, ::google::protobuf::int64 value); + void add_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dimensions(); + + // repeated .xla.HloInstructionProto.SliceDimensions slice_dimensions = 17; + int slice_dimensions_size() const; + void clear_slice_dimensions(); + static const int kSliceDimensionsFieldNumber = 17; + ::xla::HloInstructionProto_SliceDimensions* mutable_slice_dimensions(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto_SliceDimensions >* + mutable_slice_dimensions(); + const ::xla::HloInstructionProto_SliceDimensions& slice_dimensions(int index) const; + ::xla::HloInstructionProto_SliceDimensions* add_slice_dimensions(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto_SliceDimensions >& + slice_dimensions() const; + + // repeated int64 dynamic_slice_sizes = 20; + int dynamic_slice_sizes_size() const; + void clear_dynamic_slice_sizes(); + static const int kDynamicSliceSizesFieldNumber = 20; + ::google::protobuf::int64 dynamic_slice_sizes(int index) const; + void set_dynamic_slice_sizes(int index, ::google::protobuf::int64 value); + void add_dynamic_slice_sizes(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dynamic_slice_sizes() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dynamic_slice_sizes(); + + // repeated int64 fft_length = 32; + int fft_length_size() const; + void clear_fft_length(); + static const int kFftLengthFieldNumber = 32; + ::google::protobuf::int64 fft_length(int index) const; + void set_fft_length(int index, ::google::protobuf::int64 value); + void add_fft_length(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + fft_length() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_fft_length(); + + // repeated int64 gather_slice_sizes = 34; + int gather_slice_sizes_size() const; + void clear_gather_slice_sizes(); + static const int kGatherSliceSizesFieldNumber = 34; + ::google::protobuf::int64 gather_slice_sizes(int index) const; + void set_gather_slice_sizes(int index, ::google::protobuf::int64 value); + void add_gather_slice_sizes(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + gather_slice_sizes() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_gather_slice_sizes(); + + // repeated int64 operand_ids = 36; + int operand_ids_size() const; + void clear_operand_ids(); + static const int kOperandIdsFieldNumber = 36; + ::google::protobuf::int64 operand_ids(int index) const; + void set_operand_ids(int index, ::google::protobuf::int64 value); + void add_operand_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + operand_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_operand_ids(); + + // repeated int64 control_predecessor_ids = 37; + int control_predecessor_ids_size() const; + void clear_control_predecessor_ids(); + static const int kControlPredecessorIdsFieldNumber = 37; + ::google::protobuf::int64 control_predecessor_ids(int index) const; + void set_control_predecessor_ids(int index, ::google::protobuf::int64 value); + void add_control_predecessor_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + control_predecessor_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_control_predecessor_ids(); + + // repeated int64 called_computation_ids = 38; + int called_computation_ids_size() const; + void clear_called_computation_ids(); + static const int kCalledComputationIdsFieldNumber = 38; + ::google::protobuf::int64 called_computation_ids(int index) const; + void set_called_computation_ids(int index, ::google::protobuf::int64 value); + void add_called_computation_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + called_computation_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_called_computation_ids(); + + // repeated .xla.ReplicaGroup replica_groups = 49; + int replica_groups_size() const; + void clear_replica_groups(); + static const int kReplicaGroupsFieldNumber = 49; + ::xla::ReplicaGroup* mutable_replica_groups(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ReplicaGroup >* + mutable_replica_groups(); + const ::xla::ReplicaGroup& replica_groups(int index) const; + ::xla::ReplicaGroup* add_replica_groups(); + const ::google::protobuf::RepeatedPtrField< ::xla::ReplicaGroup >& + replica_groups() const; + + // repeated .xla.SourceTarget source_target_pairs = 52; + int source_target_pairs_size() const; + void clear_source_target_pairs(); + static const int kSourceTargetPairsFieldNumber = 52; + ::xla::SourceTarget* mutable_source_target_pairs(int index); + ::google::protobuf::RepeatedPtrField< ::xla::SourceTarget >* + mutable_source_target_pairs(); + const ::xla::SourceTarget& source_target_pairs(int index) const; + ::xla::SourceTarget* add_source_target_pairs(); + const ::google::protobuf::RepeatedPtrField< ::xla::SourceTarget >& + source_target_pairs() const; + + // repeated .xla.ShapeProto operand_shapes_with_layout = 57; + int operand_shapes_with_layout_size() const; + void clear_operand_shapes_with_layout(); + static const int kOperandShapesWithLayoutFieldNumber = 57; + ::xla::ShapeProto* mutable_operand_shapes_with_layout(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* + mutable_operand_shapes_with_layout(); + const ::xla::ShapeProto& operand_shapes_with_layout(int index) const; + ::xla::ShapeProto* add_operand_shapes_with_layout(); + const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& + operand_shapes_with_layout() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string opcode = 2; + void clear_opcode(); + static const int kOpcodeFieldNumber = 2; + const ::std::string& opcode() const; + void set_opcode(const ::std::string& value); + #if LANG_CXX11 + void set_opcode(::std::string&& value); + #endif + void set_opcode(const char* value); + void set_opcode(const char* value, size_t size); + ::std::string* mutable_opcode(); + ::std::string* release_opcode(); + void set_allocated_opcode(::std::string* opcode); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_opcode(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_opcode( + ::std::string* opcode); + + // string fusion_kind = 11; + void clear_fusion_kind(); + static const int kFusionKindFieldNumber = 11; + const ::std::string& fusion_kind() const; + void set_fusion_kind(const ::std::string& value); + #if LANG_CXX11 + void set_fusion_kind(::std::string&& value); + #endif + void set_fusion_kind(const char* value); + void set_fusion_kind(const char* value, size_t size); + ::std::string* mutable_fusion_kind(); + ::std::string* release_fusion_kind(); + void set_allocated_fusion_kind(::std::string* fusion_kind); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_fusion_kind(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_fusion_kind( + ::std::string* fusion_kind); + + // bytes outfeed_config = 22; + void clear_outfeed_config(); + static const int kOutfeedConfigFieldNumber = 22; + const ::std::string& outfeed_config() const; + void set_outfeed_config(const ::std::string& value); + #if LANG_CXX11 + void set_outfeed_config(::std::string&& value); + #endif + void set_outfeed_config(const char* value); + void set_outfeed_config(const void* value, size_t size); + ::std::string* mutable_outfeed_config(); + ::std::string* release_outfeed_config(); + void set_allocated_outfeed_config(::std::string* outfeed_config); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_outfeed_config(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_outfeed_config( + ::std::string* outfeed_config); + + // bytes infeed_config = 27; + void clear_infeed_config(); + static const int kInfeedConfigFieldNumber = 27; + const ::std::string& infeed_config() const; + void set_infeed_config(const ::std::string& value); + #if LANG_CXX11 + void set_infeed_config(::std::string&& value); + #endif + void set_infeed_config(const char* value); + void set_infeed_config(const void* value, size_t size); + ::std::string* mutable_infeed_config(); + ::std::string* release_infeed_config(); + void set_allocated_infeed_config(::std::string* infeed_config); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_infeed_config(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_infeed_config( + ::std::string* infeed_config); + + // string custom_call_target = 28; + void clear_custom_call_target(); + static const int kCustomCallTargetFieldNumber = 28; + const ::std::string& custom_call_target() const; + void set_custom_call_target(const ::std::string& value); + #if LANG_CXX11 + void set_custom_call_target(::std::string&& value); + #endif + void set_custom_call_target(const char* value); + void set_custom_call_target(const char* value, size_t size); + ::std::string* mutable_custom_call_target(); + ::std::string* release_custom_call_target(); + void set_allocated_custom_call_target(::std::string* custom_call_target); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_custom_call_target(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_custom_call_target( + ::std::string* custom_call_target); + + // string channel_name = 41; + void clear_channel_name(); + static const int kChannelNameFieldNumber = 41; + const ::std::string& channel_name() const; + void set_channel_name(const ::std::string& value); + #if LANG_CXX11 + void set_channel_name(::std::string&& value); + #endif + void set_channel_name(const char* value); + void set_channel_name(const char* value, size_t size); + ::std::string* mutable_channel_name(); + ::std::string* release_channel_name(); + void set_allocated_channel_name(::std::string* channel_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_channel_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_channel_name( + ::std::string* channel_name); + + // string backend_config = 43; + void clear_backend_config(); + static const int kBackendConfigFieldNumber = 43; + const ::std::string& backend_config() const; + void set_backend_config(const ::std::string& value); + #if LANG_CXX11 + void set_backend_config(::std::string&& value); + #endif + void set_backend_config(const char* value); + void set_backend_config(const char* value, size_t size); + ::std::string* mutable_backend_config(); + ::std::string* release_backend_config(); + void set_allocated_backend_config(::std::string* backend_config); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_backend_config(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_backend_config( + ::std::string* backend_config); + + // string cross_replica_sum_barrier = 46; + void clear_cross_replica_sum_barrier(); + static const int kCrossReplicaSumBarrierFieldNumber = 46; + const ::std::string& cross_replica_sum_barrier() const; + void set_cross_replica_sum_barrier(const ::std::string& value); + #if LANG_CXX11 + void set_cross_replica_sum_barrier(::std::string&& value); + #endif + void set_cross_replica_sum_barrier(const char* value); + void set_cross_replica_sum_barrier(const char* value, size_t size); + ::std::string* mutable_cross_replica_sum_barrier(); + ::std::string* release_cross_replica_sum_barrier(); + void set_allocated_cross_replica_sum_barrier(::std::string* cross_replica_sum_barrier); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_cross_replica_sum_barrier(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_cross_replica_sum_barrier( + ::std::string* cross_replica_sum_barrier); + + // string custom_call_opaque = 53; + void clear_custom_call_opaque(); + static const int kCustomCallOpaqueFieldNumber = 53; + const ::std::string& custom_call_opaque() const; + void set_custom_call_opaque(const ::std::string& value); + #if LANG_CXX11 + void set_custom_call_opaque(::std::string&& value); + #endif + void set_custom_call_opaque(const char* value); + void set_custom_call_opaque(const char* value, size_t size); + ::std::string* mutable_custom_call_opaque(); + ::std::string* release_custom_call_opaque(); + void set_allocated_custom_call_opaque(::std::string* custom_call_opaque); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_custom_call_opaque(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_custom_call_opaque( + ::std::string* custom_call_opaque); + + // .xla.ShapeProto shape = 3; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 3; + private: + const ::xla::ShapeProto& _internal_shape() const; + public: + const ::xla::ShapeProto& shape() const; + ::xla::ShapeProto* release_shape(); + ::xla::ShapeProto* mutable_shape(); + void set_allocated_shape(::xla::ShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::xla::ShapeProto* shape); + ::xla::ShapeProto* unsafe_arena_release_shape(); + + // .xla.OpMetadata metadata = 7; + bool has_metadata() const; + void clear_metadata(); + static const int kMetadataFieldNumber = 7; + private: + const ::xla::OpMetadata& _internal_metadata() const; + public: + const ::xla::OpMetadata& metadata() const; + ::xla::OpMetadata* release_metadata(); + ::xla::OpMetadata* mutable_metadata(); + void set_allocated_metadata(::xla::OpMetadata* metadata); + void unsafe_arena_set_allocated_metadata( + ::xla::OpMetadata* metadata); + ::xla::OpMetadata* unsafe_arena_release_metadata(); + + // .xla.LiteralProto literal = 8; + bool has_literal() const; + void clear_literal(); + static const int kLiteralFieldNumber = 8; + private: + const ::xla::LiteralProto& _internal_literal() const; + public: + const ::xla::LiteralProto& literal() const; + ::xla::LiteralProto* release_literal(); + ::xla::LiteralProto* mutable_literal(); + void set_allocated_literal(::xla::LiteralProto* literal); + void unsafe_arena_set_allocated_literal( + ::xla::LiteralProto* literal); + ::xla::LiteralProto* unsafe_arena_release_literal(); + + // .xla.Window window = 15; + bool has_window() const; + void clear_window(); + static const int kWindowFieldNumber = 15; + private: + const ::xla::Window& _internal_window() const; + public: + const ::xla::Window& window() const; + ::xla::Window* release_window(); + ::xla::Window* mutable_window(); + void set_allocated_window(::xla::Window* window); + void unsafe_arena_set_allocated_window( + ::xla::Window* window); + ::xla::Window* unsafe_arena_release_window(); + + // .xla.ConvolutionDimensionNumbers convolution_dimension_numbers = 16; + bool has_convolution_dimension_numbers() const; + void clear_convolution_dimension_numbers(); + static const int kConvolutionDimensionNumbersFieldNumber = 16; + private: + const ::xla::ConvolutionDimensionNumbers& _internal_convolution_dimension_numbers() const; + public: + const ::xla::ConvolutionDimensionNumbers& convolution_dimension_numbers() const; + ::xla::ConvolutionDimensionNumbers* release_convolution_dimension_numbers(); + ::xla::ConvolutionDimensionNumbers* mutable_convolution_dimension_numbers(); + void set_allocated_convolution_dimension_numbers(::xla::ConvolutionDimensionNumbers* convolution_dimension_numbers); + void unsafe_arena_set_allocated_convolution_dimension_numbers( + ::xla::ConvolutionDimensionNumbers* convolution_dimension_numbers); + ::xla::ConvolutionDimensionNumbers* unsafe_arena_release_convolution_dimension_numbers(); + + // .xla.PaddingConfig padding_config = 21; + bool has_padding_config() const; + void clear_padding_config(); + static const int kPaddingConfigFieldNumber = 21; + private: + const ::xla::PaddingConfig& _internal_padding_config() const; + public: + const ::xla::PaddingConfig& padding_config() const; + ::xla::PaddingConfig* release_padding_config(); + ::xla::PaddingConfig* mutable_padding_config(); + void set_allocated_padding_config(::xla::PaddingConfig* padding_config); + void unsafe_arena_set_allocated_padding_config( + ::xla::PaddingConfig* padding_config); + ::xla::PaddingConfig* unsafe_arena_release_padding_config(); + + // .xla.ShapeProto outfeed_shape = 29; + bool has_outfeed_shape() const; + void clear_outfeed_shape(); + static const int kOutfeedShapeFieldNumber = 29; + private: + const ::xla::ShapeProto& _internal_outfeed_shape() const; + public: + const ::xla::ShapeProto& outfeed_shape() const; + ::xla::ShapeProto* release_outfeed_shape(); + ::xla::ShapeProto* mutable_outfeed_shape(); + void set_allocated_outfeed_shape(::xla::ShapeProto* outfeed_shape); + void unsafe_arena_set_allocated_outfeed_shape( + ::xla::ShapeProto* outfeed_shape); + ::xla::ShapeProto* unsafe_arena_release_outfeed_shape(); + + // .xla.DotDimensionNumbers dot_dimension_numbers = 30; + bool has_dot_dimension_numbers() const; + void clear_dot_dimension_numbers(); + static const int kDotDimensionNumbersFieldNumber = 30; + private: + const ::xla::DotDimensionNumbers& _internal_dot_dimension_numbers() const; + public: + const ::xla::DotDimensionNumbers& dot_dimension_numbers() const; + ::xla::DotDimensionNumbers* release_dot_dimension_numbers(); + ::xla::DotDimensionNumbers* mutable_dot_dimension_numbers(); + void set_allocated_dot_dimension_numbers(::xla::DotDimensionNumbers* dot_dimension_numbers); + void unsafe_arena_set_allocated_dot_dimension_numbers( + ::xla::DotDimensionNumbers* dot_dimension_numbers); + ::xla::DotDimensionNumbers* unsafe_arena_release_dot_dimension_numbers(); + + // .xla.GatherDimensionNumbers gather_dimension_numbers = 33; + bool has_gather_dimension_numbers() const; + void clear_gather_dimension_numbers(); + static const int kGatherDimensionNumbersFieldNumber = 33; + private: + const ::xla::GatherDimensionNumbers& _internal_gather_dimension_numbers() const; + public: + const ::xla::GatherDimensionNumbers& gather_dimension_numbers() const; + ::xla::GatherDimensionNumbers* release_gather_dimension_numbers(); + ::xla::GatherDimensionNumbers* mutable_gather_dimension_numbers(); + void set_allocated_gather_dimension_numbers(::xla::GatherDimensionNumbers* gather_dimension_numbers); + void unsafe_arena_set_allocated_gather_dimension_numbers( + ::xla::GatherDimensionNumbers* gather_dimension_numbers); + ::xla::GatherDimensionNumbers* unsafe_arena_release_gather_dimension_numbers(); + + // .xla.OpSharding sharding = 40; + bool has_sharding() const; + void clear_sharding(); + static const int kShardingFieldNumber = 40; + private: + const ::xla::OpSharding& _internal_sharding() const; + public: + const ::xla::OpSharding& sharding() const; + ::xla::OpSharding* release_sharding(); + ::xla::OpSharding* mutable_sharding(); + void set_allocated_sharding(::xla::OpSharding* sharding); + void unsafe_arena_set_allocated_sharding( + ::xla::OpSharding* sharding); + ::xla::OpSharding* unsafe_arena_release_sharding(); + + // .xla.ScatterDimensionNumbers scatter_dimension_numbers = 48; + bool has_scatter_dimension_numbers() const; + void clear_scatter_dimension_numbers(); + static const int kScatterDimensionNumbersFieldNumber = 48; + private: + const ::xla::ScatterDimensionNumbers& _internal_scatter_dimension_numbers() const; + public: + const ::xla::ScatterDimensionNumbers& scatter_dimension_numbers() const; + ::xla::ScatterDimensionNumbers* release_scatter_dimension_numbers(); + ::xla::ScatterDimensionNumbers* mutable_scatter_dimension_numbers(); + void set_allocated_scatter_dimension_numbers(::xla::ScatterDimensionNumbers* scatter_dimension_numbers); + void unsafe_arena_set_allocated_scatter_dimension_numbers( + ::xla::ScatterDimensionNumbers* scatter_dimension_numbers); + ::xla::ScatterDimensionNumbers* unsafe_arena_release_scatter_dimension_numbers(); + + // .xla.PrecisionConfig precision_config = 51; + bool has_precision_config() const; + void clear_precision_config(); + static const int kPrecisionConfigFieldNumber = 51; + private: + const ::xla::PrecisionConfig& _internal_precision_config() const; + public: + const ::xla::PrecisionConfig& precision_config() const; + ::xla::PrecisionConfig* release_precision_config(); + ::xla::PrecisionConfig* mutable_precision_config(); + void set_allocated_precision_config(::xla::PrecisionConfig* precision_config); + void unsafe_arena_set_allocated_precision_config( + ::xla::PrecisionConfig* precision_config); + ::xla::PrecisionConfig* unsafe_arena_release_precision_config(); + + // .xla.OpSharding domain_entry_sharding = 54; + bool has_domain_entry_sharding() const; + void clear_domain_entry_sharding(); + static const int kDomainEntryShardingFieldNumber = 54; + private: + const ::xla::OpSharding& _internal_domain_entry_sharding() const; + public: + const ::xla::OpSharding& domain_entry_sharding() const; + ::xla::OpSharding* release_domain_entry_sharding(); + ::xla::OpSharding* mutable_domain_entry_sharding(); + void set_allocated_domain_entry_sharding(::xla::OpSharding* domain_entry_sharding); + void unsafe_arena_set_allocated_domain_entry_sharding( + ::xla::OpSharding* domain_entry_sharding); + ::xla::OpSharding* unsafe_arena_release_domain_entry_sharding(); + + // .xla.OpSharding domain_exit_sharding = 55; + bool has_domain_exit_sharding() const; + void clear_domain_exit_sharding(); + static const int kDomainExitShardingFieldNumber = 55; + private: + const ::xla::OpSharding& _internal_domain_exit_sharding() const; + public: + const ::xla::OpSharding& domain_exit_sharding() const; + ::xla::OpSharding* release_domain_exit_sharding(); + ::xla::OpSharding* mutable_domain_exit_sharding(); + void set_allocated_domain_exit_sharding(::xla::OpSharding* domain_exit_sharding); + void unsafe_arena_set_allocated_domain_exit_sharding( + ::xla::OpSharding* domain_exit_sharding); + ::xla::OpSharding* unsafe_arena_release_domain_exit_sharding(); + + // int64 parameter_number = 9; + void clear_parameter_number(); + static const int kParameterNumberFieldNumber = 9; + ::google::protobuf::int64 parameter_number() const; + void set_parameter_number(::google::protobuf::int64 value); + + // int64 tuple_index = 13; + void clear_tuple_index(); + static const int kTupleIndexFieldNumber = 13; + ::google::protobuf::int64 tuple_index() const; + void set_tuple_index(::google::protobuf::int64 value); + + // int32 exponent_bits = 18; + void clear_exponent_bits(); + static const int kExponentBitsFieldNumber = 18; + ::google::protobuf::int32 exponent_bits() const; + void set_exponent_bits(::google::protobuf::int32 value); + + // int32 mantissa_bits = 19; + void clear_mantissa_bits(); + static const int kMantissaBitsFieldNumber = 19; + ::google::protobuf::int32 mantissa_bits() const; + void set_mantissa_bits(::google::protobuf::int32 value); + + // .xla.RandomDistribution distribution = 23; + void clear_distribution(); + static const int kDistributionFieldNumber = 23; + ::xla::RandomDistribution distribution() const; + void set_distribution(::xla::RandomDistribution value); + + // float epsilon = 24; + void clear_epsilon(); + static const int kEpsilonFieldNumber = 24; + float epsilon() const; + void set_epsilon(float value); + + // int64 feature_index = 25; + void clear_feature_index(); + static const int kFeatureIndexFieldNumber = 25; + ::google::protobuf::int64 feature_index() const; + void set_feature_index(::google::protobuf::int64 value); + + // int64 channel_id = 26; + void clear_channel_id(); + static const int kChannelIdFieldNumber = 26; + ::google::protobuf::int64 channel_id() const; + void set_channel_id(::google::protobuf::int64 value); + + // int64 id = 35; + void clear_id(); + static const int kIdFieldNumber = 35; + ::google::protobuf::int64 id() const; + void set_id(::google::protobuf::int64 value); + + // int64 cost_estimate_ns = 42; + void clear_cost_estimate_ns(); + static const int kCostEstimateNsFieldNumber = 42; + ::google::protobuf::int64 cost_estimate_ns() const; + void set_cost_estimate_ns(::google::protobuf::int64 value); + + // .xla.FftType fft_type = 31; + void clear_fft_type(); + static const int kFftTypeFieldNumber = 31; + ::xla::FftType fft_type() const; + void set_fft_type(::xla::FftType value); + + // bool is_host_transfer = 47; + void clear_is_host_transfer(); + static const int kIsHostTransferFieldNumber = 47; + bool is_host_transfer() const; + void set_is_host_transfer(bool value); + + // bool constrain_layout = 56; + void clear_constrain_layout(); + static const int kConstrainLayoutFieldNumber = 56; + bool constrain_layout() const; + void set_constrain_layout(bool value); + + // int64 all_reduce_id = 45; + void clear_all_reduce_id(); + static const int kAllReduceIdFieldNumber = 45; + ::google::protobuf::int64 all_reduce_id() const; + void set_all_reduce_id(::google::protobuf::int64 value); + + // int64 feature_group_count = 50; + void clear_feature_group_count(); + static const int kFeatureGroupCountFieldNumber = 50; + ::google::protobuf::int64 feature_group_count() const; + void set_feature_group_count(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloInstructionProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dimensions_; + mutable int _dimensions_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto_SliceDimensions > slice_dimensions_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dynamic_slice_sizes_; + mutable int _dynamic_slice_sizes_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > fft_length_; + mutable int _fft_length_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > gather_slice_sizes_; + mutable int _gather_slice_sizes_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > operand_ids_; + mutable int _operand_ids_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > control_predecessor_ids_; + mutable int _control_predecessor_ids_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > called_computation_ids_; + mutable int _called_computation_ids_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::xla::ReplicaGroup > replica_groups_; + ::google::protobuf::RepeatedPtrField< ::xla::SourceTarget > source_target_pairs_; + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto > operand_shapes_with_layout_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr opcode_; + ::google::protobuf::internal::ArenaStringPtr fusion_kind_; + ::google::protobuf::internal::ArenaStringPtr outfeed_config_; + ::google::protobuf::internal::ArenaStringPtr infeed_config_; + ::google::protobuf::internal::ArenaStringPtr custom_call_target_; + ::google::protobuf::internal::ArenaStringPtr channel_name_; + ::google::protobuf::internal::ArenaStringPtr backend_config_; + ::google::protobuf::internal::ArenaStringPtr cross_replica_sum_barrier_; + ::google::protobuf::internal::ArenaStringPtr custom_call_opaque_; + ::xla::ShapeProto* shape_; + ::xla::OpMetadata* metadata_; + ::xla::LiteralProto* literal_; + ::xla::Window* window_; + ::xla::ConvolutionDimensionNumbers* convolution_dimension_numbers_; + ::xla::PaddingConfig* padding_config_; + ::xla::ShapeProto* outfeed_shape_; + ::xla::DotDimensionNumbers* dot_dimension_numbers_; + ::xla::GatherDimensionNumbers* gather_dimension_numbers_; + ::xla::OpSharding* sharding_; + ::xla::ScatterDimensionNumbers* scatter_dimension_numbers_; + ::xla::PrecisionConfig* precision_config_; + ::xla::OpSharding* domain_entry_sharding_; + ::xla::OpSharding* domain_exit_sharding_; + ::google::protobuf::int64 parameter_number_; + ::google::protobuf::int64 tuple_index_; + ::google::protobuf::int32 exponent_bits_; + ::google::protobuf::int32 mantissa_bits_; + int distribution_; + float epsilon_; + ::google::protobuf::int64 feature_index_; + ::google::protobuf::int64 channel_id_; + ::google::protobuf::int64 id_; + ::google::protobuf::int64 cost_estimate_ns_; + int fft_type_; + bool is_host_transfer_; + bool constrain_layout_; + ::google::protobuf::int64 all_reduce_id_; + ::google::protobuf::int64 feature_group_count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloComputationProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloComputationProto) */ { + public: + HloComputationProto(); + virtual ~HloComputationProto(); + + HloComputationProto(const HloComputationProto& from); + + inline HloComputationProto& operator=(const HloComputationProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloComputationProto(HloComputationProto&& from) noexcept + : HloComputationProto() { + *this = ::std::move(from); + } + + inline HloComputationProto& operator=(HloComputationProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloComputationProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloComputationProto* internal_default_instance() { + return reinterpret_cast( + &_HloComputationProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(HloComputationProto* other); + void Swap(HloComputationProto* other); + friend void swap(HloComputationProto& a, HloComputationProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloComputationProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloComputationProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloComputationProto& from); + void MergeFrom(const HloComputationProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloComputationProto* other); + protected: + explicit HloComputationProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.HloInstructionProto instructions = 2; + int instructions_size() const; + void clear_instructions(); + static const int kInstructionsFieldNumber = 2; + ::xla::HloInstructionProto* mutable_instructions(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto >* + mutable_instructions(); + const ::xla::HloInstructionProto& instructions(int index) const; + ::xla::HloInstructionProto* add_instructions(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto >& + instructions() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // .xla.ProgramShapeProto program_shape = 4; + bool has_program_shape() const; + void clear_program_shape(); + static const int kProgramShapeFieldNumber = 4; + private: + const ::xla::ProgramShapeProto& _internal_program_shape() const; + public: + const ::xla::ProgramShapeProto& program_shape() const; + ::xla::ProgramShapeProto* release_program_shape(); + ::xla::ProgramShapeProto* mutable_program_shape(); + void set_allocated_program_shape(::xla::ProgramShapeProto* program_shape); + void unsafe_arena_set_allocated_program_shape( + ::xla::ProgramShapeProto* program_shape); + ::xla::ProgramShapeProto* unsafe_arena_release_program_shape(); + + // int64 id = 5; + void clear_id(); + static const int kIdFieldNumber = 5; + ::google::protobuf::int64 id() const; + void set_id(::google::protobuf::int64 value); + + // int64 root_id = 6; + void clear_root_id(); + static const int kRootIdFieldNumber = 6; + ::google::protobuf::int64 root_id() const; + void set_root_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloComputationProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto > instructions_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::xla::ProgramShapeProto* program_shape_; + ::google::protobuf::int64 id_; + ::google::protobuf::int64 root_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloScheduleProto_InstructionSequence : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloScheduleProto.InstructionSequence) */ { + public: + HloScheduleProto_InstructionSequence(); + virtual ~HloScheduleProto_InstructionSequence(); + + HloScheduleProto_InstructionSequence(const HloScheduleProto_InstructionSequence& from); + + inline HloScheduleProto_InstructionSequence& operator=(const HloScheduleProto_InstructionSequence& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloScheduleProto_InstructionSequence(HloScheduleProto_InstructionSequence&& from) noexcept + : HloScheduleProto_InstructionSequence() { + *this = ::std::move(from); + } + + inline HloScheduleProto_InstructionSequence& operator=(HloScheduleProto_InstructionSequence&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloScheduleProto_InstructionSequence& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloScheduleProto_InstructionSequence* internal_default_instance() { + return reinterpret_cast( + &_HloScheduleProto_InstructionSequence_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(HloScheduleProto_InstructionSequence* other); + void Swap(HloScheduleProto_InstructionSequence* other); + friend void swap(HloScheduleProto_InstructionSequence& a, HloScheduleProto_InstructionSequence& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloScheduleProto_InstructionSequence* New() const final { + return CreateMaybeMessage(NULL); + } + + HloScheduleProto_InstructionSequence* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloScheduleProto_InstructionSequence& from); + void MergeFrom(const HloScheduleProto_InstructionSequence& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloScheduleProto_InstructionSequence* other); + protected: + explicit HloScheduleProto_InstructionSequence(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 instruction_ids = 1; + int instruction_ids_size() const; + void clear_instruction_ids(); + static const int kInstructionIdsFieldNumber = 1; + ::google::protobuf::int64 instruction_ids(int index) const; + void set_instruction_ids(int index, ::google::protobuf::int64 value); + void add_instruction_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + instruction_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_instruction_ids(); + + // @@protoc_insertion_point(class_scope:xla.HloScheduleProto.InstructionSequence) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > instruction_ids_; + mutable int _instruction_ids_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloScheduleProto_SequencesEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + HloScheduleProto_SequencesEntry_DoNotUse(); + HloScheduleProto_SequencesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const HloScheduleProto_SequencesEntry_DoNotUse& other); + static const HloScheduleProto_SequencesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_HloScheduleProto_SequencesEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class HloScheduleProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloScheduleProto) */ { + public: + HloScheduleProto(); + virtual ~HloScheduleProto(); + + HloScheduleProto(const HloScheduleProto& from); + + inline HloScheduleProto& operator=(const HloScheduleProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloScheduleProto(HloScheduleProto&& from) noexcept + : HloScheduleProto() { + *this = ::std::move(from); + } + + inline HloScheduleProto& operator=(HloScheduleProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloScheduleProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloScheduleProto* internal_default_instance() { + return reinterpret_cast( + &_HloScheduleProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(HloScheduleProto* other); + void Swap(HloScheduleProto* other); + friend void swap(HloScheduleProto& a, HloScheduleProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloScheduleProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloScheduleProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloScheduleProto& from); + void MergeFrom(const HloScheduleProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloScheduleProto* other); + protected: + explicit HloScheduleProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HloScheduleProto_InstructionSequence InstructionSequence; + + // accessors ------------------------------------------------------- + + // map sequences = 1; + int sequences_size() const; + void clear_sequences(); + static const int kSequencesFieldNumber = 1; + const ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >& + sequences() const; + ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >* + mutable_sequences(); + + // @@protoc_insertion_point(class_scope:xla.HloScheduleProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + HloScheduleProto_SequencesEntry_DoNotUse, + ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > sequences_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloInputOutputAliasProto_AliasEntryProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloInputOutputAliasProto.AliasEntryProto) */ { + public: + HloInputOutputAliasProto_AliasEntryProto(); + virtual ~HloInputOutputAliasProto_AliasEntryProto(); + + HloInputOutputAliasProto_AliasEntryProto(const HloInputOutputAliasProto_AliasEntryProto& from); + + inline HloInputOutputAliasProto_AliasEntryProto& operator=(const HloInputOutputAliasProto_AliasEntryProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloInputOutputAliasProto_AliasEntryProto(HloInputOutputAliasProto_AliasEntryProto&& from) noexcept + : HloInputOutputAliasProto_AliasEntryProto() { + *this = ::std::move(from); + } + + inline HloInputOutputAliasProto_AliasEntryProto& operator=(HloInputOutputAliasProto_AliasEntryProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloInputOutputAliasProto_AliasEntryProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloInputOutputAliasProto_AliasEntryProto* internal_default_instance() { + return reinterpret_cast( + &_HloInputOutputAliasProto_AliasEntryProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(HloInputOutputAliasProto_AliasEntryProto* other); + void Swap(HloInputOutputAliasProto_AliasEntryProto* other); + friend void swap(HloInputOutputAliasProto_AliasEntryProto& a, HloInputOutputAliasProto_AliasEntryProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloInputOutputAliasProto_AliasEntryProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloInputOutputAliasProto_AliasEntryProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloInputOutputAliasProto_AliasEntryProto& from); + void MergeFrom(const HloInputOutputAliasProto_AliasEntryProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloInputOutputAliasProto_AliasEntryProto* other); + protected: + explicit HloInputOutputAliasProto_AliasEntryProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 output_shape_index = 1; + int output_shape_index_size() const; + void clear_output_shape_index(); + static const int kOutputShapeIndexFieldNumber = 1; + ::google::protobuf::int64 output_shape_index(int index) const; + void set_output_shape_index(int index, ::google::protobuf::int64 value); + void add_output_shape_index(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + output_shape_index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_output_shape_index(); + + // repeated int64 parameter_shape_index = 3; + int parameter_shape_index_size() const; + void clear_parameter_shape_index(); + static const int kParameterShapeIndexFieldNumber = 3; + ::google::protobuf::int64 parameter_shape_index(int index) const; + void set_parameter_shape_index(int index, ::google::protobuf::int64 value); + void add_parameter_shape_index(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + parameter_shape_index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_parameter_shape_index(); + + // int64 parameter_number = 2; + void clear_parameter_number(); + static const int kParameterNumberFieldNumber = 2; + ::google::protobuf::int64 parameter_number() const; + void set_parameter_number(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloInputOutputAliasProto.AliasEntryProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > output_shape_index_; + mutable int _output_shape_index_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > parameter_shape_index_; + mutable int _parameter_shape_index_cached_byte_size_; + ::google::protobuf::int64 parameter_number_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloInputOutputAliasProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloInputOutputAliasProto) */ { + public: + HloInputOutputAliasProto(); + virtual ~HloInputOutputAliasProto(); + + HloInputOutputAliasProto(const HloInputOutputAliasProto& from); + + inline HloInputOutputAliasProto& operator=(const HloInputOutputAliasProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloInputOutputAliasProto(HloInputOutputAliasProto&& from) noexcept + : HloInputOutputAliasProto() { + *this = ::std::move(from); + } + + inline HloInputOutputAliasProto& operator=(HloInputOutputAliasProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloInputOutputAliasProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloInputOutputAliasProto* internal_default_instance() { + return reinterpret_cast( + &_HloInputOutputAliasProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(HloInputOutputAliasProto* other); + void Swap(HloInputOutputAliasProto* other); + friend void swap(HloInputOutputAliasProto& a, HloInputOutputAliasProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloInputOutputAliasProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloInputOutputAliasProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloInputOutputAliasProto& from); + void MergeFrom(const HloInputOutputAliasProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloInputOutputAliasProto* other); + protected: + explicit HloInputOutputAliasProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HloInputOutputAliasProto_AliasEntryProto AliasEntryProto; + + // accessors ------------------------------------------------------- + + // repeated .xla.HloInputOutputAliasProto.AliasEntryProto entries = 1; + int entries_size() const; + void clear_entries(); + static const int kEntriesFieldNumber = 1; + ::xla::HloInputOutputAliasProto_AliasEntryProto* mutable_entries(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloInputOutputAliasProto_AliasEntryProto >* + mutable_entries(); + const ::xla::HloInputOutputAliasProto_AliasEntryProto& entries(int index) const; + ::xla::HloInputOutputAliasProto_AliasEntryProto* add_entries(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloInputOutputAliasProto_AliasEntryProto >& + entries() const; + + // @@protoc_insertion_point(class_scope:xla.HloInputOutputAliasProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HloInputOutputAliasProto_AliasEntryProto > entries_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DynamicParameterBindingProto_Binding : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DynamicParameterBindingProto.Binding) */ { + public: + DynamicParameterBindingProto_Binding(); + virtual ~DynamicParameterBindingProto_Binding(); + + DynamicParameterBindingProto_Binding(const DynamicParameterBindingProto_Binding& from); + + inline DynamicParameterBindingProto_Binding& operator=(const DynamicParameterBindingProto_Binding& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DynamicParameterBindingProto_Binding(DynamicParameterBindingProto_Binding&& from) noexcept + : DynamicParameterBindingProto_Binding() { + *this = ::std::move(from); + } + + inline DynamicParameterBindingProto_Binding& operator=(DynamicParameterBindingProto_Binding&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DynamicParameterBindingProto_Binding& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DynamicParameterBindingProto_Binding* internal_default_instance() { + return reinterpret_cast( + &_DynamicParameterBindingProto_Binding_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(DynamicParameterBindingProto_Binding* other); + void Swap(DynamicParameterBindingProto_Binding* other); + friend void swap(DynamicParameterBindingProto_Binding& a, DynamicParameterBindingProto_Binding& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DynamicParameterBindingProto_Binding* New() const final { + return CreateMaybeMessage(NULL); + } + + DynamicParameterBindingProto_Binding* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DynamicParameterBindingProto_Binding& from); + void MergeFrom(const DynamicParameterBindingProto_Binding& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DynamicParameterBindingProto_Binding* other); + protected: + explicit DynamicParameterBindingProto_Binding(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 dynamic_param_index = 2; + int dynamic_param_index_size() const; + void clear_dynamic_param_index(); + static const int kDynamicParamIndexFieldNumber = 2; + ::google::protobuf::int64 dynamic_param_index(int index) const; + void set_dynamic_param_index(int index, ::google::protobuf::int64 value); + void add_dynamic_param_index(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dynamic_param_index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dynamic_param_index(); + + // repeated int64 target_param_index = 4; + int target_param_index_size() const; + void clear_target_param_index(); + static const int kTargetParamIndexFieldNumber = 4; + ::google::protobuf::int64 target_param_index(int index) const; + void set_target_param_index(int index, ::google::protobuf::int64 value); + void add_target_param_index(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + target_param_index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_target_param_index(); + + // int64 dynamic_param_num = 1; + void clear_dynamic_param_num(); + static const int kDynamicParamNumFieldNumber = 1; + ::google::protobuf::int64 dynamic_param_num() const; + void set_dynamic_param_num(::google::protobuf::int64 value); + + // int64 target_param_num = 3; + void clear_target_param_num(); + static const int kTargetParamNumFieldNumber = 3; + ::google::protobuf::int64 target_param_num() const; + void set_target_param_num(::google::protobuf::int64 value); + + // int64 target_param_dim_num = 5; + void clear_target_param_dim_num(); + static const int kTargetParamDimNumFieldNumber = 5; + ::google::protobuf::int64 target_param_dim_num() const; + void set_target_param_dim_num(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.DynamicParameterBindingProto.Binding) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dynamic_param_index_; + mutable int _dynamic_param_index_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > target_param_index_; + mutable int _target_param_index_cached_byte_size_; + ::google::protobuf::int64 dynamic_param_num_; + ::google::protobuf::int64 target_param_num_; + ::google::protobuf::int64 target_param_dim_num_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DynamicParameterBindingProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DynamicParameterBindingProto) */ { + public: + DynamicParameterBindingProto(); + virtual ~DynamicParameterBindingProto(); + + DynamicParameterBindingProto(const DynamicParameterBindingProto& from); + + inline DynamicParameterBindingProto& operator=(const DynamicParameterBindingProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DynamicParameterBindingProto(DynamicParameterBindingProto&& from) noexcept + : DynamicParameterBindingProto() { + *this = ::std::move(from); + } + + inline DynamicParameterBindingProto& operator=(DynamicParameterBindingProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DynamicParameterBindingProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DynamicParameterBindingProto* internal_default_instance() { + return reinterpret_cast( + &_DynamicParameterBindingProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void UnsafeArenaSwap(DynamicParameterBindingProto* other); + void Swap(DynamicParameterBindingProto* other); + friend void swap(DynamicParameterBindingProto& a, DynamicParameterBindingProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DynamicParameterBindingProto* New() const final { + return CreateMaybeMessage(NULL); + } + + DynamicParameterBindingProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DynamicParameterBindingProto& from); + void MergeFrom(const DynamicParameterBindingProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DynamicParameterBindingProto* other); + protected: + explicit DynamicParameterBindingProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef DynamicParameterBindingProto_Binding Binding; + + // accessors ------------------------------------------------------- + + // repeated .xla.DynamicParameterBindingProto.Binding entries = 1; + int entries_size() const; + void clear_entries(); + static const int kEntriesFieldNumber = 1; + ::xla::DynamicParameterBindingProto_Binding* mutable_entries(int index); + ::google::protobuf::RepeatedPtrField< ::xla::DynamicParameterBindingProto_Binding >* + mutable_entries(); + const ::xla::DynamicParameterBindingProto_Binding& entries(int index) const; + ::xla::DynamicParameterBindingProto_Binding* add_entries(); + const ::google::protobuf::RepeatedPtrField< ::xla::DynamicParameterBindingProto_Binding >& + entries() const; + + // @@protoc_insertion_point(class_scope:xla.DynamicParameterBindingProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::DynamicParameterBindingProto_Binding > entries_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloModuleProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloModuleProto) */ { + public: + HloModuleProto(); + virtual ~HloModuleProto(); + + HloModuleProto(const HloModuleProto& from); + + inline HloModuleProto& operator=(const HloModuleProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloModuleProto(HloModuleProto&& from) noexcept + : HloModuleProto() { + *this = ::std::move(from); + } + + inline HloModuleProto& operator=(HloModuleProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloModuleProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloModuleProto* internal_default_instance() { + return reinterpret_cast( + &_HloModuleProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void UnsafeArenaSwap(HloModuleProto* other); + void Swap(HloModuleProto* other); + friend void swap(HloModuleProto& a, HloModuleProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloModuleProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloModuleProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloModuleProto& from); + void MergeFrom(const HloModuleProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloModuleProto* other); + protected: + explicit HloModuleProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.HloComputationProto computations = 3; + int computations_size() const; + void clear_computations(); + static const int kComputationsFieldNumber = 3; + ::xla::HloComputationProto* mutable_computations(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloComputationProto >* + mutable_computations(); + const ::xla::HloComputationProto& computations(int index) const; + ::xla::HloComputationProto* add_computations(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloComputationProto >& + computations() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string entry_computation_name = 2; + void clear_entry_computation_name(); + static const int kEntryComputationNameFieldNumber = 2; + const ::std::string& entry_computation_name() const; + void set_entry_computation_name(const ::std::string& value); + #if LANG_CXX11 + void set_entry_computation_name(::std::string&& value); + #endif + void set_entry_computation_name(const char* value); + void set_entry_computation_name(const char* value, size_t size); + ::std::string* mutable_entry_computation_name(); + ::std::string* release_entry_computation_name(); + void set_allocated_entry_computation_name(::std::string* entry_computation_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_entry_computation_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_entry_computation_name( + ::std::string* entry_computation_name); + + // .xla.ProgramShapeProto host_program_shape = 4; + bool has_host_program_shape() const; + void clear_host_program_shape(); + static const int kHostProgramShapeFieldNumber = 4; + private: + const ::xla::ProgramShapeProto& _internal_host_program_shape() const; + public: + const ::xla::ProgramShapeProto& host_program_shape() const; + ::xla::ProgramShapeProto* release_host_program_shape(); + ::xla::ProgramShapeProto* mutable_host_program_shape(); + void set_allocated_host_program_shape(::xla::ProgramShapeProto* host_program_shape); + void unsafe_arena_set_allocated_host_program_shape( + ::xla::ProgramShapeProto* host_program_shape); + ::xla::ProgramShapeProto* unsafe_arena_release_host_program_shape(); + + // .xla.HloScheduleProto schedule = 7; + bool has_schedule() const; + void clear_schedule(); + static const int kScheduleFieldNumber = 7; + private: + const ::xla::HloScheduleProto& _internal_schedule() const; + public: + const ::xla::HloScheduleProto& schedule() const; + ::xla::HloScheduleProto* release_schedule(); + ::xla::HloScheduleProto* mutable_schedule(); + void set_allocated_schedule(::xla::HloScheduleProto* schedule); + void unsafe_arena_set_allocated_schedule( + ::xla::HloScheduleProto* schedule); + ::xla::HloScheduleProto* unsafe_arena_release_schedule(); + + // .xla.HloInputOutputAliasProto input_output_alias = 8; + bool has_input_output_alias() const; + void clear_input_output_alias(); + static const int kInputOutputAliasFieldNumber = 8; + private: + const ::xla::HloInputOutputAliasProto& _internal_input_output_alias() const; + public: + const ::xla::HloInputOutputAliasProto& input_output_alias() const; + ::xla::HloInputOutputAliasProto* release_input_output_alias(); + ::xla::HloInputOutputAliasProto* mutable_input_output_alias(); + void set_allocated_input_output_alias(::xla::HloInputOutputAliasProto* input_output_alias); + void unsafe_arena_set_allocated_input_output_alias( + ::xla::HloInputOutputAliasProto* input_output_alias); + ::xla::HloInputOutputAliasProto* unsafe_arena_release_input_output_alias(); + + // .xla.DynamicParameterBindingProto dynamic_parameter_binding = 9; + bool has_dynamic_parameter_binding() const; + void clear_dynamic_parameter_binding(); + static const int kDynamicParameterBindingFieldNumber = 9; + private: + const ::xla::DynamicParameterBindingProto& _internal_dynamic_parameter_binding() const; + public: + const ::xla::DynamicParameterBindingProto& dynamic_parameter_binding() const; + ::xla::DynamicParameterBindingProto* release_dynamic_parameter_binding(); + ::xla::DynamicParameterBindingProto* mutable_dynamic_parameter_binding(); + void set_allocated_dynamic_parameter_binding(::xla::DynamicParameterBindingProto* dynamic_parameter_binding); + void unsafe_arena_set_allocated_dynamic_parameter_binding( + ::xla::DynamicParameterBindingProto* dynamic_parameter_binding); + ::xla::DynamicParameterBindingProto* unsafe_arena_release_dynamic_parameter_binding(); + + // int64 id = 5; + void clear_id(); + static const int kIdFieldNumber = 5; + ::google::protobuf::int64 id() const; + void set_id(::google::protobuf::int64 value); + + // int64 entry_computation_id = 6; + void clear_entry_computation_id(); + static const int kEntryComputationIdFieldNumber = 6; + ::google::protobuf::int64 entry_computation_id() const; + void set_entry_computation_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloModuleProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HloComputationProto > computations_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr entry_computation_name_; + ::xla::ProgramShapeProto* host_program_shape_; + ::xla::HloScheduleProto* schedule_; + ::xla::HloInputOutputAliasProto* input_output_alias_; + ::xla::DynamicParameterBindingProto* dynamic_parameter_binding_; + ::google::protobuf::int64 id_; + ::google::protobuf::int64 entry_computation_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LogicalBufferProto_Location : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.LogicalBufferProto.Location) */ { + public: + LogicalBufferProto_Location(); + virtual ~LogicalBufferProto_Location(); + + LogicalBufferProto_Location(const LogicalBufferProto_Location& from); + + inline LogicalBufferProto_Location& operator=(const LogicalBufferProto_Location& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LogicalBufferProto_Location(LogicalBufferProto_Location&& from) noexcept + : LogicalBufferProto_Location() { + *this = ::std::move(from); + } + + inline LogicalBufferProto_Location& operator=(LogicalBufferProto_Location&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LogicalBufferProto_Location& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LogicalBufferProto_Location* internal_default_instance() { + return reinterpret_cast( + &_LogicalBufferProto_Location_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void UnsafeArenaSwap(LogicalBufferProto_Location* other); + void Swap(LogicalBufferProto_Location* other); + friend void swap(LogicalBufferProto_Location& a, LogicalBufferProto_Location& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LogicalBufferProto_Location* New() const final { + return CreateMaybeMessage(NULL); + } + + LogicalBufferProto_Location* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LogicalBufferProto_Location& from); + void MergeFrom(const LogicalBufferProto_Location& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LogicalBufferProto_Location* other); + protected: + explicit LogicalBufferProto_Location(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 shape_index = 3; + int shape_index_size() const; + void clear_shape_index(); + static const int kShapeIndexFieldNumber = 3; + ::google::protobuf::int64 shape_index(int index) const; + void set_shape_index(int index, ::google::protobuf::int64 value); + void add_shape_index(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + shape_index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_shape_index(); + + // string computation_name = 1; + void clear_computation_name(); + static const int kComputationNameFieldNumber = 1; + const ::std::string& computation_name() const; + void set_computation_name(const ::std::string& value); + #if LANG_CXX11 + void set_computation_name(::std::string&& value); + #endif + void set_computation_name(const char* value); + void set_computation_name(const char* value, size_t size); + ::std::string* mutable_computation_name(); + ::std::string* release_computation_name(); + void set_allocated_computation_name(::std::string* computation_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_computation_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_computation_name( + ::std::string* computation_name); + + // string instruction_name = 2; + void clear_instruction_name(); + static const int kInstructionNameFieldNumber = 2; + const ::std::string& instruction_name() const; + void set_instruction_name(const ::std::string& value); + #if LANG_CXX11 + void set_instruction_name(::std::string&& value); + #endif + void set_instruction_name(const char* value); + void set_instruction_name(const char* value, size_t size); + ::std::string* mutable_instruction_name(); + ::std::string* release_instruction_name(); + void set_allocated_instruction_name(::std::string* instruction_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_instruction_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_instruction_name( + ::std::string* instruction_name); + + // @@protoc_insertion_point(class_scope:xla.LogicalBufferProto.Location) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > shape_index_; + mutable int _shape_index_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr computation_name_; + ::google::protobuf::internal::ArenaStringPtr instruction_name_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LogicalBufferProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.LogicalBufferProto) */ { + public: + LogicalBufferProto(); + virtual ~LogicalBufferProto(); + + LogicalBufferProto(const LogicalBufferProto& from); + + inline LogicalBufferProto& operator=(const LogicalBufferProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LogicalBufferProto(LogicalBufferProto&& from) noexcept + : LogicalBufferProto() { + *this = ::std::move(from); + } + + inline LogicalBufferProto& operator=(LogicalBufferProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LogicalBufferProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LogicalBufferProto* internal_default_instance() { + return reinterpret_cast( + &_LogicalBufferProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void UnsafeArenaSwap(LogicalBufferProto* other); + void Swap(LogicalBufferProto* other); + friend void swap(LogicalBufferProto& a, LogicalBufferProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LogicalBufferProto* New() const final { + return CreateMaybeMessage(NULL); + } + + LogicalBufferProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LogicalBufferProto& from); + void MergeFrom(const LogicalBufferProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LogicalBufferProto* other); + protected: + explicit LogicalBufferProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef LogicalBufferProto_Location Location; + + // accessors ------------------------------------------------------- + + // .xla.LogicalBufferProto.Location defined_at = 3; + bool has_defined_at() const; + void clear_defined_at(); + static const int kDefinedAtFieldNumber = 3; + private: + const ::xla::LogicalBufferProto_Location& _internal_defined_at() const; + public: + const ::xla::LogicalBufferProto_Location& defined_at() const; + ::xla::LogicalBufferProto_Location* release_defined_at(); + ::xla::LogicalBufferProto_Location* mutable_defined_at(); + void set_allocated_defined_at(::xla::LogicalBufferProto_Location* defined_at); + void unsafe_arena_set_allocated_defined_at( + ::xla::LogicalBufferProto_Location* defined_at); + ::xla::LogicalBufferProto_Location* unsafe_arena_release_defined_at(); + + // int64 id = 1; + void clear_id(); + static const int kIdFieldNumber = 1; + ::google::protobuf::int64 id() const; + void set_id(::google::protobuf::int64 value); + + // int64 size = 2; + void clear_size(); + static const int kSizeFieldNumber = 2; + ::google::protobuf::int64 size() const; + void set_size(::google::protobuf::int64 value); + + // int64 color = 4; + void clear_color(); + static const int kColorFieldNumber = 4; + ::google::protobuf::int64 color() const; + void set_color(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.LogicalBufferProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::xla::LogicalBufferProto_Location* defined_at_; + ::google::protobuf::int64 id_; + ::google::protobuf::int64 size_; + ::google::protobuf::int64 color_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class BufferAllocationProto_Assigned : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.BufferAllocationProto.Assigned) */ { + public: + BufferAllocationProto_Assigned(); + virtual ~BufferAllocationProto_Assigned(); + + BufferAllocationProto_Assigned(const BufferAllocationProto_Assigned& from); + + inline BufferAllocationProto_Assigned& operator=(const BufferAllocationProto_Assigned& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BufferAllocationProto_Assigned(BufferAllocationProto_Assigned&& from) noexcept + : BufferAllocationProto_Assigned() { + *this = ::std::move(from); + } + + inline BufferAllocationProto_Assigned& operator=(BufferAllocationProto_Assigned&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BufferAllocationProto_Assigned& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BufferAllocationProto_Assigned* internal_default_instance() { + return reinterpret_cast( + &_BufferAllocationProto_Assigned_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void UnsafeArenaSwap(BufferAllocationProto_Assigned* other); + void Swap(BufferAllocationProto_Assigned* other); + friend void swap(BufferAllocationProto_Assigned& a, BufferAllocationProto_Assigned& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BufferAllocationProto_Assigned* New() const final { + return CreateMaybeMessage(NULL); + } + + BufferAllocationProto_Assigned* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BufferAllocationProto_Assigned& from); + void MergeFrom(const BufferAllocationProto_Assigned& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BufferAllocationProto_Assigned* other); + protected: + explicit BufferAllocationProto_Assigned(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 logical_buffer_id = 1; + void clear_logical_buffer_id(); + static const int kLogicalBufferIdFieldNumber = 1; + ::google::protobuf::int64 logical_buffer_id() const; + void set_logical_buffer_id(::google::protobuf::int64 value); + + // int64 offset = 2; + void clear_offset(); + static const int kOffsetFieldNumber = 2; + ::google::protobuf::int64 offset() const; + void set_offset(::google::protobuf::int64 value); + + // int64 size = 3; + void clear_size(); + static const int kSizeFieldNumber = 3; + ::google::protobuf::int64 size() const; + void set_size(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.BufferAllocationProto.Assigned) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 logical_buffer_id_; + ::google::protobuf::int64 offset_; + ::google::protobuf::int64 size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class BufferAllocationProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.BufferAllocationProto) */ { + public: + BufferAllocationProto(); + virtual ~BufferAllocationProto(); + + BufferAllocationProto(const BufferAllocationProto& from); + + inline BufferAllocationProto& operator=(const BufferAllocationProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BufferAllocationProto(BufferAllocationProto&& from) noexcept + : BufferAllocationProto() { + *this = ::std::move(from); + } + + inline BufferAllocationProto& operator=(BufferAllocationProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BufferAllocationProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BufferAllocationProto* internal_default_instance() { + return reinterpret_cast( + &_BufferAllocationProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + void UnsafeArenaSwap(BufferAllocationProto* other); + void Swap(BufferAllocationProto* other); + friend void swap(BufferAllocationProto& a, BufferAllocationProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BufferAllocationProto* New() const final { + return CreateMaybeMessage(NULL); + } + + BufferAllocationProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BufferAllocationProto& from); + void MergeFrom(const BufferAllocationProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BufferAllocationProto* other); + protected: + explicit BufferAllocationProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef BufferAllocationProto_Assigned Assigned; + + // accessors ------------------------------------------------------- + + // repeated .xla.BufferAllocationProto.Assigned assigned = 9; + int assigned_size() const; + void clear_assigned(); + static const int kAssignedFieldNumber = 9; + ::xla::BufferAllocationProto_Assigned* mutable_assigned(int index); + ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto_Assigned >* + mutable_assigned(); + const ::xla::BufferAllocationProto_Assigned& assigned(int index) const; + ::xla::BufferAllocationProto_Assigned* add_assigned(); + const ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto_Assigned >& + assigned() const; + + // repeated int64 parameter_shape_index = 10; + int parameter_shape_index_size() const; + void clear_parameter_shape_index(); + static const int kParameterShapeIndexFieldNumber = 10; + ::google::protobuf::int64 parameter_shape_index(int index) const; + void set_parameter_shape_index(int index, ::google::protobuf::int64 value); + void add_parameter_shape_index(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + parameter_shape_index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_parameter_shape_index(); + + // int64 index = 1; + void clear_index(); + static const int kIndexFieldNumber = 1; + ::google::protobuf::int64 index() const; + void set_index(::google::protobuf::int64 value); + + // int64 size = 2; + void clear_size(); + static const int kSizeFieldNumber = 2; + ::google::protobuf::int64 size() const; + void set_size(::google::protobuf::int64 value); + + // int64 parameter_number = 6; + void clear_parameter_number(); + static const int kParameterNumberFieldNumber = 6; + ::google::protobuf::int64 parameter_number() const; + void set_parameter_number(::google::protobuf::int64 value); + + // bool maybe_live_out = 7; + void clear_maybe_live_out(); + static const int kMaybeLiveOutFieldNumber = 7; + bool maybe_live_out() const; + void set_maybe_live_out(bool value); + + // bool is_thread_local = 3; + void clear_is_thread_local(); + static const int kIsThreadLocalFieldNumber = 3; + bool is_thread_local() const; + void set_is_thread_local(bool value); + + // bool is_tuple = 11; + void clear_is_tuple(); + static const int kIsTupleFieldNumber = 11; + bool is_tuple() const; + void set_is_tuple(bool value); + + // bool is_entry_computation_parameter = 5; + void clear_is_entry_computation_parameter(); + static const int kIsEntryComputationParameterFieldNumber = 5; + bool is_entry_computation_parameter() const; + void set_is_entry_computation_parameter(bool value); + + // bool is_constant = 12; + void clear_is_constant(); + static const int kIsConstantFieldNumber = 12; + bool is_constant() const; + void set_is_constant(bool value); + + // int64 color = 8; + void clear_color(); + static const int kColorFieldNumber = 8; + ::google::protobuf::int64 color() const; + void set_color(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.BufferAllocationProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto_Assigned > assigned_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > parameter_shape_index_; + mutable int _parameter_shape_index_cached_byte_size_; + ::google::protobuf::int64 index_; + ::google::protobuf::int64 size_; + ::google::protobuf::int64 parameter_number_; + bool maybe_live_out_; + bool is_thread_local_; + bool is_tuple_; + bool is_entry_computation_parameter_; + bool is_constant_; + ::google::protobuf::int64 color_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HeapSimulatorTrace_Event : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HeapSimulatorTrace.Event) */ { + public: + HeapSimulatorTrace_Event(); + virtual ~HeapSimulatorTrace_Event(); + + HeapSimulatorTrace_Event(const HeapSimulatorTrace_Event& from); + + inline HeapSimulatorTrace_Event& operator=(const HeapSimulatorTrace_Event& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HeapSimulatorTrace_Event(HeapSimulatorTrace_Event&& from) noexcept + : HeapSimulatorTrace_Event() { + *this = ::std::move(from); + } + + inline HeapSimulatorTrace_Event& operator=(HeapSimulatorTrace_Event&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HeapSimulatorTrace_Event& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HeapSimulatorTrace_Event* internal_default_instance() { + return reinterpret_cast( + &_HeapSimulatorTrace_Event_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void UnsafeArenaSwap(HeapSimulatorTrace_Event* other); + void Swap(HeapSimulatorTrace_Event* other); + friend void swap(HeapSimulatorTrace_Event& a, HeapSimulatorTrace_Event& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HeapSimulatorTrace_Event* New() const final { + return CreateMaybeMessage(NULL); + } + + HeapSimulatorTrace_Event* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HeapSimulatorTrace_Event& from); + void MergeFrom(const HeapSimulatorTrace_Event& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HeapSimulatorTrace_Event* other); + protected: + explicit HeapSimulatorTrace_Event(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HeapSimulatorTrace_Event_Kind Kind; + static const Kind ALLOC = + HeapSimulatorTrace_Event_Kind_ALLOC; + static const Kind FREE = + HeapSimulatorTrace_Event_Kind_FREE; + static const Kind SHARE_WITH = + HeapSimulatorTrace_Event_Kind_SHARE_WITH; + static inline bool Kind_IsValid(int value) { + return HeapSimulatorTrace_Event_Kind_IsValid(value); + } + static const Kind Kind_MIN = + HeapSimulatorTrace_Event_Kind_Kind_MIN; + static const Kind Kind_MAX = + HeapSimulatorTrace_Event_Kind_Kind_MAX; + static const int Kind_ARRAYSIZE = + HeapSimulatorTrace_Event_Kind_Kind_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Kind_descriptor() { + return HeapSimulatorTrace_Event_Kind_descriptor(); + } + static inline const ::std::string& Kind_Name(Kind value) { + return HeapSimulatorTrace_Event_Kind_Name(value); + } + static inline bool Kind_Parse(const ::std::string& name, + Kind* value) { + return HeapSimulatorTrace_Event_Kind_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // string computation_name = 3; + void clear_computation_name(); + static const int kComputationNameFieldNumber = 3; + const ::std::string& computation_name() const; + void set_computation_name(const ::std::string& value); + #if LANG_CXX11 + void set_computation_name(::std::string&& value); + #endif + void set_computation_name(const char* value); + void set_computation_name(const char* value, size_t size); + ::std::string* mutable_computation_name(); + ::std::string* release_computation_name(); + void set_allocated_computation_name(::std::string* computation_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_computation_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_computation_name( + ::std::string* computation_name); + + // string instruction_name = 4; + void clear_instruction_name(); + static const int kInstructionNameFieldNumber = 4; + const ::std::string& instruction_name() const; + void set_instruction_name(const ::std::string& value); + #if LANG_CXX11 + void set_instruction_name(::std::string&& value); + #endif + void set_instruction_name(const char* value); + void set_instruction_name(const char* value, size_t size); + ::std::string* mutable_instruction_name(); + ::std::string* release_instruction_name(); + void set_allocated_instruction_name(::std::string* instruction_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_instruction_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_instruction_name( + ::std::string* instruction_name); + + // int64 buffer_id = 2; + void clear_buffer_id(); + static const int kBufferIdFieldNumber = 2; + ::google::protobuf::int64 buffer_id() const; + void set_buffer_id(::google::protobuf::int64 value); + + // int64 share_with_canonical_id = 5; + void clear_share_with_canonical_id(); + static const int kShareWithCanonicalIdFieldNumber = 5; + ::google::protobuf::int64 share_with_canonical_id() const; + void set_share_with_canonical_id(::google::protobuf::int64 value); + + // .xla.HeapSimulatorTrace.Event.Kind kind = 1; + void clear_kind(); + static const int kKindFieldNumber = 1; + ::xla::HeapSimulatorTrace_Event_Kind kind() const; + void set_kind(::xla::HeapSimulatorTrace_Event_Kind value); + + // @@protoc_insertion_point(class_scope:xla.HeapSimulatorTrace.Event) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr computation_name_; + ::google::protobuf::internal::ArenaStringPtr instruction_name_; + ::google::protobuf::int64 buffer_id_; + ::google::protobuf::int64 share_with_canonical_id_; + int kind_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HeapSimulatorTrace : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HeapSimulatorTrace) */ { + public: + HeapSimulatorTrace(); + virtual ~HeapSimulatorTrace(); + + HeapSimulatorTrace(const HeapSimulatorTrace& from); + + inline HeapSimulatorTrace& operator=(const HeapSimulatorTrace& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HeapSimulatorTrace(HeapSimulatorTrace&& from) noexcept + : HeapSimulatorTrace() { + *this = ::std::move(from); + } + + inline HeapSimulatorTrace& operator=(HeapSimulatorTrace&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HeapSimulatorTrace& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HeapSimulatorTrace* internal_default_instance() { + return reinterpret_cast( + &_HeapSimulatorTrace_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + void UnsafeArenaSwap(HeapSimulatorTrace* other); + void Swap(HeapSimulatorTrace* other); + friend void swap(HeapSimulatorTrace& a, HeapSimulatorTrace& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HeapSimulatorTrace* New() const final { + return CreateMaybeMessage(NULL); + } + + HeapSimulatorTrace* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HeapSimulatorTrace& from); + void MergeFrom(const HeapSimulatorTrace& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HeapSimulatorTrace* other); + protected: + explicit HeapSimulatorTrace(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HeapSimulatorTrace_Event Event; + + // accessors ------------------------------------------------------- + + // repeated .xla.HeapSimulatorTrace.Event events = 1; + int events_size() const; + void clear_events(); + static const int kEventsFieldNumber = 1; + ::xla::HeapSimulatorTrace_Event* mutable_events(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace_Event >* + mutable_events(); + const ::xla::HeapSimulatorTrace_Event& events(int index) const; + ::xla::HeapSimulatorTrace_Event* add_events(); + const ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace_Event >& + events() const; + + // bool whole_module_simulation = 2; + void clear_whole_module_simulation(); + static const int kWholeModuleSimulationFieldNumber = 2; + bool whole_module_simulation() const; + void set_whole_module_simulation(bool value); + + // @@protoc_insertion_point(class_scope:xla.HeapSimulatorTrace) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace_Event > events_; + bool whole_module_simulation_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloModuleGroupProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloModuleGroupProto) */ { + public: + HloModuleGroupProto(); + virtual ~HloModuleGroupProto(); + + HloModuleGroupProto(const HloModuleGroupProto& from); + + inline HloModuleGroupProto& operator=(const HloModuleGroupProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloModuleGroupProto(HloModuleGroupProto&& from) noexcept + : HloModuleGroupProto() { + *this = ::std::move(from); + } + + inline HloModuleGroupProto& operator=(HloModuleGroupProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloModuleGroupProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloModuleGroupProto* internal_default_instance() { + return reinterpret_cast( + &_HloModuleGroupProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 17; + + void UnsafeArenaSwap(HloModuleGroupProto* other); + void Swap(HloModuleGroupProto* other); + friend void swap(HloModuleGroupProto& a, HloModuleGroupProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloModuleGroupProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloModuleGroupProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloModuleGroupProto& from); + void MergeFrom(const HloModuleGroupProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloModuleGroupProto* other); + protected: + explicit HloModuleGroupProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.HloModuleProto hlo_modules = 2; + int hlo_modules_size() const; + void clear_hlo_modules(); + static const int kHloModulesFieldNumber = 2; + ::xla::HloModuleProto* mutable_hlo_modules(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloModuleProto >* + mutable_hlo_modules(); + const ::xla::HloModuleProto& hlo_modules(int index) const; + ::xla::HloModuleProto* add_hlo_modules(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloModuleProto >& + hlo_modules() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // @@protoc_insertion_point(class_scope:xla.HloModuleGroupProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HloModuleProto > hlo_modules_; + ::google::protobuf::internal::ArenaStringPtr name_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class BufferAssignmentProto_BufferAlias : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.BufferAssignmentProto.BufferAlias) */ { + public: + BufferAssignmentProto_BufferAlias(); + virtual ~BufferAssignmentProto_BufferAlias(); + + BufferAssignmentProto_BufferAlias(const BufferAssignmentProto_BufferAlias& from); + + inline BufferAssignmentProto_BufferAlias& operator=(const BufferAssignmentProto_BufferAlias& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BufferAssignmentProto_BufferAlias(BufferAssignmentProto_BufferAlias&& from) noexcept + : BufferAssignmentProto_BufferAlias() { + *this = ::std::move(from); + } + + inline BufferAssignmentProto_BufferAlias& operator=(BufferAssignmentProto_BufferAlias&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BufferAssignmentProto_BufferAlias& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BufferAssignmentProto_BufferAlias* internal_default_instance() { + return reinterpret_cast( + &_BufferAssignmentProto_BufferAlias_default_instance_); + } + static constexpr int kIndexInFileMessages = + 18; + + void UnsafeArenaSwap(BufferAssignmentProto_BufferAlias* other); + void Swap(BufferAssignmentProto_BufferAlias* other); + friend void swap(BufferAssignmentProto_BufferAlias& a, BufferAssignmentProto_BufferAlias& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BufferAssignmentProto_BufferAlias* New() const final { + return CreateMaybeMessage(NULL); + } + + BufferAssignmentProto_BufferAlias* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BufferAssignmentProto_BufferAlias& from); + void MergeFrom(const BufferAssignmentProto_BufferAlias& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BufferAssignmentProto_BufferAlias* other); + protected: + explicit BufferAssignmentProto_BufferAlias(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.LogicalBufferProto.Location location = 2; + bool has_location() const; + void clear_location(); + static const int kLocationFieldNumber = 2; + private: + const ::xla::LogicalBufferProto_Location& _internal_location() const; + public: + const ::xla::LogicalBufferProto_Location& location() const; + ::xla::LogicalBufferProto_Location* release_location(); + ::xla::LogicalBufferProto_Location* mutable_location(); + void set_allocated_location(::xla::LogicalBufferProto_Location* location); + void unsafe_arena_set_allocated_location( + ::xla::LogicalBufferProto_Location* location); + ::xla::LogicalBufferProto_Location* unsafe_arena_release_location(); + + // int64 source_buffer_id = 1; + void clear_source_buffer_id(); + static const int kSourceBufferIdFieldNumber = 1; + ::google::protobuf::int64 source_buffer_id() const; + void set_source_buffer_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.BufferAssignmentProto.BufferAlias) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::xla::LogicalBufferProto_Location* location_; + ::google::protobuf::int64 source_buffer_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class BufferAssignmentProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.BufferAssignmentProto) */ { + public: + BufferAssignmentProto(); + virtual ~BufferAssignmentProto(); + + BufferAssignmentProto(const BufferAssignmentProto& from); + + inline BufferAssignmentProto& operator=(const BufferAssignmentProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BufferAssignmentProto(BufferAssignmentProto&& from) noexcept + : BufferAssignmentProto() { + *this = ::std::move(from); + } + + inline BufferAssignmentProto& operator=(BufferAssignmentProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BufferAssignmentProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BufferAssignmentProto* internal_default_instance() { + return reinterpret_cast( + &_BufferAssignmentProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 19; + + void UnsafeArenaSwap(BufferAssignmentProto* other); + void Swap(BufferAssignmentProto* other); + friend void swap(BufferAssignmentProto& a, BufferAssignmentProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BufferAssignmentProto* New() const final { + return CreateMaybeMessage(NULL); + } + + BufferAssignmentProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BufferAssignmentProto& from); + void MergeFrom(const BufferAssignmentProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BufferAssignmentProto* other); + protected: + explicit BufferAssignmentProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef BufferAssignmentProto_BufferAlias BufferAlias; + + // accessors ------------------------------------------------------- + + // repeated .xla.LogicalBufferProto logical_buffers = 1; + int logical_buffers_size() const; + void clear_logical_buffers(); + static const int kLogicalBuffersFieldNumber = 1; + ::xla::LogicalBufferProto* mutable_logical_buffers(int index); + ::google::protobuf::RepeatedPtrField< ::xla::LogicalBufferProto >* + mutable_logical_buffers(); + const ::xla::LogicalBufferProto& logical_buffers(int index) const; + ::xla::LogicalBufferProto* add_logical_buffers(); + const ::google::protobuf::RepeatedPtrField< ::xla::LogicalBufferProto >& + logical_buffers() const; + + // repeated .xla.BufferAssignmentProto.BufferAlias buffer_aliases = 2; + int buffer_aliases_size() const; + void clear_buffer_aliases(); + static const int kBufferAliasesFieldNumber = 2; + ::xla::BufferAssignmentProto_BufferAlias* mutable_buffer_aliases(int index); + ::google::protobuf::RepeatedPtrField< ::xla::BufferAssignmentProto_BufferAlias >* + mutable_buffer_aliases(); + const ::xla::BufferAssignmentProto_BufferAlias& buffer_aliases(int index) const; + ::xla::BufferAssignmentProto_BufferAlias* add_buffer_aliases(); + const ::google::protobuf::RepeatedPtrField< ::xla::BufferAssignmentProto_BufferAlias >& + buffer_aliases() const; + + // repeated .xla.BufferAllocationProto buffer_allocations = 3; + int buffer_allocations_size() const; + void clear_buffer_allocations(); + static const int kBufferAllocationsFieldNumber = 3; + ::xla::BufferAllocationProto* mutable_buffer_allocations(int index); + ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto >* + mutable_buffer_allocations(); + const ::xla::BufferAllocationProto& buffer_allocations(int index) const; + ::xla::BufferAllocationProto* add_buffer_allocations(); + const ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto >& + buffer_allocations() const; + + // repeated .xla.HeapSimulatorTrace heap_simulator_traces = 4; + int heap_simulator_traces_size() const; + void clear_heap_simulator_traces(); + static const int kHeapSimulatorTracesFieldNumber = 4; + ::xla::HeapSimulatorTrace* mutable_heap_simulator_traces(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace >* + mutable_heap_simulator_traces(); + const ::xla::HeapSimulatorTrace& heap_simulator_traces(int index) const; + ::xla::HeapSimulatorTrace* add_heap_simulator_traces(); + const ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace >& + heap_simulator_traces() const; + + // @@protoc_insertion_point(class_scope:xla.BufferAssignmentProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::LogicalBufferProto > logical_buffers_; + ::google::protobuf::RepeatedPtrField< ::xla::BufferAssignmentProto_BufferAlias > buffer_aliases_; + ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto > buffer_allocations_; + ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace > heap_simulator_traces_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloProto) */ { + public: + HloProto(); + virtual ~HloProto(); + + HloProto(const HloProto& from); + + inline HloProto& operator=(const HloProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloProto(HloProto&& from) noexcept + : HloProto() { + *this = ::std::move(from); + } + + inline HloProto& operator=(HloProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloProto* internal_default_instance() { + return reinterpret_cast( + &_HloProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 20; + + void UnsafeArenaSwap(HloProto* other); + void Swap(HloProto* other); + friend void swap(HloProto& a, HloProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HloProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloProto& from); + void MergeFrom(const HloProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloProto* other); + protected: + explicit HloProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.HloModuleProto hlo_module = 1; + bool has_hlo_module() const; + void clear_hlo_module(); + static const int kHloModuleFieldNumber = 1; + private: + const ::xla::HloModuleProto& _internal_hlo_module() const; + public: + const ::xla::HloModuleProto& hlo_module() const; + ::xla::HloModuleProto* release_hlo_module(); + ::xla::HloModuleProto* mutable_hlo_module(); + void set_allocated_hlo_module(::xla::HloModuleProto* hlo_module); + void unsafe_arena_set_allocated_hlo_module( + ::xla::HloModuleProto* hlo_module); + ::xla::HloModuleProto* unsafe_arena_release_hlo_module(); + + // .xla.BufferAssignmentProto buffer_assignment = 3; + bool has_buffer_assignment() const; + void clear_buffer_assignment(); + static const int kBufferAssignmentFieldNumber = 3; + private: + const ::xla::BufferAssignmentProto& _internal_buffer_assignment() const; + public: + const ::xla::BufferAssignmentProto& buffer_assignment() const; + ::xla::BufferAssignmentProto* release_buffer_assignment(); + ::xla::BufferAssignmentProto* mutable_buffer_assignment(); + void set_allocated_buffer_assignment(::xla::BufferAssignmentProto* buffer_assignment); + void unsafe_arena_set_allocated_buffer_assignment( + ::xla::BufferAssignmentProto* buffer_assignment); + ::xla::BufferAssignmentProto* unsafe_arena_release_buffer_assignment(); + + // @@protoc_insertion_point(class_scope:xla.HloProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::xla::HloModuleProto* hlo_module_; + ::xla::BufferAssignmentProto* buffer_assignment_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloSnapshot : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloSnapshot) */ { + public: + HloSnapshot(); + virtual ~HloSnapshot(); + + HloSnapshot(const HloSnapshot& from); + + inline HloSnapshot& operator=(const HloSnapshot& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloSnapshot(HloSnapshot&& from) noexcept + : HloSnapshot() { + *this = ::std::move(from); + } + + inline HloSnapshot& operator=(HloSnapshot&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloSnapshot& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloSnapshot* internal_default_instance() { + return reinterpret_cast( + &_HloSnapshot_default_instance_); + } + static constexpr int kIndexInFileMessages = + 21; + + void UnsafeArenaSwap(HloSnapshot* other); + void Swap(HloSnapshot* other); + friend void swap(HloSnapshot& a, HloSnapshot& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloSnapshot* New() const final { + return CreateMaybeMessage(NULL); + } + + HloSnapshot* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloSnapshot& from); + void MergeFrom(const HloSnapshot& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloSnapshot* other); + protected: + explicit HloSnapshot(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.LiteralProto arguments = 2; + int arguments_size() const; + void clear_arguments(); + static const int kArgumentsFieldNumber = 2; + ::xla::LiteralProto* mutable_arguments(int index); + ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >* + mutable_arguments(); + const ::xla::LiteralProto& arguments(int index) const; + ::xla::LiteralProto* add_arguments(); + const ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >& + arguments() const; + + // string execution_platform = 4; + void clear_execution_platform(); + static const int kExecutionPlatformFieldNumber = 4; + const ::std::string& execution_platform() const; + void set_execution_platform(const ::std::string& value); + #if LANG_CXX11 + void set_execution_platform(::std::string&& value); + #endif + void set_execution_platform(const char* value); + void set_execution_platform(const char* value, size_t size); + ::std::string* mutable_execution_platform(); + ::std::string* release_execution_platform(); + void set_allocated_execution_platform(::std::string* execution_platform); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_execution_platform(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_execution_platform( + ::std::string* execution_platform); + + // .xla.HloProto hlo = 1; + bool has_hlo() const; + void clear_hlo(); + static const int kHloFieldNumber = 1; + private: + const ::xla::HloProto& _internal_hlo() const; + public: + const ::xla::HloProto& hlo() const; + ::xla::HloProto* release_hlo(); + ::xla::HloProto* mutable_hlo(); + void set_allocated_hlo(::xla::HloProto* hlo); + void unsafe_arena_set_allocated_hlo( + ::xla::HloProto* hlo); + ::xla::HloProto* unsafe_arena_release_hlo(); + + // .xla.LiteralProto result = 3; + bool has_result() const; + void clear_result(); + static const int kResultFieldNumber = 3; + private: + const ::xla::LiteralProto& _internal_result() const; + public: + const ::xla::LiteralProto& result() const; + ::xla::LiteralProto* release_result(); + ::xla::LiteralProto* mutable_result(); + void set_allocated_result(::xla::LiteralProto* result); + void unsafe_arena_set_allocated_result( + ::xla::LiteralProto* result); + ::xla::LiteralProto* unsafe_arena_release_result(); + + // @@protoc_insertion_point(class_scope:xla.HloSnapshot) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto > arguments_; + ::google::protobuf::internal::ArenaStringPtr execution_platform_; + ::xla::HloProto* hlo_; + ::xla::LiteralProto* result_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// HloInstructionProto_SliceDimensions + +// int64 start = 1; +inline void HloInstructionProto_SliceDimensions::clear_start() { + start_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto_SliceDimensions::start() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.SliceDimensions.start) + return start_; +} +inline void HloInstructionProto_SliceDimensions::set_start(::google::protobuf::int64 value) { + + start_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.SliceDimensions.start) +} + +// int64 limit = 2; +inline void HloInstructionProto_SliceDimensions::clear_limit() { + limit_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto_SliceDimensions::limit() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.SliceDimensions.limit) + return limit_; +} +inline void HloInstructionProto_SliceDimensions::set_limit(::google::protobuf::int64 value) { + + limit_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.SliceDimensions.limit) +} + +// int64 stride = 3; +inline void HloInstructionProto_SliceDimensions::clear_stride() { + stride_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto_SliceDimensions::stride() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.SliceDimensions.stride) + return stride_; +} +inline void HloInstructionProto_SliceDimensions::set_stride(::google::protobuf::int64 value) { + + stride_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.SliceDimensions.stride) +} + +// ------------------------------------------------------------------- + +// HloInstructionProto + +// string name = 1; +inline void HloInstructionProto::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::name() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.name) + return name_.Get(); +} +inline void HloInstructionProto::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.name) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.name) +} +#endif +inline void HloInstructionProto::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.name) +} +inline void HloInstructionProto::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.name) +} +inline ::std::string* HloInstructionProto::mutable_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_name() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.name) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.name) +} + +// string opcode = 2; +inline void HloInstructionProto::clear_opcode() { + opcode_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::opcode() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.opcode) + return opcode_.Get(); +} +inline void HloInstructionProto::set_opcode(const ::std::string& value) { + + opcode_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.opcode) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_opcode(::std::string&& value) { + + opcode_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.opcode) +} +#endif +inline void HloInstructionProto::set_opcode(const char* value) { + GOOGLE_DCHECK(value != NULL); + + opcode_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.opcode) +} +inline void HloInstructionProto::set_opcode(const char* value, + size_t size) { + + opcode_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.opcode) +} +inline ::std::string* HloInstructionProto::mutable_opcode() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.opcode) + return opcode_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_opcode() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.opcode) + + return opcode_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_opcode(::std::string* opcode) { + if (opcode != NULL) { + + } else { + + } + opcode_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), opcode, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.opcode) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_opcode() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.opcode) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return opcode_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_opcode( + ::std::string* opcode) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (opcode != NULL) { + + } else { + + } + opcode_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + opcode, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.opcode) +} + +// .xla.ShapeProto shape = 3; +inline bool HloInstructionProto::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::xla::ShapeProto& HloInstructionProto::_internal_shape() const { + return *shape_; +} +inline const ::xla::ShapeProto& HloInstructionProto::shape() const { + const ::xla::ShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* HloInstructionProto::release_shape() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.shape) + + ::xla::ShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* HloInstructionProto::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.shape) + + ::xla::ShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* HloInstructionProto::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.shape) + return shape_; +} +inline void HloInstructionProto::set_allocated_shape(::xla::ShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.shape) +} + +// .xla.OpMetadata metadata = 7; +inline bool HloInstructionProto::has_metadata() const { + return this != internal_default_instance() && metadata_ != NULL; +} +inline const ::xla::OpMetadata& HloInstructionProto::_internal_metadata() const { + return *metadata_; +} +inline const ::xla::OpMetadata& HloInstructionProto::metadata() const { + const ::xla::OpMetadata* p = metadata_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.metadata) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_OpMetadata_default_instance_); +} +inline ::xla::OpMetadata* HloInstructionProto::release_metadata() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.metadata) + + ::xla::OpMetadata* temp = metadata_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + metadata_ = NULL; + return temp; +} +inline ::xla::OpMetadata* HloInstructionProto::unsafe_arena_release_metadata() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.metadata) + + ::xla::OpMetadata* temp = metadata_; + metadata_ = NULL; + return temp; +} +inline ::xla::OpMetadata* HloInstructionProto::mutable_metadata() { + + if (metadata_ == NULL) { + auto* p = CreateMaybeMessage<::xla::OpMetadata>(GetArenaNoVirtual()); + metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.metadata) + return metadata_; +} +inline void HloInstructionProto::set_allocated_metadata(::xla::OpMetadata* metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(metadata_); + } + if (metadata) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(metadata)->GetArena(); + if (message_arena != submessage_arena) { + metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, metadata, submessage_arena); + } + + } else { + + } + metadata_ = metadata; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.metadata) +} + +// .xla.LiteralProto literal = 8; +inline bool HloInstructionProto::has_literal() const { + return this != internal_default_instance() && literal_ != NULL; +} +inline const ::xla::LiteralProto& HloInstructionProto::_internal_literal() const { + return *literal_; +} +inline const ::xla::LiteralProto& HloInstructionProto::literal() const { + const ::xla::LiteralProto* p = literal_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.literal) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* HloInstructionProto::release_literal() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.literal) + + ::xla::LiteralProto* temp = literal_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + literal_ = NULL; + return temp; +} +inline ::xla::LiteralProto* HloInstructionProto::unsafe_arena_release_literal() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.literal) + + ::xla::LiteralProto* temp = literal_; + literal_ = NULL; + return temp; +} +inline ::xla::LiteralProto* HloInstructionProto::mutable_literal() { + + if (literal_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + literal_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.literal) + return literal_; +} +inline void HloInstructionProto::set_allocated_literal(::xla::LiteralProto* literal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(literal_); + } + if (literal) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(literal)->GetArena(); + if (message_arena != submessage_arena) { + literal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, literal, submessage_arena); + } + + } else { + + } + literal_ = literal; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.literal) +} + +// int64 parameter_number = 9; +inline void HloInstructionProto::clear_parameter_number() { + parameter_number_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::parameter_number() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.parameter_number) + return parameter_number_; +} +inline void HloInstructionProto::set_parameter_number(::google::protobuf::int64 value) { + + parameter_number_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.parameter_number) +} + +// string fusion_kind = 11; +inline void HloInstructionProto::clear_fusion_kind() { + fusion_kind_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::fusion_kind() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.fusion_kind) + return fusion_kind_.Get(); +} +inline void HloInstructionProto::set_fusion_kind(const ::std::string& value) { + + fusion_kind_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.fusion_kind) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_fusion_kind(::std::string&& value) { + + fusion_kind_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.fusion_kind) +} +#endif +inline void HloInstructionProto::set_fusion_kind(const char* value) { + GOOGLE_DCHECK(value != NULL); + + fusion_kind_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.fusion_kind) +} +inline void HloInstructionProto::set_fusion_kind(const char* value, + size_t size) { + + fusion_kind_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.fusion_kind) +} +inline ::std::string* HloInstructionProto::mutable_fusion_kind() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.fusion_kind) + return fusion_kind_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_fusion_kind() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.fusion_kind) + + return fusion_kind_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_fusion_kind(::std::string* fusion_kind) { + if (fusion_kind != NULL) { + + } else { + + } + fusion_kind_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), fusion_kind, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.fusion_kind) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_fusion_kind() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.fusion_kind) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return fusion_kind_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_fusion_kind( + ::std::string* fusion_kind) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (fusion_kind != NULL) { + + } else { + + } + fusion_kind_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + fusion_kind, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.fusion_kind) +} + +// int64 tuple_index = 13; +inline void HloInstructionProto::clear_tuple_index() { + tuple_index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::tuple_index() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.tuple_index) + return tuple_index_; +} +inline void HloInstructionProto::set_tuple_index(::google::protobuf::int64 value) { + + tuple_index_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.tuple_index) +} + +// repeated int64 dimensions = 14; +inline int HloInstructionProto::dimensions_size() const { + return dimensions_.size(); +} +inline void HloInstructionProto::clear_dimensions() { + dimensions_.Clear(); +} +inline ::google::protobuf::int64 HloInstructionProto::dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.dimensions) + return dimensions_.Get(index); +} +inline void HloInstructionProto::set_dimensions(int index, ::google::protobuf::int64 value) { + dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.dimensions) +} +inline void HloInstructionProto::add_dimensions(::google::protobuf::int64 value) { + dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInstructionProto::dimensions() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.dimensions) + return dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInstructionProto::mutable_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.dimensions) + return &dimensions_; +} + +// .xla.Window window = 15; +inline bool HloInstructionProto::has_window() const { + return this != internal_default_instance() && window_ != NULL; +} +inline const ::xla::Window& HloInstructionProto::_internal_window() const { + return *window_; +} +inline const ::xla::Window& HloInstructionProto::window() const { + const ::xla::Window* p = window_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.window) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_Window_default_instance_); +} +inline ::xla::Window* HloInstructionProto::release_window() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.window) + + ::xla::Window* temp = window_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + window_ = NULL; + return temp; +} +inline ::xla::Window* HloInstructionProto::unsafe_arena_release_window() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.window) + + ::xla::Window* temp = window_; + window_ = NULL; + return temp; +} +inline ::xla::Window* HloInstructionProto::mutable_window() { + + if (window_ == NULL) { + auto* p = CreateMaybeMessage<::xla::Window>(GetArenaNoVirtual()); + window_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.window) + return window_; +} +inline void HloInstructionProto::set_allocated_window(::xla::Window* window) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(window_); + } + if (window) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(window)->GetArena(); + if (message_arena != submessage_arena) { + window = ::google::protobuf::internal::GetOwnedMessage( + message_arena, window, submessage_arena); + } + + } else { + + } + window_ = window; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.window) +} + +// .xla.ConvolutionDimensionNumbers convolution_dimension_numbers = 16; +inline bool HloInstructionProto::has_convolution_dimension_numbers() const { + return this != internal_default_instance() && convolution_dimension_numbers_ != NULL; +} +inline const ::xla::ConvolutionDimensionNumbers& HloInstructionProto::_internal_convolution_dimension_numbers() const { + return *convolution_dimension_numbers_; +} +inline const ::xla::ConvolutionDimensionNumbers& HloInstructionProto::convolution_dimension_numbers() const { + const ::xla::ConvolutionDimensionNumbers* p = convolution_dimension_numbers_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.convolution_dimension_numbers) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ConvolutionDimensionNumbers_default_instance_); +} +inline ::xla::ConvolutionDimensionNumbers* HloInstructionProto::release_convolution_dimension_numbers() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.convolution_dimension_numbers) + + ::xla::ConvolutionDimensionNumbers* temp = convolution_dimension_numbers_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + convolution_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::ConvolutionDimensionNumbers* HloInstructionProto::unsafe_arena_release_convolution_dimension_numbers() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.convolution_dimension_numbers) + + ::xla::ConvolutionDimensionNumbers* temp = convolution_dimension_numbers_; + convolution_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::ConvolutionDimensionNumbers* HloInstructionProto::mutable_convolution_dimension_numbers() { + + if (convolution_dimension_numbers_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ConvolutionDimensionNumbers>(GetArenaNoVirtual()); + convolution_dimension_numbers_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.convolution_dimension_numbers) + return convolution_dimension_numbers_; +} +inline void HloInstructionProto::set_allocated_convolution_dimension_numbers(::xla::ConvolutionDimensionNumbers* convolution_dimension_numbers) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(convolution_dimension_numbers_); + } + if (convolution_dimension_numbers) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(convolution_dimension_numbers)->GetArena(); + if (message_arena != submessage_arena) { + convolution_dimension_numbers = ::google::protobuf::internal::GetOwnedMessage( + message_arena, convolution_dimension_numbers, submessage_arena); + } + + } else { + + } + convolution_dimension_numbers_ = convolution_dimension_numbers; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.convolution_dimension_numbers) +} + +// int64 feature_group_count = 50; +inline void HloInstructionProto::clear_feature_group_count() { + feature_group_count_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::feature_group_count() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.feature_group_count) + return feature_group_count_; +} +inline void HloInstructionProto::set_feature_group_count(::google::protobuf::int64 value) { + + feature_group_count_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.feature_group_count) +} + +// repeated .xla.HloInstructionProto.SliceDimensions slice_dimensions = 17; +inline int HloInstructionProto::slice_dimensions_size() const { + return slice_dimensions_.size(); +} +inline void HloInstructionProto::clear_slice_dimensions() { + slice_dimensions_.Clear(); +} +inline ::xla::HloInstructionProto_SliceDimensions* HloInstructionProto::mutable_slice_dimensions(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.slice_dimensions) + return slice_dimensions_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto_SliceDimensions >* +HloInstructionProto::mutable_slice_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.slice_dimensions) + return &slice_dimensions_; +} +inline const ::xla::HloInstructionProto_SliceDimensions& HloInstructionProto::slice_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.slice_dimensions) + return slice_dimensions_.Get(index); +} +inline ::xla::HloInstructionProto_SliceDimensions* HloInstructionProto::add_slice_dimensions() { + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.slice_dimensions) + return slice_dimensions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto_SliceDimensions >& +HloInstructionProto::slice_dimensions() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.slice_dimensions) + return slice_dimensions_; +} + +// int32 exponent_bits = 18; +inline void HloInstructionProto::clear_exponent_bits() { + exponent_bits_ = 0; +} +inline ::google::protobuf::int32 HloInstructionProto::exponent_bits() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.exponent_bits) + return exponent_bits_; +} +inline void HloInstructionProto::set_exponent_bits(::google::protobuf::int32 value) { + + exponent_bits_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.exponent_bits) +} + +// int32 mantissa_bits = 19; +inline void HloInstructionProto::clear_mantissa_bits() { + mantissa_bits_ = 0; +} +inline ::google::protobuf::int32 HloInstructionProto::mantissa_bits() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.mantissa_bits) + return mantissa_bits_; +} +inline void HloInstructionProto::set_mantissa_bits(::google::protobuf::int32 value) { + + mantissa_bits_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.mantissa_bits) +} + +// repeated int64 dynamic_slice_sizes = 20; +inline int HloInstructionProto::dynamic_slice_sizes_size() const { + return dynamic_slice_sizes_.size(); +} +inline void HloInstructionProto::clear_dynamic_slice_sizes() { + dynamic_slice_sizes_.Clear(); +} +inline ::google::protobuf::int64 HloInstructionProto::dynamic_slice_sizes(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.dynamic_slice_sizes) + return dynamic_slice_sizes_.Get(index); +} +inline void HloInstructionProto::set_dynamic_slice_sizes(int index, ::google::protobuf::int64 value) { + dynamic_slice_sizes_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.dynamic_slice_sizes) +} +inline void HloInstructionProto::add_dynamic_slice_sizes(::google::protobuf::int64 value) { + dynamic_slice_sizes_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.dynamic_slice_sizes) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInstructionProto::dynamic_slice_sizes() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.dynamic_slice_sizes) + return dynamic_slice_sizes_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInstructionProto::mutable_dynamic_slice_sizes() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.dynamic_slice_sizes) + return &dynamic_slice_sizes_; +} + +// .xla.PaddingConfig padding_config = 21; +inline bool HloInstructionProto::has_padding_config() const { + return this != internal_default_instance() && padding_config_ != NULL; +} +inline const ::xla::PaddingConfig& HloInstructionProto::_internal_padding_config() const { + return *padding_config_; +} +inline const ::xla::PaddingConfig& HloInstructionProto::padding_config() const { + const ::xla::PaddingConfig* p = padding_config_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.padding_config) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_PaddingConfig_default_instance_); +} +inline ::xla::PaddingConfig* HloInstructionProto::release_padding_config() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.padding_config) + + ::xla::PaddingConfig* temp = padding_config_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + padding_config_ = NULL; + return temp; +} +inline ::xla::PaddingConfig* HloInstructionProto::unsafe_arena_release_padding_config() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.padding_config) + + ::xla::PaddingConfig* temp = padding_config_; + padding_config_ = NULL; + return temp; +} +inline ::xla::PaddingConfig* HloInstructionProto::mutable_padding_config() { + + if (padding_config_ == NULL) { + auto* p = CreateMaybeMessage<::xla::PaddingConfig>(GetArenaNoVirtual()); + padding_config_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.padding_config) + return padding_config_; +} +inline void HloInstructionProto::set_allocated_padding_config(::xla::PaddingConfig* padding_config) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(padding_config_); + } + if (padding_config) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(padding_config)->GetArena(); + if (message_arena != submessage_arena) { + padding_config = ::google::protobuf::internal::GetOwnedMessage( + message_arena, padding_config, submessage_arena); + } + + } else { + + } + padding_config_ = padding_config; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.padding_config) +} + +// bytes outfeed_config = 22; +inline void HloInstructionProto::clear_outfeed_config() { + outfeed_config_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::outfeed_config() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.outfeed_config) + return outfeed_config_.Get(); +} +inline void HloInstructionProto::set_outfeed_config(const ::std::string& value) { + + outfeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.outfeed_config) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_outfeed_config(::std::string&& value) { + + outfeed_config_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.outfeed_config) +} +#endif +inline void HloInstructionProto::set_outfeed_config(const char* value) { + GOOGLE_DCHECK(value != NULL); + + outfeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.outfeed_config) +} +inline void HloInstructionProto::set_outfeed_config(const void* value, + size_t size) { + + outfeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.outfeed_config) +} +inline ::std::string* HloInstructionProto::mutable_outfeed_config() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.outfeed_config) + return outfeed_config_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_outfeed_config() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.outfeed_config) + + return outfeed_config_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_outfeed_config(::std::string* outfeed_config) { + if (outfeed_config != NULL) { + + } else { + + } + outfeed_config_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), outfeed_config, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.outfeed_config) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_outfeed_config() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.outfeed_config) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return outfeed_config_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_outfeed_config( + ::std::string* outfeed_config) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (outfeed_config != NULL) { + + } else { + + } + outfeed_config_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + outfeed_config, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.outfeed_config) +} + +// .xla.RandomDistribution distribution = 23; +inline void HloInstructionProto::clear_distribution() { + distribution_ = 0; +} +inline ::xla::RandomDistribution HloInstructionProto::distribution() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.distribution) + return static_cast< ::xla::RandomDistribution >(distribution_); +} +inline void HloInstructionProto::set_distribution(::xla::RandomDistribution value) { + + distribution_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.distribution) +} + +// float epsilon = 24; +inline void HloInstructionProto::clear_epsilon() { + epsilon_ = 0; +} +inline float HloInstructionProto::epsilon() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.epsilon) + return epsilon_; +} +inline void HloInstructionProto::set_epsilon(float value) { + + epsilon_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.epsilon) +} + +// int64 feature_index = 25; +inline void HloInstructionProto::clear_feature_index() { + feature_index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::feature_index() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.feature_index) + return feature_index_; +} +inline void HloInstructionProto::set_feature_index(::google::protobuf::int64 value) { + + feature_index_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.feature_index) +} + +// int64 channel_id = 26; +inline void HloInstructionProto::clear_channel_id() { + channel_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::channel_id() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.channel_id) + return channel_id_; +} +inline void HloInstructionProto::set_channel_id(::google::protobuf::int64 value) { + + channel_id_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.channel_id) +} + +// bytes infeed_config = 27; +inline void HloInstructionProto::clear_infeed_config() { + infeed_config_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::infeed_config() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.infeed_config) + return infeed_config_.Get(); +} +inline void HloInstructionProto::set_infeed_config(const ::std::string& value) { + + infeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.infeed_config) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_infeed_config(::std::string&& value) { + + infeed_config_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.infeed_config) +} +#endif +inline void HloInstructionProto::set_infeed_config(const char* value) { + GOOGLE_DCHECK(value != NULL); + + infeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.infeed_config) +} +inline void HloInstructionProto::set_infeed_config(const void* value, + size_t size) { + + infeed_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.infeed_config) +} +inline ::std::string* HloInstructionProto::mutable_infeed_config() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.infeed_config) + return infeed_config_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_infeed_config() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.infeed_config) + + return infeed_config_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_infeed_config(::std::string* infeed_config) { + if (infeed_config != NULL) { + + } else { + + } + infeed_config_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), infeed_config, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.infeed_config) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_infeed_config() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.infeed_config) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return infeed_config_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_infeed_config( + ::std::string* infeed_config) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (infeed_config != NULL) { + + } else { + + } + infeed_config_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + infeed_config, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.infeed_config) +} + +// string custom_call_target = 28; +inline void HloInstructionProto::clear_custom_call_target() { + custom_call_target_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::custom_call_target() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.custom_call_target) + return custom_call_target_.Get(); +} +inline void HloInstructionProto::set_custom_call_target(const ::std::string& value) { + + custom_call_target_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.custom_call_target) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_custom_call_target(::std::string&& value) { + + custom_call_target_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.custom_call_target) +} +#endif +inline void HloInstructionProto::set_custom_call_target(const char* value) { + GOOGLE_DCHECK(value != NULL); + + custom_call_target_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.custom_call_target) +} +inline void HloInstructionProto::set_custom_call_target(const char* value, + size_t size) { + + custom_call_target_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.custom_call_target) +} +inline ::std::string* HloInstructionProto::mutable_custom_call_target() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.custom_call_target) + return custom_call_target_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_custom_call_target() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.custom_call_target) + + return custom_call_target_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_custom_call_target(::std::string* custom_call_target) { + if (custom_call_target != NULL) { + + } else { + + } + custom_call_target_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), custom_call_target, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.custom_call_target) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_custom_call_target() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.custom_call_target) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return custom_call_target_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_custom_call_target( + ::std::string* custom_call_target) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (custom_call_target != NULL) { + + } else { + + } + custom_call_target_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + custom_call_target, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.custom_call_target) +} + +// string custom_call_opaque = 53; +inline void HloInstructionProto::clear_custom_call_opaque() { + custom_call_opaque_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::custom_call_opaque() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.custom_call_opaque) + return custom_call_opaque_.Get(); +} +inline void HloInstructionProto::set_custom_call_opaque(const ::std::string& value) { + + custom_call_opaque_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.custom_call_opaque) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_custom_call_opaque(::std::string&& value) { + + custom_call_opaque_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.custom_call_opaque) +} +#endif +inline void HloInstructionProto::set_custom_call_opaque(const char* value) { + GOOGLE_DCHECK(value != NULL); + + custom_call_opaque_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.custom_call_opaque) +} +inline void HloInstructionProto::set_custom_call_opaque(const char* value, + size_t size) { + + custom_call_opaque_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.custom_call_opaque) +} +inline ::std::string* HloInstructionProto::mutable_custom_call_opaque() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.custom_call_opaque) + return custom_call_opaque_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_custom_call_opaque() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.custom_call_opaque) + + return custom_call_opaque_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_custom_call_opaque(::std::string* custom_call_opaque) { + if (custom_call_opaque != NULL) { + + } else { + + } + custom_call_opaque_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), custom_call_opaque, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.custom_call_opaque) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_custom_call_opaque() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.custom_call_opaque) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return custom_call_opaque_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_custom_call_opaque( + ::std::string* custom_call_opaque) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (custom_call_opaque != NULL) { + + } else { + + } + custom_call_opaque_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + custom_call_opaque, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.custom_call_opaque) +} + +// .xla.ShapeProto outfeed_shape = 29; +inline bool HloInstructionProto::has_outfeed_shape() const { + return this != internal_default_instance() && outfeed_shape_ != NULL; +} +inline const ::xla::ShapeProto& HloInstructionProto::_internal_outfeed_shape() const { + return *outfeed_shape_; +} +inline const ::xla::ShapeProto& HloInstructionProto::outfeed_shape() const { + const ::xla::ShapeProto* p = outfeed_shape_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.outfeed_shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* HloInstructionProto::release_outfeed_shape() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.outfeed_shape) + + ::xla::ShapeProto* temp = outfeed_shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + outfeed_shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* HloInstructionProto::unsafe_arena_release_outfeed_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.outfeed_shape) + + ::xla::ShapeProto* temp = outfeed_shape_; + outfeed_shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* HloInstructionProto::mutable_outfeed_shape() { + + if (outfeed_shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + outfeed_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.outfeed_shape) + return outfeed_shape_; +} +inline void HloInstructionProto::set_allocated_outfeed_shape(::xla::ShapeProto* outfeed_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(outfeed_shape_); + } + if (outfeed_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(outfeed_shape)->GetArena(); + if (message_arena != submessage_arena) { + outfeed_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, outfeed_shape, submessage_arena); + } + + } else { + + } + outfeed_shape_ = outfeed_shape; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.outfeed_shape) +} + +// .xla.DotDimensionNumbers dot_dimension_numbers = 30; +inline bool HloInstructionProto::has_dot_dimension_numbers() const { + return this != internal_default_instance() && dot_dimension_numbers_ != NULL; +} +inline const ::xla::DotDimensionNumbers& HloInstructionProto::_internal_dot_dimension_numbers() const { + return *dot_dimension_numbers_; +} +inline const ::xla::DotDimensionNumbers& HloInstructionProto::dot_dimension_numbers() const { + const ::xla::DotDimensionNumbers* p = dot_dimension_numbers_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.dot_dimension_numbers) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DotDimensionNumbers_default_instance_); +} +inline ::xla::DotDimensionNumbers* HloInstructionProto::release_dot_dimension_numbers() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.dot_dimension_numbers) + + ::xla::DotDimensionNumbers* temp = dot_dimension_numbers_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + dot_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::DotDimensionNumbers* HloInstructionProto::unsafe_arena_release_dot_dimension_numbers() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.dot_dimension_numbers) + + ::xla::DotDimensionNumbers* temp = dot_dimension_numbers_; + dot_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::DotDimensionNumbers* HloInstructionProto::mutable_dot_dimension_numbers() { + + if (dot_dimension_numbers_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DotDimensionNumbers>(GetArenaNoVirtual()); + dot_dimension_numbers_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.dot_dimension_numbers) + return dot_dimension_numbers_; +} +inline void HloInstructionProto::set_allocated_dot_dimension_numbers(::xla::DotDimensionNumbers* dot_dimension_numbers) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(dot_dimension_numbers_); + } + if (dot_dimension_numbers) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(dot_dimension_numbers)->GetArena(); + if (message_arena != submessage_arena) { + dot_dimension_numbers = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dot_dimension_numbers, submessage_arena); + } + + } else { + + } + dot_dimension_numbers_ = dot_dimension_numbers; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.dot_dimension_numbers) +} + +// .xla.FftType fft_type = 31; +inline void HloInstructionProto::clear_fft_type() { + fft_type_ = 0; +} +inline ::xla::FftType HloInstructionProto::fft_type() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.fft_type) + return static_cast< ::xla::FftType >(fft_type_); +} +inline void HloInstructionProto::set_fft_type(::xla::FftType value) { + + fft_type_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.fft_type) +} + +// repeated int64 fft_length = 32; +inline int HloInstructionProto::fft_length_size() const { + return fft_length_.size(); +} +inline void HloInstructionProto::clear_fft_length() { + fft_length_.Clear(); +} +inline ::google::protobuf::int64 HloInstructionProto::fft_length(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.fft_length) + return fft_length_.Get(index); +} +inline void HloInstructionProto::set_fft_length(int index, ::google::protobuf::int64 value) { + fft_length_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.fft_length) +} +inline void HloInstructionProto::add_fft_length(::google::protobuf::int64 value) { + fft_length_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.fft_length) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInstructionProto::fft_length() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.fft_length) + return fft_length_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInstructionProto::mutable_fft_length() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.fft_length) + return &fft_length_; +} + +// .xla.GatherDimensionNumbers gather_dimension_numbers = 33; +inline bool HloInstructionProto::has_gather_dimension_numbers() const { + return this != internal_default_instance() && gather_dimension_numbers_ != NULL; +} +inline const ::xla::GatherDimensionNumbers& HloInstructionProto::_internal_gather_dimension_numbers() const { + return *gather_dimension_numbers_; +} +inline const ::xla::GatherDimensionNumbers& HloInstructionProto::gather_dimension_numbers() const { + const ::xla::GatherDimensionNumbers* p = gather_dimension_numbers_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.gather_dimension_numbers) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GatherDimensionNumbers_default_instance_); +} +inline ::xla::GatherDimensionNumbers* HloInstructionProto::release_gather_dimension_numbers() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.gather_dimension_numbers) + + ::xla::GatherDimensionNumbers* temp = gather_dimension_numbers_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + gather_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::GatherDimensionNumbers* HloInstructionProto::unsafe_arena_release_gather_dimension_numbers() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.gather_dimension_numbers) + + ::xla::GatherDimensionNumbers* temp = gather_dimension_numbers_; + gather_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::GatherDimensionNumbers* HloInstructionProto::mutable_gather_dimension_numbers() { + + if (gather_dimension_numbers_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GatherDimensionNumbers>(GetArenaNoVirtual()); + gather_dimension_numbers_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.gather_dimension_numbers) + return gather_dimension_numbers_; +} +inline void HloInstructionProto::set_allocated_gather_dimension_numbers(::xla::GatherDimensionNumbers* gather_dimension_numbers) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(gather_dimension_numbers_); + } + if (gather_dimension_numbers) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(gather_dimension_numbers)->GetArena(); + if (message_arena != submessage_arena) { + gather_dimension_numbers = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gather_dimension_numbers, submessage_arena); + } + + } else { + + } + gather_dimension_numbers_ = gather_dimension_numbers; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.gather_dimension_numbers) +} + +// repeated int64 gather_slice_sizes = 34; +inline int HloInstructionProto::gather_slice_sizes_size() const { + return gather_slice_sizes_.size(); +} +inline void HloInstructionProto::clear_gather_slice_sizes() { + gather_slice_sizes_.Clear(); +} +inline ::google::protobuf::int64 HloInstructionProto::gather_slice_sizes(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.gather_slice_sizes) + return gather_slice_sizes_.Get(index); +} +inline void HloInstructionProto::set_gather_slice_sizes(int index, ::google::protobuf::int64 value) { + gather_slice_sizes_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.gather_slice_sizes) +} +inline void HloInstructionProto::add_gather_slice_sizes(::google::protobuf::int64 value) { + gather_slice_sizes_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.gather_slice_sizes) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInstructionProto::gather_slice_sizes() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.gather_slice_sizes) + return gather_slice_sizes_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInstructionProto::mutable_gather_slice_sizes() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.gather_slice_sizes) + return &gather_slice_sizes_; +} + +// string channel_name = 41; +inline void HloInstructionProto::clear_channel_name() { + channel_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::channel_name() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.channel_name) + return channel_name_.Get(); +} +inline void HloInstructionProto::set_channel_name(const ::std::string& value) { + + channel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.channel_name) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_channel_name(::std::string&& value) { + + channel_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.channel_name) +} +#endif +inline void HloInstructionProto::set_channel_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + channel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.channel_name) +} +inline void HloInstructionProto::set_channel_name(const char* value, + size_t size) { + + channel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.channel_name) +} +inline ::std::string* HloInstructionProto::mutable_channel_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.channel_name) + return channel_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_channel_name() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.channel_name) + + return channel_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_channel_name(::std::string* channel_name) { + if (channel_name != NULL) { + + } else { + + } + channel_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), channel_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.channel_name) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_channel_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.channel_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return channel_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_channel_name( + ::std::string* channel_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (channel_name != NULL) { + + } else { + + } + channel_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + channel_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.channel_name) +} + +// int64 cost_estimate_ns = 42; +inline void HloInstructionProto::clear_cost_estimate_ns() { + cost_estimate_ns_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::cost_estimate_ns() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.cost_estimate_ns) + return cost_estimate_ns_; +} +inline void HloInstructionProto::set_cost_estimate_ns(::google::protobuf::int64 value) { + + cost_estimate_ns_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.cost_estimate_ns) +} + +// int64 id = 35; +inline void HloInstructionProto::clear_id() { + id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::id() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.id) + return id_; +} +inline void HloInstructionProto::set_id(::google::protobuf::int64 value) { + + id_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.id) +} + +// repeated int64 operand_ids = 36; +inline int HloInstructionProto::operand_ids_size() const { + return operand_ids_.size(); +} +inline void HloInstructionProto::clear_operand_ids() { + operand_ids_.Clear(); +} +inline ::google::protobuf::int64 HloInstructionProto::operand_ids(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.operand_ids) + return operand_ids_.Get(index); +} +inline void HloInstructionProto::set_operand_ids(int index, ::google::protobuf::int64 value) { + operand_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.operand_ids) +} +inline void HloInstructionProto::add_operand_ids(::google::protobuf::int64 value) { + operand_ids_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.operand_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInstructionProto::operand_ids() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.operand_ids) + return operand_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInstructionProto::mutable_operand_ids() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.operand_ids) + return &operand_ids_; +} + +// repeated int64 control_predecessor_ids = 37; +inline int HloInstructionProto::control_predecessor_ids_size() const { + return control_predecessor_ids_.size(); +} +inline void HloInstructionProto::clear_control_predecessor_ids() { + control_predecessor_ids_.Clear(); +} +inline ::google::protobuf::int64 HloInstructionProto::control_predecessor_ids(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.control_predecessor_ids) + return control_predecessor_ids_.Get(index); +} +inline void HloInstructionProto::set_control_predecessor_ids(int index, ::google::protobuf::int64 value) { + control_predecessor_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.control_predecessor_ids) +} +inline void HloInstructionProto::add_control_predecessor_ids(::google::protobuf::int64 value) { + control_predecessor_ids_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.control_predecessor_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInstructionProto::control_predecessor_ids() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.control_predecessor_ids) + return control_predecessor_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInstructionProto::mutable_control_predecessor_ids() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.control_predecessor_ids) + return &control_predecessor_ids_; +} + +// repeated int64 called_computation_ids = 38; +inline int HloInstructionProto::called_computation_ids_size() const { + return called_computation_ids_.size(); +} +inline void HloInstructionProto::clear_called_computation_ids() { + called_computation_ids_.Clear(); +} +inline ::google::protobuf::int64 HloInstructionProto::called_computation_ids(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.called_computation_ids) + return called_computation_ids_.Get(index); +} +inline void HloInstructionProto::set_called_computation_ids(int index, ::google::protobuf::int64 value) { + called_computation_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.called_computation_ids) +} +inline void HloInstructionProto::add_called_computation_ids(::google::protobuf::int64 value) { + called_computation_ids_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.called_computation_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInstructionProto::called_computation_ids() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.called_computation_ids) + return called_computation_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInstructionProto::mutable_called_computation_ids() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.called_computation_ids) + return &called_computation_ids_; +} + +// .xla.OpSharding sharding = 40; +inline bool HloInstructionProto::has_sharding() const { + return this != internal_default_instance() && sharding_ != NULL; +} +inline const ::xla::OpSharding& HloInstructionProto::_internal_sharding() const { + return *sharding_; +} +inline const ::xla::OpSharding& HloInstructionProto::sharding() const { + const ::xla::OpSharding* p = sharding_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.sharding) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_OpSharding_default_instance_); +} +inline ::xla::OpSharding* HloInstructionProto::release_sharding() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.sharding) + + ::xla::OpSharding* temp = sharding_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + sharding_ = NULL; + return temp; +} +inline ::xla::OpSharding* HloInstructionProto::unsafe_arena_release_sharding() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.sharding) + + ::xla::OpSharding* temp = sharding_; + sharding_ = NULL; + return temp; +} +inline ::xla::OpSharding* HloInstructionProto::mutable_sharding() { + + if (sharding_ == NULL) { + auto* p = CreateMaybeMessage<::xla::OpSharding>(GetArenaNoVirtual()); + sharding_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.sharding) + return sharding_; +} +inline void HloInstructionProto::set_allocated_sharding(::xla::OpSharding* sharding) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(sharding_); + } + if (sharding) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(sharding)->GetArena(); + if (message_arena != submessage_arena) { + sharding = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sharding, submessage_arena); + } + + } else { + + } + sharding_ = sharding; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.sharding) +} + +// string backend_config = 43; +inline void HloInstructionProto::clear_backend_config() { + backend_config_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::backend_config() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.backend_config) + return backend_config_.Get(); +} +inline void HloInstructionProto::set_backend_config(const ::std::string& value) { + + backend_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.backend_config) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_backend_config(::std::string&& value) { + + backend_config_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.backend_config) +} +#endif +inline void HloInstructionProto::set_backend_config(const char* value) { + GOOGLE_DCHECK(value != NULL); + + backend_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.backend_config) +} +inline void HloInstructionProto::set_backend_config(const char* value, + size_t size) { + + backend_config_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.backend_config) +} +inline ::std::string* HloInstructionProto::mutable_backend_config() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.backend_config) + return backend_config_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_backend_config() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.backend_config) + + return backend_config_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_backend_config(::std::string* backend_config) { + if (backend_config != NULL) { + + } else { + + } + backend_config_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), backend_config, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.backend_config) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_backend_config() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.backend_config) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return backend_config_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_backend_config( + ::std::string* backend_config) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (backend_config != NULL) { + + } else { + + } + backend_config_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + backend_config, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.backend_config) +} + +// repeated .xla.ReplicaGroup replica_groups = 49; +inline int HloInstructionProto::replica_groups_size() const { + return replica_groups_.size(); +} +inline ::xla::ReplicaGroup* HloInstructionProto::mutable_replica_groups(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.replica_groups) + return replica_groups_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ReplicaGroup >* +HloInstructionProto::mutable_replica_groups() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.replica_groups) + return &replica_groups_; +} +inline const ::xla::ReplicaGroup& HloInstructionProto::replica_groups(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.replica_groups) + return replica_groups_.Get(index); +} +inline ::xla::ReplicaGroup* HloInstructionProto::add_replica_groups() { + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.replica_groups) + return replica_groups_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ReplicaGroup >& +HloInstructionProto::replica_groups() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.replica_groups) + return replica_groups_; +} + +// int64 all_reduce_id = 45; +inline void HloInstructionProto::clear_all_reduce_id() { + all_reduce_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInstructionProto::all_reduce_id() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.all_reduce_id) + return all_reduce_id_; +} +inline void HloInstructionProto::set_all_reduce_id(::google::protobuf::int64 value) { + + all_reduce_id_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.all_reduce_id) +} + +// string cross_replica_sum_barrier = 46; +inline void HloInstructionProto::clear_cross_replica_sum_barrier() { + cross_replica_sum_barrier_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloInstructionProto::cross_replica_sum_barrier() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.cross_replica_sum_barrier) + return cross_replica_sum_barrier_.Get(); +} +inline void HloInstructionProto::set_cross_replica_sum_barrier(const ::std::string& value) { + + cross_replica_sum_barrier_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.cross_replica_sum_barrier) +} +#if LANG_CXX11 +inline void HloInstructionProto::set_cross_replica_sum_barrier(::std::string&& value) { + + cross_replica_sum_barrier_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloInstructionProto.cross_replica_sum_barrier) +} +#endif +inline void HloInstructionProto::set_cross_replica_sum_barrier(const char* value) { + GOOGLE_DCHECK(value != NULL); + + cross_replica_sum_barrier_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloInstructionProto.cross_replica_sum_barrier) +} +inline void HloInstructionProto::set_cross_replica_sum_barrier(const char* value, + size_t size) { + + cross_replica_sum_barrier_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloInstructionProto.cross_replica_sum_barrier) +} +inline ::std::string* HloInstructionProto::mutable_cross_replica_sum_barrier() { + + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.cross_replica_sum_barrier) + return cross_replica_sum_barrier_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloInstructionProto::release_cross_replica_sum_barrier() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.cross_replica_sum_barrier) + + return cross_replica_sum_barrier_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloInstructionProto::set_allocated_cross_replica_sum_barrier(::std::string* cross_replica_sum_barrier) { + if (cross_replica_sum_barrier != NULL) { + + } else { + + } + cross_replica_sum_barrier_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), cross_replica_sum_barrier, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.cross_replica_sum_barrier) +} +inline ::std::string* HloInstructionProto::unsafe_arena_release_cross_replica_sum_barrier() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.cross_replica_sum_barrier) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return cross_replica_sum_barrier_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloInstructionProto::unsafe_arena_set_allocated_cross_replica_sum_barrier( + ::std::string* cross_replica_sum_barrier) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (cross_replica_sum_barrier != NULL) { + + } else { + + } + cross_replica_sum_barrier_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + cross_replica_sum_barrier, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloInstructionProto.cross_replica_sum_barrier) +} + +// bool is_host_transfer = 47; +inline void HloInstructionProto::clear_is_host_transfer() { + is_host_transfer_ = false; +} +inline bool HloInstructionProto::is_host_transfer() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.is_host_transfer) + return is_host_transfer_; +} +inline void HloInstructionProto::set_is_host_transfer(bool value) { + + is_host_transfer_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.is_host_transfer) +} + +// .xla.ScatterDimensionNumbers scatter_dimension_numbers = 48; +inline bool HloInstructionProto::has_scatter_dimension_numbers() const { + return this != internal_default_instance() && scatter_dimension_numbers_ != NULL; +} +inline const ::xla::ScatterDimensionNumbers& HloInstructionProto::_internal_scatter_dimension_numbers() const { + return *scatter_dimension_numbers_; +} +inline const ::xla::ScatterDimensionNumbers& HloInstructionProto::scatter_dimension_numbers() const { + const ::xla::ScatterDimensionNumbers* p = scatter_dimension_numbers_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.scatter_dimension_numbers) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ScatterDimensionNumbers_default_instance_); +} +inline ::xla::ScatterDimensionNumbers* HloInstructionProto::release_scatter_dimension_numbers() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.scatter_dimension_numbers) + + ::xla::ScatterDimensionNumbers* temp = scatter_dimension_numbers_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + scatter_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::ScatterDimensionNumbers* HloInstructionProto::unsafe_arena_release_scatter_dimension_numbers() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.scatter_dimension_numbers) + + ::xla::ScatterDimensionNumbers* temp = scatter_dimension_numbers_; + scatter_dimension_numbers_ = NULL; + return temp; +} +inline ::xla::ScatterDimensionNumbers* HloInstructionProto::mutable_scatter_dimension_numbers() { + + if (scatter_dimension_numbers_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ScatterDimensionNumbers>(GetArenaNoVirtual()); + scatter_dimension_numbers_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.scatter_dimension_numbers) + return scatter_dimension_numbers_; +} +inline void HloInstructionProto::set_allocated_scatter_dimension_numbers(::xla::ScatterDimensionNumbers* scatter_dimension_numbers) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(scatter_dimension_numbers_); + } + if (scatter_dimension_numbers) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(scatter_dimension_numbers)->GetArena(); + if (message_arena != submessage_arena) { + scatter_dimension_numbers = ::google::protobuf::internal::GetOwnedMessage( + message_arena, scatter_dimension_numbers, submessage_arena); + } + + } else { + + } + scatter_dimension_numbers_ = scatter_dimension_numbers; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.scatter_dimension_numbers) +} + +// .xla.PrecisionConfig precision_config = 51; +inline bool HloInstructionProto::has_precision_config() const { + return this != internal_default_instance() && precision_config_ != NULL; +} +inline const ::xla::PrecisionConfig& HloInstructionProto::_internal_precision_config() const { + return *precision_config_; +} +inline const ::xla::PrecisionConfig& HloInstructionProto::precision_config() const { + const ::xla::PrecisionConfig* p = precision_config_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.precision_config) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_PrecisionConfig_default_instance_); +} +inline ::xla::PrecisionConfig* HloInstructionProto::release_precision_config() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.precision_config) + + ::xla::PrecisionConfig* temp = precision_config_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + precision_config_ = NULL; + return temp; +} +inline ::xla::PrecisionConfig* HloInstructionProto::unsafe_arena_release_precision_config() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.precision_config) + + ::xla::PrecisionConfig* temp = precision_config_; + precision_config_ = NULL; + return temp; +} +inline ::xla::PrecisionConfig* HloInstructionProto::mutable_precision_config() { + + if (precision_config_ == NULL) { + auto* p = CreateMaybeMessage<::xla::PrecisionConfig>(GetArenaNoVirtual()); + precision_config_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.precision_config) + return precision_config_; +} +inline void HloInstructionProto::set_allocated_precision_config(::xla::PrecisionConfig* precision_config) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(precision_config_); + } + if (precision_config) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(precision_config)->GetArena(); + if (message_arena != submessage_arena) { + precision_config = ::google::protobuf::internal::GetOwnedMessage( + message_arena, precision_config, submessage_arena); + } + + } else { + + } + precision_config_ = precision_config; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.precision_config) +} + +// repeated .xla.SourceTarget source_target_pairs = 52; +inline int HloInstructionProto::source_target_pairs_size() const { + return source_target_pairs_.size(); +} +inline ::xla::SourceTarget* HloInstructionProto::mutable_source_target_pairs(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.source_target_pairs) + return source_target_pairs_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::SourceTarget >* +HloInstructionProto::mutable_source_target_pairs() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.source_target_pairs) + return &source_target_pairs_; +} +inline const ::xla::SourceTarget& HloInstructionProto::source_target_pairs(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.source_target_pairs) + return source_target_pairs_.Get(index); +} +inline ::xla::SourceTarget* HloInstructionProto::add_source_target_pairs() { + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.source_target_pairs) + return source_target_pairs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::SourceTarget >& +HloInstructionProto::source_target_pairs() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.source_target_pairs) + return source_target_pairs_; +} + +// .xla.OpSharding domain_entry_sharding = 54; +inline bool HloInstructionProto::has_domain_entry_sharding() const { + return this != internal_default_instance() && domain_entry_sharding_ != NULL; +} +inline const ::xla::OpSharding& HloInstructionProto::_internal_domain_entry_sharding() const { + return *domain_entry_sharding_; +} +inline const ::xla::OpSharding& HloInstructionProto::domain_entry_sharding() const { + const ::xla::OpSharding* p = domain_entry_sharding_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.domain_entry_sharding) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_OpSharding_default_instance_); +} +inline ::xla::OpSharding* HloInstructionProto::release_domain_entry_sharding() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.domain_entry_sharding) + + ::xla::OpSharding* temp = domain_entry_sharding_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + domain_entry_sharding_ = NULL; + return temp; +} +inline ::xla::OpSharding* HloInstructionProto::unsafe_arena_release_domain_entry_sharding() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.domain_entry_sharding) + + ::xla::OpSharding* temp = domain_entry_sharding_; + domain_entry_sharding_ = NULL; + return temp; +} +inline ::xla::OpSharding* HloInstructionProto::mutable_domain_entry_sharding() { + + if (domain_entry_sharding_ == NULL) { + auto* p = CreateMaybeMessage<::xla::OpSharding>(GetArenaNoVirtual()); + domain_entry_sharding_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.domain_entry_sharding) + return domain_entry_sharding_; +} +inline void HloInstructionProto::set_allocated_domain_entry_sharding(::xla::OpSharding* domain_entry_sharding) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(domain_entry_sharding_); + } + if (domain_entry_sharding) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(domain_entry_sharding)->GetArena(); + if (message_arena != submessage_arena) { + domain_entry_sharding = ::google::protobuf::internal::GetOwnedMessage( + message_arena, domain_entry_sharding, submessage_arena); + } + + } else { + + } + domain_entry_sharding_ = domain_entry_sharding; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.domain_entry_sharding) +} + +// .xla.OpSharding domain_exit_sharding = 55; +inline bool HloInstructionProto::has_domain_exit_sharding() const { + return this != internal_default_instance() && domain_exit_sharding_ != NULL; +} +inline const ::xla::OpSharding& HloInstructionProto::_internal_domain_exit_sharding() const { + return *domain_exit_sharding_; +} +inline const ::xla::OpSharding& HloInstructionProto::domain_exit_sharding() const { + const ::xla::OpSharding* p = domain_exit_sharding_; + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.domain_exit_sharding) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_OpSharding_default_instance_); +} +inline ::xla::OpSharding* HloInstructionProto::release_domain_exit_sharding() { + // @@protoc_insertion_point(field_release:xla.HloInstructionProto.domain_exit_sharding) + + ::xla::OpSharding* temp = domain_exit_sharding_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + domain_exit_sharding_ = NULL; + return temp; +} +inline ::xla::OpSharding* HloInstructionProto::unsafe_arena_release_domain_exit_sharding() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloInstructionProto.domain_exit_sharding) + + ::xla::OpSharding* temp = domain_exit_sharding_; + domain_exit_sharding_ = NULL; + return temp; +} +inline ::xla::OpSharding* HloInstructionProto::mutable_domain_exit_sharding() { + + if (domain_exit_sharding_ == NULL) { + auto* p = CreateMaybeMessage<::xla::OpSharding>(GetArenaNoVirtual()); + domain_exit_sharding_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.domain_exit_sharding) + return domain_exit_sharding_; +} +inline void HloInstructionProto::set_allocated_domain_exit_sharding(::xla::OpSharding* domain_exit_sharding) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(domain_exit_sharding_); + } + if (domain_exit_sharding) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(domain_exit_sharding)->GetArena(); + if (message_arena != submessage_arena) { + domain_exit_sharding = ::google::protobuf::internal::GetOwnedMessage( + message_arena, domain_exit_sharding, submessage_arena); + } + + } else { + + } + domain_exit_sharding_ = domain_exit_sharding; + // @@protoc_insertion_point(field_set_allocated:xla.HloInstructionProto.domain_exit_sharding) +} + +// bool constrain_layout = 56; +inline void HloInstructionProto::clear_constrain_layout() { + constrain_layout_ = false; +} +inline bool HloInstructionProto::constrain_layout() const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.constrain_layout) + return constrain_layout_; +} +inline void HloInstructionProto::set_constrain_layout(bool value) { + + constrain_layout_ = value; + // @@protoc_insertion_point(field_set:xla.HloInstructionProto.constrain_layout) +} + +// repeated .xla.ShapeProto operand_shapes_with_layout = 57; +inline int HloInstructionProto::operand_shapes_with_layout_size() const { + return operand_shapes_with_layout_.size(); +} +inline ::xla::ShapeProto* HloInstructionProto::mutable_operand_shapes_with_layout(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloInstructionProto.operand_shapes_with_layout) + return operand_shapes_with_layout_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* +HloInstructionProto::mutable_operand_shapes_with_layout() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInstructionProto.operand_shapes_with_layout) + return &operand_shapes_with_layout_; +} +inline const ::xla::ShapeProto& HloInstructionProto::operand_shapes_with_layout(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInstructionProto.operand_shapes_with_layout) + return operand_shapes_with_layout_.Get(index); +} +inline ::xla::ShapeProto* HloInstructionProto::add_operand_shapes_with_layout() { + // @@protoc_insertion_point(field_add:xla.HloInstructionProto.operand_shapes_with_layout) + return operand_shapes_with_layout_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& +HloInstructionProto::operand_shapes_with_layout() const { + // @@protoc_insertion_point(field_list:xla.HloInstructionProto.operand_shapes_with_layout) + return operand_shapes_with_layout_; +} + +// ------------------------------------------------------------------- + +// HloComputationProto + +// string name = 1; +inline void HloComputationProto::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloComputationProto::name() const { + // @@protoc_insertion_point(field_get:xla.HloComputationProto.name) + return name_.Get(); +} +inline void HloComputationProto::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloComputationProto.name) +} +#if LANG_CXX11 +inline void HloComputationProto::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloComputationProto.name) +} +#endif +inline void HloComputationProto::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloComputationProto.name) +} +inline void HloComputationProto::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloComputationProto.name) +} +inline ::std::string* HloComputationProto::mutable_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloComputationProto.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloComputationProto::release_name() { + // @@protoc_insertion_point(field_release:xla.HloComputationProto.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloComputationProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloComputationProto.name) +} +inline ::std::string* HloComputationProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloComputationProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloComputationProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloComputationProto.name) +} + +// repeated .xla.HloInstructionProto instructions = 2; +inline int HloComputationProto::instructions_size() const { + return instructions_.size(); +} +inline void HloComputationProto::clear_instructions() { + instructions_.Clear(); +} +inline ::xla::HloInstructionProto* HloComputationProto::mutable_instructions(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloComputationProto.instructions) + return instructions_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto >* +HloComputationProto::mutable_instructions() { + // @@protoc_insertion_point(field_mutable_list:xla.HloComputationProto.instructions) + return &instructions_; +} +inline const ::xla::HloInstructionProto& HloComputationProto::instructions(int index) const { + // @@protoc_insertion_point(field_get:xla.HloComputationProto.instructions) + return instructions_.Get(index); +} +inline ::xla::HloInstructionProto* HloComputationProto::add_instructions() { + // @@protoc_insertion_point(field_add:xla.HloComputationProto.instructions) + return instructions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloInstructionProto >& +HloComputationProto::instructions() const { + // @@protoc_insertion_point(field_list:xla.HloComputationProto.instructions) + return instructions_; +} + +// .xla.ProgramShapeProto program_shape = 4; +inline bool HloComputationProto::has_program_shape() const { + return this != internal_default_instance() && program_shape_ != NULL; +} +inline const ::xla::ProgramShapeProto& HloComputationProto::_internal_program_shape() const { + return *program_shape_; +} +inline const ::xla::ProgramShapeProto& HloComputationProto::program_shape() const { + const ::xla::ProgramShapeProto* p = program_shape_; + // @@protoc_insertion_point(field_get:xla.HloComputationProto.program_shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ProgramShapeProto_default_instance_); +} +inline ::xla::ProgramShapeProto* HloComputationProto::release_program_shape() { + // @@protoc_insertion_point(field_release:xla.HloComputationProto.program_shape) + + ::xla::ProgramShapeProto* temp = program_shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + program_shape_ = NULL; + return temp; +} +inline ::xla::ProgramShapeProto* HloComputationProto::unsafe_arena_release_program_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloComputationProto.program_shape) + + ::xla::ProgramShapeProto* temp = program_shape_; + program_shape_ = NULL; + return temp; +} +inline ::xla::ProgramShapeProto* HloComputationProto::mutable_program_shape() { + + if (program_shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ProgramShapeProto>(GetArenaNoVirtual()); + program_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloComputationProto.program_shape) + return program_shape_; +} +inline void HloComputationProto::set_allocated_program_shape(::xla::ProgramShapeProto* program_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(program_shape_); + } + if (program_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(program_shape)->GetArena(); + if (message_arena != submessage_arena) { + program_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, program_shape, submessage_arena); + } + + } else { + + } + program_shape_ = program_shape; + // @@protoc_insertion_point(field_set_allocated:xla.HloComputationProto.program_shape) +} + +// int64 id = 5; +inline void HloComputationProto::clear_id() { + id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloComputationProto::id() const { + // @@protoc_insertion_point(field_get:xla.HloComputationProto.id) + return id_; +} +inline void HloComputationProto::set_id(::google::protobuf::int64 value) { + + id_ = value; + // @@protoc_insertion_point(field_set:xla.HloComputationProto.id) +} + +// int64 root_id = 6; +inline void HloComputationProto::clear_root_id() { + root_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloComputationProto::root_id() const { + // @@protoc_insertion_point(field_get:xla.HloComputationProto.root_id) + return root_id_; +} +inline void HloComputationProto::set_root_id(::google::protobuf::int64 value) { + + root_id_ = value; + // @@protoc_insertion_point(field_set:xla.HloComputationProto.root_id) +} + +// ------------------------------------------------------------------- + +// HloScheduleProto_InstructionSequence + +// repeated int64 instruction_ids = 1; +inline int HloScheduleProto_InstructionSequence::instruction_ids_size() const { + return instruction_ids_.size(); +} +inline void HloScheduleProto_InstructionSequence::clear_instruction_ids() { + instruction_ids_.Clear(); +} +inline ::google::protobuf::int64 HloScheduleProto_InstructionSequence::instruction_ids(int index) const { + // @@protoc_insertion_point(field_get:xla.HloScheduleProto.InstructionSequence.instruction_ids) + return instruction_ids_.Get(index); +} +inline void HloScheduleProto_InstructionSequence::set_instruction_ids(int index, ::google::protobuf::int64 value) { + instruction_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloScheduleProto.InstructionSequence.instruction_ids) +} +inline void HloScheduleProto_InstructionSequence::add_instruction_ids(::google::protobuf::int64 value) { + instruction_ids_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloScheduleProto.InstructionSequence.instruction_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloScheduleProto_InstructionSequence::instruction_ids() const { + // @@protoc_insertion_point(field_list:xla.HloScheduleProto.InstructionSequence.instruction_ids) + return instruction_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloScheduleProto_InstructionSequence::mutable_instruction_ids() { + // @@protoc_insertion_point(field_mutable_list:xla.HloScheduleProto.InstructionSequence.instruction_ids) + return &instruction_ids_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// HloScheduleProto + +// map sequences = 1; +inline int HloScheduleProto::sequences_size() const { + return sequences_.size(); +} +inline void HloScheduleProto::clear_sequences() { + sequences_.Clear(); +} +inline const ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >& +HloScheduleProto::sequences() const { + // @@protoc_insertion_point(field_map:xla.HloScheduleProto.sequences) + return sequences_.GetMap(); +} +inline ::google::protobuf::Map< ::google::protobuf::int64, ::xla::HloScheduleProto_InstructionSequence >* +HloScheduleProto::mutable_sequences() { + // @@protoc_insertion_point(field_mutable_map:xla.HloScheduleProto.sequences) + return sequences_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// HloInputOutputAliasProto_AliasEntryProto + +// repeated int64 output_shape_index = 1; +inline int HloInputOutputAliasProto_AliasEntryProto::output_shape_index_size() const { + return output_shape_index_.size(); +} +inline void HloInputOutputAliasProto_AliasEntryProto::clear_output_shape_index() { + output_shape_index_.Clear(); +} +inline ::google::protobuf::int64 HloInputOutputAliasProto_AliasEntryProto::output_shape_index(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInputOutputAliasProto.AliasEntryProto.output_shape_index) + return output_shape_index_.Get(index); +} +inline void HloInputOutputAliasProto_AliasEntryProto::set_output_shape_index(int index, ::google::protobuf::int64 value) { + output_shape_index_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInputOutputAliasProto.AliasEntryProto.output_shape_index) +} +inline void HloInputOutputAliasProto_AliasEntryProto::add_output_shape_index(::google::protobuf::int64 value) { + output_shape_index_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInputOutputAliasProto.AliasEntryProto.output_shape_index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInputOutputAliasProto_AliasEntryProto::output_shape_index() const { + // @@protoc_insertion_point(field_list:xla.HloInputOutputAliasProto.AliasEntryProto.output_shape_index) + return output_shape_index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInputOutputAliasProto_AliasEntryProto::mutable_output_shape_index() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInputOutputAliasProto.AliasEntryProto.output_shape_index) + return &output_shape_index_; +} + +// int64 parameter_number = 2; +inline void HloInputOutputAliasProto_AliasEntryProto::clear_parameter_number() { + parameter_number_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloInputOutputAliasProto_AliasEntryProto::parameter_number() const { + // @@protoc_insertion_point(field_get:xla.HloInputOutputAliasProto.AliasEntryProto.parameter_number) + return parameter_number_; +} +inline void HloInputOutputAliasProto_AliasEntryProto::set_parameter_number(::google::protobuf::int64 value) { + + parameter_number_ = value; + // @@protoc_insertion_point(field_set:xla.HloInputOutputAliasProto.AliasEntryProto.parameter_number) +} + +// repeated int64 parameter_shape_index = 3; +inline int HloInputOutputAliasProto_AliasEntryProto::parameter_shape_index_size() const { + return parameter_shape_index_.size(); +} +inline void HloInputOutputAliasProto_AliasEntryProto::clear_parameter_shape_index() { + parameter_shape_index_.Clear(); +} +inline ::google::protobuf::int64 HloInputOutputAliasProto_AliasEntryProto::parameter_shape_index(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInputOutputAliasProto.AliasEntryProto.parameter_shape_index) + return parameter_shape_index_.Get(index); +} +inline void HloInputOutputAliasProto_AliasEntryProto::set_parameter_shape_index(int index, ::google::protobuf::int64 value) { + parameter_shape_index_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloInputOutputAliasProto.AliasEntryProto.parameter_shape_index) +} +inline void HloInputOutputAliasProto_AliasEntryProto::add_parameter_shape_index(::google::protobuf::int64 value) { + parameter_shape_index_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloInputOutputAliasProto.AliasEntryProto.parameter_shape_index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HloInputOutputAliasProto_AliasEntryProto::parameter_shape_index() const { + // @@protoc_insertion_point(field_list:xla.HloInputOutputAliasProto.AliasEntryProto.parameter_shape_index) + return parameter_shape_index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HloInputOutputAliasProto_AliasEntryProto::mutable_parameter_shape_index() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInputOutputAliasProto.AliasEntryProto.parameter_shape_index) + return ¶meter_shape_index_; +} + +// ------------------------------------------------------------------- + +// HloInputOutputAliasProto + +// repeated .xla.HloInputOutputAliasProto.AliasEntryProto entries = 1; +inline int HloInputOutputAliasProto::entries_size() const { + return entries_.size(); +} +inline void HloInputOutputAliasProto::clear_entries() { + entries_.Clear(); +} +inline ::xla::HloInputOutputAliasProto_AliasEntryProto* HloInputOutputAliasProto::mutable_entries(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloInputOutputAliasProto.entries) + return entries_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloInputOutputAliasProto_AliasEntryProto >* +HloInputOutputAliasProto::mutable_entries() { + // @@protoc_insertion_point(field_mutable_list:xla.HloInputOutputAliasProto.entries) + return &entries_; +} +inline const ::xla::HloInputOutputAliasProto_AliasEntryProto& HloInputOutputAliasProto::entries(int index) const { + // @@protoc_insertion_point(field_get:xla.HloInputOutputAliasProto.entries) + return entries_.Get(index); +} +inline ::xla::HloInputOutputAliasProto_AliasEntryProto* HloInputOutputAliasProto::add_entries() { + // @@protoc_insertion_point(field_add:xla.HloInputOutputAliasProto.entries) + return entries_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloInputOutputAliasProto_AliasEntryProto >& +HloInputOutputAliasProto::entries() const { + // @@protoc_insertion_point(field_list:xla.HloInputOutputAliasProto.entries) + return entries_; +} + +// ------------------------------------------------------------------- + +// DynamicParameterBindingProto_Binding + +// int64 dynamic_param_num = 1; +inline void DynamicParameterBindingProto_Binding::clear_dynamic_param_num() { + dynamic_param_num_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 DynamicParameterBindingProto_Binding::dynamic_param_num() const { + // @@protoc_insertion_point(field_get:xla.DynamicParameterBindingProto.Binding.dynamic_param_num) + return dynamic_param_num_; +} +inline void DynamicParameterBindingProto_Binding::set_dynamic_param_num(::google::protobuf::int64 value) { + + dynamic_param_num_ = value; + // @@protoc_insertion_point(field_set:xla.DynamicParameterBindingProto.Binding.dynamic_param_num) +} + +// repeated int64 dynamic_param_index = 2; +inline int DynamicParameterBindingProto_Binding::dynamic_param_index_size() const { + return dynamic_param_index_.size(); +} +inline void DynamicParameterBindingProto_Binding::clear_dynamic_param_index() { + dynamic_param_index_.Clear(); +} +inline ::google::protobuf::int64 DynamicParameterBindingProto_Binding::dynamic_param_index(int index) const { + // @@protoc_insertion_point(field_get:xla.DynamicParameterBindingProto.Binding.dynamic_param_index) + return dynamic_param_index_.Get(index); +} +inline void DynamicParameterBindingProto_Binding::set_dynamic_param_index(int index, ::google::protobuf::int64 value) { + dynamic_param_index_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.DynamicParameterBindingProto.Binding.dynamic_param_index) +} +inline void DynamicParameterBindingProto_Binding::add_dynamic_param_index(::google::protobuf::int64 value) { + dynamic_param_index_.Add(value); + // @@protoc_insertion_point(field_add:xla.DynamicParameterBindingProto.Binding.dynamic_param_index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DynamicParameterBindingProto_Binding::dynamic_param_index() const { + // @@protoc_insertion_point(field_list:xla.DynamicParameterBindingProto.Binding.dynamic_param_index) + return dynamic_param_index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DynamicParameterBindingProto_Binding::mutable_dynamic_param_index() { + // @@protoc_insertion_point(field_mutable_list:xla.DynamicParameterBindingProto.Binding.dynamic_param_index) + return &dynamic_param_index_; +} + +// int64 target_param_num = 3; +inline void DynamicParameterBindingProto_Binding::clear_target_param_num() { + target_param_num_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 DynamicParameterBindingProto_Binding::target_param_num() const { + // @@protoc_insertion_point(field_get:xla.DynamicParameterBindingProto.Binding.target_param_num) + return target_param_num_; +} +inline void DynamicParameterBindingProto_Binding::set_target_param_num(::google::protobuf::int64 value) { + + target_param_num_ = value; + // @@protoc_insertion_point(field_set:xla.DynamicParameterBindingProto.Binding.target_param_num) +} + +// repeated int64 target_param_index = 4; +inline int DynamicParameterBindingProto_Binding::target_param_index_size() const { + return target_param_index_.size(); +} +inline void DynamicParameterBindingProto_Binding::clear_target_param_index() { + target_param_index_.Clear(); +} +inline ::google::protobuf::int64 DynamicParameterBindingProto_Binding::target_param_index(int index) const { + // @@protoc_insertion_point(field_get:xla.DynamicParameterBindingProto.Binding.target_param_index) + return target_param_index_.Get(index); +} +inline void DynamicParameterBindingProto_Binding::set_target_param_index(int index, ::google::protobuf::int64 value) { + target_param_index_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.DynamicParameterBindingProto.Binding.target_param_index) +} +inline void DynamicParameterBindingProto_Binding::add_target_param_index(::google::protobuf::int64 value) { + target_param_index_.Add(value); + // @@protoc_insertion_point(field_add:xla.DynamicParameterBindingProto.Binding.target_param_index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DynamicParameterBindingProto_Binding::target_param_index() const { + // @@protoc_insertion_point(field_list:xla.DynamicParameterBindingProto.Binding.target_param_index) + return target_param_index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DynamicParameterBindingProto_Binding::mutable_target_param_index() { + // @@protoc_insertion_point(field_mutable_list:xla.DynamicParameterBindingProto.Binding.target_param_index) + return &target_param_index_; +} + +// int64 target_param_dim_num = 5; +inline void DynamicParameterBindingProto_Binding::clear_target_param_dim_num() { + target_param_dim_num_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 DynamicParameterBindingProto_Binding::target_param_dim_num() const { + // @@protoc_insertion_point(field_get:xla.DynamicParameterBindingProto.Binding.target_param_dim_num) + return target_param_dim_num_; +} +inline void DynamicParameterBindingProto_Binding::set_target_param_dim_num(::google::protobuf::int64 value) { + + target_param_dim_num_ = value; + // @@protoc_insertion_point(field_set:xla.DynamicParameterBindingProto.Binding.target_param_dim_num) +} + +// ------------------------------------------------------------------- + +// DynamicParameterBindingProto + +// repeated .xla.DynamicParameterBindingProto.Binding entries = 1; +inline int DynamicParameterBindingProto::entries_size() const { + return entries_.size(); +} +inline void DynamicParameterBindingProto::clear_entries() { + entries_.Clear(); +} +inline ::xla::DynamicParameterBindingProto_Binding* DynamicParameterBindingProto::mutable_entries(int index) { + // @@protoc_insertion_point(field_mutable:xla.DynamicParameterBindingProto.entries) + return entries_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::DynamicParameterBindingProto_Binding >* +DynamicParameterBindingProto::mutable_entries() { + // @@protoc_insertion_point(field_mutable_list:xla.DynamicParameterBindingProto.entries) + return &entries_; +} +inline const ::xla::DynamicParameterBindingProto_Binding& DynamicParameterBindingProto::entries(int index) const { + // @@protoc_insertion_point(field_get:xla.DynamicParameterBindingProto.entries) + return entries_.Get(index); +} +inline ::xla::DynamicParameterBindingProto_Binding* DynamicParameterBindingProto::add_entries() { + // @@protoc_insertion_point(field_add:xla.DynamicParameterBindingProto.entries) + return entries_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::DynamicParameterBindingProto_Binding >& +DynamicParameterBindingProto::entries() const { + // @@protoc_insertion_point(field_list:xla.DynamicParameterBindingProto.entries) + return entries_; +} + +// ------------------------------------------------------------------- + +// HloModuleProto + +// string name = 1; +inline void HloModuleProto::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloModuleProto::name() const { + // @@protoc_insertion_point(field_get:xla.HloModuleProto.name) + return name_.Get(); +} +inline void HloModuleProto::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloModuleProto.name) +} +#if LANG_CXX11 +inline void HloModuleProto::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloModuleProto.name) +} +#endif +inline void HloModuleProto::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloModuleProto.name) +} +inline void HloModuleProto::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloModuleProto.name) +} +inline ::std::string* HloModuleProto::mutable_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloModuleProto.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloModuleProto::release_name() { + // @@protoc_insertion_point(field_release:xla.HloModuleProto.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloModuleProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloModuleProto.name) +} +inline ::std::string* HloModuleProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloModuleProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloModuleProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloModuleProto.name) +} + +// string entry_computation_name = 2; +inline void HloModuleProto::clear_entry_computation_name() { + entry_computation_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloModuleProto::entry_computation_name() const { + // @@protoc_insertion_point(field_get:xla.HloModuleProto.entry_computation_name) + return entry_computation_name_.Get(); +} +inline void HloModuleProto::set_entry_computation_name(const ::std::string& value) { + + entry_computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloModuleProto.entry_computation_name) +} +#if LANG_CXX11 +inline void HloModuleProto::set_entry_computation_name(::std::string&& value) { + + entry_computation_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloModuleProto.entry_computation_name) +} +#endif +inline void HloModuleProto::set_entry_computation_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + entry_computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloModuleProto.entry_computation_name) +} +inline void HloModuleProto::set_entry_computation_name(const char* value, + size_t size) { + + entry_computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloModuleProto.entry_computation_name) +} +inline ::std::string* HloModuleProto::mutable_entry_computation_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloModuleProto.entry_computation_name) + return entry_computation_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloModuleProto::release_entry_computation_name() { + // @@protoc_insertion_point(field_release:xla.HloModuleProto.entry_computation_name) + + return entry_computation_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloModuleProto::set_allocated_entry_computation_name(::std::string* entry_computation_name) { + if (entry_computation_name != NULL) { + + } else { + + } + entry_computation_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), entry_computation_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloModuleProto.entry_computation_name) +} +inline ::std::string* HloModuleProto::unsafe_arena_release_entry_computation_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloModuleProto.entry_computation_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return entry_computation_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloModuleProto::unsafe_arena_set_allocated_entry_computation_name( + ::std::string* entry_computation_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (entry_computation_name != NULL) { + + } else { + + } + entry_computation_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + entry_computation_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloModuleProto.entry_computation_name) +} + +// int64 entry_computation_id = 6; +inline void HloModuleProto::clear_entry_computation_id() { + entry_computation_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloModuleProto::entry_computation_id() const { + // @@protoc_insertion_point(field_get:xla.HloModuleProto.entry_computation_id) + return entry_computation_id_; +} +inline void HloModuleProto::set_entry_computation_id(::google::protobuf::int64 value) { + + entry_computation_id_ = value; + // @@protoc_insertion_point(field_set:xla.HloModuleProto.entry_computation_id) +} + +// repeated .xla.HloComputationProto computations = 3; +inline int HloModuleProto::computations_size() const { + return computations_.size(); +} +inline void HloModuleProto::clear_computations() { + computations_.Clear(); +} +inline ::xla::HloComputationProto* HloModuleProto::mutable_computations(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloModuleProto.computations) + return computations_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloComputationProto >* +HloModuleProto::mutable_computations() { + // @@protoc_insertion_point(field_mutable_list:xla.HloModuleProto.computations) + return &computations_; +} +inline const ::xla::HloComputationProto& HloModuleProto::computations(int index) const { + // @@protoc_insertion_point(field_get:xla.HloModuleProto.computations) + return computations_.Get(index); +} +inline ::xla::HloComputationProto* HloModuleProto::add_computations() { + // @@protoc_insertion_point(field_add:xla.HloModuleProto.computations) + return computations_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloComputationProto >& +HloModuleProto::computations() const { + // @@protoc_insertion_point(field_list:xla.HloModuleProto.computations) + return computations_; +} + +// .xla.ProgramShapeProto host_program_shape = 4; +inline bool HloModuleProto::has_host_program_shape() const { + return this != internal_default_instance() && host_program_shape_ != NULL; +} +inline const ::xla::ProgramShapeProto& HloModuleProto::_internal_host_program_shape() const { + return *host_program_shape_; +} +inline const ::xla::ProgramShapeProto& HloModuleProto::host_program_shape() const { + const ::xla::ProgramShapeProto* p = host_program_shape_; + // @@protoc_insertion_point(field_get:xla.HloModuleProto.host_program_shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ProgramShapeProto_default_instance_); +} +inline ::xla::ProgramShapeProto* HloModuleProto::release_host_program_shape() { + // @@protoc_insertion_point(field_release:xla.HloModuleProto.host_program_shape) + + ::xla::ProgramShapeProto* temp = host_program_shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + host_program_shape_ = NULL; + return temp; +} +inline ::xla::ProgramShapeProto* HloModuleProto::unsafe_arena_release_host_program_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloModuleProto.host_program_shape) + + ::xla::ProgramShapeProto* temp = host_program_shape_; + host_program_shape_ = NULL; + return temp; +} +inline ::xla::ProgramShapeProto* HloModuleProto::mutable_host_program_shape() { + + if (host_program_shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ProgramShapeProto>(GetArenaNoVirtual()); + host_program_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloModuleProto.host_program_shape) + return host_program_shape_; +} +inline void HloModuleProto::set_allocated_host_program_shape(::xla::ProgramShapeProto* host_program_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(host_program_shape_); + } + if (host_program_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(host_program_shape)->GetArena(); + if (message_arena != submessage_arena) { + host_program_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, host_program_shape, submessage_arena); + } + + } else { + + } + host_program_shape_ = host_program_shape; + // @@protoc_insertion_point(field_set_allocated:xla.HloModuleProto.host_program_shape) +} + +// int64 id = 5; +inline void HloModuleProto::clear_id() { + id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloModuleProto::id() const { + // @@protoc_insertion_point(field_get:xla.HloModuleProto.id) + return id_; +} +inline void HloModuleProto::set_id(::google::protobuf::int64 value) { + + id_ = value; + // @@protoc_insertion_point(field_set:xla.HloModuleProto.id) +} + +// .xla.HloScheduleProto schedule = 7; +inline bool HloModuleProto::has_schedule() const { + return this != internal_default_instance() && schedule_ != NULL; +} +inline void HloModuleProto::clear_schedule() { + if (GetArenaNoVirtual() == NULL && schedule_ != NULL) { + delete schedule_; + } + schedule_ = NULL; +} +inline const ::xla::HloScheduleProto& HloModuleProto::_internal_schedule() const { + return *schedule_; +} +inline const ::xla::HloScheduleProto& HloModuleProto::schedule() const { + const ::xla::HloScheduleProto* p = schedule_; + // @@protoc_insertion_point(field_get:xla.HloModuleProto.schedule) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloScheduleProto_default_instance_); +} +inline ::xla::HloScheduleProto* HloModuleProto::release_schedule() { + // @@protoc_insertion_point(field_release:xla.HloModuleProto.schedule) + + ::xla::HloScheduleProto* temp = schedule_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + schedule_ = NULL; + return temp; +} +inline ::xla::HloScheduleProto* HloModuleProto::unsafe_arena_release_schedule() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloModuleProto.schedule) + + ::xla::HloScheduleProto* temp = schedule_; + schedule_ = NULL; + return temp; +} +inline ::xla::HloScheduleProto* HloModuleProto::mutable_schedule() { + + if (schedule_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloScheduleProto>(GetArenaNoVirtual()); + schedule_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloModuleProto.schedule) + return schedule_; +} +inline void HloModuleProto::set_allocated_schedule(::xla::HloScheduleProto* schedule) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete schedule_; + } + if (schedule) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(schedule); + if (message_arena != submessage_arena) { + schedule = ::google::protobuf::internal::GetOwnedMessage( + message_arena, schedule, submessage_arena); + } + + } else { + + } + schedule_ = schedule; + // @@protoc_insertion_point(field_set_allocated:xla.HloModuleProto.schedule) +} + +// .xla.HloInputOutputAliasProto input_output_alias = 8; +inline bool HloModuleProto::has_input_output_alias() const { + return this != internal_default_instance() && input_output_alias_ != NULL; +} +inline void HloModuleProto::clear_input_output_alias() { + if (GetArenaNoVirtual() == NULL && input_output_alias_ != NULL) { + delete input_output_alias_; + } + input_output_alias_ = NULL; +} +inline const ::xla::HloInputOutputAliasProto& HloModuleProto::_internal_input_output_alias() const { + return *input_output_alias_; +} +inline const ::xla::HloInputOutputAliasProto& HloModuleProto::input_output_alias() const { + const ::xla::HloInputOutputAliasProto* p = input_output_alias_; + // @@protoc_insertion_point(field_get:xla.HloModuleProto.input_output_alias) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloInputOutputAliasProto_default_instance_); +} +inline ::xla::HloInputOutputAliasProto* HloModuleProto::release_input_output_alias() { + // @@protoc_insertion_point(field_release:xla.HloModuleProto.input_output_alias) + + ::xla::HloInputOutputAliasProto* temp = input_output_alias_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + input_output_alias_ = NULL; + return temp; +} +inline ::xla::HloInputOutputAliasProto* HloModuleProto::unsafe_arena_release_input_output_alias() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloModuleProto.input_output_alias) + + ::xla::HloInputOutputAliasProto* temp = input_output_alias_; + input_output_alias_ = NULL; + return temp; +} +inline ::xla::HloInputOutputAliasProto* HloModuleProto::mutable_input_output_alias() { + + if (input_output_alias_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloInputOutputAliasProto>(GetArenaNoVirtual()); + input_output_alias_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloModuleProto.input_output_alias) + return input_output_alias_; +} +inline void HloModuleProto::set_allocated_input_output_alias(::xla::HloInputOutputAliasProto* input_output_alias) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete input_output_alias_; + } + if (input_output_alias) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(input_output_alias); + if (message_arena != submessage_arena) { + input_output_alias = ::google::protobuf::internal::GetOwnedMessage( + message_arena, input_output_alias, submessage_arena); + } + + } else { + + } + input_output_alias_ = input_output_alias; + // @@protoc_insertion_point(field_set_allocated:xla.HloModuleProto.input_output_alias) +} + +// .xla.DynamicParameterBindingProto dynamic_parameter_binding = 9; +inline bool HloModuleProto::has_dynamic_parameter_binding() const { + return this != internal_default_instance() && dynamic_parameter_binding_ != NULL; +} +inline void HloModuleProto::clear_dynamic_parameter_binding() { + if (GetArenaNoVirtual() == NULL && dynamic_parameter_binding_ != NULL) { + delete dynamic_parameter_binding_; + } + dynamic_parameter_binding_ = NULL; +} +inline const ::xla::DynamicParameterBindingProto& HloModuleProto::_internal_dynamic_parameter_binding() const { + return *dynamic_parameter_binding_; +} +inline const ::xla::DynamicParameterBindingProto& HloModuleProto::dynamic_parameter_binding() const { + const ::xla::DynamicParameterBindingProto* p = dynamic_parameter_binding_; + // @@protoc_insertion_point(field_get:xla.HloModuleProto.dynamic_parameter_binding) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DynamicParameterBindingProto_default_instance_); +} +inline ::xla::DynamicParameterBindingProto* HloModuleProto::release_dynamic_parameter_binding() { + // @@protoc_insertion_point(field_release:xla.HloModuleProto.dynamic_parameter_binding) + + ::xla::DynamicParameterBindingProto* temp = dynamic_parameter_binding_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + dynamic_parameter_binding_ = NULL; + return temp; +} +inline ::xla::DynamicParameterBindingProto* HloModuleProto::unsafe_arena_release_dynamic_parameter_binding() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloModuleProto.dynamic_parameter_binding) + + ::xla::DynamicParameterBindingProto* temp = dynamic_parameter_binding_; + dynamic_parameter_binding_ = NULL; + return temp; +} +inline ::xla::DynamicParameterBindingProto* HloModuleProto::mutable_dynamic_parameter_binding() { + + if (dynamic_parameter_binding_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DynamicParameterBindingProto>(GetArenaNoVirtual()); + dynamic_parameter_binding_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloModuleProto.dynamic_parameter_binding) + return dynamic_parameter_binding_; +} +inline void HloModuleProto::set_allocated_dynamic_parameter_binding(::xla::DynamicParameterBindingProto* dynamic_parameter_binding) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete dynamic_parameter_binding_; + } + if (dynamic_parameter_binding) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(dynamic_parameter_binding); + if (message_arena != submessage_arena) { + dynamic_parameter_binding = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dynamic_parameter_binding, submessage_arena); + } + + } else { + + } + dynamic_parameter_binding_ = dynamic_parameter_binding; + // @@protoc_insertion_point(field_set_allocated:xla.HloModuleProto.dynamic_parameter_binding) +} + +// ------------------------------------------------------------------- + +// LogicalBufferProto_Location + +// string computation_name = 1; +inline void LogicalBufferProto_Location::clear_computation_name() { + computation_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LogicalBufferProto_Location::computation_name() const { + // @@protoc_insertion_point(field_get:xla.LogicalBufferProto.Location.computation_name) + return computation_name_.Get(); +} +inline void LogicalBufferProto_Location::set_computation_name(const ::std::string& value) { + + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LogicalBufferProto.Location.computation_name) +} +#if LANG_CXX11 +inline void LogicalBufferProto_Location::set_computation_name(::std::string&& value) { + + computation_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LogicalBufferProto.Location.computation_name) +} +#endif +inline void LogicalBufferProto_Location::set_computation_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LogicalBufferProto.Location.computation_name) +} +inline void LogicalBufferProto_Location::set_computation_name(const char* value, + size_t size) { + + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LogicalBufferProto.Location.computation_name) +} +inline ::std::string* LogicalBufferProto_Location::mutable_computation_name() { + + // @@protoc_insertion_point(field_mutable:xla.LogicalBufferProto.Location.computation_name) + return computation_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LogicalBufferProto_Location::release_computation_name() { + // @@protoc_insertion_point(field_release:xla.LogicalBufferProto.Location.computation_name) + + return computation_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LogicalBufferProto_Location::set_allocated_computation_name(::std::string* computation_name) { + if (computation_name != NULL) { + + } else { + + } + computation_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), computation_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LogicalBufferProto.Location.computation_name) +} +inline ::std::string* LogicalBufferProto_Location::unsafe_arena_release_computation_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LogicalBufferProto.Location.computation_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return computation_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LogicalBufferProto_Location::unsafe_arena_set_allocated_computation_name( + ::std::string* computation_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (computation_name != NULL) { + + } else { + + } + computation_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + computation_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LogicalBufferProto.Location.computation_name) +} + +// string instruction_name = 2; +inline void LogicalBufferProto_Location::clear_instruction_name() { + instruction_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LogicalBufferProto_Location::instruction_name() const { + // @@protoc_insertion_point(field_get:xla.LogicalBufferProto.Location.instruction_name) + return instruction_name_.Get(); +} +inline void LogicalBufferProto_Location::set_instruction_name(const ::std::string& value) { + + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LogicalBufferProto.Location.instruction_name) +} +#if LANG_CXX11 +inline void LogicalBufferProto_Location::set_instruction_name(::std::string&& value) { + + instruction_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LogicalBufferProto.Location.instruction_name) +} +#endif +inline void LogicalBufferProto_Location::set_instruction_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LogicalBufferProto.Location.instruction_name) +} +inline void LogicalBufferProto_Location::set_instruction_name(const char* value, + size_t size) { + + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LogicalBufferProto.Location.instruction_name) +} +inline ::std::string* LogicalBufferProto_Location::mutable_instruction_name() { + + // @@protoc_insertion_point(field_mutable:xla.LogicalBufferProto.Location.instruction_name) + return instruction_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LogicalBufferProto_Location::release_instruction_name() { + // @@protoc_insertion_point(field_release:xla.LogicalBufferProto.Location.instruction_name) + + return instruction_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LogicalBufferProto_Location::set_allocated_instruction_name(::std::string* instruction_name) { + if (instruction_name != NULL) { + + } else { + + } + instruction_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), instruction_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LogicalBufferProto.Location.instruction_name) +} +inline ::std::string* LogicalBufferProto_Location::unsafe_arena_release_instruction_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LogicalBufferProto.Location.instruction_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return instruction_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LogicalBufferProto_Location::unsafe_arena_set_allocated_instruction_name( + ::std::string* instruction_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (instruction_name != NULL) { + + } else { + + } + instruction_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + instruction_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LogicalBufferProto.Location.instruction_name) +} + +// repeated int64 shape_index = 3; +inline int LogicalBufferProto_Location::shape_index_size() const { + return shape_index_.size(); +} +inline void LogicalBufferProto_Location::clear_shape_index() { + shape_index_.Clear(); +} +inline ::google::protobuf::int64 LogicalBufferProto_Location::shape_index(int index) const { + // @@protoc_insertion_point(field_get:xla.LogicalBufferProto.Location.shape_index) + return shape_index_.Get(index); +} +inline void LogicalBufferProto_Location::set_shape_index(int index, ::google::protobuf::int64 value) { + shape_index_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LogicalBufferProto.Location.shape_index) +} +inline void LogicalBufferProto_Location::add_shape_index(::google::protobuf::int64 value) { + shape_index_.Add(value); + // @@protoc_insertion_point(field_add:xla.LogicalBufferProto.Location.shape_index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +LogicalBufferProto_Location::shape_index() const { + // @@protoc_insertion_point(field_list:xla.LogicalBufferProto.Location.shape_index) + return shape_index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +LogicalBufferProto_Location::mutable_shape_index() { + // @@protoc_insertion_point(field_mutable_list:xla.LogicalBufferProto.Location.shape_index) + return &shape_index_; +} + +// ------------------------------------------------------------------- + +// LogicalBufferProto + +// int64 id = 1; +inline void LogicalBufferProto::clear_id() { + id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LogicalBufferProto::id() const { + // @@protoc_insertion_point(field_get:xla.LogicalBufferProto.id) + return id_; +} +inline void LogicalBufferProto::set_id(::google::protobuf::int64 value) { + + id_ = value; + // @@protoc_insertion_point(field_set:xla.LogicalBufferProto.id) +} + +// int64 size = 2; +inline void LogicalBufferProto::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LogicalBufferProto::size() const { + // @@protoc_insertion_point(field_get:xla.LogicalBufferProto.size) + return size_; +} +inline void LogicalBufferProto::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:xla.LogicalBufferProto.size) +} + +// .xla.LogicalBufferProto.Location defined_at = 3; +inline bool LogicalBufferProto::has_defined_at() const { + return this != internal_default_instance() && defined_at_ != NULL; +} +inline void LogicalBufferProto::clear_defined_at() { + if (GetArenaNoVirtual() == NULL && defined_at_ != NULL) { + delete defined_at_; + } + defined_at_ = NULL; +} +inline const ::xla::LogicalBufferProto_Location& LogicalBufferProto::_internal_defined_at() const { + return *defined_at_; +} +inline const ::xla::LogicalBufferProto_Location& LogicalBufferProto::defined_at() const { + const ::xla::LogicalBufferProto_Location* p = defined_at_; + // @@protoc_insertion_point(field_get:xla.LogicalBufferProto.defined_at) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LogicalBufferProto_Location_default_instance_); +} +inline ::xla::LogicalBufferProto_Location* LogicalBufferProto::release_defined_at() { + // @@protoc_insertion_point(field_release:xla.LogicalBufferProto.defined_at) + + ::xla::LogicalBufferProto_Location* temp = defined_at_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + defined_at_ = NULL; + return temp; +} +inline ::xla::LogicalBufferProto_Location* LogicalBufferProto::unsafe_arena_release_defined_at() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LogicalBufferProto.defined_at) + + ::xla::LogicalBufferProto_Location* temp = defined_at_; + defined_at_ = NULL; + return temp; +} +inline ::xla::LogicalBufferProto_Location* LogicalBufferProto::mutable_defined_at() { + + if (defined_at_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LogicalBufferProto_Location>(GetArenaNoVirtual()); + defined_at_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.LogicalBufferProto.defined_at) + return defined_at_; +} +inline void LogicalBufferProto::set_allocated_defined_at(::xla::LogicalBufferProto_Location* defined_at) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete defined_at_; + } + if (defined_at) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(defined_at); + if (message_arena != submessage_arena) { + defined_at = ::google::protobuf::internal::GetOwnedMessage( + message_arena, defined_at, submessage_arena); + } + + } else { + + } + defined_at_ = defined_at; + // @@protoc_insertion_point(field_set_allocated:xla.LogicalBufferProto.defined_at) +} + +// int64 color = 4; +inline void LogicalBufferProto::clear_color() { + color_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LogicalBufferProto::color() const { + // @@protoc_insertion_point(field_get:xla.LogicalBufferProto.color) + return color_; +} +inline void LogicalBufferProto::set_color(::google::protobuf::int64 value) { + + color_ = value; + // @@protoc_insertion_point(field_set:xla.LogicalBufferProto.color) +} + +// ------------------------------------------------------------------- + +// BufferAllocationProto_Assigned + +// int64 logical_buffer_id = 1; +inline void BufferAllocationProto_Assigned::clear_logical_buffer_id() { + logical_buffer_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAllocationProto_Assigned::logical_buffer_id() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.Assigned.logical_buffer_id) + return logical_buffer_id_; +} +inline void BufferAllocationProto_Assigned::set_logical_buffer_id(::google::protobuf::int64 value) { + + logical_buffer_id_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.Assigned.logical_buffer_id) +} + +// int64 offset = 2; +inline void BufferAllocationProto_Assigned::clear_offset() { + offset_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAllocationProto_Assigned::offset() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.Assigned.offset) + return offset_; +} +inline void BufferAllocationProto_Assigned::set_offset(::google::protobuf::int64 value) { + + offset_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.Assigned.offset) +} + +// int64 size = 3; +inline void BufferAllocationProto_Assigned::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAllocationProto_Assigned::size() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.Assigned.size) + return size_; +} +inline void BufferAllocationProto_Assigned::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.Assigned.size) +} + +// ------------------------------------------------------------------- + +// BufferAllocationProto + +// int64 index = 1; +inline void BufferAllocationProto::clear_index() { + index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAllocationProto::index() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.index) + return index_; +} +inline void BufferAllocationProto::set_index(::google::protobuf::int64 value) { + + index_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.index) +} + +// int64 size = 2; +inline void BufferAllocationProto::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAllocationProto::size() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.size) + return size_; +} +inline void BufferAllocationProto::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.size) +} + +// bool is_thread_local = 3; +inline void BufferAllocationProto::clear_is_thread_local() { + is_thread_local_ = false; +} +inline bool BufferAllocationProto::is_thread_local() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.is_thread_local) + return is_thread_local_; +} +inline void BufferAllocationProto::set_is_thread_local(bool value) { + + is_thread_local_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.is_thread_local) +} + +// bool is_tuple = 11; +inline void BufferAllocationProto::clear_is_tuple() { + is_tuple_ = false; +} +inline bool BufferAllocationProto::is_tuple() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.is_tuple) + return is_tuple_; +} +inline void BufferAllocationProto::set_is_tuple(bool value) { + + is_tuple_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.is_tuple) +} + +// bool is_entry_computation_parameter = 5; +inline void BufferAllocationProto::clear_is_entry_computation_parameter() { + is_entry_computation_parameter_ = false; +} +inline bool BufferAllocationProto::is_entry_computation_parameter() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.is_entry_computation_parameter) + return is_entry_computation_parameter_; +} +inline void BufferAllocationProto::set_is_entry_computation_parameter(bool value) { + + is_entry_computation_parameter_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.is_entry_computation_parameter) +} + +// bool is_constant = 12; +inline void BufferAllocationProto::clear_is_constant() { + is_constant_ = false; +} +inline bool BufferAllocationProto::is_constant() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.is_constant) + return is_constant_; +} +inline void BufferAllocationProto::set_is_constant(bool value) { + + is_constant_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.is_constant) +} + +// int64 parameter_number = 6; +inline void BufferAllocationProto::clear_parameter_number() { + parameter_number_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAllocationProto::parameter_number() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.parameter_number) + return parameter_number_; +} +inline void BufferAllocationProto::set_parameter_number(::google::protobuf::int64 value) { + + parameter_number_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.parameter_number) +} + +// repeated int64 parameter_shape_index = 10; +inline int BufferAllocationProto::parameter_shape_index_size() const { + return parameter_shape_index_.size(); +} +inline void BufferAllocationProto::clear_parameter_shape_index() { + parameter_shape_index_.Clear(); +} +inline ::google::protobuf::int64 BufferAllocationProto::parameter_shape_index(int index) const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.parameter_shape_index) + return parameter_shape_index_.Get(index); +} +inline void BufferAllocationProto::set_parameter_shape_index(int index, ::google::protobuf::int64 value) { + parameter_shape_index_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.parameter_shape_index) +} +inline void BufferAllocationProto::add_parameter_shape_index(::google::protobuf::int64 value) { + parameter_shape_index_.Add(value); + // @@protoc_insertion_point(field_add:xla.BufferAllocationProto.parameter_shape_index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BufferAllocationProto::parameter_shape_index() const { + // @@protoc_insertion_point(field_list:xla.BufferAllocationProto.parameter_shape_index) + return parameter_shape_index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BufferAllocationProto::mutable_parameter_shape_index() { + // @@protoc_insertion_point(field_mutable_list:xla.BufferAllocationProto.parameter_shape_index) + return ¶meter_shape_index_; +} + +// bool maybe_live_out = 7; +inline void BufferAllocationProto::clear_maybe_live_out() { + maybe_live_out_ = false; +} +inline bool BufferAllocationProto::maybe_live_out() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.maybe_live_out) + return maybe_live_out_; +} +inline void BufferAllocationProto::set_maybe_live_out(bool value) { + + maybe_live_out_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.maybe_live_out) +} + +// int64 color = 8; +inline void BufferAllocationProto::clear_color() { + color_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAllocationProto::color() const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.color) + return color_; +} +inline void BufferAllocationProto::set_color(::google::protobuf::int64 value) { + + color_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAllocationProto.color) +} + +// repeated .xla.BufferAllocationProto.Assigned assigned = 9; +inline int BufferAllocationProto::assigned_size() const { + return assigned_.size(); +} +inline void BufferAllocationProto::clear_assigned() { + assigned_.Clear(); +} +inline ::xla::BufferAllocationProto_Assigned* BufferAllocationProto::mutable_assigned(int index) { + // @@protoc_insertion_point(field_mutable:xla.BufferAllocationProto.assigned) + return assigned_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto_Assigned >* +BufferAllocationProto::mutable_assigned() { + // @@protoc_insertion_point(field_mutable_list:xla.BufferAllocationProto.assigned) + return &assigned_; +} +inline const ::xla::BufferAllocationProto_Assigned& BufferAllocationProto::assigned(int index) const { + // @@protoc_insertion_point(field_get:xla.BufferAllocationProto.assigned) + return assigned_.Get(index); +} +inline ::xla::BufferAllocationProto_Assigned* BufferAllocationProto::add_assigned() { + // @@protoc_insertion_point(field_add:xla.BufferAllocationProto.assigned) + return assigned_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto_Assigned >& +BufferAllocationProto::assigned() const { + // @@protoc_insertion_point(field_list:xla.BufferAllocationProto.assigned) + return assigned_; +} + +// ------------------------------------------------------------------- + +// HeapSimulatorTrace_Event + +// .xla.HeapSimulatorTrace.Event.Kind kind = 1; +inline void HeapSimulatorTrace_Event::clear_kind() { + kind_ = 0; +} +inline ::xla::HeapSimulatorTrace_Event_Kind HeapSimulatorTrace_Event::kind() const { + // @@protoc_insertion_point(field_get:xla.HeapSimulatorTrace.Event.kind) + return static_cast< ::xla::HeapSimulatorTrace_Event_Kind >(kind_); +} +inline void HeapSimulatorTrace_Event::set_kind(::xla::HeapSimulatorTrace_Event_Kind value) { + + kind_ = value; + // @@protoc_insertion_point(field_set:xla.HeapSimulatorTrace.Event.kind) +} + +// int64 buffer_id = 2; +inline void HeapSimulatorTrace_Event::clear_buffer_id() { + buffer_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HeapSimulatorTrace_Event::buffer_id() const { + // @@protoc_insertion_point(field_get:xla.HeapSimulatorTrace.Event.buffer_id) + return buffer_id_; +} +inline void HeapSimulatorTrace_Event::set_buffer_id(::google::protobuf::int64 value) { + + buffer_id_ = value; + // @@protoc_insertion_point(field_set:xla.HeapSimulatorTrace.Event.buffer_id) +} + +// string computation_name = 3; +inline void HeapSimulatorTrace_Event::clear_computation_name() { + computation_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HeapSimulatorTrace_Event::computation_name() const { + // @@protoc_insertion_point(field_get:xla.HeapSimulatorTrace.Event.computation_name) + return computation_name_.Get(); +} +inline void HeapSimulatorTrace_Event::set_computation_name(const ::std::string& value) { + + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HeapSimulatorTrace.Event.computation_name) +} +#if LANG_CXX11 +inline void HeapSimulatorTrace_Event::set_computation_name(::std::string&& value) { + + computation_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HeapSimulatorTrace.Event.computation_name) +} +#endif +inline void HeapSimulatorTrace_Event::set_computation_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HeapSimulatorTrace.Event.computation_name) +} +inline void HeapSimulatorTrace_Event::set_computation_name(const char* value, + size_t size) { + + computation_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HeapSimulatorTrace.Event.computation_name) +} +inline ::std::string* HeapSimulatorTrace_Event::mutable_computation_name() { + + // @@protoc_insertion_point(field_mutable:xla.HeapSimulatorTrace.Event.computation_name) + return computation_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HeapSimulatorTrace_Event::release_computation_name() { + // @@protoc_insertion_point(field_release:xla.HeapSimulatorTrace.Event.computation_name) + + return computation_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HeapSimulatorTrace_Event::set_allocated_computation_name(::std::string* computation_name) { + if (computation_name != NULL) { + + } else { + + } + computation_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), computation_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HeapSimulatorTrace.Event.computation_name) +} +inline ::std::string* HeapSimulatorTrace_Event::unsafe_arena_release_computation_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HeapSimulatorTrace.Event.computation_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return computation_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HeapSimulatorTrace_Event::unsafe_arena_set_allocated_computation_name( + ::std::string* computation_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (computation_name != NULL) { + + } else { + + } + computation_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + computation_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HeapSimulatorTrace.Event.computation_name) +} + +// string instruction_name = 4; +inline void HeapSimulatorTrace_Event::clear_instruction_name() { + instruction_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HeapSimulatorTrace_Event::instruction_name() const { + // @@protoc_insertion_point(field_get:xla.HeapSimulatorTrace.Event.instruction_name) + return instruction_name_.Get(); +} +inline void HeapSimulatorTrace_Event::set_instruction_name(const ::std::string& value) { + + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HeapSimulatorTrace.Event.instruction_name) +} +#if LANG_CXX11 +inline void HeapSimulatorTrace_Event::set_instruction_name(::std::string&& value) { + + instruction_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HeapSimulatorTrace.Event.instruction_name) +} +#endif +inline void HeapSimulatorTrace_Event::set_instruction_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HeapSimulatorTrace.Event.instruction_name) +} +inline void HeapSimulatorTrace_Event::set_instruction_name(const char* value, + size_t size) { + + instruction_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HeapSimulatorTrace.Event.instruction_name) +} +inline ::std::string* HeapSimulatorTrace_Event::mutable_instruction_name() { + + // @@protoc_insertion_point(field_mutable:xla.HeapSimulatorTrace.Event.instruction_name) + return instruction_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HeapSimulatorTrace_Event::release_instruction_name() { + // @@protoc_insertion_point(field_release:xla.HeapSimulatorTrace.Event.instruction_name) + + return instruction_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HeapSimulatorTrace_Event::set_allocated_instruction_name(::std::string* instruction_name) { + if (instruction_name != NULL) { + + } else { + + } + instruction_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), instruction_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HeapSimulatorTrace.Event.instruction_name) +} +inline ::std::string* HeapSimulatorTrace_Event::unsafe_arena_release_instruction_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HeapSimulatorTrace.Event.instruction_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return instruction_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HeapSimulatorTrace_Event::unsafe_arena_set_allocated_instruction_name( + ::std::string* instruction_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (instruction_name != NULL) { + + } else { + + } + instruction_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + instruction_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HeapSimulatorTrace.Event.instruction_name) +} + +// int64 share_with_canonical_id = 5; +inline void HeapSimulatorTrace_Event::clear_share_with_canonical_id() { + share_with_canonical_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HeapSimulatorTrace_Event::share_with_canonical_id() const { + // @@protoc_insertion_point(field_get:xla.HeapSimulatorTrace.Event.share_with_canonical_id) + return share_with_canonical_id_; +} +inline void HeapSimulatorTrace_Event::set_share_with_canonical_id(::google::protobuf::int64 value) { + + share_with_canonical_id_ = value; + // @@protoc_insertion_point(field_set:xla.HeapSimulatorTrace.Event.share_with_canonical_id) +} + +// ------------------------------------------------------------------- + +// HeapSimulatorTrace + +// repeated .xla.HeapSimulatorTrace.Event events = 1; +inline int HeapSimulatorTrace::events_size() const { + return events_.size(); +} +inline void HeapSimulatorTrace::clear_events() { + events_.Clear(); +} +inline ::xla::HeapSimulatorTrace_Event* HeapSimulatorTrace::mutable_events(int index) { + // @@protoc_insertion_point(field_mutable:xla.HeapSimulatorTrace.events) + return events_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace_Event >* +HeapSimulatorTrace::mutable_events() { + // @@protoc_insertion_point(field_mutable_list:xla.HeapSimulatorTrace.events) + return &events_; +} +inline const ::xla::HeapSimulatorTrace_Event& HeapSimulatorTrace::events(int index) const { + // @@protoc_insertion_point(field_get:xla.HeapSimulatorTrace.events) + return events_.Get(index); +} +inline ::xla::HeapSimulatorTrace_Event* HeapSimulatorTrace::add_events() { + // @@protoc_insertion_point(field_add:xla.HeapSimulatorTrace.events) + return events_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace_Event >& +HeapSimulatorTrace::events() const { + // @@protoc_insertion_point(field_list:xla.HeapSimulatorTrace.events) + return events_; +} + +// bool whole_module_simulation = 2; +inline void HeapSimulatorTrace::clear_whole_module_simulation() { + whole_module_simulation_ = false; +} +inline bool HeapSimulatorTrace::whole_module_simulation() const { + // @@protoc_insertion_point(field_get:xla.HeapSimulatorTrace.whole_module_simulation) + return whole_module_simulation_; +} +inline void HeapSimulatorTrace::set_whole_module_simulation(bool value) { + + whole_module_simulation_ = value; + // @@protoc_insertion_point(field_set:xla.HeapSimulatorTrace.whole_module_simulation) +} + +// ------------------------------------------------------------------- + +// HloModuleGroupProto + +// string name = 1; +inline void HloModuleGroupProto::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloModuleGroupProto::name() const { + // @@protoc_insertion_point(field_get:xla.HloModuleGroupProto.name) + return name_.Get(); +} +inline void HloModuleGroupProto::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloModuleGroupProto.name) +} +#if LANG_CXX11 +inline void HloModuleGroupProto::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloModuleGroupProto.name) +} +#endif +inline void HloModuleGroupProto::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloModuleGroupProto.name) +} +inline void HloModuleGroupProto::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloModuleGroupProto.name) +} +inline ::std::string* HloModuleGroupProto::mutable_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloModuleGroupProto.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloModuleGroupProto::release_name() { + // @@protoc_insertion_point(field_release:xla.HloModuleGroupProto.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloModuleGroupProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloModuleGroupProto.name) +} +inline ::std::string* HloModuleGroupProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloModuleGroupProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloModuleGroupProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloModuleGroupProto.name) +} + +// repeated .xla.HloModuleProto hlo_modules = 2; +inline int HloModuleGroupProto::hlo_modules_size() const { + return hlo_modules_.size(); +} +inline void HloModuleGroupProto::clear_hlo_modules() { + hlo_modules_.Clear(); +} +inline ::xla::HloModuleProto* HloModuleGroupProto::mutable_hlo_modules(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloModuleGroupProto.hlo_modules) + return hlo_modules_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloModuleProto >* +HloModuleGroupProto::mutable_hlo_modules() { + // @@protoc_insertion_point(field_mutable_list:xla.HloModuleGroupProto.hlo_modules) + return &hlo_modules_; +} +inline const ::xla::HloModuleProto& HloModuleGroupProto::hlo_modules(int index) const { + // @@protoc_insertion_point(field_get:xla.HloModuleGroupProto.hlo_modules) + return hlo_modules_.Get(index); +} +inline ::xla::HloModuleProto* HloModuleGroupProto::add_hlo_modules() { + // @@protoc_insertion_point(field_add:xla.HloModuleGroupProto.hlo_modules) + return hlo_modules_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloModuleProto >& +HloModuleGroupProto::hlo_modules() const { + // @@protoc_insertion_point(field_list:xla.HloModuleGroupProto.hlo_modules) + return hlo_modules_; +} + +// ------------------------------------------------------------------- + +// BufferAssignmentProto_BufferAlias + +// int64 source_buffer_id = 1; +inline void BufferAssignmentProto_BufferAlias::clear_source_buffer_id() { + source_buffer_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BufferAssignmentProto_BufferAlias::source_buffer_id() const { + // @@protoc_insertion_point(field_get:xla.BufferAssignmentProto.BufferAlias.source_buffer_id) + return source_buffer_id_; +} +inline void BufferAssignmentProto_BufferAlias::set_source_buffer_id(::google::protobuf::int64 value) { + + source_buffer_id_ = value; + // @@protoc_insertion_point(field_set:xla.BufferAssignmentProto.BufferAlias.source_buffer_id) +} + +// .xla.LogicalBufferProto.Location location = 2; +inline bool BufferAssignmentProto_BufferAlias::has_location() const { + return this != internal_default_instance() && location_ != NULL; +} +inline void BufferAssignmentProto_BufferAlias::clear_location() { + if (GetArenaNoVirtual() == NULL && location_ != NULL) { + delete location_; + } + location_ = NULL; +} +inline const ::xla::LogicalBufferProto_Location& BufferAssignmentProto_BufferAlias::_internal_location() const { + return *location_; +} +inline const ::xla::LogicalBufferProto_Location& BufferAssignmentProto_BufferAlias::location() const { + const ::xla::LogicalBufferProto_Location* p = location_; + // @@protoc_insertion_point(field_get:xla.BufferAssignmentProto.BufferAlias.location) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LogicalBufferProto_Location_default_instance_); +} +inline ::xla::LogicalBufferProto_Location* BufferAssignmentProto_BufferAlias::release_location() { + // @@protoc_insertion_point(field_release:xla.BufferAssignmentProto.BufferAlias.location) + + ::xla::LogicalBufferProto_Location* temp = location_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + location_ = NULL; + return temp; +} +inline ::xla::LogicalBufferProto_Location* BufferAssignmentProto_BufferAlias::unsafe_arena_release_location() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.BufferAssignmentProto.BufferAlias.location) + + ::xla::LogicalBufferProto_Location* temp = location_; + location_ = NULL; + return temp; +} +inline ::xla::LogicalBufferProto_Location* BufferAssignmentProto_BufferAlias::mutable_location() { + + if (location_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LogicalBufferProto_Location>(GetArenaNoVirtual()); + location_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.BufferAssignmentProto.BufferAlias.location) + return location_; +} +inline void BufferAssignmentProto_BufferAlias::set_allocated_location(::xla::LogicalBufferProto_Location* location) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete location_; + } + if (location) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(location); + if (message_arena != submessage_arena) { + location = ::google::protobuf::internal::GetOwnedMessage( + message_arena, location, submessage_arena); + } + + } else { + + } + location_ = location; + // @@protoc_insertion_point(field_set_allocated:xla.BufferAssignmentProto.BufferAlias.location) +} + +// ------------------------------------------------------------------- + +// BufferAssignmentProto + +// repeated .xla.LogicalBufferProto logical_buffers = 1; +inline int BufferAssignmentProto::logical_buffers_size() const { + return logical_buffers_.size(); +} +inline void BufferAssignmentProto::clear_logical_buffers() { + logical_buffers_.Clear(); +} +inline ::xla::LogicalBufferProto* BufferAssignmentProto::mutable_logical_buffers(int index) { + // @@protoc_insertion_point(field_mutable:xla.BufferAssignmentProto.logical_buffers) + return logical_buffers_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::LogicalBufferProto >* +BufferAssignmentProto::mutable_logical_buffers() { + // @@protoc_insertion_point(field_mutable_list:xla.BufferAssignmentProto.logical_buffers) + return &logical_buffers_; +} +inline const ::xla::LogicalBufferProto& BufferAssignmentProto::logical_buffers(int index) const { + // @@protoc_insertion_point(field_get:xla.BufferAssignmentProto.logical_buffers) + return logical_buffers_.Get(index); +} +inline ::xla::LogicalBufferProto* BufferAssignmentProto::add_logical_buffers() { + // @@protoc_insertion_point(field_add:xla.BufferAssignmentProto.logical_buffers) + return logical_buffers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::LogicalBufferProto >& +BufferAssignmentProto::logical_buffers() const { + // @@protoc_insertion_point(field_list:xla.BufferAssignmentProto.logical_buffers) + return logical_buffers_; +} + +// repeated .xla.BufferAssignmentProto.BufferAlias buffer_aliases = 2; +inline int BufferAssignmentProto::buffer_aliases_size() const { + return buffer_aliases_.size(); +} +inline void BufferAssignmentProto::clear_buffer_aliases() { + buffer_aliases_.Clear(); +} +inline ::xla::BufferAssignmentProto_BufferAlias* BufferAssignmentProto::mutable_buffer_aliases(int index) { + // @@protoc_insertion_point(field_mutable:xla.BufferAssignmentProto.buffer_aliases) + return buffer_aliases_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::BufferAssignmentProto_BufferAlias >* +BufferAssignmentProto::mutable_buffer_aliases() { + // @@protoc_insertion_point(field_mutable_list:xla.BufferAssignmentProto.buffer_aliases) + return &buffer_aliases_; +} +inline const ::xla::BufferAssignmentProto_BufferAlias& BufferAssignmentProto::buffer_aliases(int index) const { + // @@protoc_insertion_point(field_get:xla.BufferAssignmentProto.buffer_aliases) + return buffer_aliases_.Get(index); +} +inline ::xla::BufferAssignmentProto_BufferAlias* BufferAssignmentProto::add_buffer_aliases() { + // @@protoc_insertion_point(field_add:xla.BufferAssignmentProto.buffer_aliases) + return buffer_aliases_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::BufferAssignmentProto_BufferAlias >& +BufferAssignmentProto::buffer_aliases() const { + // @@protoc_insertion_point(field_list:xla.BufferAssignmentProto.buffer_aliases) + return buffer_aliases_; +} + +// repeated .xla.BufferAllocationProto buffer_allocations = 3; +inline int BufferAssignmentProto::buffer_allocations_size() const { + return buffer_allocations_.size(); +} +inline void BufferAssignmentProto::clear_buffer_allocations() { + buffer_allocations_.Clear(); +} +inline ::xla::BufferAllocationProto* BufferAssignmentProto::mutable_buffer_allocations(int index) { + // @@protoc_insertion_point(field_mutable:xla.BufferAssignmentProto.buffer_allocations) + return buffer_allocations_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto >* +BufferAssignmentProto::mutable_buffer_allocations() { + // @@protoc_insertion_point(field_mutable_list:xla.BufferAssignmentProto.buffer_allocations) + return &buffer_allocations_; +} +inline const ::xla::BufferAllocationProto& BufferAssignmentProto::buffer_allocations(int index) const { + // @@protoc_insertion_point(field_get:xla.BufferAssignmentProto.buffer_allocations) + return buffer_allocations_.Get(index); +} +inline ::xla::BufferAllocationProto* BufferAssignmentProto::add_buffer_allocations() { + // @@protoc_insertion_point(field_add:xla.BufferAssignmentProto.buffer_allocations) + return buffer_allocations_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::BufferAllocationProto >& +BufferAssignmentProto::buffer_allocations() const { + // @@protoc_insertion_point(field_list:xla.BufferAssignmentProto.buffer_allocations) + return buffer_allocations_; +} + +// repeated .xla.HeapSimulatorTrace heap_simulator_traces = 4; +inline int BufferAssignmentProto::heap_simulator_traces_size() const { + return heap_simulator_traces_.size(); +} +inline void BufferAssignmentProto::clear_heap_simulator_traces() { + heap_simulator_traces_.Clear(); +} +inline ::xla::HeapSimulatorTrace* BufferAssignmentProto::mutable_heap_simulator_traces(int index) { + // @@protoc_insertion_point(field_mutable:xla.BufferAssignmentProto.heap_simulator_traces) + return heap_simulator_traces_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace >* +BufferAssignmentProto::mutable_heap_simulator_traces() { + // @@protoc_insertion_point(field_mutable_list:xla.BufferAssignmentProto.heap_simulator_traces) + return &heap_simulator_traces_; +} +inline const ::xla::HeapSimulatorTrace& BufferAssignmentProto::heap_simulator_traces(int index) const { + // @@protoc_insertion_point(field_get:xla.BufferAssignmentProto.heap_simulator_traces) + return heap_simulator_traces_.Get(index); +} +inline ::xla::HeapSimulatorTrace* BufferAssignmentProto::add_heap_simulator_traces() { + // @@protoc_insertion_point(field_add:xla.BufferAssignmentProto.heap_simulator_traces) + return heap_simulator_traces_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HeapSimulatorTrace >& +BufferAssignmentProto::heap_simulator_traces() const { + // @@protoc_insertion_point(field_list:xla.BufferAssignmentProto.heap_simulator_traces) + return heap_simulator_traces_; +} + +// ------------------------------------------------------------------- + +// HloProto + +// .xla.HloModuleProto hlo_module = 1; +inline bool HloProto::has_hlo_module() const { + return this != internal_default_instance() && hlo_module_ != NULL; +} +inline void HloProto::clear_hlo_module() { + if (GetArenaNoVirtual() == NULL && hlo_module_ != NULL) { + delete hlo_module_; + } + hlo_module_ = NULL; +} +inline const ::xla::HloModuleProto& HloProto::_internal_hlo_module() const { + return *hlo_module_; +} +inline const ::xla::HloModuleProto& HloProto::hlo_module() const { + const ::xla::HloModuleProto* p = hlo_module_; + // @@protoc_insertion_point(field_get:xla.HloProto.hlo_module) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloModuleProto_default_instance_); +} +inline ::xla::HloModuleProto* HloProto::release_hlo_module() { + // @@protoc_insertion_point(field_release:xla.HloProto.hlo_module) + + ::xla::HloModuleProto* temp = hlo_module_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + hlo_module_ = NULL; + return temp; +} +inline ::xla::HloModuleProto* HloProto::unsafe_arena_release_hlo_module() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloProto.hlo_module) + + ::xla::HloModuleProto* temp = hlo_module_; + hlo_module_ = NULL; + return temp; +} +inline ::xla::HloModuleProto* HloProto::mutable_hlo_module() { + + if (hlo_module_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloModuleProto>(GetArenaNoVirtual()); + hlo_module_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloProto.hlo_module) + return hlo_module_; +} +inline void HloProto::set_allocated_hlo_module(::xla::HloModuleProto* hlo_module) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete hlo_module_; + } + if (hlo_module) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(hlo_module); + if (message_arena != submessage_arena) { + hlo_module = ::google::protobuf::internal::GetOwnedMessage( + message_arena, hlo_module, submessage_arena); + } + + } else { + + } + hlo_module_ = hlo_module; + // @@protoc_insertion_point(field_set_allocated:xla.HloProto.hlo_module) +} + +// .xla.BufferAssignmentProto buffer_assignment = 3; +inline bool HloProto::has_buffer_assignment() const { + return this != internal_default_instance() && buffer_assignment_ != NULL; +} +inline void HloProto::clear_buffer_assignment() { + if (GetArenaNoVirtual() == NULL && buffer_assignment_ != NULL) { + delete buffer_assignment_; + } + buffer_assignment_ = NULL; +} +inline const ::xla::BufferAssignmentProto& HloProto::_internal_buffer_assignment() const { + return *buffer_assignment_; +} +inline const ::xla::BufferAssignmentProto& HloProto::buffer_assignment() const { + const ::xla::BufferAssignmentProto* p = buffer_assignment_; + // @@protoc_insertion_point(field_get:xla.HloProto.buffer_assignment) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_BufferAssignmentProto_default_instance_); +} +inline ::xla::BufferAssignmentProto* HloProto::release_buffer_assignment() { + // @@protoc_insertion_point(field_release:xla.HloProto.buffer_assignment) + + ::xla::BufferAssignmentProto* temp = buffer_assignment_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + buffer_assignment_ = NULL; + return temp; +} +inline ::xla::BufferAssignmentProto* HloProto::unsafe_arena_release_buffer_assignment() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloProto.buffer_assignment) + + ::xla::BufferAssignmentProto* temp = buffer_assignment_; + buffer_assignment_ = NULL; + return temp; +} +inline ::xla::BufferAssignmentProto* HloProto::mutable_buffer_assignment() { + + if (buffer_assignment_ == NULL) { + auto* p = CreateMaybeMessage<::xla::BufferAssignmentProto>(GetArenaNoVirtual()); + buffer_assignment_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloProto.buffer_assignment) + return buffer_assignment_; +} +inline void HloProto::set_allocated_buffer_assignment(::xla::BufferAssignmentProto* buffer_assignment) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete buffer_assignment_; + } + if (buffer_assignment) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(buffer_assignment); + if (message_arena != submessage_arena) { + buffer_assignment = ::google::protobuf::internal::GetOwnedMessage( + message_arena, buffer_assignment, submessage_arena); + } + + } else { + + } + buffer_assignment_ = buffer_assignment; + // @@protoc_insertion_point(field_set_allocated:xla.HloProto.buffer_assignment) +} + +// ------------------------------------------------------------------- + +// HloSnapshot + +// .xla.HloProto hlo = 1; +inline bool HloSnapshot::has_hlo() const { + return this != internal_default_instance() && hlo_ != NULL; +} +inline void HloSnapshot::clear_hlo() { + if (GetArenaNoVirtual() == NULL && hlo_ != NULL) { + delete hlo_; + } + hlo_ = NULL; +} +inline const ::xla::HloProto& HloSnapshot::_internal_hlo() const { + return *hlo_; +} +inline const ::xla::HloProto& HloSnapshot::hlo() const { + const ::xla::HloProto* p = hlo_; + // @@protoc_insertion_point(field_get:xla.HloSnapshot.hlo) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloProto_default_instance_); +} +inline ::xla::HloProto* HloSnapshot::release_hlo() { + // @@protoc_insertion_point(field_release:xla.HloSnapshot.hlo) + + ::xla::HloProto* temp = hlo_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + hlo_ = NULL; + return temp; +} +inline ::xla::HloProto* HloSnapshot::unsafe_arena_release_hlo() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloSnapshot.hlo) + + ::xla::HloProto* temp = hlo_; + hlo_ = NULL; + return temp; +} +inline ::xla::HloProto* HloSnapshot::mutable_hlo() { + + if (hlo_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloProto>(GetArenaNoVirtual()); + hlo_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloSnapshot.hlo) + return hlo_; +} +inline void HloSnapshot::set_allocated_hlo(::xla::HloProto* hlo) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete hlo_; + } + if (hlo) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(hlo); + if (message_arena != submessage_arena) { + hlo = ::google::protobuf::internal::GetOwnedMessage( + message_arena, hlo, submessage_arena); + } + + } else { + + } + hlo_ = hlo; + // @@protoc_insertion_point(field_set_allocated:xla.HloSnapshot.hlo) +} + +// repeated .xla.LiteralProto arguments = 2; +inline int HloSnapshot::arguments_size() const { + return arguments_.size(); +} +inline ::xla::LiteralProto* HloSnapshot::mutable_arguments(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloSnapshot.arguments) + return arguments_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >* +HloSnapshot::mutable_arguments() { + // @@protoc_insertion_point(field_mutable_list:xla.HloSnapshot.arguments) + return &arguments_; +} +inline const ::xla::LiteralProto& HloSnapshot::arguments(int index) const { + // @@protoc_insertion_point(field_get:xla.HloSnapshot.arguments) + return arguments_.Get(index); +} +inline ::xla::LiteralProto* HloSnapshot::add_arguments() { + // @@protoc_insertion_point(field_add:xla.HloSnapshot.arguments) + return arguments_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >& +HloSnapshot::arguments() const { + // @@protoc_insertion_point(field_list:xla.HloSnapshot.arguments) + return arguments_; +} + +// .xla.LiteralProto result = 3; +inline bool HloSnapshot::has_result() const { + return this != internal_default_instance() && result_ != NULL; +} +inline const ::xla::LiteralProto& HloSnapshot::_internal_result() const { + return *result_; +} +inline const ::xla::LiteralProto& HloSnapshot::result() const { + const ::xla::LiteralProto* p = result_; + // @@protoc_insertion_point(field_get:xla.HloSnapshot.result) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* HloSnapshot::release_result() { + // @@protoc_insertion_point(field_release:xla.HloSnapshot.result) + + ::xla::LiteralProto* temp = result_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + result_ = NULL; + return temp; +} +inline ::xla::LiteralProto* HloSnapshot::unsafe_arena_release_result() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloSnapshot.result) + + ::xla::LiteralProto* temp = result_; + result_ = NULL; + return temp; +} +inline ::xla::LiteralProto* HloSnapshot::mutable_result() { + + if (result_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + result_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.HloSnapshot.result) + return result_; +} +inline void HloSnapshot::set_allocated_result(::xla::LiteralProto* result) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(result_); + } + if (result) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(result)->GetArena(); + if (message_arena != submessage_arena) { + result = ::google::protobuf::internal::GetOwnedMessage( + message_arena, result, submessage_arena); + } + + } else { + + } + result_ = result; + // @@protoc_insertion_point(field_set_allocated:xla.HloSnapshot.result) +} + +// string execution_platform = 4; +inline void HloSnapshot::clear_execution_platform() { + execution_platform_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloSnapshot::execution_platform() const { + // @@protoc_insertion_point(field_get:xla.HloSnapshot.execution_platform) + return execution_platform_.Get(); +} +inline void HloSnapshot::set_execution_platform(const ::std::string& value) { + + execution_platform_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloSnapshot.execution_platform) +} +#if LANG_CXX11 +inline void HloSnapshot::set_execution_platform(::std::string&& value) { + + execution_platform_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloSnapshot.execution_platform) +} +#endif +inline void HloSnapshot::set_execution_platform(const char* value) { + GOOGLE_DCHECK(value != NULL); + + execution_platform_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloSnapshot.execution_platform) +} +inline void HloSnapshot::set_execution_platform(const char* value, + size_t size) { + + execution_platform_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloSnapshot.execution_platform) +} +inline ::std::string* HloSnapshot::mutable_execution_platform() { + + // @@protoc_insertion_point(field_mutable:xla.HloSnapshot.execution_platform) + return execution_platform_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloSnapshot::release_execution_platform() { + // @@protoc_insertion_point(field_release:xla.HloSnapshot.execution_platform) + + return execution_platform_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloSnapshot::set_allocated_execution_platform(::std::string* execution_platform) { + if (execution_platform != NULL) { + + } else { + + } + execution_platform_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), execution_platform, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloSnapshot.execution_platform) +} +inline ::std::string* HloSnapshot::unsafe_arena_release_execution_platform() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloSnapshot.execution_platform) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return execution_platform_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloSnapshot::unsafe_arena_set_allocated_execution_platform( + ::std::string* execution_platform) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (execution_platform != NULL) { + + } else { + + } + execution_platform_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + execution_platform, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloSnapshot.execution_platform) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace xla + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::xla::HeapSimulatorTrace_Event_Kind> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::HeapSimulatorTrace_Event_Kind>() { + return ::xla::HeapSimulatorTrace_Event_Kind_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.proto new file mode 100644 index 0000000..837032b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo.proto @@ -0,0 +1,440 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +// This proto file defines messages which represent the HLO module. This is a +// full fidelity serialization of the c++ HLO constructs. +// +// Many of the protos below are simple 1-to-1 serializations of the +// corresponding C++ classes, e.g., HloModule, HloComputation, and +// HloInstruction. +// +// FIELD NAMES ARE IMPORTANT +// +// Unlike most protos, you can't safely change the names of fields, even if you +// keep the numeric ids the same. This is because we sometimes serialize these +// protos as JSON, which includes the field names in the serialization. + +syntax = "proto3"; + +package xla; +import "diplomacy_tensorflow/compiler/xla/xla_data.proto"; + +option cc_enable_arenas = true; + +// Serialization of HloInstruction. +// Next ID: 58 +message HloInstructionProto { + reserved 10; + reserved "parameter_name"; + reserved 12; + reserved "fused_instructions_computation"; + reserved 4; + reserved "operand_names"; + reserved 5; + reserved "control_predecessor_names"; + reserved 6; + reserved "called_computation_names"; + reserved 44; + reserved "replica_group_ids"; + + string name = 1; + string opcode = 2; + xla.ShapeProto shape = 3; + + xla.OpMetadata metadata = 7; + + // Literal, only present for kConstant. + xla.LiteralProto literal = 8; + + // Parameter number is only present for kParameter. + int64 parameter_number = 9; + + // Fusion state, only present for kFusion. + string fusion_kind = 11; + + // Index for kGetTupleElement. + int64 tuple_index = 13; + + // Dimensions present for some operations that require reshaping or + // broadcasting, including Reshape, Reduce, ReduceWindow, and Reverse. + repeated int64 dimensions = 14; + + // Describes the window in a windowed operation such as convolution. + xla.Window window = 15; + + // Describes the dimension numbers used for a convolution. + xla.ConvolutionDimensionNumbers convolution_dimension_numbers = 16; + + // The number of feature groups. Used for a convolution. Must be a divisor of + // the input feature dimension and output feature dimension. If not specified, + // it will use a default value of 1. + int64 feature_group_count = 50; + + // Describes the [begin, end) index range and stride for slices. + message SliceDimensions { + int64 start = 1; + int64 limit = 2; + int64 stride = 3; + } + repeated SliceDimensions slice_dimensions = 17; + + // The bit sizes for a reduce-precision operation. + int32 exponent_bits = 18; + int32 mantissa_bits = 19; + + // Describes the [start, start + size) range size for a dynamic slice + // ('start' is specified dynamically in the second operand of the operation). + repeated int64 dynamic_slice_sizes = 20; + + // The padding configuration that describes the edge padding and interior + // padding of this pad instruction. Only set for pad instructions. + xla.PaddingConfig padding_config = 21; + + // Outfeed configuration information, only present for kOutfeed. + bytes outfeed_config = 22; + + // The distribution requested for random number generation. + // Only present for kRng. + xla.RandomDistribution distribution = 23; + + // A small float number added to the variance to avoid divide-by-zero error. + // Only present for kBatchNormTraining. + float epsilon = 24; + + // An integer value representing the index of the feature dimension. + // Only present for kBatchNormTraining. + int64 feature_index = 25; + + // Represents a unique identifier for each Send/Recv instruction pair. + // Only present for kSend or kRecv. + int64 channel_id = 26; + + // The string representation of the infeed configuration. + bytes infeed_config = 27; + + // Name of a external target (eg, global symbol) to call, only present for + // kCustomCall. + string custom_call_target = 28; + + // Opaque string, only present for kCustomCall. + string custom_call_opaque = 53; + + // Shape of outfeed request. + xla.ShapeProto outfeed_shape = 29; + + // Describes the dimension numbers used for a dot operation + xla.DotDimensionNumbers dot_dimension_numbers = 30; + + // FFT type (FFT, IFFT, etc). + xla.FftType fft_type = 31; + + // FFT length. + repeated int64 fft_length = 32; + + // Gather dimension numbers. + xla.GatherDimensionNumbers gather_dimension_numbers = 33; + repeated int64 gather_slice_sizes = 34; + + // Compute Host. + string channel_name = 41; + int64 cost_estimate_ns = 42; + + // The id of this instruction. + int64 id = 35; + + repeated int64 operand_ids = 36; + repeated int64 control_predecessor_ids = 37; + repeated int64 called_computation_ids = 38; + + xla.OpSharding sharding = 40; + + // Backend configuration for the instruction. Has backend-specific meaning. + string backend_config = 43; + + // Cross replica op fields. + repeated ReplicaGroup replica_groups = 49; + int64 all_reduce_id = 45; + string cross_replica_sum_barrier = 46; + + // Whether this Send/Recv instruction transfers data to/from the host. Only + // present for Send and Recv instructions and their SendDone and RecvDone + // partners. + bool is_host_transfer = 47; + + xla.ScatterDimensionNumbers scatter_dimension_numbers = 48; + + // Precision configuration for the instruction. Has backend-specific meaning. + xla.PrecisionConfig precision_config = 51; + + // Collective permute field. + repeated SourceTarget source_target_pairs = 52; + + // Sharding for kDomain instructions. + xla.OpSharding domain_entry_sharding = 54; + xla.OpSharding domain_exit_sharding = 55; + + // For custom call this indicates that the layouts are constrained. If + // constrain_layout is true then the 'shape' field must contain a layout, and + // 'operand_shapes_with_layout' must contain a shape with layout for each + // operand. + bool constrain_layout = 56; + repeated xla.ShapeProto operand_shapes_with_layout = 57; +} + +// Serialization of HloComputation. +message HloComputationProto { + reserved 3; + reserved "root_name"; + + string name = 1; + + // The array of instructions is always in a valid dependency order, where + // operands appear before their users. + repeated HloInstructionProto instructions = 2; + + // The program shape (with layout) of this computation. + + xla.ProgramShapeProto program_shape = 4; + + // The id of this computation. + int64 id = 5; + + // The id of the root of the computation. + int64 root_id = 6; +} + +// Serialization of an HLO schedule. An HLO schedule contains a total order of +// instructions for each non-fusion computation in the module. +message HloScheduleProto { + message InstructionSequence { + repeated int64 instruction_ids = 1; + } + + // Map from computation id to sequence. + map sequences = 1; +} + +message HloInputOutputAliasProto { + // The following proto describes a pair of aliased an input + // (described by parameter number and a ShapeIndex of the parameter) + // and an output (described by a ShapeIndex of the root + // instruction). For example: + // + // entry = { + // output_shape_index={1}, + // parameter_number=0, + // parameter_shape_index={1, 2}, + // } + // + // This entry indicates that the first paremter's {1, 2} element is + // aliased with the {1} element of the root instruction. + message AliasEntryProto { + // ShapeIndex of the root hlo. + repeated int64 output_shape_index = 1; + // Number of the parameter in entry computation. + int64 parameter_number = 2; + // ShapeIndex of the parameter instruction. + repeated int64 parameter_shape_index = 3; + } + + repeated AliasEntryProto entries = 1; +} + +message DynamicParameterBindingProto { + // A list of bindings which indicates that the `target_dim_num` in + // the subshape `target_param_index` of parameter `target_param_num` + // is a dynamic dimension and its real dynamic size is represented + // by `dynamic_param_index` in parameter `dynamic_param_num`. + // + // As an example, imagine we have a program: + // + // ENTRY main { + // a = f32[] parameter(0) + // b = f32[10] parameter(1) + // ROOT root = (f32[], f32[10]) tuple(%a, %b) + // } + // + // Let's say 'b' (param index 1) is a dynamic shape whose input has + // an upperbound of 10 and real size is determined at runtime.'a' + // represents the real size of b's first dimension. + // + // In this case, the fields are set in the following way: + // dynamic_param_num = 1 + // dynamic_param_index = {} + // target_param_num = 0 + // target_param_index = {} + // target_param_dim = 0 + message Binding { + int64 dynamic_param_num = 1; + repeated int64 dynamic_param_index = 2; + int64 target_param_num = 3; + repeated int64 target_param_index = 4; + int64 target_param_dim_num = 5; + } + + repeated Binding entries = 1; +} + +// Serialization of HloModule. +message HloModuleProto { + string name = 1; + string entry_computation_name = 2; + int64 entry_computation_id = 6; + + // The array of computations is always in a valid dependency order, where + // callees appear before their callers. + repeated HloComputationProto computations = 3; + + // The host program shape (with layout) of the entry computation. + xla.ProgramShapeProto host_program_shape = 4; + + // The id of this module. + int64 id = 5; + + // The schedule for this module. + HloScheduleProto schedule = 7; + + // Describes alias information between inputs and outputs. + HloInputOutputAliasProto input_output_alias = 8; + + DynamicParameterBindingProto dynamic_parameter_binding = 9; +} + +// Serialization of LogicalBuffer. +message LogicalBufferProto { + // Location represents an instruction and its shape index, which uniquely + // identifies a point where a buffer is needed. + message Location { + // NOTE: module_name isn't necessary, since all LogicalBuffers are + // associated with a single HloModule. + string computation_name = 1; + string instruction_name = 2; + repeated int64 shape_index = 3; + } + + int64 id = 1; + int64 size = 2; + + // The location where the buffer is defined. + Location defined_at = 3; + + int64 color = 4; +} + +// Serialization of BufferAllocation. +message BufferAllocationProto { + // Assigned represents a single LogicalBuffer that is assigned to this + // BufferAllocation. + message Assigned { + int64 logical_buffer_id = 1; + int64 offset = 2; + int64 size = 3; + } + + int64 index = 1; + int64 size = 2; + bool is_thread_local = 3; + bool is_tuple = 11; + bool is_entry_computation_parameter = 5; + bool is_constant = 12; + int64 parameter_number = 6; + repeated int64 parameter_shape_index = 10; + bool maybe_live_out = 7; + int64 color = 8; + repeated Assigned assigned = 9; +} + +// A trace of a HeapSimulator run. +message HeapSimulatorTrace { + // The trace includes a list of events, where each event describes one action + // performed by the heap simulator. + message Event { + enum Kind { + ALLOC = 0; // A memory region was allocated for the buffer. + FREE = 1; // A memory region was freed for the buffer. + + // A buffer was shared with another (canonical) buffer. This is similar to + // ALLOC, except that instead of allocating a new region of memory, the + // memory region of the canonical buffer is directly re-used. Multiple + // buffers may share with the same canonical buffer. The lifetime of the + // canonical buffer is extended to the union of all lifetimes. + SHARE_WITH = 2; + } + Kind kind = 1; + + // The id of the LogicalBuffer that the event applies to. + int64 buffer_id = 2; + + // The HloInstruction that the simulation was processing that caused this + // event to occur, identified by its computation and instruction name. E.g. + // buffers defined by instruction A are allocated when processing A. + string computation_name = 3; + string instruction_name = 4; + + // The id of the canonical LogicalBuffer that the buffer shares with. Only + // set for SHARE_WITH events. + int64 share_with_canonical_id = 5; + } + repeated Event events = 1; + bool whole_module_simulation = 2; +} + +// An abstraction representing a set of HLO module built to run concurrently +// across different devices. +message HloModuleGroupProto { + string name = 1; + repeated HloModuleProto hlo_modules = 2; +} + +// Serialization of BufferAssignment. +message BufferAssignmentProto { + // Alias represents a source LogicalBuffer, and the buffer location that + // aliases it. + message BufferAlias { + int64 source_buffer_id = 1; + LogicalBufferProto.Location location = 2; + } + + repeated LogicalBufferProto logical_buffers = 1; + repeated BufferAlias buffer_aliases = 2; + repeated BufferAllocationProto buffer_allocations = 3; + repeated HeapSimulatorTrace heap_simulator_traces = 4; +} + +// Grouping message that contains all of the information above. +message HloProto { + reserved 2; + reserved "hlo_ordering"; + + HloModuleProto hlo_module = 1; + BufferAssignmentProto buffer_assignment = 3; +} + +// Encapsulates HloProto together with the arguments, result, and +// execution_platform. This message is used for purposes such as +// analysis/replay/file-storage. +message HloSnapshot { + // The hlo graph. + HloProto hlo = 1; + + // The arguments passed to the graph. + repeated LiteralProto arguments = 2; + + // The result of the graph. + LiteralProto result = 3; + + // The name of the platform used to run the graph. + string execution_platform = 4; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_pb2.py new file mode 100644 index 0000000..a94a5ff --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_pb2.py @@ -0,0 +1,1673 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/xla/service/hlo.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.compiler.xla import xla_data_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/xla/service/hlo.proto', + package='xla', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n3diplomacy_tensorflow/compiler/xla/service/hlo.proto\x12\x03xla\x1a\x30\x64iplomacy_tensorflow/compiler/xla/xla_data.proto\"\xf9\x0e\n\x13HloInstructionProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06opcode\x18\x02 \x01(\t\x12\x1e\n\x05shape\x18\x03 \x01(\x0b\x32\x0f.xla.ShapeProto\x12!\n\x08metadata\x18\x07 \x01(\x0b\x32\x0f.xla.OpMetadata\x12\"\n\x07literal\x18\x08 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x18\n\x10parameter_number\x18\t \x01(\x03\x12\x13\n\x0b\x66usion_kind\x18\x0b \x01(\t\x12\x13\n\x0btuple_index\x18\r \x01(\x03\x12\x12\n\ndimensions\x18\x0e \x03(\x03\x12\x1b\n\x06window\x18\x0f \x01(\x0b\x32\x0b.xla.Window\x12G\n\x1d\x63onvolution_dimension_numbers\x18\x10 \x01(\x0b\x32 .xla.ConvolutionDimensionNumbers\x12\x1b\n\x13\x66\x65\x61ture_group_count\x18\x32 \x01(\x03\x12\x42\n\x10slice_dimensions\x18\x11 \x03(\x0b\x32(.xla.HloInstructionProto.SliceDimensions\x12\x15\n\rexponent_bits\x18\x12 \x01(\x05\x12\x15\n\rmantissa_bits\x18\x13 \x01(\x05\x12\x1b\n\x13\x64ynamic_slice_sizes\x18\x14 \x03(\x03\x12*\n\x0epadding_config\x18\x15 \x01(\x0b\x32\x12.xla.PaddingConfig\x12\x16\n\x0eoutfeed_config\x18\x16 \x01(\x0c\x12-\n\x0c\x64istribution\x18\x17 \x01(\x0e\x32\x17.xla.RandomDistribution\x12\x0f\n\x07\x65psilon\x18\x18 \x01(\x02\x12\x15\n\rfeature_index\x18\x19 \x01(\x03\x12\x12\n\nchannel_id\x18\x1a \x01(\x03\x12\x15\n\rinfeed_config\x18\x1b \x01(\x0c\x12\x1a\n\x12\x63ustom_call_target\x18\x1c \x01(\t\x12\x1a\n\x12\x63ustom_call_opaque\x18\x35 \x01(\t\x12&\n\routfeed_shape\x18\x1d \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x37\n\x15\x64ot_dimension_numbers\x18\x1e \x01(\x0b\x32\x18.xla.DotDimensionNumbers\x12\x1e\n\x08\x66\x66t_type\x18\x1f \x01(\x0e\x32\x0c.xla.FftType\x12\x12\n\nfft_length\x18 \x03(\x03\x12=\n\x18gather_dimension_numbers\x18! \x01(\x0b\x32\x1b.xla.GatherDimensionNumbers\x12\x1a\n\x12gather_slice_sizes\x18\" \x03(\x03\x12\x14\n\x0c\x63hannel_name\x18) \x01(\t\x12\x18\n\x10\x63ost_estimate_ns\x18* \x01(\x03\x12\n\n\x02id\x18# \x01(\x03\x12\x13\n\x0boperand_ids\x18$ \x03(\x03\x12\x1f\n\x17\x63ontrol_predecessor_ids\x18% \x03(\x03\x12\x1e\n\x16\x63\x61lled_computation_ids\x18& \x03(\x03\x12!\n\x08sharding\x18( \x01(\x0b\x32\x0f.xla.OpSharding\x12\x16\n\x0e\x62\x61\x63kend_config\x18+ \x01(\t\x12)\n\x0ereplica_groups\x18\x31 \x03(\x0b\x32\x11.xla.ReplicaGroup\x12\x15\n\rall_reduce_id\x18- \x01(\x03\x12!\n\x19\x63ross_replica_sum_barrier\x18. \x01(\t\x12\x18\n\x10is_host_transfer\x18/ \x01(\x08\x12?\n\x19scatter_dimension_numbers\x18\x30 \x01(\x0b\x32\x1c.xla.ScatterDimensionNumbers\x12.\n\x10precision_config\x18\x33 \x01(\x0b\x32\x14.xla.PrecisionConfig\x12.\n\x13source_target_pairs\x18\x34 \x03(\x0b\x32\x11.xla.SourceTarget\x12.\n\x15\x64omain_entry_sharding\x18\x36 \x01(\x0b\x32\x0f.xla.OpSharding\x12-\n\x14\x64omain_exit_sharding\x18\x37 \x01(\x0b\x32\x0f.xla.OpSharding\x12\x18\n\x10\x63onstrain_layout\x18\x38 \x01(\x08\x12\x33\n\x1aoperand_shapes_with_layout\x18\x39 \x03(\x0b\x32\x0f.xla.ShapeProto\x1a?\n\x0fSliceDimensions\x12\r\n\x05start\x18\x01 \x01(\x03\x12\r\n\x05limit\x18\x02 \x01(\x03\x12\x0e\n\x06stride\x18\x03 \x01(\x03J\x04\x08\n\x10\x0bJ\x04\x08\x0c\x10\rJ\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08,\x10-R\x0eparameter_nameR\x1e\x66used_instructions_computationR\roperand_namesR\x19\x63ontrol_predecessor_namesR\x18\x63\x61lled_computation_namesR\x11replica_group_ids\"\xb0\x01\n\x13HloComputationProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\x0cinstructions\x18\x02 \x03(\x0b\x32\x18.xla.HloInstructionProto\x12-\n\rprogram_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\x0f\n\x07root_id\x18\x06 \x01(\x03J\x04\x08\x03\x10\x04R\troot_name\"\xd8\x01\n\x10HloScheduleProto\x12\x37\n\tsequences\x18\x01 \x03(\x0b\x32$.xla.HloScheduleProto.SequencesEntry\x1a.\n\x13InstructionSequence\x12\x17\n\x0finstruction_ids\x18\x01 \x03(\x03\x1a[\n\x0eSequencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).xla.HloScheduleProto.InstructionSequence:\x02\x38\x01\"\xc2\x01\n\x18HloInputOutputAliasProto\x12>\n\x07\x65ntries\x18\x01 \x03(\x0b\x32-.xla.HloInputOutputAliasProto.AliasEntryProto\x1a\x66\n\x0f\x41liasEntryProto\x12\x1a\n\x12output_shape_index\x18\x01 \x03(\x03\x12\x18\n\x10parameter_number\x18\x02 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\x03 \x03(\x03\"\xf2\x01\n\x1c\x44ynamicParameterBindingProto\x12:\n\x07\x65ntries\x18\x01 \x03(\x0b\x32).xla.DynamicParameterBindingProto.Binding\x1a\x95\x01\n\x07\x42inding\x12\x19\n\x11\x64ynamic_param_num\x18\x01 \x01(\x03\x12\x1b\n\x13\x64ynamic_param_index\x18\x02 \x03(\x03\x12\x18\n\x10target_param_num\x18\x03 \x01(\x03\x12\x1a\n\x12target_param_index\x18\x04 \x03(\x03\x12\x1c\n\x14target_param_dim_num\x18\x05 \x01(\x03\"\xf6\x02\n\x0eHloModuleProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65ntry_computation_name\x18\x02 \x01(\t\x12\x1c\n\x14\x65ntry_computation_id\x18\x06 \x01(\x03\x12.\n\x0c\x63omputations\x18\x03 \x03(\x0b\x32\x18.xla.HloComputationProto\x12\x32\n\x12host_program_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\n\n\x02id\x18\x05 \x01(\x03\x12\'\n\x08schedule\x18\x07 \x01(\x0b\x32\x15.xla.HloScheduleProto\x12\x39\n\x12input_output_alias\x18\x08 \x01(\x0b\x32\x1d.xla.HloInputOutputAliasProto\x12\x44\n\x19\x64ynamic_parameter_binding\x18\t \x01(\x0b\x32!.xla.DynamicParameterBindingProto\"\xc8\x01\n\x12LogicalBufferProto\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x34\n\ndefined_at\x18\x03 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\x12\r\n\x05\x63olor\x18\x04 \x01(\x03\x1aS\n\x08Location\x12\x18\n\x10\x63omputation_name\x18\x01 \x01(\t\x12\x18\n\x10instruction_name\x18\x02 \x01(\t\x12\x13\n\x0bshape_index\x18\x03 \x03(\x03\"\xf8\x02\n\x15\x42ufferAllocationProto\x12\r\n\x05index\x18\x01 \x01(\x03\x12\x0c\n\x04size\x18\x02 \x01(\x03\x12\x17\n\x0fis_thread_local\x18\x03 \x01(\x08\x12\x10\n\x08is_tuple\x18\x0b \x01(\x08\x12&\n\x1eis_entry_computation_parameter\x18\x05 \x01(\x08\x12\x13\n\x0bis_constant\x18\x0c \x01(\x08\x12\x18\n\x10parameter_number\x18\x06 \x01(\x03\x12\x1d\n\x15parameter_shape_index\x18\n \x03(\x03\x12\x16\n\x0emaybe_live_out\x18\x07 \x01(\x08\x12\r\n\x05\x63olor\x18\x08 \x01(\x03\x12\x35\n\x08\x61ssigned\x18\t \x03(\x0b\x32#.xla.BufferAllocationProto.Assigned\x1a\x43\n\x08\x41ssigned\x12\x19\n\x11logical_buffer_id\x18\x01 \x01(\x03\x12\x0e\n\x06offset\x18\x02 \x01(\x03\x12\x0c\n\x04size\x18\x03 \x01(\x03\"\xb5\x02\n\x12HeapSimulatorTrace\x12-\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x1d.xla.HeapSimulatorTrace.Event\x12\x1f\n\x17whole_module_simulation\x18\x02 \x01(\x08\x1a\xce\x01\n\x05\x45vent\x12\x30\n\x04kind\x18\x01 \x01(\x0e\x32\".xla.HeapSimulatorTrace.Event.Kind\x12\x11\n\tbuffer_id\x18\x02 \x01(\x03\x12\x18\n\x10\x63omputation_name\x18\x03 \x01(\t\x12\x18\n\x10instruction_name\x18\x04 \x01(\t\x12\x1f\n\x17share_with_canonical_id\x18\x05 \x01(\x03\"+\n\x04Kind\x12\t\n\x05\x41LLOC\x10\x00\x12\x08\n\x04\x46REE\x10\x01\x12\x0e\n\nSHARE_WITH\x10\x02\"M\n\x13HloModuleGroupProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12(\n\x0bhlo_modules\x18\x02 \x03(\x0b\x32\x13.xla.HloModuleProto\"\xd6\x02\n\x15\x42ufferAssignmentProto\x12\x30\n\x0flogical_buffers\x18\x01 \x03(\x0b\x32\x17.xla.LogicalBufferProto\x12>\n\x0e\x62uffer_aliases\x18\x02 \x03(\x0b\x32&.xla.BufferAssignmentProto.BufferAlias\x12\x36\n\x12\x62uffer_allocations\x18\x03 \x03(\x0b\x32\x1a.xla.BufferAllocationProto\x12\x36\n\x15heap_simulator_traces\x18\x04 \x03(\x0b\x32\x17.xla.HeapSimulatorTrace\x1a[\n\x0b\x42ufferAlias\x12\x18\n\x10source_buffer_id\x18\x01 \x01(\x03\x12\x32\n\x08location\x18\x02 \x01(\x0b\x32 .xla.LogicalBufferProto.Location\"~\n\x08HloProto\x12\'\n\nhlo_module\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\x35\n\x11\x62uffer_assignment\x18\x03 \x01(\x0b\x32\x1a.xla.BufferAssignmentProtoJ\x04\x08\x02\x10\x03R\x0chlo_ordering\"\x8e\x01\n\x0bHloSnapshot\x12\x1a\n\x03hlo\x18\x01 \x01(\x0b\x32\r.xla.HloProto\x12$\n\targuments\x18\x02 \x03(\x0b\x32\x11.xla.LiteralProto\x12!\n\x06result\x18\x03 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x1a\n\x12\x65xecution_platform\x18\x04 \x01(\tB\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2.DESCRIPTOR,]) + + + +_HEAPSIMULATORTRACE_EVENT_KIND = _descriptor.EnumDescriptor( + name='Kind', + full_name='xla.HeapSimulatorTrace.Event.Kind', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ALLOC', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FREE', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SHARE_WITH', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=4092, + serialized_end=4135, +) +_sym_db.RegisterEnumDescriptor(_HEAPSIMULATORTRACE_EVENT_KIND) + + +_HLOINSTRUCTIONPROTO_SLICEDIMENSIONS = _descriptor.Descriptor( + name='SliceDimensions', + full_name='xla.HloInstructionProto.SliceDimensions', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='start', full_name='xla.HloInstructionProto.SliceDimensions.start', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='limit', full_name='xla.HloInstructionProto.SliceDimensions.limit', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='stride', full_name='xla.HloInstructionProto.SliceDimensions.stride', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1790, + serialized_end=1853, +) + +_HLOINSTRUCTIONPROTO = _descriptor.Descriptor( + name='HloInstructionProto', + full_name='xla.HloInstructionProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='xla.HloInstructionProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='opcode', full_name='xla.HloInstructionProto.opcode', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='xla.HloInstructionProto.shape', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata', full_name='xla.HloInstructionProto.metadata', index=3, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='literal', full_name='xla.HloInstructionProto.literal', index=4, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='parameter_number', full_name='xla.HloInstructionProto.parameter_number', index=5, + number=9, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fusion_kind', full_name='xla.HloInstructionProto.fusion_kind', index=6, + number=11, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tuple_index', full_name='xla.HloInstructionProto.tuple_index', index=7, + number=13, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dimensions', full_name='xla.HloInstructionProto.dimensions', index=8, + number=14, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='window', full_name='xla.HloInstructionProto.window', index=9, + number=15, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='convolution_dimension_numbers', full_name='xla.HloInstructionProto.convolution_dimension_numbers', index=10, + number=16, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_group_count', full_name='xla.HloInstructionProto.feature_group_count', index=11, + number=50, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='slice_dimensions', full_name='xla.HloInstructionProto.slice_dimensions', index=12, + number=17, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='exponent_bits', full_name='xla.HloInstructionProto.exponent_bits', index=13, + number=18, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mantissa_bits', full_name='xla.HloInstructionProto.mantissa_bits', index=14, + number=19, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dynamic_slice_sizes', full_name='xla.HloInstructionProto.dynamic_slice_sizes', index=15, + number=20, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='padding_config', full_name='xla.HloInstructionProto.padding_config', index=16, + number=21, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='outfeed_config', full_name='xla.HloInstructionProto.outfeed_config', index=17, + number=22, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='distribution', full_name='xla.HloInstructionProto.distribution', index=18, + number=23, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='epsilon', full_name='xla.HloInstructionProto.epsilon', index=19, + number=24, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_index', full_name='xla.HloInstructionProto.feature_index', index=20, + number=25, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='channel_id', full_name='xla.HloInstructionProto.channel_id', index=21, + number=26, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='infeed_config', full_name='xla.HloInstructionProto.infeed_config', index=22, + number=27, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom_call_target', full_name='xla.HloInstructionProto.custom_call_target', index=23, + number=28, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom_call_opaque', full_name='xla.HloInstructionProto.custom_call_opaque', index=24, + number=53, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='outfeed_shape', full_name='xla.HloInstructionProto.outfeed_shape', index=25, + number=29, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dot_dimension_numbers', full_name='xla.HloInstructionProto.dot_dimension_numbers', index=26, + number=30, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fft_type', full_name='xla.HloInstructionProto.fft_type', index=27, + number=31, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fft_length', full_name='xla.HloInstructionProto.fft_length', index=28, + number=32, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='gather_dimension_numbers', full_name='xla.HloInstructionProto.gather_dimension_numbers', index=29, + number=33, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='gather_slice_sizes', full_name='xla.HloInstructionProto.gather_slice_sizes', index=30, + number=34, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='channel_name', full_name='xla.HloInstructionProto.channel_name', index=31, + number=41, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='cost_estimate_ns', full_name='xla.HloInstructionProto.cost_estimate_ns', index=32, + number=42, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='id', full_name='xla.HloInstructionProto.id', index=33, + number=35, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='operand_ids', full_name='xla.HloInstructionProto.operand_ids', index=34, + number=36, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='control_predecessor_ids', full_name='xla.HloInstructionProto.control_predecessor_ids', index=35, + number=37, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='called_computation_ids', full_name='xla.HloInstructionProto.called_computation_ids', index=36, + number=38, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sharding', full_name='xla.HloInstructionProto.sharding', index=37, + number=40, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='backend_config', full_name='xla.HloInstructionProto.backend_config', index=38, + number=43, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='replica_groups', full_name='xla.HloInstructionProto.replica_groups', index=39, + number=49, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='all_reduce_id', full_name='xla.HloInstructionProto.all_reduce_id', index=40, + number=45, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='cross_replica_sum_barrier', full_name='xla.HloInstructionProto.cross_replica_sum_barrier', index=41, + number=46, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_host_transfer', full_name='xla.HloInstructionProto.is_host_transfer', index=42, + number=47, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='scatter_dimension_numbers', full_name='xla.HloInstructionProto.scatter_dimension_numbers', index=43, + number=48, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='precision_config', full_name='xla.HloInstructionProto.precision_config', index=44, + number=51, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='source_target_pairs', full_name='xla.HloInstructionProto.source_target_pairs', index=45, + number=52, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='domain_entry_sharding', full_name='xla.HloInstructionProto.domain_entry_sharding', index=46, + number=54, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='domain_exit_sharding', full_name='xla.HloInstructionProto.domain_exit_sharding', index=47, + number=55, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='constrain_layout', full_name='xla.HloInstructionProto.constrain_layout', index=48, + number=56, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='operand_shapes_with_layout', full_name='xla.HloInstructionProto.operand_shapes_with_layout', index=49, + number=57, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_HLOINSTRUCTIONPROTO_SLICEDIMENSIONS, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=111, + serialized_end=2024, +) + + +_HLOCOMPUTATIONPROTO = _descriptor.Descriptor( + name='HloComputationProto', + full_name='xla.HloComputationProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='xla.HloComputationProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='instructions', full_name='xla.HloComputationProto.instructions', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='program_shape', full_name='xla.HloComputationProto.program_shape', index=2, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='id', full_name='xla.HloComputationProto.id', index=3, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='root_id', full_name='xla.HloComputationProto.root_id', index=4, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2027, + serialized_end=2203, +) + + +_HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE = _descriptor.Descriptor( + name='InstructionSequence', + full_name='xla.HloScheduleProto.InstructionSequence', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='instruction_ids', full_name='xla.HloScheduleProto.InstructionSequence.instruction_ids', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2283, + serialized_end=2329, +) + +_HLOSCHEDULEPROTO_SEQUENCESENTRY = _descriptor.Descriptor( + name='SequencesEntry', + full_name='xla.HloScheduleProto.SequencesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='xla.HloScheduleProto.SequencesEntry.key', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='xla.HloScheduleProto.SequencesEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2331, + serialized_end=2422, +) + +_HLOSCHEDULEPROTO = _descriptor.Descriptor( + name='HloScheduleProto', + full_name='xla.HloScheduleProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='sequences', full_name='xla.HloScheduleProto.sequences', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE, _HLOSCHEDULEPROTO_SEQUENCESENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2206, + serialized_end=2422, +) + + +_HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO = _descriptor.Descriptor( + name='AliasEntryProto', + full_name='xla.HloInputOutputAliasProto.AliasEntryProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='output_shape_index', full_name='xla.HloInputOutputAliasProto.AliasEntryProto.output_shape_index', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='parameter_number', full_name='xla.HloInputOutputAliasProto.AliasEntryProto.parameter_number', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='parameter_shape_index', full_name='xla.HloInputOutputAliasProto.AliasEntryProto.parameter_shape_index', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2517, + serialized_end=2619, +) + +_HLOINPUTOUTPUTALIASPROTO = _descriptor.Descriptor( + name='HloInputOutputAliasProto', + full_name='xla.HloInputOutputAliasProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entries', full_name='xla.HloInputOutputAliasProto.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2425, + serialized_end=2619, +) + + +_DYNAMICPARAMETERBINDINGPROTO_BINDING = _descriptor.Descriptor( + name='Binding', + full_name='xla.DynamicParameterBindingProto.Binding', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dynamic_param_num', full_name='xla.DynamicParameterBindingProto.Binding.dynamic_param_num', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dynamic_param_index', full_name='xla.DynamicParameterBindingProto.Binding.dynamic_param_index', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='target_param_num', full_name='xla.DynamicParameterBindingProto.Binding.target_param_num', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='target_param_index', full_name='xla.DynamicParameterBindingProto.Binding.target_param_index', index=3, + number=4, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='target_param_dim_num', full_name='xla.DynamicParameterBindingProto.Binding.target_param_dim_num', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2715, + serialized_end=2864, +) + +_DYNAMICPARAMETERBINDINGPROTO = _descriptor.Descriptor( + name='DynamicParameterBindingProto', + full_name='xla.DynamicParameterBindingProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entries', full_name='xla.DynamicParameterBindingProto.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_DYNAMICPARAMETERBINDINGPROTO_BINDING, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2622, + serialized_end=2864, +) + + +_HLOMODULEPROTO = _descriptor.Descriptor( + name='HloModuleProto', + full_name='xla.HloModuleProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='xla.HloModuleProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='entry_computation_name', full_name='xla.HloModuleProto.entry_computation_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='entry_computation_id', full_name='xla.HloModuleProto.entry_computation_id', index=2, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='computations', full_name='xla.HloModuleProto.computations', index=3, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='host_program_shape', full_name='xla.HloModuleProto.host_program_shape', index=4, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='id', full_name='xla.HloModuleProto.id', index=5, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='schedule', full_name='xla.HloModuleProto.schedule', index=6, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input_output_alias', full_name='xla.HloModuleProto.input_output_alias', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dynamic_parameter_binding', full_name='xla.HloModuleProto.dynamic_parameter_binding', index=8, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2867, + serialized_end=3241, +) + + +_LOGICALBUFFERPROTO_LOCATION = _descriptor.Descriptor( + name='Location', + full_name='xla.LogicalBufferProto.Location', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='computation_name', full_name='xla.LogicalBufferProto.Location.computation_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='instruction_name', full_name='xla.LogicalBufferProto.Location.instruction_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape_index', full_name='xla.LogicalBufferProto.Location.shape_index', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3361, + serialized_end=3444, +) + +_LOGICALBUFFERPROTO = _descriptor.Descriptor( + name='LogicalBufferProto', + full_name='xla.LogicalBufferProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='xla.LogicalBufferProto.id', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='size', full_name='xla.LogicalBufferProto.size', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='defined_at', full_name='xla.LogicalBufferProto.defined_at', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='color', full_name='xla.LogicalBufferProto.color', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_LOGICALBUFFERPROTO_LOCATION, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3244, + serialized_end=3444, +) + + +_BUFFERALLOCATIONPROTO_ASSIGNED = _descriptor.Descriptor( + name='Assigned', + full_name='xla.BufferAllocationProto.Assigned', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='logical_buffer_id', full_name='xla.BufferAllocationProto.Assigned.logical_buffer_id', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='offset', full_name='xla.BufferAllocationProto.Assigned.offset', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='size', full_name='xla.BufferAllocationProto.Assigned.size', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3756, + serialized_end=3823, +) + +_BUFFERALLOCATIONPROTO = _descriptor.Descriptor( + name='BufferAllocationProto', + full_name='xla.BufferAllocationProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='xla.BufferAllocationProto.index', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='size', full_name='xla.BufferAllocationProto.size', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_thread_local', full_name='xla.BufferAllocationProto.is_thread_local', index=2, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_tuple', full_name='xla.BufferAllocationProto.is_tuple', index=3, + number=11, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_entry_computation_parameter', full_name='xla.BufferAllocationProto.is_entry_computation_parameter', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_constant', full_name='xla.BufferAllocationProto.is_constant', index=5, + number=12, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='parameter_number', full_name='xla.BufferAllocationProto.parameter_number', index=6, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='parameter_shape_index', full_name='xla.BufferAllocationProto.parameter_shape_index', index=7, + number=10, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='maybe_live_out', full_name='xla.BufferAllocationProto.maybe_live_out', index=8, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='color', full_name='xla.BufferAllocationProto.color', index=9, + number=8, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='assigned', full_name='xla.BufferAllocationProto.assigned', index=10, + number=9, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_BUFFERALLOCATIONPROTO_ASSIGNED, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3447, + serialized_end=3823, +) + + +_HEAPSIMULATORTRACE_EVENT = _descriptor.Descriptor( + name='Event', + full_name='xla.HeapSimulatorTrace.Event', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='kind', full_name='xla.HeapSimulatorTrace.Event.kind', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='buffer_id', full_name='xla.HeapSimulatorTrace.Event.buffer_id', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='computation_name', full_name='xla.HeapSimulatorTrace.Event.computation_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='instruction_name', full_name='xla.HeapSimulatorTrace.Event.instruction_name', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='share_with_canonical_id', full_name='xla.HeapSimulatorTrace.Event.share_with_canonical_id', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _HEAPSIMULATORTRACE_EVENT_KIND, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3929, + serialized_end=4135, +) + +_HEAPSIMULATORTRACE = _descriptor.Descriptor( + name='HeapSimulatorTrace', + full_name='xla.HeapSimulatorTrace', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='events', full_name='xla.HeapSimulatorTrace.events', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='whole_module_simulation', full_name='xla.HeapSimulatorTrace.whole_module_simulation', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_HEAPSIMULATORTRACE_EVENT, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3826, + serialized_end=4135, +) + + +_HLOMODULEGROUPPROTO = _descriptor.Descriptor( + name='HloModuleGroupProto', + full_name='xla.HloModuleGroupProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='xla.HloModuleGroupProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='hlo_modules', full_name='xla.HloModuleGroupProto.hlo_modules', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4137, + serialized_end=4214, +) + + +_BUFFERASSIGNMENTPROTO_BUFFERALIAS = _descriptor.Descriptor( + name='BufferAlias', + full_name='xla.BufferAssignmentProto.BufferAlias', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='source_buffer_id', full_name='xla.BufferAssignmentProto.BufferAlias.source_buffer_id', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='location', full_name='xla.BufferAssignmentProto.BufferAlias.location', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4468, + serialized_end=4559, +) + +_BUFFERASSIGNMENTPROTO = _descriptor.Descriptor( + name='BufferAssignmentProto', + full_name='xla.BufferAssignmentProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='logical_buffers', full_name='xla.BufferAssignmentProto.logical_buffers', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='buffer_aliases', full_name='xla.BufferAssignmentProto.buffer_aliases', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='buffer_allocations', full_name='xla.BufferAssignmentProto.buffer_allocations', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='heap_simulator_traces', full_name='xla.BufferAssignmentProto.heap_simulator_traces', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_BUFFERASSIGNMENTPROTO_BUFFERALIAS, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4217, + serialized_end=4559, +) + + +_HLOPROTO = _descriptor.Descriptor( + name='HloProto', + full_name='xla.HloProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='hlo_module', full_name='xla.HloProto.hlo_module', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='buffer_assignment', full_name='xla.HloProto.buffer_assignment', index=1, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4561, + serialized_end=4687, +) + + +_HLOSNAPSHOT = _descriptor.Descriptor( + name='HloSnapshot', + full_name='xla.HloSnapshot', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='hlo', full_name='xla.HloSnapshot.hlo', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='arguments', full_name='xla.HloSnapshot.arguments', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='result', full_name='xla.HloSnapshot.result', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='execution_platform', full_name='xla.HloSnapshot.execution_platform', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4690, + serialized_end=4832, +) + +_HLOINSTRUCTIONPROTO_SLICEDIMENSIONS.containing_type = _HLOINSTRUCTIONPROTO +_HLOINSTRUCTIONPROTO.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_HLOINSTRUCTIONPROTO.fields_by_name['metadata'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._OPMETADATA +_HLOINSTRUCTIONPROTO.fields_by_name['literal'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_HLOINSTRUCTIONPROTO.fields_by_name['window'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._WINDOW +_HLOINSTRUCTIONPROTO.fields_by_name['convolution_dimension_numbers'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._CONVOLUTIONDIMENSIONNUMBERS +_HLOINSTRUCTIONPROTO.fields_by_name['slice_dimensions'].message_type = _HLOINSTRUCTIONPROTO_SLICEDIMENSIONS +_HLOINSTRUCTIONPROTO.fields_by_name['padding_config'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._PADDINGCONFIG +_HLOINSTRUCTIONPROTO.fields_by_name['distribution'].enum_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._RANDOMDISTRIBUTION +_HLOINSTRUCTIONPROTO.fields_by_name['outfeed_shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_HLOINSTRUCTIONPROTO.fields_by_name['dot_dimension_numbers'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._DOTDIMENSIONNUMBERS +_HLOINSTRUCTIONPROTO.fields_by_name['fft_type'].enum_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._FFTTYPE +_HLOINSTRUCTIONPROTO.fields_by_name['gather_dimension_numbers'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GATHERDIMENSIONNUMBERS +_HLOINSTRUCTIONPROTO.fields_by_name['sharding'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._OPSHARDING +_HLOINSTRUCTIONPROTO.fields_by_name['replica_groups'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._REPLICAGROUP +_HLOINSTRUCTIONPROTO.fields_by_name['scatter_dimension_numbers'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SCATTERDIMENSIONNUMBERS +_HLOINSTRUCTIONPROTO.fields_by_name['precision_config'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._PRECISIONCONFIG +_HLOINSTRUCTIONPROTO.fields_by_name['source_target_pairs'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SOURCETARGET +_HLOINSTRUCTIONPROTO.fields_by_name['domain_entry_sharding'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._OPSHARDING +_HLOINSTRUCTIONPROTO.fields_by_name['domain_exit_sharding'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._OPSHARDING +_HLOINSTRUCTIONPROTO.fields_by_name['operand_shapes_with_layout'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_HLOCOMPUTATIONPROTO.fields_by_name['instructions'].message_type = _HLOINSTRUCTIONPROTO +_HLOCOMPUTATIONPROTO.fields_by_name['program_shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._PROGRAMSHAPEPROTO +_HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE.containing_type = _HLOSCHEDULEPROTO +_HLOSCHEDULEPROTO_SEQUENCESENTRY.fields_by_name['value'].message_type = _HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE +_HLOSCHEDULEPROTO_SEQUENCESENTRY.containing_type = _HLOSCHEDULEPROTO +_HLOSCHEDULEPROTO.fields_by_name['sequences'].message_type = _HLOSCHEDULEPROTO_SEQUENCESENTRY +_HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO.containing_type = _HLOINPUTOUTPUTALIASPROTO +_HLOINPUTOUTPUTALIASPROTO.fields_by_name['entries'].message_type = _HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO +_DYNAMICPARAMETERBINDINGPROTO_BINDING.containing_type = _DYNAMICPARAMETERBINDINGPROTO +_DYNAMICPARAMETERBINDINGPROTO.fields_by_name['entries'].message_type = _DYNAMICPARAMETERBINDINGPROTO_BINDING +_HLOMODULEPROTO.fields_by_name['computations'].message_type = _HLOCOMPUTATIONPROTO +_HLOMODULEPROTO.fields_by_name['host_program_shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._PROGRAMSHAPEPROTO +_HLOMODULEPROTO.fields_by_name['schedule'].message_type = _HLOSCHEDULEPROTO +_HLOMODULEPROTO.fields_by_name['input_output_alias'].message_type = _HLOINPUTOUTPUTALIASPROTO +_HLOMODULEPROTO.fields_by_name['dynamic_parameter_binding'].message_type = _DYNAMICPARAMETERBINDINGPROTO +_LOGICALBUFFERPROTO_LOCATION.containing_type = _LOGICALBUFFERPROTO +_LOGICALBUFFERPROTO.fields_by_name['defined_at'].message_type = _LOGICALBUFFERPROTO_LOCATION +_BUFFERALLOCATIONPROTO_ASSIGNED.containing_type = _BUFFERALLOCATIONPROTO +_BUFFERALLOCATIONPROTO.fields_by_name['assigned'].message_type = _BUFFERALLOCATIONPROTO_ASSIGNED +_HEAPSIMULATORTRACE_EVENT.fields_by_name['kind'].enum_type = _HEAPSIMULATORTRACE_EVENT_KIND +_HEAPSIMULATORTRACE_EVENT.containing_type = _HEAPSIMULATORTRACE +_HEAPSIMULATORTRACE_EVENT_KIND.containing_type = _HEAPSIMULATORTRACE_EVENT +_HEAPSIMULATORTRACE.fields_by_name['events'].message_type = _HEAPSIMULATORTRACE_EVENT +_HLOMODULEGROUPPROTO.fields_by_name['hlo_modules'].message_type = _HLOMODULEPROTO +_BUFFERASSIGNMENTPROTO_BUFFERALIAS.fields_by_name['location'].message_type = _LOGICALBUFFERPROTO_LOCATION +_BUFFERASSIGNMENTPROTO_BUFFERALIAS.containing_type = _BUFFERASSIGNMENTPROTO +_BUFFERASSIGNMENTPROTO.fields_by_name['logical_buffers'].message_type = _LOGICALBUFFERPROTO +_BUFFERASSIGNMENTPROTO.fields_by_name['buffer_aliases'].message_type = _BUFFERASSIGNMENTPROTO_BUFFERALIAS +_BUFFERASSIGNMENTPROTO.fields_by_name['buffer_allocations'].message_type = _BUFFERALLOCATIONPROTO +_BUFFERASSIGNMENTPROTO.fields_by_name['heap_simulator_traces'].message_type = _HEAPSIMULATORTRACE +_HLOPROTO.fields_by_name['hlo_module'].message_type = _HLOMODULEPROTO +_HLOPROTO.fields_by_name['buffer_assignment'].message_type = _BUFFERASSIGNMENTPROTO +_HLOSNAPSHOT.fields_by_name['hlo'].message_type = _HLOPROTO +_HLOSNAPSHOT.fields_by_name['arguments'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_HLOSNAPSHOT.fields_by_name['result'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +DESCRIPTOR.message_types_by_name['HloInstructionProto'] = _HLOINSTRUCTIONPROTO +DESCRIPTOR.message_types_by_name['HloComputationProto'] = _HLOCOMPUTATIONPROTO +DESCRIPTOR.message_types_by_name['HloScheduleProto'] = _HLOSCHEDULEPROTO +DESCRIPTOR.message_types_by_name['HloInputOutputAliasProto'] = _HLOINPUTOUTPUTALIASPROTO +DESCRIPTOR.message_types_by_name['DynamicParameterBindingProto'] = _DYNAMICPARAMETERBINDINGPROTO +DESCRIPTOR.message_types_by_name['HloModuleProto'] = _HLOMODULEPROTO +DESCRIPTOR.message_types_by_name['LogicalBufferProto'] = _LOGICALBUFFERPROTO +DESCRIPTOR.message_types_by_name['BufferAllocationProto'] = _BUFFERALLOCATIONPROTO +DESCRIPTOR.message_types_by_name['HeapSimulatorTrace'] = _HEAPSIMULATORTRACE +DESCRIPTOR.message_types_by_name['HloModuleGroupProto'] = _HLOMODULEGROUPPROTO +DESCRIPTOR.message_types_by_name['BufferAssignmentProto'] = _BUFFERASSIGNMENTPROTO +DESCRIPTOR.message_types_by_name['HloProto'] = _HLOPROTO +DESCRIPTOR.message_types_by_name['HloSnapshot'] = _HLOSNAPSHOT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +HloInstructionProto = _reflection.GeneratedProtocolMessageType('HloInstructionProto', (_message.Message,), dict( + + SliceDimensions = _reflection.GeneratedProtocolMessageType('SliceDimensions', (_message.Message,), dict( + DESCRIPTOR = _HLOINSTRUCTIONPROTO_SLICEDIMENSIONS, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloInstructionProto.SliceDimensions) + )) + , + DESCRIPTOR = _HLOINSTRUCTIONPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloInstructionProto) + )) +_sym_db.RegisterMessage(HloInstructionProto) +_sym_db.RegisterMessage(HloInstructionProto.SliceDimensions) + +HloComputationProto = _reflection.GeneratedProtocolMessageType('HloComputationProto', (_message.Message,), dict( + DESCRIPTOR = _HLOCOMPUTATIONPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloComputationProto) + )) +_sym_db.RegisterMessage(HloComputationProto) + +HloScheduleProto = _reflection.GeneratedProtocolMessageType('HloScheduleProto', (_message.Message,), dict( + + InstructionSequence = _reflection.GeneratedProtocolMessageType('InstructionSequence', (_message.Message,), dict( + DESCRIPTOR = _HLOSCHEDULEPROTO_INSTRUCTIONSEQUENCE, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloScheduleProto.InstructionSequence) + )) + , + + SequencesEntry = _reflection.GeneratedProtocolMessageType('SequencesEntry', (_message.Message,), dict( + DESCRIPTOR = _HLOSCHEDULEPROTO_SEQUENCESENTRY, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloScheduleProto.SequencesEntry) + )) + , + DESCRIPTOR = _HLOSCHEDULEPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloScheduleProto) + )) +_sym_db.RegisterMessage(HloScheduleProto) +_sym_db.RegisterMessage(HloScheduleProto.InstructionSequence) +_sym_db.RegisterMessage(HloScheduleProto.SequencesEntry) + +HloInputOutputAliasProto = _reflection.GeneratedProtocolMessageType('HloInputOutputAliasProto', (_message.Message,), dict( + + AliasEntryProto = _reflection.GeneratedProtocolMessageType('AliasEntryProto', (_message.Message,), dict( + DESCRIPTOR = _HLOINPUTOUTPUTALIASPROTO_ALIASENTRYPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloInputOutputAliasProto.AliasEntryProto) + )) + , + DESCRIPTOR = _HLOINPUTOUTPUTALIASPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloInputOutputAliasProto) + )) +_sym_db.RegisterMessage(HloInputOutputAliasProto) +_sym_db.RegisterMessage(HloInputOutputAliasProto.AliasEntryProto) + +DynamicParameterBindingProto = _reflection.GeneratedProtocolMessageType('DynamicParameterBindingProto', (_message.Message,), dict( + + Binding = _reflection.GeneratedProtocolMessageType('Binding', (_message.Message,), dict( + DESCRIPTOR = _DYNAMICPARAMETERBINDINGPROTO_BINDING, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.DynamicParameterBindingProto.Binding) + )) + , + DESCRIPTOR = _DYNAMICPARAMETERBINDINGPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.DynamicParameterBindingProto) + )) +_sym_db.RegisterMessage(DynamicParameterBindingProto) +_sym_db.RegisterMessage(DynamicParameterBindingProto.Binding) + +HloModuleProto = _reflection.GeneratedProtocolMessageType('HloModuleProto', (_message.Message,), dict( + DESCRIPTOR = _HLOMODULEPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloModuleProto) + )) +_sym_db.RegisterMessage(HloModuleProto) + +LogicalBufferProto = _reflection.GeneratedProtocolMessageType('LogicalBufferProto', (_message.Message,), dict( + + Location = _reflection.GeneratedProtocolMessageType('Location', (_message.Message,), dict( + DESCRIPTOR = _LOGICALBUFFERPROTO_LOCATION, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.LogicalBufferProto.Location) + )) + , + DESCRIPTOR = _LOGICALBUFFERPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.LogicalBufferProto) + )) +_sym_db.RegisterMessage(LogicalBufferProto) +_sym_db.RegisterMessage(LogicalBufferProto.Location) + +BufferAllocationProto = _reflection.GeneratedProtocolMessageType('BufferAllocationProto', (_message.Message,), dict( + + Assigned = _reflection.GeneratedProtocolMessageType('Assigned', (_message.Message,), dict( + DESCRIPTOR = _BUFFERALLOCATIONPROTO_ASSIGNED, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.BufferAllocationProto.Assigned) + )) + , + DESCRIPTOR = _BUFFERALLOCATIONPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.BufferAllocationProto) + )) +_sym_db.RegisterMessage(BufferAllocationProto) +_sym_db.RegisterMessage(BufferAllocationProto.Assigned) + +HeapSimulatorTrace = _reflection.GeneratedProtocolMessageType('HeapSimulatorTrace', (_message.Message,), dict( + + Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), dict( + DESCRIPTOR = _HEAPSIMULATORTRACE_EVENT, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HeapSimulatorTrace.Event) + )) + , + DESCRIPTOR = _HEAPSIMULATORTRACE, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HeapSimulatorTrace) + )) +_sym_db.RegisterMessage(HeapSimulatorTrace) +_sym_db.RegisterMessage(HeapSimulatorTrace.Event) + +HloModuleGroupProto = _reflection.GeneratedProtocolMessageType('HloModuleGroupProto', (_message.Message,), dict( + DESCRIPTOR = _HLOMODULEGROUPPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloModuleGroupProto) + )) +_sym_db.RegisterMessage(HloModuleGroupProto) + +BufferAssignmentProto = _reflection.GeneratedProtocolMessageType('BufferAssignmentProto', (_message.Message,), dict( + + BufferAlias = _reflection.GeneratedProtocolMessageType('BufferAlias', (_message.Message,), dict( + DESCRIPTOR = _BUFFERASSIGNMENTPROTO_BUFFERALIAS, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.BufferAssignmentProto.BufferAlias) + )) + , + DESCRIPTOR = _BUFFERASSIGNMENTPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.BufferAssignmentProto) + )) +_sym_db.RegisterMessage(BufferAssignmentProto) +_sym_db.RegisterMessage(BufferAssignmentProto.BufferAlias) + +HloProto = _reflection.GeneratedProtocolMessageType('HloProto', (_message.Message,), dict( + DESCRIPTOR = _HLOPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloProto) + )) +_sym_db.RegisterMessage(HloProto) + +HloSnapshot = _reflection.GeneratedProtocolMessageType('HloSnapshot', (_message.Message,), dict( + DESCRIPTOR = _HLOSNAPSHOT, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_pb2' + # @@protoc_insertion_point(class_scope:xla.HloSnapshot) + )) +_sym_db.RegisterMessage(HloSnapshot) + + +DESCRIPTOR._options = None +_HLOSCHEDULEPROTO_SEQUENCESENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.cc new file mode 100644 index 0000000..ce3d7b6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.cc @@ -0,0 +1,1713 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto + +#include "diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HloProfilePrinterData_ExtraMetricsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HloProfilePrinterData_HloInstructionInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HloProfilePrinterData_HloComputationInfo; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto +namespace xla { +class HloProfilePrinterData_HloInstructionInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloProfilePrinterData_HloInstructionInfo_default_instance_; +class HloProfilePrinterData_HloComputationInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloProfilePrinterData_HloComputationInfo_default_instance_; +class HloProfilePrinterData_ExtraMetricsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloProfilePrinterData_ExtraMetricsEntry_DoNotUse_default_instance_; +class HloProfilePrinterDataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloProfilePrinterData_default_instance_; +} // namespace xla +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto { +static void InitDefaultsHloProfilePrinterData_HloInstructionInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloProfilePrinterData_HloInstructionInfo_default_instance_; + new (ptr) ::xla::HloProfilePrinterData_HloInstructionInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloProfilePrinterData_HloInstructionInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HloProfilePrinterData_HloInstructionInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHloProfilePrinterData_HloInstructionInfo}, {}}; + +static void InitDefaultsHloProfilePrinterData_HloComputationInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloProfilePrinterData_HloComputationInfo_default_instance_; + new (ptr) ::xla::HloProfilePrinterData_HloComputationInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloProfilePrinterData_HloComputationInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HloProfilePrinterData_HloComputationInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHloProfilePrinterData_HloComputationInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloInstructionInfo.base,}}; + +static void InitDefaultsHloProfilePrinterData_ExtraMetricsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloProfilePrinterData_ExtraMetricsEntry_DoNotUse_default_instance_; + new (ptr) ::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse(); + } + ::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HloProfilePrinterData_ExtraMetricsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHloProfilePrinterData_ExtraMetricsEntry_DoNotUse}, {}}; + +static void InitDefaultsHloProfilePrinterData() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloProfilePrinterData_default_instance_; + new (ptr) ::xla::HloProfilePrinterData(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloProfilePrinterData::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_HloProfilePrinterData = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsHloProfilePrinterData}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloComputationInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_ExtraMetricsEntry_DoNotUse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_HloProfilePrinterData_HloInstructionInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloProfilePrinterData_HloComputationInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloProfilePrinterData_ExtraMetricsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_HloProfilePrinterData.base); +} + +::google::protobuf::Metadata file_level_metadata[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, long_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, short_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, category_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, flop_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, transcendental_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, bytes_accessed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, optimal_seconds_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloInstructionInfo, profile_index_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloComputationInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloComputationInfo, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloComputationInfo, profile_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_HloComputationInfo, instruction_infos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData, computation_infos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData, profile_counters_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData, extra_metrics_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloProfilePrinterData, entry_computation_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::xla::HloProfilePrinterData_HloInstructionInfo)}, + { 13, -1, sizeof(::xla::HloProfilePrinterData_HloComputationInfo)}, + { 21, 28, sizeof(::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse)}, + { 30, -1, sizeof(::xla::HloProfilePrinterData)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::xla::_HloProfilePrinterData_HloInstructionInfo_default_instance_), + reinterpret_cast(&::xla::_HloProfilePrinterData_HloComputationInfo_default_instance_), + reinterpret_cast(&::xla::_HloProfilePrinterData_ExtraMetricsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::xla::_HloProfilePrinterData_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nHdiplomacy_tensorflow/compiler/xla/serv" + "ice/hlo_profile_printer_data.proto\022\003xla\"" + "\345\004\n\025HloProfilePrinterData\022H\n\021computation" + "_infos\030\001 \003(\0132-.xla.HloProfilePrinterData" + ".HloComputationInfo\022\035\n\025profile_counters_" + "size\030\002 \001(\003\022C\n\rextra_metrics\030\003 \003(\0132,.xla." + "HloProfilePrinterData.ExtraMetricsEntry\022" + "\031\n\021entry_computation\030\004 \001(\t\032\307\001\n\022HloInstru" + "ctionInfo\022\021\n\tlong_name\030\001 \001(\t\022\022\n\nshort_na" + "me\030\002 \001(\t\022\020\n\010category\030\003 \001(\t\022\022\n\nflop_count" + "\030\004 \001(\002\022\034\n\024transcendental_count\030\005 \001(\002\022\026\n\016" + "bytes_accessed\030\006 \001(\002\022\027\n\017optimal_seconds\030" + "\007 \001(\002\022\025\n\rprofile_index\030\010 \001(\003\032\203\001\n\022HloComp" + "utationInfo\022\014\n\004name\030\001 \001(\t\022\025\n\rprofile_ind" + "ex\030\002 \001(\003\022H\n\021instruction_infos\030\003 \003(\0132-.xl" + "a.HloProfilePrinterData.HloInstructionIn" + "fo\0323\n\021ExtraMetricsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + "value\030\002 \001(\003:\0028\001B\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 708); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto +namespace xla { + +// =================================================================== + +void HloProfilePrinterData_HloInstructionInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloProfilePrinterData_HloInstructionInfo::kLongNameFieldNumber; +const int HloProfilePrinterData_HloInstructionInfo::kShortNameFieldNumber; +const int HloProfilePrinterData_HloInstructionInfo::kCategoryFieldNumber; +const int HloProfilePrinterData_HloInstructionInfo::kFlopCountFieldNumber; +const int HloProfilePrinterData_HloInstructionInfo::kTranscendentalCountFieldNumber; +const int HloProfilePrinterData_HloInstructionInfo::kBytesAccessedFieldNumber; +const int HloProfilePrinterData_HloInstructionInfo::kOptimalSecondsFieldNumber; +const int HloProfilePrinterData_HloInstructionInfo::kProfileIndexFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloProfilePrinterData_HloInstructionInfo::HloProfilePrinterData_HloInstructionInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloInstructionInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloProfilePrinterData.HloInstructionInfo) +} +HloProfilePrinterData_HloInstructionInfo::HloProfilePrinterData_HloInstructionInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloInstructionInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloProfilePrinterData.HloInstructionInfo) +} +HloProfilePrinterData_HloInstructionInfo::HloProfilePrinterData_HloInstructionInfo(const HloProfilePrinterData_HloInstructionInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + long_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.long_name().size() > 0) { + long_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.long_name(), + GetArenaNoVirtual()); + } + short_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.short_name().size() > 0) { + short_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.short_name(), + GetArenaNoVirtual()); + } + category_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.category().size() > 0) { + category_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.category(), + GetArenaNoVirtual()); + } + ::memcpy(&flop_count_, &from.flop_count_, + static_cast(reinterpret_cast(&profile_index_) - + reinterpret_cast(&flop_count_)) + sizeof(profile_index_)); + // @@protoc_insertion_point(copy_constructor:xla.HloProfilePrinterData.HloInstructionInfo) +} + +void HloProfilePrinterData_HloInstructionInfo::SharedCtor() { + long_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + short_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + category_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&flop_count_, 0, static_cast( + reinterpret_cast(&profile_index_) - + reinterpret_cast(&flop_count_)) + sizeof(profile_index_)); +} + +HloProfilePrinterData_HloInstructionInfo::~HloProfilePrinterData_HloInstructionInfo() { + // @@protoc_insertion_point(destructor:xla.HloProfilePrinterData.HloInstructionInfo) + SharedDtor(); +} + +void HloProfilePrinterData_HloInstructionInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + long_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + short_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + category_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HloProfilePrinterData_HloInstructionInfo::ArenaDtor(void* object) { + HloProfilePrinterData_HloInstructionInfo* _this = reinterpret_cast< HloProfilePrinterData_HloInstructionInfo* >(object); + (void)_this; +} +void HloProfilePrinterData_HloInstructionInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloProfilePrinterData_HloInstructionInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloProfilePrinterData_HloInstructionInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloProfilePrinterData_HloInstructionInfo& HloProfilePrinterData_HloInstructionInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloInstructionInfo.base); + return *internal_default_instance(); +} + + +void HloProfilePrinterData_HloInstructionInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloProfilePrinterData.HloInstructionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + long_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + short_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + category_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&flop_count_, 0, static_cast( + reinterpret_cast(&profile_index_) - + reinterpret_cast(&flop_count_)) + sizeof(profile_index_)); + _internal_metadata_.Clear(); +} + +bool HloProfilePrinterData_HloInstructionInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloProfilePrinterData.HloInstructionInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string long_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_long_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->long_name().data(), static_cast(this->long_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloProfilePrinterData.HloInstructionInfo.long_name")); + } else { + goto handle_unusual; + } + break; + } + + // string short_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_short_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->short_name().data(), static_cast(this->short_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloProfilePrinterData.HloInstructionInfo.short_name")); + } else { + goto handle_unusual; + } + break; + } + + // string category = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_category())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->category().data(), static_cast(this->category().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloProfilePrinterData.HloInstructionInfo.category")); + } else { + goto handle_unusual; + } + break; + } + + // float flop_count = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &flop_count_))); + } else { + goto handle_unusual; + } + break; + } + + // float transcendental_count = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &transcendental_count_))); + } else { + goto handle_unusual; + } + break; + } + + // float bytes_accessed = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &bytes_accessed_))); + } else { + goto handle_unusual; + } + break; + } + + // float optimal_seconds = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &optimal_seconds_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 profile_index = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &profile_index_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloProfilePrinterData.HloInstructionInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloProfilePrinterData.HloInstructionInfo) + return false; +#undef DO_ +} + +void HloProfilePrinterData_HloInstructionInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloProfilePrinterData.HloInstructionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string long_name = 1; + if (this->long_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->long_name().data(), static_cast(this->long_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloInstructionInfo.long_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->long_name(), output); + } + + // string short_name = 2; + if (this->short_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->short_name().data(), static_cast(this->short_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloInstructionInfo.short_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->short_name(), output); + } + + // string category = 3; + if (this->category().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->category().data(), static_cast(this->category().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloInstructionInfo.category"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->category(), output); + } + + // float flop_count = 4; + if (this->flop_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->flop_count(), output); + } + + // float transcendental_count = 5; + if (this->transcendental_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->transcendental_count(), output); + } + + // float bytes_accessed = 6; + if (this->bytes_accessed() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->bytes_accessed(), output); + } + + // float optimal_seconds = 7; + if (this->optimal_seconds() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->optimal_seconds(), output); + } + + // int64 profile_index = 8; + if (this->profile_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(8, this->profile_index(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloProfilePrinterData.HloInstructionInfo) +} + +::google::protobuf::uint8* HloProfilePrinterData_HloInstructionInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloProfilePrinterData.HloInstructionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string long_name = 1; + if (this->long_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->long_name().data(), static_cast(this->long_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloInstructionInfo.long_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->long_name(), target); + } + + // string short_name = 2; + if (this->short_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->short_name().data(), static_cast(this->short_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloInstructionInfo.short_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->short_name(), target); + } + + // string category = 3; + if (this->category().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->category().data(), static_cast(this->category().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloInstructionInfo.category"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->category(), target); + } + + // float flop_count = 4; + if (this->flop_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->flop_count(), target); + } + + // float transcendental_count = 5; + if (this->transcendental_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->transcendental_count(), target); + } + + // float bytes_accessed = 6; + if (this->bytes_accessed() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->bytes_accessed(), target); + } + + // float optimal_seconds = 7; + if (this->optimal_seconds() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->optimal_seconds(), target); + } + + // int64 profile_index = 8; + if (this->profile_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(8, this->profile_index(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloProfilePrinterData.HloInstructionInfo) + return target; +} + +size_t HloProfilePrinterData_HloInstructionInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloProfilePrinterData.HloInstructionInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string long_name = 1; + if (this->long_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->long_name()); + } + + // string short_name = 2; + if (this->short_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->short_name()); + } + + // string category = 3; + if (this->category().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->category()); + } + + // float flop_count = 4; + if (this->flop_count() != 0) { + total_size += 1 + 4; + } + + // float transcendental_count = 5; + if (this->transcendental_count() != 0) { + total_size += 1 + 4; + } + + // float bytes_accessed = 6; + if (this->bytes_accessed() != 0) { + total_size += 1 + 4; + } + + // float optimal_seconds = 7; + if (this->optimal_seconds() != 0) { + total_size += 1 + 4; + } + + // int64 profile_index = 8; + if (this->profile_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->profile_index()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloProfilePrinterData_HloInstructionInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloProfilePrinterData.HloInstructionInfo) + GOOGLE_DCHECK_NE(&from, this); + const HloProfilePrinterData_HloInstructionInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloProfilePrinterData.HloInstructionInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloProfilePrinterData.HloInstructionInfo) + MergeFrom(*source); + } +} + +void HloProfilePrinterData_HloInstructionInfo::MergeFrom(const HloProfilePrinterData_HloInstructionInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloProfilePrinterData.HloInstructionInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.long_name().size() > 0) { + set_long_name(from.long_name()); + } + if (from.short_name().size() > 0) { + set_short_name(from.short_name()); + } + if (from.category().size() > 0) { + set_category(from.category()); + } + if (from.flop_count() != 0) { + set_flop_count(from.flop_count()); + } + if (from.transcendental_count() != 0) { + set_transcendental_count(from.transcendental_count()); + } + if (from.bytes_accessed() != 0) { + set_bytes_accessed(from.bytes_accessed()); + } + if (from.optimal_seconds() != 0) { + set_optimal_seconds(from.optimal_seconds()); + } + if (from.profile_index() != 0) { + set_profile_index(from.profile_index()); + } +} + +void HloProfilePrinterData_HloInstructionInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloProfilePrinterData.HloInstructionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloProfilePrinterData_HloInstructionInfo::CopyFrom(const HloProfilePrinterData_HloInstructionInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloProfilePrinterData.HloInstructionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloProfilePrinterData_HloInstructionInfo::IsInitialized() const { + return true; +} + +void HloProfilePrinterData_HloInstructionInfo::Swap(HloProfilePrinterData_HloInstructionInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloProfilePrinterData_HloInstructionInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloProfilePrinterData_HloInstructionInfo::UnsafeArenaSwap(HloProfilePrinterData_HloInstructionInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloProfilePrinterData_HloInstructionInfo::InternalSwap(HloProfilePrinterData_HloInstructionInfo* other) { + using std::swap; + long_name_.Swap(&other->long_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + short_name_.Swap(&other->short_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + category_.Swap(&other->category_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(flop_count_, other->flop_count_); + swap(transcendental_count_, other->transcendental_count_); + swap(bytes_accessed_, other->bytes_accessed_); + swap(optimal_seconds_, other->optimal_seconds_); + swap(profile_index_, other->profile_index_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloProfilePrinterData_HloInstructionInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HloProfilePrinterData_HloComputationInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloProfilePrinterData_HloComputationInfo::kNameFieldNumber; +const int HloProfilePrinterData_HloComputationInfo::kProfileIndexFieldNumber; +const int HloProfilePrinterData_HloComputationInfo::kInstructionInfosFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloProfilePrinterData_HloComputationInfo::HloProfilePrinterData_HloComputationInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloComputationInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloProfilePrinterData.HloComputationInfo) +} +HloProfilePrinterData_HloComputationInfo::HloProfilePrinterData_HloComputationInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + instruction_infos_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloComputationInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloProfilePrinterData.HloComputationInfo) +} +HloProfilePrinterData_HloComputationInfo::HloProfilePrinterData_HloComputationInfo(const HloProfilePrinterData_HloComputationInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + instruction_infos_(from.instruction_infos_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + profile_index_ = from.profile_index_; + // @@protoc_insertion_point(copy_constructor:xla.HloProfilePrinterData.HloComputationInfo) +} + +void HloProfilePrinterData_HloComputationInfo::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + profile_index_ = GOOGLE_LONGLONG(0); +} + +HloProfilePrinterData_HloComputationInfo::~HloProfilePrinterData_HloComputationInfo() { + // @@protoc_insertion_point(destructor:xla.HloProfilePrinterData.HloComputationInfo) + SharedDtor(); +} + +void HloProfilePrinterData_HloComputationInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HloProfilePrinterData_HloComputationInfo::ArenaDtor(void* object) { + HloProfilePrinterData_HloComputationInfo* _this = reinterpret_cast< HloProfilePrinterData_HloComputationInfo* >(object); + (void)_this; +} +void HloProfilePrinterData_HloComputationInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloProfilePrinterData_HloComputationInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloProfilePrinterData_HloComputationInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloProfilePrinterData_HloComputationInfo& HloProfilePrinterData_HloComputationInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData_HloComputationInfo.base); + return *internal_default_instance(); +} + + +void HloProfilePrinterData_HloComputationInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloProfilePrinterData.HloComputationInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + instruction_infos_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + profile_index_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool HloProfilePrinterData_HloComputationInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloProfilePrinterData.HloComputationInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloProfilePrinterData.HloComputationInfo.name")); + } else { + goto handle_unusual; + } + break; + } + + // int64 profile_index = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &profile_index_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HloProfilePrinterData.HloInstructionInfo instruction_infos = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_instruction_infos())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloProfilePrinterData.HloComputationInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloProfilePrinterData.HloComputationInfo) + return false; +#undef DO_ +} + +void HloProfilePrinterData_HloComputationInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloProfilePrinterData.HloComputationInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloComputationInfo.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // int64 profile_index = 2; + if (this->profile_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->profile_index(), output); + } + + // repeated .xla.HloProfilePrinterData.HloInstructionInfo instruction_infos = 3; + for (unsigned int i = 0, + n = static_cast(this->instruction_infos_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->instruction_infos(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloProfilePrinterData.HloComputationInfo) +} + +::google::protobuf::uint8* HloProfilePrinterData_HloComputationInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloProfilePrinterData.HloComputationInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.HloComputationInfo.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // int64 profile_index = 2; + if (this->profile_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->profile_index(), target); + } + + // repeated .xla.HloProfilePrinterData.HloInstructionInfo instruction_infos = 3; + for (unsigned int i = 0, + n = static_cast(this->instruction_infos_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->instruction_infos(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloProfilePrinterData.HloComputationInfo) + return target; +} + +size_t HloProfilePrinterData_HloComputationInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloProfilePrinterData.HloComputationInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HloProfilePrinterData.HloInstructionInfo instruction_infos = 3; + { + unsigned int count = static_cast(this->instruction_infos_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->instruction_infos(static_cast(i))); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // int64 profile_index = 2; + if (this->profile_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->profile_index()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloProfilePrinterData_HloComputationInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloProfilePrinterData.HloComputationInfo) + GOOGLE_DCHECK_NE(&from, this); + const HloProfilePrinterData_HloComputationInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloProfilePrinterData.HloComputationInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloProfilePrinterData.HloComputationInfo) + MergeFrom(*source); + } +} + +void HloProfilePrinterData_HloComputationInfo::MergeFrom(const HloProfilePrinterData_HloComputationInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloProfilePrinterData.HloComputationInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + instruction_infos_.MergeFrom(from.instruction_infos_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.profile_index() != 0) { + set_profile_index(from.profile_index()); + } +} + +void HloProfilePrinterData_HloComputationInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloProfilePrinterData.HloComputationInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloProfilePrinterData_HloComputationInfo::CopyFrom(const HloProfilePrinterData_HloComputationInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloProfilePrinterData.HloComputationInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloProfilePrinterData_HloComputationInfo::IsInitialized() const { + return true; +} + +void HloProfilePrinterData_HloComputationInfo::Swap(HloProfilePrinterData_HloComputationInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloProfilePrinterData_HloComputationInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloProfilePrinterData_HloComputationInfo::UnsafeArenaSwap(HloProfilePrinterData_HloComputationInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloProfilePrinterData_HloComputationInfo::InternalSwap(HloProfilePrinterData_HloComputationInfo* other) { + using std::swap; + CastToBase(&instruction_infos_)->InternalSwap(CastToBase(&other->instruction_infos_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(profile_index_, other->profile_index_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloProfilePrinterData_HloComputationInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +HloProfilePrinterData_ExtraMetricsEntry_DoNotUse::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse() {} +HloProfilePrinterData_ExtraMetricsEntry_DoNotUse::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void HloProfilePrinterData_ExtraMetricsEntry_DoNotUse::MergeFrom(const HloProfilePrinterData_ExtraMetricsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata HloProfilePrinterData_ExtraMetricsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::file_level_metadata[2]; +} +void HloProfilePrinterData_ExtraMetricsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void HloProfilePrinterData::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloProfilePrinterData::kComputationInfosFieldNumber; +const int HloProfilePrinterData::kProfileCountersSizeFieldNumber; +const int HloProfilePrinterData::kExtraMetricsFieldNumber; +const int HloProfilePrinterData::kEntryComputationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloProfilePrinterData::HloProfilePrinterData() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloProfilePrinterData) +} +HloProfilePrinterData::HloProfilePrinterData(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + computation_infos_(arena), + extra_metrics_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.HloProfilePrinterData) +} +HloProfilePrinterData::HloProfilePrinterData(const HloProfilePrinterData& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + computation_infos_(from.computation_infos_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + extra_metrics_.MergeFrom(from.extra_metrics_); + entry_computation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.entry_computation().size() > 0) { + entry_computation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.entry_computation(), + GetArenaNoVirtual()); + } + profile_counters_size_ = from.profile_counters_size_; + // @@protoc_insertion_point(copy_constructor:xla.HloProfilePrinterData) +} + +void HloProfilePrinterData::SharedCtor() { + entry_computation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + profile_counters_size_ = GOOGLE_LONGLONG(0); +} + +HloProfilePrinterData::~HloProfilePrinterData() { + // @@protoc_insertion_point(destructor:xla.HloProfilePrinterData) + SharedDtor(); +} + +void HloProfilePrinterData::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + entry_computation_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HloProfilePrinterData::ArenaDtor(void* object) { + HloProfilePrinterData* _this = reinterpret_cast< HloProfilePrinterData* >(object); + (void)_this; +} +void HloProfilePrinterData::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HloProfilePrinterData::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloProfilePrinterData::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloProfilePrinterData& HloProfilePrinterData::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::scc_info_HloProfilePrinterData.base); + return *internal_default_instance(); +} + + +void HloProfilePrinterData::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloProfilePrinterData) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + computation_infos_.Clear(); + extra_metrics_.Clear(); + entry_computation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + profile_counters_size_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool HloProfilePrinterData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloProfilePrinterData) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.HloProfilePrinterData.HloComputationInfo computation_infos = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_computation_infos())); + } else { + goto handle_unusual; + } + break; + } + + // int64 profile_counters_size = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &profile_counters_size_))); + } else { + goto handle_unusual; + } + break; + } + + // map extra_metrics = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + HloProfilePrinterData_ExtraMetricsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + HloProfilePrinterData_ExtraMetricsEntry_DoNotUse, + ::std::string, ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + 0 >, + ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 > > parser(&extra_metrics_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloProfilePrinterData.ExtraMetricsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // string entry_computation = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_entry_computation())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->entry_computation().data(), static_cast(this->entry_computation().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloProfilePrinterData.entry_computation")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloProfilePrinterData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloProfilePrinterData) + return false; +#undef DO_ +} + +void HloProfilePrinterData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloProfilePrinterData) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.HloProfilePrinterData.HloComputationInfo computation_infos = 1; + for (unsigned int i = 0, + n = static_cast(this->computation_infos_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->computation_infos(static_cast(i)), + output); + } + + // int64 profile_counters_size = 2; + if (this->profile_counters_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->profile_counters_size(), output); + } + + // map extra_metrics = 3; + if (!this->extra_metrics().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.ExtraMetricsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->extra_metrics().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->extra_metrics().size()]); + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::const_iterator + it = this->extra_metrics().begin(); + it != this->extra_metrics().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(extra_metrics_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::const_iterator + it = this->extra_metrics().begin(); + it != this->extra_metrics().end(); ++it) { + entry.reset(extra_metrics_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // string entry_computation = 4; + if (this->entry_computation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->entry_computation().data(), static_cast(this->entry_computation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.entry_computation"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->entry_computation(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloProfilePrinterData) +} + +::google::protobuf::uint8* HloProfilePrinterData::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloProfilePrinterData) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.HloProfilePrinterData.HloComputationInfo computation_infos = 1; + for (unsigned int i = 0, + n = static_cast(this->computation_infos_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->computation_infos(static_cast(i)), deterministic, target); + } + + // int64 profile_counters_size = 2; + if (this->profile_counters_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->profile_counters_size(), target); + } + + // map extra_metrics = 3; + if (!this->extra_metrics().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.ExtraMetricsEntry.key"); + } + }; + + if (deterministic && + this->extra_metrics().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->extra_metrics().size()]); + typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::const_iterator + it = this->extra_metrics().begin(); + it != this->extra_metrics().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(extra_metrics_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::const_iterator + it = this->extra_metrics().begin(); + it != this->extra_metrics().end(); ++it) { + entry.reset(extra_metrics_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // string entry_computation = 4; + if (this->entry_computation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->entry_computation().data(), static_cast(this->entry_computation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloProfilePrinterData.entry_computation"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->entry_computation(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloProfilePrinterData) + return target; +} + +size_t HloProfilePrinterData::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloProfilePrinterData) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HloProfilePrinterData.HloComputationInfo computation_infos = 1; + { + unsigned int count = static_cast(this->computation_infos_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->computation_infos(static_cast(i))); + } + } + + // map extra_metrics = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->extra_metrics_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >::const_iterator + it = this->extra_metrics().begin(); + it != this->extra_metrics().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(extra_metrics_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // string entry_computation = 4; + if (this->entry_computation().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->entry_computation()); + } + + // int64 profile_counters_size = 2; + if (this->profile_counters_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->profile_counters_size()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloProfilePrinterData::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloProfilePrinterData) + GOOGLE_DCHECK_NE(&from, this); + const HloProfilePrinterData* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloProfilePrinterData) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloProfilePrinterData) + MergeFrom(*source); + } +} + +void HloProfilePrinterData::MergeFrom(const HloProfilePrinterData& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloProfilePrinterData) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + computation_infos_.MergeFrom(from.computation_infos_); + extra_metrics_.MergeFrom(from.extra_metrics_); + if (from.entry_computation().size() > 0) { + set_entry_computation(from.entry_computation()); + } + if (from.profile_counters_size() != 0) { + set_profile_counters_size(from.profile_counters_size()); + } +} + +void HloProfilePrinterData::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloProfilePrinterData) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloProfilePrinterData::CopyFrom(const HloProfilePrinterData& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloProfilePrinterData) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloProfilePrinterData::IsInitialized() const { + return true; +} + +void HloProfilePrinterData::Swap(HloProfilePrinterData* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HloProfilePrinterData* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HloProfilePrinterData::UnsafeArenaSwap(HloProfilePrinterData* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HloProfilePrinterData::InternalSwap(HloProfilePrinterData* other) { + using std::swap; + CastToBase(&computation_infos_)->InternalSwap(CastToBase(&other->computation_infos_)); + extra_metrics_.Swap(&other->extra_metrics_); + entry_computation_.Swap(&other->entry_computation_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(profile_counters_size_, other->profile_counters_size_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloProfilePrinterData::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace xla +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloProfilePrinterData_HloInstructionInfo* Arena::CreateMaybeMessage< ::xla::HloProfilePrinterData_HloInstructionInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloProfilePrinterData_HloInstructionInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloProfilePrinterData_HloComputationInfo* Arena::CreateMaybeMessage< ::xla::HloProfilePrinterData_HloComputationInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloProfilePrinterData_HloComputationInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse* Arena::CreateMaybeMessage< ::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloProfilePrinterData* Arena::CreateMaybeMessage< ::xla::HloProfilePrinterData >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::HloProfilePrinterData >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.h new file mode 100644 index 0000000..ec6a263 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.h @@ -0,0 +1,1230 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto +namespace xla { +class HloProfilePrinterData; +class HloProfilePrinterDataDefaultTypeInternal; +extern HloProfilePrinterDataDefaultTypeInternal _HloProfilePrinterData_default_instance_; +class HloProfilePrinterData_ExtraMetricsEntry_DoNotUse; +class HloProfilePrinterData_ExtraMetricsEntry_DoNotUseDefaultTypeInternal; +extern HloProfilePrinterData_ExtraMetricsEntry_DoNotUseDefaultTypeInternal _HloProfilePrinterData_ExtraMetricsEntry_DoNotUse_default_instance_; +class HloProfilePrinterData_HloComputationInfo; +class HloProfilePrinterData_HloComputationInfoDefaultTypeInternal; +extern HloProfilePrinterData_HloComputationInfoDefaultTypeInternal _HloProfilePrinterData_HloComputationInfo_default_instance_; +class HloProfilePrinterData_HloInstructionInfo; +class HloProfilePrinterData_HloInstructionInfoDefaultTypeInternal; +extern HloProfilePrinterData_HloInstructionInfoDefaultTypeInternal _HloProfilePrinterData_HloInstructionInfo_default_instance_; +} // namespace xla +namespace google { +namespace protobuf { +template<> ::xla::HloProfilePrinterData* Arena::CreateMaybeMessage<::xla::HloProfilePrinterData>(Arena*); +template<> ::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse* Arena::CreateMaybeMessage<::xla::HloProfilePrinterData_ExtraMetricsEntry_DoNotUse>(Arena*); +template<> ::xla::HloProfilePrinterData_HloComputationInfo* Arena::CreateMaybeMessage<::xla::HloProfilePrinterData_HloComputationInfo>(Arena*); +template<> ::xla::HloProfilePrinterData_HloInstructionInfo* Arena::CreateMaybeMessage<::xla::HloProfilePrinterData_HloInstructionInfo>(Arena*); +} // namespace protobuf +} // namespace google +namespace xla { + +// =================================================================== + +class HloProfilePrinterData_HloInstructionInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloProfilePrinterData.HloInstructionInfo) */ { + public: + HloProfilePrinterData_HloInstructionInfo(); + virtual ~HloProfilePrinterData_HloInstructionInfo(); + + HloProfilePrinterData_HloInstructionInfo(const HloProfilePrinterData_HloInstructionInfo& from); + + inline HloProfilePrinterData_HloInstructionInfo& operator=(const HloProfilePrinterData_HloInstructionInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloProfilePrinterData_HloInstructionInfo(HloProfilePrinterData_HloInstructionInfo&& from) noexcept + : HloProfilePrinterData_HloInstructionInfo() { + *this = ::std::move(from); + } + + inline HloProfilePrinterData_HloInstructionInfo& operator=(HloProfilePrinterData_HloInstructionInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloProfilePrinterData_HloInstructionInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloProfilePrinterData_HloInstructionInfo* internal_default_instance() { + return reinterpret_cast( + &_HloProfilePrinterData_HloInstructionInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(HloProfilePrinterData_HloInstructionInfo* other); + void Swap(HloProfilePrinterData_HloInstructionInfo* other); + friend void swap(HloProfilePrinterData_HloInstructionInfo& a, HloProfilePrinterData_HloInstructionInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloProfilePrinterData_HloInstructionInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + HloProfilePrinterData_HloInstructionInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloProfilePrinterData_HloInstructionInfo& from); + void MergeFrom(const HloProfilePrinterData_HloInstructionInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloProfilePrinterData_HloInstructionInfo* other); + protected: + explicit HloProfilePrinterData_HloInstructionInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string long_name = 1; + void clear_long_name(); + static const int kLongNameFieldNumber = 1; + const ::std::string& long_name() const; + void set_long_name(const ::std::string& value); + #if LANG_CXX11 + void set_long_name(::std::string&& value); + #endif + void set_long_name(const char* value); + void set_long_name(const char* value, size_t size); + ::std::string* mutable_long_name(); + ::std::string* release_long_name(); + void set_allocated_long_name(::std::string* long_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_long_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_long_name( + ::std::string* long_name); + + // string short_name = 2; + void clear_short_name(); + static const int kShortNameFieldNumber = 2; + const ::std::string& short_name() const; + void set_short_name(const ::std::string& value); + #if LANG_CXX11 + void set_short_name(::std::string&& value); + #endif + void set_short_name(const char* value); + void set_short_name(const char* value, size_t size); + ::std::string* mutable_short_name(); + ::std::string* release_short_name(); + void set_allocated_short_name(::std::string* short_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_short_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_short_name( + ::std::string* short_name); + + // string category = 3; + void clear_category(); + static const int kCategoryFieldNumber = 3; + const ::std::string& category() const; + void set_category(const ::std::string& value); + #if LANG_CXX11 + void set_category(::std::string&& value); + #endif + void set_category(const char* value); + void set_category(const char* value, size_t size); + ::std::string* mutable_category(); + ::std::string* release_category(); + void set_allocated_category(::std::string* category); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_category(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_category( + ::std::string* category); + + // float flop_count = 4; + void clear_flop_count(); + static const int kFlopCountFieldNumber = 4; + float flop_count() const; + void set_flop_count(float value); + + // float transcendental_count = 5; + void clear_transcendental_count(); + static const int kTranscendentalCountFieldNumber = 5; + float transcendental_count() const; + void set_transcendental_count(float value); + + // float bytes_accessed = 6; + void clear_bytes_accessed(); + static const int kBytesAccessedFieldNumber = 6; + float bytes_accessed() const; + void set_bytes_accessed(float value); + + // float optimal_seconds = 7; + void clear_optimal_seconds(); + static const int kOptimalSecondsFieldNumber = 7; + float optimal_seconds() const; + void set_optimal_seconds(float value); + + // int64 profile_index = 8; + void clear_profile_index(); + static const int kProfileIndexFieldNumber = 8; + ::google::protobuf::int64 profile_index() const; + void set_profile_index(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloProfilePrinterData.HloInstructionInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr long_name_; + ::google::protobuf::internal::ArenaStringPtr short_name_; + ::google::protobuf::internal::ArenaStringPtr category_; + float flop_count_; + float transcendental_count_; + float bytes_accessed_; + float optimal_seconds_; + ::google::protobuf::int64 profile_index_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloProfilePrinterData_HloComputationInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloProfilePrinterData.HloComputationInfo) */ { + public: + HloProfilePrinterData_HloComputationInfo(); + virtual ~HloProfilePrinterData_HloComputationInfo(); + + HloProfilePrinterData_HloComputationInfo(const HloProfilePrinterData_HloComputationInfo& from); + + inline HloProfilePrinterData_HloComputationInfo& operator=(const HloProfilePrinterData_HloComputationInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloProfilePrinterData_HloComputationInfo(HloProfilePrinterData_HloComputationInfo&& from) noexcept + : HloProfilePrinterData_HloComputationInfo() { + *this = ::std::move(from); + } + + inline HloProfilePrinterData_HloComputationInfo& operator=(HloProfilePrinterData_HloComputationInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloProfilePrinterData_HloComputationInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloProfilePrinterData_HloComputationInfo* internal_default_instance() { + return reinterpret_cast( + &_HloProfilePrinterData_HloComputationInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(HloProfilePrinterData_HloComputationInfo* other); + void Swap(HloProfilePrinterData_HloComputationInfo* other); + friend void swap(HloProfilePrinterData_HloComputationInfo& a, HloProfilePrinterData_HloComputationInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloProfilePrinterData_HloComputationInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + HloProfilePrinterData_HloComputationInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloProfilePrinterData_HloComputationInfo& from); + void MergeFrom(const HloProfilePrinterData_HloComputationInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloProfilePrinterData_HloComputationInfo* other); + protected: + explicit HloProfilePrinterData_HloComputationInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.HloProfilePrinterData.HloInstructionInfo instruction_infos = 3; + int instruction_infos_size() const; + void clear_instruction_infos(); + static const int kInstructionInfosFieldNumber = 3; + ::xla::HloProfilePrinterData_HloInstructionInfo* mutable_instruction_infos(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloInstructionInfo >* + mutable_instruction_infos(); + const ::xla::HloProfilePrinterData_HloInstructionInfo& instruction_infos(int index) const; + ::xla::HloProfilePrinterData_HloInstructionInfo* add_instruction_infos(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloInstructionInfo >& + instruction_infos() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // int64 profile_index = 2; + void clear_profile_index(); + static const int kProfileIndexFieldNumber = 2; + ::google::protobuf::int64 profile_index() const; + void set_profile_index(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloProfilePrinterData.HloComputationInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloInstructionInfo > instruction_infos_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::int64 profile_index_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HloProfilePrinterData_ExtraMetricsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + HloProfilePrinterData_ExtraMetricsEntry_DoNotUse(); + HloProfilePrinterData_ExtraMetricsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const HloProfilePrinterData_ExtraMetricsEntry_DoNotUse& other); + static const HloProfilePrinterData_ExtraMetricsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_HloProfilePrinterData_ExtraMetricsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class HloProfilePrinterData : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloProfilePrinterData) */ { + public: + HloProfilePrinterData(); + virtual ~HloProfilePrinterData(); + + HloProfilePrinterData(const HloProfilePrinterData& from); + + inline HloProfilePrinterData& operator=(const HloProfilePrinterData& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloProfilePrinterData(HloProfilePrinterData&& from) noexcept + : HloProfilePrinterData() { + *this = ::std::move(from); + } + + inline HloProfilePrinterData& operator=(HloProfilePrinterData&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HloProfilePrinterData& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloProfilePrinterData* internal_default_instance() { + return reinterpret_cast( + &_HloProfilePrinterData_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(HloProfilePrinterData* other); + void Swap(HloProfilePrinterData* other); + friend void swap(HloProfilePrinterData& a, HloProfilePrinterData& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloProfilePrinterData* New() const final { + return CreateMaybeMessage(NULL); + } + + HloProfilePrinterData* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloProfilePrinterData& from); + void MergeFrom(const HloProfilePrinterData& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloProfilePrinterData* other); + protected: + explicit HloProfilePrinterData(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HloProfilePrinterData_HloInstructionInfo HloInstructionInfo; + typedef HloProfilePrinterData_HloComputationInfo HloComputationInfo; + + // accessors ------------------------------------------------------- + + // repeated .xla.HloProfilePrinterData.HloComputationInfo computation_infos = 1; + int computation_infos_size() const; + void clear_computation_infos(); + static const int kComputationInfosFieldNumber = 1; + ::xla::HloProfilePrinterData_HloComputationInfo* mutable_computation_infos(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloComputationInfo >* + mutable_computation_infos(); + const ::xla::HloProfilePrinterData_HloComputationInfo& computation_infos(int index) const; + ::xla::HloProfilePrinterData_HloComputationInfo* add_computation_infos(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloComputationInfo >& + computation_infos() const; + + // map extra_metrics = 3; + int extra_metrics_size() const; + void clear_extra_metrics(); + static const int kExtraMetricsFieldNumber = 3; + const ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >& + extra_metrics() const; + ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >* + mutable_extra_metrics(); + + // string entry_computation = 4; + void clear_entry_computation(); + static const int kEntryComputationFieldNumber = 4; + const ::std::string& entry_computation() const; + void set_entry_computation(const ::std::string& value); + #if LANG_CXX11 + void set_entry_computation(::std::string&& value); + #endif + void set_entry_computation(const char* value); + void set_entry_computation(const char* value, size_t size); + ::std::string* mutable_entry_computation(); + ::std::string* release_entry_computation(); + void set_allocated_entry_computation(::std::string* entry_computation); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_entry_computation(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_entry_computation( + ::std::string* entry_computation); + + // int64 profile_counters_size = 2; + void clear_profile_counters_size(); + static const int kProfileCountersSizeFieldNumber = 2; + ::google::protobuf::int64 profile_counters_size() const; + void set_profile_counters_size(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.HloProfilePrinterData) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloComputationInfo > computation_infos_; + ::google::protobuf::internal::MapField< + HloProfilePrinterData_ExtraMetricsEntry_DoNotUse, + ::std::string, ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + 0 > extra_metrics_; + ::google::protobuf::internal::ArenaStringPtr entry_computation_; + ::google::protobuf::int64 profile_counters_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// HloProfilePrinterData_HloInstructionInfo + +// string long_name = 1; +inline void HloProfilePrinterData_HloInstructionInfo::clear_long_name() { + long_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloProfilePrinterData_HloInstructionInfo::long_name() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.long_name) + return long_name_.Get(); +} +inline void HloProfilePrinterData_HloInstructionInfo::set_long_name(const ::std::string& value) { + + long_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.long_name) +} +#if LANG_CXX11 +inline void HloProfilePrinterData_HloInstructionInfo::set_long_name(::std::string&& value) { + + long_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloProfilePrinterData.HloInstructionInfo.long_name) +} +#endif +inline void HloProfilePrinterData_HloInstructionInfo::set_long_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + long_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloProfilePrinterData.HloInstructionInfo.long_name) +} +inline void HloProfilePrinterData_HloInstructionInfo::set_long_name(const char* value, + size_t size) { + + long_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloProfilePrinterData.HloInstructionInfo.long_name) +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::mutable_long_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloProfilePrinterData.HloInstructionInfo.long_name) + return long_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::release_long_name() { + // @@protoc_insertion_point(field_release:xla.HloProfilePrinterData.HloInstructionInfo.long_name) + + return long_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloInstructionInfo::set_allocated_long_name(::std::string* long_name) { + if (long_name != NULL) { + + } else { + + } + long_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), long_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloProfilePrinterData.HloInstructionInfo.long_name) +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::unsafe_arena_release_long_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloProfilePrinterData.HloInstructionInfo.long_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return long_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloInstructionInfo::unsafe_arena_set_allocated_long_name( + ::std::string* long_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (long_name != NULL) { + + } else { + + } + long_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + long_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloProfilePrinterData.HloInstructionInfo.long_name) +} + +// string short_name = 2; +inline void HloProfilePrinterData_HloInstructionInfo::clear_short_name() { + short_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloProfilePrinterData_HloInstructionInfo::short_name() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.short_name) + return short_name_.Get(); +} +inline void HloProfilePrinterData_HloInstructionInfo::set_short_name(const ::std::string& value) { + + short_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.short_name) +} +#if LANG_CXX11 +inline void HloProfilePrinterData_HloInstructionInfo::set_short_name(::std::string&& value) { + + short_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloProfilePrinterData.HloInstructionInfo.short_name) +} +#endif +inline void HloProfilePrinterData_HloInstructionInfo::set_short_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + short_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloProfilePrinterData.HloInstructionInfo.short_name) +} +inline void HloProfilePrinterData_HloInstructionInfo::set_short_name(const char* value, + size_t size) { + + short_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloProfilePrinterData.HloInstructionInfo.short_name) +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::mutable_short_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloProfilePrinterData.HloInstructionInfo.short_name) + return short_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::release_short_name() { + // @@protoc_insertion_point(field_release:xla.HloProfilePrinterData.HloInstructionInfo.short_name) + + return short_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloInstructionInfo::set_allocated_short_name(::std::string* short_name) { + if (short_name != NULL) { + + } else { + + } + short_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), short_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloProfilePrinterData.HloInstructionInfo.short_name) +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::unsafe_arena_release_short_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloProfilePrinterData.HloInstructionInfo.short_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return short_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloInstructionInfo::unsafe_arena_set_allocated_short_name( + ::std::string* short_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (short_name != NULL) { + + } else { + + } + short_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + short_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloProfilePrinterData.HloInstructionInfo.short_name) +} + +// string category = 3; +inline void HloProfilePrinterData_HloInstructionInfo::clear_category() { + category_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloProfilePrinterData_HloInstructionInfo::category() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.category) + return category_.Get(); +} +inline void HloProfilePrinterData_HloInstructionInfo::set_category(const ::std::string& value) { + + category_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.category) +} +#if LANG_CXX11 +inline void HloProfilePrinterData_HloInstructionInfo::set_category(::std::string&& value) { + + category_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloProfilePrinterData.HloInstructionInfo.category) +} +#endif +inline void HloProfilePrinterData_HloInstructionInfo::set_category(const char* value) { + GOOGLE_DCHECK(value != NULL); + + category_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloProfilePrinterData.HloInstructionInfo.category) +} +inline void HloProfilePrinterData_HloInstructionInfo::set_category(const char* value, + size_t size) { + + category_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloProfilePrinterData.HloInstructionInfo.category) +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::mutable_category() { + + // @@protoc_insertion_point(field_mutable:xla.HloProfilePrinterData.HloInstructionInfo.category) + return category_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::release_category() { + // @@protoc_insertion_point(field_release:xla.HloProfilePrinterData.HloInstructionInfo.category) + + return category_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloInstructionInfo::set_allocated_category(::std::string* category) { + if (category != NULL) { + + } else { + + } + category_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), category, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloProfilePrinterData.HloInstructionInfo.category) +} +inline ::std::string* HloProfilePrinterData_HloInstructionInfo::unsafe_arena_release_category() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloProfilePrinterData.HloInstructionInfo.category) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return category_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloInstructionInfo::unsafe_arena_set_allocated_category( + ::std::string* category) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (category != NULL) { + + } else { + + } + category_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + category, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloProfilePrinterData.HloInstructionInfo.category) +} + +// float flop_count = 4; +inline void HloProfilePrinterData_HloInstructionInfo::clear_flop_count() { + flop_count_ = 0; +} +inline float HloProfilePrinterData_HloInstructionInfo::flop_count() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.flop_count) + return flop_count_; +} +inline void HloProfilePrinterData_HloInstructionInfo::set_flop_count(float value) { + + flop_count_ = value; + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.flop_count) +} + +// float transcendental_count = 5; +inline void HloProfilePrinterData_HloInstructionInfo::clear_transcendental_count() { + transcendental_count_ = 0; +} +inline float HloProfilePrinterData_HloInstructionInfo::transcendental_count() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.transcendental_count) + return transcendental_count_; +} +inline void HloProfilePrinterData_HloInstructionInfo::set_transcendental_count(float value) { + + transcendental_count_ = value; + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.transcendental_count) +} + +// float bytes_accessed = 6; +inline void HloProfilePrinterData_HloInstructionInfo::clear_bytes_accessed() { + bytes_accessed_ = 0; +} +inline float HloProfilePrinterData_HloInstructionInfo::bytes_accessed() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.bytes_accessed) + return bytes_accessed_; +} +inline void HloProfilePrinterData_HloInstructionInfo::set_bytes_accessed(float value) { + + bytes_accessed_ = value; + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.bytes_accessed) +} + +// float optimal_seconds = 7; +inline void HloProfilePrinterData_HloInstructionInfo::clear_optimal_seconds() { + optimal_seconds_ = 0; +} +inline float HloProfilePrinterData_HloInstructionInfo::optimal_seconds() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.optimal_seconds) + return optimal_seconds_; +} +inline void HloProfilePrinterData_HloInstructionInfo::set_optimal_seconds(float value) { + + optimal_seconds_ = value; + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.optimal_seconds) +} + +// int64 profile_index = 8; +inline void HloProfilePrinterData_HloInstructionInfo::clear_profile_index() { + profile_index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloProfilePrinterData_HloInstructionInfo::profile_index() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloInstructionInfo.profile_index) + return profile_index_; +} +inline void HloProfilePrinterData_HloInstructionInfo::set_profile_index(::google::protobuf::int64 value) { + + profile_index_ = value; + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloInstructionInfo.profile_index) +} + +// ------------------------------------------------------------------- + +// HloProfilePrinterData_HloComputationInfo + +// string name = 1; +inline void HloProfilePrinterData_HloComputationInfo::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloProfilePrinterData_HloComputationInfo::name() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloComputationInfo.name) + return name_.Get(); +} +inline void HloProfilePrinterData_HloComputationInfo::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloComputationInfo.name) +} +#if LANG_CXX11 +inline void HloProfilePrinterData_HloComputationInfo::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloProfilePrinterData.HloComputationInfo.name) +} +#endif +inline void HloProfilePrinterData_HloComputationInfo::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloProfilePrinterData.HloComputationInfo.name) +} +inline void HloProfilePrinterData_HloComputationInfo::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloProfilePrinterData.HloComputationInfo.name) +} +inline ::std::string* HloProfilePrinterData_HloComputationInfo::mutable_name() { + + // @@protoc_insertion_point(field_mutable:xla.HloProfilePrinterData.HloComputationInfo.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloProfilePrinterData_HloComputationInfo::release_name() { + // @@protoc_insertion_point(field_release:xla.HloProfilePrinterData.HloComputationInfo.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloComputationInfo::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloProfilePrinterData.HloComputationInfo.name) +} +inline ::std::string* HloProfilePrinterData_HloComputationInfo::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloProfilePrinterData.HloComputationInfo.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloProfilePrinterData_HloComputationInfo::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloProfilePrinterData.HloComputationInfo.name) +} + +// int64 profile_index = 2; +inline void HloProfilePrinterData_HloComputationInfo::clear_profile_index() { + profile_index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloProfilePrinterData_HloComputationInfo::profile_index() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloComputationInfo.profile_index) + return profile_index_; +} +inline void HloProfilePrinterData_HloComputationInfo::set_profile_index(::google::protobuf::int64 value) { + + profile_index_ = value; + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.HloComputationInfo.profile_index) +} + +// repeated .xla.HloProfilePrinterData.HloInstructionInfo instruction_infos = 3; +inline int HloProfilePrinterData_HloComputationInfo::instruction_infos_size() const { + return instruction_infos_.size(); +} +inline void HloProfilePrinterData_HloComputationInfo::clear_instruction_infos() { + instruction_infos_.Clear(); +} +inline ::xla::HloProfilePrinterData_HloInstructionInfo* HloProfilePrinterData_HloComputationInfo::mutable_instruction_infos(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloProfilePrinterData.HloComputationInfo.instruction_infos) + return instruction_infos_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloInstructionInfo >* +HloProfilePrinterData_HloComputationInfo::mutable_instruction_infos() { + // @@protoc_insertion_point(field_mutable_list:xla.HloProfilePrinterData.HloComputationInfo.instruction_infos) + return &instruction_infos_; +} +inline const ::xla::HloProfilePrinterData_HloInstructionInfo& HloProfilePrinterData_HloComputationInfo::instruction_infos(int index) const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.HloComputationInfo.instruction_infos) + return instruction_infos_.Get(index); +} +inline ::xla::HloProfilePrinterData_HloInstructionInfo* HloProfilePrinterData_HloComputationInfo::add_instruction_infos() { + // @@protoc_insertion_point(field_add:xla.HloProfilePrinterData.HloComputationInfo.instruction_infos) + return instruction_infos_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloInstructionInfo >& +HloProfilePrinterData_HloComputationInfo::instruction_infos() const { + // @@protoc_insertion_point(field_list:xla.HloProfilePrinterData.HloComputationInfo.instruction_infos) + return instruction_infos_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// HloProfilePrinterData + +// repeated .xla.HloProfilePrinterData.HloComputationInfo computation_infos = 1; +inline int HloProfilePrinterData::computation_infos_size() const { + return computation_infos_.size(); +} +inline void HloProfilePrinterData::clear_computation_infos() { + computation_infos_.Clear(); +} +inline ::xla::HloProfilePrinterData_HloComputationInfo* HloProfilePrinterData::mutable_computation_infos(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloProfilePrinterData.computation_infos) + return computation_infos_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloComputationInfo >* +HloProfilePrinterData::mutable_computation_infos() { + // @@protoc_insertion_point(field_mutable_list:xla.HloProfilePrinterData.computation_infos) + return &computation_infos_; +} +inline const ::xla::HloProfilePrinterData_HloComputationInfo& HloProfilePrinterData::computation_infos(int index) const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.computation_infos) + return computation_infos_.Get(index); +} +inline ::xla::HloProfilePrinterData_HloComputationInfo* HloProfilePrinterData::add_computation_infos() { + // @@protoc_insertion_point(field_add:xla.HloProfilePrinterData.computation_infos) + return computation_infos_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloProfilePrinterData_HloComputationInfo >& +HloProfilePrinterData::computation_infos() const { + // @@protoc_insertion_point(field_list:xla.HloProfilePrinterData.computation_infos) + return computation_infos_; +} + +// int64 profile_counters_size = 2; +inline void HloProfilePrinterData::clear_profile_counters_size() { + profile_counters_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 HloProfilePrinterData::profile_counters_size() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.profile_counters_size) + return profile_counters_size_; +} +inline void HloProfilePrinterData::set_profile_counters_size(::google::protobuf::int64 value) { + + profile_counters_size_ = value; + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.profile_counters_size) +} + +// map extra_metrics = 3; +inline int HloProfilePrinterData::extra_metrics_size() const { + return extra_metrics_.size(); +} +inline void HloProfilePrinterData::clear_extra_metrics() { + extra_metrics_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >& +HloProfilePrinterData::extra_metrics() const { + // @@protoc_insertion_point(field_map:xla.HloProfilePrinterData.extra_metrics) + return extra_metrics_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::google::protobuf::int64 >* +HloProfilePrinterData::mutable_extra_metrics() { + // @@protoc_insertion_point(field_mutable_map:xla.HloProfilePrinterData.extra_metrics) + return extra_metrics_.MutableMap(); +} + +// string entry_computation = 4; +inline void HloProfilePrinterData::clear_entry_computation() { + entry_computation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& HloProfilePrinterData::entry_computation() const { + // @@protoc_insertion_point(field_get:xla.HloProfilePrinterData.entry_computation) + return entry_computation_.Get(); +} +inline void HloProfilePrinterData::set_entry_computation(const ::std::string& value) { + + entry_computation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.HloProfilePrinterData.entry_computation) +} +#if LANG_CXX11 +inline void HloProfilePrinterData::set_entry_computation(::std::string&& value) { + + entry_computation_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.HloProfilePrinterData.entry_computation) +} +#endif +inline void HloProfilePrinterData::set_entry_computation(const char* value) { + GOOGLE_DCHECK(value != NULL); + + entry_computation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.HloProfilePrinterData.entry_computation) +} +inline void HloProfilePrinterData::set_entry_computation(const char* value, + size_t size) { + + entry_computation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.HloProfilePrinterData.entry_computation) +} +inline ::std::string* HloProfilePrinterData::mutable_entry_computation() { + + // @@protoc_insertion_point(field_mutable:xla.HloProfilePrinterData.entry_computation) + return entry_computation_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* HloProfilePrinterData::release_entry_computation() { + // @@protoc_insertion_point(field_release:xla.HloProfilePrinterData.entry_computation) + + return entry_computation_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void HloProfilePrinterData::set_allocated_entry_computation(::std::string* entry_computation) { + if (entry_computation != NULL) { + + } else { + + } + entry_computation_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), entry_computation, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.HloProfilePrinterData.entry_computation) +} +inline ::std::string* HloProfilePrinterData::unsafe_arena_release_entry_computation() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.HloProfilePrinterData.entry_computation) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return entry_computation_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void HloProfilePrinterData::unsafe_arena_set_allocated_entry_computation( + ::std::string* entry_computation) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (entry_computation != NULL) { + + } else { + + } + entry_computation_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + entry_computation, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.HloProfilePrinterData.entry_computation) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace xla + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_5fprofile_5fprinter_5fdata_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto new file mode 100644 index 0000000..ee66c86 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto @@ -0,0 +1,66 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +package xla; + +option cc_enable_arenas = true; + +// Describes how to pretty-print a profile counter array gathered for a specific +// HloModule. +message HloProfilePrinterData { + // Pretty-printer information about an HloInstruction. + message HloInstructionInfo { + string long_name = 1; + string short_name = 2; + string category = 3; + + // Metrics computed by HloCostAnalysis. + float flop_count = 4; + float transcendental_count = 5; + float bytes_accessed = 6; + float optimal_seconds = 7; + + // The index into the profile counters array for the HloInstruction + // corresponding to this HloInstructionInfo. + int64 profile_index = 8; + } + + // Pretty-printer information about an HloComputation. + message HloComputationInfo { + string name = 1; + + // The index into the profile counters array for the HloComputation + // corresponding to this HloComputationInfo. + int64 profile_index = 2; + + // HloInstructionInfos for every HloInstruction in the HloComputation for + // corresponding to this HloComputattionInfo. + repeated HloInstructionInfo instruction_infos = 3; + } + + // HloComputationInfos for every HloComputation in the HloModule. + repeated HloComputationInfo computation_infos = 1; + + // The size of the profile counters array we will pretty-print. + int64 profile_counters_size = 2; + + // Maps extra metric name to the index into the profile counters array. + map extra_metrics = 3; + + // Name of the entry computation. + string entry_computation = 4; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data_pb2.py new file mode 100644 index 0000000..06be30c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data_pb2.py @@ -0,0 +1,282 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto', + package='xla', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\nHdiplomacy_tensorflow/compiler/xla/service/hlo_profile_printer_data.proto\x12\x03xla\"\xe5\x04\n\x15HloProfilePrinterData\x12H\n\x11\x63omputation_infos\x18\x01 \x03(\x0b\x32-.xla.HloProfilePrinterData.HloComputationInfo\x12\x1d\n\x15profile_counters_size\x18\x02 \x01(\x03\x12\x43\n\rextra_metrics\x18\x03 \x03(\x0b\x32,.xla.HloProfilePrinterData.ExtraMetricsEntry\x12\x19\n\x11\x65ntry_computation\x18\x04 \x01(\t\x1a\xc7\x01\n\x12HloInstructionInfo\x12\x11\n\tlong_name\x18\x01 \x01(\t\x12\x12\n\nshort_name\x18\x02 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x03 \x01(\t\x12\x12\n\nflop_count\x18\x04 \x01(\x02\x12\x1c\n\x14transcendental_count\x18\x05 \x01(\x02\x12\x16\n\x0e\x62ytes_accessed\x18\x06 \x01(\x02\x12\x17\n\x0foptimal_seconds\x18\x07 \x01(\x02\x12\x15\n\rprofile_index\x18\x08 \x01(\x03\x1a\x83\x01\n\x12HloComputationInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rprofile_index\x18\x02 \x01(\x03\x12H\n\x11instruction_infos\x18\x03 \x03(\x0b\x32-.xla.HloProfilePrinterData.HloInstructionInfo\x1a\x33\n\x11\x45xtraMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42\x03\xf8\x01\x01\x62\x06proto3') +) + + + + +_HLOPROFILEPRINTERDATA_HLOINSTRUCTIONINFO = _descriptor.Descriptor( + name='HloInstructionInfo', + full_name='xla.HloProfilePrinterData.HloInstructionInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='long_name', full_name='xla.HloProfilePrinterData.HloInstructionInfo.long_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='short_name', full_name='xla.HloProfilePrinterData.HloInstructionInfo.short_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='category', full_name='xla.HloProfilePrinterData.HloInstructionInfo.category', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='flop_count', full_name='xla.HloProfilePrinterData.HloInstructionInfo.flop_count', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='transcendental_count', full_name='xla.HloProfilePrinterData.HloInstructionInfo.transcendental_count', index=4, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bytes_accessed', full_name='xla.HloProfilePrinterData.HloInstructionInfo.bytes_accessed', index=5, + number=6, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='optimal_seconds', full_name='xla.HloProfilePrinterData.HloInstructionInfo.optimal_seconds', index=6, + number=7, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='profile_index', full_name='xla.HloProfilePrinterData.HloInstructionInfo.profile_index', index=7, + number=8, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=309, + serialized_end=508, +) + +_HLOPROFILEPRINTERDATA_HLOCOMPUTATIONINFO = _descriptor.Descriptor( + name='HloComputationInfo', + full_name='xla.HloProfilePrinterData.HloComputationInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='xla.HloProfilePrinterData.HloComputationInfo.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='profile_index', full_name='xla.HloProfilePrinterData.HloComputationInfo.profile_index', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='instruction_infos', full_name='xla.HloProfilePrinterData.HloComputationInfo.instruction_infos', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=511, + serialized_end=642, +) + +_HLOPROFILEPRINTERDATA_EXTRAMETRICSENTRY = _descriptor.Descriptor( + name='ExtraMetricsEntry', + full_name='xla.HloProfilePrinterData.ExtraMetricsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='xla.HloProfilePrinterData.ExtraMetricsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='xla.HloProfilePrinterData.ExtraMetricsEntry.value', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=644, + serialized_end=695, +) + +_HLOPROFILEPRINTERDATA = _descriptor.Descriptor( + name='HloProfilePrinterData', + full_name='xla.HloProfilePrinterData', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='computation_infos', full_name='xla.HloProfilePrinterData.computation_infos', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='profile_counters_size', full_name='xla.HloProfilePrinterData.profile_counters_size', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='extra_metrics', full_name='xla.HloProfilePrinterData.extra_metrics', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='entry_computation', full_name='xla.HloProfilePrinterData.entry_computation', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_HLOPROFILEPRINTERDATA_HLOINSTRUCTIONINFO, _HLOPROFILEPRINTERDATA_HLOCOMPUTATIONINFO, _HLOPROFILEPRINTERDATA_EXTRAMETRICSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=82, + serialized_end=695, +) + +_HLOPROFILEPRINTERDATA_HLOINSTRUCTIONINFO.containing_type = _HLOPROFILEPRINTERDATA +_HLOPROFILEPRINTERDATA_HLOCOMPUTATIONINFO.fields_by_name['instruction_infos'].message_type = _HLOPROFILEPRINTERDATA_HLOINSTRUCTIONINFO +_HLOPROFILEPRINTERDATA_HLOCOMPUTATIONINFO.containing_type = _HLOPROFILEPRINTERDATA +_HLOPROFILEPRINTERDATA_EXTRAMETRICSENTRY.containing_type = _HLOPROFILEPRINTERDATA +_HLOPROFILEPRINTERDATA.fields_by_name['computation_infos'].message_type = _HLOPROFILEPRINTERDATA_HLOCOMPUTATIONINFO +_HLOPROFILEPRINTERDATA.fields_by_name['extra_metrics'].message_type = _HLOPROFILEPRINTERDATA_EXTRAMETRICSENTRY +DESCRIPTOR.message_types_by_name['HloProfilePrinterData'] = _HLOPROFILEPRINTERDATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +HloProfilePrinterData = _reflection.GeneratedProtocolMessageType('HloProfilePrinterData', (_message.Message,), dict( + + HloInstructionInfo = _reflection.GeneratedProtocolMessageType('HloInstructionInfo', (_message.Message,), dict( + DESCRIPTOR = _HLOPROFILEPRINTERDATA_HLOINSTRUCTIONINFO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_profile_printer_data_pb2' + # @@protoc_insertion_point(class_scope:xla.HloProfilePrinterData.HloInstructionInfo) + )) + , + + HloComputationInfo = _reflection.GeneratedProtocolMessageType('HloComputationInfo', (_message.Message,), dict( + DESCRIPTOR = _HLOPROFILEPRINTERDATA_HLOCOMPUTATIONINFO, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_profile_printer_data_pb2' + # @@protoc_insertion_point(class_scope:xla.HloProfilePrinterData.HloComputationInfo) + )) + , + + ExtraMetricsEntry = _reflection.GeneratedProtocolMessageType('ExtraMetricsEntry', (_message.Message,), dict( + DESCRIPTOR = _HLOPROFILEPRINTERDATA_EXTRAMETRICSENTRY, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_profile_printer_data_pb2' + # @@protoc_insertion_point(class_scope:xla.HloProfilePrinterData.ExtraMetricsEntry) + )) + , + DESCRIPTOR = _HLOPROFILEPRINTERDATA, + __module__ = 'diplomacy_tensorflow.compiler.xla.service.hlo_profile_printer_data_pb2' + # @@protoc_insertion_point(class_scope:xla.HloProfilePrinterData) + )) +_sym_db.RegisterMessage(HloProfilePrinterData) +_sym_db.RegisterMessage(HloProfilePrinterData.HloInstructionInfo) +_sym_db.RegisterMessage(HloProfilePrinterData.HloComputationInfo) +_sym_db.RegisterMessage(HloProfilePrinterData.ExtraMetricsEntry) + + +DESCRIPTOR._options = None +_HLOPROFILEPRINTERDATA_EXTRAMETRICSENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.pb.cc new file mode 100644 index 0000000..dddd2f5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.pb.cc @@ -0,0 +1,14302 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/xla.proto + +#include "diplomacy_tensorflow/compiler/xla/xla.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<5> scc_info_HloModuleProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HloReducePrecisionOptions; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_DebugOptions; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_ExecuteResponse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_ExecuteGraphRequest; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_ExecutionOptions; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ChannelHandle; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ComputationStats; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DeviceHandle; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ExecutionHandle; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ExecutionProfile; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GlobalDataHandle; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LayoutProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LiteralProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto +namespace xla { +class HloReducePrecisionOptionsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HloReducePrecisionOptions_default_instance_; +class DebugOptions_XlaBackendExtraOptionsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse_default_instance_; +class DebugOptionsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DebugOptions_default_instance_; +class ExecutionOptionsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecutionOptions_default_instance_; +class GetDeviceHandlesRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GetDeviceHandlesRequest_default_instance_; +class GetDeviceHandlesResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GetDeviceHandlesResponse_default_instance_; +class TransferToClientRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferToClientRequest_default_instance_; +class TransferToClientResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferToClientResponse_default_instance_; +class TransferToServerRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferToServerRequest_default_instance_; +class TransferToServerResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferToServerResponse_default_instance_; +class TransferToInfeedRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferToInfeedRequest_default_instance_; +class TransferToInfeedResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferToInfeedResponse_default_instance_; +class TransferFromOutfeedRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferFromOutfeedRequest_default_instance_; +class TransferFromOutfeedResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TransferFromOutfeedResponse_default_instance_; +class ResetDeviceRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ResetDeviceRequest_default_instance_; +class ResetDeviceResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ResetDeviceResponse_default_instance_; +class ComputationGraphStatsRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ComputationGraphStatsRequest_default_instance_; +class ComputationStatsResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ComputationStatsResponse_default_instance_; +class CreateChannelHandleRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CreateChannelHandleRequest_default_instance_; +class CreateChannelHandleResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CreateChannelHandleResponse_default_instance_; +class UnregisterRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _UnregisterRequest_default_instance_; +class UnregisterResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _UnregisterResponse_default_instance_; +class CompileRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CompileRequest_default_instance_; +class CompileResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CompileResponse_default_instance_; +class ExecuteRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecuteRequest_default_instance_; +class ExecuteGraphRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecuteGraphRequest_default_instance_; +class ExecuteGraphParallelRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecuteGraphParallelRequest_default_instance_; +class ExecuteResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecuteResponse_default_instance_; +class ExecuteParallelResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecuteParallelResponse_default_instance_; +class WaitForExecutionRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _WaitForExecutionRequest_default_instance_; +class WaitForExecutionResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _WaitForExecutionResponse_default_instance_; +class ComputeConstantGraphRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ComputeConstantGraphRequest_default_instance_; +class ComputeConstantResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ComputeConstantResponse_default_instance_; +class DeconstructTupleRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeconstructTupleRequest_default_instance_; +class DeconstructTupleResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeconstructTupleResponse_default_instance_; +class LoadDataRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LoadDataRequest_default_instance_; +class LoadDataResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LoadDataResponse_default_instance_; +class GetShapeRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GetShapeRequest_default_instance_; +class GetShapeResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GetShapeResponse_default_instance_; +class UnpackRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _UnpackRequest_default_instance_; +class UnpackResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _UnpackResponse_default_instance_; +} // namespace xla +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto { +static void InitDefaultsHloReducePrecisionOptions() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_HloReducePrecisionOptions_default_instance_; + new (ptr) ::xla::HloReducePrecisionOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::HloReducePrecisionOptions::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HloReducePrecisionOptions = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHloReducePrecisionOptions}, {}}; + +static void InitDefaultsDebugOptions_XlaBackendExtraOptionsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse_default_instance_; + new (ptr) ::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse(); + } + ::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDebugOptions_XlaBackendExtraOptionsEntry_DoNotUse}, {}}; + +static void InitDefaultsDebugOptions() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DebugOptions_default_instance_; + new (ptr) ::xla::DebugOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DebugOptions::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_DebugOptions = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsDebugOptions}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_HloReducePrecisionOptions.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse.base,}}; + +static void InitDefaultsExecutionOptions() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecutionOptions_default_instance_; + new (ptr) ::xla::ExecutionOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecutionOptions::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_ExecutionOptions = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsExecutionOptions}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DebugOptions.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base,}}; + +static void InitDefaultsGetDeviceHandlesRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_GetDeviceHandlesRequest_default_instance_; + new (ptr) ::xla::GetDeviceHandlesRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::GetDeviceHandlesRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GetDeviceHandlesRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGetDeviceHandlesRequest}, {}}; + +static void InitDefaultsGetDeviceHandlesResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_GetDeviceHandlesResponse_default_instance_; + new (ptr) ::xla::GetDeviceHandlesResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::GetDeviceHandlesResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_GetDeviceHandlesResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsGetDeviceHandlesResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base,}}; + +static void InitDefaultsTransferToClientRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferToClientRequest_default_instance_; + new (ptr) ::xla::TransferToClientRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferToClientRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TransferToClientRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTransferToClientRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsTransferToClientResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferToClientResponse_default_instance_; + new (ptr) ::xla::TransferToClientResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferToClientResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TransferToClientResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTransferToClientResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base,}}; + +static void InitDefaultsTransferToServerRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferToServerRequest_default_instance_; + new (ptr) ::xla::TransferToServerRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferToServerRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TransferToServerRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTransferToServerRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base,}}; + +static void InitDefaultsTransferToServerResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferToServerResponse_default_instance_; + new (ptr) ::xla::TransferToServerResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferToServerResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TransferToServerResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTransferToServerResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +static void InitDefaultsTransferToInfeedRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferToInfeedRequest_default_instance_; + new (ptr) ::xla::TransferToInfeedRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferToInfeedRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TransferToInfeedRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTransferToInfeedRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base,}}; + +static void InitDefaultsTransferToInfeedResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferToInfeedResponse_default_instance_; + new (ptr) ::xla::TransferToInfeedResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferToInfeedResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TransferToInfeedResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTransferToInfeedResponse}, {}}; + +static void InitDefaultsTransferFromOutfeedRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferFromOutfeedRequest_default_instance_; + new (ptr) ::xla::TransferFromOutfeedRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferFromOutfeedRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TransferFromOutfeedRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTransferFromOutfeedRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base,}}; + +static void InitDefaultsTransferFromOutfeedResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TransferFromOutfeedResponse_default_instance_; + new (ptr) ::xla::TransferFromOutfeedResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TransferFromOutfeedResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TransferFromOutfeedResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTransferFromOutfeedResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base,}}; + +static void InitDefaultsResetDeviceRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ResetDeviceRequest_default_instance_; + new (ptr) ::xla::ResetDeviceRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ResetDeviceRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ResetDeviceRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsResetDeviceRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base,}}; + +static void InitDefaultsResetDeviceResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ResetDeviceResponse_default_instance_; + new (ptr) ::xla::ResetDeviceResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ResetDeviceResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ResetDeviceResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsResetDeviceResponse}, {}}; + +static void InitDefaultsComputationGraphStatsRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ComputationGraphStatsRequest_default_instance_; + new (ptr) ::xla::ComputationGraphStatsRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ComputationGraphStatsRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_ComputationGraphStatsRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsComputationGraphStatsRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DebugOptions.base,}}; + +static void InitDefaultsComputationStatsResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ComputationStatsResponse_default_instance_; + new (ptr) ::xla::ComputationStatsResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ComputationStatsResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ComputationStatsResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsComputationStatsResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ComputationStats.base,}}; + +static void InitDefaultsCreateChannelHandleRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_CreateChannelHandleRequest_default_instance_; + new (ptr) ::xla::CreateChannelHandleRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::CreateChannelHandleRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CreateChannelHandleRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCreateChannelHandleRequest}, {}}; + +static void InitDefaultsCreateChannelHandleResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_CreateChannelHandleResponse_default_instance_; + new (ptr) ::xla::CreateChannelHandleResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::CreateChannelHandleResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_CreateChannelHandleResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsCreateChannelHandleResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ChannelHandle.base,}}; + +static void InitDefaultsUnregisterRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_UnregisterRequest_default_instance_; + new (ptr) ::xla::UnregisterRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::UnregisterRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_UnregisterRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsUnregisterRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +static void InitDefaultsUnregisterResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_UnregisterResponse_default_instance_; + new (ptr) ::xla::UnregisterResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::UnregisterResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_UnregisterResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsUnregisterResponse}, {}}; + +static void InitDefaultsCompileRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_CompileRequest_default_instance_; + new (ptr) ::xla::CompileRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::CompileRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_CompileRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsCompileRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecutionOptions.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsCompileResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_CompileResponse_default_instance_; + new (ptr) ::xla::CompileResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::CompileResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_CompileResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsCompileResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionHandle.base,}}; + +static void InitDefaultsExecuteRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecuteRequest_default_instance_; + new (ptr) ::xla::ExecuteRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecuteRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_ExecuteRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsExecuteRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionHandle.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +static void InitDefaultsExecuteGraphRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecuteGraphRequest_default_instance_; + new (ptr) ::xla::ExecuteGraphRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecuteGraphRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_ExecuteGraphRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsExecuteGraphRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecutionOptions.base,}}; + +static void InitDefaultsExecuteGraphParallelRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecuteGraphParallelRequest_default_instance_; + new (ptr) ::xla::ExecuteGraphParallelRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecuteGraphParallelRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ExecuteGraphParallelRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsExecuteGraphParallelRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteGraphRequest.base,}}; + +static void InitDefaultsExecuteResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecuteResponse_default_instance_; + new (ptr) ::xla::ExecuteResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecuteResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_ExecuteResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsExecuteResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionProfile.base,}}; + +static void InitDefaultsExecuteParallelResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecuteParallelResponse_default_instance_; + new (ptr) ::xla::ExecuteParallelResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecuteParallelResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ExecuteParallelResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsExecuteParallelResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteResponse.base,}}; + +static void InitDefaultsWaitForExecutionRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_WaitForExecutionRequest_default_instance_; + new (ptr) ::xla::WaitForExecutionRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::WaitForExecutionRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_WaitForExecutionRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsWaitForExecutionRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionHandle.base,}}; + +static void InitDefaultsWaitForExecutionResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_WaitForExecutionResponse_default_instance_; + new (ptr) ::xla::WaitForExecutionResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::WaitForExecutionResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_WaitForExecutionResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsWaitForExecutionResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionProfile.base,}}; + +static void InitDefaultsComputeConstantGraphRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ComputeConstantGraphRequest_default_instance_; + new (ptr) ::xla::ComputeConstantGraphRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ComputeConstantGraphRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_ComputeConstantGraphRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsComputeConstantGraphRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloModuleProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LayoutProto.base,}}; + +static void InitDefaultsComputeConstantResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ComputeConstantResponse_default_instance_; + new (ptr) ::xla::ComputeConstantResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ComputeConstantResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ComputeConstantResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsComputeConstantResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base,}}; + +static void InitDefaultsDeconstructTupleRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DeconstructTupleRequest_default_instance_; + new (ptr) ::xla::DeconstructTupleRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DeconstructTupleRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeconstructTupleRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeconstructTupleRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +static void InitDefaultsDeconstructTupleResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DeconstructTupleResponse_default_instance_; + new (ptr) ::xla::DeconstructTupleResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DeconstructTupleResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeconstructTupleResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeconstructTupleResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +static void InitDefaultsLoadDataRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_LoadDataRequest_default_instance_; + new (ptr) ::xla::LoadDataRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::LoadDataRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_LoadDataRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsLoadDataRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsLoadDataResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_LoadDataResponse_default_instance_; + new (ptr) ::xla::LoadDataResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::LoadDataResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_LoadDataResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsLoadDataResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsGetShapeRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_GetShapeRequest_default_instance_; + new (ptr) ::xla::GetShapeRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::GetShapeRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_GetShapeRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsGetShapeRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +static void InitDefaultsGetShapeResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_GetShapeResponse_default_instance_; + new (ptr) ::xla::GetShapeResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::GetShapeResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_GetShapeResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsGetShapeResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsUnpackRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_UnpackRequest_default_instance_; + new (ptr) ::xla::UnpackRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::UnpackRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_UnpackRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsUnpackRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +static void InitDefaultsUnpackResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_UnpackResponse_default_instance_; + new (ptr) ::xla::UnpackResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::UnpackResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_UnpackResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsUnpackResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_HloReducePrecisionOptions.base); + ::google::protobuf::internal::InitSCC(&scc_info_DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_DebugOptions.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecutionOptions.base); + ::google::protobuf::internal::InitSCC(&scc_info_GetDeviceHandlesRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_GetDeviceHandlesResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferToClientRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferToClientResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferToServerRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferToServerResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferToInfeedRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferToInfeedResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferFromOutfeedRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_TransferFromOutfeedResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ResetDeviceRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ResetDeviceResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ComputationGraphStatsRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ComputationStatsResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_CreateChannelHandleRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_CreateChannelHandleResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_UnregisterRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_UnregisterResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_CompileRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_CompileResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecuteRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecuteGraphRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecuteGraphParallelRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecuteResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecuteParallelResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_WaitForExecutionRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_WaitForExecutionResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ComputeConstantGraphRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ComputeConstantResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeconstructTupleRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeconstructTupleResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_LoadDataRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_LoadDataResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_GetShapeRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_GetShapeResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_UnpackRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_UnpackResponse.base); +} + +::google::protobuf::Metadata file_level_metadata[41]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloReducePrecisionOptions, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloReducePrecisionOptions, location_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloReducePrecisionOptions, exponent_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloReducePrecisionOptions, mantissa_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloReducePrecisionOptions, opcodes_to_suffix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::HloReducePrecisionOptions, opname_substrings_to_suffix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_generate_hlo_graph_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_graph_addresses_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_graph_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_dump_as_graphdef_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_log_hlo_text_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_generate_hlo_text_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_dump_optimized_hlo_proto_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_profile_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_dump_computations_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_dump_executions_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_disable_hlo_passes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_disable_all_hlo_passes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_backend_optimization_level_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_embed_ir_in_executable_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_dump_ir_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_eliminate_hlo_implicit_broadcast_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_cpu_multi_thread_eigen_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_cuda_data_dir_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_ftz_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_disable_multi_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_llvm_enable_alias_scope_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_llvm_enable_noalias_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_llvm_enable_invariant_load_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_llvm_disable_expensive_passes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, hlo_reduce_precision_options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_test_all_output_layouts_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_test_all_input_layouts_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_graph_sharding_color_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_tfgraph_device_scopes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_use_cudnn_batchnorm_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_dump_unoptimized_hlo_proto_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_dump_per_pass_hlo_proto_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_cpu_use_mkl_dnn_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_max_kernel_unroll_factor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_cpu_enable_fast_math_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_enable_fast_min_max_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_crash_on_verification_failures_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_force_host_platform_device_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_gpu_disable_ptxas_optimizations_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_dump_as_html_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_hlo_evaluator_use_fast_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DebugOptions, xla_backend_extra_options_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionOptions, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionOptions, shape_with_output_layout_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionOptions, seed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionOptions, debug_options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionOptions, device_handles_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetDeviceHandlesRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetDeviceHandlesRequest, device_count_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetDeviceHandlesResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetDeviceHandlesResponse, device_handles_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToClientRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToClientRequest, data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToClientRequest, shape_with_layout_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToClientResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToClientResponse, literal_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToServerRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToServerRequest, literal_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToServerRequest, device_handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToServerResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToServerResponse, data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToInfeedRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToInfeedRequest, literal_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToInfeedRequest, replica_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToInfeedRequest, device_handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferToInfeedResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferFromOutfeedRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferFromOutfeedRequest, shape_with_layout_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferFromOutfeedRequest, replica_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferFromOutfeedRequest, device_handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferFromOutfeedResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TransferFromOutfeedResponse, literal_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ResetDeviceRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ResetDeviceRequest, device_handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ResetDeviceResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationGraphStatsRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationGraphStatsRequest, computation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationGraphStatsRequest, debug_options_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationStatsResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationStatsResponse, stats_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CreateChannelHandleRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CreateChannelHandleRequest, channel_type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CreateChannelHandleResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CreateChannelHandleResponse, channel_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::UnregisterRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::UnregisterRequest, data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::UnregisterResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CompileRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CompileRequest, computation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CompileRequest, execution_options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CompileRequest, input_shape_with_layout_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CompileResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::CompileResponse, handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteRequest, handle_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteRequest, arguments_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteGraphRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteGraphRequest, computation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteGraphRequest, arguments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteGraphRequest, execution_options_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteGraphParallelRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteGraphParallelRequest, requests_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteResponse, output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteResponse, profile_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteParallelResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecuteParallelResponse, responses_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WaitForExecutionRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WaitForExecutionRequest, execution_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WaitForExecutionResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WaitForExecutionResponse, output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WaitForExecutionResponse, profile_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputeConstantGraphRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputeConstantGraphRequest, computation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputeConstantGraphRequest, output_layout_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputeConstantResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputeConstantResponse, literal_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeconstructTupleRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeconstructTupleRequest, tuple_handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeconstructTupleResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeconstructTupleResponse, element_handles_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataRequest, columnio_tablet_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataRequest, columnio_field_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataRequest, element_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataRequest, offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataRequest, limit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataRequest, zip_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataResponse, data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataResponse, data_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataResponse, available_rows_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataResponse, rows_loaded_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LoadDataResponse, nanoseconds_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetShapeRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetShapeRequest, data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetShapeResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GetShapeResponse, shape_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::UnpackRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::UnpackRequest, data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::UnpackResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::UnpackResponse, tied_data_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::xla::HloReducePrecisionOptions)}, + { 10, 17, sizeof(::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse)}, + { 19, -1, sizeof(::xla::DebugOptions)}, + { 66, -1, sizeof(::xla::ExecutionOptions)}, + { 75, -1, sizeof(::xla::GetDeviceHandlesRequest)}, + { 81, -1, sizeof(::xla::GetDeviceHandlesResponse)}, + { 87, -1, sizeof(::xla::TransferToClientRequest)}, + { 94, -1, sizeof(::xla::TransferToClientResponse)}, + { 100, -1, sizeof(::xla::TransferToServerRequest)}, + { 107, -1, sizeof(::xla::TransferToServerResponse)}, + { 113, -1, sizeof(::xla::TransferToInfeedRequest)}, + { 121, -1, sizeof(::xla::TransferToInfeedResponse)}, + { 126, -1, sizeof(::xla::TransferFromOutfeedRequest)}, + { 134, -1, sizeof(::xla::TransferFromOutfeedResponse)}, + { 140, -1, sizeof(::xla::ResetDeviceRequest)}, + { 146, -1, sizeof(::xla::ResetDeviceResponse)}, + { 151, -1, sizeof(::xla::ComputationGraphStatsRequest)}, + { 158, -1, sizeof(::xla::ComputationStatsResponse)}, + { 164, -1, sizeof(::xla::CreateChannelHandleRequest)}, + { 170, -1, sizeof(::xla::CreateChannelHandleResponse)}, + { 176, -1, sizeof(::xla::UnregisterRequest)}, + { 182, -1, sizeof(::xla::UnregisterResponse)}, + { 187, -1, sizeof(::xla::CompileRequest)}, + { 195, -1, sizeof(::xla::CompileResponse)}, + { 201, -1, sizeof(::xla::ExecuteRequest)}, + { 208, -1, sizeof(::xla::ExecuteGraphRequest)}, + { 216, -1, sizeof(::xla::ExecuteGraphParallelRequest)}, + { 222, -1, sizeof(::xla::ExecuteResponse)}, + { 229, -1, sizeof(::xla::ExecuteParallelResponse)}, + { 235, -1, sizeof(::xla::WaitForExecutionRequest)}, + { 241, -1, sizeof(::xla::WaitForExecutionResponse)}, + { 248, -1, sizeof(::xla::ComputeConstantGraphRequest)}, + { 255, -1, sizeof(::xla::ComputeConstantResponse)}, + { 261, -1, sizeof(::xla::DeconstructTupleRequest)}, + { 267, -1, sizeof(::xla::DeconstructTupleResponse)}, + { 273, -1, sizeof(::xla::LoadDataRequest)}, + { 284, -1, sizeof(::xla::LoadDataResponse)}, + { 294, -1, sizeof(::xla::GetShapeRequest)}, + { 300, -1, sizeof(::xla::GetShapeResponse)}, + { 306, -1, sizeof(::xla::UnpackRequest)}, + { 312, -1, sizeof(::xla::UnpackResponse)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::xla::_HloReducePrecisionOptions_default_instance_), + reinterpret_cast(&::xla::_DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::xla::_DebugOptions_default_instance_), + reinterpret_cast(&::xla::_ExecutionOptions_default_instance_), + reinterpret_cast(&::xla::_GetDeviceHandlesRequest_default_instance_), + reinterpret_cast(&::xla::_GetDeviceHandlesResponse_default_instance_), + reinterpret_cast(&::xla::_TransferToClientRequest_default_instance_), + reinterpret_cast(&::xla::_TransferToClientResponse_default_instance_), + reinterpret_cast(&::xla::_TransferToServerRequest_default_instance_), + reinterpret_cast(&::xla::_TransferToServerResponse_default_instance_), + reinterpret_cast(&::xla::_TransferToInfeedRequest_default_instance_), + reinterpret_cast(&::xla::_TransferToInfeedResponse_default_instance_), + reinterpret_cast(&::xla::_TransferFromOutfeedRequest_default_instance_), + reinterpret_cast(&::xla::_TransferFromOutfeedResponse_default_instance_), + reinterpret_cast(&::xla::_ResetDeviceRequest_default_instance_), + reinterpret_cast(&::xla::_ResetDeviceResponse_default_instance_), + reinterpret_cast(&::xla::_ComputationGraphStatsRequest_default_instance_), + reinterpret_cast(&::xla::_ComputationStatsResponse_default_instance_), + reinterpret_cast(&::xla::_CreateChannelHandleRequest_default_instance_), + reinterpret_cast(&::xla::_CreateChannelHandleResponse_default_instance_), + reinterpret_cast(&::xla::_UnregisterRequest_default_instance_), + reinterpret_cast(&::xla::_UnregisterResponse_default_instance_), + reinterpret_cast(&::xla::_CompileRequest_default_instance_), + reinterpret_cast(&::xla::_CompileResponse_default_instance_), + reinterpret_cast(&::xla::_ExecuteRequest_default_instance_), + reinterpret_cast(&::xla::_ExecuteGraphRequest_default_instance_), + reinterpret_cast(&::xla::_ExecuteGraphParallelRequest_default_instance_), + reinterpret_cast(&::xla::_ExecuteResponse_default_instance_), + reinterpret_cast(&::xla::_ExecuteParallelResponse_default_instance_), + reinterpret_cast(&::xla::_WaitForExecutionRequest_default_instance_), + reinterpret_cast(&::xla::_WaitForExecutionResponse_default_instance_), + reinterpret_cast(&::xla::_ComputeConstantGraphRequest_default_instance_), + reinterpret_cast(&::xla::_ComputeConstantResponse_default_instance_), + reinterpret_cast(&::xla::_DeconstructTupleRequest_default_instance_), + reinterpret_cast(&::xla::_DeconstructTupleResponse_default_instance_), + reinterpret_cast(&::xla::_LoadDataRequest_default_instance_), + reinterpret_cast(&::xla::_LoadDataResponse_default_instance_), + reinterpret_cast(&::xla::_GetShapeRequest_default_instance_), + reinterpret_cast(&::xla::_GetShapeResponse_default_instance_), + reinterpret_cast(&::xla::_UnpackRequest_default_instance_), + reinterpret_cast(&::xla::_UnpackResponse_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/xla/xla.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 41); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n+diplomacy_tensorflow/compiler/xla/xla." + "proto\022\003xla\0320diplomacy_tensorflow/compile" + "r/xla/xla_data.proto\0323diplomacy_tensorfl" + "ow/compiler/xla/service/hlo.proto\"\304\002\n\031Hl" + "oReducePrecisionOptions\0229\n\010location\030\001 \001(" + "\0162\'.xla.HloReducePrecisionOptions.Locati" + "on\022\025\n\rexponent_bits\030\002 \001(\r\022\025\n\rmantissa_bi" + "ts\030\003 \001(\r\022\031\n\021opcodes_to_suffix\030\004 \003(\r\022#\n\033o" + "pname_substrings_to_suffix\030\005 \003(\t\"~\n\010Loca" + "tion\022\r\n\tOP_INPUTS\020\000\022\016\n\nOP_OUTPUTS\020\001\022\026\n\022U" + "NFUSED_OP_OUTPUTS\020\002\022\034\n\030FUSION_INPUTS_BY_" + "CONTENT\020\003\022\035\n\031FUSION_OUTPUTS_BY_CONTENT\020\004" + "\"\236\r\n\014DebugOptions\022\036\n\026xla_generate_hlo_gr" + "aph\030\001 \001(\t\022\037\n\027xla_hlo_graph_addresses\030\002 \001" + "(\010\022\032\n\022xla_hlo_graph_path\030\004 \001(\t\022 \n\030xla_hl" + "o_dump_as_graphdef\030\005 \001(\010\022\030\n\020xla_log_hlo_" + "text\030\006 \001(\t\022 \n\030xla_generate_hlo_text_to\030\007" + " \001(\t\022\'\n\037xla_dump_optimized_hlo_proto_to\030" + "\010 \001(\t\022\027\n\017xla_hlo_profile\030\t \001(\010\022 \n\030xla_du" + "mp_computations_to\030\n \001(\t\022\036\n\026xla_dump_exe" + "cutions_to\030\013 \001(\t\022\036\n\026xla_disable_hlo_pass" + "es\030\036 \003(\t\022\"\n\032xla_disable_all_hlo_passes\030h" + " \001(\010\022&\n\036xla_backend_optimization_level\030\037" + " \001(\005\022\"\n\032xla_embed_ir_in_executable\030! \001(\010" + "\022\026\n\016xla_dump_ir_to\030\" \001(\t\022,\n$xla_eliminat" + "e_hlo_implicit_broadcast\030# \001(\010\022\"\n\032xla_cp" + "u_multi_thread_eigen\030< \001(\010\022\035\n\025xla_gpu_cu" + "da_data_dir\030= \001(\t\022\023\n\013xla_gpu_ftz\030> \001(\010\022\'" + "\n\037xla_gpu_disable_multi_streaming\030\? \001(\010\022" + ",\n$xla_llvm_enable_alias_scope_metadata\030" + "F \001(\010\022(\n xla_llvm_enable_noalias_metadat" + "a\030G \001(\010\022/\n\'xla_llvm_enable_invariant_loa" + "d_metadata\030H \001(\010\022)\n!xla_llvm_disable_exp" + "ensive_passes\030I \001(\010\022D\n\034hlo_reduce_precis" + "ion_options\030P \003(\0132\036.xla.HloReducePrecisi" + "onOptions\022#\n\033xla_test_all_output_layouts" + "\030Z \001(\010\022\"\n\032xla_test_all_input_layouts\030[ \001" + "(\010\022$\n\034xla_hlo_graph_sharding_color\030\\ \001(\010" + "\022%\n\035xla_hlo_tfgraph_device_scopes\030] \001(\010\022" + "#\n\033xla_gpu_use_cudnn_batchnorm\030^ \001(\010\022)\n!" + "xla_dump_unoptimized_hlo_proto_to\030_ \001(\t\022" + "&\n\036xla_dump_per_pass_hlo_proto_to\030` \001(\t\022" + "\033\n\023xla_cpu_use_mkl_dnn\030a \001(\010\022(\n xla_gpu_" + "max_kernel_unroll_factor\030b \001(\005\022 \n\030xla_cp" + "u_enable_fast_math\030c \001(\010\022#\n\033xla_gpu_enab" + "le_fast_min_max\030d \001(\010\022.\n&xla_gpu_crash_o" + "n_verification_failures\030e \001(\010\022,\n$xla_for" + "ce_host_platform_device_count\030f \001(\005\022+\n#x" + "la_gpu_disable_ptxas_optimizations\030g \001(\010" + "\022\034\n\024xla_hlo_dump_as_html\030i \001(\010\022\'\n\037xla_hl" + "o_evaluator_use_fast_path\030j \001(\010\022Q\n\031xla_b" + "ackend_extra_options\030\364\003 \003(\0132-.xla.DebugO" + "ptions.XlaBackendExtraOptionsEntry\032=\n\033Xl" + "aBackendExtraOptionsEntry\022\013\n\003key\030\001 \001(\t\022\r" + "\n\005value\030\002 \001(\t:\0028\001\"\250\001\n\020ExecutionOptions\0221" + "\n\030shape_with_output_layout\030\002 \001(\0132\017.xla.S" + "hapeProto\022\014\n\004seed\030\003 \001(\004\022(\n\rdebug_options" + "\030\004 \001(\0132\021.xla.DebugOptions\022)\n\016device_hand" + "les\030\005 \003(\0132\021.xla.DeviceHandle\"/\n\027GetDevic" + "eHandlesRequest\022\024\n\014device_count\030\001 \001(\003\"E\n" + "\030GetDeviceHandlesResponse\022)\n\016device_hand" + "les\030\001 \003(\0132\021.xla.DeviceHandle\"j\n\027Transfer" + "ToClientRequest\022#\n\004data\030\001 \001(\0132\025.xla.Glob" + "alDataHandle\022*\n\021shape_with_layout\030\002 \001(\0132" + "\017.xla.ShapeProto\">\n\030TransferToClientResp" + "onse\022\"\n\007literal\030\001 \001(\0132\021.xla.LiteralProto" + "\"g\n\027TransferToServerRequest\022\"\n\007literal\030\001" + " \001(\0132\021.xla.LiteralProto\022(\n\rdevice_handle" + "\030\002 \001(\0132\021.xla.DeviceHandle\"\?\n\030TransferToS" + "erverResponse\022#\n\004data\030\001 \001(\0132\025.xla.Global" + "DataHandle\"{\n\027TransferToInfeedRequest\022\"\n" + "\007literal\030\001 \001(\0132\021.xla.LiteralProto\022\022\n\nrep" + "lica_id\030\002 \001(\003\022(\n\rdevice_handle\030\003 \001(\0132\021.x" + "la.DeviceHandle\"\032\n\030TransferToInfeedRespo" + "nse\"\206\001\n\032TransferFromOutfeedRequest\022*\n\021sh" + "ape_with_layout\030\001 \001(\0132\017.xla.ShapeProto\022\022" + "\n\nreplica_id\030\002 \001(\003\022(\n\rdevice_handle\030\003 \001(" + "\0132\021.xla.DeviceHandle\"A\n\033TransferFromOutf" + "eedResponse\022\"\n\007literal\030\001 \001(\0132\021.xla.Liter" + "alProto\">\n\022ResetDeviceRequest\022(\n\rdevice_" + "handle\030\001 \001(\0132\021.xla.DeviceHandle\"\025\n\023Reset" + "DeviceResponse\"r\n\034ComputationGraphStatsR" + "equest\022(\n\013computation\030\001 \001(\0132\023.xla.HloMod" + "uleProto\022(\n\rdebug_options\030\002 \001(\0132\021.xla.De" + "bugOptions\"@\n\030ComputationStatsResponse\022$" + "\n\005stats\030\001 \001(\0132\025.xla.ComputationStats\"R\n\032" + "CreateChannelHandleRequest\0224\n\014channel_ty" + "pe\030\001 \001(\0162\036.xla.ChannelHandle.ChannelType" + "\"B\n\033CreateChannelHandleResponse\022#\n\007chann" + "el\030\001 \001(\0132\022.xla.ChannelHandle\"8\n\021Unregist" + "erRequest\022#\n\004data\030\001 \003(\0132\025.xla.GlobalData" + "Handle\"\024\n\022UnregisterResponse\"\236\001\n\016Compile" + "Request\022(\n\013computation\030\001 \001(\0132\023.xla.HloMo" + "duleProto\0220\n\021execution_options\030\002 \001(\0132\025.x" + "la.ExecutionOptions\0220\n\027input_shape_with_" + "layout\030\003 \003(\0132\017.xla.ShapeProto\"7\n\017Compile" + "Response\022$\n\006handle\030\001 \001(\0132\024.xla.Execution" + "Handle\"`\n\016ExecuteRequest\022$\n\006handle\030\001 \001(\013" + "2\024.xla.ExecutionHandle\022(\n\targuments\030\002 \003(" + "\0132\025.xla.GlobalDataHandle\"\233\001\n\023ExecuteGrap" + "hRequest\022(\n\013computation\030\001 \001(\0132\023.xla.HloM" + "oduleProto\022(\n\targuments\030\002 \003(\0132\025.xla.Glob" + "alDataHandle\0220\n\021execution_options\030\003 \001(\0132" + "\025.xla.ExecutionOptions\"I\n\033ExecuteGraphPa" + "rallelRequest\022*\n\010requests\030\001 \003(\0132\030.xla.Ex" + "ecuteGraphRequest\"`\n\017ExecuteResponse\022%\n\006" + "output\030\001 \001(\0132\025.xla.GlobalDataHandle\022&\n\007p" + "rofile\030\002 \001(\0132\025.xla.ExecutionProfile\"B\n\027E" + "xecuteParallelResponse\022\'\n\tresponses\030\001 \003(" + "\0132\024.xla.ExecuteResponse\"B\n\027WaitForExecut" + "ionRequest\022\'\n\texecution\030\001 \001(\0132\024.xla.Exec" + "utionHandle\"i\n\030WaitForExecutionResponse\022" + "%\n\006output\030\001 \001(\0132\025.xla.GlobalDataHandle\022&" + "\n\007profile\030\002 \001(\0132\025.xla.ExecutionProfile\"p" + "\n\033ComputeConstantGraphRequest\022(\n\013computa" + "tion\030\001 \001(\0132\023.xla.HloModuleProto\022\'\n\routpu" + "t_layout\030\002 \001(\0132\020.xla.LayoutProto\"=\n\027Comp" + "uteConstantResponse\022\"\n\007literal\030\001 \001(\0132\021.x" + "la.LiteralProto\"F\n\027DeconstructTupleReque" + "st\022+\n\014tuple_handle\030\002 \001(\0132\025.xla.GlobalDat" + "aHandle\"J\n\030DeconstructTupleResponse\022.\n\017e" + "lement_handles\030\001 \003(\0132\025.xla.GlobalDataHan" + "dle\"\233\001\n\017LoadDataRequest\022\034\n\024columnio_tabl" + "et_path\030\001 \001(\t\022\026\n\016columnio_field\030\002 \001(\t\022&\n" + "\relement_shape\030\003 \001(\0132\017.xla.ShapeProto\022\016\n" + "\006offset\030\004 \001(\003\022\r\n\005limit\030\005 \001(\003\022\013\n\003zip\030\006 \001(" + "\010\"\236\001\n\020LoadDataResponse\022#\n\004data\030\001 \001(\0132\025.x" + "la.GlobalDataHandle\022#\n\ndata_shape\030\002 \001(\0132" + "\017.xla.ShapeProto\022\026\n\016available_rows\030\003 \001(\003" + "\022\023\n\013rows_loaded\030\004 \001(\003\022\023\n\013nanoseconds\030\005 \001" + "(\003\"6\n\017GetShapeRequest\022#\n\004data\030\001 \001(\0132\025.xl" + "a.GlobalDataHandle\"2\n\020GetShapeResponse\022\036" + "\n\005shape\030\001 \001(\0132\017.xla.ShapeProto\"4\n\rUnpack" + "Request\022#\n\004data\030\001 \001(\0132\025.xla.GlobalDataHa" + "ndle\":\n\016UnpackResponse\022(\n\ttied_data\030\001 \003(" + "\0132\025.xla.GlobalDataHandleb\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 5432); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/xla/xla.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto +namespace xla { +const ::google::protobuf::EnumDescriptor* HloReducePrecisionOptions_Location_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_enum_descriptors[0]; +} +bool HloReducePrecisionOptions_Location_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const HloReducePrecisionOptions_Location HloReducePrecisionOptions::OP_INPUTS; +const HloReducePrecisionOptions_Location HloReducePrecisionOptions::OP_OUTPUTS; +const HloReducePrecisionOptions_Location HloReducePrecisionOptions::UNFUSED_OP_OUTPUTS; +const HloReducePrecisionOptions_Location HloReducePrecisionOptions::FUSION_INPUTS_BY_CONTENT; +const HloReducePrecisionOptions_Location HloReducePrecisionOptions::FUSION_OUTPUTS_BY_CONTENT; +const HloReducePrecisionOptions_Location HloReducePrecisionOptions::Location_MIN; +const HloReducePrecisionOptions_Location HloReducePrecisionOptions::Location_MAX; +const int HloReducePrecisionOptions::Location_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void HloReducePrecisionOptions::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HloReducePrecisionOptions::kLocationFieldNumber; +const int HloReducePrecisionOptions::kExponentBitsFieldNumber; +const int HloReducePrecisionOptions::kMantissaBitsFieldNumber; +const int HloReducePrecisionOptions::kOpcodesToSuffixFieldNumber; +const int HloReducePrecisionOptions::kOpnameSubstringsToSuffixFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HloReducePrecisionOptions::HloReducePrecisionOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_HloReducePrecisionOptions.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.HloReducePrecisionOptions) +} +HloReducePrecisionOptions::HloReducePrecisionOptions(const HloReducePrecisionOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + opcodes_to_suffix_(from.opcodes_to_suffix_), + opname_substrings_to_suffix_(from.opname_substrings_to_suffix_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&location_, &from.location_, + static_cast(reinterpret_cast(&mantissa_bits_) - + reinterpret_cast(&location_)) + sizeof(mantissa_bits_)); + // @@protoc_insertion_point(copy_constructor:xla.HloReducePrecisionOptions) +} + +void HloReducePrecisionOptions::SharedCtor() { + ::memset(&location_, 0, static_cast( + reinterpret_cast(&mantissa_bits_) - + reinterpret_cast(&location_)) + sizeof(mantissa_bits_)); +} + +HloReducePrecisionOptions::~HloReducePrecisionOptions() { + // @@protoc_insertion_point(destructor:xla.HloReducePrecisionOptions) + SharedDtor(); +} + +void HloReducePrecisionOptions::SharedDtor() { +} + +void HloReducePrecisionOptions::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HloReducePrecisionOptions::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HloReducePrecisionOptions& HloReducePrecisionOptions::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_HloReducePrecisionOptions.base); + return *internal_default_instance(); +} + + +void HloReducePrecisionOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.HloReducePrecisionOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + opcodes_to_suffix_.Clear(); + opname_substrings_to_suffix_.Clear(); + ::memset(&location_, 0, static_cast( + reinterpret_cast(&mantissa_bits_) - + reinterpret_cast(&location_)) + sizeof(mantissa_bits_)); + _internal_metadata_.Clear(); +} + +bool HloReducePrecisionOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.HloReducePrecisionOptions) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HloReducePrecisionOptions.Location location = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_location(static_cast< ::xla::HloReducePrecisionOptions_Location >(value)); + } else { + goto handle_unusual; + } + break; + } + + // uint32 exponent_bits = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &exponent_bits_))); + } else { + goto handle_unusual; + } + break; + } + + // uint32 mantissa_bits = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &mantissa_bits_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 opcodes_to_suffix = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_opcodes_to_suffix()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 34u, input, this->mutable_opcodes_to_suffix()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated string opname_substrings_to_suffix = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_opname_substrings_to_suffix())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->opname_substrings_to_suffix(this->opname_substrings_to_suffix_size() - 1).data(), + static_cast(this->opname_substrings_to_suffix(this->opname_substrings_to_suffix_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.HloReducePrecisionOptions.opname_substrings_to_suffix")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.HloReducePrecisionOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.HloReducePrecisionOptions) + return false; +#undef DO_ +} + +void HloReducePrecisionOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.HloReducePrecisionOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloReducePrecisionOptions.Location location = 1; + if (this->location() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->location(), output); + } + + // uint32 exponent_bits = 2; + if (this->exponent_bits() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->exponent_bits(), output); + } + + // uint32 mantissa_bits = 3; + if (this->mantissa_bits() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->mantissa_bits(), output); + } + + // repeated uint32 opcodes_to_suffix = 4; + if (this->opcodes_to_suffix_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _opcodes_to_suffix_cached_byte_size_)); + } + for (int i = 0, n = this->opcodes_to_suffix_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->opcodes_to_suffix(i), output); + } + + // repeated string opname_substrings_to_suffix = 5; + for (int i = 0, n = this->opname_substrings_to_suffix_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->opname_substrings_to_suffix(i).data(), static_cast(this->opname_substrings_to_suffix(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloReducePrecisionOptions.opname_substrings_to_suffix"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->opname_substrings_to_suffix(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.HloReducePrecisionOptions) +} + +::google::protobuf::uint8* HloReducePrecisionOptions::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.HloReducePrecisionOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloReducePrecisionOptions.Location location = 1; + if (this->location() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->location(), target); + } + + // uint32 exponent_bits = 2; + if (this->exponent_bits() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->exponent_bits(), target); + } + + // uint32 mantissa_bits = 3; + if (this->mantissa_bits() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->mantissa_bits(), target); + } + + // repeated uint32 opcodes_to_suffix = 4; + if (this->opcodes_to_suffix_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _opcodes_to_suffix_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->opcodes_to_suffix_, target); + } + + // repeated string opname_substrings_to_suffix = 5; + for (int i = 0, n = this->opname_substrings_to_suffix_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->opname_substrings_to_suffix(i).data(), static_cast(this->opname_substrings_to_suffix(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.HloReducePrecisionOptions.opname_substrings_to_suffix"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(5, this->opname_substrings_to_suffix(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.HloReducePrecisionOptions) + return target; +} + +size_t HloReducePrecisionOptions::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.HloReducePrecisionOptions) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated uint32 opcodes_to_suffix = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->opcodes_to_suffix_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _opcodes_to_suffix_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated string opname_substrings_to_suffix = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->opname_substrings_to_suffix_size()); + for (int i = 0, n = this->opname_substrings_to_suffix_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->opname_substrings_to_suffix(i)); + } + + // .xla.HloReducePrecisionOptions.Location location = 1; + if (this->location() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->location()); + } + + // uint32 exponent_bits = 2; + if (this->exponent_bits() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->exponent_bits()); + } + + // uint32 mantissa_bits = 3; + if (this->mantissa_bits() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->mantissa_bits()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HloReducePrecisionOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.HloReducePrecisionOptions) + GOOGLE_DCHECK_NE(&from, this); + const HloReducePrecisionOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.HloReducePrecisionOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.HloReducePrecisionOptions) + MergeFrom(*source); + } +} + +void HloReducePrecisionOptions::MergeFrom(const HloReducePrecisionOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.HloReducePrecisionOptions) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + opcodes_to_suffix_.MergeFrom(from.opcodes_to_suffix_); + opname_substrings_to_suffix_.MergeFrom(from.opname_substrings_to_suffix_); + if (from.location() != 0) { + set_location(from.location()); + } + if (from.exponent_bits() != 0) { + set_exponent_bits(from.exponent_bits()); + } + if (from.mantissa_bits() != 0) { + set_mantissa_bits(from.mantissa_bits()); + } +} + +void HloReducePrecisionOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.HloReducePrecisionOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HloReducePrecisionOptions::CopyFrom(const HloReducePrecisionOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.HloReducePrecisionOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HloReducePrecisionOptions::IsInitialized() const { + return true; +} + +void HloReducePrecisionOptions::Swap(HloReducePrecisionOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void HloReducePrecisionOptions::InternalSwap(HloReducePrecisionOptions* other) { + using std::swap; + opcodes_to_suffix_.InternalSwap(&other->opcodes_to_suffix_); + opname_substrings_to_suffix_.InternalSwap(CastToBase(&other->opname_substrings_to_suffix_)); + swap(location_, other->location_); + swap(exponent_bits_, other->exponent_bits_); + swap(mantissa_bits_, other->mantissa_bits_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HloReducePrecisionOptions::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse() {} +DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse::MergeFrom(const DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[1]; +} +void DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void DebugOptions::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DebugOptions::kXlaGenerateHloGraphFieldNumber; +const int DebugOptions::kXlaHloGraphAddressesFieldNumber; +const int DebugOptions::kXlaHloGraphPathFieldNumber; +const int DebugOptions::kXlaHloDumpAsGraphdefFieldNumber; +const int DebugOptions::kXlaLogHloTextFieldNumber; +const int DebugOptions::kXlaGenerateHloTextToFieldNumber; +const int DebugOptions::kXlaDumpOptimizedHloProtoToFieldNumber; +const int DebugOptions::kXlaHloProfileFieldNumber; +const int DebugOptions::kXlaDumpComputationsToFieldNumber; +const int DebugOptions::kXlaDumpExecutionsToFieldNumber; +const int DebugOptions::kXlaDisableHloPassesFieldNumber; +const int DebugOptions::kXlaDisableAllHloPassesFieldNumber; +const int DebugOptions::kXlaBackendOptimizationLevelFieldNumber; +const int DebugOptions::kXlaEmbedIrInExecutableFieldNumber; +const int DebugOptions::kXlaDumpIrToFieldNumber; +const int DebugOptions::kXlaEliminateHloImplicitBroadcastFieldNumber; +const int DebugOptions::kXlaCpuMultiThreadEigenFieldNumber; +const int DebugOptions::kXlaGpuCudaDataDirFieldNumber; +const int DebugOptions::kXlaGpuFtzFieldNumber; +const int DebugOptions::kXlaGpuDisableMultiStreamingFieldNumber; +const int DebugOptions::kXlaLlvmEnableAliasScopeMetadataFieldNumber; +const int DebugOptions::kXlaLlvmEnableNoaliasMetadataFieldNumber; +const int DebugOptions::kXlaLlvmEnableInvariantLoadMetadataFieldNumber; +const int DebugOptions::kXlaLlvmDisableExpensivePassesFieldNumber; +const int DebugOptions::kHloReducePrecisionOptionsFieldNumber; +const int DebugOptions::kXlaTestAllOutputLayoutsFieldNumber; +const int DebugOptions::kXlaTestAllInputLayoutsFieldNumber; +const int DebugOptions::kXlaHloGraphShardingColorFieldNumber; +const int DebugOptions::kXlaHloTfgraphDeviceScopesFieldNumber; +const int DebugOptions::kXlaGpuUseCudnnBatchnormFieldNumber; +const int DebugOptions::kXlaDumpUnoptimizedHloProtoToFieldNumber; +const int DebugOptions::kXlaDumpPerPassHloProtoToFieldNumber; +const int DebugOptions::kXlaCpuUseMklDnnFieldNumber; +const int DebugOptions::kXlaGpuMaxKernelUnrollFactorFieldNumber; +const int DebugOptions::kXlaCpuEnableFastMathFieldNumber; +const int DebugOptions::kXlaGpuEnableFastMinMaxFieldNumber; +const int DebugOptions::kXlaGpuCrashOnVerificationFailuresFieldNumber; +const int DebugOptions::kXlaForceHostPlatformDeviceCountFieldNumber; +const int DebugOptions::kXlaGpuDisablePtxasOptimizationsFieldNumber; +const int DebugOptions::kXlaHloDumpAsHtmlFieldNumber; +const int DebugOptions::kXlaHloEvaluatorUseFastPathFieldNumber; +const int DebugOptions::kXlaBackendExtraOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DebugOptions::DebugOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DebugOptions.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DebugOptions) +} +DebugOptions::DebugOptions(const DebugOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + xla_disable_hlo_passes_(from.xla_disable_hlo_passes_), + hlo_reduce_precision_options_(from.hlo_reduce_precision_options_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + xla_backend_extra_options_.MergeFrom(from.xla_backend_extra_options_); + xla_generate_hlo_graph_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_generate_hlo_graph().size() > 0) { + xla_generate_hlo_graph_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_generate_hlo_graph_); + } + xla_hlo_graph_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_hlo_graph_path().size() > 0) { + xla_hlo_graph_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_hlo_graph_path_); + } + xla_log_hlo_text_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_log_hlo_text().size() > 0) { + xla_log_hlo_text_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_log_hlo_text_); + } + xla_generate_hlo_text_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_generate_hlo_text_to().size() > 0) { + xla_generate_hlo_text_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_generate_hlo_text_to_); + } + xla_dump_optimized_hlo_proto_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_dump_optimized_hlo_proto_to().size() > 0) { + xla_dump_optimized_hlo_proto_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_optimized_hlo_proto_to_); + } + xla_dump_computations_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_dump_computations_to().size() > 0) { + xla_dump_computations_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_computations_to_); + } + xla_dump_executions_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_dump_executions_to().size() > 0) { + xla_dump_executions_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_executions_to_); + } + xla_dump_ir_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_dump_ir_to().size() > 0) { + xla_dump_ir_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_ir_to_); + } + xla_gpu_cuda_data_dir_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_gpu_cuda_data_dir().size() > 0) { + xla_gpu_cuda_data_dir_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_gpu_cuda_data_dir_); + } + xla_dump_unoptimized_hlo_proto_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_dump_unoptimized_hlo_proto_to().size() > 0) { + xla_dump_unoptimized_hlo_proto_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_unoptimized_hlo_proto_to_); + } + xla_dump_per_pass_hlo_proto_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.xla_dump_per_pass_hlo_proto_to().size() > 0) { + xla_dump_per_pass_hlo_proto_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_per_pass_hlo_proto_to_); + } + ::memcpy(&xla_hlo_graph_addresses_, &from.xla_hlo_graph_addresses_, + static_cast(reinterpret_cast(&xla_hlo_evaluator_use_fast_path_) - + reinterpret_cast(&xla_hlo_graph_addresses_)) + sizeof(xla_hlo_evaluator_use_fast_path_)); + // @@protoc_insertion_point(copy_constructor:xla.DebugOptions) +} + +void DebugOptions::SharedCtor() { + xla_generate_hlo_graph_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_hlo_graph_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_log_hlo_text_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_generate_hlo_text_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_optimized_hlo_proto_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_computations_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_executions_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_ir_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_gpu_cuda_data_dir_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_unoptimized_hlo_proto_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_per_pass_hlo_proto_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&xla_hlo_graph_addresses_, 0, static_cast( + reinterpret_cast(&xla_hlo_evaluator_use_fast_path_) - + reinterpret_cast(&xla_hlo_graph_addresses_)) + sizeof(xla_hlo_evaluator_use_fast_path_)); +} + +DebugOptions::~DebugOptions() { + // @@protoc_insertion_point(destructor:xla.DebugOptions) + SharedDtor(); +} + +void DebugOptions::SharedDtor() { + xla_generate_hlo_graph_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_hlo_graph_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_log_hlo_text_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_generate_hlo_text_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_optimized_hlo_proto_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_computations_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_executions_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_ir_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_gpu_cuda_data_dir_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_unoptimized_hlo_proto_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_per_pass_hlo_proto_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void DebugOptions::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DebugOptions::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DebugOptions& DebugOptions::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DebugOptions.base); + return *internal_default_instance(); +} + + +void DebugOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DebugOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + xla_disable_hlo_passes_.Clear(); + hlo_reduce_precision_options_.Clear(); + xla_backend_extra_options_.Clear(); + xla_generate_hlo_graph_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_hlo_graph_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_log_hlo_text_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_generate_hlo_text_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_optimized_hlo_proto_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_computations_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_executions_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_ir_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_gpu_cuda_data_dir_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_unoptimized_hlo_proto_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + xla_dump_per_pass_hlo_proto_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&xla_hlo_graph_addresses_, 0, static_cast( + reinterpret_cast(&xla_hlo_evaluator_use_fast_path_) - + reinterpret_cast(&xla_hlo_graph_addresses_)) + sizeof(xla_hlo_evaluator_use_fast_path_)); + _internal_metadata_.Clear(); +} + +bool DebugOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DebugOptions) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string xla_generate_hlo_graph = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_generate_hlo_graph())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_generate_hlo_graph().data(), static_cast(this->xla_generate_hlo_graph().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_generate_hlo_graph")); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_hlo_graph_addresses = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_hlo_graph_addresses_))); + } else { + goto handle_unusual; + } + break; + } + + // string xla_hlo_graph_path = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_hlo_graph_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_hlo_graph_path().data(), static_cast(this->xla_hlo_graph_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_hlo_graph_path")); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_hlo_dump_as_graphdef = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_hlo_dump_as_graphdef_))); + } else { + goto handle_unusual; + } + break; + } + + // string xla_log_hlo_text = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_log_hlo_text())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_log_hlo_text().data(), static_cast(this->xla_log_hlo_text().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_log_hlo_text")); + } else { + goto handle_unusual; + } + break; + } + + // string xla_generate_hlo_text_to = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_generate_hlo_text_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_generate_hlo_text_to().data(), static_cast(this->xla_generate_hlo_text_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_generate_hlo_text_to")); + } else { + goto handle_unusual; + } + break; + } + + // string xla_dump_optimized_hlo_proto_to = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_dump_optimized_hlo_proto_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_optimized_hlo_proto_to().data(), static_cast(this->xla_dump_optimized_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_dump_optimized_hlo_proto_to")); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_hlo_profile = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_hlo_profile_))); + } else { + goto handle_unusual; + } + break; + } + + // string xla_dump_computations_to = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_dump_computations_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_computations_to().data(), static_cast(this->xla_dump_computations_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_dump_computations_to")); + } else { + goto handle_unusual; + } + break; + } + + // string xla_dump_executions_to = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_dump_executions_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_executions_to().data(), static_cast(this->xla_dump_executions_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_dump_executions_to")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string xla_disable_hlo_passes = 30; + case 30: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(242u /* 242 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_xla_disable_hlo_passes())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_disable_hlo_passes(this->xla_disable_hlo_passes_size() - 1).data(), + static_cast(this->xla_disable_hlo_passes(this->xla_disable_hlo_passes_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_disable_hlo_passes")); + } else { + goto handle_unusual; + } + break; + } + + // int32 xla_backend_optimization_level = 31; + case 31: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(248u /* 248 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &xla_backend_optimization_level_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_embed_ir_in_executable = 33; + case 33: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 264 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_embed_ir_in_executable_))); + } else { + goto handle_unusual; + } + break; + } + + // string xla_dump_ir_to = 34; + case 34: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 274 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_dump_ir_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_ir_to().data(), static_cast(this->xla_dump_ir_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_dump_ir_to")); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_eliminate_hlo_implicit_broadcast = 35; + case 35: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 280 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_eliminate_hlo_implicit_broadcast_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_cpu_multi_thread_eigen = 60; + case 60: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(224u /* 480 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_cpu_multi_thread_eigen_))); + } else { + goto handle_unusual; + } + break; + } + + // string xla_gpu_cuda_data_dir = 61; + case 61: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(234u /* 490 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_gpu_cuda_data_dir())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_gpu_cuda_data_dir().data(), static_cast(this->xla_gpu_cuda_data_dir().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_gpu_cuda_data_dir")); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_gpu_ftz = 62; + case 62: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(240u /* 496 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_gpu_ftz_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_gpu_disable_multi_streaming = 63; + case 63: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(248u /* 504 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_gpu_disable_multi_streaming_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_llvm_enable_alias_scope_metadata = 70; + case 70: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 560 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_llvm_enable_alias_scope_metadata_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_llvm_enable_noalias_metadata = 71; + case 71: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 568 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_llvm_enable_noalias_metadata_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_llvm_enable_invariant_load_metadata = 72; + case 72: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 576 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_llvm_enable_invariant_load_metadata_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_llvm_disable_expensive_passes = 73; + case 73: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 584 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_llvm_disable_expensive_passes_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HloReducePrecisionOptions hlo_reduce_precision_options = 80; + case 80: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(130u /* 642 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_hlo_reduce_precision_options())); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_test_all_output_layouts = 90; + case 90: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(208u /* 720 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_test_all_output_layouts_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_test_all_input_layouts = 91; + case 91: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(216u /* 728 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_test_all_input_layouts_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_hlo_graph_sharding_color = 92; + case 92: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(224u /* 736 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_hlo_graph_sharding_color_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_hlo_tfgraph_device_scopes = 93; + case 93: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(232u /* 744 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_hlo_tfgraph_device_scopes_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_gpu_use_cudnn_batchnorm = 94; + case 94: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(240u /* 752 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_gpu_use_cudnn_batchnorm_))); + } else { + goto handle_unusual; + } + break; + } + + // string xla_dump_unoptimized_hlo_proto_to = 95; + case 95: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(250u /* 762 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_dump_unoptimized_hlo_proto_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_unoptimized_hlo_proto_to().data(), static_cast(this->xla_dump_unoptimized_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to")); + } else { + goto handle_unusual; + } + break; + } + + // string xla_dump_per_pass_hlo_proto_to = 96; + case 96: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(2u /* 770 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_xla_dump_per_pass_hlo_proto_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_per_pass_hlo_proto_to().data(), static_cast(this->xla_dump_per_pass_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.xla_dump_per_pass_hlo_proto_to")); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_cpu_use_mkl_dnn = 97; + case 97: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 776 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_cpu_use_mkl_dnn_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 xla_gpu_max_kernel_unroll_factor = 98; + case 98: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 784 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &xla_gpu_max_kernel_unroll_factor_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_cpu_enable_fast_math = 99; + case 99: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 792 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_cpu_enable_fast_math_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_gpu_enable_fast_min_max = 100; + case 100: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 800 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_gpu_enable_fast_min_max_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_gpu_crash_on_verification_failures = 101; + case 101: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 808 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_gpu_crash_on_verification_failures_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 xla_force_host_platform_device_count = 102; + case 102: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 816 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &xla_force_host_platform_device_count_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_gpu_disable_ptxas_optimizations = 103; + case 103: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 824 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_gpu_disable_ptxas_optimizations_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_disable_all_hlo_passes = 104; + case 104: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 832 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_disable_all_hlo_passes_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_hlo_dump_as_html = 105; + case 105: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 840 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_hlo_dump_as_html_))); + } else { + goto handle_unusual; + } + break; + } + + // bool xla_hlo_evaluator_use_fast_path = 106; + case 106: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 848 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &xla_hlo_evaluator_use_fast_path_))); + } else { + goto handle_unusual; + } + break; + } + + // map xla_backend_extra_options = 500; + case 500: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(162u /* 4002 & 0xFF */)) { + DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse, + ::std::string, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::google::protobuf::Map< ::std::string, ::std::string > > parser(&xla_backend_extra_options_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.XlaBackendExtraOptionsEntry.key")); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.value().data(), static_cast(parser.value().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.DebugOptions.XlaBackendExtraOptionsEntry.value")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DebugOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DebugOptions) + return false; +#undef DO_ +} + +void DebugOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DebugOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string xla_generate_hlo_graph = 1; + if (this->xla_generate_hlo_graph().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_generate_hlo_graph().data(), static_cast(this->xla_generate_hlo_graph().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_generate_hlo_graph"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->xla_generate_hlo_graph(), output); + } + + // bool xla_hlo_graph_addresses = 2; + if (this->xla_hlo_graph_addresses() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->xla_hlo_graph_addresses(), output); + } + + // string xla_hlo_graph_path = 4; + if (this->xla_hlo_graph_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_hlo_graph_path().data(), static_cast(this->xla_hlo_graph_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_hlo_graph_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->xla_hlo_graph_path(), output); + } + + // bool xla_hlo_dump_as_graphdef = 5; + if (this->xla_hlo_dump_as_graphdef() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->xla_hlo_dump_as_graphdef(), output); + } + + // string xla_log_hlo_text = 6; + if (this->xla_log_hlo_text().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_log_hlo_text().data(), static_cast(this->xla_log_hlo_text().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_log_hlo_text"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->xla_log_hlo_text(), output); + } + + // string xla_generate_hlo_text_to = 7; + if (this->xla_generate_hlo_text_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_generate_hlo_text_to().data(), static_cast(this->xla_generate_hlo_text_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_generate_hlo_text_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->xla_generate_hlo_text_to(), output); + } + + // string xla_dump_optimized_hlo_proto_to = 8; + if (this->xla_dump_optimized_hlo_proto_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_optimized_hlo_proto_to().data(), static_cast(this->xla_dump_optimized_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_optimized_hlo_proto_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 8, this->xla_dump_optimized_hlo_proto_to(), output); + } + + // bool xla_hlo_profile = 9; + if (this->xla_hlo_profile() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->xla_hlo_profile(), output); + } + + // string xla_dump_computations_to = 10; + if (this->xla_dump_computations_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_computations_to().data(), static_cast(this->xla_dump_computations_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_computations_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 10, this->xla_dump_computations_to(), output); + } + + // string xla_dump_executions_to = 11; + if (this->xla_dump_executions_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_executions_to().data(), static_cast(this->xla_dump_executions_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_executions_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 11, this->xla_dump_executions_to(), output); + } + + // repeated string xla_disable_hlo_passes = 30; + for (int i = 0, n = this->xla_disable_hlo_passes_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_disable_hlo_passes(i).data(), static_cast(this->xla_disable_hlo_passes(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_disable_hlo_passes"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 30, this->xla_disable_hlo_passes(i), output); + } + + // int32 xla_backend_optimization_level = 31; + if (this->xla_backend_optimization_level() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(31, this->xla_backend_optimization_level(), output); + } + + // bool xla_embed_ir_in_executable = 33; + if (this->xla_embed_ir_in_executable() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(33, this->xla_embed_ir_in_executable(), output); + } + + // string xla_dump_ir_to = 34; + if (this->xla_dump_ir_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_ir_to().data(), static_cast(this->xla_dump_ir_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_ir_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 34, this->xla_dump_ir_to(), output); + } + + // bool xla_eliminate_hlo_implicit_broadcast = 35; + if (this->xla_eliminate_hlo_implicit_broadcast() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(35, this->xla_eliminate_hlo_implicit_broadcast(), output); + } + + // bool xla_cpu_multi_thread_eigen = 60; + if (this->xla_cpu_multi_thread_eigen() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(60, this->xla_cpu_multi_thread_eigen(), output); + } + + // string xla_gpu_cuda_data_dir = 61; + if (this->xla_gpu_cuda_data_dir().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_gpu_cuda_data_dir().data(), static_cast(this->xla_gpu_cuda_data_dir().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_gpu_cuda_data_dir"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 61, this->xla_gpu_cuda_data_dir(), output); + } + + // bool xla_gpu_ftz = 62; + if (this->xla_gpu_ftz() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(62, this->xla_gpu_ftz(), output); + } + + // bool xla_gpu_disable_multi_streaming = 63; + if (this->xla_gpu_disable_multi_streaming() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(63, this->xla_gpu_disable_multi_streaming(), output); + } + + // bool xla_llvm_enable_alias_scope_metadata = 70; + if (this->xla_llvm_enable_alias_scope_metadata() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(70, this->xla_llvm_enable_alias_scope_metadata(), output); + } + + // bool xla_llvm_enable_noalias_metadata = 71; + if (this->xla_llvm_enable_noalias_metadata() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(71, this->xla_llvm_enable_noalias_metadata(), output); + } + + // bool xla_llvm_enable_invariant_load_metadata = 72; + if (this->xla_llvm_enable_invariant_load_metadata() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(72, this->xla_llvm_enable_invariant_load_metadata(), output); + } + + // bool xla_llvm_disable_expensive_passes = 73; + if (this->xla_llvm_disable_expensive_passes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(73, this->xla_llvm_disable_expensive_passes(), output); + } + + // repeated .xla.HloReducePrecisionOptions hlo_reduce_precision_options = 80; + for (unsigned int i = 0, + n = static_cast(this->hlo_reduce_precision_options_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 80, + this->hlo_reduce_precision_options(static_cast(i)), + output); + } + + // bool xla_test_all_output_layouts = 90; + if (this->xla_test_all_output_layouts() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(90, this->xla_test_all_output_layouts(), output); + } + + // bool xla_test_all_input_layouts = 91; + if (this->xla_test_all_input_layouts() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(91, this->xla_test_all_input_layouts(), output); + } + + // bool xla_hlo_graph_sharding_color = 92; + if (this->xla_hlo_graph_sharding_color() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(92, this->xla_hlo_graph_sharding_color(), output); + } + + // bool xla_hlo_tfgraph_device_scopes = 93; + if (this->xla_hlo_tfgraph_device_scopes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(93, this->xla_hlo_tfgraph_device_scopes(), output); + } + + // bool xla_gpu_use_cudnn_batchnorm = 94; + if (this->xla_gpu_use_cudnn_batchnorm() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(94, this->xla_gpu_use_cudnn_batchnorm(), output); + } + + // string xla_dump_unoptimized_hlo_proto_to = 95; + if (this->xla_dump_unoptimized_hlo_proto_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_unoptimized_hlo_proto_to().data(), static_cast(this->xla_dump_unoptimized_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 95, this->xla_dump_unoptimized_hlo_proto_to(), output); + } + + // string xla_dump_per_pass_hlo_proto_to = 96; + if (this->xla_dump_per_pass_hlo_proto_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_per_pass_hlo_proto_to().data(), static_cast(this->xla_dump_per_pass_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_per_pass_hlo_proto_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 96, this->xla_dump_per_pass_hlo_proto_to(), output); + } + + // bool xla_cpu_use_mkl_dnn = 97; + if (this->xla_cpu_use_mkl_dnn() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(97, this->xla_cpu_use_mkl_dnn(), output); + } + + // int32 xla_gpu_max_kernel_unroll_factor = 98; + if (this->xla_gpu_max_kernel_unroll_factor() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(98, this->xla_gpu_max_kernel_unroll_factor(), output); + } + + // bool xla_cpu_enable_fast_math = 99; + if (this->xla_cpu_enable_fast_math() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(99, this->xla_cpu_enable_fast_math(), output); + } + + // bool xla_gpu_enable_fast_min_max = 100; + if (this->xla_gpu_enable_fast_min_max() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(100, this->xla_gpu_enable_fast_min_max(), output); + } + + // bool xla_gpu_crash_on_verification_failures = 101; + if (this->xla_gpu_crash_on_verification_failures() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(101, this->xla_gpu_crash_on_verification_failures(), output); + } + + // int32 xla_force_host_platform_device_count = 102; + if (this->xla_force_host_platform_device_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(102, this->xla_force_host_platform_device_count(), output); + } + + // bool xla_gpu_disable_ptxas_optimizations = 103; + if (this->xla_gpu_disable_ptxas_optimizations() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(103, this->xla_gpu_disable_ptxas_optimizations(), output); + } + + // bool xla_disable_all_hlo_passes = 104; + if (this->xla_disable_all_hlo_passes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(104, this->xla_disable_all_hlo_passes(), output); + } + + // bool xla_hlo_dump_as_html = 105; + if (this->xla_hlo_dump_as_html() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(105, this->xla_hlo_dump_as_html(), output); + } + + // bool xla_hlo_evaluator_use_fast_path = 106; + if (this->xla_hlo_evaluator_use_fast_path() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(106, this->xla_hlo_evaluator_use_fast_path(), output); + } + + // map xla_backend_extra_options = 500; + if (!this->xla_backend_extra_options().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.XlaBackendExtraOptionsEntry.key"); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.XlaBackendExtraOptionsEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->xla_backend_extra_options().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->xla_backend_extra_options().size()]); + typedef ::google::protobuf::Map< ::std::string, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->xla_backend_extra_options().begin(); + it != this->xla_backend_extra_options().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(xla_backend_extra_options_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 500, *entry, output); + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->xla_backend_extra_options().begin(); + it != this->xla_backend_extra_options().end(); ++it) { + entry.reset(xla_backend_extra_options_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 500, *entry, output); + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DebugOptions) +} + +::google::protobuf::uint8* DebugOptions::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DebugOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string xla_generate_hlo_graph = 1; + if (this->xla_generate_hlo_graph().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_generate_hlo_graph().data(), static_cast(this->xla_generate_hlo_graph().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_generate_hlo_graph"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->xla_generate_hlo_graph(), target); + } + + // bool xla_hlo_graph_addresses = 2; + if (this->xla_hlo_graph_addresses() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->xla_hlo_graph_addresses(), target); + } + + // string xla_hlo_graph_path = 4; + if (this->xla_hlo_graph_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_hlo_graph_path().data(), static_cast(this->xla_hlo_graph_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_hlo_graph_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->xla_hlo_graph_path(), target); + } + + // bool xla_hlo_dump_as_graphdef = 5; + if (this->xla_hlo_dump_as_graphdef() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->xla_hlo_dump_as_graphdef(), target); + } + + // string xla_log_hlo_text = 6; + if (this->xla_log_hlo_text().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_log_hlo_text().data(), static_cast(this->xla_log_hlo_text().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_log_hlo_text"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->xla_log_hlo_text(), target); + } + + // string xla_generate_hlo_text_to = 7; + if (this->xla_generate_hlo_text_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_generate_hlo_text_to().data(), static_cast(this->xla_generate_hlo_text_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_generate_hlo_text_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->xla_generate_hlo_text_to(), target); + } + + // string xla_dump_optimized_hlo_proto_to = 8; + if (this->xla_dump_optimized_hlo_proto_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_optimized_hlo_proto_to().data(), static_cast(this->xla_dump_optimized_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_optimized_hlo_proto_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 8, this->xla_dump_optimized_hlo_proto_to(), target); + } + + // bool xla_hlo_profile = 9; + if (this->xla_hlo_profile() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->xla_hlo_profile(), target); + } + + // string xla_dump_computations_to = 10; + if (this->xla_dump_computations_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_computations_to().data(), static_cast(this->xla_dump_computations_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_computations_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 10, this->xla_dump_computations_to(), target); + } + + // string xla_dump_executions_to = 11; + if (this->xla_dump_executions_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_executions_to().data(), static_cast(this->xla_dump_executions_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_executions_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 11, this->xla_dump_executions_to(), target); + } + + // repeated string xla_disable_hlo_passes = 30; + for (int i = 0, n = this->xla_disable_hlo_passes_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_disable_hlo_passes(i).data(), static_cast(this->xla_disable_hlo_passes(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_disable_hlo_passes"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(30, this->xla_disable_hlo_passes(i), target); + } + + // int32 xla_backend_optimization_level = 31; + if (this->xla_backend_optimization_level() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(31, this->xla_backend_optimization_level(), target); + } + + // bool xla_embed_ir_in_executable = 33; + if (this->xla_embed_ir_in_executable() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(33, this->xla_embed_ir_in_executable(), target); + } + + // string xla_dump_ir_to = 34; + if (this->xla_dump_ir_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_ir_to().data(), static_cast(this->xla_dump_ir_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_ir_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 34, this->xla_dump_ir_to(), target); + } + + // bool xla_eliminate_hlo_implicit_broadcast = 35; + if (this->xla_eliminate_hlo_implicit_broadcast() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(35, this->xla_eliminate_hlo_implicit_broadcast(), target); + } + + // bool xla_cpu_multi_thread_eigen = 60; + if (this->xla_cpu_multi_thread_eigen() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(60, this->xla_cpu_multi_thread_eigen(), target); + } + + // string xla_gpu_cuda_data_dir = 61; + if (this->xla_gpu_cuda_data_dir().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_gpu_cuda_data_dir().data(), static_cast(this->xla_gpu_cuda_data_dir().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_gpu_cuda_data_dir"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 61, this->xla_gpu_cuda_data_dir(), target); + } + + // bool xla_gpu_ftz = 62; + if (this->xla_gpu_ftz() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(62, this->xla_gpu_ftz(), target); + } + + // bool xla_gpu_disable_multi_streaming = 63; + if (this->xla_gpu_disable_multi_streaming() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(63, this->xla_gpu_disable_multi_streaming(), target); + } + + // bool xla_llvm_enable_alias_scope_metadata = 70; + if (this->xla_llvm_enable_alias_scope_metadata() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(70, this->xla_llvm_enable_alias_scope_metadata(), target); + } + + // bool xla_llvm_enable_noalias_metadata = 71; + if (this->xla_llvm_enable_noalias_metadata() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(71, this->xla_llvm_enable_noalias_metadata(), target); + } + + // bool xla_llvm_enable_invariant_load_metadata = 72; + if (this->xla_llvm_enable_invariant_load_metadata() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(72, this->xla_llvm_enable_invariant_load_metadata(), target); + } + + // bool xla_llvm_disable_expensive_passes = 73; + if (this->xla_llvm_disable_expensive_passes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(73, this->xla_llvm_disable_expensive_passes(), target); + } + + // repeated .xla.HloReducePrecisionOptions hlo_reduce_precision_options = 80; + for (unsigned int i = 0, + n = static_cast(this->hlo_reduce_precision_options_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 80, this->hlo_reduce_precision_options(static_cast(i)), deterministic, target); + } + + // bool xla_test_all_output_layouts = 90; + if (this->xla_test_all_output_layouts() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(90, this->xla_test_all_output_layouts(), target); + } + + // bool xla_test_all_input_layouts = 91; + if (this->xla_test_all_input_layouts() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(91, this->xla_test_all_input_layouts(), target); + } + + // bool xla_hlo_graph_sharding_color = 92; + if (this->xla_hlo_graph_sharding_color() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(92, this->xla_hlo_graph_sharding_color(), target); + } + + // bool xla_hlo_tfgraph_device_scopes = 93; + if (this->xla_hlo_tfgraph_device_scopes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(93, this->xla_hlo_tfgraph_device_scopes(), target); + } + + // bool xla_gpu_use_cudnn_batchnorm = 94; + if (this->xla_gpu_use_cudnn_batchnorm() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(94, this->xla_gpu_use_cudnn_batchnorm(), target); + } + + // string xla_dump_unoptimized_hlo_proto_to = 95; + if (this->xla_dump_unoptimized_hlo_proto_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_unoptimized_hlo_proto_to().data(), static_cast(this->xla_dump_unoptimized_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 95, this->xla_dump_unoptimized_hlo_proto_to(), target); + } + + // string xla_dump_per_pass_hlo_proto_to = 96; + if (this->xla_dump_per_pass_hlo_proto_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->xla_dump_per_pass_hlo_proto_to().data(), static_cast(this->xla_dump_per_pass_hlo_proto_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.xla_dump_per_pass_hlo_proto_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 96, this->xla_dump_per_pass_hlo_proto_to(), target); + } + + // bool xla_cpu_use_mkl_dnn = 97; + if (this->xla_cpu_use_mkl_dnn() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(97, this->xla_cpu_use_mkl_dnn(), target); + } + + // int32 xla_gpu_max_kernel_unroll_factor = 98; + if (this->xla_gpu_max_kernel_unroll_factor() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(98, this->xla_gpu_max_kernel_unroll_factor(), target); + } + + // bool xla_cpu_enable_fast_math = 99; + if (this->xla_cpu_enable_fast_math() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(99, this->xla_cpu_enable_fast_math(), target); + } + + // bool xla_gpu_enable_fast_min_max = 100; + if (this->xla_gpu_enable_fast_min_max() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(100, this->xla_gpu_enable_fast_min_max(), target); + } + + // bool xla_gpu_crash_on_verification_failures = 101; + if (this->xla_gpu_crash_on_verification_failures() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(101, this->xla_gpu_crash_on_verification_failures(), target); + } + + // int32 xla_force_host_platform_device_count = 102; + if (this->xla_force_host_platform_device_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(102, this->xla_force_host_platform_device_count(), target); + } + + // bool xla_gpu_disable_ptxas_optimizations = 103; + if (this->xla_gpu_disable_ptxas_optimizations() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(103, this->xla_gpu_disable_ptxas_optimizations(), target); + } + + // bool xla_disable_all_hlo_passes = 104; + if (this->xla_disable_all_hlo_passes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(104, this->xla_disable_all_hlo_passes(), target); + } + + // bool xla_hlo_dump_as_html = 105; + if (this->xla_hlo_dump_as_html() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(105, this->xla_hlo_dump_as_html(), target); + } + + // bool xla_hlo_evaluator_use_fast_path = 106; + if (this->xla_hlo_evaluator_use_fast_path() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(106, this->xla_hlo_evaluator_use_fast_path(), target); + } + + // map xla_backend_extra_options = 500; + if (!this->xla_backend_extra_options().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.XlaBackendExtraOptionsEntry.key"); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.DebugOptions.XlaBackendExtraOptionsEntry.value"); + } + }; + + if (deterministic && + this->xla_backend_extra_options().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->xla_backend_extra_options().size()]); + typedef ::google::protobuf::Map< ::std::string, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->xla_backend_extra_options().begin(); + it != this->xla_backend_extra_options().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(xla_backend_extra_options_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 500, *entry, deterministic, target); +; + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->xla_backend_extra_options().begin(); + it != this->xla_backend_extra_options().end(); ++it) { + entry.reset(xla_backend_extra_options_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 500, *entry, deterministic, target); +; + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DebugOptions) + return target; +} + +size_t DebugOptions::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DebugOptions) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string xla_disable_hlo_passes = 30; + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->xla_disable_hlo_passes_size()); + for (int i = 0, n = this->xla_disable_hlo_passes_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_disable_hlo_passes(i)); + } + + // repeated .xla.HloReducePrecisionOptions hlo_reduce_precision_options = 80; + { + unsigned int count = static_cast(this->hlo_reduce_precision_options_size()); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->hlo_reduce_precision_options(static_cast(i))); + } + } + + // map xla_backend_extra_options = 500; + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->xla_backend_extra_options_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->xla_backend_extra_options().begin(); + it != this->xla_backend_extra_options().end(); ++it) { + entry.reset(xla_backend_extra_options_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + // string xla_generate_hlo_graph = 1; + if (this->xla_generate_hlo_graph().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_generate_hlo_graph()); + } + + // string xla_hlo_graph_path = 4; + if (this->xla_hlo_graph_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_hlo_graph_path()); + } + + // string xla_log_hlo_text = 6; + if (this->xla_log_hlo_text().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_log_hlo_text()); + } + + // string xla_generate_hlo_text_to = 7; + if (this->xla_generate_hlo_text_to().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_generate_hlo_text_to()); + } + + // string xla_dump_optimized_hlo_proto_to = 8; + if (this->xla_dump_optimized_hlo_proto_to().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_dump_optimized_hlo_proto_to()); + } + + // string xla_dump_computations_to = 10; + if (this->xla_dump_computations_to().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_dump_computations_to()); + } + + // string xla_dump_executions_to = 11; + if (this->xla_dump_executions_to().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_dump_executions_to()); + } + + // string xla_dump_ir_to = 34; + if (this->xla_dump_ir_to().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_dump_ir_to()); + } + + // string xla_gpu_cuda_data_dir = 61; + if (this->xla_gpu_cuda_data_dir().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_gpu_cuda_data_dir()); + } + + // string xla_dump_unoptimized_hlo_proto_to = 95; + if (this->xla_dump_unoptimized_hlo_proto_to().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_dump_unoptimized_hlo_proto_to()); + } + + // string xla_dump_per_pass_hlo_proto_to = 96; + if (this->xla_dump_per_pass_hlo_proto_to().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->xla_dump_per_pass_hlo_proto_to()); + } + + // bool xla_hlo_graph_addresses = 2; + if (this->xla_hlo_graph_addresses() != 0) { + total_size += 1 + 1; + } + + // bool xla_hlo_dump_as_graphdef = 5; + if (this->xla_hlo_dump_as_graphdef() != 0) { + total_size += 1 + 1; + } + + // bool xla_hlo_profile = 9; + if (this->xla_hlo_profile() != 0) { + total_size += 1 + 1; + } + + // bool xla_disable_all_hlo_passes = 104; + if (this->xla_disable_all_hlo_passes() != 0) { + total_size += 2 + 1; + } + + // int32 xla_backend_optimization_level = 31; + if (this->xla_backend_optimization_level() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->xla_backend_optimization_level()); + } + + // bool xla_embed_ir_in_executable = 33; + if (this->xla_embed_ir_in_executable() != 0) { + total_size += 2 + 1; + } + + // bool xla_eliminate_hlo_implicit_broadcast = 35; + if (this->xla_eliminate_hlo_implicit_broadcast() != 0) { + total_size += 2 + 1; + } + + // bool xla_cpu_multi_thread_eigen = 60; + if (this->xla_cpu_multi_thread_eigen() != 0) { + total_size += 2 + 1; + } + + // bool xla_gpu_ftz = 62; + if (this->xla_gpu_ftz() != 0) { + total_size += 2 + 1; + } + + // bool xla_gpu_disable_multi_streaming = 63; + if (this->xla_gpu_disable_multi_streaming() != 0) { + total_size += 2 + 1; + } + + // bool xla_llvm_enable_alias_scope_metadata = 70; + if (this->xla_llvm_enable_alias_scope_metadata() != 0) { + total_size += 2 + 1; + } + + // bool xla_llvm_enable_noalias_metadata = 71; + if (this->xla_llvm_enable_noalias_metadata() != 0) { + total_size += 2 + 1; + } + + // bool xla_llvm_enable_invariant_load_metadata = 72; + if (this->xla_llvm_enable_invariant_load_metadata() != 0) { + total_size += 2 + 1; + } + + // bool xla_llvm_disable_expensive_passes = 73; + if (this->xla_llvm_disable_expensive_passes() != 0) { + total_size += 2 + 1; + } + + // bool xla_test_all_output_layouts = 90; + if (this->xla_test_all_output_layouts() != 0) { + total_size += 2 + 1; + } + + // bool xla_test_all_input_layouts = 91; + if (this->xla_test_all_input_layouts() != 0) { + total_size += 2 + 1; + } + + // bool xla_hlo_graph_sharding_color = 92; + if (this->xla_hlo_graph_sharding_color() != 0) { + total_size += 2 + 1; + } + + // bool xla_hlo_tfgraph_device_scopes = 93; + if (this->xla_hlo_tfgraph_device_scopes() != 0) { + total_size += 2 + 1; + } + + // bool xla_gpu_use_cudnn_batchnorm = 94; + if (this->xla_gpu_use_cudnn_batchnorm() != 0) { + total_size += 2 + 1; + } + + // bool xla_cpu_use_mkl_dnn = 97; + if (this->xla_cpu_use_mkl_dnn() != 0) { + total_size += 2 + 1; + } + + // bool xla_cpu_enable_fast_math = 99; + if (this->xla_cpu_enable_fast_math() != 0) { + total_size += 2 + 1; + } + + // int32 xla_gpu_max_kernel_unroll_factor = 98; + if (this->xla_gpu_max_kernel_unroll_factor() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->xla_gpu_max_kernel_unroll_factor()); + } + + // int32 xla_force_host_platform_device_count = 102; + if (this->xla_force_host_platform_device_count() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->xla_force_host_platform_device_count()); + } + + // bool xla_gpu_enable_fast_min_max = 100; + if (this->xla_gpu_enable_fast_min_max() != 0) { + total_size += 2 + 1; + } + + // bool xla_gpu_crash_on_verification_failures = 101; + if (this->xla_gpu_crash_on_verification_failures() != 0) { + total_size += 2 + 1; + } + + // bool xla_gpu_disable_ptxas_optimizations = 103; + if (this->xla_gpu_disable_ptxas_optimizations() != 0) { + total_size += 2 + 1; + } + + // bool xla_hlo_dump_as_html = 105; + if (this->xla_hlo_dump_as_html() != 0) { + total_size += 2 + 1; + } + + // bool xla_hlo_evaluator_use_fast_path = 106; + if (this->xla_hlo_evaluator_use_fast_path() != 0) { + total_size += 2 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DebugOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DebugOptions) + GOOGLE_DCHECK_NE(&from, this); + const DebugOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DebugOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DebugOptions) + MergeFrom(*source); + } +} + +void DebugOptions::MergeFrom(const DebugOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DebugOptions) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + xla_disable_hlo_passes_.MergeFrom(from.xla_disable_hlo_passes_); + hlo_reduce_precision_options_.MergeFrom(from.hlo_reduce_precision_options_); + xla_backend_extra_options_.MergeFrom(from.xla_backend_extra_options_); + if (from.xla_generate_hlo_graph().size() > 0) { + + xla_generate_hlo_graph_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_generate_hlo_graph_); + } + if (from.xla_hlo_graph_path().size() > 0) { + + xla_hlo_graph_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_hlo_graph_path_); + } + if (from.xla_log_hlo_text().size() > 0) { + + xla_log_hlo_text_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_log_hlo_text_); + } + if (from.xla_generate_hlo_text_to().size() > 0) { + + xla_generate_hlo_text_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_generate_hlo_text_to_); + } + if (from.xla_dump_optimized_hlo_proto_to().size() > 0) { + + xla_dump_optimized_hlo_proto_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_optimized_hlo_proto_to_); + } + if (from.xla_dump_computations_to().size() > 0) { + + xla_dump_computations_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_computations_to_); + } + if (from.xla_dump_executions_to().size() > 0) { + + xla_dump_executions_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_executions_to_); + } + if (from.xla_dump_ir_to().size() > 0) { + + xla_dump_ir_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_ir_to_); + } + if (from.xla_gpu_cuda_data_dir().size() > 0) { + + xla_gpu_cuda_data_dir_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_gpu_cuda_data_dir_); + } + if (from.xla_dump_unoptimized_hlo_proto_to().size() > 0) { + + xla_dump_unoptimized_hlo_proto_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_unoptimized_hlo_proto_to_); + } + if (from.xla_dump_per_pass_hlo_proto_to().size() > 0) { + + xla_dump_per_pass_hlo_proto_to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.xla_dump_per_pass_hlo_proto_to_); + } + if (from.xla_hlo_graph_addresses() != 0) { + set_xla_hlo_graph_addresses(from.xla_hlo_graph_addresses()); + } + if (from.xla_hlo_dump_as_graphdef() != 0) { + set_xla_hlo_dump_as_graphdef(from.xla_hlo_dump_as_graphdef()); + } + if (from.xla_hlo_profile() != 0) { + set_xla_hlo_profile(from.xla_hlo_profile()); + } + if (from.xla_disable_all_hlo_passes() != 0) { + set_xla_disable_all_hlo_passes(from.xla_disable_all_hlo_passes()); + } + if (from.xla_backend_optimization_level() != 0) { + set_xla_backend_optimization_level(from.xla_backend_optimization_level()); + } + if (from.xla_embed_ir_in_executable() != 0) { + set_xla_embed_ir_in_executable(from.xla_embed_ir_in_executable()); + } + if (from.xla_eliminate_hlo_implicit_broadcast() != 0) { + set_xla_eliminate_hlo_implicit_broadcast(from.xla_eliminate_hlo_implicit_broadcast()); + } + if (from.xla_cpu_multi_thread_eigen() != 0) { + set_xla_cpu_multi_thread_eigen(from.xla_cpu_multi_thread_eigen()); + } + if (from.xla_gpu_ftz() != 0) { + set_xla_gpu_ftz(from.xla_gpu_ftz()); + } + if (from.xla_gpu_disable_multi_streaming() != 0) { + set_xla_gpu_disable_multi_streaming(from.xla_gpu_disable_multi_streaming()); + } + if (from.xla_llvm_enable_alias_scope_metadata() != 0) { + set_xla_llvm_enable_alias_scope_metadata(from.xla_llvm_enable_alias_scope_metadata()); + } + if (from.xla_llvm_enable_noalias_metadata() != 0) { + set_xla_llvm_enable_noalias_metadata(from.xla_llvm_enable_noalias_metadata()); + } + if (from.xla_llvm_enable_invariant_load_metadata() != 0) { + set_xla_llvm_enable_invariant_load_metadata(from.xla_llvm_enable_invariant_load_metadata()); + } + if (from.xla_llvm_disable_expensive_passes() != 0) { + set_xla_llvm_disable_expensive_passes(from.xla_llvm_disable_expensive_passes()); + } + if (from.xla_test_all_output_layouts() != 0) { + set_xla_test_all_output_layouts(from.xla_test_all_output_layouts()); + } + if (from.xla_test_all_input_layouts() != 0) { + set_xla_test_all_input_layouts(from.xla_test_all_input_layouts()); + } + if (from.xla_hlo_graph_sharding_color() != 0) { + set_xla_hlo_graph_sharding_color(from.xla_hlo_graph_sharding_color()); + } + if (from.xla_hlo_tfgraph_device_scopes() != 0) { + set_xla_hlo_tfgraph_device_scopes(from.xla_hlo_tfgraph_device_scopes()); + } + if (from.xla_gpu_use_cudnn_batchnorm() != 0) { + set_xla_gpu_use_cudnn_batchnorm(from.xla_gpu_use_cudnn_batchnorm()); + } + if (from.xla_cpu_use_mkl_dnn() != 0) { + set_xla_cpu_use_mkl_dnn(from.xla_cpu_use_mkl_dnn()); + } + if (from.xla_cpu_enable_fast_math() != 0) { + set_xla_cpu_enable_fast_math(from.xla_cpu_enable_fast_math()); + } + if (from.xla_gpu_max_kernel_unroll_factor() != 0) { + set_xla_gpu_max_kernel_unroll_factor(from.xla_gpu_max_kernel_unroll_factor()); + } + if (from.xla_force_host_platform_device_count() != 0) { + set_xla_force_host_platform_device_count(from.xla_force_host_platform_device_count()); + } + if (from.xla_gpu_enable_fast_min_max() != 0) { + set_xla_gpu_enable_fast_min_max(from.xla_gpu_enable_fast_min_max()); + } + if (from.xla_gpu_crash_on_verification_failures() != 0) { + set_xla_gpu_crash_on_verification_failures(from.xla_gpu_crash_on_verification_failures()); + } + if (from.xla_gpu_disable_ptxas_optimizations() != 0) { + set_xla_gpu_disable_ptxas_optimizations(from.xla_gpu_disable_ptxas_optimizations()); + } + if (from.xla_hlo_dump_as_html() != 0) { + set_xla_hlo_dump_as_html(from.xla_hlo_dump_as_html()); + } + if (from.xla_hlo_evaluator_use_fast_path() != 0) { + set_xla_hlo_evaluator_use_fast_path(from.xla_hlo_evaluator_use_fast_path()); + } +} + +void DebugOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DebugOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DebugOptions::CopyFrom(const DebugOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DebugOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DebugOptions::IsInitialized() const { + return true; +} + +void DebugOptions::Swap(DebugOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void DebugOptions::InternalSwap(DebugOptions* other) { + using std::swap; + xla_disable_hlo_passes_.InternalSwap(CastToBase(&other->xla_disable_hlo_passes_)); + CastToBase(&hlo_reduce_precision_options_)->InternalSwap(CastToBase(&other->hlo_reduce_precision_options_)); + xla_backend_extra_options_.Swap(&other->xla_backend_extra_options_); + xla_generate_hlo_graph_.Swap(&other->xla_generate_hlo_graph_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_hlo_graph_path_.Swap(&other->xla_hlo_graph_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_log_hlo_text_.Swap(&other->xla_log_hlo_text_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_generate_hlo_text_to_.Swap(&other->xla_generate_hlo_text_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_dump_optimized_hlo_proto_to_.Swap(&other->xla_dump_optimized_hlo_proto_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_dump_computations_to_.Swap(&other->xla_dump_computations_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_dump_executions_to_.Swap(&other->xla_dump_executions_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_dump_ir_to_.Swap(&other->xla_dump_ir_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_gpu_cuda_data_dir_.Swap(&other->xla_gpu_cuda_data_dir_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_dump_unoptimized_hlo_proto_to_.Swap(&other->xla_dump_unoptimized_hlo_proto_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + xla_dump_per_pass_hlo_proto_to_.Swap(&other->xla_dump_per_pass_hlo_proto_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(xla_hlo_graph_addresses_, other->xla_hlo_graph_addresses_); + swap(xla_hlo_dump_as_graphdef_, other->xla_hlo_dump_as_graphdef_); + swap(xla_hlo_profile_, other->xla_hlo_profile_); + swap(xla_disable_all_hlo_passes_, other->xla_disable_all_hlo_passes_); + swap(xla_backend_optimization_level_, other->xla_backend_optimization_level_); + swap(xla_embed_ir_in_executable_, other->xla_embed_ir_in_executable_); + swap(xla_eliminate_hlo_implicit_broadcast_, other->xla_eliminate_hlo_implicit_broadcast_); + swap(xla_cpu_multi_thread_eigen_, other->xla_cpu_multi_thread_eigen_); + swap(xla_gpu_ftz_, other->xla_gpu_ftz_); + swap(xla_gpu_disable_multi_streaming_, other->xla_gpu_disable_multi_streaming_); + swap(xla_llvm_enable_alias_scope_metadata_, other->xla_llvm_enable_alias_scope_metadata_); + swap(xla_llvm_enable_noalias_metadata_, other->xla_llvm_enable_noalias_metadata_); + swap(xla_llvm_enable_invariant_load_metadata_, other->xla_llvm_enable_invariant_load_metadata_); + swap(xla_llvm_disable_expensive_passes_, other->xla_llvm_disable_expensive_passes_); + swap(xla_test_all_output_layouts_, other->xla_test_all_output_layouts_); + swap(xla_test_all_input_layouts_, other->xla_test_all_input_layouts_); + swap(xla_hlo_graph_sharding_color_, other->xla_hlo_graph_sharding_color_); + swap(xla_hlo_tfgraph_device_scopes_, other->xla_hlo_tfgraph_device_scopes_); + swap(xla_gpu_use_cudnn_batchnorm_, other->xla_gpu_use_cudnn_batchnorm_); + swap(xla_cpu_use_mkl_dnn_, other->xla_cpu_use_mkl_dnn_); + swap(xla_cpu_enable_fast_math_, other->xla_cpu_enable_fast_math_); + swap(xla_gpu_max_kernel_unroll_factor_, other->xla_gpu_max_kernel_unroll_factor_); + swap(xla_force_host_platform_device_count_, other->xla_force_host_platform_device_count_); + swap(xla_gpu_enable_fast_min_max_, other->xla_gpu_enable_fast_min_max_); + swap(xla_gpu_crash_on_verification_failures_, other->xla_gpu_crash_on_verification_failures_); + swap(xla_gpu_disable_ptxas_optimizations_, other->xla_gpu_disable_ptxas_optimizations_); + swap(xla_hlo_dump_as_html_, other->xla_hlo_dump_as_html_); + swap(xla_hlo_evaluator_use_fast_path_, other->xla_hlo_evaluator_use_fast_path_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DebugOptions::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecutionOptions::InitAsDefaultInstance() { + ::xla::_ExecutionOptions_default_instance_._instance.get_mutable()->shape_with_output_layout_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); + ::xla::_ExecutionOptions_default_instance_._instance.get_mutable()->debug_options_ = const_cast< ::xla::DebugOptions*>( + ::xla::DebugOptions::internal_default_instance()); +} +void ExecutionOptions::clear_shape_with_output_layout() { + if (GetArenaNoVirtual() == NULL && shape_with_output_layout_ != NULL) { + delete shape_with_output_layout_; + } + shape_with_output_layout_ = NULL; +} +void ExecutionOptions::clear_device_handles() { + device_handles_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecutionOptions::kShapeWithOutputLayoutFieldNumber; +const int ExecutionOptions::kSeedFieldNumber; +const int ExecutionOptions::kDebugOptionsFieldNumber; +const int ExecutionOptions::kDeviceHandlesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecutionOptions::ExecutionOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecutionOptions.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecutionOptions) +} +ExecutionOptions::ExecutionOptions(const ExecutionOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + device_handles_(from.device_handles_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape_with_output_layout()) { + shape_with_output_layout_ = new ::xla::ShapeProto(*from.shape_with_output_layout_); + } else { + shape_with_output_layout_ = NULL; + } + if (from.has_debug_options()) { + debug_options_ = new ::xla::DebugOptions(*from.debug_options_); + } else { + debug_options_ = NULL; + } + seed_ = from.seed_; + // @@protoc_insertion_point(copy_constructor:xla.ExecutionOptions) +} + +void ExecutionOptions::SharedCtor() { + ::memset(&shape_with_output_layout_, 0, static_cast( + reinterpret_cast(&seed_) - + reinterpret_cast(&shape_with_output_layout_)) + sizeof(seed_)); +} + +ExecutionOptions::~ExecutionOptions() { + // @@protoc_insertion_point(destructor:xla.ExecutionOptions) + SharedDtor(); +} + +void ExecutionOptions::SharedDtor() { + if (this != internal_default_instance()) delete shape_with_output_layout_; + if (this != internal_default_instance()) delete debug_options_; +} + +void ExecutionOptions::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecutionOptions::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecutionOptions& ExecutionOptions::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecutionOptions.base); + return *internal_default_instance(); +} + + +void ExecutionOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecutionOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + device_handles_.Clear(); + if (GetArenaNoVirtual() == NULL && shape_with_output_layout_ != NULL) { + delete shape_with_output_layout_; + } + shape_with_output_layout_ = NULL; + if (GetArenaNoVirtual() == NULL && debug_options_ != NULL) { + delete debug_options_; + } + debug_options_ = NULL; + seed_ = GOOGLE_ULONGLONG(0); + _internal_metadata_.Clear(); +} + +bool ExecutionOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecutionOptions) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ShapeProto shape_with_output_layout = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape_with_output_layout())); + } else { + goto handle_unusual; + } + break; + } + + // uint64 seed = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &seed_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DebugOptions debug_options = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_debug_options())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.DeviceHandle device_handles = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_device_handles())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecutionOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecutionOptions) + return false; +#undef DO_ +} + +void ExecutionOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecutionOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape_with_output_layout = 2; + if (this->has_shape_with_output_layout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape_with_output_layout(), output); + } + + // uint64 seed = 3; + if (this->seed() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->seed(), output); + } + + // .xla.DebugOptions debug_options = 4; + if (this->has_debug_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_debug_options(), output); + } + + // repeated .xla.DeviceHandle device_handles = 5; + for (unsigned int i = 0, + n = static_cast(this->device_handles_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, + this->device_handles(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecutionOptions) +} + +::google::protobuf::uint8* ExecutionOptions::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecutionOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape_with_output_layout = 2; + if (this->has_shape_with_output_layout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape_with_output_layout(), deterministic, target); + } + + // uint64 seed = 3; + if (this->seed() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->seed(), target); + } + + // .xla.DebugOptions debug_options = 4; + if (this->has_debug_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_debug_options(), deterministic, target); + } + + // repeated .xla.DeviceHandle device_handles = 5; + for (unsigned int i = 0, + n = static_cast(this->device_handles_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->device_handles(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecutionOptions) + return target; +} + +size_t ExecutionOptions::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecutionOptions) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.DeviceHandle device_handles = 5; + { + unsigned int count = static_cast(this->device_handles_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->device_handles(static_cast(i))); + } + } + + // .xla.ShapeProto shape_with_output_layout = 2; + if (this->has_shape_with_output_layout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_with_output_layout_); + } + + // .xla.DebugOptions debug_options = 4; + if (this->has_debug_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *debug_options_); + } + + // uint64 seed = 3; + if (this->seed() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->seed()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecutionOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecutionOptions) + GOOGLE_DCHECK_NE(&from, this); + const ExecutionOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecutionOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecutionOptions) + MergeFrom(*source); + } +} + +void ExecutionOptions::MergeFrom(const ExecutionOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecutionOptions) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + device_handles_.MergeFrom(from.device_handles_); + if (from.has_shape_with_output_layout()) { + mutable_shape_with_output_layout()->::xla::ShapeProto::MergeFrom(from.shape_with_output_layout()); + } + if (from.has_debug_options()) { + mutable_debug_options()->::xla::DebugOptions::MergeFrom(from.debug_options()); + } + if (from.seed() != 0) { + set_seed(from.seed()); + } +} + +void ExecutionOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecutionOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecutionOptions::CopyFrom(const ExecutionOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecutionOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecutionOptions::IsInitialized() const { + return true; +} + +void ExecutionOptions::Swap(ExecutionOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void ExecutionOptions::InternalSwap(ExecutionOptions* other) { + using std::swap; + CastToBase(&device_handles_)->InternalSwap(CastToBase(&other->device_handles_)); + swap(shape_with_output_layout_, other->shape_with_output_layout_); + swap(debug_options_, other->debug_options_); + swap(seed_, other->seed_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecutionOptions::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GetDeviceHandlesRequest::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GetDeviceHandlesRequest::kDeviceCountFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GetDeviceHandlesRequest::GetDeviceHandlesRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetDeviceHandlesRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.GetDeviceHandlesRequest) +} +GetDeviceHandlesRequest::GetDeviceHandlesRequest(const GetDeviceHandlesRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + device_count_ = from.device_count_; + // @@protoc_insertion_point(copy_constructor:xla.GetDeviceHandlesRequest) +} + +void GetDeviceHandlesRequest::SharedCtor() { + device_count_ = GOOGLE_LONGLONG(0); +} + +GetDeviceHandlesRequest::~GetDeviceHandlesRequest() { + // @@protoc_insertion_point(destructor:xla.GetDeviceHandlesRequest) + SharedDtor(); +} + +void GetDeviceHandlesRequest::SharedDtor() { +} + +void GetDeviceHandlesRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GetDeviceHandlesRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GetDeviceHandlesRequest& GetDeviceHandlesRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetDeviceHandlesRequest.base); + return *internal_default_instance(); +} + + +void GetDeviceHandlesRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.GetDeviceHandlesRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + device_count_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool GetDeviceHandlesRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.GetDeviceHandlesRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 device_count = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_count_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.GetDeviceHandlesRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.GetDeviceHandlesRequest) + return false; +#undef DO_ +} + +void GetDeviceHandlesRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.GetDeviceHandlesRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 device_count = 1; + if (this->device_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->device_count(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.GetDeviceHandlesRequest) +} + +::google::protobuf::uint8* GetDeviceHandlesRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.GetDeviceHandlesRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 device_count = 1; + if (this->device_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->device_count(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.GetDeviceHandlesRequest) + return target; +} + +size_t GetDeviceHandlesRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.GetDeviceHandlesRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 device_count = 1; + if (this->device_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_count()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetDeviceHandlesRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.GetDeviceHandlesRequest) + GOOGLE_DCHECK_NE(&from, this); + const GetDeviceHandlesRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.GetDeviceHandlesRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.GetDeviceHandlesRequest) + MergeFrom(*source); + } +} + +void GetDeviceHandlesRequest::MergeFrom(const GetDeviceHandlesRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.GetDeviceHandlesRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.device_count() != 0) { + set_device_count(from.device_count()); + } +} + +void GetDeviceHandlesRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.GetDeviceHandlesRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetDeviceHandlesRequest::CopyFrom(const GetDeviceHandlesRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.GetDeviceHandlesRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetDeviceHandlesRequest::IsInitialized() const { + return true; +} + +void GetDeviceHandlesRequest::Swap(GetDeviceHandlesRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void GetDeviceHandlesRequest::InternalSwap(GetDeviceHandlesRequest* other) { + using std::swap; + swap(device_count_, other->device_count_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GetDeviceHandlesRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GetDeviceHandlesResponse::InitAsDefaultInstance() { +} +void GetDeviceHandlesResponse::clear_device_handles() { + device_handles_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GetDeviceHandlesResponse::kDeviceHandlesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GetDeviceHandlesResponse::GetDeviceHandlesResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetDeviceHandlesResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.GetDeviceHandlesResponse) +} +GetDeviceHandlesResponse::GetDeviceHandlesResponse(const GetDeviceHandlesResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + device_handles_(from.device_handles_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.GetDeviceHandlesResponse) +} + +void GetDeviceHandlesResponse::SharedCtor() { +} + +GetDeviceHandlesResponse::~GetDeviceHandlesResponse() { + // @@protoc_insertion_point(destructor:xla.GetDeviceHandlesResponse) + SharedDtor(); +} + +void GetDeviceHandlesResponse::SharedDtor() { +} + +void GetDeviceHandlesResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GetDeviceHandlesResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GetDeviceHandlesResponse& GetDeviceHandlesResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetDeviceHandlesResponse.base); + return *internal_default_instance(); +} + + +void GetDeviceHandlesResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.GetDeviceHandlesResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + device_handles_.Clear(); + _internal_metadata_.Clear(); +} + +bool GetDeviceHandlesResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.GetDeviceHandlesResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.DeviceHandle device_handles = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_device_handles())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.GetDeviceHandlesResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.GetDeviceHandlesResponse) + return false; +#undef DO_ +} + +void GetDeviceHandlesResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.GetDeviceHandlesResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.DeviceHandle device_handles = 1; + for (unsigned int i = 0, + n = static_cast(this->device_handles_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->device_handles(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.GetDeviceHandlesResponse) +} + +::google::protobuf::uint8* GetDeviceHandlesResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.GetDeviceHandlesResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.DeviceHandle device_handles = 1; + for (unsigned int i = 0, + n = static_cast(this->device_handles_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->device_handles(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.GetDeviceHandlesResponse) + return target; +} + +size_t GetDeviceHandlesResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.GetDeviceHandlesResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.DeviceHandle device_handles = 1; + { + unsigned int count = static_cast(this->device_handles_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->device_handles(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetDeviceHandlesResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.GetDeviceHandlesResponse) + GOOGLE_DCHECK_NE(&from, this); + const GetDeviceHandlesResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.GetDeviceHandlesResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.GetDeviceHandlesResponse) + MergeFrom(*source); + } +} + +void GetDeviceHandlesResponse::MergeFrom(const GetDeviceHandlesResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.GetDeviceHandlesResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + device_handles_.MergeFrom(from.device_handles_); +} + +void GetDeviceHandlesResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.GetDeviceHandlesResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetDeviceHandlesResponse::CopyFrom(const GetDeviceHandlesResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.GetDeviceHandlesResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetDeviceHandlesResponse::IsInitialized() const { + return true; +} + +void GetDeviceHandlesResponse::Swap(GetDeviceHandlesResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void GetDeviceHandlesResponse::InternalSwap(GetDeviceHandlesResponse* other) { + using std::swap; + CastToBase(&device_handles_)->InternalSwap(CastToBase(&other->device_handles_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GetDeviceHandlesResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferToClientRequest::InitAsDefaultInstance() { + ::xla::_TransferToClientRequest_default_instance_._instance.get_mutable()->data_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); + ::xla::_TransferToClientRequest_default_instance_._instance.get_mutable()->shape_with_layout_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); +} +void TransferToClientRequest::clear_data() { + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; +} +void TransferToClientRequest::clear_shape_with_layout() { + if (GetArenaNoVirtual() == NULL && shape_with_layout_ != NULL) { + delete shape_with_layout_; + } + shape_with_layout_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransferToClientRequest::kDataFieldNumber; +const int TransferToClientRequest::kShapeWithLayoutFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferToClientRequest::TransferToClientRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToClientRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferToClientRequest) +} +TransferToClientRequest::TransferToClientRequest(const TransferToClientRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_data()) { + data_ = new ::xla::GlobalDataHandle(*from.data_); + } else { + data_ = NULL; + } + if (from.has_shape_with_layout()) { + shape_with_layout_ = new ::xla::ShapeProto(*from.shape_with_layout_); + } else { + shape_with_layout_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.TransferToClientRequest) +} + +void TransferToClientRequest::SharedCtor() { + ::memset(&data_, 0, static_cast( + reinterpret_cast(&shape_with_layout_) - + reinterpret_cast(&data_)) + sizeof(shape_with_layout_)); +} + +TransferToClientRequest::~TransferToClientRequest() { + // @@protoc_insertion_point(destructor:xla.TransferToClientRequest) + SharedDtor(); +} + +void TransferToClientRequest::SharedDtor() { + if (this != internal_default_instance()) delete data_; + if (this != internal_default_instance()) delete shape_with_layout_; +} + +void TransferToClientRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferToClientRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferToClientRequest& TransferToClientRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToClientRequest.base); + return *internal_default_instance(); +} + + +void TransferToClientRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferToClientRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; + if (GetArenaNoVirtual() == NULL && shape_with_layout_ != NULL) { + delete shape_with_layout_; + } + shape_with_layout_ = NULL; + _internal_metadata_.Clear(); +} + +bool TransferToClientRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferToClientRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ShapeProto shape_with_layout = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape_with_layout())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferToClientRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferToClientRequest) + return false; +#undef DO_ +} + +void TransferToClientRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferToClientRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_data(), output); + } + + // .xla.ShapeProto shape_with_layout = 2; + if (this->has_shape_with_layout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape_with_layout(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferToClientRequest) +} + +::google::protobuf::uint8* TransferToClientRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferToClientRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_data(), deterministic, target); + } + + // .xla.ShapeProto shape_with_layout = 2; + if (this->has_shape_with_layout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape_with_layout(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferToClientRequest) + return target; +} + +size_t TransferToClientRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferToClientRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *data_); + } + + // .xla.ShapeProto shape_with_layout = 2; + if (this->has_shape_with_layout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_with_layout_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferToClientRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferToClientRequest) + GOOGLE_DCHECK_NE(&from, this); + const TransferToClientRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferToClientRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferToClientRequest) + MergeFrom(*source); + } +} + +void TransferToClientRequest::MergeFrom(const TransferToClientRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferToClientRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_data()) { + mutable_data()->::xla::GlobalDataHandle::MergeFrom(from.data()); + } + if (from.has_shape_with_layout()) { + mutable_shape_with_layout()->::xla::ShapeProto::MergeFrom(from.shape_with_layout()); + } +} + +void TransferToClientRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferToClientRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferToClientRequest::CopyFrom(const TransferToClientRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferToClientRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferToClientRequest::IsInitialized() const { + return true; +} + +void TransferToClientRequest::Swap(TransferToClientRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferToClientRequest::InternalSwap(TransferToClientRequest* other) { + using std::swap; + swap(data_, other->data_); + swap(shape_with_layout_, other->shape_with_layout_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferToClientRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferToClientResponse::InitAsDefaultInstance() { + ::xla::_TransferToClientResponse_default_instance_._instance.get_mutable()->literal_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); +} +void TransferToClientResponse::clear_literal() { + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransferToClientResponse::kLiteralFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferToClientResponse::TransferToClientResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToClientResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferToClientResponse) +} +TransferToClientResponse::TransferToClientResponse(const TransferToClientResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_literal()) { + literal_ = new ::xla::LiteralProto(*from.literal_); + } else { + literal_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.TransferToClientResponse) +} + +void TransferToClientResponse::SharedCtor() { + literal_ = NULL; +} + +TransferToClientResponse::~TransferToClientResponse() { + // @@protoc_insertion_point(destructor:xla.TransferToClientResponse) + SharedDtor(); +} + +void TransferToClientResponse::SharedDtor() { + if (this != internal_default_instance()) delete literal_; +} + +void TransferToClientResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferToClientResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferToClientResponse& TransferToClientResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToClientResponse.base); + return *internal_default_instance(); +} + + +void TransferToClientResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferToClientResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; + _internal_metadata_.Clear(); +} + +bool TransferToClientResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferToClientResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.LiteralProto literal = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_literal())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferToClientResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferToClientResponse) + return false; +#undef DO_ +} + +void TransferToClientResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferToClientResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_literal(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferToClientResponse) +} + +::google::protobuf::uint8* TransferToClientResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferToClientResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_literal(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferToClientResponse) + return target; +} + +size_t TransferToClientResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferToClientResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *literal_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferToClientResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferToClientResponse) + GOOGLE_DCHECK_NE(&from, this); + const TransferToClientResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferToClientResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferToClientResponse) + MergeFrom(*source); + } +} + +void TransferToClientResponse::MergeFrom(const TransferToClientResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferToClientResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_literal()) { + mutable_literal()->::xla::LiteralProto::MergeFrom(from.literal()); + } +} + +void TransferToClientResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferToClientResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferToClientResponse::CopyFrom(const TransferToClientResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferToClientResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferToClientResponse::IsInitialized() const { + return true; +} + +void TransferToClientResponse::Swap(TransferToClientResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferToClientResponse::InternalSwap(TransferToClientResponse* other) { + using std::swap; + swap(literal_, other->literal_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferToClientResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferToServerRequest::InitAsDefaultInstance() { + ::xla::_TransferToServerRequest_default_instance_._instance.get_mutable()->literal_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); + ::xla::_TransferToServerRequest_default_instance_._instance.get_mutable()->device_handle_ = const_cast< ::xla::DeviceHandle*>( + ::xla::DeviceHandle::internal_default_instance()); +} +void TransferToServerRequest::clear_literal() { + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; +} +void TransferToServerRequest::clear_device_handle() { + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransferToServerRequest::kLiteralFieldNumber; +const int TransferToServerRequest::kDeviceHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferToServerRequest::TransferToServerRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToServerRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferToServerRequest) +} +TransferToServerRequest::TransferToServerRequest(const TransferToServerRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_literal()) { + literal_ = new ::xla::LiteralProto(*from.literal_); + } else { + literal_ = NULL; + } + if (from.has_device_handle()) { + device_handle_ = new ::xla::DeviceHandle(*from.device_handle_); + } else { + device_handle_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.TransferToServerRequest) +} + +void TransferToServerRequest::SharedCtor() { + ::memset(&literal_, 0, static_cast( + reinterpret_cast(&device_handle_) - + reinterpret_cast(&literal_)) + sizeof(device_handle_)); +} + +TransferToServerRequest::~TransferToServerRequest() { + // @@protoc_insertion_point(destructor:xla.TransferToServerRequest) + SharedDtor(); +} + +void TransferToServerRequest::SharedDtor() { + if (this != internal_default_instance()) delete literal_; + if (this != internal_default_instance()) delete device_handle_; +} + +void TransferToServerRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferToServerRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferToServerRequest& TransferToServerRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToServerRequest.base); + return *internal_default_instance(); +} + + +void TransferToServerRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferToServerRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; + _internal_metadata_.Clear(); +} + +bool TransferToServerRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferToServerRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.LiteralProto literal = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_literal())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DeviceHandle device_handle = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_device_handle())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferToServerRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferToServerRequest) + return false; +#undef DO_ +} + +void TransferToServerRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferToServerRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_literal(), output); + } + + // .xla.DeviceHandle device_handle = 2; + if (this->has_device_handle()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_device_handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferToServerRequest) +} + +::google::protobuf::uint8* TransferToServerRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferToServerRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_literal(), deterministic, target); + } + + // .xla.DeviceHandle device_handle = 2; + if (this->has_device_handle()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_device_handle(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferToServerRequest) + return target; +} + +size_t TransferToServerRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferToServerRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *literal_); + } + + // .xla.DeviceHandle device_handle = 2; + if (this->has_device_handle()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *device_handle_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferToServerRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferToServerRequest) + GOOGLE_DCHECK_NE(&from, this); + const TransferToServerRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferToServerRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferToServerRequest) + MergeFrom(*source); + } +} + +void TransferToServerRequest::MergeFrom(const TransferToServerRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferToServerRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_literal()) { + mutable_literal()->::xla::LiteralProto::MergeFrom(from.literal()); + } + if (from.has_device_handle()) { + mutable_device_handle()->::xla::DeviceHandle::MergeFrom(from.device_handle()); + } +} + +void TransferToServerRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferToServerRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferToServerRequest::CopyFrom(const TransferToServerRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferToServerRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferToServerRequest::IsInitialized() const { + return true; +} + +void TransferToServerRequest::Swap(TransferToServerRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferToServerRequest::InternalSwap(TransferToServerRequest* other) { + using std::swap; + swap(literal_, other->literal_); + swap(device_handle_, other->device_handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferToServerRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferToServerResponse::InitAsDefaultInstance() { + ::xla::_TransferToServerResponse_default_instance_._instance.get_mutable()->data_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); +} +void TransferToServerResponse::clear_data() { + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransferToServerResponse::kDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferToServerResponse::TransferToServerResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToServerResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferToServerResponse) +} +TransferToServerResponse::TransferToServerResponse(const TransferToServerResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_data()) { + data_ = new ::xla::GlobalDataHandle(*from.data_); + } else { + data_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.TransferToServerResponse) +} + +void TransferToServerResponse::SharedCtor() { + data_ = NULL; +} + +TransferToServerResponse::~TransferToServerResponse() { + // @@protoc_insertion_point(destructor:xla.TransferToServerResponse) + SharedDtor(); +} + +void TransferToServerResponse::SharedDtor() { + if (this != internal_default_instance()) delete data_; +} + +void TransferToServerResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferToServerResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferToServerResponse& TransferToServerResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToServerResponse.base); + return *internal_default_instance(); +} + + +void TransferToServerResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferToServerResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; + _internal_metadata_.Clear(); +} + +bool TransferToServerResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferToServerResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferToServerResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferToServerResponse) + return false; +#undef DO_ +} + +void TransferToServerResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferToServerResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_data(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferToServerResponse) +} + +::google::protobuf::uint8* TransferToServerResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferToServerResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_data(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferToServerResponse) + return target; +} + +size_t TransferToServerResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferToServerResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *data_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferToServerResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferToServerResponse) + GOOGLE_DCHECK_NE(&from, this); + const TransferToServerResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferToServerResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferToServerResponse) + MergeFrom(*source); + } +} + +void TransferToServerResponse::MergeFrom(const TransferToServerResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferToServerResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_data()) { + mutable_data()->::xla::GlobalDataHandle::MergeFrom(from.data()); + } +} + +void TransferToServerResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferToServerResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferToServerResponse::CopyFrom(const TransferToServerResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferToServerResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferToServerResponse::IsInitialized() const { + return true; +} + +void TransferToServerResponse::Swap(TransferToServerResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferToServerResponse::InternalSwap(TransferToServerResponse* other) { + using std::swap; + swap(data_, other->data_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferToServerResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferToInfeedRequest::InitAsDefaultInstance() { + ::xla::_TransferToInfeedRequest_default_instance_._instance.get_mutable()->literal_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); + ::xla::_TransferToInfeedRequest_default_instance_._instance.get_mutable()->device_handle_ = const_cast< ::xla::DeviceHandle*>( + ::xla::DeviceHandle::internal_default_instance()); +} +void TransferToInfeedRequest::clear_literal() { + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; +} +void TransferToInfeedRequest::clear_device_handle() { + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransferToInfeedRequest::kLiteralFieldNumber; +const int TransferToInfeedRequest::kReplicaIdFieldNumber; +const int TransferToInfeedRequest::kDeviceHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferToInfeedRequest::TransferToInfeedRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToInfeedRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferToInfeedRequest) +} +TransferToInfeedRequest::TransferToInfeedRequest(const TransferToInfeedRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_literal()) { + literal_ = new ::xla::LiteralProto(*from.literal_); + } else { + literal_ = NULL; + } + if (from.has_device_handle()) { + device_handle_ = new ::xla::DeviceHandle(*from.device_handle_); + } else { + device_handle_ = NULL; + } + replica_id_ = from.replica_id_; + // @@protoc_insertion_point(copy_constructor:xla.TransferToInfeedRequest) +} + +void TransferToInfeedRequest::SharedCtor() { + ::memset(&literal_, 0, static_cast( + reinterpret_cast(&replica_id_) - + reinterpret_cast(&literal_)) + sizeof(replica_id_)); +} + +TransferToInfeedRequest::~TransferToInfeedRequest() { + // @@protoc_insertion_point(destructor:xla.TransferToInfeedRequest) + SharedDtor(); +} + +void TransferToInfeedRequest::SharedDtor() { + if (this != internal_default_instance()) delete literal_; + if (this != internal_default_instance()) delete device_handle_; +} + +void TransferToInfeedRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferToInfeedRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferToInfeedRequest& TransferToInfeedRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToInfeedRequest.base); + return *internal_default_instance(); +} + + +void TransferToInfeedRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferToInfeedRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; + replica_id_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool TransferToInfeedRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferToInfeedRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.LiteralProto literal = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_literal())); + } else { + goto handle_unusual; + } + break; + } + + // int64 replica_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &replica_id_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DeviceHandle device_handle = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_device_handle())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferToInfeedRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferToInfeedRequest) + return false; +#undef DO_ +} + +void TransferToInfeedRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferToInfeedRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_literal(), output); + } + + // int64 replica_id = 2; + if (this->replica_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->replica_id(), output); + } + + // .xla.DeviceHandle device_handle = 3; + if (this->has_device_handle()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_device_handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferToInfeedRequest) +} + +::google::protobuf::uint8* TransferToInfeedRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferToInfeedRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_literal(), deterministic, target); + } + + // int64 replica_id = 2; + if (this->replica_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->replica_id(), target); + } + + // .xla.DeviceHandle device_handle = 3; + if (this->has_device_handle()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_device_handle(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferToInfeedRequest) + return target; +} + +size_t TransferToInfeedRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferToInfeedRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *literal_); + } + + // .xla.DeviceHandle device_handle = 3; + if (this->has_device_handle()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *device_handle_); + } + + // int64 replica_id = 2; + if (this->replica_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->replica_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferToInfeedRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferToInfeedRequest) + GOOGLE_DCHECK_NE(&from, this); + const TransferToInfeedRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferToInfeedRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferToInfeedRequest) + MergeFrom(*source); + } +} + +void TransferToInfeedRequest::MergeFrom(const TransferToInfeedRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferToInfeedRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_literal()) { + mutable_literal()->::xla::LiteralProto::MergeFrom(from.literal()); + } + if (from.has_device_handle()) { + mutable_device_handle()->::xla::DeviceHandle::MergeFrom(from.device_handle()); + } + if (from.replica_id() != 0) { + set_replica_id(from.replica_id()); + } +} + +void TransferToInfeedRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferToInfeedRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferToInfeedRequest::CopyFrom(const TransferToInfeedRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferToInfeedRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferToInfeedRequest::IsInitialized() const { + return true; +} + +void TransferToInfeedRequest::Swap(TransferToInfeedRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferToInfeedRequest::InternalSwap(TransferToInfeedRequest* other) { + using std::swap; + swap(literal_, other->literal_); + swap(device_handle_, other->device_handle_); + swap(replica_id_, other->replica_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferToInfeedRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferToInfeedResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferToInfeedResponse::TransferToInfeedResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToInfeedResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferToInfeedResponse) +} +TransferToInfeedResponse::TransferToInfeedResponse(const TransferToInfeedResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.TransferToInfeedResponse) +} + +void TransferToInfeedResponse::SharedCtor() { +} + +TransferToInfeedResponse::~TransferToInfeedResponse() { + // @@protoc_insertion_point(destructor:xla.TransferToInfeedResponse) + SharedDtor(); +} + +void TransferToInfeedResponse::SharedDtor() { +} + +void TransferToInfeedResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferToInfeedResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferToInfeedResponse& TransferToInfeedResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferToInfeedResponse.base); + return *internal_default_instance(); +} + + +void TransferToInfeedResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferToInfeedResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +bool TransferToInfeedResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferToInfeedResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferToInfeedResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferToInfeedResponse) + return false; +#undef DO_ +} + +void TransferToInfeedResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferToInfeedResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferToInfeedResponse) +} + +::google::protobuf::uint8* TransferToInfeedResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferToInfeedResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferToInfeedResponse) + return target; +} + +size_t TransferToInfeedResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferToInfeedResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferToInfeedResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferToInfeedResponse) + GOOGLE_DCHECK_NE(&from, this); + const TransferToInfeedResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferToInfeedResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferToInfeedResponse) + MergeFrom(*source); + } +} + +void TransferToInfeedResponse::MergeFrom(const TransferToInfeedResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferToInfeedResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void TransferToInfeedResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferToInfeedResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferToInfeedResponse::CopyFrom(const TransferToInfeedResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferToInfeedResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferToInfeedResponse::IsInitialized() const { + return true; +} + +void TransferToInfeedResponse::Swap(TransferToInfeedResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferToInfeedResponse::InternalSwap(TransferToInfeedResponse* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferToInfeedResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferFromOutfeedRequest::InitAsDefaultInstance() { + ::xla::_TransferFromOutfeedRequest_default_instance_._instance.get_mutable()->shape_with_layout_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); + ::xla::_TransferFromOutfeedRequest_default_instance_._instance.get_mutable()->device_handle_ = const_cast< ::xla::DeviceHandle*>( + ::xla::DeviceHandle::internal_default_instance()); +} +void TransferFromOutfeedRequest::clear_shape_with_layout() { + if (GetArenaNoVirtual() == NULL && shape_with_layout_ != NULL) { + delete shape_with_layout_; + } + shape_with_layout_ = NULL; +} +void TransferFromOutfeedRequest::clear_device_handle() { + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransferFromOutfeedRequest::kShapeWithLayoutFieldNumber; +const int TransferFromOutfeedRequest::kReplicaIdFieldNumber; +const int TransferFromOutfeedRequest::kDeviceHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferFromOutfeedRequest::TransferFromOutfeedRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferFromOutfeedRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferFromOutfeedRequest) +} +TransferFromOutfeedRequest::TransferFromOutfeedRequest(const TransferFromOutfeedRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape_with_layout()) { + shape_with_layout_ = new ::xla::ShapeProto(*from.shape_with_layout_); + } else { + shape_with_layout_ = NULL; + } + if (from.has_device_handle()) { + device_handle_ = new ::xla::DeviceHandle(*from.device_handle_); + } else { + device_handle_ = NULL; + } + replica_id_ = from.replica_id_; + // @@protoc_insertion_point(copy_constructor:xla.TransferFromOutfeedRequest) +} + +void TransferFromOutfeedRequest::SharedCtor() { + ::memset(&shape_with_layout_, 0, static_cast( + reinterpret_cast(&replica_id_) - + reinterpret_cast(&shape_with_layout_)) + sizeof(replica_id_)); +} + +TransferFromOutfeedRequest::~TransferFromOutfeedRequest() { + // @@protoc_insertion_point(destructor:xla.TransferFromOutfeedRequest) + SharedDtor(); +} + +void TransferFromOutfeedRequest::SharedDtor() { + if (this != internal_default_instance()) delete shape_with_layout_; + if (this != internal_default_instance()) delete device_handle_; +} + +void TransferFromOutfeedRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferFromOutfeedRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferFromOutfeedRequest& TransferFromOutfeedRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferFromOutfeedRequest.base); + return *internal_default_instance(); +} + + +void TransferFromOutfeedRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferFromOutfeedRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && shape_with_layout_ != NULL) { + delete shape_with_layout_; + } + shape_with_layout_ = NULL; + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; + replica_id_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool TransferFromOutfeedRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferFromOutfeedRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ShapeProto shape_with_layout = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape_with_layout())); + } else { + goto handle_unusual; + } + break; + } + + // int64 replica_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &replica_id_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DeviceHandle device_handle = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_device_handle())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferFromOutfeedRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferFromOutfeedRequest) + return false; +#undef DO_ +} + +void TransferFromOutfeedRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferFromOutfeedRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape_with_layout = 1; + if (this->has_shape_with_layout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_shape_with_layout(), output); + } + + // int64 replica_id = 2; + if (this->replica_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->replica_id(), output); + } + + // .xla.DeviceHandle device_handle = 3; + if (this->has_device_handle()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_device_handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferFromOutfeedRequest) +} + +::google::protobuf::uint8* TransferFromOutfeedRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferFromOutfeedRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape_with_layout = 1; + if (this->has_shape_with_layout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_shape_with_layout(), deterministic, target); + } + + // int64 replica_id = 2; + if (this->replica_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->replica_id(), target); + } + + // .xla.DeviceHandle device_handle = 3; + if (this->has_device_handle()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_device_handle(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferFromOutfeedRequest) + return target; +} + +size_t TransferFromOutfeedRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferFromOutfeedRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.ShapeProto shape_with_layout = 1; + if (this->has_shape_with_layout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_with_layout_); + } + + // .xla.DeviceHandle device_handle = 3; + if (this->has_device_handle()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *device_handle_); + } + + // int64 replica_id = 2; + if (this->replica_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->replica_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferFromOutfeedRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferFromOutfeedRequest) + GOOGLE_DCHECK_NE(&from, this); + const TransferFromOutfeedRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferFromOutfeedRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferFromOutfeedRequest) + MergeFrom(*source); + } +} + +void TransferFromOutfeedRequest::MergeFrom(const TransferFromOutfeedRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferFromOutfeedRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_shape_with_layout()) { + mutable_shape_with_layout()->::xla::ShapeProto::MergeFrom(from.shape_with_layout()); + } + if (from.has_device_handle()) { + mutable_device_handle()->::xla::DeviceHandle::MergeFrom(from.device_handle()); + } + if (from.replica_id() != 0) { + set_replica_id(from.replica_id()); + } +} + +void TransferFromOutfeedRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferFromOutfeedRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferFromOutfeedRequest::CopyFrom(const TransferFromOutfeedRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferFromOutfeedRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferFromOutfeedRequest::IsInitialized() const { + return true; +} + +void TransferFromOutfeedRequest::Swap(TransferFromOutfeedRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferFromOutfeedRequest::InternalSwap(TransferFromOutfeedRequest* other) { + using std::swap; + swap(shape_with_layout_, other->shape_with_layout_); + swap(device_handle_, other->device_handle_); + swap(replica_id_, other->replica_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferFromOutfeedRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TransferFromOutfeedResponse::InitAsDefaultInstance() { + ::xla::_TransferFromOutfeedResponse_default_instance_._instance.get_mutable()->literal_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); +} +void TransferFromOutfeedResponse::clear_literal() { + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransferFromOutfeedResponse::kLiteralFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransferFromOutfeedResponse::TransferFromOutfeedResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferFromOutfeedResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TransferFromOutfeedResponse) +} +TransferFromOutfeedResponse::TransferFromOutfeedResponse(const TransferFromOutfeedResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_literal()) { + literal_ = new ::xla::LiteralProto(*from.literal_); + } else { + literal_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.TransferFromOutfeedResponse) +} + +void TransferFromOutfeedResponse::SharedCtor() { + literal_ = NULL; +} + +TransferFromOutfeedResponse::~TransferFromOutfeedResponse() { + // @@protoc_insertion_point(destructor:xla.TransferFromOutfeedResponse) + SharedDtor(); +} + +void TransferFromOutfeedResponse::SharedDtor() { + if (this != internal_default_instance()) delete literal_; +} + +void TransferFromOutfeedResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TransferFromOutfeedResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TransferFromOutfeedResponse& TransferFromOutfeedResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_TransferFromOutfeedResponse.base); + return *internal_default_instance(); +} + + +void TransferFromOutfeedResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TransferFromOutfeedResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; + _internal_metadata_.Clear(); +} + +bool TransferFromOutfeedResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TransferFromOutfeedResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.LiteralProto literal = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_literal())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TransferFromOutfeedResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TransferFromOutfeedResponse) + return false; +#undef DO_ +} + +void TransferFromOutfeedResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TransferFromOutfeedResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_literal(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TransferFromOutfeedResponse) +} + +::google::protobuf::uint8* TransferFromOutfeedResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TransferFromOutfeedResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_literal(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TransferFromOutfeedResponse) + return target; +} + +size_t TransferFromOutfeedResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TransferFromOutfeedResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *literal_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TransferFromOutfeedResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TransferFromOutfeedResponse) + GOOGLE_DCHECK_NE(&from, this); + const TransferFromOutfeedResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TransferFromOutfeedResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TransferFromOutfeedResponse) + MergeFrom(*source); + } +} + +void TransferFromOutfeedResponse::MergeFrom(const TransferFromOutfeedResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TransferFromOutfeedResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_literal()) { + mutable_literal()->::xla::LiteralProto::MergeFrom(from.literal()); + } +} + +void TransferFromOutfeedResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TransferFromOutfeedResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransferFromOutfeedResponse::CopyFrom(const TransferFromOutfeedResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TransferFromOutfeedResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransferFromOutfeedResponse::IsInitialized() const { + return true; +} + +void TransferFromOutfeedResponse::Swap(TransferFromOutfeedResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void TransferFromOutfeedResponse::InternalSwap(TransferFromOutfeedResponse* other) { + using std::swap; + swap(literal_, other->literal_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TransferFromOutfeedResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ResetDeviceRequest::InitAsDefaultInstance() { + ::xla::_ResetDeviceRequest_default_instance_._instance.get_mutable()->device_handle_ = const_cast< ::xla::DeviceHandle*>( + ::xla::DeviceHandle::internal_default_instance()); +} +void ResetDeviceRequest::clear_device_handle() { + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ResetDeviceRequest::kDeviceHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ResetDeviceRequest::ResetDeviceRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ResetDeviceRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ResetDeviceRequest) +} +ResetDeviceRequest::ResetDeviceRequest(const ResetDeviceRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_device_handle()) { + device_handle_ = new ::xla::DeviceHandle(*from.device_handle_); + } else { + device_handle_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ResetDeviceRequest) +} + +void ResetDeviceRequest::SharedCtor() { + device_handle_ = NULL; +} + +ResetDeviceRequest::~ResetDeviceRequest() { + // @@protoc_insertion_point(destructor:xla.ResetDeviceRequest) + SharedDtor(); +} + +void ResetDeviceRequest::SharedDtor() { + if (this != internal_default_instance()) delete device_handle_; +} + +void ResetDeviceRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ResetDeviceRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ResetDeviceRequest& ResetDeviceRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ResetDeviceRequest.base); + return *internal_default_instance(); +} + + +void ResetDeviceRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ResetDeviceRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && device_handle_ != NULL) { + delete device_handle_; + } + device_handle_ = NULL; + _internal_metadata_.Clear(); +} + +bool ResetDeviceRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ResetDeviceRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.DeviceHandle device_handle = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_device_handle())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ResetDeviceRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ResetDeviceRequest) + return false; +#undef DO_ +} + +void ResetDeviceRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ResetDeviceRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.DeviceHandle device_handle = 1; + if (this->has_device_handle()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_device_handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ResetDeviceRequest) +} + +::google::protobuf::uint8* ResetDeviceRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ResetDeviceRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.DeviceHandle device_handle = 1; + if (this->has_device_handle()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_device_handle(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ResetDeviceRequest) + return target; +} + +size_t ResetDeviceRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ResetDeviceRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.DeviceHandle device_handle = 1; + if (this->has_device_handle()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *device_handle_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ResetDeviceRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ResetDeviceRequest) + GOOGLE_DCHECK_NE(&from, this); + const ResetDeviceRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ResetDeviceRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ResetDeviceRequest) + MergeFrom(*source); + } +} + +void ResetDeviceRequest::MergeFrom(const ResetDeviceRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ResetDeviceRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_device_handle()) { + mutable_device_handle()->::xla::DeviceHandle::MergeFrom(from.device_handle()); + } +} + +void ResetDeviceRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ResetDeviceRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ResetDeviceRequest::CopyFrom(const ResetDeviceRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ResetDeviceRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ResetDeviceRequest::IsInitialized() const { + return true; +} + +void ResetDeviceRequest::Swap(ResetDeviceRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ResetDeviceRequest::InternalSwap(ResetDeviceRequest* other) { + using std::swap; + swap(device_handle_, other->device_handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ResetDeviceRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ResetDeviceResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ResetDeviceResponse::ResetDeviceResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ResetDeviceResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ResetDeviceResponse) +} +ResetDeviceResponse::ResetDeviceResponse(const ResetDeviceResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.ResetDeviceResponse) +} + +void ResetDeviceResponse::SharedCtor() { +} + +ResetDeviceResponse::~ResetDeviceResponse() { + // @@protoc_insertion_point(destructor:xla.ResetDeviceResponse) + SharedDtor(); +} + +void ResetDeviceResponse::SharedDtor() { +} + +void ResetDeviceResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ResetDeviceResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ResetDeviceResponse& ResetDeviceResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ResetDeviceResponse.base); + return *internal_default_instance(); +} + + +void ResetDeviceResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ResetDeviceResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +bool ResetDeviceResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ResetDeviceResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:xla.ResetDeviceResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ResetDeviceResponse) + return false; +#undef DO_ +} + +void ResetDeviceResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ResetDeviceResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ResetDeviceResponse) +} + +::google::protobuf::uint8* ResetDeviceResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ResetDeviceResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ResetDeviceResponse) + return target; +} + +size_t ResetDeviceResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ResetDeviceResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ResetDeviceResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ResetDeviceResponse) + GOOGLE_DCHECK_NE(&from, this); + const ResetDeviceResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ResetDeviceResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ResetDeviceResponse) + MergeFrom(*source); + } +} + +void ResetDeviceResponse::MergeFrom(const ResetDeviceResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ResetDeviceResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void ResetDeviceResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ResetDeviceResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ResetDeviceResponse::CopyFrom(const ResetDeviceResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ResetDeviceResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ResetDeviceResponse::IsInitialized() const { + return true; +} + +void ResetDeviceResponse::Swap(ResetDeviceResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ResetDeviceResponse::InternalSwap(ResetDeviceResponse* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ResetDeviceResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ComputationGraphStatsRequest::InitAsDefaultInstance() { + ::xla::_ComputationGraphStatsRequest_default_instance_._instance.get_mutable()->computation_ = const_cast< ::xla::HloModuleProto*>( + ::xla::HloModuleProto::internal_default_instance()); + ::xla::_ComputationGraphStatsRequest_default_instance_._instance.get_mutable()->debug_options_ = const_cast< ::xla::DebugOptions*>( + ::xla::DebugOptions::internal_default_instance()); +} +void ComputationGraphStatsRequest::clear_computation() { + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ComputationGraphStatsRequest::kComputationFieldNumber; +const int ComputationGraphStatsRequest::kDebugOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ComputationGraphStatsRequest::ComputationGraphStatsRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputationGraphStatsRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ComputationGraphStatsRequest) +} +ComputationGraphStatsRequest::ComputationGraphStatsRequest(const ComputationGraphStatsRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_computation()) { + computation_ = new ::xla::HloModuleProto(*from.computation_); + } else { + computation_ = NULL; + } + if (from.has_debug_options()) { + debug_options_ = new ::xla::DebugOptions(*from.debug_options_); + } else { + debug_options_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ComputationGraphStatsRequest) +} + +void ComputationGraphStatsRequest::SharedCtor() { + ::memset(&computation_, 0, static_cast( + reinterpret_cast(&debug_options_) - + reinterpret_cast(&computation_)) + sizeof(debug_options_)); +} + +ComputationGraphStatsRequest::~ComputationGraphStatsRequest() { + // @@protoc_insertion_point(destructor:xla.ComputationGraphStatsRequest) + SharedDtor(); +} + +void ComputationGraphStatsRequest::SharedDtor() { + if (this != internal_default_instance()) delete computation_; + if (this != internal_default_instance()) delete debug_options_; +} + +void ComputationGraphStatsRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ComputationGraphStatsRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ComputationGraphStatsRequest& ComputationGraphStatsRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputationGraphStatsRequest.base); + return *internal_default_instance(); +} + + +void ComputationGraphStatsRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ComputationGraphStatsRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; + if (GetArenaNoVirtual() == NULL && debug_options_ != NULL) { + delete debug_options_; + } + debug_options_ = NULL; + _internal_metadata_.Clear(); +} + +bool ComputationGraphStatsRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ComputationGraphStatsRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HloModuleProto computation = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_computation())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DebugOptions debug_options = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_debug_options())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ComputationGraphStatsRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ComputationGraphStatsRequest) + return false; +#undef DO_ +} + +void ComputationGraphStatsRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ComputationGraphStatsRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_computation(), output); + } + + // .xla.DebugOptions debug_options = 2; + if (this->has_debug_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_debug_options(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ComputationGraphStatsRequest) +} + +::google::protobuf::uint8* ComputationGraphStatsRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ComputationGraphStatsRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_computation(), deterministic, target); + } + + // .xla.DebugOptions debug_options = 2; + if (this->has_debug_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_debug_options(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ComputationGraphStatsRequest) + return target; +} + +size_t ComputationGraphStatsRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ComputationGraphStatsRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *computation_); + } + + // .xla.DebugOptions debug_options = 2; + if (this->has_debug_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *debug_options_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ComputationGraphStatsRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ComputationGraphStatsRequest) + GOOGLE_DCHECK_NE(&from, this); + const ComputationGraphStatsRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ComputationGraphStatsRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ComputationGraphStatsRequest) + MergeFrom(*source); + } +} + +void ComputationGraphStatsRequest::MergeFrom(const ComputationGraphStatsRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ComputationGraphStatsRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_computation()) { + mutable_computation()->::xla::HloModuleProto::MergeFrom(from.computation()); + } + if (from.has_debug_options()) { + mutable_debug_options()->::xla::DebugOptions::MergeFrom(from.debug_options()); + } +} + +void ComputationGraphStatsRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ComputationGraphStatsRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ComputationGraphStatsRequest::CopyFrom(const ComputationGraphStatsRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ComputationGraphStatsRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ComputationGraphStatsRequest::IsInitialized() const { + return true; +} + +void ComputationGraphStatsRequest::Swap(ComputationGraphStatsRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ComputationGraphStatsRequest::InternalSwap(ComputationGraphStatsRequest* other) { + using std::swap; + swap(computation_, other->computation_); + swap(debug_options_, other->debug_options_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ComputationGraphStatsRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ComputationStatsResponse::InitAsDefaultInstance() { + ::xla::_ComputationStatsResponse_default_instance_._instance.get_mutable()->stats_ = const_cast< ::xla::ComputationStats*>( + ::xla::ComputationStats::internal_default_instance()); +} +void ComputationStatsResponse::clear_stats() { + if (GetArenaNoVirtual() == NULL && stats_ != NULL) { + delete stats_; + } + stats_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ComputationStatsResponse::kStatsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ComputationStatsResponse::ComputationStatsResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputationStatsResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ComputationStatsResponse) +} +ComputationStatsResponse::ComputationStatsResponse(const ComputationStatsResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_stats()) { + stats_ = new ::xla::ComputationStats(*from.stats_); + } else { + stats_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ComputationStatsResponse) +} + +void ComputationStatsResponse::SharedCtor() { + stats_ = NULL; +} + +ComputationStatsResponse::~ComputationStatsResponse() { + // @@protoc_insertion_point(destructor:xla.ComputationStatsResponse) + SharedDtor(); +} + +void ComputationStatsResponse::SharedDtor() { + if (this != internal_default_instance()) delete stats_; +} + +void ComputationStatsResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ComputationStatsResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ComputationStatsResponse& ComputationStatsResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputationStatsResponse.base); + return *internal_default_instance(); +} + + +void ComputationStatsResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ComputationStatsResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && stats_ != NULL) { + delete stats_; + } + stats_ = NULL; + _internal_metadata_.Clear(); +} + +bool ComputationStatsResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ComputationStatsResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ComputationStats stats = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_stats())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ComputationStatsResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ComputationStatsResponse) + return false; +#undef DO_ +} + +void ComputationStatsResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ComputationStatsResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ComputationStats stats = 1; + if (this->has_stats()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_stats(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ComputationStatsResponse) +} + +::google::protobuf::uint8* ComputationStatsResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ComputationStatsResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ComputationStats stats = 1; + if (this->has_stats()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_stats(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ComputationStatsResponse) + return target; +} + +size_t ComputationStatsResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ComputationStatsResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.ComputationStats stats = 1; + if (this->has_stats()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *stats_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ComputationStatsResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ComputationStatsResponse) + GOOGLE_DCHECK_NE(&from, this); + const ComputationStatsResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ComputationStatsResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ComputationStatsResponse) + MergeFrom(*source); + } +} + +void ComputationStatsResponse::MergeFrom(const ComputationStatsResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ComputationStatsResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_stats()) { + mutable_stats()->::xla::ComputationStats::MergeFrom(from.stats()); + } +} + +void ComputationStatsResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ComputationStatsResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ComputationStatsResponse::CopyFrom(const ComputationStatsResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ComputationStatsResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ComputationStatsResponse::IsInitialized() const { + return true; +} + +void ComputationStatsResponse::Swap(ComputationStatsResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ComputationStatsResponse::InternalSwap(ComputationStatsResponse* other) { + using std::swap; + swap(stats_, other->stats_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ComputationStatsResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CreateChannelHandleRequest::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CreateChannelHandleRequest::kChannelTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CreateChannelHandleRequest::CreateChannelHandleRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CreateChannelHandleRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.CreateChannelHandleRequest) +} +CreateChannelHandleRequest::CreateChannelHandleRequest(const CreateChannelHandleRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + channel_type_ = from.channel_type_; + // @@protoc_insertion_point(copy_constructor:xla.CreateChannelHandleRequest) +} + +void CreateChannelHandleRequest::SharedCtor() { + channel_type_ = 0; +} + +CreateChannelHandleRequest::~CreateChannelHandleRequest() { + // @@protoc_insertion_point(destructor:xla.CreateChannelHandleRequest) + SharedDtor(); +} + +void CreateChannelHandleRequest::SharedDtor() { +} + +void CreateChannelHandleRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CreateChannelHandleRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CreateChannelHandleRequest& CreateChannelHandleRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CreateChannelHandleRequest.base); + return *internal_default_instance(); +} + + +void CreateChannelHandleRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.CreateChannelHandleRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + channel_type_ = 0; + _internal_metadata_.Clear(); +} + +bool CreateChannelHandleRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.CreateChannelHandleRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ChannelHandle.ChannelType channel_type = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_channel_type(static_cast< ::xla::ChannelHandle_ChannelType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.CreateChannelHandleRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.CreateChannelHandleRequest) + return false; +#undef DO_ +} + +void CreateChannelHandleRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.CreateChannelHandleRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ChannelHandle.ChannelType channel_type = 1; + if (this->channel_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->channel_type(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.CreateChannelHandleRequest) +} + +::google::protobuf::uint8* CreateChannelHandleRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.CreateChannelHandleRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ChannelHandle.ChannelType channel_type = 1; + if (this->channel_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->channel_type(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.CreateChannelHandleRequest) + return target; +} + +size_t CreateChannelHandleRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.CreateChannelHandleRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.ChannelHandle.ChannelType channel_type = 1; + if (this->channel_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->channel_type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CreateChannelHandleRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.CreateChannelHandleRequest) + GOOGLE_DCHECK_NE(&from, this); + const CreateChannelHandleRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.CreateChannelHandleRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.CreateChannelHandleRequest) + MergeFrom(*source); + } +} + +void CreateChannelHandleRequest::MergeFrom(const CreateChannelHandleRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.CreateChannelHandleRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.channel_type() != 0) { + set_channel_type(from.channel_type()); + } +} + +void CreateChannelHandleRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.CreateChannelHandleRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CreateChannelHandleRequest::CopyFrom(const CreateChannelHandleRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.CreateChannelHandleRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CreateChannelHandleRequest::IsInitialized() const { + return true; +} + +void CreateChannelHandleRequest::Swap(CreateChannelHandleRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void CreateChannelHandleRequest::InternalSwap(CreateChannelHandleRequest* other) { + using std::swap; + swap(channel_type_, other->channel_type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CreateChannelHandleRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CreateChannelHandleResponse::InitAsDefaultInstance() { + ::xla::_CreateChannelHandleResponse_default_instance_._instance.get_mutable()->channel_ = const_cast< ::xla::ChannelHandle*>( + ::xla::ChannelHandle::internal_default_instance()); +} +void CreateChannelHandleResponse::clear_channel() { + if (GetArenaNoVirtual() == NULL && channel_ != NULL) { + delete channel_; + } + channel_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CreateChannelHandleResponse::kChannelFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CreateChannelHandleResponse::CreateChannelHandleResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CreateChannelHandleResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.CreateChannelHandleResponse) +} +CreateChannelHandleResponse::CreateChannelHandleResponse(const CreateChannelHandleResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_channel()) { + channel_ = new ::xla::ChannelHandle(*from.channel_); + } else { + channel_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.CreateChannelHandleResponse) +} + +void CreateChannelHandleResponse::SharedCtor() { + channel_ = NULL; +} + +CreateChannelHandleResponse::~CreateChannelHandleResponse() { + // @@protoc_insertion_point(destructor:xla.CreateChannelHandleResponse) + SharedDtor(); +} + +void CreateChannelHandleResponse::SharedDtor() { + if (this != internal_default_instance()) delete channel_; +} + +void CreateChannelHandleResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CreateChannelHandleResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CreateChannelHandleResponse& CreateChannelHandleResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CreateChannelHandleResponse.base); + return *internal_default_instance(); +} + + +void CreateChannelHandleResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.CreateChannelHandleResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && channel_ != NULL) { + delete channel_; + } + channel_ = NULL; + _internal_metadata_.Clear(); +} + +bool CreateChannelHandleResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.CreateChannelHandleResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ChannelHandle channel = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_channel())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.CreateChannelHandleResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.CreateChannelHandleResponse) + return false; +#undef DO_ +} + +void CreateChannelHandleResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.CreateChannelHandleResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ChannelHandle channel = 1; + if (this->has_channel()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_channel(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.CreateChannelHandleResponse) +} + +::google::protobuf::uint8* CreateChannelHandleResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.CreateChannelHandleResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ChannelHandle channel = 1; + if (this->has_channel()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_channel(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.CreateChannelHandleResponse) + return target; +} + +size_t CreateChannelHandleResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.CreateChannelHandleResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.ChannelHandle channel = 1; + if (this->has_channel()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *channel_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CreateChannelHandleResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.CreateChannelHandleResponse) + GOOGLE_DCHECK_NE(&from, this); + const CreateChannelHandleResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.CreateChannelHandleResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.CreateChannelHandleResponse) + MergeFrom(*source); + } +} + +void CreateChannelHandleResponse::MergeFrom(const CreateChannelHandleResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.CreateChannelHandleResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_channel()) { + mutable_channel()->::xla::ChannelHandle::MergeFrom(from.channel()); + } +} + +void CreateChannelHandleResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.CreateChannelHandleResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CreateChannelHandleResponse::CopyFrom(const CreateChannelHandleResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.CreateChannelHandleResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CreateChannelHandleResponse::IsInitialized() const { + return true; +} + +void CreateChannelHandleResponse::Swap(CreateChannelHandleResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void CreateChannelHandleResponse::InternalSwap(CreateChannelHandleResponse* other) { + using std::swap; + swap(channel_, other->channel_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CreateChannelHandleResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void UnregisterRequest::InitAsDefaultInstance() { +} +void UnregisterRequest::clear_data() { + data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int UnregisterRequest::kDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +UnregisterRequest::UnregisterRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnregisterRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.UnregisterRequest) +} +UnregisterRequest::UnregisterRequest(const UnregisterRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + data_(from.data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.UnregisterRequest) +} + +void UnregisterRequest::SharedCtor() { +} + +UnregisterRequest::~UnregisterRequest() { + // @@protoc_insertion_point(destructor:xla.UnregisterRequest) + SharedDtor(); +} + +void UnregisterRequest::SharedDtor() { +} + +void UnregisterRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* UnregisterRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const UnregisterRequest& UnregisterRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnregisterRequest.base); + return *internal_default_instance(); +} + + +void UnregisterRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.UnregisterRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + data_.Clear(); + _internal_metadata_.Clear(); +} + +bool UnregisterRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.UnregisterRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.GlobalDataHandle data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.UnregisterRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.UnregisterRequest) + return false; +#undef DO_ +} + +void UnregisterRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.UnregisterRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.GlobalDataHandle data = 1; + for (unsigned int i = 0, + n = static_cast(this->data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.UnregisterRequest) +} + +::google::protobuf::uint8* UnregisterRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.UnregisterRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.GlobalDataHandle data = 1; + for (unsigned int i = 0, + n = static_cast(this->data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.UnregisterRequest) + return target; +} + +size_t UnregisterRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.UnregisterRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.GlobalDataHandle data = 1; + { + unsigned int count = static_cast(this->data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->data(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void UnregisterRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.UnregisterRequest) + GOOGLE_DCHECK_NE(&from, this); + const UnregisterRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.UnregisterRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.UnregisterRequest) + MergeFrom(*source); + } +} + +void UnregisterRequest::MergeFrom(const UnregisterRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.UnregisterRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + data_.MergeFrom(from.data_); +} + +void UnregisterRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.UnregisterRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void UnregisterRequest::CopyFrom(const UnregisterRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.UnregisterRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool UnregisterRequest::IsInitialized() const { + return true; +} + +void UnregisterRequest::Swap(UnregisterRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void UnregisterRequest::InternalSwap(UnregisterRequest* other) { + using std::swap; + CastToBase(&data_)->InternalSwap(CastToBase(&other->data_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata UnregisterRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void UnregisterResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +UnregisterResponse::UnregisterResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnregisterResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.UnregisterResponse) +} +UnregisterResponse::UnregisterResponse(const UnregisterResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.UnregisterResponse) +} + +void UnregisterResponse::SharedCtor() { +} + +UnregisterResponse::~UnregisterResponse() { + // @@protoc_insertion_point(destructor:xla.UnregisterResponse) + SharedDtor(); +} + +void UnregisterResponse::SharedDtor() { +} + +void UnregisterResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* UnregisterResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const UnregisterResponse& UnregisterResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnregisterResponse.base); + return *internal_default_instance(); +} + + +void UnregisterResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.UnregisterResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +bool UnregisterResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.UnregisterResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:xla.UnregisterResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.UnregisterResponse) + return false; +#undef DO_ +} + +void UnregisterResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.UnregisterResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.UnregisterResponse) +} + +::google::protobuf::uint8* UnregisterResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.UnregisterResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.UnregisterResponse) + return target; +} + +size_t UnregisterResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.UnregisterResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void UnregisterResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.UnregisterResponse) + GOOGLE_DCHECK_NE(&from, this); + const UnregisterResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.UnregisterResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.UnregisterResponse) + MergeFrom(*source); + } +} + +void UnregisterResponse::MergeFrom(const UnregisterResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.UnregisterResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void UnregisterResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.UnregisterResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void UnregisterResponse::CopyFrom(const UnregisterResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.UnregisterResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool UnregisterResponse::IsInitialized() const { + return true; +} + +void UnregisterResponse::Swap(UnregisterResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void UnregisterResponse::InternalSwap(UnregisterResponse* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata UnregisterResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CompileRequest::InitAsDefaultInstance() { + ::xla::_CompileRequest_default_instance_._instance.get_mutable()->computation_ = const_cast< ::xla::HloModuleProto*>( + ::xla::HloModuleProto::internal_default_instance()); + ::xla::_CompileRequest_default_instance_._instance.get_mutable()->execution_options_ = const_cast< ::xla::ExecutionOptions*>( + ::xla::ExecutionOptions::internal_default_instance()); +} +void CompileRequest::clear_computation() { + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; +} +void CompileRequest::clear_input_shape_with_layout() { + input_shape_with_layout_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CompileRequest::kComputationFieldNumber; +const int CompileRequest::kExecutionOptionsFieldNumber; +const int CompileRequest::kInputShapeWithLayoutFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CompileRequest::CompileRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CompileRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.CompileRequest) +} +CompileRequest::CompileRequest(const CompileRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + input_shape_with_layout_(from.input_shape_with_layout_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_computation()) { + computation_ = new ::xla::HloModuleProto(*from.computation_); + } else { + computation_ = NULL; + } + if (from.has_execution_options()) { + execution_options_ = new ::xla::ExecutionOptions(*from.execution_options_); + } else { + execution_options_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.CompileRequest) +} + +void CompileRequest::SharedCtor() { + ::memset(&computation_, 0, static_cast( + reinterpret_cast(&execution_options_) - + reinterpret_cast(&computation_)) + sizeof(execution_options_)); +} + +CompileRequest::~CompileRequest() { + // @@protoc_insertion_point(destructor:xla.CompileRequest) + SharedDtor(); +} + +void CompileRequest::SharedDtor() { + if (this != internal_default_instance()) delete computation_; + if (this != internal_default_instance()) delete execution_options_; +} + +void CompileRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CompileRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CompileRequest& CompileRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CompileRequest.base); + return *internal_default_instance(); +} + + +void CompileRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.CompileRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + input_shape_with_layout_.Clear(); + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; + if (GetArenaNoVirtual() == NULL && execution_options_ != NULL) { + delete execution_options_; + } + execution_options_ = NULL; + _internal_metadata_.Clear(); +} + +bool CompileRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.CompileRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HloModuleProto computation = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_computation())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ExecutionOptions execution_options = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_execution_options())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.ShapeProto input_shape_with_layout = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_input_shape_with_layout())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.CompileRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.CompileRequest) + return false; +#undef DO_ +} + +void CompileRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.CompileRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_computation(), output); + } + + // .xla.ExecutionOptions execution_options = 2; + if (this->has_execution_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_execution_options(), output); + } + + // repeated .xla.ShapeProto input_shape_with_layout = 3; + for (unsigned int i = 0, + n = static_cast(this->input_shape_with_layout_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->input_shape_with_layout(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.CompileRequest) +} + +::google::protobuf::uint8* CompileRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.CompileRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_computation(), deterministic, target); + } + + // .xla.ExecutionOptions execution_options = 2; + if (this->has_execution_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_execution_options(), deterministic, target); + } + + // repeated .xla.ShapeProto input_shape_with_layout = 3; + for (unsigned int i = 0, + n = static_cast(this->input_shape_with_layout_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->input_shape_with_layout(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.CompileRequest) + return target; +} + +size_t CompileRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.CompileRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.ShapeProto input_shape_with_layout = 3; + { + unsigned int count = static_cast(this->input_shape_with_layout_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->input_shape_with_layout(static_cast(i))); + } + } + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *computation_); + } + + // .xla.ExecutionOptions execution_options = 2; + if (this->has_execution_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *execution_options_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CompileRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.CompileRequest) + GOOGLE_DCHECK_NE(&from, this); + const CompileRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.CompileRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.CompileRequest) + MergeFrom(*source); + } +} + +void CompileRequest::MergeFrom(const CompileRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.CompileRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + input_shape_with_layout_.MergeFrom(from.input_shape_with_layout_); + if (from.has_computation()) { + mutable_computation()->::xla::HloModuleProto::MergeFrom(from.computation()); + } + if (from.has_execution_options()) { + mutable_execution_options()->::xla::ExecutionOptions::MergeFrom(from.execution_options()); + } +} + +void CompileRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.CompileRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CompileRequest::CopyFrom(const CompileRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.CompileRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CompileRequest::IsInitialized() const { + return true; +} + +void CompileRequest::Swap(CompileRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void CompileRequest::InternalSwap(CompileRequest* other) { + using std::swap; + CastToBase(&input_shape_with_layout_)->InternalSwap(CastToBase(&other->input_shape_with_layout_)); + swap(computation_, other->computation_); + swap(execution_options_, other->execution_options_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CompileRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CompileResponse::InitAsDefaultInstance() { + ::xla::_CompileResponse_default_instance_._instance.get_mutable()->handle_ = const_cast< ::xla::ExecutionHandle*>( + ::xla::ExecutionHandle::internal_default_instance()); +} +void CompileResponse::clear_handle() { + if (GetArenaNoVirtual() == NULL && handle_ != NULL) { + delete handle_; + } + handle_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CompileResponse::kHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CompileResponse::CompileResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CompileResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.CompileResponse) +} +CompileResponse::CompileResponse(const CompileResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_handle()) { + handle_ = new ::xla::ExecutionHandle(*from.handle_); + } else { + handle_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.CompileResponse) +} + +void CompileResponse::SharedCtor() { + handle_ = NULL; +} + +CompileResponse::~CompileResponse() { + // @@protoc_insertion_point(destructor:xla.CompileResponse) + SharedDtor(); +} + +void CompileResponse::SharedDtor() { + if (this != internal_default_instance()) delete handle_; +} + +void CompileResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CompileResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CompileResponse& CompileResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_CompileResponse.base); + return *internal_default_instance(); +} + + +void CompileResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.CompileResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && handle_ != NULL) { + delete handle_; + } + handle_ = NULL; + _internal_metadata_.Clear(); +} + +bool CompileResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.CompileResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ExecutionHandle handle = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_handle())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.CompileResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.CompileResponse) + return false; +#undef DO_ +} + +void CompileResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.CompileResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ExecutionHandle handle = 1; + if (this->has_handle()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.CompileResponse) +} + +::google::protobuf::uint8* CompileResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.CompileResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ExecutionHandle handle = 1; + if (this->has_handle()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_handle(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.CompileResponse) + return target; +} + +size_t CompileResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.CompileResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.ExecutionHandle handle = 1; + if (this->has_handle()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *handle_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CompileResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.CompileResponse) + GOOGLE_DCHECK_NE(&from, this); + const CompileResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.CompileResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.CompileResponse) + MergeFrom(*source); + } +} + +void CompileResponse::MergeFrom(const CompileResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.CompileResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_handle()) { + mutable_handle()->::xla::ExecutionHandle::MergeFrom(from.handle()); + } +} + +void CompileResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.CompileResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CompileResponse::CopyFrom(const CompileResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.CompileResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CompileResponse::IsInitialized() const { + return true; +} + +void CompileResponse::Swap(CompileResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void CompileResponse::InternalSwap(CompileResponse* other) { + using std::swap; + swap(handle_, other->handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CompileResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecuteRequest::InitAsDefaultInstance() { + ::xla::_ExecuteRequest_default_instance_._instance.get_mutable()->handle_ = const_cast< ::xla::ExecutionHandle*>( + ::xla::ExecutionHandle::internal_default_instance()); +} +void ExecuteRequest::clear_handle() { + if (GetArenaNoVirtual() == NULL && handle_ != NULL) { + delete handle_; + } + handle_ = NULL; +} +void ExecuteRequest::clear_arguments() { + arguments_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecuteRequest::kHandleFieldNumber; +const int ExecuteRequest::kArgumentsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecuteRequest::ExecuteRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecuteRequest) +} +ExecuteRequest::ExecuteRequest(const ExecuteRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + arguments_(from.arguments_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_handle()) { + handle_ = new ::xla::ExecutionHandle(*from.handle_); + } else { + handle_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ExecuteRequest) +} + +void ExecuteRequest::SharedCtor() { + handle_ = NULL; +} + +ExecuteRequest::~ExecuteRequest() { + // @@protoc_insertion_point(destructor:xla.ExecuteRequest) + SharedDtor(); +} + +void ExecuteRequest::SharedDtor() { + if (this != internal_default_instance()) delete handle_; +} + +void ExecuteRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecuteRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecuteRequest& ExecuteRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteRequest.base); + return *internal_default_instance(); +} + + +void ExecuteRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecuteRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + arguments_.Clear(); + if (GetArenaNoVirtual() == NULL && handle_ != NULL) { + delete handle_; + } + handle_ = NULL; + _internal_metadata_.Clear(); +} + +bool ExecuteRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecuteRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ExecutionHandle handle = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_handle())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.GlobalDataHandle arguments = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_arguments())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecuteRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecuteRequest) + return false; +#undef DO_ +} + +void ExecuteRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecuteRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ExecutionHandle handle = 1; + if (this->has_handle()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_handle(), output); + } + + // repeated .xla.GlobalDataHandle arguments = 2; + for (unsigned int i = 0, + n = static_cast(this->arguments_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->arguments(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecuteRequest) +} + +::google::protobuf::uint8* ExecuteRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecuteRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ExecutionHandle handle = 1; + if (this->has_handle()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_handle(), deterministic, target); + } + + // repeated .xla.GlobalDataHandle arguments = 2; + for (unsigned int i = 0, + n = static_cast(this->arguments_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->arguments(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecuteRequest) + return target; +} + +size_t ExecuteRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecuteRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.GlobalDataHandle arguments = 2; + { + unsigned int count = static_cast(this->arguments_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->arguments(static_cast(i))); + } + } + + // .xla.ExecutionHandle handle = 1; + if (this->has_handle()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *handle_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecuteRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecuteRequest) + GOOGLE_DCHECK_NE(&from, this); + const ExecuteRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecuteRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecuteRequest) + MergeFrom(*source); + } +} + +void ExecuteRequest::MergeFrom(const ExecuteRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecuteRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + arguments_.MergeFrom(from.arguments_); + if (from.has_handle()) { + mutable_handle()->::xla::ExecutionHandle::MergeFrom(from.handle()); + } +} + +void ExecuteRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecuteRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecuteRequest::CopyFrom(const ExecuteRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecuteRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecuteRequest::IsInitialized() const { + return true; +} + +void ExecuteRequest::Swap(ExecuteRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ExecuteRequest::InternalSwap(ExecuteRequest* other) { + using std::swap; + CastToBase(&arguments_)->InternalSwap(CastToBase(&other->arguments_)); + swap(handle_, other->handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecuteRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecuteGraphRequest::InitAsDefaultInstance() { + ::xla::_ExecuteGraphRequest_default_instance_._instance.get_mutable()->computation_ = const_cast< ::xla::HloModuleProto*>( + ::xla::HloModuleProto::internal_default_instance()); + ::xla::_ExecuteGraphRequest_default_instance_._instance.get_mutable()->execution_options_ = const_cast< ::xla::ExecutionOptions*>( + ::xla::ExecutionOptions::internal_default_instance()); +} +void ExecuteGraphRequest::clear_computation() { + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; +} +void ExecuteGraphRequest::clear_arguments() { + arguments_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecuteGraphRequest::kComputationFieldNumber; +const int ExecuteGraphRequest::kArgumentsFieldNumber; +const int ExecuteGraphRequest::kExecutionOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecuteGraphRequest::ExecuteGraphRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteGraphRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecuteGraphRequest) +} +ExecuteGraphRequest::ExecuteGraphRequest(const ExecuteGraphRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + arguments_(from.arguments_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_computation()) { + computation_ = new ::xla::HloModuleProto(*from.computation_); + } else { + computation_ = NULL; + } + if (from.has_execution_options()) { + execution_options_ = new ::xla::ExecutionOptions(*from.execution_options_); + } else { + execution_options_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ExecuteGraphRequest) +} + +void ExecuteGraphRequest::SharedCtor() { + ::memset(&computation_, 0, static_cast( + reinterpret_cast(&execution_options_) - + reinterpret_cast(&computation_)) + sizeof(execution_options_)); +} + +ExecuteGraphRequest::~ExecuteGraphRequest() { + // @@protoc_insertion_point(destructor:xla.ExecuteGraphRequest) + SharedDtor(); +} + +void ExecuteGraphRequest::SharedDtor() { + if (this != internal_default_instance()) delete computation_; + if (this != internal_default_instance()) delete execution_options_; +} + +void ExecuteGraphRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecuteGraphRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecuteGraphRequest& ExecuteGraphRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteGraphRequest.base); + return *internal_default_instance(); +} + + +void ExecuteGraphRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecuteGraphRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + arguments_.Clear(); + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; + if (GetArenaNoVirtual() == NULL && execution_options_ != NULL) { + delete execution_options_; + } + execution_options_ = NULL; + _internal_metadata_.Clear(); +} + +bool ExecuteGraphRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecuteGraphRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HloModuleProto computation = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_computation())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.GlobalDataHandle arguments = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_arguments())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ExecutionOptions execution_options = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_execution_options())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecuteGraphRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecuteGraphRequest) + return false; +#undef DO_ +} + +void ExecuteGraphRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecuteGraphRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_computation(), output); + } + + // repeated .xla.GlobalDataHandle arguments = 2; + for (unsigned int i = 0, + n = static_cast(this->arguments_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->arguments(static_cast(i)), + output); + } + + // .xla.ExecutionOptions execution_options = 3; + if (this->has_execution_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_execution_options(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecuteGraphRequest) +} + +::google::protobuf::uint8* ExecuteGraphRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecuteGraphRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_computation(), deterministic, target); + } + + // repeated .xla.GlobalDataHandle arguments = 2; + for (unsigned int i = 0, + n = static_cast(this->arguments_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->arguments(static_cast(i)), deterministic, target); + } + + // .xla.ExecutionOptions execution_options = 3; + if (this->has_execution_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_execution_options(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecuteGraphRequest) + return target; +} + +size_t ExecuteGraphRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecuteGraphRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.GlobalDataHandle arguments = 2; + { + unsigned int count = static_cast(this->arguments_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->arguments(static_cast(i))); + } + } + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *computation_); + } + + // .xla.ExecutionOptions execution_options = 3; + if (this->has_execution_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *execution_options_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecuteGraphRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecuteGraphRequest) + GOOGLE_DCHECK_NE(&from, this); + const ExecuteGraphRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecuteGraphRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecuteGraphRequest) + MergeFrom(*source); + } +} + +void ExecuteGraphRequest::MergeFrom(const ExecuteGraphRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecuteGraphRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + arguments_.MergeFrom(from.arguments_); + if (from.has_computation()) { + mutable_computation()->::xla::HloModuleProto::MergeFrom(from.computation()); + } + if (from.has_execution_options()) { + mutable_execution_options()->::xla::ExecutionOptions::MergeFrom(from.execution_options()); + } +} + +void ExecuteGraphRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecuteGraphRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecuteGraphRequest::CopyFrom(const ExecuteGraphRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecuteGraphRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecuteGraphRequest::IsInitialized() const { + return true; +} + +void ExecuteGraphRequest::Swap(ExecuteGraphRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ExecuteGraphRequest::InternalSwap(ExecuteGraphRequest* other) { + using std::swap; + CastToBase(&arguments_)->InternalSwap(CastToBase(&other->arguments_)); + swap(computation_, other->computation_); + swap(execution_options_, other->execution_options_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecuteGraphRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecuteGraphParallelRequest::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecuteGraphParallelRequest::kRequestsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecuteGraphParallelRequest::ExecuteGraphParallelRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteGraphParallelRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecuteGraphParallelRequest) +} +ExecuteGraphParallelRequest::ExecuteGraphParallelRequest(const ExecuteGraphParallelRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + requests_(from.requests_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.ExecuteGraphParallelRequest) +} + +void ExecuteGraphParallelRequest::SharedCtor() { +} + +ExecuteGraphParallelRequest::~ExecuteGraphParallelRequest() { + // @@protoc_insertion_point(destructor:xla.ExecuteGraphParallelRequest) + SharedDtor(); +} + +void ExecuteGraphParallelRequest::SharedDtor() { +} + +void ExecuteGraphParallelRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecuteGraphParallelRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecuteGraphParallelRequest& ExecuteGraphParallelRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteGraphParallelRequest.base); + return *internal_default_instance(); +} + + +void ExecuteGraphParallelRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecuteGraphParallelRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + requests_.Clear(); + _internal_metadata_.Clear(); +} + +bool ExecuteGraphParallelRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecuteGraphParallelRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.ExecuteGraphRequest requests = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_requests())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecuteGraphParallelRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecuteGraphParallelRequest) + return false; +#undef DO_ +} + +void ExecuteGraphParallelRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecuteGraphParallelRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.ExecuteGraphRequest requests = 1; + for (unsigned int i = 0, + n = static_cast(this->requests_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->requests(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecuteGraphParallelRequest) +} + +::google::protobuf::uint8* ExecuteGraphParallelRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecuteGraphParallelRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.ExecuteGraphRequest requests = 1; + for (unsigned int i = 0, + n = static_cast(this->requests_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->requests(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecuteGraphParallelRequest) + return target; +} + +size_t ExecuteGraphParallelRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecuteGraphParallelRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.ExecuteGraphRequest requests = 1; + { + unsigned int count = static_cast(this->requests_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->requests(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecuteGraphParallelRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecuteGraphParallelRequest) + GOOGLE_DCHECK_NE(&from, this); + const ExecuteGraphParallelRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecuteGraphParallelRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecuteGraphParallelRequest) + MergeFrom(*source); + } +} + +void ExecuteGraphParallelRequest::MergeFrom(const ExecuteGraphParallelRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecuteGraphParallelRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + requests_.MergeFrom(from.requests_); +} + +void ExecuteGraphParallelRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecuteGraphParallelRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecuteGraphParallelRequest::CopyFrom(const ExecuteGraphParallelRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecuteGraphParallelRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecuteGraphParallelRequest::IsInitialized() const { + return true; +} + +void ExecuteGraphParallelRequest::Swap(ExecuteGraphParallelRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ExecuteGraphParallelRequest::InternalSwap(ExecuteGraphParallelRequest* other) { + using std::swap; + CastToBase(&requests_)->InternalSwap(CastToBase(&other->requests_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecuteGraphParallelRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecuteResponse::InitAsDefaultInstance() { + ::xla::_ExecuteResponse_default_instance_._instance.get_mutable()->output_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); + ::xla::_ExecuteResponse_default_instance_._instance.get_mutable()->profile_ = const_cast< ::xla::ExecutionProfile*>( + ::xla::ExecutionProfile::internal_default_instance()); +} +void ExecuteResponse::clear_output() { + if (GetArenaNoVirtual() == NULL && output_ != NULL) { + delete output_; + } + output_ = NULL; +} +void ExecuteResponse::clear_profile() { + if (GetArenaNoVirtual() == NULL && profile_ != NULL) { + delete profile_; + } + profile_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecuteResponse::kOutputFieldNumber; +const int ExecuteResponse::kProfileFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecuteResponse::ExecuteResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecuteResponse) +} +ExecuteResponse::ExecuteResponse(const ExecuteResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_output()) { + output_ = new ::xla::GlobalDataHandle(*from.output_); + } else { + output_ = NULL; + } + if (from.has_profile()) { + profile_ = new ::xla::ExecutionProfile(*from.profile_); + } else { + profile_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ExecuteResponse) +} + +void ExecuteResponse::SharedCtor() { + ::memset(&output_, 0, static_cast( + reinterpret_cast(&profile_) - + reinterpret_cast(&output_)) + sizeof(profile_)); +} + +ExecuteResponse::~ExecuteResponse() { + // @@protoc_insertion_point(destructor:xla.ExecuteResponse) + SharedDtor(); +} + +void ExecuteResponse::SharedDtor() { + if (this != internal_default_instance()) delete output_; + if (this != internal_default_instance()) delete profile_; +} + +void ExecuteResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecuteResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecuteResponse& ExecuteResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteResponse.base); + return *internal_default_instance(); +} + + +void ExecuteResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecuteResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && output_ != NULL) { + delete output_; + } + output_ = NULL; + if (GetArenaNoVirtual() == NULL && profile_ != NULL) { + delete profile_; + } + profile_ = NULL; + _internal_metadata_.Clear(); +} + +bool ExecuteResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecuteResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle output = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_output())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ExecutionProfile profile = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_profile())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecuteResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecuteResponse) + return false; +#undef DO_ +} + +void ExecuteResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecuteResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle output = 1; + if (this->has_output()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_output(), output); + } + + // .xla.ExecutionProfile profile = 2; + if (this->has_profile()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_profile(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecuteResponse) +} + +::google::protobuf::uint8* ExecuteResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecuteResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle output = 1; + if (this->has_output()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_output(), deterministic, target); + } + + // .xla.ExecutionProfile profile = 2; + if (this->has_profile()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_profile(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecuteResponse) + return target; +} + +size_t ExecuteResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecuteResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle output = 1; + if (this->has_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *output_); + } + + // .xla.ExecutionProfile profile = 2; + if (this->has_profile()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *profile_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecuteResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecuteResponse) + GOOGLE_DCHECK_NE(&from, this); + const ExecuteResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecuteResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecuteResponse) + MergeFrom(*source); + } +} + +void ExecuteResponse::MergeFrom(const ExecuteResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecuteResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_output()) { + mutable_output()->::xla::GlobalDataHandle::MergeFrom(from.output()); + } + if (from.has_profile()) { + mutable_profile()->::xla::ExecutionProfile::MergeFrom(from.profile()); + } +} + +void ExecuteResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecuteResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecuteResponse::CopyFrom(const ExecuteResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecuteResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecuteResponse::IsInitialized() const { + return true; +} + +void ExecuteResponse::Swap(ExecuteResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ExecuteResponse::InternalSwap(ExecuteResponse* other) { + using std::swap; + swap(output_, other->output_); + swap(profile_, other->profile_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecuteResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecuteParallelResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecuteParallelResponse::kResponsesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecuteParallelResponse::ExecuteParallelResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteParallelResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecuteParallelResponse) +} +ExecuteParallelResponse::ExecuteParallelResponse(const ExecuteParallelResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + responses_(from.responses_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.ExecuteParallelResponse) +} + +void ExecuteParallelResponse::SharedCtor() { +} + +ExecuteParallelResponse::~ExecuteParallelResponse() { + // @@protoc_insertion_point(destructor:xla.ExecuteParallelResponse) + SharedDtor(); +} + +void ExecuteParallelResponse::SharedDtor() { +} + +void ExecuteParallelResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecuteParallelResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecuteParallelResponse& ExecuteParallelResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ExecuteParallelResponse.base); + return *internal_default_instance(); +} + + +void ExecuteParallelResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecuteParallelResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + responses_.Clear(); + _internal_metadata_.Clear(); +} + +bool ExecuteParallelResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecuteParallelResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.ExecuteResponse responses = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_responses())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecuteParallelResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecuteParallelResponse) + return false; +#undef DO_ +} + +void ExecuteParallelResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecuteParallelResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.ExecuteResponse responses = 1; + for (unsigned int i = 0, + n = static_cast(this->responses_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->responses(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecuteParallelResponse) +} + +::google::protobuf::uint8* ExecuteParallelResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecuteParallelResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.ExecuteResponse responses = 1; + for (unsigned int i = 0, + n = static_cast(this->responses_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->responses(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecuteParallelResponse) + return target; +} + +size_t ExecuteParallelResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecuteParallelResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.ExecuteResponse responses = 1; + { + unsigned int count = static_cast(this->responses_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->responses(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecuteParallelResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecuteParallelResponse) + GOOGLE_DCHECK_NE(&from, this); + const ExecuteParallelResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecuteParallelResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecuteParallelResponse) + MergeFrom(*source); + } +} + +void ExecuteParallelResponse::MergeFrom(const ExecuteParallelResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecuteParallelResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + responses_.MergeFrom(from.responses_); +} + +void ExecuteParallelResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecuteParallelResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecuteParallelResponse::CopyFrom(const ExecuteParallelResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecuteParallelResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecuteParallelResponse::IsInitialized() const { + return true; +} + +void ExecuteParallelResponse::Swap(ExecuteParallelResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ExecuteParallelResponse::InternalSwap(ExecuteParallelResponse* other) { + using std::swap; + CastToBase(&responses_)->InternalSwap(CastToBase(&other->responses_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecuteParallelResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void WaitForExecutionRequest::InitAsDefaultInstance() { + ::xla::_WaitForExecutionRequest_default_instance_._instance.get_mutable()->execution_ = const_cast< ::xla::ExecutionHandle*>( + ::xla::ExecutionHandle::internal_default_instance()); +} +void WaitForExecutionRequest::clear_execution() { + if (GetArenaNoVirtual() == NULL && execution_ != NULL) { + delete execution_; + } + execution_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int WaitForExecutionRequest::kExecutionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +WaitForExecutionRequest::WaitForExecutionRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_WaitForExecutionRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.WaitForExecutionRequest) +} +WaitForExecutionRequest::WaitForExecutionRequest(const WaitForExecutionRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_execution()) { + execution_ = new ::xla::ExecutionHandle(*from.execution_); + } else { + execution_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.WaitForExecutionRequest) +} + +void WaitForExecutionRequest::SharedCtor() { + execution_ = NULL; +} + +WaitForExecutionRequest::~WaitForExecutionRequest() { + // @@protoc_insertion_point(destructor:xla.WaitForExecutionRequest) + SharedDtor(); +} + +void WaitForExecutionRequest::SharedDtor() { + if (this != internal_default_instance()) delete execution_; +} + +void WaitForExecutionRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* WaitForExecutionRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const WaitForExecutionRequest& WaitForExecutionRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_WaitForExecutionRequest.base); + return *internal_default_instance(); +} + + +void WaitForExecutionRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.WaitForExecutionRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && execution_ != NULL) { + delete execution_; + } + execution_ = NULL; + _internal_metadata_.Clear(); +} + +bool WaitForExecutionRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.WaitForExecutionRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ExecutionHandle execution = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_execution())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.WaitForExecutionRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.WaitForExecutionRequest) + return false; +#undef DO_ +} + +void WaitForExecutionRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.WaitForExecutionRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ExecutionHandle execution = 1; + if (this->has_execution()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_execution(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.WaitForExecutionRequest) +} + +::google::protobuf::uint8* WaitForExecutionRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.WaitForExecutionRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ExecutionHandle execution = 1; + if (this->has_execution()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_execution(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.WaitForExecutionRequest) + return target; +} + +size_t WaitForExecutionRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.WaitForExecutionRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.ExecutionHandle execution = 1; + if (this->has_execution()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *execution_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WaitForExecutionRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.WaitForExecutionRequest) + GOOGLE_DCHECK_NE(&from, this); + const WaitForExecutionRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.WaitForExecutionRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.WaitForExecutionRequest) + MergeFrom(*source); + } +} + +void WaitForExecutionRequest::MergeFrom(const WaitForExecutionRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.WaitForExecutionRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_execution()) { + mutable_execution()->::xla::ExecutionHandle::MergeFrom(from.execution()); + } +} + +void WaitForExecutionRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.WaitForExecutionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WaitForExecutionRequest::CopyFrom(const WaitForExecutionRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.WaitForExecutionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WaitForExecutionRequest::IsInitialized() const { + return true; +} + +void WaitForExecutionRequest::Swap(WaitForExecutionRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void WaitForExecutionRequest::InternalSwap(WaitForExecutionRequest* other) { + using std::swap; + swap(execution_, other->execution_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata WaitForExecutionRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void WaitForExecutionResponse::InitAsDefaultInstance() { + ::xla::_WaitForExecutionResponse_default_instance_._instance.get_mutable()->output_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); + ::xla::_WaitForExecutionResponse_default_instance_._instance.get_mutable()->profile_ = const_cast< ::xla::ExecutionProfile*>( + ::xla::ExecutionProfile::internal_default_instance()); +} +void WaitForExecutionResponse::clear_output() { + if (GetArenaNoVirtual() == NULL && output_ != NULL) { + delete output_; + } + output_ = NULL; +} +void WaitForExecutionResponse::clear_profile() { + if (GetArenaNoVirtual() == NULL && profile_ != NULL) { + delete profile_; + } + profile_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int WaitForExecutionResponse::kOutputFieldNumber; +const int WaitForExecutionResponse::kProfileFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +WaitForExecutionResponse::WaitForExecutionResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_WaitForExecutionResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.WaitForExecutionResponse) +} +WaitForExecutionResponse::WaitForExecutionResponse(const WaitForExecutionResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_output()) { + output_ = new ::xla::GlobalDataHandle(*from.output_); + } else { + output_ = NULL; + } + if (from.has_profile()) { + profile_ = new ::xla::ExecutionProfile(*from.profile_); + } else { + profile_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.WaitForExecutionResponse) +} + +void WaitForExecutionResponse::SharedCtor() { + ::memset(&output_, 0, static_cast( + reinterpret_cast(&profile_) - + reinterpret_cast(&output_)) + sizeof(profile_)); +} + +WaitForExecutionResponse::~WaitForExecutionResponse() { + // @@protoc_insertion_point(destructor:xla.WaitForExecutionResponse) + SharedDtor(); +} + +void WaitForExecutionResponse::SharedDtor() { + if (this != internal_default_instance()) delete output_; + if (this != internal_default_instance()) delete profile_; +} + +void WaitForExecutionResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* WaitForExecutionResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const WaitForExecutionResponse& WaitForExecutionResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_WaitForExecutionResponse.base); + return *internal_default_instance(); +} + + +void WaitForExecutionResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.WaitForExecutionResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && output_ != NULL) { + delete output_; + } + output_ = NULL; + if (GetArenaNoVirtual() == NULL && profile_ != NULL) { + delete profile_; + } + profile_ = NULL; + _internal_metadata_.Clear(); +} + +bool WaitForExecutionResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.WaitForExecutionResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle output = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_output())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ExecutionProfile profile = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_profile())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.WaitForExecutionResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.WaitForExecutionResponse) + return false; +#undef DO_ +} + +void WaitForExecutionResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.WaitForExecutionResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle output = 1; + if (this->has_output()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_output(), output); + } + + // .xla.ExecutionProfile profile = 2; + if (this->has_profile()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_profile(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.WaitForExecutionResponse) +} + +::google::protobuf::uint8* WaitForExecutionResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.WaitForExecutionResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle output = 1; + if (this->has_output()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_output(), deterministic, target); + } + + // .xla.ExecutionProfile profile = 2; + if (this->has_profile()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_profile(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.WaitForExecutionResponse) + return target; +} + +size_t WaitForExecutionResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.WaitForExecutionResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle output = 1; + if (this->has_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *output_); + } + + // .xla.ExecutionProfile profile = 2; + if (this->has_profile()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *profile_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WaitForExecutionResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.WaitForExecutionResponse) + GOOGLE_DCHECK_NE(&from, this); + const WaitForExecutionResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.WaitForExecutionResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.WaitForExecutionResponse) + MergeFrom(*source); + } +} + +void WaitForExecutionResponse::MergeFrom(const WaitForExecutionResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.WaitForExecutionResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_output()) { + mutable_output()->::xla::GlobalDataHandle::MergeFrom(from.output()); + } + if (from.has_profile()) { + mutable_profile()->::xla::ExecutionProfile::MergeFrom(from.profile()); + } +} + +void WaitForExecutionResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.WaitForExecutionResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WaitForExecutionResponse::CopyFrom(const WaitForExecutionResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.WaitForExecutionResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WaitForExecutionResponse::IsInitialized() const { + return true; +} + +void WaitForExecutionResponse::Swap(WaitForExecutionResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void WaitForExecutionResponse::InternalSwap(WaitForExecutionResponse* other) { + using std::swap; + swap(output_, other->output_); + swap(profile_, other->profile_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata WaitForExecutionResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ComputeConstantGraphRequest::InitAsDefaultInstance() { + ::xla::_ComputeConstantGraphRequest_default_instance_._instance.get_mutable()->computation_ = const_cast< ::xla::HloModuleProto*>( + ::xla::HloModuleProto::internal_default_instance()); + ::xla::_ComputeConstantGraphRequest_default_instance_._instance.get_mutable()->output_layout_ = const_cast< ::xla::LayoutProto*>( + ::xla::LayoutProto::internal_default_instance()); +} +void ComputeConstantGraphRequest::clear_computation() { + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; +} +void ComputeConstantGraphRequest::clear_output_layout() { + if (GetArenaNoVirtual() == NULL && output_layout_ != NULL) { + delete output_layout_; + } + output_layout_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ComputeConstantGraphRequest::kComputationFieldNumber; +const int ComputeConstantGraphRequest::kOutputLayoutFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ComputeConstantGraphRequest::ComputeConstantGraphRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputeConstantGraphRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ComputeConstantGraphRequest) +} +ComputeConstantGraphRequest::ComputeConstantGraphRequest(const ComputeConstantGraphRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_computation()) { + computation_ = new ::xla::HloModuleProto(*from.computation_); + } else { + computation_ = NULL; + } + if (from.has_output_layout()) { + output_layout_ = new ::xla::LayoutProto(*from.output_layout_); + } else { + output_layout_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ComputeConstantGraphRequest) +} + +void ComputeConstantGraphRequest::SharedCtor() { + ::memset(&computation_, 0, static_cast( + reinterpret_cast(&output_layout_) - + reinterpret_cast(&computation_)) + sizeof(output_layout_)); +} + +ComputeConstantGraphRequest::~ComputeConstantGraphRequest() { + // @@protoc_insertion_point(destructor:xla.ComputeConstantGraphRequest) + SharedDtor(); +} + +void ComputeConstantGraphRequest::SharedDtor() { + if (this != internal_default_instance()) delete computation_; + if (this != internal_default_instance()) delete output_layout_; +} + +void ComputeConstantGraphRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ComputeConstantGraphRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ComputeConstantGraphRequest& ComputeConstantGraphRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputeConstantGraphRequest.base); + return *internal_default_instance(); +} + + +void ComputeConstantGraphRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ComputeConstantGraphRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && computation_ != NULL) { + delete computation_; + } + computation_ = NULL; + if (GetArenaNoVirtual() == NULL && output_layout_ != NULL) { + delete output_layout_; + } + output_layout_ = NULL; + _internal_metadata_.Clear(); +} + +bool ComputeConstantGraphRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ComputeConstantGraphRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.HloModuleProto computation = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_computation())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.LayoutProto output_layout = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_output_layout())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ComputeConstantGraphRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ComputeConstantGraphRequest) + return false; +#undef DO_ +} + +void ComputeConstantGraphRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ComputeConstantGraphRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_computation(), output); + } + + // .xla.LayoutProto output_layout = 2; + if (this->has_output_layout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_output_layout(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ComputeConstantGraphRequest) +} + +::google::protobuf::uint8* ComputeConstantGraphRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ComputeConstantGraphRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_computation(), deterministic, target); + } + + // .xla.LayoutProto output_layout = 2; + if (this->has_output_layout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_output_layout(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ComputeConstantGraphRequest) + return target; +} + +size_t ComputeConstantGraphRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ComputeConstantGraphRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.HloModuleProto computation = 1; + if (this->has_computation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *computation_); + } + + // .xla.LayoutProto output_layout = 2; + if (this->has_output_layout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *output_layout_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ComputeConstantGraphRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ComputeConstantGraphRequest) + GOOGLE_DCHECK_NE(&from, this); + const ComputeConstantGraphRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ComputeConstantGraphRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ComputeConstantGraphRequest) + MergeFrom(*source); + } +} + +void ComputeConstantGraphRequest::MergeFrom(const ComputeConstantGraphRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ComputeConstantGraphRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_computation()) { + mutable_computation()->::xla::HloModuleProto::MergeFrom(from.computation()); + } + if (from.has_output_layout()) { + mutable_output_layout()->::xla::LayoutProto::MergeFrom(from.output_layout()); + } +} + +void ComputeConstantGraphRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ComputeConstantGraphRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ComputeConstantGraphRequest::CopyFrom(const ComputeConstantGraphRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ComputeConstantGraphRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ComputeConstantGraphRequest::IsInitialized() const { + return true; +} + +void ComputeConstantGraphRequest::Swap(ComputeConstantGraphRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ComputeConstantGraphRequest::InternalSwap(ComputeConstantGraphRequest* other) { + using std::swap; + swap(computation_, other->computation_); + swap(output_layout_, other->output_layout_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ComputeConstantGraphRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ComputeConstantResponse::InitAsDefaultInstance() { + ::xla::_ComputeConstantResponse_default_instance_._instance.get_mutable()->literal_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); +} +void ComputeConstantResponse::clear_literal() { + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ComputeConstantResponse::kLiteralFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ComputeConstantResponse::ComputeConstantResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputeConstantResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ComputeConstantResponse) +} +ComputeConstantResponse::ComputeConstantResponse(const ComputeConstantResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_literal()) { + literal_ = new ::xla::LiteralProto(*from.literal_); + } else { + literal_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ComputeConstantResponse) +} + +void ComputeConstantResponse::SharedCtor() { + literal_ = NULL; +} + +ComputeConstantResponse::~ComputeConstantResponse() { + // @@protoc_insertion_point(destructor:xla.ComputeConstantResponse) + SharedDtor(); +} + +void ComputeConstantResponse::SharedDtor() { + if (this != internal_default_instance()) delete literal_; +} + +void ComputeConstantResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ComputeConstantResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ComputeConstantResponse& ComputeConstantResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_ComputeConstantResponse.base); + return *internal_default_instance(); +} + + +void ComputeConstantResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ComputeConstantResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && literal_ != NULL) { + delete literal_; + } + literal_ = NULL; + _internal_metadata_.Clear(); +} + +bool ComputeConstantResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ComputeConstantResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.LiteralProto literal = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_literal())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ComputeConstantResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ComputeConstantResponse) + return false; +#undef DO_ +} + +void ComputeConstantResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ComputeConstantResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_literal(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ComputeConstantResponse) +} + +::google::protobuf::uint8* ComputeConstantResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ComputeConstantResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_literal(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ComputeConstantResponse) + return target; +} + +size_t ComputeConstantResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ComputeConstantResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LiteralProto literal = 1; + if (this->has_literal()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *literal_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ComputeConstantResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ComputeConstantResponse) + GOOGLE_DCHECK_NE(&from, this); + const ComputeConstantResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ComputeConstantResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ComputeConstantResponse) + MergeFrom(*source); + } +} + +void ComputeConstantResponse::MergeFrom(const ComputeConstantResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ComputeConstantResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_literal()) { + mutable_literal()->::xla::LiteralProto::MergeFrom(from.literal()); + } +} + +void ComputeConstantResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ComputeConstantResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ComputeConstantResponse::CopyFrom(const ComputeConstantResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ComputeConstantResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ComputeConstantResponse::IsInitialized() const { + return true; +} + +void ComputeConstantResponse::Swap(ComputeConstantResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ComputeConstantResponse::InternalSwap(ComputeConstantResponse* other) { + using std::swap; + swap(literal_, other->literal_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ComputeConstantResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeconstructTupleRequest::InitAsDefaultInstance() { + ::xla::_DeconstructTupleRequest_default_instance_._instance.get_mutable()->tuple_handle_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); +} +void DeconstructTupleRequest::clear_tuple_handle() { + if (GetArenaNoVirtual() == NULL && tuple_handle_ != NULL) { + delete tuple_handle_; + } + tuple_handle_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeconstructTupleRequest::kTupleHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeconstructTupleRequest::DeconstructTupleRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DeconstructTupleRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DeconstructTupleRequest) +} +DeconstructTupleRequest::DeconstructTupleRequest(const DeconstructTupleRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_tuple_handle()) { + tuple_handle_ = new ::xla::GlobalDataHandle(*from.tuple_handle_); + } else { + tuple_handle_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.DeconstructTupleRequest) +} + +void DeconstructTupleRequest::SharedCtor() { + tuple_handle_ = NULL; +} + +DeconstructTupleRequest::~DeconstructTupleRequest() { + // @@protoc_insertion_point(destructor:xla.DeconstructTupleRequest) + SharedDtor(); +} + +void DeconstructTupleRequest::SharedDtor() { + if (this != internal_default_instance()) delete tuple_handle_; +} + +void DeconstructTupleRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeconstructTupleRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeconstructTupleRequest& DeconstructTupleRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DeconstructTupleRequest.base); + return *internal_default_instance(); +} + + +void DeconstructTupleRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DeconstructTupleRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && tuple_handle_ != NULL) { + delete tuple_handle_; + } + tuple_handle_ = NULL; + _internal_metadata_.Clear(); +} + +bool DeconstructTupleRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DeconstructTupleRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle tuple_handle = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tuple_handle())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DeconstructTupleRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DeconstructTupleRequest) + return false; +#undef DO_ +} + +void DeconstructTupleRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DeconstructTupleRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle tuple_handle = 2; + if (this->has_tuple_handle()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_tuple_handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DeconstructTupleRequest) +} + +::google::protobuf::uint8* DeconstructTupleRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DeconstructTupleRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle tuple_handle = 2; + if (this->has_tuple_handle()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_tuple_handle(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DeconstructTupleRequest) + return target; +} + +size_t DeconstructTupleRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DeconstructTupleRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle tuple_handle = 2; + if (this->has_tuple_handle()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tuple_handle_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeconstructTupleRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DeconstructTupleRequest) + GOOGLE_DCHECK_NE(&from, this); + const DeconstructTupleRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DeconstructTupleRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DeconstructTupleRequest) + MergeFrom(*source); + } +} + +void DeconstructTupleRequest::MergeFrom(const DeconstructTupleRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DeconstructTupleRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_tuple_handle()) { + mutable_tuple_handle()->::xla::GlobalDataHandle::MergeFrom(from.tuple_handle()); + } +} + +void DeconstructTupleRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DeconstructTupleRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeconstructTupleRequest::CopyFrom(const DeconstructTupleRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DeconstructTupleRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeconstructTupleRequest::IsInitialized() const { + return true; +} + +void DeconstructTupleRequest::Swap(DeconstructTupleRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void DeconstructTupleRequest::InternalSwap(DeconstructTupleRequest* other) { + using std::swap; + swap(tuple_handle_, other->tuple_handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeconstructTupleRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeconstructTupleResponse::InitAsDefaultInstance() { +} +void DeconstructTupleResponse::clear_element_handles() { + element_handles_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeconstructTupleResponse::kElementHandlesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeconstructTupleResponse::DeconstructTupleResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DeconstructTupleResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DeconstructTupleResponse) +} +DeconstructTupleResponse::DeconstructTupleResponse(const DeconstructTupleResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + element_handles_(from.element_handles_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.DeconstructTupleResponse) +} + +void DeconstructTupleResponse::SharedCtor() { +} + +DeconstructTupleResponse::~DeconstructTupleResponse() { + // @@protoc_insertion_point(destructor:xla.DeconstructTupleResponse) + SharedDtor(); +} + +void DeconstructTupleResponse::SharedDtor() { +} + +void DeconstructTupleResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeconstructTupleResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeconstructTupleResponse& DeconstructTupleResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DeconstructTupleResponse.base); + return *internal_default_instance(); +} + + +void DeconstructTupleResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DeconstructTupleResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + element_handles_.Clear(); + _internal_metadata_.Clear(); +} + +bool DeconstructTupleResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DeconstructTupleResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.GlobalDataHandle element_handles = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_element_handles())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DeconstructTupleResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DeconstructTupleResponse) + return false; +#undef DO_ +} + +void DeconstructTupleResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DeconstructTupleResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.GlobalDataHandle element_handles = 1; + for (unsigned int i = 0, + n = static_cast(this->element_handles_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->element_handles(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DeconstructTupleResponse) +} + +::google::protobuf::uint8* DeconstructTupleResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DeconstructTupleResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.GlobalDataHandle element_handles = 1; + for (unsigned int i = 0, + n = static_cast(this->element_handles_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->element_handles(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DeconstructTupleResponse) + return target; +} + +size_t DeconstructTupleResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DeconstructTupleResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.GlobalDataHandle element_handles = 1; + { + unsigned int count = static_cast(this->element_handles_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->element_handles(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeconstructTupleResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DeconstructTupleResponse) + GOOGLE_DCHECK_NE(&from, this); + const DeconstructTupleResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DeconstructTupleResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DeconstructTupleResponse) + MergeFrom(*source); + } +} + +void DeconstructTupleResponse::MergeFrom(const DeconstructTupleResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DeconstructTupleResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + element_handles_.MergeFrom(from.element_handles_); +} + +void DeconstructTupleResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DeconstructTupleResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeconstructTupleResponse::CopyFrom(const DeconstructTupleResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DeconstructTupleResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeconstructTupleResponse::IsInitialized() const { + return true; +} + +void DeconstructTupleResponse::Swap(DeconstructTupleResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void DeconstructTupleResponse::InternalSwap(DeconstructTupleResponse* other) { + using std::swap; + CastToBase(&element_handles_)->InternalSwap(CastToBase(&other->element_handles_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeconstructTupleResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LoadDataRequest::InitAsDefaultInstance() { + ::xla::_LoadDataRequest_default_instance_._instance.get_mutable()->element_shape_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); +} +void LoadDataRequest::clear_element_shape() { + if (GetArenaNoVirtual() == NULL && element_shape_ != NULL) { + delete element_shape_; + } + element_shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LoadDataRequest::kColumnioTabletPathFieldNumber; +const int LoadDataRequest::kColumnioFieldFieldNumber; +const int LoadDataRequest::kElementShapeFieldNumber; +const int LoadDataRequest::kOffsetFieldNumber; +const int LoadDataRequest::kLimitFieldNumber; +const int LoadDataRequest::kZipFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LoadDataRequest::LoadDataRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_LoadDataRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.LoadDataRequest) +} +LoadDataRequest::LoadDataRequest(const LoadDataRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + columnio_tablet_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.columnio_tablet_path().size() > 0) { + columnio_tablet_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.columnio_tablet_path_); + } + columnio_field_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.columnio_field().size() > 0) { + columnio_field_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.columnio_field_); + } + if (from.has_element_shape()) { + element_shape_ = new ::xla::ShapeProto(*from.element_shape_); + } else { + element_shape_ = NULL; + } + ::memcpy(&offset_, &from.offset_, + static_cast(reinterpret_cast(&zip_) - + reinterpret_cast(&offset_)) + sizeof(zip_)); + // @@protoc_insertion_point(copy_constructor:xla.LoadDataRequest) +} + +void LoadDataRequest::SharedCtor() { + columnio_tablet_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + columnio_field_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&element_shape_, 0, static_cast( + reinterpret_cast(&zip_) - + reinterpret_cast(&element_shape_)) + sizeof(zip_)); +} + +LoadDataRequest::~LoadDataRequest() { + // @@protoc_insertion_point(destructor:xla.LoadDataRequest) + SharedDtor(); +} + +void LoadDataRequest::SharedDtor() { + columnio_tablet_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + columnio_field_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete element_shape_; +} + +void LoadDataRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LoadDataRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LoadDataRequest& LoadDataRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_LoadDataRequest.base); + return *internal_default_instance(); +} + + +void LoadDataRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.LoadDataRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + columnio_tablet_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + columnio_field_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && element_shape_ != NULL) { + delete element_shape_; + } + element_shape_ = NULL; + ::memset(&offset_, 0, static_cast( + reinterpret_cast(&zip_) - + reinterpret_cast(&offset_)) + sizeof(zip_)); + _internal_metadata_.Clear(); +} + +bool LoadDataRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.LoadDataRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string columnio_tablet_path = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_columnio_tablet_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->columnio_tablet_path().data(), static_cast(this->columnio_tablet_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.LoadDataRequest.columnio_tablet_path")); + } else { + goto handle_unusual; + } + break; + } + + // string columnio_field = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_columnio_field())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->columnio_field().data(), static_cast(this->columnio_field().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.LoadDataRequest.columnio_field")); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ShapeProto element_shape = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_element_shape())); + } else { + goto handle_unusual; + } + break; + } + + // int64 offset = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &offset_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 limit = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &limit_))); + } else { + goto handle_unusual; + } + break; + } + + // bool zip = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &zip_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.LoadDataRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.LoadDataRequest) + return false; +#undef DO_ +} + +void LoadDataRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.LoadDataRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string columnio_tablet_path = 1; + if (this->columnio_tablet_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->columnio_tablet_path().data(), static_cast(this->columnio_tablet_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LoadDataRequest.columnio_tablet_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->columnio_tablet_path(), output); + } + + // string columnio_field = 2; + if (this->columnio_field().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->columnio_field().data(), static_cast(this->columnio_field().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LoadDataRequest.columnio_field"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->columnio_field(), output); + } + + // .xla.ShapeProto element_shape = 3; + if (this->has_element_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_element_shape(), output); + } + + // int64 offset = 4; + if (this->offset() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->offset(), output); + } + + // int64 limit = 5; + if (this->limit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->limit(), output); + } + + // bool zip = 6; + if (this->zip() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->zip(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.LoadDataRequest) +} + +::google::protobuf::uint8* LoadDataRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.LoadDataRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string columnio_tablet_path = 1; + if (this->columnio_tablet_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->columnio_tablet_path().data(), static_cast(this->columnio_tablet_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LoadDataRequest.columnio_tablet_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->columnio_tablet_path(), target); + } + + // string columnio_field = 2; + if (this->columnio_field().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->columnio_field().data(), static_cast(this->columnio_field().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.LoadDataRequest.columnio_field"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->columnio_field(), target); + } + + // .xla.ShapeProto element_shape = 3; + if (this->has_element_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_element_shape(), deterministic, target); + } + + // int64 offset = 4; + if (this->offset() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->offset(), target); + } + + // int64 limit = 5; + if (this->limit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->limit(), target); + } + + // bool zip = 6; + if (this->zip() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->zip(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.LoadDataRequest) + return target; +} + +size_t LoadDataRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.LoadDataRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string columnio_tablet_path = 1; + if (this->columnio_tablet_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->columnio_tablet_path()); + } + + // string columnio_field = 2; + if (this->columnio_field().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->columnio_field()); + } + + // .xla.ShapeProto element_shape = 3; + if (this->has_element_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *element_shape_); + } + + // int64 offset = 4; + if (this->offset() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->offset()); + } + + // int64 limit = 5; + if (this->limit() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->limit()); + } + + // bool zip = 6; + if (this->zip() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LoadDataRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.LoadDataRequest) + GOOGLE_DCHECK_NE(&from, this); + const LoadDataRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.LoadDataRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.LoadDataRequest) + MergeFrom(*source); + } +} + +void LoadDataRequest::MergeFrom(const LoadDataRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.LoadDataRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.columnio_tablet_path().size() > 0) { + + columnio_tablet_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.columnio_tablet_path_); + } + if (from.columnio_field().size() > 0) { + + columnio_field_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.columnio_field_); + } + if (from.has_element_shape()) { + mutable_element_shape()->::xla::ShapeProto::MergeFrom(from.element_shape()); + } + if (from.offset() != 0) { + set_offset(from.offset()); + } + if (from.limit() != 0) { + set_limit(from.limit()); + } + if (from.zip() != 0) { + set_zip(from.zip()); + } +} + +void LoadDataRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.LoadDataRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LoadDataRequest::CopyFrom(const LoadDataRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.LoadDataRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LoadDataRequest::IsInitialized() const { + return true; +} + +void LoadDataRequest::Swap(LoadDataRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void LoadDataRequest::InternalSwap(LoadDataRequest* other) { + using std::swap; + columnio_tablet_path_.Swap(&other->columnio_tablet_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + columnio_field_.Swap(&other->columnio_field_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(element_shape_, other->element_shape_); + swap(offset_, other->offset_); + swap(limit_, other->limit_); + swap(zip_, other->zip_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LoadDataRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LoadDataResponse::InitAsDefaultInstance() { + ::xla::_LoadDataResponse_default_instance_._instance.get_mutable()->data_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); + ::xla::_LoadDataResponse_default_instance_._instance.get_mutable()->data_shape_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); +} +void LoadDataResponse::clear_data() { + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; +} +void LoadDataResponse::clear_data_shape() { + if (GetArenaNoVirtual() == NULL && data_shape_ != NULL) { + delete data_shape_; + } + data_shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LoadDataResponse::kDataFieldNumber; +const int LoadDataResponse::kDataShapeFieldNumber; +const int LoadDataResponse::kAvailableRowsFieldNumber; +const int LoadDataResponse::kRowsLoadedFieldNumber; +const int LoadDataResponse::kNanosecondsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LoadDataResponse::LoadDataResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_LoadDataResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.LoadDataResponse) +} +LoadDataResponse::LoadDataResponse(const LoadDataResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_data()) { + data_ = new ::xla::GlobalDataHandle(*from.data_); + } else { + data_ = NULL; + } + if (from.has_data_shape()) { + data_shape_ = new ::xla::ShapeProto(*from.data_shape_); + } else { + data_shape_ = NULL; + } + ::memcpy(&available_rows_, &from.available_rows_, + static_cast(reinterpret_cast(&nanoseconds_) - + reinterpret_cast(&available_rows_)) + sizeof(nanoseconds_)); + // @@protoc_insertion_point(copy_constructor:xla.LoadDataResponse) +} + +void LoadDataResponse::SharedCtor() { + ::memset(&data_, 0, static_cast( + reinterpret_cast(&nanoseconds_) - + reinterpret_cast(&data_)) + sizeof(nanoseconds_)); +} + +LoadDataResponse::~LoadDataResponse() { + // @@protoc_insertion_point(destructor:xla.LoadDataResponse) + SharedDtor(); +} + +void LoadDataResponse::SharedDtor() { + if (this != internal_default_instance()) delete data_; + if (this != internal_default_instance()) delete data_shape_; +} + +void LoadDataResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LoadDataResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LoadDataResponse& LoadDataResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_LoadDataResponse.base); + return *internal_default_instance(); +} + + +void LoadDataResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.LoadDataResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; + if (GetArenaNoVirtual() == NULL && data_shape_ != NULL) { + delete data_shape_; + } + data_shape_ = NULL; + ::memset(&available_rows_, 0, static_cast( + reinterpret_cast(&nanoseconds_) - + reinterpret_cast(&available_rows_)) + sizeof(nanoseconds_)); + _internal_metadata_.Clear(); +} + +bool LoadDataResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.LoadDataResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ShapeProto data_shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_data_shape())); + } else { + goto handle_unusual; + } + break; + } + + // int64 available_rows = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &available_rows_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 rows_loaded = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &rows_loaded_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 nanoseconds = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &nanoseconds_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.LoadDataResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.LoadDataResponse) + return false; +#undef DO_ +} + +void LoadDataResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.LoadDataResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_data(), output); + } + + // .xla.ShapeProto data_shape = 2; + if (this->has_data_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_data_shape(), output); + } + + // int64 available_rows = 3; + if (this->available_rows() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->available_rows(), output); + } + + // int64 rows_loaded = 4; + if (this->rows_loaded() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->rows_loaded(), output); + } + + // int64 nanoseconds = 5; + if (this->nanoseconds() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->nanoseconds(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.LoadDataResponse) +} + +::google::protobuf::uint8* LoadDataResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.LoadDataResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_data(), deterministic, target); + } + + // .xla.ShapeProto data_shape = 2; + if (this->has_data_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_data_shape(), deterministic, target); + } + + // int64 available_rows = 3; + if (this->available_rows() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->available_rows(), target); + } + + // int64 rows_loaded = 4; + if (this->rows_loaded() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->rows_loaded(), target); + } + + // int64 nanoseconds = 5; + if (this->nanoseconds() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->nanoseconds(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.LoadDataResponse) + return target; +} + +size_t LoadDataResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.LoadDataResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *data_); + } + + // .xla.ShapeProto data_shape = 2; + if (this->has_data_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *data_shape_); + } + + // int64 available_rows = 3; + if (this->available_rows() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->available_rows()); + } + + // int64 rows_loaded = 4; + if (this->rows_loaded() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->rows_loaded()); + } + + // int64 nanoseconds = 5; + if (this->nanoseconds() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->nanoseconds()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LoadDataResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.LoadDataResponse) + GOOGLE_DCHECK_NE(&from, this); + const LoadDataResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.LoadDataResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.LoadDataResponse) + MergeFrom(*source); + } +} + +void LoadDataResponse::MergeFrom(const LoadDataResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.LoadDataResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_data()) { + mutable_data()->::xla::GlobalDataHandle::MergeFrom(from.data()); + } + if (from.has_data_shape()) { + mutable_data_shape()->::xla::ShapeProto::MergeFrom(from.data_shape()); + } + if (from.available_rows() != 0) { + set_available_rows(from.available_rows()); + } + if (from.rows_loaded() != 0) { + set_rows_loaded(from.rows_loaded()); + } + if (from.nanoseconds() != 0) { + set_nanoseconds(from.nanoseconds()); + } +} + +void LoadDataResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.LoadDataResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LoadDataResponse::CopyFrom(const LoadDataResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.LoadDataResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LoadDataResponse::IsInitialized() const { + return true; +} + +void LoadDataResponse::Swap(LoadDataResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void LoadDataResponse::InternalSwap(LoadDataResponse* other) { + using std::swap; + swap(data_, other->data_); + swap(data_shape_, other->data_shape_); + swap(available_rows_, other->available_rows_); + swap(rows_loaded_, other->rows_loaded_); + swap(nanoseconds_, other->nanoseconds_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LoadDataResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GetShapeRequest::InitAsDefaultInstance() { + ::xla::_GetShapeRequest_default_instance_._instance.get_mutable()->data_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); +} +void GetShapeRequest::clear_data() { + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GetShapeRequest::kDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GetShapeRequest::GetShapeRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetShapeRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.GetShapeRequest) +} +GetShapeRequest::GetShapeRequest(const GetShapeRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_data()) { + data_ = new ::xla::GlobalDataHandle(*from.data_); + } else { + data_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.GetShapeRequest) +} + +void GetShapeRequest::SharedCtor() { + data_ = NULL; +} + +GetShapeRequest::~GetShapeRequest() { + // @@protoc_insertion_point(destructor:xla.GetShapeRequest) + SharedDtor(); +} + +void GetShapeRequest::SharedDtor() { + if (this != internal_default_instance()) delete data_; +} + +void GetShapeRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GetShapeRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GetShapeRequest& GetShapeRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetShapeRequest.base); + return *internal_default_instance(); +} + + +void GetShapeRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.GetShapeRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; + _internal_metadata_.Clear(); +} + +bool GetShapeRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.GetShapeRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.GetShapeRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.GetShapeRequest) + return false; +#undef DO_ +} + +void GetShapeRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.GetShapeRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_data(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.GetShapeRequest) +} + +::google::protobuf::uint8* GetShapeRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.GetShapeRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_data(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.GetShapeRequest) + return target; +} + +size_t GetShapeRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.GetShapeRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *data_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetShapeRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.GetShapeRequest) + GOOGLE_DCHECK_NE(&from, this); + const GetShapeRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.GetShapeRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.GetShapeRequest) + MergeFrom(*source); + } +} + +void GetShapeRequest::MergeFrom(const GetShapeRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.GetShapeRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_data()) { + mutable_data()->::xla::GlobalDataHandle::MergeFrom(from.data()); + } +} + +void GetShapeRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.GetShapeRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetShapeRequest::CopyFrom(const GetShapeRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.GetShapeRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetShapeRequest::IsInitialized() const { + return true; +} + +void GetShapeRequest::Swap(GetShapeRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void GetShapeRequest::InternalSwap(GetShapeRequest* other) { + using std::swap; + swap(data_, other->data_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GetShapeRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GetShapeResponse::InitAsDefaultInstance() { + ::xla::_GetShapeResponse_default_instance_._instance.get_mutable()->shape_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); +} +void GetShapeResponse::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GetShapeResponse::kShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GetShapeResponse::GetShapeResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetShapeResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.GetShapeResponse) +} +GetShapeResponse::GetShapeResponse(const GetShapeResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape()) { + shape_ = new ::xla::ShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.GetShapeResponse) +} + +void GetShapeResponse::SharedCtor() { + shape_ = NULL; +} + +GetShapeResponse::~GetShapeResponse() { + // @@protoc_insertion_point(destructor:xla.GetShapeResponse) + SharedDtor(); +} + +void GetShapeResponse::SharedDtor() { + if (this != internal_default_instance()) delete shape_; +} + +void GetShapeResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GetShapeResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GetShapeResponse& GetShapeResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_GetShapeResponse.base); + return *internal_default_instance(); +} + + +void GetShapeResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.GetShapeResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + _internal_metadata_.Clear(); +} + +bool GetShapeResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.GetShapeResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ShapeProto shape = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.GetShapeResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.GetShapeResponse) + return false; +#undef DO_ +} + +void GetShapeResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.GetShapeResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape = 1; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_shape(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.GetShapeResponse) +} + +::google::protobuf::uint8* GetShapeResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.GetShapeResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape = 1; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_shape(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.GetShapeResponse) + return target; +} + +size_t GetShapeResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.GetShapeResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.ShapeProto shape = 1; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetShapeResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.GetShapeResponse) + GOOGLE_DCHECK_NE(&from, this); + const GetShapeResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.GetShapeResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.GetShapeResponse) + MergeFrom(*source); + } +} + +void GetShapeResponse::MergeFrom(const GetShapeResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.GetShapeResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_shape()) { + mutable_shape()->::xla::ShapeProto::MergeFrom(from.shape()); + } +} + +void GetShapeResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.GetShapeResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetShapeResponse::CopyFrom(const GetShapeResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.GetShapeResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetShapeResponse::IsInitialized() const { + return true; +} + +void GetShapeResponse::Swap(GetShapeResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void GetShapeResponse::InternalSwap(GetShapeResponse* other) { + using std::swap; + swap(shape_, other->shape_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GetShapeResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void UnpackRequest::InitAsDefaultInstance() { + ::xla::_UnpackRequest_default_instance_._instance.get_mutable()->data_ = const_cast< ::xla::GlobalDataHandle*>( + ::xla::GlobalDataHandle::internal_default_instance()); +} +void UnpackRequest::clear_data() { + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int UnpackRequest::kDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +UnpackRequest::UnpackRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnpackRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.UnpackRequest) +} +UnpackRequest::UnpackRequest(const UnpackRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_data()) { + data_ = new ::xla::GlobalDataHandle(*from.data_); + } else { + data_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.UnpackRequest) +} + +void UnpackRequest::SharedCtor() { + data_ = NULL; +} + +UnpackRequest::~UnpackRequest() { + // @@protoc_insertion_point(destructor:xla.UnpackRequest) + SharedDtor(); +} + +void UnpackRequest::SharedDtor() { + if (this != internal_default_instance()) delete data_; +} + +void UnpackRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* UnpackRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const UnpackRequest& UnpackRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnpackRequest.base); + return *internal_default_instance(); +} + + +void UnpackRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.UnpackRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && data_ != NULL) { + delete data_; + } + data_ = NULL; + _internal_metadata_.Clear(); +} + +bool UnpackRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.UnpackRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.GlobalDataHandle data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.UnpackRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.UnpackRequest) + return false; +#undef DO_ +} + +void UnpackRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.UnpackRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_data(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.UnpackRequest) +} + +::google::protobuf::uint8* UnpackRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.UnpackRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_data(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.UnpackRequest) + return target; +} + +size_t UnpackRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.UnpackRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.GlobalDataHandle data = 1; + if (this->has_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *data_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void UnpackRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.UnpackRequest) + GOOGLE_DCHECK_NE(&from, this); + const UnpackRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.UnpackRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.UnpackRequest) + MergeFrom(*source); + } +} + +void UnpackRequest::MergeFrom(const UnpackRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.UnpackRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_data()) { + mutable_data()->::xla::GlobalDataHandle::MergeFrom(from.data()); + } +} + +void UnpackRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.UnpackRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void UnpackRequest::CopyFrom(const UnpackRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.UnpackRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool UnpackRequest::IsInitialized() const { + return true; +} + +void UnpackRequest::Swap(UnpackRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void UnpackRequest::InternalSwap(UnpackRequest* other) { + using std::swap; + swap(data_, other->data_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata UnpackRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void UnpackResponse::InitAsDefaultInstance() { +} +void UnpackResponse::clear_tied_data() { + tied_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int UnpackResponse::kTiedDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +UnpackResponse::UnpackResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnpackResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.UnpackResponse) +} +UnpackResponse::UnpackResponse(const UnpackResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + tied_data_(from.tied_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.UnpackResponse) +} + +void UnpackResponse::SharedCtor() { +} + +UnpackResponse::~UnpackResponse() { + // @@protoc_insertion_point(destructor:xla.UnpackResponse) + SharedDtor(); +} + +void UnpackResponse::SharedDtor() { +} + +void UnpackResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* UnpackResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const UnpackResponse& UnpackResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_UnpackResponse.base); + return *internal_default_instance(); +} + + +void UnpackResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.UnpackResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tied_data_.Clear(); + _internal_metadata_.Clear(); +} + +bool UnpackResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.UnpackResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.GlobalDataHandle tied_data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tied_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.UnpackResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.UnpackResponse) + return false; +#undef DO_ +} + +void UnpackResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.UnpackResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.GlobalDataHandle tied_data = 1; + for (unsigned int i = 0, + n = static_cast(this->tied_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->tied_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.UnpackResponse) +} + +::google::protobuf::uint8* UnpackResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.UnpackResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.GlobalDataHandle tied_data = 1; + for (unsigned int i = 0, + n = static_cast(this->tied_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->tied_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.UnpackResponse) + return target; +} + +size_t UnpackResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.UnpackResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.GlobalDataHandle tied_data = 1; + { + unsigned int count = static_cast(this->tied_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tied_data(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void UnpackResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.UnpackResponse) + GOOGLE_DCHECK_NE(&from, this); + const UnpackResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.UnpackResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.UnpackResponse) + MergeFrom(*source); + } +} + +void UnpackResponse::MergeFrom(const UnpackResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.UnpackResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + tied_data_.MergeFrom(from.tied_data_); +} + +void UnpackResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.UnpackResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void UnpackResponse::CopyFrom(const UnpackResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.UnpackResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool UnpackResponse::IsInitialized() const { + return true; +} + +void UnpackResponse::Swap(UnpackResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void UnpackResponse::InternalSwap(UnpackResponse* other) { + using std::swap; + CastToBase(&tied_data_)->InternalSwap(CastToBase(&other->tied_data_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata UnpackResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace xla +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::HloReducePrecisionOptions* Arena::CreateMaybeMessage< ::xla::HloReducePrecisionOptions >(Arena* arena) { + return Arena::CreateInternal< ::xla::HloReducePrecisionOptions >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse* Arena::CreateMaybeMessage< ::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DebugOptions* Arena::CreateMaybeMessage< ::xla::DebugOptions >(Arena* arena) { + return Arena::CreateInternal< ::xla::DebugOptions >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecutionOptions* Arena::CreateMaybeMessage< ::xla::ExecutionOptions >(Arena* arena) { + return Arena::CreateInternal< ::xla::ExecutionOptions >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::GetDeviceHandlesRequest* Arena::CreateMaybeMessage< ::xla::GetDeviceHandlesRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::GetDeviceHandlesRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::GetDeviceHandlesResponse* Arena::CreateMaybeMessage< ::xla::GetDeviceHandlesResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::GetDeviceHandlesResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferToClientRequest* Arena::CreateMaybeMessage< ::xla::TransferToClientRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferToClientRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferToClientResponse* Arena::CreateMaybeMessage< ::xla::TransferToClientResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferToClientResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferToServerRequest* Arena::CreateMaybeMessage< ::xla::TransferToServerRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferToServerRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferToServerResponse* Arena::CreateMaybeMessage< ::xla::TransferToServerResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferToServerResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferToInfeedRequest* Arena::CreateMaybeMessage< ::xla::TransferToInfeedRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferToInfeedRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferToInfeedResponse* Arena::CreateMaybeMessage< ::xla::TransferToInfeedResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferToInfeedResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferFromOutfeedRequest* Arena::CreateMaybeMessage< ::xla::TransferFromOutfeedRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferFromOutfeedRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TransferFromOutfeedResponse* Arena::CreateMaybeMessage< ::xla::TransferFromOutfeedResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::TransferFromOutfeedResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ResetDeviceRequest* Arena::CreateMaybeMessage< ::xla::ResetDeviceRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::ResetDeviceRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ResetDeviceResponse* Arena::CreateMaybeMessage< ::xla::ResetDeviceResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::ResetDeviceResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ComputationGraphStatsRequest* Arena::CreateMaybeMessage< ::xla::ComputationGraphStatsRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::ComputationGraphStatsRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ComputationStatsResponse* Arena::CreateMaybeMessage< ::xla::ComputationStatsResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::ComputationStatsResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::CreateChannelHandleRequest* Arena::CreateMaybeMessage< ::xla::CreateChannelHandleRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::CreateChannelHandleRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::CreateChannelHandleResponse* Arena::CreateMaybeMessage< ::xla::CreateChannelHandleResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::CreateChannelHandleResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::UnregisterRequest* Arena::CreateMaybeMessage< ::xla::UnregisterRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::UnregisterRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::UnregisterResponse* Arena::CreateMaybeMessage< ::xla::UnregisterResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::UnregisterResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::CompileRequest* Arena::CreateMaybeMessage< ::xla::CompileRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::CompileRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::CompileResponse* Arena::CreateMaybeMessage< ::xla::CompileResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::CompileResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecuteRequest* Arena::CreateMaybeMessage< ::xla::ExecuteRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::ExecuteRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecuteGraphRequest* Arena::CreateMaybeMessage< ::xla::ExecuteGraphRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::ExecuteGraphRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecuteGraphParallelRequest* Arena::CreateMaybeMessage< ::xla::ExecuteGraphParallelRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::ExecuteGraphParallelRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecuteResponse* Arena::CreateMaybeMessage< ::xla::ExecuteResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::ExecuteResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecuteParallelResponse* Arena::CreateMaybeMessage< ::xla::ExecuteParallelResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::ExecuteParallelResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::WaitForExecutionRequest* Arena::CreateMaybeMessage< ::xla::WaitForExecutionRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::WaitForExecutionRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::WaitForExecutionResponse* Arena::CreateMaybeMessage< ::xla::WaitForExecutionResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::WaitForExecutionResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ComputeConstantGraphRequest* Arena::CreateMaybeMessage< ::xla::ComputeConstantGraphRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::ComputeConstantGraphRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ComputeConstantResponse* Arena::CreateMaybeMessage< ::xla::ComputeConstantResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::ComputeConstantResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DeconstructTupleRequest* Arena::CreateMaybeMessage< ::xla::DeconstructTupleRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::DeconstructTupleRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DeconstructTupleResponse* Arena::CreateMaybeMessage< ::xla::DeconstructTupleResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::DeconstructTupleResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::LoadDataRequest* Arena::CreateMaybeMessage< ::xla::LoadDataRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::LoadDataRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::LoadDataResponse* Arena::CreateMaybeMessage< ::xla::LoadDataResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::LoadDataResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::GetShapeRequest* Arena::CreateMaybeMessage< ::xla::GetShapeRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::GetShapeRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::GetShapeResponse* Arena::CreateMaybeMessage< ::xla::GetShapeResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::GetShapeResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::UnpackRequest* Arena::CreateMaybeMessage< ::xla::UnpackRequest >(Arena* arena) { + return Arena::CreateInternal< ::xla::UnpackRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::UnpackResponse* Arena::CreateMaybeMessage< ::xla::UnpackResponse >(Arena* arena) { + return Arena::CreateInternal< ::xla::UnpackResponse >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.pb.h new file mode 100644 index 0000000..4d858d1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.pb.h @@ -0,0 +1,9329 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/xla.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include +#include "diplomacy_tensorflow/compiler/xla/xla_data.pb.h" +#include "diplomacy_tensorflow/compiler/xla/service/hlo.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[41]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto +namespace xla { +class CompileRequest; +class CompileRequestDefaultTypeInternal; +extern CompileRequestDefaultTypeInternal _CompileRequest_default_instance_; +class CompileResponse; +class CompileResponseDefaultTypeInternal; +extern CompileResponseDefaultTypeInternal _CompileResponse_default_instance_; +class ComputationGraphStatsRequest; +class ComputationGraphStatsRequestDefaultTypeInternal; +extern ComputationGraphStatsRequestDefaultTypeInternal _ComputationGraphStatsRequest_default_instance_; +class ComputationStatsResponse; +class ComputationStatsResponseDefaultTypeInternal; +extern ComputationStatsResponseDefaultTypeInternal _ComputationStatsResponse_default_instance_; +class ComputeConstantGraphRequest; +class ComputeConstantGraphRequestDefaultTypeInternal; +extern ComputeConstantGraphRequestDefaultTypeInternal _ComputeConstantGraphRequest_default_instance_; +class ComputeConstantResponse; +class ComputeConstantResponseDefaultTypeInternal; +extern ComputeConstantResponseDefaultTypeInternal _ComputeConstantResponse_default_instance_; +class CreateChannelHandleRequest; +class CreateChannelHandleRequestDefaultTypeInternal; +extern CreateChannelHandleRequestDefaultTypeInternal _CreateChannelHandleRequest_default_instance_; +class CreateChannelHandleResponse; +class CreateChannelHandleResponseDefaultTypeInternal; +extern CreateChannelHandleResponseDefaultTypeInternal _CreateChannelHandleResponse_default_instance_; +class DebugOptions; +class DebugOptionsDefaultTypeInternal; +extern DebugOptionsDefaultTypeInternal _DebugOptions_default_instance_; +class DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse; +class DebugOptions_XlaBackendExtraOptionsEntry_DoNotUseDefaultTypeInternal; +extern DebugOptions_XlaBackendExtraOptionsEntry_DoNotUseDefaultTypeInternal _DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse_default_instance_; +class DeconstructTupleRequest; +class DeconstructTupleRequestDefaultTypeInternal; +extern DeconstructTupleRequestDefaultTypeInternal _DeconstructTupleRequest_default_instance_; +class DeconstructTupleResponse; +class DeconstructTupleResponseDefaultTypeInternal; +extern DeconstructTupleResponseDefaultTypeInternal _DeconstructTupleResponse_default_instance_; +class ExecuteGraphParallelRequest; +class ExecuteGraphParallelRequestDefaultTypeInternal; +extern ExecuteGraphParallelRequestDefaultTypeInternal _ExecuteGraphParallelRequest_default_instance_; +class ExecuteGraphRequest; +class ExecuteGraphRequestDefaultTypeInternal; +extern ExecuteGraphRequestDefaultTypeInternal _ExecuteGraphRequest_default_instance_; +class ExecuteParallelResponse; +class ExecuteParallelResponseDefaultTypeInternal; +extern ExecuteParallelResponseDefaultTypeInternal _ExecuteParallelResponse_default_instance_; +class ExecuteRequest; +class ExecuteRequestDefaultTypeInternal; +extern ExecuteRequestDefaultTypeInternal _ExecuteRequest_default_instance_; +class ExecuteResponse; +class ExecuteResponseDefaultTypeInternal; +extern ExecuteResponseDefaultTypeInternal _ExecuteResponse_default_instance_; +class ExecutionOptions; +class ExecutionOptionsDefaultTypeInternal; +extern ExecutionOptionsDefaultTypeInternal _ExecutionOptions_default_instance_; +class GetDeviceHandlesRequest; +class GetDeviceHandlesRequestDefaultTypeInternal; +extern GetDeviceHandlesRequestDefaultTypeInternal _GetDeviceHandlesRequest_default_instance_; +class GetDeviceHandlesResponse; +class GetDeviceHandlesResponseDefaultTypeInternal; +extern GetDeviceHandlesResponseDefaultTypeInternal _GetDeviceHandlesResponse_default_instance_; +class GetShapeRequest; +class GetShapeRequestDefaultTypeInternal; +extern GetShapeRequestDefaultTypeInternal _GetShapeRequest_default_instance_; +class GetShapeResponse; +class GetShapeResponseDefaultTypeInternal; +extern GetShapeResponseDefaultTypeInternal _GetShapeResponse_default_instance_; +class HloReducePrecisionOptions; +class HloReducePrecisionOptionsDefaultTypeInternal; +extern HloReducePrecisionOptionsDefaultTypeInternal _HloReducePrecisionOptions_default_instance_; +class LoadDataRequest; +class LoadDataRequestDefaultTypeInternal; +extern LoadDataRequestDefaultTypeInternal _LoadDataRequest_default_instance_; +class LoadDataResponse; +class LoadDataResponseDefaultTypeInternal; +extern LoadDataResponseDefaultTypeInternal _LoadDataResponse_default_instance_; +class ResetDeviceRequest; +class ResetDeviceRequestDefaultTypeInternal; +extern ResetDeviceRequestDefaultTypeInternal _ResetDeviceRequest_default_instance_; +class ResetDeviceResponse; +class ResetDeviceResponseDefaultTypeInternal; +extern ResetDeviceResponseDefaultTypeInternal _ResetDeviceResponse_default_instance_; +class TransferFromOutfeedRequest; +class TransferFromOutfeedRequestDefaultTypeInternal; +extern TransferFromOutfeedRequestDefaultTypeInternal _TransferFromOutfeedRequest_default_instance_; +class TransferFromOutfeedResponse; +class TransferFromOutfeedResponseDefaultTypeInternal; +extern TransferFromOutfeedResponseDefaultTypeInternal _TransferFromOutfeedResponse_default_instance_; +class TransferToClientRequest; +class TransferToClientRequestDefaultTypeInternal; +extern TransferToClientRequestDefaultTypeInternal _TransferToClientRequest_default_instance_; +class TransferToClientResponse; +class TransferToClientResponseDefaultTypeInternal; +extern TransferToClientResponseDefaultTypeInternal _TransferToClientResponse_default_instance_; +class TransferToInfeedRequest; +class TransferToInfeedRequestDefaultTypeInternal; +extern TransferToInfeedRequestDefaultTypeInternal _TransferToInfeedRequest_default_instance_; +class TransferToInfeedResponse; +class TransferToInfeedResponseDefaultTypeInternal; +extern TransferToInfeedResponseDefaultTypeInternal _TransferToInfeedResponse_default_instance_; +class TransferToServerRequest; +class TransferToServerRequestDefaultTypeInternal; +extern TransferToServerRequestDefaultTypeInternal _TransferToServerRequest_default_instance_; +class TransferToServerResponse; +class TransferToServerResponseDefaultTypeInternal; +extern TransferToServerResponseDefaultTypeInternal _TransferToServerResponse_default_instance_; +class UnpackRequest; +class UnpackRequestDefaultTypeInternal; +extern UnpackRequestDefaultTypeInternal _UnpackRequest_default_instance_; +class UnpackResponse; +class UnpackResponseDefaultTypeInternal; +extern UnpackResponseDefaultTypeInternal _UnpackResponse_default_instance_; +class UnregisterRequest; +class UnregisterRequestDefaultTypeInternal; +extern UnregisterRequestDefaultTypeInternal _UnregisterRequest_default_instance_; +class UnregisterResponse; +class UnregisterResponseDefaultTypeInternal; +extern UnregisterResponseDefaultTypeInternal _UnregisterResponse_default_instance_; +class WaitForExecutionRequest; +class WaitForExecutionRequestDefaultTypeInternal; +extern WaitForExecutionRequestDefaultTypeInternal _WaitForExecutionRequest_default_instance_; +class WaitForExecutionResponse; +class WaitForExecutionResponseDefaultTypeInternal; +extern WaitForExecutionResponseDefaultTypeInternal _WaitForExecutionResponse_default_instance_; +} // namespace xla +namespace google { +namespace protobuf { +template<> ::xla::CompileRequest* Arena::CreateMaybeMessage<::xla::CompileRequest>(Arena*); +template<> ::xla::CompileResponse* Arena::CreateMaybeMessage<::xla::CompileResponse>(Arena*); +template<> ::xla::ComputationGraphStatsRequest* Arena::CreateMaybeMessage<::xla::ComputationGraphStatsRequest>(Arena*); +template<> ::xla::ComputationStatsResponse* Arena::CreateMaybeMessage<::xla::ComputationStatsResponse>(Arena*); +template<> ::xla::ComputeConstantGraphRequest* Arena::CreateMaybeMessage<::xla::ComputeConstantGraphRequest>(Arena*); +template<> ::xla::ComputeConstantResponse* Arena::CreateMaybeMessage<::xla::ComputeConstantResponse>(Arena*); +template<> ::xla::CreateChannelHandleRequest* Arena::CreateMaybeMessage<::xla::CreateChannelHandleRequest>(Arena*); +template<> ::xla::CreateChannelHandleResponse* Arena::CreateMaybeMessage<::xla::CreateChannelHandleResponse>(Arena*); +template<> ::xla::DebugOptions* Arena::CreateMaybeMessage<::xla::DebugOptions>(Arena*); +template<> ::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse* Arena::CreateMaybeMessage<::xla::DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse>(Arena*); +template<> ::xla::DeconstructTupleRequest* Arena::CreateMaybeMessage<::xla::DeconstructTupleRequest>(Arena*); +template<> ::xla::DeconstructTupleResponse* Arena::CreateMaybeMessage<::xla::DeconstructTupleResponse>(Arena*); +template<> ::xla::ExecuteGraphParallelRequest* Arena::CreateMaybeMessage<::xla::ExecuteGraphParallelRequest>(Arena*); +template<> ::xla::ExecuteGraphRequest* Arena::CreateMaybeMessage<::xla::ExecuteGraphRequest>(Arena*); +template<> ::xla::ExecuteParallelResponse* Arena::CreateMaybeMessage<::xla::ExecuteParallelResponse>(Arena*); +template<> ::xla::ExecuteRequest* Arena::CreateMaybeMessage<::xla::ExecuteRequest>(Arena*); +template<> ::xla::ExecuteResponse* Arena::CreateMaybeMessage<::xla::ExecuteResponse>(Arena*); +template<> ::xla::ExecutionOptions* Arena::CreateMaybeMessage<::xla::ExecutionOptions>(Arena*); +template<> ::xla::GetDeviceHandlesRequest* Arena::CreateMaybeMessage<::xla::GetDeviceHandlesRequest>(Arena*); +template<> ::xla::GetDeviceHandlesResponse* Arena::CreateMaybeMessage<::xla::GetDeviceHandlesResponse>(Arena*); +template<> ::xla::GetShapeRequest* Arena::CreateMaybeMessage<::xla::GetShapeRequest>(Arena*); +template<> ::xla::GetShapeResponse* Arena::CreateMaybeMessage<::xla::GetShapeResponse>(Arena*); +template<> ::xla::HloReducePrecisionOptions* Arena::CreateMaybeMessage<::xla::HloReducePrecisionOptions>(Arena*); +template<> ::xla::LoadDataRequest* Arena::CreateMaybeMessage<::xla::LoadDataRequest>(Arena*); +template<> ::xla::LoadDataResponse* Arena::CreateMaybeMessage<::xla::LoadDataResponse>(Arena*); +template<> ::xla::ResetDeviceRequest* Arena::CreateMaybeMessage<::xla::ResetDeviceRequest>(Arena*); +template<> ::xla::ResetDeviceResponse* Arena::CreateMaybeMessage<::xla::ResetDeviceResponse>(Arena*); +template<> ::xla::TransferFromOutfeedRequest* Arena::CreateMaybeMessage<::xla::TransferFromOutfeedRequest>(Arena*); +template<> ::xla::TransferFromOutfeedResponse* Arena::CreateMaybeMessage<::xla::TransferFromOutfeedResponse>(Arena*); +template<> ::xla::TransferToClientRequest* Arena::CreateMaybeMessage<::xla::TransferToClientRequest>(Arena*); +template<> ::xla::TransferToClientResponse* Arena::CreateMaybeMessage<::xla::TransferToClientResponse>(Arena*); +template<> ::xla::TransferToInfeedRequest* Arena::CreateMaybeMessage<::xla::TransferToInfeedRequest>(Arena*); +template<> ::xla::TransferToInfeedResponse* Arena::CreateMaybeMessage<::xla::TransferToInfeedResponse>(Arena*); +template<> ::xla::TransferToServerRequest* Arena::CreateMaybeMessage<::xla::TransferToServerRequest>(Arena*); +template<> ::xla::TransferToServerResponse* Arena::CreateMaybeMessage<::xla::TransferToServerResponse>(Arena*); +template<> ::xla::UnpackRequest* Arena::CreateMaybeMessage<::xla::UnpackRequest>(Arena*); +template<> ::xla::UnpackResponse* Arena::CreateMaybeMessage<::xla::UnpackResponse>(Arena*); +template<> ::xla::UnregisterRequest* Arena::CreateMaybeMessage<::xla::UnregisterRequest>(Arena*); +template<> ::xla::UnregisterResponse* Arena::CreateMaybeMessage<::xla::UnregisterResponse>(Arena*); +template<> ::xla::WaitForExecutionRequest* Arena::CreateMaybeMessage<::xla::WaitForExecutionRequest>(Arena*); +template<> ::xla::WaitForExecutionResponse* Arena::CreateMaybeMessage<::xla::WaitForExecutionResponse>(Arena*); +} // namespace protobuf +} // namespace google +namespace xla { + +enum HloReducePrecisionOptions_Location { + HloReducePrecisionOptions_Location_OP_INPUTS = 0, + HloReducePrecisionOptions_Location_OP_OUTPUTS = 1, + HloReducePrecisionOptions_Location_UNFUSED_OP_OUTPUTS = 2, + HloReducePrecisionOptions_Location_FUSION_INPUTS_BY_CONTENT = 3, + HloReducePrecisionOptions_Location_FUSION_OUTPUTS_BY_CONTENT = 4, + HloReducePrecisionOptions_Location_HloReducePrecisionOptions_Location_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + HloReducePrecisionOptions_Location_HloReducePrecisionOptions_Location_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool HloReducePrecisionOptions_Location_IsValid(int value); +const HloReducePrecisionOptions_Location HloReducePrecisionOptions_Location_Location_MIN = HloReducePrecisionOptions_Location_OP_INPUTS; +const HloReducePrecisionOptions_Location HloReducePrecisionOptions_Location_Location_MAX = HloReducePrecisionOptions_Location_FUSION_OUTPUTS_BY_CONTENT; +const int HloReducePrecisionOptions_Location_Location_ARRAYSIZE = HloReducePrecisionOptions_Location_Location_MAX + 1; + +const ::google::protobuf::EnumDescriptor* HloReducePrecisionOptions_Location_descriptor(); +inline const ::std::string& HloReducePrecisionOptions_Location_Name(HloReducePrecisionOptions_Location value) { + return ::google::protobuf::internal::NameOfEnum( + HloReducePrecisionOptions_Location_descriptor(), value); +} +inline bool HloReducePrecisionOptions_Location_Parse( + const ::std::string& name, HloReducePrecisionOptions_Location* value) { + return ::google::protobuf::internal::ParseNamedEnum( + HloReducePrecisionOptions_Location_descriptor(), name, value); +} +// =================================================================== + +class HloReducePrecisionOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.HloReducePrecisionOptions) */ { + public: + HloReducePrecisionOptions(); + virtual ~HloReducePrecisionOptions(); + + HloReducePrecisionOptions(const HloReducePrecisionOptions& from); + + inline HloReducePrecisionOptions& operator=(const HloReducePrecisionOptions& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HloReducePrecisionOptions(HloReducePrecisionOptions&& from) noexcept + : HloReducePrecisionOptions() { + *this = ::std::move(from); + } + + inline HloReducePrecisionOptions& operator=(HloReducePrecisionOptions&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const HloReducePrecisionOptions& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HloReducePrecisionOptions* internal_default_instance() { + return reinterpret_cast( + &_HloReducePrecisionOptions_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(HloReducePrecisionOptions* other); + friend void swap(HloReducePrecisionOptions& a, HloReducePrecisionOptions& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HloReducePrecisionOptions* New() const final { + return CreateMaybeMessage(NULL); + } + + HloReducePrecisionOptions* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HloReducePrecisionOptions& from); + void MergeFrom(const HloReducePrecisionOptions& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HloReducePrecisionOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HloReducePrecisionOptions_Location Location; + static const Location OP_INPUTS = + HloReducePrecisionOptions_Location_OP_INPUTS; + static const Location OP_OUTPUTS = + HloReducePrecisionOptions_Location_OP_OUTPUTS; + static const Location UNFUSED_OP_OUTPUTS = + HloReducePrecisionOptions_Location_UNFUSED_OP_OUTPUTS; + static const Location FUSION_INPUTS_BY_CONTENT = + HloReducePrecisionOptions_Location_FUSION_INPUTS_BY_CONTENT; + static const Location FUSION_OUTPUTS_BY_CONTENT = + HloReducePrecisionOptions_Location_FUSION_OUTPUTS_BY_CONTENT; + static inline bool Location_IsValid(int value) { + return HloReducePrecisionOptions_Location_IsValid(value); + } + static const Location Location_MIN = + HloReducePrecisionOptions_Location_Location_MIN; + static const Location Location_MAX = + HloReducePrecisionOptions_Location_Location_MAX; + static const int Location_ARRAYSIZE = + HloReducePrecisionOptions_Location_Location_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Location_descriptor() { + return HloReducePrecisionOptions_Location_descriptor(); + } + static inline const ::std::string& Location_Name(Location value) { + return HloReducePrecisionOptions_Location_Name(value); + } + static inline bool Location_Parse(const ::std::string& name, + Location* value) { + return HloReducePrecisionOptions_Location_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // repeated uint32 opcodes_to_suffix = 4; + int opcodes_to_suffix_size() const; + void clear_opcodes_to_suffix(); + static const int kOpcodesToSuffixFieldNumber = 4; + ::google::protobuf::uint32 opcodes_to_suffix(int index) const; + void set_opcodes_to_suffix(int index, ::google::protobuf::uint32 value); + void add_opcodes_to_suffix(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + opcodes_to_suffix() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_opcodes_to_suffix(); + + // repeated string opname_substrings_to_suffix = 5; + int opname_substrings_to_suffix_size() const; + void clear_opname_substrings_to_suffix(); + static const int kOpnameSubstringsToSuffixFieldNumber = 5; + const ::std::string& opname_substrings_to_suffix(int index) const; + ::std::string* mutable_opname_substrings_to_suffix(int index); + void set_opname_substrings_to_suffix(int index, const ::std::string& value); + #if LANG_CXX11 + void set_opname_substrings_to_suffix(int index, ::std::string&& value); + #endif + void set_opname_substrings_to_suffix(int index, const char* value); + void set_opname_substrings_to_suffix(int index, const char* value, size_t size); + ::std::string* add_opname_substrings_to_suffix(); + void add_opname_substrings_to_suffix(const ::std::string& value); + #if LANG_CXX11 + void add_opname_substrings_to_suffix(::std::string&& value); + #endif + void add_opname_substrings_to_suffix(const char* value); + void add_opname_substrings_to_suffix(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& opname_substrings_to_suffix() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_opname_substrings_to_suffix(); + + // .xla.HloReducePrecisionOptions.Location location = 1; + void clear_location(); + static const int kLocationFieldNumber = 1; + ::xla::HloReducePrecisionOptions_Location location() const; + void set_location(::xla::HloReducePrecisionOptions_Location value); + + // uint32 exponent_bits = 2; + void clear_exponent_bits(); + static const int kExponentBitsFieldNumber = 2; + ::google::protobuf::uint32 exponent_bits() const; + void set_exponent_bits(::google::protobuf::uint32 value); + + // uint32 mantissa_bits = 3; + void clear_mantissa_bits(); + static const int kMantissaBitsFieldNumber = 3; + ::google::protobuf::uint32 mantissa_bits() const; + void set_mantissa_bits(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:xla.HloReducePrecisionOptions) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > opcodes_to_suffix_; + mutable int _opcodes_to_suffix_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::std::string> opname_substrings_to_suffix_; + int location_; + ::google::protobuf::uint32 exponent_bits_; + ::google::protobuf::uint32 mantissa_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse(); + DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse& other); + static const DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class DebugOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DebugOptions) */ { + public: + DebugOptions(); + virtual ~DebugOptions(); + + DebugOptions(const DebugOptions& from); + + inline DebugOptions& operator=(const DebugOptions& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DebugOptions(DebugOptions&& from) noexcept + : DebugOptions() { + *this = ::std::move(from); + } + + inline DebugOptions& operator=(DebugOptions&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DebugOptions& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DebugOptions* internal_default_instance() { + return reinterpret_cast( + &_DebugOptions_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(DebugOptions* other); + friend void swap(DebugOptions& a, DebugOptions& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DebugOptions* New() const final { + return CreateMaybeMessage(NULL); + } + + DebugOptions* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DebugOptions& from); + void MergeFrom(const DebugOptions& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DebugOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // repeated string xla_disable_hlo_passes = 30; + int xla_disable_hlo_passes_size() const; + void clear_xla_disable_hlo_passes(); + static const int kXlaDisableHloPassesFieldNumber = 30; + const ::std::string& xla_disable_hlo_passes(int index) const; + ::std::string* mutable_xla_disable_hlo_passes(int index); + void set_xla_disable_hlo_passes(int index, const ::std::string& value); + #if LANG_CXX11 + void set_xla_disable_hlo_passes(int index, ::std::string&& value); + #endif + void set_xla_disable_hlo_passes(int index, const char* value); + void set_xla_disable_hlo_passes(int index, const char* value, size_t size); + ::std::string* add_xla_disable_hlo_passes(); + void add_xla_disable_hlo_passes(const ::std::string& value); + #if LANG_CXX11 + void add_xla_disable_hlo_passes(::std::string&& value); + #endif + void add_xla_disable_hlo_passes(const char* value); + void add_xla_disable_hlo_passes(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& xla_disable_hlo_passes() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_xla_disable_hlo_passes(); + + // repeated .xla.HloReducePrecisionOptions hlo_reduce_precision_options = 80; + int hlo_reduce_precision_options_size() const; + void clear_hlo_reduce_precision_options(); + static const int kHloReducePrecisionOptionsFieldNumber = 80; + ::xla::HloReducePrecisionOptions* mutable_hlo_reduce_precision_options(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloReducePrecisionOptions >* + mutable_hlo_reduce_precision_options(); + const ::xla::HloReducePrecisionOptions& hlo_reduce_precision_options(int index) const; + ::xla::HloReducePrecisionOptions* add_hlo_reduce_precision_options(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloReducePrecisionOptions >& + hlo_reduce_precision_options() const; + + // map xla_backend_extra_options = 500; + int xla_backend_extra_options_size() const; + void clear_xla_backend_extra_options(); + static const int kXlaBackendExtraOptionsFieldNumber = 500; + const ::google::protobuf::Map< ::std::string, ::std::string >& + xla_backend_extra_options() const; + ::google::protobuf::Map< ::std::string, ::std::string >* + mutable_xla_backend_extra_options(); + + // string xla_generate_hlo_graph = 1; + void clear_xla_generate_hlo_graph(); + static const int kXlaGenerateHloGraphFieldNumber = 1; + const ::std::string& xla_generate_hlo_graph() const; + void set_xla_generate_hlo_graph(const ::std::string& value); + #if LANG_CXX11 + void set_xla_generate_hlo_graph(::std::string&& value); + #endif + void set_xla_generate_hlo_graph(const char* value); + void set_xla_generate_hlo_graph(const char* value, size_t size); + ::std::string* mutable_xla_generate_hlo_graph(); + ::std::string* release_xla_generate_hlo_graph(); + void set_allocated_xla_generate_hlo_graph(::std::string* xla_generate_hlo_graph); + + // string xla_hlo_graph_path = 4; + void clear_xla_hlo_graph_path(); + static const int kXlaHloGraphPathFieldNumber = 4; + const ::std::string& xla_hlo_graph_path() const; + void set_xla_hlo_graph_path(const ::std::string& value); + #if LANG_CXX11 + void set_xla_hlo_graph_path(::std::string&& value); + #endif + void set_xla_hlo_graph_path(const char* value); + void set_xla_hlo_graph_path(const char* value, size_t size); + ::std::string* mutable_xla_hlo_graph_path(); + ::std::string* release_xla_hlo_graph_path(); + void set_allocated_xla_hlo_graph_path(::std::string* xla_hlo_graph_path); + + // string xla_log_hlo_text = 6; + void clear_xla_log_hlo_text(); + static const int kXlaLogHloTextFieldNumber = 6; + const ::std::string& xla_log_hlo_text() const; + void set_xla_log_hlo_text(const ::std::string& value); + #if LANG_CXX11 + void set_xla_log_hlo_text(::std::string&& value); + #endif + void set_xla_log_hlo_text(const char* value); + void set_xla_log_hlo_text(const char* value, size_t size); + ::std::string* mutable_xla_log_hlo_text(); + ::std::string* release_xla_log_hlo_text(); + void set_allocated_xla_log_hlo_text(::std::string* xla_log_hlo_text); + + // string xla_generate_hlo_text_to = 7; + void clear_xla_generate_hlo_text_to(); + static const int kXlaGenerateHloTextToFieldNumber = 7; + const ::std::string& xla_generate_hlo_text_to() const; + void set_xla_generate_hlo_text_to(const ::std::string& value); + #if LANG_CXX11 + void set_xla_generate_hlo_text_to(::std::string&& value); + #endif + void set_xla_generate_hlo_text_to(const char* value); + void set_xla_generate_hlo_text_to(const char* value, size_t size); + ::std::string* mutable_xla_generate_hlo_text_to(); + ::std::string* release_xla_generate_hlo_text_to(); + void set_allocated_xla_generate_hlo_text_to(::std::string* xla_generate_hlo_text_to); + + // string xla_dump_optimized_hlo_proto_to = 8; + void clear_xla_dump_optimized_hlo_proto_to(); + static const int kXlaDumpOptimizedHloProtoToFieldNumber = 8; + const ::std::string& xla_dump_optimized_hlo_proto_to() const; + void set_xla_dump_optimized_hlo_proto_to(const ::std::string& value); + #if LANG_CXX11 + void set_xla_dump_optimized_hlo_proto_to(::std::string&& value); + #endif + void set_xla_dump_optimized_hlo_proto_to(const char* value); + void set_xla_dump_optimized_hlo_proto_to(const char* value, size_t size); + ::std::string* mutable_xla_dump_optimized_hlo_proto_to(); + ::std::string* release_xla_dump_optimized_hlo_proto_to(); + void set_allocated_xla_dump_optimized_hlo_proto_to(::std::string* xla_dump_optimized_hlo_proto_to); + + // string xla_dump_computations_to = 10; + void clear_xla_dump_computations_to(); + static const int kXlaDumpComputationsToFieldNumber = 10; + const ::std::string& xla_dump_computations_to() const; + void set_xla_dump_computations_to(const ::std::string& value); + #if LANG_CXX11 + void set_xla_dump_computations_to(::std::string&& value); + #endif + void set_xla_dump_computations_to(const char* value); + void set_xla_dump_computations_to(const char* value, size_t size); + ::std::string* mutable_xla_dump_computations_to(); + ::std::string* release_xla_dump_computations_to(); + void set_allocated_xla_dump_computations_to(::std::string* xla_dump_computations_to); + + // string xla_dump_executions_to = 11; + void clear_xla_dump_executions_to(); + static const int kXlaDumpExecutionsToFieldNumber = 11; + const ::std::string& xla_dump_executions_to() const; + void set_xla_dump_executions_to(const ::std::string& value); + #if LANG_CXX11 + void set_xla_dump_executions_to(::std::string&& value); + #endif + void set_xla_dump_executions_to(const char* value); + void set_xla_dump_executions_to(const char* value, size_t size); + ::std::string* mutable_xla_dump_executions_to(); + ::std::string* release_xla_dump_executions_to(); + void set_allocated_xla_dump_executions_to(::std::string* xla_dump_executions_to); + + // string xla_dump_ir_to = 34; + void clear_xla_dump_ir_to(); + static const int kXlaDumpIrToFieldNumber = 34; + const ::std::string& xla_dump_ir_to() const; + void set_xla_dump_ir_to(const ::std::string& value); + #if LANG_CXX11 + void set_xla_dump_ir_to(::std::string&& value); + #endif + void set_xla_dump_ir_to(const char* value); + void set_xla_dump_ir_to(const char* value, size_t size); + ::std::string* mutable_xla_dump_ir_to(); + ::std::string* release_xla_dump_ir_to(); + void set_allocated_xla_dump_ir_to(::std::string* xla_dump_ir_to); + + // string xla_gpu_cuda_data_dir = 61; + void clear_xla_gpu_cuda_data_dir(); + static const int kXlaGpuCudaDataDirFieldNumber = 61; + const ::std::string& xla_gpu_cuda_data_dir() const; + void set_xla_gpu_cuda_data_dir(const ::std::string& value); + #if LANG_CXX11 + void set_xla_gpu_cuda_data_dir(::std::string&& value); + #endif + void set_xla_gpu_cuda_data_dir(const char* value); + void set_xla_gpu_cuda_data_dir(const char* value, size_t size); + ::std::string* mutable_xla_gpu_cuda_data_dir(); + ::std::string* release_xla_gpu_cuda_data_dir(); + void set_allocated_xla_gpu_cuda_data_dir(::std::string* xla_gpu_cuda_data_dir); + + // string xla_dump_unoptimized_hlo_proto_to = 95; + void clear_xla_dump_unoptimized_hlo_proto_to(); + static const int kXlaDumpUnoptimizedHloProtoToFieldNumber = 95; + const ::std::string& xla_dump_unoptimized_hlo_proto_to() const; + void set_xla_dump_unoptimized_hlo_proto_to(const ::std::string& value); + #if LANG_CXX11 + void set_xla_dump_unoptimized_hlo_proto_to(::std::string&& value); + #endif + void set_xla_dump_unoptimized_hlo_proto_to(const char* value); + void set_xla_dump_unoptimized_hlo_proto_to(const char* value, size_t size); + ::std::string* mutable_xla_dump_unoptimized_hlo_proto_to(); + ::std::string* release_xla_dump_unoptimized_hlo_proto_to(); + void set_allocated_xla_dump_unoptimized_hlo_proto_to(::std::string* xla_dump_unoptimized_hlo_proto_to); + + // string xla_dump_per_pass_hlo_proto_to = 96; + void clear_xla_dump_per_pass_hlo_proto_to(); + static const int kXlaDumpPerPassHloProtoToFieldNumber = 96; + const ::std::string& xla_dump_per_pass_hlo_proto_to() const; + void set_xla_dump_per_pass_hlo_proto_to(const ::std::string& value); + #if LANG_CXX11 + void set_xla_dump_per_pass_hlo_proto_to(::std::string&& value); + #endif + void set_xla_dump_per_pass_hlo_proto_to(const char* value); + void set_xla_dump_per_pass_hlo_proto_to(const char* value, size_t size); + ::std::string* mutable_xla_dump_per_pass_hlo_proto_to(); + ::std::string* release_xla_dump_per_pass_hlo_proto_to(); + void set_allocated_xla_dump_per_pass_hlo_proto_to(::std::string* xla_dump_per_pass_hlo_proto_to); + + // bool xla_hlo_graph_addresses = 2; + void clear_xla_hlo_graph_addresses(); + static const int kXlaHloGraphAddressesFieldNumber = 2; + bool xla_hlo_graph_addresses() const; + void set_xla_hlo_graph_addresses(bool value); + + // bool xla_hlo_dump_as_graphdef = 5; + void clear_xla_hlo_dump_as_graphdef(); + static const int kXlaHloDumpAsGraphdefFieldNumber = 5; + bool xla_hlo_dump_as_graphdef() const; + void set_xla_hlo_dump_as_graphdef(bool value); + + // bool xla_hlo_profile = 9; + void clear_xla_hlo_profile(); + static const int kXlaHloProfileFieldNumber = 9; + bool xla_hlo_profile() const; + void set_xla_hlo_profile(bool value); + + // bool xla_disable_all_hlo_passes = 104; + void clear_xla_disable_all_hlo_passes(); + static const int kXlaDisableAllHloPassesFieldNumber = 104; + bool xla_disable_all_hlo_passes() const; + void set_xla_disable_all_hlo_passes(bool value); + + // int32 xla_backend_optimization_level = 31; + void clear_xla_backend_optimization_level(); + static const int kXlaBackendOptimizationLevelFieldNumber = 31; + ::google::protobuf::int32 xla_backend_optimization_level() const; + void set_xla_backend_optimization_level(::google::protobuf::int32 value); + + // bool xla_embed_ir_in_executable = 33; + void clear_xla_embed_ir_in_executable(); + static const int kXlaEmbedIrInExecutableFieldNumber = 33; + bool xla_embed_ir_in_executable() const; + void set_xla_embed_ir_in_executable(bool value); + + // bool xla_eliminate_hlo_implicit_broadcast = 35; + void clear_xla_eliminate_hlo_implicit_broadcast(); + static const int kXlaEliminateHloImplicitBroadcastFieldNumber = 35; + bool xla_eliminate_hlo_implicit_broadcast() const; + void set_xla_eliminate_hlo_implicit_broadcast(bool value); + + // bool xla_cpu_multi_thread_eigen = 60; + void clear_xla_cpu_multi_thread_eigen(); + static const int kXlaCpuMultiThreadEigenFieldNumber = 60; + bool xla_cpu_multi_thread_eigen() const; + void set_xla_cpu_multi_thread_eigen(bool value); + + // bool xla_gpu_ftz = 62; + void clear_xla_gpu_ftz(); + static const int kXlaGpuFtzFieldNumber = 62; + bool xla_gpu_ftz() const; + void set_xla_gpu_ftz(bool value); + + // bool xla_gpu_disable_multi_streaming = 63; + void clear_xla_gpu_disable_multi_streaming(); + static const int kXlaGpuDisableMultiStreamingFieldNumber = 63; + bool xla_gpu_disable_multi_streaming() const; + void set_xla_gpu_disable_multi_streaming(bool value); + + // bool xla_llvm_enable_alias_scope_metadata = 70; + void clear_xla_llvm_enable_alias_scope_metadata(); + static const int kXlaLlvmEnableAliasScopeMetadataFieldNumber = 70; + bool xla_llvm_enable_alias_scope_metadata() const; + void set_xla_llvm_enable_alias_scope_metadata(bool value); + + // bool xla_llvm_enable_noalias_metadata = 71; + void clear_xla_llvm_enable_noalias_metadata(); + static const int kXlaLlvmEnableNoaliasMetadataFieldNumber = 71; + bool xla_llvm_enable_noalias_metadata() const; + void set_xla_llvm_enable_noalias_metadata(bool value); + + // bool xla_llvm_enable_invariant_load_metadata = 72; + void clear_xla_llvm_enable_invariant_load_metadata(); + static const int kXlaLlvmEnableInvariantLoadMetadataFieldNumber = 72; + bool xla_llvm_enable_invariant_load_metadata() const; + void set_xla_llvm_enable_invariant_load_metadata(bool value); + + // bool xla_llvm_disable_expensive_passes = 73; + void clear_xla_llvm_disable_expensive_passes(); + static const int kXlaLlvmDisableExpensivePassesFieldNumber = 73; + bool xla_llvm_disable_expensive_passes() const; + void set_xla_llvm_disable_expensive_passes(bool value); + + // bool xla_test_all_output_layouts = 90; + void clear_xla_test_all_output_layouts(); + static const int kXlaTestAllOutputLayoutsFieldNumber = 90; + bool xla_test_all_output_layouts() const; + void set_xla_test_all_output_layouts(bool value); + + // bool xla_test_all_input_layouts = 91; + void clear_xla_test_all_input_layouts(); + static const int kXlaTestAllInputLayoutsFieldNumber = 91; + bool xla_test_all_input_layouts() const; + void set_xla_test_all_input_layouts(bool value); + + // bool xla_hlo_graph_sharding_color = 92; + void clear_xla_hlo_graph_sharding_color(); + static const int kXlaHloGraphShardingColorFieldNumber = 92; + bool xla_hlo_graph_sharding_color() const; + void set_xla_hlo_graph_sharding_color(bool value); + + // bool xla_hlo_tfgraph_device_scopes = 93; + void clear_xla_hlo_tfgraph_device_scopes(); + static const int kXlaHloTfgraphDeviceScopesFieldNumber = 93; + bool xla_hlo_tfgraph_device_scopes() const; + void set_xla_hlo_tfgraph_device_scopes(bool value); + + // bool xla_gpu_use_cudnn_batchnorm = 94; + void clear_xla_gpu_use_cudnn_batchnorm(); + static const int kXlaGpuUseCudnnBatchnormFieldNumber = 94; + bool xla_gpu_use_cudnn_batchnorm() const; + void set_xla_gpu_use_cudnn_batchnorm(bool value); + + // bool xla_cpu_use_mkl_dnn = 97; + void clear_xla_cpu_use_mkl_dnn(); + static const int kXlaCpuUseMklDnnFieldNumber = 97; + bool xla_cpu_use_mkl_dnn() const; + void set_xla_cpu_use_mkl_dnn(bool value); + + // bool xla_cpu_enable_fast_math = 99; + void clear_xla_cpu_enable_fast_math(); + static const int kXlaCpuEnableFastMathFieldNumber = 99; + bool xla_cpu_enable_fast_math() const; + void set_xla_cpu_enable_fast_math(bool value); + + // int32 xla_gpu_max_kernel_unroll_factor = 98; + void clear_xla_gpu_max_kernel_unroll_factor(); + static const int kXlaGpuMaxKernelUnrollFactorFieldNumber = 98; + ::google::protobuf::int32 xla_gpu_max_kernel_unroll_factor() const; + void set_xla_gpu_max_kernel_unroll_factor(::google::protobuf::int32 value); + + // int32 xla_force_host_platform_device_count = 102; + void clear_xla_force_host_platform_device_count(); + static const int kXlaForceHostPlatformDeviceCountFieldNumber = 102; + ::google::protobuf::int32 xla_force_host_platform_device_count() const; + void set_xla_force_host_platform_device_count(::google::protobuf::int32 value); + + // bool xla_gpu_enable_fast_min_max = 100; + void clear_xla_gpu_enable_fast_min_max(); + static const int kXlaGpuEnableFastMinMaxFieldNumber = 100; + bool xla_gpu_enable_fast_min_max() const; + void set_xla_gpu_enable_fast_min_max(bool value); + + // bool xla_gpu_crash_on_verification_failures = 101; + void clear_xla_gpu_crash_on_verification_failures(); + static const int kXlaGpuCrashOnVerificationFailuresFieldNumber = 101; + bool xla_gpu_crash_on_verification_failures() const; + void set_xla_gpu_crash_on_verification_failures(bool value); + + // bool xla_gpu_disable_ptxas_optimizations = 103; + void clear_xla_gpu_disable_ptxas_optimizations(); + static const int kXlaGpuDisablePtxasOptimizationsFieldNumber = 103; + bool xla_gpu_disable_ptxas_optimizations() const; + void set_xla_gpu_disable_ptxas_optimizations(bool value); + + // bool xla_hlo_dump_as_html = 105; + void clear_xla_hlo_dump_as_html(); + static const int kXlaHloDumpAsHtmlFieldNumber = 105; + bool xla_hlo_dump_as_html() const; + void set_xla_hlo_dump_as_html(bool value); + + // bool xla_hlo_evaluator_use_fast_path = 106; + void clear_xla_hlo_evaluator_use_fast_path(); + static const int kXlaHloEvaluatorUseFastPathFieldNumber = 106; + bool xla_hlo_evaluator_use_fast_path() const; + void set_xla_hlo_evaluator_use_fast_path(bool value); + + // @@protoc_insertion_point(class_scope:xla.DebugOptions) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::std::string> xla_disable_hlo_passes_; + ::google::protobuf::RepeatedPtrField< ::xla::HloReducePrecisionOptions > hlo_reduce_precision_options_; + ::google::protobuf::internal::MapField< + DebugOptions_XlaBackendExtraOptionsEntry_DoNotUse, + ::std::string, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 > xla_backend_extra_options_; + ::google::protobuf::internal::ArenaStringPtr xla_generate_hlo_graph_; + ::google::protobuf::internal::ArenaStringPtr xla_hlo_graph_path_; + ::google::protobuf::internal::ArenaStringPtr xla_log_hlo_text_; + ::google::protobuf::internal::ArenaStringPtr xla_generate_hlo_text_to_; + ::google::protobuf::internal::ArenaStringPtr xla_dump_optimized_hlo_proto_to_; + ::google::protobuf::internal::ArenaStringPtr xla_dump_computations_to_; + ::google::protobuf::internal::ArenaStringPtr xla_dump_executions_to_; + ::google::protobuf::internal::ArenaStringPtr xla_dump_ir_to_; + ::google::protobuf::internal::ArenaStringPtr xla_gpu_cuda_data_dir_; + ::google::protobuf::internal::ArenaStringPtr xla_dump_unoptimized_hlo_proto_to_; + ::google::protobuf::internal::ArenaStringPtr xla_dump_per_pass_hlo_proto_to_; + bool xla_hlo_graph_addresses_; + bool xla_hlo_dump_as_graphdef_; + bool xla_hlo_profile_; + bool xla_disable_all_hlo_passes_; + ::google::protobuf::int32 xla_backend_optimization_level_; + bool xla_embed_ir_in_executable_; + bool xla_eliminate_hlo_implicit_broadcast_; + bool xla_cpu_multi_thread_eigen_; + bool xla_gpu_ftz_; + bool xla_gpu_disable_multi_streaming_; + bool xla_llvm_enable_alias_scope_metadata_; + bool xla_llvm_enable_noalias_metadata_; + bool xla_llvm_enable_invariant_load_metadata_; + bool xla_llvm_disable_expensive_passes_; + bool xla_test_all_output_layouts_; + bool xla_test_all_input_layouts_; + bool xla_hlo_graph_sharding_color_; + bool xla_hlo_tfgraph_device_scopes_; + bool xla_gpu_use_cudnn_batchnorm_; + bool xla_cpu_use_mkl_dnn_; + bool xla_cpu_enable_fast_math_; + ::google::protobuf::int32 xla_gpu_max_kernel_unroll_factor_; + ::google::protobuf::int32 xla_force_host_platform_device_count_; + bool xla_gpu_enable_fast_min_max_; + bool xla_gpu_crash_on_verification_failures_; + bool xla_gpu_disable_ptxas_optimizations_; + bool xla_hlo_dump_as_html_; + bool xla_hlo_evaluator_use_fast_path_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecutionOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecutionOptions) */ { + public: + ExecutionOptions(); + virtual ~ExecutionOptions(); + + ExecutionOptions(const ExecutionOptions& from); + + inline ExecutionOptions& operator=(const ExecutionOptions& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecutionOptions(ExecutionOptions&& from) noexcept + : ExecutionOptions() { + *this = ::std::move(from); + } + + inline ExecutionOptions& operator=(ExecutionOptions&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecutionOptions& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecutionOptions* internal_default_instance() { + return reinterpret_cast( + &_ExecutionOptions_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(ExecutionOptions* other); + friend void swap(ExecutionOptions& a, ExecutionOptions& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecutionOptions* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecutionOptions* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecutionOptions& from); + void MergeFrom(const ExecutionOptions& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecutionOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.DeviceHandle device_handles = 5; + int device_handles_size() const; + void clear_device_handles(); + static const int kDeviceHandlesFieldNumber = 5; + ::xla::DeviceHandle* mutable_device_handles(int index); + ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >* + mutable_device_handles(); + const ::xla::DeviceHandle& device_handles(int index) const; + ::xla::DeviceHandle* add_device_handles(); + const ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >& + device_handles() const; + + // .xla.ShapeProto shape_with_output_layout = 2; + bool has_shape_with_output_layout() const; + void clear_shape_with_output_layout(); + static const int kShapeWithOutputLayoutFieldNumber = 2; + private: + const ::xla::ShapeProto& _internal_shape_with_output_layout() const; + public: + const ::xla::ShapeProto& shape_with_output_layout() const; + ::xla::ShapeProto* release_shape_with_output_layout(); + ::xla::ShapeProto* mutable_shape_with_output_layout(); + void set_allocated_shape_with_output_layout(::xla::ShapeProto* shape_with_output_layout); + + // .xla.DebugOptions debug_options = 4; + bool has_debug_options() const; + void clear_debug_options(); + static const int kDebugOptionsFieldNumber = 4; + private: + const ::xla::DebugOptions& _internal_debug_options() const; + public: + const ::xla::DebugOptions& debug_options() const; + ::xla::DebugOptions* release_debug_options(); + ::xla::DebugOptions* mutable_debug_options(); + void set_allocated_debug_options(::xla::DebugOptions* debug_options); + + // uint64 seed = 3; + void clear_seed(); + static const int kSeedFieldNumber = 3; + ::google::protobuf::uint64 seed() const; + void set_seed(::google::protobuf::uint64 value); + + // @@protoc_insertion_point(class_scope:xla.ExecutionOptions) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle > device_handles_; + ::xla::ShapeProto* shape_with_output_layout_; + ::xla::DebugOptions* debug_options_; + ::google::protobuf::uint64 seed_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GetDeviceHandlesRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.GetDeviceHandlesRequest) */ { + public: + GetDeviceHandlesRequest(); + virtual ~GetDeviceHandlesRequest(); + + GetDeviceHandlesRequest(const GetDeviceHandlesRequest& from); + + inline GetDeviceHandlesRequest& operator=(const GetDeviceHandlesRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GetDeviceHandlesRequest(GetDeviceHandlesRequest&& from) noexcept + : GetDeviceHandlesRequest() { + *this = ::std::move(from); + } + + inline GetDeviceHandlesRequest& operator=(GetDeviceHandlesRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const GetDeviceHandlesRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GetDeviceHandlesRequest* internal_default_instance() { + return reinterpret_cast( + &_GetDeviceHandlesRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(GetDeviceHandlesRequest* other); + friend void swap(GetDeviceHandlesRequest& a, GetDeviceHandlesRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GetDeviceHandlesRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + GetDeviceHandlesRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GetDeviceHandlesRequest& from); + void MergeFrom(const GetDeviceHandlesRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetDeviceHandlesRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 device_count = 1; + void clear_device_count(); + static const int kDeviceCountFieldNumber = 1; + ::google::protobuf::int64 device_count() const; + void set_device_count(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.GetDeviceHandlesRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int64 device_count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GetDeviceHandlesResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.GetDeviceHandlesResponse) */ { + public: + GetDeviceHandlesResponse(); + virtual ~GetDeviceHandlesResponse(); + + GetDeviceHandlesResponse(const GetDeviceHandlesResponse& from); + + inline GetDeviceHandlesResponse& operator=(const GetDeviceHandlesResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GetDeviceHandlesResponse(GetDeviceHandlesResponse&& from) noexcept + : GetDeviceHandlesResponse() { + *this = ::std::move(from); + } + + inline GetDeviceHandlesResponse& operator=(GetDeviceHandlesResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const GetDeviceHandlesResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GetDeviceHandlesResponse* internal_default_instance() { + return reinterpret_cast( + &_GetDeviceHandlesResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(GetDeviceHandlesResponse* other); + friend void swap(GetDeviceHandlesResponse& a, GetDeviceHandlesResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GetDeviceHandlesResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + GetDeviceHandlesResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GetDeviceHandlesResponse& from); + void MergeFrom(const GetDeviceHandlesResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetDeviceHandlesResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.DeviceHandle device_handles = 1; + int device_handles_size() const; + void clear_device_handles(); + static const int kDeviceHandlesFieldNumber = 1; + ::xla::DeviceHandle* mutable_device_handles(int index); + ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >* + mutable_device_handles(); + const ::xla::DeviceHandle& device_handles(int index) const; + ::xla::DeviceHandle* add_device_handles(); + const ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >& + device_handles() const; + + // @@protoc_insertion_point(class_scope:xla.GetDeviceHandlesResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle > device_handles_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferToClientRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferToClientRequest) */ { + public: + TransferToClientRequest(); + virtual ~TransferToClientRequest(); + + TransferToClientRequest(const TransferToClientRequest& from); + + inline TransferToClientRequest& operator=(const TransferToClientRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferToClientRequest(TransferToClientRequest&& from) noexcept + : TransferToClientRequest() { + *this = ::std::move(from); + } + + inline TransferToClientRequest& operator=(TransferToClientRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferToClientRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferToClientRequest* internal_default_instance() { + return reinterpret_cast( + &_TransferToClientRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(TransferToClientRequest* other); + friend void swap(TransferToClientRequest& a, TransferToClientRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferToClientRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferToClientRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferToClientRequest& from); + void MergeFrom(const TransferToClientRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferToClientRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle data = 1; + bool has_data() const; + void clear_data(); + static const int kDataFieldNumber = 1; + private: + const ::xla::GlobalDataHandle& _internal_data() const; + public: + const ::xla::GlobalDataHandle& data() const; + ::xla::GlobalDataHandle* release_data(); + ::xla::GlobalDataHandle* mutable_data(); + void set_allocated_data(::xla::GlobalDataHandle* data); + + // .xla.ShapeProto shape_with_layout = 2; + bool has_shape_with_layout() const; + void clear_shape_with_layout(); + static const int kShapeWithLayoutFieldNumber = 2; + private: + const ::xla::ShapeProto& _internal_shape_with_layout() const; + public: + const ::xla::ShapeProto& shape_with_layout() const; + ::xla::ShapeProto* release_shape_with_layout(); + ::xla::ShapeProto* mutable_shape_with_layout(); + void set_allocated_shape_with_layout(::xla::ShapeProto* shape_with_layout); + + // @@protoc_insertion_point(class_scope:xla.TransferToClientRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* data_; + ::xla::ShapeProto* shape_with_layout_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferToClientResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferToClientResponse) */ { + public: + TransferToClientResponse(); + virtual ~TransferToClientResponse(); + + TransferToClientResponse(const TransferToClientResponse& from); + + inline TransferToClientResponse& operator=(const TransferToClientResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferToClientResponse(TransferToClientResponse&& from) noexcept + : TransferToClientResponse() { + *this = ::std::move(from); + } + + inline TransferToClientResponse& operator=(TransferToClientResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferToClientResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferToClientResponse* internal_default_instance() { + return reinterpret_cast( + &_TransferToClientResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void Swap(TransferToClientResponse* other); + friend void swap(TransferToClientResponse& a, TransferToClientResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferToClientResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferToClientResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferToClientResponse& from); + void MergeFrom(const TransferToClientResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferToClientResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.LiteralProto literal = 1; + bool has_literal() const; + void clear_literal(); + static const int kLiteralFieldNumber = 1; + private: + const ::xla::LiteralProto& _internal_literal() const; + public: + const ::xla::LiteralProto& literal() const; + ::xla::LiteralProto* release_literal(); + ::xla::LiteralProto* mutable_literal(); + void set_allocated_literal(::xla::LiteralProto* literal); + + // @@protoc_insertion_point(class_scope:xla.TransferToClientResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::LiteralProto* literal_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferToServerRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferToServerRequest) */ { + public: + TransferToServerRequest(); + virtual ~TransferToServerRequest(); + + TransferToServerRequest(const TransferToServerRequest& from); + + inline TransferToServerRequest& operator=(const TransferToServerRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferToServerRequest(TransferToServerRequest&& from) noexcept + : TransferToServerRequest() { + *this = ::std::move(from); + } + + inline TransferToServerRequest& operator=(TransferToServerRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferToServerRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferToServerRequest* internal_default_instance() { + return reinterpret_cast( + &_TransferToServerRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void Swap(TransferToServerRequest* other); + friend void swap(TransferToServerRequest& a, TransferToServerRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferToServerRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferToServerRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferToServerRequest& from); + void MergeFrom(const TransferToServerRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferToServerRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.LiteralProto literal = 1; + bool has_literal() const; + void clear_literal(); + static const int kLiteralFieldNumber = 1; + private: + const ::xla::LiteralProto& _internal_literal() const; + public: + const ::xla::LiteralProto& literal() const; + ::xla::LiteralProto* release_literal(); + ::xla::LiteralProto* mutable_literal(); + void set_allocated_literal(::xla::LiteralProto* literal); + + // .xla.DeviceHandle device_handle = 2; + bool has_device_handle() const; + void clear_device_handle(); + static const int kDeviceHandleFieldNumber = 2; + private: + const ::xla::DeviceHandle& _internal_device_handle() const; + public: + const ::xla::DeviceHandle& device_handle() const; + ::xla::DeviceHandle* release_device_handle(); + ::xla::DeviceHandle* mutable_device_handle(); + void set_allocated_device_handle(::xla::DeviceHandle* device_handle); + + // @@protoc_insertion_point(class_scope:xla.TransferToServerRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::LiteralProto* literal_; + ::xla::DeviceHandle* device_handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferToServerResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferToServerResponse) */ { + public: + TransferToServerResponse(); + virtual ~TransferToServerResponse(); + + TransferToServerResponse(const TransferToServerResponse& from); + + inline TransferToServerResponse& operator=(const TransferToServerResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferToServerResponse(TransferToServerResponse&& from) noexcept + : TransferToServerResponse() { + *this = ::std::move(from); + } + + inline TransferToServerResponse& operator=(TransferToServerResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferToServerResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferToServerResponse* internal_default_instance() { + return reinterpret_cast( + &_TransferToServerResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void Swap(TransferToServerResponse* other); + friend void swap(TransferToServerResponse& a, TransferToServerResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferToServerResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferToServerResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferToServerResponse& from); + void MergeFrom(const TransferToServerResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferToServerResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle data = 1; + bool has_data() const; + void clear_data(); + static const int kDataFieldNumber = 1; + private: + const ::xla::GlobalDataHandle& _internal_data() const; + public: + const ::xla::GlobalDataHandle& data() const; + ::xla::GlobalDataHandle* release_data(); + ::xla::GlobalDataHandle* mutable_data(); + void set_allocated_data(::xla::GlobalDataHandle* data); + + // @@protoc_insertion_point(class_scope:xla.TransferToServerResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferToInfeedRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferToInfeedRequest) */ { + public: + TransferToInfeedRequest(); + virtual ~TransferToInfeedRequest(); + + TransferToInfeedRequest(const TransferToInfeedRequest& from); + + inline TransferToInfeedRequest& operator=(const TransferToInfeedRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferToInfeedRequest(TransferToInfeedRequest&& from) noexcept + : TransferToInfeedRequest() { + *this = ::std::move(from); + } + + inline TransferToInfeedRequest& operator=(TransferToInfeedRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferToInfeedRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferToInfeedRequest* internal_default_instance() { + return reinterpret_cast( + &_TransferToInfeedRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void Swap(TransferToInfeedRequest* other); + friend void swap(TransferToInfeedRequest& a, TransferToInfeedRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferToInfeedRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferToInfeedRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferToInfeedRequest& from); + void MergeFrom(const TransferToInfeedRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferToInfeedRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.LiteralProto literal = 1; + bool has_literal() const; + void clear_literal(); + static const int kLiteralFieldNumber = 1; + private: + const ::xla::LiteralProto& _internal_literal() const; + public: + const ::xla::LiteralProto& literal() const; + ::xla::LiteralProto* release_literal(); + ::xla::LiteralProto* mutable_literal(); + void set_allocated_literal(::xla::LiteralProto* literal); + + // .xla.DeviceHandle device_handle = 3; + bool has_device_handle() const; + void clear_device_handle(); + static const int kDeviceHandleFieldNumber = 3; + private: + const ::xla::DeviceHandle& _internal_device_handle() const; + public: + const ::xla::DeviceHandle& device_handle() const; + ::xla::DeviceHandle* release_device_handle(); + ::xla::DeviceHandle* mutable_device_handle(); + void set_allocated_device_handle(::xla::DeviceHandle* device_handle); + + // int64 replica_id = 2; + void clear_replica_id(); + static const int kReplicaIdFieldNumber = 2; + ::google::protobuf::int64 replica_id() const; + void set_replica_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.TransferToInfeedRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::LiteralProto* literal_; + ::xla::DeviceHandle* device_handle_; + ::google::protobuf::int64 replica_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferToInfeedResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferToInfeedResponse) */ { + public: + TransferToInfeedResponse(); + virtual ~TransferToInfeedResponse(); + + TransferToInfeedResponse(const TransferToInfeedResponse& from); + + inline TransferToInfeedResponse& operator=(const TransferToInfeedResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferToInfeedResponse(TransferToInfeedResponse&& from) noexcept + : TransferToInfeedResponse() { + *this = ::std::move(from); + } + + inline TransferToInfeedResponse& operator=(TransferToInfeedResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferToInfeedResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferToInfeedResponse* internal_default_instance() { + return reinterpret_cast( + &_TransferToInfeedResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void Swap(TransferToInfeedResponse* other); + friend void swap(TransferToInfeedResponse& a, TransferToInfeedResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferToInfeedResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferToInfeedResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferToInfeedResponse& from); + void MergeFrom(const TransferToInfeedResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferToInfeedResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:xla.TransferToInfeedResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferFromOutfeedRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferFromOutfeedRequest) */ { + public: + TransferFromOutfeedRequest(); + virtual ~TransferFromOutfeedRequest(); + + TransferFromOutfeedRequest(const TransferFromOutfeedRequest& from); + + inline TransferFromOutfeedRequest& operator=(const TransferFromOutfeedRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferFromOutfeedRequest(TransferFromOutfeedRequest&& from) noexcept + : TransferFromOutfeedRequest() { + *this = ::std::move(from); + } + + inline TransferFromOutfeedRequest& operator=(TransferFromOutfeedRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferFromOutfeedRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferFromOutfeedRequest* internal_default_instance() { + return reinterpret_cast( + &_TransferFromOutfeedRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void Swap(TransferFromOutfeedRequest* other); + friend void swap(TransferFromOutfeedRequest& a, TransferFromOutfeedRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferFromOutfeedRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferFromOutfeedRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferFromOutfeedRequest& from); + void MergeFrom(const TransferFromOutfeedRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferFromOutfeedRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.ShapeProto shape_with_layout = 1; + bool has_shape_with_layout() const; + void clear_shape_with_layout(); + static const int kShapeWithLayoutFieldNumber = 1; + private: + const ::xla::ShapeProto& _internal_shape_with_layout() const; + public: + const ::xla::ShapeProto& shape_with_layout() const; + ::xla::ShapeProto* release_shape_with_layout(); + ::xla::ShapeProto* mutable_shape_with_layout(); + void set_allocated_shape_with_layout(::xla::ShapeProto* shape_with_layout); + + // .xla.DeviceHandle device_handle = 3; + bool has_device_handle() const; + void clear_device_handle(); + static const int kDeviceHandleFieldNumber = 3; + private: + const ::xla::DeviceHandle& _internal_device_handle() const; + public: + const ::xla::DeviceHandle& device_handle() const; + ::xla::DeviceHandle* release_device_handle(); + ::xla::DeviceHandle* mutable_device_handle(); + void set_allocated_device_handle(::xla::DeviceHandle* device_handle); + + // int64 replica_id = 2; + void clear_replica_id(); + static const int kReplicaIdFieldNumber = 2; + ::google::protobuf::int64 replica_id() const; + void set_replica_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.TransferFromOutfeedRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::ShapeProto* shape_with_layout_; + ::xla::DeviceHandle* device_handle_; + ::google::protobuf::int64 replica_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TransferFromOutfeedResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TransferFromOutfeedResponse) */ { + public: + TransferFromOutfeedResponse(); + virtual ~TransferFromOutfeedResponse(); + + TransferFromOutfeedResponse(const TransferFromOutfeedResponse& from); + + inline TransferFromOutfeedResponse& operator=(const TransferFromOutfeedResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TransferFromOutfeedResponse(TransferFromOutfeedResponse&& from) noexcept + : TransferFromOutfeedResponse() { + *this = ::std::move(from); + } + + inline TransferFromOutfeedResponse& operator=(TransferFromOutfeedResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TransferFromOutfeedResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TransferFromOutfeedResponse* internal_default_instance() { + return reinterpret_cast( + &_TransferFromOutfeedResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void Swap(TransferFromOutfeedResponse* other); + friend void swap(TransferFromOutfeedResponse& a, TransferFromOutfeedResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TransferFromOutfeedResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + TransferFromOutfeedResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TransferFromOutfeedResponse& from); + void MergeFrom(const TransferFromOutfeedResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TransferFromOutfeedResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.LiteralProto literal = 1; + bool has_literal() const; + void clear_literal(); + static const int kLiteralFieldNumber = 1; + private: + const ::xla::LiteralProto& _internal_literal() const; + public: + const ::xla::LiteralProto& literal() const; + ::xla::LiteralProto* release_literal(); + ::xla::LiteralProto* mutable_literal(); + void set_allocated_literal(::xla::LiteralProto* literal); + + // @@protoc_insertion_point(class_scope:xla.TransferFromOutfeedResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::LiteralProto* literal_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ResetDeviceRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ResetDeviceRequest) */ { + public: + ResetDeviceRequest(); + virtual ~ResetDeviceRequest(); + + ResetDeviceRequest(const ResetDeviceRequest& from); + + inline ResetDeviceRequest& operator=(const ResetDeviceRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ResetDeviceRequest(ResetDeviceRequest&& from) noexcept + : ResetDeviceRequest() { + *this = ::std::move(from); + } + + inline ResetDeviceRequest& operator=(ResetDeviceRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ResetDeviceRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ResetDeviceRequest* internal_default_instance() { + return reinterpret_cast( + &_ResetDeviceRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + void Swap(ResetDeviceRequest* other); + friend void swap(ResetDeviceRequest& a, ResetDeviceRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ResetDeviceRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ResetDeviceRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ResetDeviceRequest& from); + void MergeFrom(const ResetDeviceRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ResetDeviceRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.DeviceHandle device_handle = 1; + bool has_device_handle() const; + void clear_device_handle(); + static const int kDeviceHandleFieldNumber = 1; + private: + const ::xla::DeviceHandle& _internal_device_handle() const; + public: + const ::xla::DeviceHandle& device_handle() const; + ::xla::DeviceHandle* release_device_handle(); + ::xla::DeviceHandle* mutable_device_handle(); + void set_allocated_device_handle(::xla::DeviceHandle* device_handle); + + // @@protoc_insertion_point(class_scope:xla.ResetDeviceRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::DeviceHandle* device_handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ResetDeviceResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ResetDeviceResponse) */ { + public: + ResetDeviceResponse(); + virtual ~ResetDeviceResponse(); + + ResetDeviceResponse(const ResetDeviceResponse& from); + + inline ResetDeviceResponse& operator=(const ResetDeviceResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ResetDeviceResponse(ResetDeviceResponse&& from) noexcept + : ResetDeviceResponse() { + *this = ::std::move(from); + } + + inline ResetDeviceResponse& operator=(ResetDeviceResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ResetDeviceResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ResetDeviceResponse* internal_default_instance() { + return reinterpret_cast( + &_ResetDeviceResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void Swap(ResetDeviceResponse* other); + friend void swap(ResetDeviceResponse& a, ResetDeviceResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ResetDeviceResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + ResetDeviceResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ResetDeviceResponse& from); + void MergeFrom(const ResetDeviceResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ResetDeviceResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:xla.ResetDeviceResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ComputationGraphStatsRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ComputationGraphStatsRequest) */ { + public: + ComputationGraphStatsRequest(); + virtual ~ComputationGraphStatsRequest(); + + ComputationGraphStatsRequest(const ComputationGraphStatsRequest& from); + + inline ComputationGraphStatsRequest& operator=(const ComputationGraphStatsRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ComputationGraphStatsRequest(ComputationGraphStatsRequest&& from) noexcept + : ComputationGraphStatsRequest() { + *this = ::std::move(from); + } + + inline ComputationGraphStatsRequest& operator=(ComputationGraphStatsRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ComputationGraphStatsRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ComputationGraphStatsRequest* internal_default_instance() { + return reinterpret_cast( + &_ComputationGraphStatsRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + void Swap(ComputationGraphStatsRequest* other); + friend void swap(ComputationGraphStatsRequest& a, ComputationGraphStatsRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ComputationGraphStatsRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ComputationGraphStatsRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ComputationGraphStatsRequest& from); + void MergeFrom(const ComputationGraphStatsRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ComputationGraphStatsRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.HloModuleProto computation = 1; + bool has_computation() const; + void clear_computation(); + static const int kComputationFieldNumber = 1; + private: + const ::xla::HloModuleProto& _internal_computation() const; + public: + const ::xla::HloModuleProto& computation() const; + ::xla::HloModuleProto* release_computation(); + ::xla::HloModuleProto* mutable_computation(); + void set_allocated_computation(::xla::HloModuleProto* computation); + + // .xla.DebugOptions debug_options = 2; + bool has_debug_options() const; + void clear_debug_options(); + static const int kDebugOptionsFieldNumber = 2; + private: + const ::xla::DebugOptions& _internal_debug_options() const; + public: + const ::xla::DebugOptions& debug_options() const; + ::xla::DebugOptions* release_debug_options(); + ::xla::DebugOptions* mutable_debug_options(); + void set_allocated_debug_options(::xla::DebugOptions* debug_options); + + // @@protoc_insertion_point(class_scope:xla.ComputationGraphStatsRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::HloModuleProto* computation_; + ::xla::DebugOptions* debug_options_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ComputationStatsResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ComputationStatsResponse) */ { + public: + ComputationStatsResponse(); + virtual ~ComputationStatsResponse(); + + ComputationStatsResponse(const ComputationStatsResponse& from); + + inline ComputationStatsResponse& operator=(const ComputationStatsResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ComputationStatsResponse(ComputationStatsResponse&& from) noexcept + : ComputationStatsResponse() { + *this = ::std::move(from); + } + + inline ComputationStatsResponse& operator=(ComputationStatsResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ComputationStatsResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ComputationStatsResponse* internal_default_instance() { + return reinterpret_cast( + &_ComputationStatsResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 17; + + void Swap(ComputationStatsResponse* other); + friend void swap(ComputationStatsResponse& a, ComputationStatsResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ComputationStatsResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + ComputationStatsResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ComputationStatsResponse& from); + void MergeFrom(const ComputationStatsResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ComputationStatsResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.ComputationStats stats = 1; + bool has_stats() const; + void clear_stats(); + static const int kStatsFieldNumber = 1; + private: + const ::xla::ComputationStats& _internal_stats() const; + public: + const ::xla::ComputationStats& stats() const; + ::xla::ComputationStats* release_stats(); + ::xla::ComputationStats* mutable_stats(); + void set_allocated_stats(::xla::ComputationStats* stats); + + // @@protoc_insertion_point(class_scope:xla.ComputationStatsResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::ComputationStats* stats_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CreateChannelHandleRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.CreateChannelHandleRequest) */ { + public: + CreateChannelHandleRequest(); + virtual ~CreateChannelHandleRequest(); + + CreateChannelHandleRequest(const CreateChannelHandleRequest& from); + + inline CreateChannelHandleRequest& operator=(const CreateChannelHandleRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CreateChannelHandleRequest(CreateChannelHandleRequest&& from) noexcept + : CreateChannelHandleRequest() { + *this = ::std::move(from); + } + + inline CreateChannelHandleRequest& operator=(CreateChannelHandleRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const CreateChannelHandleRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CreateChannelHandleRequest* internal_default_instance() { + return reinterpret_cast( + &_CreateChannelHandleRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 18; + + void Swap(CreateChannelHandleRequest* other); + friend void swap(CreateChannelHandleRequest& a, CreateChannelHandleRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CreateChannelHandleRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + CreateChannelHandleRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CreateChannelHandleRequest& from); + void MergeFrom(const CreateChannelHandleRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CreateChannelHandleRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.ChannelHandle.ChannelType channel_type = 1; + void clear_channel_type(); + static const int kChannelTypeFieldNumber = 1; + ::xla::ChannelHandle_ChannelType channel_type() const; + void set_channel_type(::xla::ChannelHandle_ChannelType value); + + // @@protoc_insertion_point(class_scope:xla.CreateChannelHandleRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + int channel_type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CreateChannelHandleResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.CreateChannelHandleResponse) */ { + public: + CreateChannelHandleResponse(); + virtual ~CreateChannelHandleResponse(); + + CreateChannelHandleResponse(const CreateChannelHandleResponse& from); + + inline CreateChannelHandleResponse& operator=(const CreateChannelHandleResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CreateChannelHandleResponse(CreateChannelHandleResponse&& from) noexcept + : CreateChannelHandleResponse() { + *this = ::std::move(from); + } + + inline CreateChannelHandleResponse& operator=(CreateChannelHandleResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const CreateChannelHandleResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CreateChannelHandleResponse* internal_default_instance() { + return reinterpret_cast( + &_CreateChannelHandleResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 19; + + void Swap(CreateChannelHandleResponse* other); + friend void swap(CreateChannelHandleResponse& a, CreateChannelHandleResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CreateChannelHandleResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + CreateChannelHandleResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CreateChannelHandleResponse& from); + void MergeFrom(const CreateChannelHandleResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CreateChannelHandleResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.ChannelHandle channel = 1; + bool has_channel() const; + void clear_channel(); + static const int kChannelFieldNumber = 1; + private: + const ::xla::ChannelHandle& _internal_channel() const; + public: + const ::xla::ChannelHandle& channel() const; + ::xla::ChannelHandle* release_channel(); + ::xla::ChannelHandle* mutable_channel(); + void set_allocated_channel(::xla::ChannelHandle* channel); + + // @@protoc_insertion_point(class_scope:xla.CreateChannelHandleResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::ChannelHandle* channel_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class UnregisterRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.UnregisterRequest) */ { + public: + UnregisterRequest(); + virtual ~UnregisterRequest(); + + UnregisterRequest(const UnregisterRequest& from); + + inline UnregisterRequest& operator=(const UnregisterRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + UnregisterRequest(UnregisterRequest&& from) noexcept + : UnregisterRequest() { + *this = ::std::move(from); + } + + inline UnregisterRequest& operator=(UnregisterRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const UnregisterRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const UnregisterRequest* internal_default_instance() { + return reinterpret_cast( + &_UnregisterRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 20; + + void Swap(UnregisterRequest* other); + friend void swap(UnregisterRequest& a, UnregisterRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline UnregisterRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + UnregisterRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const UnregisterRequest& from); + void MergeFrom(const UnregisterRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(UnregisterRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.GlobalDataHandle data = 1; + int data_size() const; + void clear_data(); + static const int kDataFieldNumber = 1; + ::xla::GlobalDataHandle* mutable_data(int index); + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* + mutable_data(); + const ::xla::GlobalDataHandle& data(int index) const; + ::xla::GlobalDataHandle* add_data(); + const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& + data() const; + + // @@protoc_insertion_point(class_scope:xla.UnregisterRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle > data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class UnregisterResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.UnregisterResponse) */ { + public: + UnregisterResponse(); + virtual ~UnregisterResponse(); + + UnregisterResponse(const UnregisterResponse& from); + + inline UnregisterResponse& operator=(const UnregisterResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + UnregisterResponse(UnregisterResponse&& from) noexcept + : UnregisterResponse() { + *this = ::std::move(from); + } + + inline UnregisterResponse& operator=(UnregisterResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const UnregisterResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const UnregisterResponse* internal_default_instance() { + return reinterpret_cast( + &_UnregisterResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 21; + + void Swap(UnregisterResponse* other); + friend void swap(UnregisterResponse& a, UnregisterResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline UnregisterResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + UnregisterResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const UnregisterResponse& from); + void MergeFrom(const UnregisterResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(UnregisterResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:xla.UnregisterResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CompileRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.CompileRequest) */ { + public: + CompileRequest(); + virtual ~CompileRequest(); + + CompileRequest(const CompileRequest& from); + + inline CompileRequest& operator=(const CompileRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CompileRequest(CompileRequest&& from) noexcept + : CompileRequest() { + *this = ::std::move(from); + } + + inline CompileRequest& operator=(CompileRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const CompileRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CompileRequest* internal_default_instance() { + return reinterpret_cast( + &_CompileRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 22; + + void Swap(CompileRequest* other); + friend void swap(CompileRequest& a, CompileRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CompileRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + CompileRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CompileRequest& from); + void MergeFrom(const CompileRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CompileRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.ShapeProto input_shape_with_layout = 3; + int input_shape_with_layout_size() const; + void clear_input_shape_with_layout(); + static const int kInputShapeWithLayoutFieldNumber = 3; + ::xla::ShapeProto* mutable_input_shape_with_layout(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* + mutable_input_shape_with_layout(); + const ::xla::ShapeProto& input_shape_with_layout(int index) const; + ::xla::ShapeProto* add_input_shape_with_layout(); + const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& + input_shape_with_layout() const; + + // .xla.HloModuleProto computation = 1; + bool has_computation() const; + void clear_computation(); + static const int kComputationFieldNumber = 1; + private: + const ::xla::HloModuleProto& _internal_computation() const; + public: + const ::xla::HloModuleProto& computation() const; + ::xla::HloModuleProto* release_computation(); + ::xla::HloModuleProto* mutable_computation(); + void set_allocated_computation(::xla::HloModuleProto* computation); + + // .xla.ExecutionOptions execution_options = 2; + bool has_execution_options() const; + void clear_execution_options(); + static const int kExecutionOptionsFieldNumber = 2; + private: + const ::xla::ExecutionOptions& _internal_execution_options() const; + public: + const ::xla::ExecutionOptions& execution_options() const; + ::xla::ExecutionOptions* release_execution_options(); + ::xla::ExecutionOptions* mutable_execution_options(); + void set_allocated_execution_options(::xla::ExecutionOptions* execution_options); + + // @@protoc_insertion_point(class_scope:xla.CompileRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto > input_shape_with_layout_; + ::xla::HloModuleProto* computation_; + ::xla::ExecutionOptions* execution_options_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CompileResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.CompileResponse) */ { + public: + CompileResponse(); + virtual ~CompileResponse(); + + CompileResponse(const CompileResponse& from); + + inline CompileResponse& operator=(const CompileResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CompileResponse(CompileResponse&& from) noexcept + : CompileResponse() { + *this = ::std::move(from); + } + + inline CompileResponse& operator=(CompileResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const CompileResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CompileResponse* internal_default_instance() { + return reinterpret_cast( + &_CompileResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 23; + + void Swap(CompileResponse* other); + friend void swap(CompileResponse& a, CompileResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CompileResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + CompileResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CompileResponse& from); + void MergeFrom(const CompileResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CompileResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.ExecutionHandle handle = 1; + bool has_handle() const; + void clear_handle(); + static const int kHandleFieldNumber = 1; + private: + const ::xla::ExecutionHandle& _internal_handle() const; + public: + const ::xla::ExecutionHandle& handle() const; + ::xla::ExecutionHandle* release_handle(); + ::xla::ExecutionHandle* mutable_handle(); + void set_allocated_handle(::xla::ExecutionHandle* handle); + + // @@protoc_insertion_point(class_scope:xla.CompileResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::ExecutionHandle* handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecuteRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecuteRequest) */ { + public: + ExecuteRequest(); + virtual ~ExecuteRequest(); + + ExecuteRequest(const ExecuteRequest& from); + + inline ExecuteRequest& operator=(const ExecuteRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecuteRequest(ExecuteRequest&& from) noexcept + : ExecuteRequest() { + *this = ::std::move(from); + } + + inline ExecuteRequest& operator=(ExecuteRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecuteRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecuteRequest* internal_default_instance() { + return reinterpret_cast( + &_ExecuteRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 24; + + void Swap(ExecuteRequest* other); + friend void swap(ExecuteRequest& a, ExecuteRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecuteRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecuteRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecuteRequest& from); + void MergeFrom(const ExecuteRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecuteRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.GlobalDataHandle arguments = 2; + int arguments_size() const; + void clear_arguments(); + static const int kArgumentsFieldNumber = 2; + ::xla::GlobalDataHandle* mutable_arguments(int index); + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* + mutable_arguments(); + const ::xla::GlobalDataHandle& arguments(int index) const; + ::xla::GlobalDataHandle* add_arguments(); + const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& + arguments() const; + + // .xla.ExecutionHandle handle = 1; + bool has_handle() const; + void clear_handle(); + static const int kHandleFieldNumber = 1; + private: + const ::xla::ExecutionHandle& _internal_handle() const; + public: + const ::xla::ExecutionHandle& handle() const; + ::xla::ExecutionHandle* release_handle(); + ::xla::ExecutionHandle* mutable_handle(); + void set_allocated_handle(::xla::ExecutionHandle* handle); + + // @@protoc_insertion_point(class_scope:xla.ExecuteRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle > arguments_; + ::xla::ExecutionHandle* handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecuteGraphRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecuteGraphRequest) */ { + public: + ExecuteGraphRequest(); + virtual ~ExecuteGraphRequest(); + + ExecuteGraphRequest(const ExecuteGraphRequest& from); + + inline ExecuteGraphRequest& operator=(const ExecuteGraphRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecuteGraphRequest(ExecuteGraphRequest&& from) noexcept + : ExecuteGraphRequest() { + *this = ::std::move(from); + } + + inline ExecuteGraphRequest& operator=(ExecuteGraphRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecuteGraphRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecuteGraphRequest* internal_default_instance() { + return reinterpret_cast( + &_ExecuteGraphRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 25; + + void Swap(ExecuteGraphRequest* other); + friend void swap(ExecuteGraphRequest& a, ExecuteGraphRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecuteGraphRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecuteGraphRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecuteGraphRequest& from); + void MergeFrom(const ExecuteGraphRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecuteGraphRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.GlobalDataHandle arguments = 2; + int arguments_size() const; + void clear_arguments(); + static const int kArgumentsFieldNumber = 2; + ::xla::GlobalDataHandle* mutable_arguments(int index); + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* + mutable_arguments(); + const ::xla::GlobalDataHandle& arguments(int index) const; + ::xla::GlobalDataHandle* add_arguments(); + const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& + arguments() const; + + // .xla.HloModuleProto computation = 1; + bool has_computation() const; + void clear_computation(); + static const int kComputationFieldNumber = 1; + private: + const ::xla::HloModuleProto& _internal_computation() const; + public: + const ::xla::HloModuleProto& computation() const; + ::xla::HloModuleProto* release_computation(); + ::xla::HloModuleProto* mutable_computation(); + void set_allocated_computation(::xla::HloModuleProto* computation); + + // .xla.ExecutionOptions execution_options = 3; + bool has_execution_options() const; + void clear_execution_options(); + static const int kExecutionOptionsFieldNumber = 3; + private: + const ::xla::ExecutionOptions& _internal_execution_options() const; + public: + const ::xla::ExecutionOptions& execution_options() const; + ::xla::ExecutionOptions* release_execution_options(); + ::xla::ExecutionOptions* mutable_execution_options(); + void set_allocated_execution_options(::xla::ExecutionOptions* execution_options); + + // @@protoc_insertion_point(class_scope:xla.ExecuteGraphRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle > arguments_; + ::xla::HloModuleProto* computation_; + ::xla::ExecutionOptions* execution_options_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecuteGraphParallelRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecuteGraphParallelRequest) */ { + public: + ExecuteGraphParallelRequest(); + virtual ~ExecuteGraphParallelRequest(); + + ExecuteGraphParallelRequest(const ExecuteGraphParallelRequest& from); + + inline ExecuteGraphParallelRequest& operator=(const ExecuteGraphParallelRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecuteGraphParallelRequest(ExecuteGraphParallelRequest&& from) noexcept + : ExecuteGraphParallelRequest() { + *this = ::std::move(from); + } + + inline ExecuteGraphParallelRequest& operator=(ExecuteGraphParallelRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecuteGraphParallelRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecuteGraphParallelRequest* internal_default_instance() { + return reinterpret_cast( + &_ExecuteGraphParallelRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 26; + + void Swap(ExecuteGraphParallelRequest* other); + friend void swap(ExecuteGraphParallelRequest& a, ExecuteGraphParallelRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecuteGraphParallelRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecuteGraphParallelRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecuteGraphParallelRequest& from); + void MergeFrom(const ExecuteGraphParallelRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecuteGraphParallelRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.ExecuteGraphRequest requests = 1; + int requests_size() const; + void clear_requests(); + static const int kRequestsFieldNumber = 1; + ::xla::ExecuteGraphRequest* mutable_requests(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ExecuteGraphRequest >* + mutable_requests(); + const ::xla::ExecuteGraphRequest& requests(int index) const; + ::xla::ExecuteGraphRequest* add_requests(); + const ::google::protobuf::RepeatedPtrField< ::xla::ExecuteGraphRequest >& + requests() const; + + // @@protoc_insertion_point(class_scope:xla.ExecuteGraphParallelRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::ExecuteGraphRequest > requests_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecuteResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecuteResponse) */ { + public: + ExecuteResponse(); + virtual ~ExecuteResponse(); + + ExecuteResponse(const ExecuteResponse& from); + + inline ExecuteResponse& operator=(const ExecuteResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecuteResponse(ExecuteResponse&& from) noexcept + : ExecuteResponse() { + *this = ::std::move(from); + } + + inline ExecuteResponse& operator=(ExecuteResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecuteResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecuteResponse* internal_default_instance() { + return reinterpret_cast( + &_ExecuteResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 27; + + void Swap(ExecuteResponse* other); + friend void swap(ExecuteResponse& a, ExecuteResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecuteResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecuteResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecuteResponse& from); + void MergeFrom(const ExecuteResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecuteResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle output = 1; + bool has_output() const; + void clear_output(); + static const int kOutputFieldNumber = 1; + private: + const ::xla::GlobalDataHandle& _internal_output() const; + public: + const ::xla::GlobalDataHandle& output() const; + ::xla::GlobalDataHandle* release_output(); + ::xla::GlobalDataHandle* mutable_output(); + void set_allocated_output(::xla::GlobalDataHandle* output); + + // .xla.ExecutionProfile profile = 2; + bool has_profile() const; + void clear_profile(); + static const int kProfileFieldNumber = 2; + private: + const ::xla::ExecutionProfile& _internal_profile() const; + public: + const ::xla::ExecutionProfile& profile() const; + ::xla::ExecutionProfile* release_profile(); + ::xla::ExecutionProfile* mutable_profile(); + void set_allocated_profile(::xla::ExecutionProfile* profile); + + // @@protoc_insertion_point(class_scope:xla.ExecuteResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* output_; + ::xla::ExecutionProfile* profile_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecuteParallelResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecuteParallelResponse) */ { + public: + ExecuteParallelResponse(); + virtual ~ExecuteParallelResponse(); + + ExecuteParallelResponse(const ExecuteParallelResponse& from); + + inline ExecuteParallelResponse& operator=(const ExecuteParallelResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecuteParallelResponse(ExecuteParallelResponse&& from) noexcept + : ExecuteParallelResponse() { + *this = ::std::move(from); + } + + inline ExecuteParallelResponse& operator=(ExecuteParallelResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecuteParallelResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecuteParallelResponse* internal_default_instance() { + return reinterpret_cast( + &_ExecuteParallelResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 28; + + void Swap(ExecuteParallelResponse* other); + friend void swap(ExecuteParallelResponse& a, ExecuteParallelResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecuteParallelResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecuteParallelResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecuteParallelResponse& from); + void MergeFrom(const ExecuteParallelResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecuteParallelResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.ExecuteResponse responses = 1; + int responses_size() const; + void clear_responses(); + static const int kResponsesFieldNumber = 1; + ::xla::ExecuteResponse* mutable_responses(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ExecuteResponse >* + mutable_responses(); + const ::xla::ExecuteResponse& responses(int index) const; + ::xla::ExecuteResponse* add_responses(); + const ::google::protobuf::RepeatedPtrField< ::xla::ExecuteResponse >& + responses() const; + + // @@protoc_insertion_point(class_scope:xla.ExecuteParallelResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::ExecuteResponse > responses_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class WaitForExecutionRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.WaitForExecutionRequest) */ { + public: + WaitForExecutionRequest(); + virtual ~WaitForExecutionRequest(); + + WaitForExecutionRequest(const WaitForExecutionRequest& from); + + inline WaitForExecutionRequest& operator=(const WaitForExecutionRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + WaitForExecutionRequest(WaitForExecutionRequest&& from) noexcept + : WaitForExecutionRequest() { + *this = ::std::move(from); + } + + inline WaitForExecutionRequest& operator=(WaitForExecutionRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const WaitForExecutionRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WaitForExecutionRequest* internal_default_instance() { + return reinterpret_cast( + &_WaitForExecutionRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 29; + + void Swap(WaitForExecutionRequest* other); + friend void swap(WaitForExecutionRequest& a, WaitForExecutionRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline WaitForExecutionRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + WaitForExecutionRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const WaitForExecutionRequest& from); + void MergeFrom(const WaitForExecutionRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WaitForExecutionRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.ExecutionHandle execution = 1; + bool has_execution() const; + void clear_execution(); + static const int kExecutionFieldNumber = 1; + private: + const ::xla::ExecutionHandle& _internal_execution() const; + public: + const ::xla::ExecutionHandle& execution() const; + ::xla::ExecutionHandle* release_execution(); + ::xla::ExecutionHandle* mutable_execution(); + void set_allocated_execution(::xla::ExecutionHandle* execution); + + // @@protoc_insertion_point(class_scope:xla.WaitForExecutionRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::ExecutionHandle* execution_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class WaitForExecutionResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.WaitForExecutionResponse) */ { + public: + WaitForExecutionResponse(); + virtual ~WaitForExecutionResponse(); + + WaitForExecutionResponse(const WaitForExecutionResponse& from); + + inline WaitForExecutionResponse& operator=(const WaitForExecutionResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + WaitForExecutionResponse(WaitForExecutionResponse&& from) noexcept + : WaitForExecutionResponse() { + *this = ::std::move(from); + } + + inline WaitForExecutionResponse& operator=(WaitForExecutionResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const WaitForExecutionResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WaitForExecutionResponse* internal_default_instance() { + return reinterpret_cast( + &_WaitForExecutionResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 30; + + void Swap(WaitForExecutionResponse* other); + friend void swap(WaitForExecutionResponse& a, WaitForExecutionResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline WaitForExecutionResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + WaitForExecutionResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const WaitForExecutionResponse& from); + void MergeFrom(const WaitForExecutionResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WaitForExecutionResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle output = 1; + bool has_output() const; + void clear_output(); + static const int kOutputFieldNumber = 1; + private: + const ::xla::GlobalDataHandle& _internal_output() const; + public: + const ::xla::GlobalDataHandle& output() const; + ::xla::GlobalDataHandle* release_output(); + ::xla::GlobalDataHandle* mutable_output(); + void set_allocated_output(::xla::GlobalDataHandle* output); + + // .xla.ExecutionProfile profile = 2; + bool has_profile() const; + void clear_profile(); + static const int kProfileFieldNumber = 2; + private: + const ::xla::ExecutionProfile& _internal_profile() const; + public: + const ::xla::ExecutionProfile& profile() const; + ::xla::ExecutionProfile* release_profile(); + ::xla::ExecutionProfile* mutable_profile(); + void set_allocated_profile(::xla::ExecutionProfile* profile); + + // @@protoc_insertion_point(class_scope:xla.WaitForExecutionResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* output_; + ::xla::ExecutionProfile* profile_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ComputeConstantGraphRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ComputeConstantGraphRequest) */ { + public: + ComputeConstantGraphRequest(); + virtual ~ComputeConstantGraphRequest(); + + ComputeConstantGraphRequest(const ComputeConstantGraphRequest& from); + + inline ComputeConstantGraphRequest& operator=(const ComputeConstantGraphRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ComputeConstantGraphRequest(ComputeConstantGraphRequest&& from) noexcept + : ComputeConstantGraphRequest() { + *this = ::std::move(from); + } + + inline ComputeConstantGraphRequest& operator=(ComputeConstantGraphRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ComputeConstantGraphRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ComputeConstantGraphRequest* internal_default_instance() { + return reinterpret_cast( + &_ComputeConstantGraphRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 31; + + void Swap(ComputeConstantGraphRequest* other); + friend void swap(ComputeConstantGraphRequest& a, ComputeConstantGraphRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ComputeConstantGraphRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ComputeConstantGraphRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ComputeConstantGraphRequest& from); + void MergeFrom(const ComputeConstantGraphRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ComputeConstantGraphRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.HloModuleProto computation = 1; + bool has_computation() const; + void clear_computation(); + static const int kComputationFieldNumber = 1; + private: + const ::xla::HloModuleProto& _internal_computation() const; + public: + const ::xla::HloModuleProto& computation() const; + ::xla::HloModuleProto* release_computation(); + ::xla::HloModuleProto* mutable_computation(); + void set_allocated_computation(::xla::HloModuleProto* computation); + + // .xla.LayoutProto output_layout = 2; + bool has_output_layout() const; + void clear_output_layout(); + static const int kOutputLayoutFieldNumber = 2; + private: + const ::xla::LayoutProto& _internal_output_layout() const; + public: + const ::xla::LayoutProto& output_layout() const; + ::xla::LayoutProto* release_output_layout(); + ::xla::LayoutProto* mutable_output_layout(); + void set_allocated_output_layout(::xla::LayoutProto* output_layout); + + // @@protoc_insertion_point(class_scope:xla.ComputeConstantGraphRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::HloModuleProto* computation_; + ::xla::LayoutProto* output_layout_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ComputeConstantResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ComputeConstantResponse) */ { + public: + ComputeConstantResponse(); + virtual ~ComputeConstantResponse(); + + ComputeConstantResponse(const ComputeConstantResponse& from); + + inline ComputeConstantResponse& operator=(const ComputeConstantResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ComputeConstantResponse(ComputeConstantResponse&& from) noexcept + : ComputeConstantResponse() { + *this = ::std::move(from); + } + + inline ComputeConstantResponse& operator=(ComputeConstantResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ComputeConstantResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ComputeConstantResponse* internal_default_instance() { + return reinterpret_cast( + &_ComputeConstantResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 32; + + void Swap(ComputeConstantResponse* other); + friend void swap(ComputeConstantResponse& a, ComputeConstantResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ComputeConstantResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + ComputeConstantResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ComputeConstantResponse& from); + void MergeFrom(const ComputeConstantResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ComputeConstantResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.LiteralProto literal = 1; + bool has_literal() const; + void clear_literal(); + static const int kLiteralFieldNumber = 1; + private: + const ::xla::LiteralProto& _internal_literal() const; + public: + const ::xla::LiteralProto& literal() const; + ::xla::LiteralProto* release_literal(); + ::xla::LiteralProto* mutable_literal(); + void set_allocated_literal(::xla::LiteralProto* literal); + + // @@protoc_insertion_point(class_scope:xla.ComputeConstantResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::LiteralProto* literal_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeconstructTupleRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DeconstructTupleRequest) */ { + public: + DeconstructTupleRequest(); + virtual ~DeconstructTupleRequest(); + + DeconstructTupleRequest(const DeconstructTupleRequest& from); + + inline DeconstructTupleRequest& operator=(const DeconstructTupleRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeconstructTupleRequest(DeconstructTupleRequest&& from) noexcept + : DeconstructTupleRequest() { + *this = ::std::move(from); + } + + inline DeconstructTupleRequest& operator=(DeconstructTupleRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DeconstructTupleRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeconstructTupleRequest* internal_default_instance() { + return reinterpret_cast( + &_DeconstructTupleRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 33; + + void Swap(DeconstructTupleRequest* other); + friend void swap(DeconstructTupleRequest& a, DeconstructTupleRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeconstructTupleRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + DeconstructTupleRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeconstructTupleRequest& from); + void MergeFrom(const DeconstructTupleRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeconstructTupleRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle tuple_handle = 2; + bool has_tuple_handle() const; + void clear_tuple_handle(); + static const int kTupleHandleFieldNumber = 2; + private: + const ::xla::GlobalDataHandle& _internal_tuple_handle() const; + public: + const ::xla::GlobalDataHandle& tuple_handle() const; + ::xla::GlobalDataHandle* release_tuple_handle(); + ::xla::GlobalDataHandle* mutable_tuple_handle(); + void set_allocated_tuple_handle(::xla::GlobalDataHandle* tuple_handle); + + // @@protoc_insertion_point(class_scope:xla.DeconstructTupleRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* tuple_handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeconstructTupleResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DeconstructTupleResponse) */ { + public: + DeconstructTupleResponse(); + virtual ~DeconstructTupleResponse(); + + DeconstructTupleResponse(const DeconstructTupleResponse& from); + + inline DeconstructTupleResponse& operator=(const DeconstructTupleResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeconstructTupleResponse(DeconstructTupleResponse&& from) noexcept + : DeconstructTupleResponse() { + *this = ::std::move(from); + } + + inline DeconstructTupleResponse& operator=(DeconstructTupleResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DeconstructTupleResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeconstructTupleResponse* internal_default_instance() { + return reinterpret_cast( + &_DeconstructTupleResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 34; + + void Swap(DeconstructTupleResponse* other); + friend void swap(DeconstructTupleResponse& a, DeconstructTupleResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeconstructTupleResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + DeconstructTupleResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeconstructTupleResponse& from); + void MergeFrom(const DeconstructTupleResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeconstructTupleResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.GlobalDataHandle element_handles = 1; + int element_handles_size() const; + void clear_element_handles(); + static const int kElementHandlesFieldNumber = 1; + ::xla::GlobalDataHandle* mutable_element_handles(int index); + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* + mutable_element_handles(); + const ::xla::GlobalDataHandle& element_handles(int index) const; + ::xla::GlobalDataHandle* add_element_handles(); + const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& + element_handles() const; + + // @@protoc_insertion_point(class_scope:xla.DeconstructTupleResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle > element_handles_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LoadDataRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.LoadDataRequest) */ { + public: + LoadDataRequest(); + virtual ~LoadDataRequest(); + + LoadDataRequest(const LoadDataRequest& from); + + inline LoadDataRequest& operator=(const LoadDataRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LoadDataRequest(LoadDataRequest&& from) noexcept + : LoadDataRequest() { + *this = ::std::move(from); + } + + inline LoadDataRequest& operator=(LoadDataRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const LoadDataRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LoadDataRequest* internal_default_instance() { + return reinterpret_cast( + &_LoadDataRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 35; + + void Swap(LoadDataRequest* other); + friend void swap(LoadDataRequest& a, LoadDataRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LoadDataRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + LoadDataRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LoadDataRequest& from); + void MergeFrom(const LoadDataRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LoadDataRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string columnio_tablet_path = 1; + void clear_columnio_tablet_path(); + static const int kColumnioTabletPathFieldNumber = 1; + const ::std::string& columnio_tablet_path() const; + void set_columnio_tablet_path(const ::std::string& value); + #if LANG_CXX11 + void set_columnio_tablet_path(::std::string&& value); + #endif + void set_columnio_tablet_path(const char* value); + void set_columnio_tablet_path(const char* value, size_t size); + ::std::string* mutable_columnio_tablet_path(); + ::std::string* release_columnio_tablet_path(); + void set_allocated_columnio_tablet_path(::std::string* columnio_tablet_path); + + // string columnio_field = 2; + void clear_columnio_field(); + static const int kColumnioFieldFieldNumber = 2; + const ::std::string& columnio_field() const; + void set_columnio_field(const ::std::string& value); + #if LANG_CXX11 + void set_columnio_field(::std::string&& value); + #endif + void set_columnio_field(const char* value); + void set_columnio_field(const char* value, size_t size); + ::std::string* mutable_columnio_field(); + ::std::string* release_columnio_field(); + void set_allocated_columnio_field(::std::string* columnio_field); + + // .xla.ShapeProto element_shape = 3; + bool has_element_shape() const; + void clear_element_shape(); + static const int kElementShapeFieldNumber = 3; + private: + const ::xla::ShapeProto& _internal_element_shape() const; + public: + const ::xla::ShapeProto& element_shape() const; + ::xla::ShapeProto* release_element_shape(); + ::xla::ShapeProto* mutable_element_shape(); + void set_allocated_element_shape(::xla::ShapeProto* element_shape); + + // int64 offset = 4; + void clear_offset(); + static const int kOffsetFieldNumber = 4; + ::google::protobuf::int64 offset() const; + void set_offset(::google::protobuf::int64 value); + + // int64 limit = 5; + void clear_limit(); + static const int kLimitFieldNumber = 5; + ::google::protobuf::int64 limit() const; + void set_limit(::google::protobuf::int64 value); + + // bool zip = 6; + void clear_zip(); + static const int kZipFieldNumber = 6; + bool zip() const; + void set_zip(bool value); + + // @@protoc_insertion_point(class_scope:xla.LoadDataRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr columnio_tablet_path_; + ::google::protobuf::internal::ArenaStringPtr columnio_field_; + ::xla::ShapeProto* element_shape_; + ::google::protobuf::int64 offset_; + ::google::protobuf::int64 limit_; + bool zip_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LoadDataResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.LoadDataResponse) */ { + public: + LoadDataResponse(); + virtual ~LoadDataResponse(); + + LoadDataResponse(const LoadDataResponse& from); + + inline LoadDataResponse& operator=(const LoadDataResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LoadDataResponse(LoadDataResponse&& from) noexcept + : LoadDataResponse() { + *this = ::std::move(from); + } + + inline LoadDataResponse& operator=(LoadDataResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const LoadDataResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LoadDataResponse* internal_default_instance() { + return reinterpret_cast( + &_LoadDataResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 36; + + void Swap(LoadDataResponse* other); + friend void swap(LoadDataResponse& a, LoadDataResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LoadDataResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + LoadDataResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LoadDataResponse& from); + void MergeFrom(const LoadDataResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LoadDataResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle data = 1; + bool has_data() const; + void clear_data(); + static const int kDataFieldNumber = 1; + private: + const ::xla::GlobalDataHandle& _internal_data() const; + public: + const ::xla::GlobalDataHandle& data() const; + ::xla::GlobalDataHandle* release_data(); + ::xla::GlobalDataHandle* mutable_data(); + void set_allocated_data(::xla::GlobalDataHandle* data); + + // .xla.ShapeProto data_shape = 2; + bool has_data_shape() const; + void clear_data_shape(); + static const int kDataShapeFieldNumber = 2; + private: + const ::xla::ShapeProto& _internal_data_shape() const; + public: + const ::xla::ShapeProto& data_shape() const; + ::xla::ShapeProto* release_data_shape(); + ::xla::ShapeProto* mutable_data_shape(); + void set_allocated_data_shape(::xla::ShapeProto* data_shape); + + // int64 available_rows = 3; + void clear_available_rows(); + static const int kAvailableRowsFieldNumber = 3; + ::google::protobuf::int64 available_rows() const; + void set_available_rows(::google::protobuf::int64 value); + + // int64 rows_loaded = 4; + void clear_rows_loaded(); + static const int kRowsLoadedFieldNumber = 4; + ::google::protobuf::int64 rows_loaded() const; + void set_rows_loaded(::google::protobuf::int64 value); + + // int64 nanoseconds = 5; + void clear_nanoseconds(); + static const int kNanosecondsFieldNumber = 5; + ::google::protobuf::int64 nanoseconds() const; + void set_nanoseconds(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.LoadDataResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* data_; + ::xla::ShapeProto* data_shape_; + ::google::protobuf::int64 available_rows_; + ::google::protobuf::int64 rows_loaded_; + ::google::protobuf::int64 nanoseconds_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GetShapeRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.GetShapeRequest) */ { + public: + GetShapeRequest(); + virtual ~GetShapeRequest(); + + GetShapeRequest(const GetShapeRequest& from); + + inline GetShapeRequest& operator=(const GetShapeRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GetShapeRequest(GetShapeRequest&& from) noexcept + : GetShapeRequest() { + *this = ::std::move(from); + } + + inline GetShapeRequest& operator=(GetShapeRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const GetShapeRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GetShapeRequest* internal_default_instance() { + return reinterpret_cast( + &_GetShapeRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 37; + + void Swap(GetShapeRequest* other); + friend void swap(GetShapeRequest& a, GetShapeRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GetShapeRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + GetShapeRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GetShapeRequest& from); + void MergeFrom(const GetShapeRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetShapeRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle data = 1; + bool has_data() const; + void clear_data(); + static const int kDataFieldNumber = 1; + private: + const ::xla::GlobalDataHandle& _internal_data() const; + public: + const ::xla::GlobalDataHandle& data() const; + ::xla::GlobalDataHandle* release_data(); + ::xla::GlobalDataHandle* mutable_data(); + void set_allocated_data(::xla::GlobalDataHandle* data); + + // @@protoc_insertion_point(class_scope:xla.GetShapeRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GetShapeResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.GetShapeResponse) */ { + public: + GetShapeResponse(); + virtual ~GetShapeResponse(); + + GetShapeResponse(const GetShapeResponse& from); + + inline GetShapeResponse& operator=(const GetShapeResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GetShapeResponse(GetShapeResponse&& from) noexcept + : GetShapeResponse() { + *this = ::std::move(from); + } + + inline GetShapeResponse& operator=(GetShapeResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const GetShapeResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GetShapeResponse* internal_default_instance() { + return reinterpret_cast( + &_GetShapeResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 38; + + void Swap(GetShapeResponse* other); + friend void swap(GetShapeResponse& a, GetShapeResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GetShapeResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + GetShapeResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GetShapeResponse& from); + void MergeFrom(const GetShapeResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetShapeResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.ShapeProto shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + private: + const ::xla::ShapeProto& _internal_shape() const; + public: + const ::xla::ShapeProto& shape() const; + ::xla::ShapeProto* release_shape(); + ::xla::ShapeProto* mutable_shape(); + void set_allocated_shape(::xla::ShapeProto* shape); + + // @@protoc_insertion_point(class_scope:xla.GetShapeResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::ShapeProto* shape_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class UnpackRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.UnpackRequest) */ { + public: + UnpackRequest(); + virtual ~UnpackRequest(); + + UnpackRequest(const UnpackRequest& from); + + inline UnpackRequest& operator=(const UnpackRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + UnpackRequest(UnpackRequest&& from) noexcept + : UnpackRequest() { + *this = ::std::move(from); + } + + inline UnpackRequest& operator=(UnpackRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const UnpackRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const UnpackRequest* internal_default_instance() { + return reinterpret_cast( + &_UnpackRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 39; + + void Swap(UnpackRequest* other); + friend void swap(UnpackRequest& a, UnpackRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline UnpackRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + UnpackRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const UnpackRequest& from); + void MergeFrom(const UnpackRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(UnpackRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.GlobalDataHandle data = 1; + bool has_data() const; + void clear_data(); + static const int kDataFieldNumber = 1; + private: + const ::xla::GlobalDataHandle& _internal_data() const; + public: + const ::xla::GlobalDataHandle& data() const; + ::xla::GlobalDataHandle* release_data(); + ::xla::GlobalDataHandle* mutable_data(); + void set_allocated_data(::xla::GlobalDataHandle* data); + + // @@protoc_insertion_point(class_scope:xla.UnpackRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::GlobalDataHandle* data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class UnpackResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.UnpackResponse) */ { + public: + UnpackResponse(); + virtual ~UnpackResponse(); + + UnpackResponse(const UnpackResponse& from); + + inline UnpackResponse& operator=(const UnpackResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + UnpackResponse(UnpackResponse&& from) noexcept + : UnpackResponse() { + *this = ::std::move(from); + } + + inline UnpackResponse& operator=(UnpackResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const UnpackResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const UnpackResponse* internal_default_instance() { + return reinterpret_cast( + &_UnpackResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 40; + + void Swap(UnpackResponse* other); + friend void swap(UnpackResponse& a, UnpackResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline UnpackResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + UnpackResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const UnpackResponse& from); + void MergeFrom(const UnpackResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(UnpackResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.GlobalDataHandle tied_data = 1; + int tied_data_size() const; + void clear_tied_data(); + static const int kTiedDataFieldNumber = 1; + ::xla::GlobalDataHandle* mutable_tied_data(int index); + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* + mutable_tied_data(); + const ::xla::GlobalDataHandle& tied_data(int index) const; + ::xla::GlobalDataHandle* add_tied_data(); + const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& + tied_data() const; + + // @@protoc_insertion_point(class_scope:xla.UnpackResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle > tied_data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// HloReducePrecisionOptions + +// .xla.HloReducePrecisionOptions.Location location = 1; +inline void HloReducePrecisionOptions::clear_location() { + location_ = 0; +} +inline ::xla::HloReducePrecisionOptions_Location HloReducePrecisionOptions::location() const { + // @@protoc_insertion_point(field_get:xla.HloReducePrecisionOptions.location) + return static_cast< ::xla::HloReducePrecisionOptions_Location >(location_); +} +inline void HloReducePrecisionOptions::set_location(::xla::HloReducePrecisionOptions_Location value) { + + location_ = value; + // @@protoc_insertion_point(field_set:xla.HloReducePrecisionOptions.location) +} + +// uint32 exponent_bits = 2; +inline void HloReducePrecisionOptions::clear_exponent_bits() { + exponent_bits_ = 0u; +} +inline ::google::protobuf::uint32 HloReducePrecisionOptions::exponent_bits() const { + // @@protoc_insertion_point(field_get:xla.HloReducePrecisionOptions.exponent_bits) + return exponent_bits_; +} +inline void HloReducePrecisionOptions::set_exponent_bits(::google::protobuf::uint32 value) { + + exponent_bits_ = value; + // @@protoc_insertion_point(field_set:xla.HloReducePrecisionOptions.exponent_bits) +} + +// uint32 mantissa_bits = 3; +inline void HloReducePrecisionOptions::clear_mantissa_bits() { + mantissa_bits_ = 0u; +} +inline ::google::protobuf::uint32 HloReducePrecisionOptions::mantissa_bits() const { + // @@protoc_insertion_point(field_get:xla.HloReducePrecisionOptions.mantissa_bits) + return mantissa_bits_; +} +inline void HloReducePrecisionOptions::set_mantissa_bits(::google::protobuf::uint32 value) { + + mantissa_bits_ = value; + // @@protoc_insertion_point(field_set:xla.HloReducePrecisionOptions.mantissa_bits) +} + +// repeated uint32 opcodes_to_suffix = 4; +inline int HloReducePrecisionOptions::opcodes_to_suffix_size() const { + return opcodes_to_suffix_.size(); +} +inline void HloReducePrecisionOptions::clear_opcodes_to_suffix() { + opcodes_to_suffix_.Clear(); +} +inline ::google::protobuf::uint32 HloReducePrecisionOptions::opcodes_to_suffix(int index) const { + // @@protoc_insertion_point(field_get:xla.HloReducePrecisionOptions.opcodes_to_suffix) + return opcodes_to_suffix_.Get(index); +} +inline void HloReducePrecisionOptions::set_opcodes_to_suffix(int index, ::google::protobuf::uint32 value) { + opcodes_to_suffix_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.HloReducePrecisionOptions.opcodes_to_suffix) +} +inline void HloReducePrecisionOptions::add_opcodes_to_suffix(::google::protobuf::uint32 value) { + opcodes_to_suffix_.Add(value); + // @@protoc_insertion_point(field_add:xla.HloReducePrecisionOptions.opcodes_to_suffix) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +HloReducePrecisionOptions::opcodes_to_suffix() const { + // @@protoc_insertion_point(field_list:xla.HloReducePrecisionOptions.opcodes_to_suffix) + return opcodes_to_suffix_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +HloReducePrecisionOptions::mutable_opcodes_to_suffix() { + // @@protoc_insertion_point(field_mutable_list:xla.HloReducePrecisionOptions.opcodes_to_suffix) + return &opcodes_to_suffix_; +} + +// repeated string opname_substrings_to_suffix = 5; +inline int HloReducePrecisionOptions::opname_substrings_to_suffix_size() const { + return opname_substrings_to_suffix_.size(); +} +inline void HloReducePrecisionOptions::clear_opname_substrings_to_suffix() { + opname_substrings_to_suffix_.Clear(); +} +inline const ::std::string& HloReducePrecisionOptions::opname_substrings_to_suffix(int index) const { + // @@protoc_insertion_point(field_get:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) + return opname_substrings_to_suffix_.Get(index); +} +inline ::std::string* HloReducePrecisionOptions::mutable_opname_substrings_to_suffix(int index) { + // @@protoc_insertion_point(field_mutable:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) + return opname_substrings_to_suffix_.Mutable(index); +} +inline void HloReducePrecisionOptions::set_opname_substrings_to_suffix(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) + opname_substrings_to_suffix_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void HloReducePrecisionOptions::set_opname_substrings_to_suffix(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) + opname_substrings_to_suffix_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void HloReducePrecisionOptions::set_opname_substrings_to_suffix(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + opname_substrings_to_suffix_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) +} +inline void HloReducePrecisionOptions::set_opname_substrings_to_suffix(int index, const char* value, size_t size) { + opname_substrings_to_suffix_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) +} +inline ::std::string* HloReducePrecisionOptions::add_opname_substrings_to_suffix() { + // @@protoc_insertion_point(field_add_mutable:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) + return opname_substrings_to_suffix_.Add(); +} +inline void HloReducePrecisionOptions::add_opname_substrings_to_suffix(const ::std::string& value) { + opname_substrings_to_suffix_.Add()->assign(value); + // @@protoc_insertion_point(field_add:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) +} +#if LANG_CXX11 +inline void HloReducePrecisionOptions::add_opname_substrings_to_suffix(::std::string&& value) { + opname_substrings_to_suffix_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) +} +#endif +inline void HloReducePrecisionOptions::add_opname_substrings_to_suffix(const char* value) { + GOOGLE_DCHECK(value != NULL); + opname_substrings_to_suffix_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) +} +inline void HloReducePrecisionOptions::add_opname_substrings_to_suffix(const char* value, size_t size) { + opname_substrings_to_suffix_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +HloReducePrecisionOptions::opname_substrings_to_suffix() const { + // @@protoc_insertion_point(field_list:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) + return opname_substrings_to_suffix_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +HloReducePrecisionOptions::mutable_opname_substrings_to_suffix() { + // @@protoc_insertion_point(field_mutable_list:xla.HloReducePrecisionOptions.opname_substrings_to_suffix) + return &opname_substrings_to_suffix_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// DebugOptions + +// string xla_generate_hlo_graph = 1; +inline void DebugOptions::clear_xla_generate_hlo_graph() { + xla_generate_hlo_graph_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_generate_hlo_graph() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_generate_hlo_graph) + return xla_generate_hlo_graph_.GetNoArena(); +} +inline void DebugOptions::set_xla_generate_hlo_graph(const ::std::string& value) { + + xla_generate_hlo_graph_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_generate_hlo_graph) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_generate_hlo_graph(::std::string&& value) { + + xla_generate_hlo_graph_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_generate_hlo_graph) +} +#endif +inline void DebugOptions::set_xla_generate_hlo_graph(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_generate_hlo_graph_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_generate_hlo_graph) +} +inline void DebugOptions::set_xla_generate_hlo_graph(const char* value, size_t size) { + + xla_generate_hlo_graph_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_generate_hlo_graph) +} +inline ::std::string* DebugOptions::mutable_xla_generate_hlo_graph() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_generate_hlo_graph) + return xla_generate_hlo_graph_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_generate_hlo_graph() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_generate_hlo_graph) + + return xla_generate_hlo_graph_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_generate_hlo_graph(::std::string* xla_generate_hlo_graph) { + if (xla_generate_hlo_graph != NULL) { + + } else { + + } + xla_generate_hlo_graph_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_generate_hlo_graph); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_generate_hlo_graph) +} + +// bool xla_hlo_graph_addresses = 2; +inline void DebugOptions::clear_xla_hlo_graph_addresses() { + xla_hlo_graph_addresses_ = false; +} +inline bool DebugOptions::xla_hlo_graph_addresses() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_graph_addresses) + return xla_hlo_graph_addresses_; +} +inline void DebugOptions::set_xla_hlo_graph_addresses(bool value) { + + xla_hlo_graph_addresses_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_graph_addresses) +} + +// string xla_hlo_graph_path = 4; +inline void DebugOptions::clear_xla_hlo_graph_path() { + xla_hlo_graph_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_hlo_graph_path() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_graph_path) + return xla_hlo_graph_path_.GetNoArena(); +} +inline void DebugOptions::set_xla_hlo_graph_path(const ::std::string& value) { + + xla_hlo_graph_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_graph_path) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_hlo_graph_path(::std::string&& value) { + + xla_hlo_graph_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_hlo_graph_path) +} +#endif +inline void DebugOptions::set_xla_hlo_graph_path(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_hlo_graph_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_hlo_graph_path) +} +inline void DebugOptions::set_xla_hlo_graph_path(const char* value, size_t size) { + + xla_hlo_graph_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_hlo_graph_path) +} +inline ::std::string* DebugOptions::mutable_xla_hlo_graph_path() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_hlo_graph_path) + return xla_hlo_graph_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_hlo_graph_path() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_hlo_graph_path) + + return xla_hlo_graph_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_hlo_graph_path(::std::string* xla_hlo_graph_path) { + if (xla_hlo_graph_path != NULL) { + + } else { + + } + xla_hlo_graph_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_hlo_graph_path); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_hlo_graph_path) +} + +// bool xla_hlo_dump_as_graphdef = 5; +inline void DebugOptions::clear_xla_hlo_dump_as_graphdef() { + xla_hlo_dump_as_graphdef_ = false; +} +inline bool DebugOptions::xla_hlo_dump_as_graphdef() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_dump_as_graphdef) + return xla_hlo_dump_as_graphdef_; +} +inline void DebugOptions::set_xla_hlo_dump_as_graphdef(bool value) { + + xla_hlo_dump_as_graphdef_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_dump_as_graphdef) +} + +// string xla_log_hlo_text = 6; +inline void DebugOptions::clear_xla_log_hlo_text() { + xla_log_hlo_text_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_log_hlo_text() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_log_hlo_text) + return xla_log_hlo_text_.GetNoArena(); +} +inline void DebugOptions::set_xla_log_hlo_text(const ::std::string& value) { + + xla_log_hlo_text_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_log_hlo_text) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_log_hlo_text(::std::string&& value) { + + xla_log_hlo_text_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_log_hlo_text) +} +#endif +inline void DebugOptions::set_xla_log_hlo_text(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_log_hlo_text_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_log_hlo_text) +} +inline void DebugOptions::set_xla_log_hlo_text(const char* value, size_t size) { + + xla_log_hlo_text_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_log_hlo_text) +} +inline ::std::string* DebugOptions::mutable_xla_log_hlo_text() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_log_hlo_text) + return xla_log_hlo_text_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_log_hlo_text() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_log_hlo_text) + + return xla_log_hlo_text_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_log_hlo_text(::std::string* xla_log_hlo_text) { + if (xla_log_hlo_text != NULL) { + + } else { + + } + xla_log_hlo_text_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_log_hlo_text); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_log_hlo_text) +} + +// string xla_generate_hlo_text_to = 7; +inline void DebugOptions::clear_xla_generate_hlo_text_to() { + xla_generate_hlo_text_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_generate_hlo_text_to() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_generate_hlo_text_to) + return xla_generate_hlo_text_to_.GetNoArena(); +} +inline void DebugOptions::set_xla_generate_hlo_text_to(const ::std::string& value) { + + xla_generate_hlo_text_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_generate_hlo_text_to) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_generate_hlo_text_to(::std::string&& value) { + + xla_generate_hlo_text_to_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_generate_hlo_text_to) +} +#endif +inline void DebugOptions::set_xla_generate_hlo_text_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_generate_hlo_text_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_generate_hlo_text_to) +} +inline void DebugOptions::set_xla_generate_hlo_text_to(const char* value, size_t size) { + + xla_generate_hlo_text_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_generate_hlo_text_to) +} +inline ::std::string* DebugOptions::mutable_xla_generate_hlo_text_to() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_generate_hlo_text_to) + return xla_generate_hlo_text_to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_generate_hlo_text_to() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_generate_hlo_text_to) + + return xla_generate_hlo_text_to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_generate_hlo_text_to(::std::string* xla_generate_hlo_text_to) { + if (xla_generate_hlo_text_to != NULL) { + + } else { + + } + xla_generate_hlo_text_to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_generate_hlo_text_to); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_generate_hlo_text_to) +} + +// string xla_dump_optimized_hlo_proto_to = 8; +inline void DebugOptions::clear_xla_dump_optimized_hlo_proto_to() { + xla_dump_optimized_hlo_proto_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_dump_optimized_hlo_proto_to() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) + return xla_dump_optimized_hlo_proto_to_.GetNoArena(); +} +inline void DebugOptions::set_xla_dump_optimized_hlo_proto_to(const ::std::string& value) { + + xla_dump_optimized_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_dump_optimized_hlo_proto_to(::std::string&& value) { + + xla_dump_optimized_hlo_proto_to_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) +} +#endif +inline void DebugOptions::set_xla_dump_optimized_hlo_proto_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_dump_optimized_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) +} +inline void DebugOptions::set_xla_dump_optimized_hlo_proto_to(const char* value, size_t size) { + + xla_dump_optimized_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) +} +inline ::std::string* DebugOptions::mutable_xla_dump_optimized_hlo_proto_to() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) + return xla_dump_optimized_hlo_proto_to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_dump_optimized_hlo_proto_to() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) + + return xla_dump_optimized_hlo_proto_to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_dump_optimized_hlo_proto_to(::std::string* xla_dump_optimized_hlo_proto_to) { + if (xla_dump_optimized_hlo_proto_to != NULL) { + + } else { + + } + xla_dump_optimized_hlo_proto_to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_dump_optimized_hlo_proto_to); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_dump_optimized_hlo_proto_to) +} + +// bool xla_hlo_profile = 9; +inline void DebugOptions::clear_xla_hlo_profile() { + xla_hlo_profile_ = false; +} +inline bool DebugOptions::xla_hlo_profile() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_profile) + return xla_hlo_profile_; +} +inline void DebugOptions::set_xla_hlo_profile(bool value) { + + xla_hlo_profile_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_profile) +} + +// string xla_dump_computations_to = 10; +inline void DebugOptions::clear_xla_dump_computations_to() { + xla_dump_computations_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_dump_computations_to() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_dump_computations_to) + return xla_dump_computations_to_.GetNoArena(); +} +inline void DebugOptions::set_xla_dump_computations_to(const ::std::string& value) { + + xla_dump_computations_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_dump_computations_to) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_dump_computations_to(::std::string&& value) { + + xla_dump_computations_to_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_dump_computations_to) +} +#endif +inline void DebugOptions::set_xla_dump_computations_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_dump_computations_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_dump_computations_to) +} +inline void DebugOptions::set_xla_dump_computations_to(const char* value, size_t size) { + + xla_dump_computations_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_dump_computations_to) +} +inline ::std::string* DebugOptions::mutable_xla_dump_computations_to() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_dump_computations_to) + return xla_dump_computations_to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_dump_computations_to() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_dump_computations_to) + + return xla_dump_computations_to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_dump_computations_to(::std::string* xla_dump_computations_to) { + if (xla_dump_computations_to != NULL) { + + } else { + + } + xla_dump_computations_to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_dump_computations_to); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_dump_computations_to) +} + +// string xla_dump_executions_to = 11; +inline void DebugOptions::clear_xla_dump_executions_to() { + xla_dump_executions_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_dump_executions_to() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_dump_executions_to) + return xla_dump_executions_to_.GetNoArena(); +} +inline void DebugOptions::set_xla_dump_executions_to(const ::std::string& value) { + + xla_dump_executions_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_dump_executions_to) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_dump_executions_to(::std::string&& value) { + + xla_dump_executions_to_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_dump_executions_to) +} +#endif +inline void DebugOptions::set_xla_dump_executions_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_dump_executions_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_dump_executions_to) +} +inline void DebugOptions::set_xla_dump_executions_to(const char* value, size_t size) { + + xla_dump_executions_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_dump_executions_to) +} +inline ::std::string* DebugOptions::mutable_xla_dump_executions_to() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_dump_executions_to) + return xla_dump_executions_to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_dump_executions_to() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_dump_executions_to) + + return xla_dump_executions_to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_dump_executions_to(::std::string* xla_dump_executions_to) { + if (xla_dump_executions_to != NULL) { + + } else { + + } + xla_dump_executions_to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_dump_executions_to); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_dump_executions_to) +} + +// repeated string xla_disable_hlo_passes = 30; +inline int DebugOptions::xla_disable_hlo_passes_size() const { + return xla_disable_hlo_passes_.size(); +} +inline void DebugOptions::clear_xla_disable_hlo_passes() { + xla_disable_hlo_passes_.Clear(); +} +inline const ::std::string& DebugOptions::xla_disable_hlo_passes(int index) const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_disable_hlo_passes) + return xla_disable_hlo_passes_.Get(index); +} +inline ::std::string* DebugOptions::mutable_xla_disable_hlo_passes(int index) { + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_disable_hlo_passes) + return xla_disable_hlo_passes_.Mutable(index); +} +inline void DebugOptions::set_xla_disable_hlo_passes(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_disable_hlo_passes) + xla_disable_hlo_passes_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_disable_hlo_passes(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_disable_hlo_passes) + xla_disable_hlo_passes_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void DebugOptions::set_xla_disable_hlo_passes(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + xla_disable_hlo_passes_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_disable_hlo_passes) +} +inline void DebugOptions::set_xla_disable_hlo_passes(int index, const char* value, size_t size) { + xla_disable_hlo_passes_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_disable_hlo_passes) +} +inline ::std::string* DebugOptions::add_xla_disable_hlo_passes() { + // @@protoc_insertion_point(field_add_mutable:xla.DebugOptions.xla_disable_hlo_passes) + return xla_disable_hlo_passes_.Add(); +} +inline void DebugOptions::add_xla_disable_hlo_passes(const ::std::string& value) { + xla_disable_hlo_passes_.Add()->assign(value); + // @@protoc_insertion_point(field_add:xla.DebugOptions.xla_disable_hlo_passes) +} +#if LANG_CXX11 +inline void DebugOptions::add_xla_disable_hlo_passes(::std::string&& value) { + xla_disable_hlo_passes_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:xla.DebugOptions.xla_disable_hlo_passes) +} +#endif +inline void DebugOptions::add_xla_disable_hlo_passes(const char* value) { + GOOGLE_DCHECK(value != NULL); + xla_disable_hlo_passes_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:xla.DebugOptions.xla_disable_hlo_passes) +} +inline void DebugOptions::add_xla_disable_hlo_passes(const char* value, size_t size) { + xla_disable_hlo_passes_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:xla.DebugOptions.xla_disable_hlo_passes) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +DebugOptions::xla_disable_hlo_passes() const { + // @@protoc_insertion_point(field_list:xla.DebugOptions.xla_disable_hlo_passes) + return xla_disable_hlo_passes_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +DebugOptions::mutable_xla_disable_hlo_passes() { + // @@protoc_insertion_point(field_mutable_list:xla.DebugOptions.xla_disable_hlo_passes) + return &xla_disable_hlo_passes_; +} + +// bool xla_disable_all_hlo_passes = 104; +inline void DebugOptions::clear_xla_disable_all_hlo_passes() { + xla_disable_all_hlo_passes_ = false; +} +inline bool DebugOptions::xla_disable_all_hlo_passes() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_disable_all_hlo_passes) + return xla_disable_all_hlo_passes_; +} +inline void DebugOptions::set_xla_disable_all_hlo_passes(bool value) { + + xla_disable_all_hlo_passes_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_disable_all_hlo_passes) +} + +// int32 xla_backend_optimization_level = 31; +inline void DebugOptions::clear_xla_backend_optimization_level() { + xla_backend_optimization_level_ = 0; +} +inline ::google::protobuf::int32 DebugOptions::xla_backend_optimization_level() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_backend_optimization_level) + return xla_backend_optimization_level_; +} +inline void DebugOptions::set_xla_backend_optimization_level(::google::protobuf::int32 value) { + + xla_backend_optimization_level_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_backend_optimization_level) +} + +// bool xla_embed_ir_in_executable = 33; +inline void DebugOptions::clear_xla_embed_ir_in_executable() { + xla_embed_ir_in_executable_ = false; +} +inline bool DebugOptions::xla_embed_ir_in_executable() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_embed_ir_in_executable) + return xla_embed_ir_in_executable_; +} +inline void DebugOptions::set_xla_embed_ir_in_executable(bool value) { + + xla_embed_ir_in_executable_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_embed_ir_in_executable) +} + +// string xla_dump_ir_to = 34; +inline void DebugOptions::clear_xla_dump_ir_to() { + xla_dump_ir_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_dump_ir_to() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_dump_ir_to) + return xla_dump_ir_to_.GetNoArena(); +} +inline void DebugOptions::set_xla_dump_ir_to(const ::std::string& value) { + + xla_dump_ir_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_dump_ir_to) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_dump_ir_to(::std::string&& value) { + + xla_dump_ir_to_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_dump_ir_to) +} +#endif +inline void DebugOptions::set_xla_dump_ir_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_dump_ir_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_dump_ir_to) +} +inline void DebugOptions::set_xla_dump_ir_to(const char* value, size_t size) { + + xla_dump_ir_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_dump_ir_to) +} +inline ::std::string* DebugOptions::mutable_xla_dump_ir_to() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_dump_ir_to) + return xla_dump_ir_to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_dump_ir_to() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_dump_ir_to) + + return xla_dump_ir_to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_dump_ir_to(::std::string* xla_dump_ir_to) { + if (xla_dump_ir_to != NULL) { + + } else { + + } + xla_dump_ir_to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_dump_ir_to); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_dump_ir_to) +} + +// bool xla_eliminate_hlo_implicit_broadcast = 35; +inline void DebugOptions::clear_xla_eliminate_hlo_implicit_broadcast() { + xla_eliminate_hlo_implicit_broadcast_ = false; +} +inline bool DebugOptions::xla_eliminate_hlo_implicit_broadcast() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_eliminate_hlo_implicit_broadcast) + return xla_eliminate_hlo_implicit_broadcast_; +} +inline void DebugOptions::set_xla_eliminate_hlo_implicit_broadcast(bool value) { + + xla_eliminate_hlo_implicit_broadcast_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_eliminate_hlo_implicit_broadcast) +} + +// bool xla_cpu_multi_thread_eigen = 60; +inline void DebugOptions::clear_xla_cpu_multi_thread_eigen() { + xla_cpu_multi_thread_eigen_ = false; +} +inline bool DebugOptions::xla_cpu_multi_thread_eigen() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_cpu_multi_thread_eigen) + return xla_cpu_multi_thread_eigen_; +} +inline void DebugOptions::set_xla_cpu_multi_thread_eigen(bool value) { + + xla_cpu_multi_thread_eigen_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_cpu_multi_thread_eigen) +} + +// string xla_gpu_cuda_data_dir = 61; +inline void DebugOptions::clear_xla_gpu_cuda_data_dir() { + xla_gpu_cuda_data_dir_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_gpu_cuda_data_dir() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_cuda_data_dir) + return xla_gpu_cuda_data_dir_.GetNoArena(); +} +inline void DebugOptions::set_xla_gpu_cuda_data_dir(const ::std::string& value) { + + xla_gpu_cuda_data_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_cuda_data_dir) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_gpu_cuda_data_dir(::std::string&& value) { + + xla_gpu_cuda_data_dir_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_gpu_cuda_data_dir) +} +#endif +inline void DebugOptions::set_xla_gpu_cuda_data_dir(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_gpu_cuda_data_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_gpu_cuda_data_dir) +} +inline void DebugOptions::set_xla_gpu_cuda_data_dir(const char* value, size_t size) { + + xla_gpu_cuda_data_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_gpu_cuda_data_dir) +} +inline ::std::string* DebugOptions::mutable_xla_gpu_cuda_data_dir() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_gpu_cuda_data_dir) + return xla_gpu_cuda_data_dir_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_gpu_cuda_data_dir() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_gpu_cuda_data_dir) + + return xla_gpu_cuda_data_dir_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_gpu_cuda_data_dir(::std::string* xla_gpu_cuda_data_dir) { + if (xla_gpu_cuda_data_dir != NULL) { + + } else { + + } + xla_gpu_cuda_data_dir_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_gpu_cuda_data_dir); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_gpu_cuda_data_dir) +} + +// bool xla_gpu_ftz = 62; +inline void DebugOptions::clear_xla_gpu_ftz() { + xla_gpu_ftz_ = false; +} +inline bool DebugOptions::xla_gpu_ftz() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_ftz) + return xla_gpu_ftz_; +} +inline void DebugOptions::set_xla_gpu_ftz(bool value) { + + xla_gpu_ftz_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_ftz) +} + +// bool xla_gpu_disable_multi_streaming = 63; +inline void DebugOptions::clear_xla_gpu_disable_multi_streaming() { + xla_gpu_disable_multi_streaming_ = false; +} +inline bool DebugOptions::xla_gpu_disable_multi_streaming() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_disable_multi_streaming) + return xla_gpu_disable_multi_streaming_; +} +inline void DebugOptions::set_xla_gpu_disable_multi_streaming(bool value) { + + xla_gpu_disable_multi_streaming_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_disable_multi_streaming) +} + +// bool xla_llvm_enable_alias_scope_metadata = 70; +inline void DebugOptions::clear_xla_llvm_enable_alias_scope_metadata() { + xla_llvm_enable_alias_scope_metadata_ = false; +} +inline bool DebugOptions::xla_llvm_enable_alias_scope_metadata() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_llvm_enable_alias_scope_metadata) + return xla_llvm_enable_alias_scope_metadata_; +} +inline void DebugOptions::set_xla_llvm_enable_alias_scope_metadata(bool value) { + + xla_llvm_enable_alias_scope_metadata_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_llvm_enable_alias_scope_metadata) +} + +// bool xla_llvm_enable_noalias_metadata = 71; +inline void DebugOptions::clear_xla_llvm_enable_noalias_metadata() { + xla_llvm_enable_noalias_metadata_ = false; +} +inline bool DebugOptions::xla_llvm_enable_noalias_metadata() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_llvm_enable_noalias_metadata) + return xla_llvm_enable_noalias_metadata_; +} +inline void DebugOptions::set_xla_llvm_enable_noalias_metadata(bool value) { + + xla_llvm_enable_noalias_metadata_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_llvm_enable_noalias_metadata) +} + +// bool xla_llvm_enable_invariant_load_metadata = 72; +inline void DebugOptions::clear_xla_llvm_enable_invariant_load_metadata() { + xla_llvm_enable_invariant_load_metadata_ = false; +} +inline bool DebugOptions::xla_llvm_enable_invariant_load_metadata() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_llvm_enable_invariant_load_metadata) + return xla_llvm_enable_invariant_load_metadata_; +} +inline void DebugOptions::set_xla_llvm_enable_invariant_load_metadata(bool value) { + + xla_llvm_enable_invariant_load_metadata_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_llvm_enable_invariant_load_metadata) +} + +// bool xla_llvm_disable_expensive_passes = 73; +inline void DebugOptions::clear_xla_llvm_disable_expensive_passes() { + xla_llvm_disable_expensive_passes_ = false; +} +inline bool DebugOptions::xla_llvm_disable_expensive_passes() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_llvm_disable_expensive_passes) + return xla_llvm_disable_expensive_passes_; +} +inline void DebugOptions::set_xla_llvm_disable_expensive_passes(bool value) { + + xla_llvm_disable_expensive_passes_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_llvm_disable_expensive_passes) +} + +// repeated .xla.HloReducePrecisionOptions hlo_reduce_precision_options = 80; +inline int DebugOptions::hlo_reduce_precision_options_size() const { + return hlo_reduce_precision_options_.size(); +} +inline void DebugOptions::clear_hlo_reduce_precision_options() { + hlo_reduce_precision_options_.Clear(); +} +inline ::xla::HloReducePrecisionOptions* DebugOptions::mutable_hlo_reduce_precision_options(int index) { + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.hlo_reduce_precision_options) + return hlo_reduce_precision_options_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloReducePrecisionOptions >* +DebugOptions::mutable_hlo_reduce_precision_options() { + // @@protoc_insertion_point(field_mutable_list:xla.DebugOptions.hlo_reduce_precision_options) + return &hlo_reduce_precision_options_; +} +inline const ::xla::HloReducePrecisionOptions& DebugOptions::hlo_reduce_precision_options(int index) const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.hlo_reduce_precision_options) + return hlo_reduce_precision_options_.Get(index); +} +inline ::xla::HloReducePrecisionOptions* DebugOptions::add_hlo_reduce_precision_options() { + // @@protoc_insertion_point(field_add:xla.DebugOptions.hlo_reduce_precision_options) + return hlo_reduce_precision_options_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloReducePrecisionOptions >& +DebugOptions::hlo_reduce_precision_options() const { + // @@protoc_insertion_point(field_list:xla.DebugOptions.hlo_reduce_precision_options) + return hlo_reduce_precision_options_; +} + +// bool xla_test_all_output_layouts = 90; +inline void DebugOptions::clear_xla_test_all_output_layouts() { + xla_test_all_output_layouts_ = false; +} +inline bool DebugOptions::xla_test_all_output_layouts() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_test_all_output_layouts) + return xla_test_all_output_layouts_; +} +inline void DebugOptions::set_xla_test_all_output_layouts(bool value) { + + xla_test_all_output_layouts_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_test_all_output_layouts) +} + +// bool xla_test_all_input_layouts = 91; +inline void DebugOptions::clear_xla_test_all_input_layouts() { + xla_test_all_input_layouts_ = false; +} +inline bool DebugOptions::xla_test_all_input_layouts() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_test_all_input_layouts) + return xla_test_all_input_layouts_; +} +inline void DebugOptions::set_xla_test_all_input_layouts(bool value) { + + xla_test_all_input_layouts_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_test_all_input_layouts) +} + +// bool xla_hlo_graph_sharding_color = 92; +inline void DebugOptions::clear_xla_hlo_graph_sharding_color() { + xla_hlo_graph_sharding_color_ = false; +} +inline bool DebugOptions::xla_hlo_graph_sharding_color() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_graph_sharding_color) + return xla_hlo_graph_sharding_color_; +} +inline void DebugOptions::set_xla_hlo_graph_sharding_color(bool value) { + + xla_hlo_graph_sharding_color_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_graph_sharding_color) +} + +// bool xla_hlo_tfgraph_device_scopes = 93; +inline void DebugOptions::clear_xla_hlo_tfgraph_device_scopes() { + xla_hlo_tfgraph_device_scopes_ = false; +} +inline bool DebugOptions::xla_hlo_tfgraph_device_scopes() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_tfgraph_device_scopes) + return xla_hlo_tfgraph_device_scopes_; +} +inline void DebugOptions::set_xla_hlo_tfgraph_device_scopes(bool value) { + + xla_hlo_tfgraph_device_scopes_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_tfgraph_device_scopes) +} + +// bool xla_gpu_use_cudnn_batchnorm = 94; +inline void DebugOptions::clear_xla_gpu_use_cudnn_batchnorm() { + xla_gpu_use_cudnn_batchnorm_ = false; +} +inline bool DebugOptions::xla_gpu_use_cudnn_batchnorm() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_use_cudnn_batchnorm) + return xla_gpu_use_cudnn_batchnorm_; +} +inline void DebugOptions::set_xla_gpu_use_cudnn_batchnorm(bool value) { + + xla_gpu_use_cudnn_batchnorm_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_use_cudnn_batchnorm) +} + +// string xla_dump_unoptimized_hlo_proto_to = 95; +inline void DebugOptions::clear_xla_dump_unoptimized_hlo_proto_to() { + xla_dump_unoptimized_hlo_proto_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_dump_unoptimized_hlo_proto_to() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) + return xla_dump_unoptimized_hlo_proto_to_.GetNoArena(); +} +inline void DebugOptions::set_xla_dump_unoptimized_hlo_proto_to(const ::std::string& value) { + + xla_dump_unoptimized_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_dump_unoptimized_hlo_proto_to(::std::string&& value) { + + xla_dump_unoptimized_hlo_proto_to_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) +} +#endif +inline void DebugOptions::set_xla_dump_unoptimized_hlo_proto_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_dump_unoptimized_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) +} +inline void DebugOptions::set_xla_dump_unoptimized_hlo_proto_to(const char* value, size_t size) { + + xla_dump_unoptimized_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) +} +inline ::std::string* DebugOptions::mutable_xla_dump_unoptimized_hlo_proto_to() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) + return xla_dump_unoptimized_hlo_proto_to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_dump_unoptimized_hlo_proto_to() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) + + return xla_dump_unoptimized_hlo_proto_to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_dump_unoptimized_hlo_proto_to(::std::string* xla_dump_unoptimized_hlo_proto_to) { + if (xla_dump_unoptimized_hlo_proto_to != NULL) { + + } else { + + } + xla_dump_unoptimized_hlo_proto_to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_dump_unoptimized_hlo_proto_to); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to) +} + +// string xla_dump_per_pass_hlo_proto_to = 96; +inline void DebugOptions::clear_xla_dump_per_pass_hlo_proto_to() { + xla_dump_per_pass_hlo_proto_to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebugOptions::xla_dump_per_pass_hlo_proto_to() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) + return xla_dump_per_pass_hlo_proto_to_.GetNoArena(); +} +inline void DebugOptions::set_xla_dump_per_pass_hlo_proto_to(const ::std::string& value) { + + xla_dump_per_pass_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) +} +#if LANG_CXX11 +inline void DebugOptions::set_xla_dump_per_pass_hlo_proto_to(::std::string&& value) { + + xla_dump_per_pass_hlo_proto_to_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) +} +#endif +inline void DebugOptions::set_xla_dump_per_pass_hlo_proto_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + xla_dump_per_pass_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) +} +inline void DebugOptions::set_xla_dump_per_pass_hlo_proto_to(const char* value, size_t size) { + + xla_dump_per_pass_hlo_proto_to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) +} +inline ::std::string* DebugOptions::mutable_xla_dump_per_pass_hlo_proto_to() { + + // @@protoc_insertion_point(field_mutable:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) + return xla_dump_per_pass_hlo_proto_to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebugOptions::release_xla_dump_per_pass_hlo_proto_to() { + // @@protoc_insertion_point(field_release:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) + + return xla_dump_per_pass_hlo_proto_to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebugOptions::set_allocated_xla_dump_per_pass_hlo_proto_to(::std::string* xla_dump_per_pass_hlo_proto_to) { + if (xla_dump_per_pass_hlo_proto_to != NULL) { + + } else { + + } + xla_dump_per_pass_hlo_proto_to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), xla_dump_per_pass_hlo_proto_to); + // @@protoc_insertion_point(field_set_allocated:xla.DebugOptions.xla_dump_per_pass_hlo_proto_to) +} + +// bool xla_cpu_use_mkl_dnn = 97; +inline void DebugOptions::clear_xla_cpu_use_mkl_dnn() { + xla_cpu_use_mkl_dnn_ = false; +} +inline bool DebugOptions::xla_cpu_use_mkl_dnn() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_cpu_use_mkl_dnn) + return xla_cpu_use_mkl_dnn_; +} +inline void DebugOptions::set_xla_cpu_use_mkl_dnn(bool value) { + + xla_cpu_use_mkl_dnn_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_cpu_use_mkl_dnn) +} + +// int32 xla_gpu_max_kernel_unroll_factor = 98; +inline void DebugOptions::clear_xla_gpu_max_kernel_unroll_factor() { + xla_gpu_max_kernel_unroll_factor_ = 0; +} +inline ::google::protobuf::int32 DebugOptions::xla_gpu_max_kernel_unroll_factor() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_max_kernel_unroll_factor) + return xla_gpu_max_kernel_unroll_factor_; +} +inline void DebugOptions::set_xla_gpu_max_kernel_unroll_factor(::google::protobuf::int32 value) { + + xla_gpu_max_kernel_unroll_factor_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_max_kernel_unroll_factor) +} + +// bool xla_cpu_enable_fast_math = 99; +inline void DebugOptions::clear_xla_cpu_enable_fast_math() { + xla_cpu_enable_fast_math_ = false; +} +inline bool DebugOptions::xla_cpu_enable_fast_math() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_cpu_enable_fast_math) + return xla_cpu_enable_fast_math_; +} +inline void DebugOptions::set_xla_cpu_enable_fast_math(bool value) { + + xla_cpu_enable_fast_math_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_cpu_enable_fast_math) +} + +// bool xla_gpu_enable_fast_min_max = 100; +inline void DebugOptions::clear_xla_gpu_enable_fast_min_max() { + xla_gpu_enable_fast_min_max_ = false; +} +inline bool DebugOptions::xla_gpu_enable_fast_min_max() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_enable_fast_min_max) + return xla_gpu_enable_fast_min_max_; +} +inline void DebugOptions::set_xla_gpu_enable_fast_min_max(bool value) { + + xla_gpu_enable_fast_min_max_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_enable_fast_min_max) +} + +// bool xla_gpu_crash_on_verification_failures = 101; +inline void DebugOptions::clear_xla_gpu_crash_on_verification_failures() { + xla_gpu_crash_on_verification_failures_ = false; +} +inline bool DebugOptions::xla_gpu_crash_on_verification_failures() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_crash_on_verification_failures) + return xla_gpu_crash_on_verification_failures_; +} +inline void DebugOptions::set_xla_gpu_crash_on_verification_failures(bool value) { + + xla_gpu_crash_on_verification_failures_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_crash_on_verification_failures) +} + +// int32 xla_force_host_platform_device_count = 102; +inline void DebugOptions::clear_xla_force_host_platform_device_count() { + xla_force_host_platform_device_count_ = 0; +} +inline ::google::protobuf::int32 DebugOptions::xla_force_host_platform_device_count() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_force_host_platform_device_count) + return xla_force_host_platform_device_count_; +} +inline void DebugOptions::set_xla_force_host_platform_device_count(::google::protobuf::int32 value) { + + xla_force_host_platform_device_count_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_force_host_platform_device_count) +} + +// bool xla_gpu_disable_ptxas_optimizations = 103; +inline void DebugOptions::clear_xla_gpu_disable_ptxas_optimizations() { + xla_gpu_disable_ptxas_optimizations_ = false; +} +inline bool DebugOptions::xla_gpu_disable_ptxas_optimizations() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_gpu_disable_ptxas_optimizations) + return xla_gpu_disable_ptxas_optimizations_; +} +inline void DebugOptions::set_xla_gpu_disable_ptxas_optimizations(bool value) { + + xla_gpu_disable_ptxas_optimizations_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_gpu_disable_ptxas_optimizations) +} + +// bool xla_hlo_dump_as_html = 105; +inline void DebugOptions::clear_xla_hlo_dump_as_html() { + xla_hlo_dump_as_html_ = false; +} +inline bool DebugOptions::xla_hlo_dump_as_html() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_dump_as_html) + return xla_hlo_dump_as_html_; +} +inline void DebugOptions::set_xla_hlo_dump_as_html(bool value) { + + xla_hlo_dump_as_html_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_dump_as_html) +} + +// bool xla_hlo_evaluator_use_fast_path = 106; +inline void DebugOptions::clear_xla_hlo_evaluator_use_fast_path() { + xla_hlo_evaluator_use_fast_path_ = false; +} +inline bool DebugOptions::xla_hlo_evaluator_use_fast_path() const { + // @@protoc_insertion_point(field_get:xla.DebugOptions.xla_hlo_evaluator_use_fast_path) + return xla_hlo_evaluator_use_fast_path_; +} +inline void DebugOptions::set_xla_hlo_evaluator_use_fast_path(bool value) { + + xla_hlo_evaluator_use_fast_path_ = value; + // @@protoc_insertion_point(field_set:xla.DebugOptions.xla_hlo_evaluator_use_fast_path) +} + +// map xla_backend_extra_options = 500; +inline int DebugOptions::xla_backend_extra_options_size() const { + return xla_backend_extra_options_.size(); +} +inline void DebugOptions::clear_xla_backend_extra_options() { + xla_backend_extra_options_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::std::string >& +DebugOptions::xla_backend_extra_options() const { + // @@protoc_insertion_point(field_map:xla.DebugOptions.xla_backend_extra_options) + return xla_backend_extra_options_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::std::string >* +DebugOptions::mutable_xla_backend_extra_options() { + // @@protoc_insertion_point(field_mutable_map:xla.DebugOptions.xla_backend_extra_options) + return xla_backend_extra_options_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// ExecutionOptions + +// .xla.ShapeProto shape_with_output_layout = 2; +inline bool ExecutionOptions::has_shape_with_output_layout() const { + return this != internal_default_instance() && shape_with_output_layout_ != NULL; +} +inline const ::xla::ShapeProto& ExecutionOptions::_internal_shape_with_output_layout() const { + return *shape_with_output_layout_; +} +inline const ::xla::ShapeProto& ExecutionOptions::shape_with_output_layout() const { + const ::xla::ShapeProto* p = shape_with_output_layout_; + // @@protoc_insertion_point(field_get:xla.ExecutionOptions.shape_with_output_layout) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* ExecutionOptions::release_shape_with_output_layout() { + // @@protoc_insertion_point(field_release:xla.ExecutionOptions.shape_with_output_layout) + + ::xla::ShapeProto* temp = shape_with_output_layout_; + shape_with_output_layout_ = NULL; + return temp; +} +inline ::xla::ShapeProto* ExecutionOptions::mutable_shape_with_output_layout() { + + if (shape_with_output_layout_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + shape_with_output_layout_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ExecutionOptions.shape_with_output_layout) + return shape_with_output_layout_; +} +inline void ExecutionOptions::set_allocated_shape_with_output_layout(::xla::ShapeProto* shape_with_output_layout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_with_output_layout_); + } + if (shape_with_output_layout) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape_with_output_layout)->GetArena(); + if (message_arena != submessage_arena) { + shape_with_output_layout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape_with_output_layout, submessage_arena); + } + + } else { + + } + shape_with_output_layout_ = shape_with_output_layout; + // @@protoc_insertion_point(field_set_allocated:xla.ExecutionOptions.shape_with_output_layout) +} + +// uint64 seed = 3; +inline void ExecutionOptions::clear_seed() { + seed_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 ExecutionOptions::seed() const { + // @@protoc_insertion_point(field_get:xla.ExecutionOptions.seed) + return seed_; +} +inline void ExecutionOptions::set_seed(::google::protobuf::uint64 value) { + + seed_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionOptions.seed) +} + +// .xla.DebugOptions debug_options = 4; +inline bool ExecutionOptions::has_debug_options() const { + return this != internal_default_instance() && debug_options_ != NULL; +} +inline void ExecutionOptions::clear_debug_options() { + if (GetArenaNoVirtual() == NULL && debug_options_ != NULL) { + delete debug_options_; + } + debug_options_ = NULL; +} +inline const ::xla::DebugOptions& ExecutionOptions::_internal_debug_options() const { + return *debug_options_; +} +inline const ::xla::DebugOptions& ExecutionOptions::debug_options() const { + const ::xla::DebugOptions* p = debug_options_; + // @@protoc_insertion_point(field_get:xla.ExecutionOptions.debug_options) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DebugOptions_default_instance_); +} +inline ::xla::DebugOptions* ExecutionOptions::release_debug_options() { + // @@protoc_insertion_point(field_release:xla.ExecutionOptions.debug_options) + + ::xla::DebugOptions* temp = debug_options_; + debug_options_ = NULL; + return temp; +} +inline ::xla::DebugOptions* ExecutionOptions::mutable_debug_options() { + + if (debug_options_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DebugOptions>(GetArenaNoVirtual()); + debug_options_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ExecutionOptions.debug_options) + return debug_options_; +} +inline void ExecutionOptions::set_allocated_debug_options(::xla::DebugOptions* debug_options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete debug_options_; + } + if (debug_options) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + debug_options = ::google::protobuf::internal::GetOwnedMessage( + message_arena, debug_options, submessage_arena); + } + + } else { + + } + debug_options_ = debug_options; + // @@protoc_insertion_point(field_set_allocated:xla.ExecutionOptions.debug_options) +} + +// repeated .xla.DeviceHandle device_handles = 5; +inline int ExecutionOptions::device_handles_size() const { + return device_handles_.size(); +} +inline ::xla::DeviceHandle* ExecutionOptions::mutable_device_handles(int index) { + // @@protoc_insertion_point(field_mutable:xla.ExecutionOptions.device_handles) + return device_handles_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >* +ExecutionOptions::mutable_device_handles() { + // @@protoc_insertion_point(field_mutable_list:xla.ExecutionOptions.device_handles) + return &device_handles_; +} +inline const ::xla::DeviceHandle& ExecutionOptions::device_handles(int index) const { + // @@protoc_insertion_point(field_get:xla.ExecutionOptions.device_handles) + return device_handles_.Get(index); +} +inline ::xla::DeviceHandle* ExecutionOptions::add_device_handles() { + // @@protoc_insertion_point(field_add:xla.ExecutionOptions.device_handles) + return device_handles_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >& +ExecutionOptions::device_handles() const { + // @@protoc_insertion_point(field_list:xla.ExecutionOptions.device_handles) + return device_handles_; +} + +// ------------------------------------------------------------------- + +// GetDeviceHandlesRequest + +// int64 device_count = 1; +inline void GetDeviceHandlesRequest::clear_device_count() { + device_count_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 GetDeviceHandlesRequest::device_count() const { + // @@protoc_insertion_point(field_get:xla.GetDeviceHandlesRequest.device_count) + return device_count_; +} +inline void GetDeviceHandlesRequest::set_device_count(::google::protobuf::int64 value) { + + device_count_ = value; + // @@protoc_insertion_point(field_set:xla.GetDeviceHandlesRequest.device_count) +} + +// ------------------------------------------------------------------- + +// GetDeviceHandlesResponse + +// repeated .xla.DeviceHandle device_handles = 1; +inline int GetDeviceHandlesResponse::device_handles_size() const { + return device_handles_.size(); +} +inline ::xla::DeviceHandle* GetDeviceHandlesResponse::mutable_device_handles(int index) { + // @@protoc_insertion_point(field_mutable:xla.GetDeviceHandlesResponse.device_handles) + return device_handles_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >* +GetDeviceHandlesResponse::mutable_device_handles() { + // @@protoc_insertion_point(field_mutable_list:xla.GetDeviceHandlesResponse.device_handles) + return &device_handles_; +} +inline const ::xla::DeviceHandle& GetDeviceHandlesResponse::device_handles(int index) const { + // @@protoc_insertion_point(field_get:xla.GetDeviceHandlesResponse.device_handles) + return device_handles_.Get(index); +} +inline ::xla::DeviceHandle* GetDeviceHandlesResponse::add_device_handles() { + // @@protoc_insertion_point(field_add:xla.GetDeviceHandlesResponse.device_handles) + return device_handles_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::DeviceHandle >& +GetDeviceHandlesResponse::device_handles() const { + // @@protoc_insertion_point(field_list:xla.GetDeviceHandlesResponse.device_handles) + return device_handles_; +} + +// ------------------------------------------------------------------- + +// TransferToClientRequest + +// .xla.GlobalDataHandle data = 1; +inline bool TransferToClientRequest::has_data() const { + return this != internal_default_instance() && data_ != NULL; +} +inline const ::xla::GlobalDataHandle& TransferToClientRequest::_internal_data() const { + return *data_; +} +inline const ::xla::GlobalDataHandle& TransferToClientRequest::data() const { + const ::xla::GlobalDataHandle* p = data_; + // @@protoc_insertion_point(field_get:xla.TransferToClientRequest.data) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* TransferToClientRequest::release_data() { + // @@protoc_insertion_point(field_release:xla.TransferToClientRequest.data) + + ::xla::GlobalDataHandle* temp = data_; + data_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* TransferToClientRequest::mutable_data() { + + if (data_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + data_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToClientRequest.data) + return data_; +} +inline void TransferToClientRequest::set_allocated_data(::xla::GlobalDataHandle* data) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(data_); + } + if (data) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(data)->GetArena(); + if (message_arena != submessage_arena) { + data = ::google::protobuf::internal::GetOwnedMessage( + message_arena, data, submessage_arena); + } + + } else { + + } + data_ = data; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToClientRequest.data) +} + +// .xla.ShapeProto shape_with_layout = 2; +inline bool TransferToClientRequest::has_shape_with_layout() const { + return this != internal_default_instance() && shape_with_layout_ != NULL; +} +inline const ::xla::ShapeProto& TransferToClientRequest::_internal_shape_with_layout() const { + return *shape_with_layout_; +} +inline const ::xla::ShapeProto& TransferToClientRequest::shape_with_layout() const { + const ::xla::ShapeProto* p = shape_with_layout_; + // @@protoc_insertion_point(field_get:xla.TransferToClientRequest.shape_with_layout) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* TransferToClientRequest::release_shape_with_layout() { + // @@protoc_insertion_point(field_release:xla.TransferToClientRequest.shape_with_layout) + + ::xla::ShapeProto* temp = shape_with_layout_; + shape_with_layout_ = NULL; + return temp; +} +inline ::xla::ShapeProto* TransferToClientRequest::mutable_shape_with_layout() { + + if (shape_with_layout_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + shape_with_layout_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToClientRequest.shape_with_layout) + return shape_with_layout_; +} +inline void TransferToClientRequest::set_allocated_shape_with_layout(::xla::ShapeProto* shape_with_layout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_with_layout_); + } + if (shape_with_layout) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape_with_layout)->GetArena(); + if (message_arena != submessage_arena) { + shape_with_layout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape_with_layout, submessage_arena); + } + + } else { + + } + shape_with_layout_ = shape_with_layout; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToClientRequest.shape_with_layout) +} + +// ------------------------------------------------------------------- + +// TransferToClientResponse + +// .xla.LiteralProto literal = 1; +inline bool TransferToClientResponse::has_literal() const { + return this != internal_default_instance() && literal_ != NULL; +} +inline const ::xla::LiteralProto& TransferToClientResponse::_internal_literal() const { + return *literal_; +} +inline const ::xla::LiteralProto& TransferToClientResponse::literal() const { + const ::xla::LiteralProto* p = literal_; + // @@protoc_insertion_point(field_get:xla.TransferToClientResponse.literal) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* TransferToClientResponse::release_literal() { + // @@protoc_insertion_point(field_release:xla.TransferToClientResponse.literal) + + ::xla::LiteralProto* temp = literal_; + literal_ = NULL; + return temp; +} +inline ::xla::LiteralProto* TransferToClientResponse::mutable_literal() { + + if (literal_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + literal_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToClientResponse.literal) + return literal_; +} +inline void TransferToClientResponse::set_allocated_literal(::xla::LiteralProto* literal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(literal_); + } + if (literal) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(literal)->GetArena(); + if (message_arena != submessage_arena) { + literal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, literal, submessage_arena); + } + + } else { + + } + literal_ = literal; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToClientResponse.literal) +} + +// ------------------------------------------------------------------- + +// TransferToServerRequest + +// .xla.LiteralProto literal = 1; +inline bool TransferToServerRequest::has_literal() const { + return this != internal_default_instance() && literal_ != NULL; +} +inline const ::xla::LiteralProto& TransferToServerRequest::_internal_literal() const { + return *literal_; +} +inline const ::xla::LiteralProto& TransferToServerRequest::literal() const { + const ::xla::LiteralProto* p = literal_; + // @@protoc_insertion_point(field_get:xla.TransferToServerRequest.literal) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* TransferToServerRequest::release_literal() { + // @@protoc_insertion_point(field_release:xla.TransferToServerRequest.literal) + + ::xla::LiteralProto* temp = literal_; + literal_ = NULL; + return temp; +} +inline ::xla::LiteralProto* TransferToServerRequest::mutable_literal() { + + if (literal_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + literal_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToServerRequest.literal) + return literal_; +} +inline void TransferToServerRequest::set_allocated_literal(::xla::LiteralProto* literal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(literal_); + } + if (literal) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(literal)->GetArena(); + if (message_arena != submessage_arena) { + literal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, literal, submessage_arena); + } + + } else { + + } + literal_ = literal; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToServerRequest.literal) +} + +// .xla.DeviceHandle device_handle = 2; +inline bool TransferToServerRequest::has_device_handle() const { + return this != internal_default_instance() && device_handle_ != NULL; +} +inline const ::xla::DeviceHandle& TransferToServerRequest::_internal_device_handle() const { + return *device_handle_; +} +inline const ::xla::DeviceHandle& TransferToServerRequest::device_handle() const { + const ::xla::DeviceHandle* p = device_handle_; + // @@protoc_insertion_point(field_get:xla.TransferToServerRequest.device_handle) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DeviceHandle_default_instance_); +} +inline ::xla::DeviceHandle* TransferToServerRequest::release_device_handle() { + // @@protoc_insertion_point(field_release:xla.TransferToServerRequest.device_handle) + + ::xla::DeviceHandle* temp = device_handle_; + device_handle_ = NULL; + return temp; +} +inline ::xla::DeviceHandle* TransferToServerRequest::mutable_device_handle() { + + if (device_handle_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DeviceHandle>(GetArenaNoVirtual()); + device_handle_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToServerRequest.device_handle) + return device_handle_; +} +inline void TransferToServerRequest::set_allocated_device_handle(::xla::DeviceHandle* device_handle) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(device_handle_); + } + if (device_handle) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(device_handle)->GetArena(); + if (message_arena != submessage_arena) { + device_handle = ::google::protobuf::internal::GetOwnedMessage( + message_arena, device_handle, submessage_arena); + } + + } else { + + } + device_handle_ = device_handle; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToServerRequest.device_handle) +} + +// ------------------------------------------------------------------- + +// TransferToServerResponse + +// .xla.GlobalDataHandle data = 1; +inline bool TransferToServerResponse::has_data() const { + return this != internal_default_instance() && data_ != NULL; +} +inline const ::xla::GlobalDataHandle& TransferToServerResponse::_internal_data() const { + return *data_; +} +inline const ::xla::GlobalDataHandle& TransferToServerResponse::data() const { + const ::xla::GlobalDataHandle* p = data_; + // @@protoc_insertion_point(field_get:xla.TransferToServerResponse.data) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* TransferToServerResponse::release_data() { + // @@protoc_insertion_point(field_release:xla.TransferToServerResponse.data) + + ::xla::GlobalDataHandle* temp = data_; + data_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* TransferToServerResponse::mutable_data() { + + if (data_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + data_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToServerResponse.data) + return data_; +} +inline void TransferToServerResponse::set_allocated_data(::xla::GlobalDataHandle* data) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(data_); + } + if (data) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(data)->GetArena(); + if (message_arena != submessage_arena) { + data = ::google::protobuf::internal::GetOwnedMessage( + message_arena, data, submessage_arena); + } + + } else { + + } + data_ = data; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToServerResponse.data) +} + +// ------------------------------------------------------------------- + +// TransferToInfeedRequest + +// .xla.LiteralProto literal = 1; +inline bool TransferToInfeedRequest::has_literal() const { + return this != internal_default_instance() && literal_ != NULL; +} +inline const ::xla::LiteralProto& TransferToInfeedRequest::_internal_literal() const { + return *literal_; +} +inline const ::xla::LiteralProto& TransferToInfeedRequest::literal() const { + const ::xla::LiteralProto* p = literal_; + // @@protoc_insertion_point(field_get:xla.TransferToInfeedRequest.literal) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* TransferToInfeedRequest::release_literal() { + // @@protoc_insertion_point(field_release:xla.TransferToInfeedRequest.literal) + + ::xla::LiteralProto* temp = literal_; + literal_ = NULL; + return temp; +} +inline ::xla::LiteralProto* TransferToInfeedRequest::mutable_literal() { + + if (literal_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + literal_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToInfeedRequest.literal) + return literal_; +} +inline void TransferToInfeedRequest::set_allocated_literal(::xla::LiteralProto* literal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(literal_); + } + if (literal) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(literal)->GetArena(); + if (message_arena != submessage_arena) { + literal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, literal, submessage_arena); + } + + } else { + + } + literal_ = literal; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToInfeedRequest.literal) +} + +// int64 replica_id = 2; +inline void TransferToInfeedRequest::clear_replica_id() { + replica_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 TransferToInfeedRequest::replica_id() const { + // @@protoc_insertion_point(field_get:xla.TransferToInfeedRequest.replica_id) + return replica_id_; +} +inline void TransferToInfeedRequest::set_replica_id(::google::protobuf::int64 value) { + + replica_id_ = value; + // @@protoc_insertion_point(field_set:xla.TransferToInfeedRequest.replica_id) +} + +// .xla.DeviceHandle device_handle = 3; +inline bool TransferToInfeedRequest::has_device_handle() const { + return this != internal_default_instance() && device_handle_ != NULL; +} +inline const ::xla::DeviceHandle& TransferToInfeedRequest::_internal_device_handle() const { + return *device_handle_; +} +inline const ::xla::DeviceHandle& TransferToInfeedRequest::device_handle() const { + const ::xla::DeviceHandle* p = device_handle_; + // @@protoc_insertion_point(field_get:xla.TransferToInfeedRequest.device_handle) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DeviceHandle_default_instance_); +} +inline ::xla::DeviceHandle* TransferToInfeedRequest::release_device_handle() { + // @@protoc_insertion_point(field_release:xla.TransferToInfeedRequest.device_handle) + + ::xla::DeviceHandle* temp = device_handle_; + device_handle_ = NULL; + return temp; +} +inline ::xla::DeviceHandle* TransferToInfeedRequest::mutable_device_handle() { + + if (device_handle_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DeviceHandle>(GetArenaNoVirtual()); + device_handle_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferToInfeedRequest.device_handle) + return device_handle_; +} +inline void TransferToInfeedRequest::set_allocated_device_handle(::xla::DeviceHandle* device_handle) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(device_handle_); + } + if (device_handle) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(device_handle)->GetArena(); + if (message_arena != submessage_arena) { + device_handle = ::google::protobuf::internal::GetOwnedMessage( + message_arena, device_handle, submessage_arena); + } + + } else { + + } + device_handle_ = device_handle; + // @@protoc_insertion_point(field_set_allocated:xla.TransferToInfeedRequest.device_handle) +} + +// ------------------------------------------------------------------- + +// TransferToInfeedResponse + +// ------------------------------------------------------------------- + +// TransferFromOutfeedRequest + +// .xla.ShapeProto shape_with_layout = 1; +inline bool TransferFromOutfeedRequest::has_shape_with_layout() const { + return this != internal_default_instance() && shape_with_layout_ != NULL; +} +inline const ::xla::ShapeProto& TransferFromOutfeedRequest::_internal_shape_with_layout() const { + return *shape_with_layout_; +} +inline const ::xla::ShapeProto& TransferFromOutfeedRequest::shape_with_layout() const { + const ::xla::ShapeProto* p = shape_with_layout_; + // @@protoc_insertion_point(field_get:xla.TransferFromOutfeedRequest.shape_with_layout) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* TransferFromOutfeedRequest::release_shape_with_layout() { + // @@protoc_insertion_point(field_release:xla.TransferFromOutfeedRequest.shape_with_layout) + + ::xla::ShapeProto* temp = shape_with_layout_; + shape_with_layout_ = NULL; + return temp; +} +inline ::xla::ShapeProto* TransferFromOutfeedRequest::mutable_shape_with_layout() { + + if (shape_with_layout_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + shape_with_layout_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferFromOutfeedRequest.shape_with_layout) + return shape_with_layout_; +} +inline void TransferFromOutfeedRequest::set_allocated_shape_with_layout(::xla::ShapeProto* shape_with_layout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_with_layout_); + } + if (shape_with_layout) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape_with_layout)->GetArena(); + if (message_arena != submessage_arena) { + shape_with_layout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape_with_layout, submessage_arena); + } + + } else { + + } + shape_with_layout_ = shape_with_layout; + // @@protoc_insertion_point(field_set_allocated:xla.TransferFromOutfeedRequest.shape_with_layout) +} + +// int64 replica_id = 2; +inline void TransferFromOutfeedRequest::clear_replica_id() { + replica_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 TransferFromOutfeedRequest::replica_id() const { + // @@protoc_insertion_point(field_get:xla.TransferFromOutfeedRequest.replica_id) + return replica_id_; +} +inline void TransferFromOutfeedRequest::set_replica_id(::google::protobuf::int64 value) { + + replica_id_ = value; + // @@protoc_insertion_point(field_set:xla.TransferFromOutfeedRequest.replica_id) +} + +// .xla.DeviceHandle device_handle = 3; +inline bool TransferFromOutfeedRequest::has_device_handle() const { + return this != internal_default_instance() && device_handle_ != NULL; +} +inline const ::xla::DeviceHandle& TransferFromOutfeedRequest::_internal_device_handle() const { + return *device_handle_; +} +inline const ::xla::DeviceHandle& TransferFromOutfeedRequest::device_handle() const { + const ::xla::DeviceHandle* p = device_handle_; + // @@protoc_insertion_point(field_get:xla.TransferFromOutfeedRequest.device_handle) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DeviceHandle_default_instance_); +} +inline ::xla::DeviceHandle* TransferFromOutfeedRequest::release_device_handle() { + // @@protoc_insertion_point(field_release:xla.TransferFromOutfeedRequest.device_handle) + + ::xla::DeviceHandle* temp = device_handle_; + device_handle_ = NULL; + return temp; +} +inline ::xla::DeviceHandle* TransferFromOutfeedRequest::mutable_device_handle() { + + if (device_handle_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DeviceHandle>(GetArenaNoVirtual()); + device_handle_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferFromOutfeedRequest.device_handle) + return device_handle_; +} +inline void TransferFromOutfeedRequest::set_allocated_device_handle(::xla::DeviceHandle* device_handle) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(device_handle_); + } + if (device_handle) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(device_handle)->GetArena(); + if (message_arena != submessage_arena) { + device_handle = ::google::protobuf::internal::GetOwnedMessage( + message_arena, device_handle, submessage_arena); + } + + } else { + + } + device_handle_ = device_handle; + // @@protoc_insertion_point(field_set_allocated:xla.TransferFromOutfeedRequest.device_handle) +} + +// ------------------------------------------------------------------- + +// TransferFromOutfeedResponse + +// .xla.LiteralProto literal = 1; +inline bool TransferFromOutfeedResponse::has_literal() const { + return this != internal_default_instance() && literal_ != NULL; +} +inline const ::xla::LiteralProto& TransferFromOutfeedResponse::_internal_literal() const { + return *literal_; +} +inline const ::xla::LiteralProto& TransferFromOutfeedResponse::literal() const { + const ::xla::LiteralProto* p = literal_; + // @@protoc_insertion_point(field_get:xla.TransferFromOutfeedResponse.literal) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* TransferFromOutfeedResponse::release_literal() { + // @@protoc_insertion_point(field_release:xla.TransferFromOutfeedResponse.literal) + + ::xla::LiteralProto* temp = literal_; + literal_ = NULL; + return temp; +} +inline ::xla::LiteralProto* TransferFromOutfeedResponse::mutable_literal() { + + if (literal_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + literal_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.TransferFromOutfeedResponse.literal) + return literal_; +} +inline void TransferFromOutfeedResponse::set_allocated_literal(::xla::LiteralProto* literal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(literal_); + } + if (literal) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(literal)->GetArena(); + if (message_arena != submessage_arena) { + literal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, literal, submessage_arena); + } + + } else { + + } + literal_ = literal; + // @@protoc_insertion_point(field_set_allocated:xla.TransferFromOutfeedResponse.literal) +} + +// ------------------------------------------------------------------- + +// ResetDeviceRequest + +// .xla.DeviceHandle device_handle = 1; +inline bool ResetDeviceRequest::has_device_handle() const { + return this != internal_default_instance() && device_handle_ != NULL; +} +inline const ::xla::DeviceHandle& ResetDeviceRequest::_internal_device_handle() const { + return *device_handle_; +} +inline const ::xla::DeviceHandle& ResetDeviceRequest::device_handle() const { + const ::xla::DeviceHandle* p = device_handle_; + // @@protoc_insertion_point(field_get:xla.ResetDeviceRequest.device_handle) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DeviceHandle_default_instance_); +} +inline ::xla::DeviceHandle* ResetDeviceRequest::release_device_handle() { + // @@protoc_insertion_point(field_release:xla.ResetDeviceRequest.device_handle) + + ::xla::DeviceHandle* temp = device_handle_; + device_handle_ = NULL; + return temp; +} +inline ::xla::DeviceHandle* ResetDeviceRequest::mutable_device_handle() { + + if (device_handle_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DeviceHandle>(GetArenaNoVirtual()); + device_handle_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ResetDeviceRequest.device_handle) + return device_handle_; +} +inline void ResetDeviceRequest::set_allocated_device_handle(::xla::DeviceHandle* device_handle) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(device_handle_); + } + if (device_handle) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(device_handle)->GetArena(); + if (message_arena != submessage_arena) { + device_handle = ::google::protobuf::internal::GetOwnedMessage( + message_arena, device_handle, submessage_arena); + } + + } else { + + } + device_handle_ = device_handle; + // @@protoc_insertion_point(field_set_allocated:xla.ResetDeviceRequest.device_handle) +} + +// ------------------------------------------------------------------- + +// ResetDeviceResponse + +// ------------------------------------------------------------------- + +// ComputationGraphStatsRequest + +// .xla.HloModuleProto computation = 1; +inline bool ComputationGraphStatsRequest::has_computation() const { + return this != internal_default_instance() && computation_ != NULL; +} +inline const ::xla::HloModuleProto& ComputationGraphStatsRequest::_internal_computation() const { + return *computation_; +} +inline const ::xla::HloModuleProto& ComputationGraphStatsRequest::computation() const { + const ::xla::HloModuleProto* p = computation_; + // @@protoc_insertion_point(field_get:xla.ComputationGraphStatsRequest.computation) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloModuleProto_default_instance_); +} +inline ::xla::HloModuleProto* ComputationGraphStatsRequest::release_computation() { + // @@protoc_insertion_point(field_release:xla.ComputationGraphStatsRequest.computation) + + ::xla::HloModuleProto* temp = computation_; + computation_ = NULL; + return temp; +} +inline ::xla::HloModuleProto* ComputationGraphStatsRequest::mutable_computation() { + + if (computation_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloModuleProto>(GetArenaNoVirtual()); + computation_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ComputationGraphStatsRequest.computation) + return computation_; +} +inline void ComputationGraphStatsRequest::set_allocated_computation(::xla::HloModuleProto* computation) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(computation_); + } + if (computation) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(computation)->GetArena(); + if (message_arena != submessage_arena) { + computation = ::google::protobuf::internal::GetOwnedMessage( + message_arena, computation, submessage_arena); + } + + } else { + + } + computation_ = computation; + // @@protoc_insertion_point(field_set_allocated:xla.ComputationGraphStatsRequest.computation) +} + +// .xla.DebugOptions debug_options = 2; +inline bool ComputationGraphStatsRequest::has_debug_options() const { + return this != internal_default_instance() && debug_options_ != NULL; +} +inline void ComputationGraphStatsRequest::clear_debug_options() { + if (GetArenaNoVirtual() == NULL && debug_options_ != NULL) { + delete debug_options_; + } + debug_options_ = NULL; +} +inline const ::xla::DebugOptions& ComputationGraphStatsRequest::_internal_debug_options() const { + return *debug_options_; +} +inline const ::xla::DebugOptions& ComputationGraphStatsRequest::debug_options() const { + const ::xla::DebugOptions* p = debug_options_; + // @@protoc_insertion_point(field_get:xla.ComputationGraphStatsRequest.debug_options) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DebugOptions_default_instance_); +} +inline ::xla::DebugOptions* ComputationGraphStatsRequest::release_debug_options() { + // @@protoc_insertion_point(field_release:xla.ComputationGraphStatsRequest.debug_options) + + ::xla::DebugOptions* temp = debug_options_; + debug_options_ = NULL; + return temp; +} +inline ::xla::DebugOptions* ComputationGraphStatsRequest::mutable_debug_options() { + + if (debug_options_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DebugOptions>(GetArenaNoVirtual()); + debug_options_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ComputationGraphStatsRequest.debug_options) + return debug_options_; +} +inline void ComputationGraphStatsRequest::set_allocated_debug_options(::xla::DebugOptions* debug_options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete debug_options_; + } + if (debug_options) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + debug_options = ::google::protobuf::internal::GetOwnedMessage( + message_arena, debug_options, submessage_arena); + } + + } else { + + } + debug_options_ = debug_options; + // @@protoc_insertion_point(field_set_allocated:xla.ComputationGraphStatsRequest.debug_options) +} + +// ------------------------------------------------------------------- + +// ComputationStatsResponse + +// .xla.ComputationStats stats = 1; +inline bool ComputationStatsResponse::has_stats() const { + return this != internal_default_instance() && stats_ != NULL; +} +inline const ::xla::ComputationStats& ComputationStatsResponse::_internal_stats() const { + return *stats_; +} +inline const ::xla::ComputationStats& ComputationStatsResponse::stats() const { + const ::xla::ComputationStats* p = stats_; + // @@protoc_insertion_point(field_get:xla.ComputationStatsResponse.stats) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ComputationStats_default_instance_); +} +inline ::xla::ComputationStats* ComputationStatsResponse::release_stats() { + // @@protoc_insertion_point(field_release:xla.ComputationStatsResponse.stats) + + ::xla::ComputationStats* temp = stats_; + stats_ = NULL; + return temp; +} +inline ::xla::ComputationStats* ComputationStatsResponse::mutable_stats() { + + if (stats_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ComputationStats>(GetArenaNoVirtual()); + stats_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ComputationStatsResponse.stats) + return stats_; +} +inline void ComputationStatsResponse::set_allocated_stats(::xla::ComputationStats* stats) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(stats_); + } + if (stats) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(stats)->GetArena(); + if (message_arena != submessage_arena) { + stats = ::google::protobuf::internal::GetOwnedMessage( + message_arena, stats, submessage_arena); + } + + } else { + + } + stats_ = stats; + // @@protoc_insertion_point(field_set_allocated:xla.ComputationStatsResponse.stats) +} + +// ------------------------------------------------------------------- + +// CreateChannelHandleRequest + +// .xla.ChannelHandle.ChannelType channel_type = 1; +inline void CreateChannelHandleRequest::clear_channel_type() { + channel_type_ = 0; +} +inline ::xla::ChannelHandle_ChannelType CreateChannelHandleRequest::channel_type() const { + // @@protoc_insertion_point(field_get:xla.CreateChannelHandleRequest.channel_type) + return static_cast< ::xla::ChannelHandle_ChannelType >(channel_type_); +} +inline void CreateChannelHandleRequest::set_channel_type(::xla::ChannelHandle_ChannelType value) { + + channel_type_ = value; + // @@protoc_insertion_point(field_set:xla.CreateChannelHandleRequest.channel_type) +} + +// ------------------------------------------------------------------- + +// CreateChannelHandleResponse + +// .xla.ChannelHandle channel = 1; +inline bool CreateChannelHandleResponse::has_channel() const { + return this != internal_default_instance() && channel_ != NULL; +} +inline const ::xla::ChannelHandle& CreateChannelHandleResponse::_internal_channel() const { + return *channel_; +} +inline const ::xla::ChannelHandle& CreateChannelHandleResponse::channel() const { + const ::xla::ChannelHandle* p = channel_; + // @@protoc_insertion_point(field_get:xla.CreateChannelHandleResponse.channel) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ChannelHandle_default_instance_); +} +inline ::xla::ChannelHandle* CreateChannelHandleResponse::release_channel() { + // @@protoc_insertion_point(field_release:xla.CreateChannelHandleResponse.channel) + + ::xla::ChannelHandle* temp = channel_; + channel_ = NULL; + return temp; +} +inline ::xla::ChannelHandle* CreateChannelHandleResponse::mutable_channel() { + + if (channel_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ChannelHandle>(GetArenaNoVirtual()); + channel_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.CreateChannelHandleResponse.channel) + return channel_; +} +inline void CreateChannelHandleResponse::set_allocated_channel(::xla::ChannelHandle* channel) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(channel_); + } + if (channel) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(channel)->GetArena(); + if (message_arena != submessage_arena) { + channel = ::google::protobuf::internal::GetOwnedMessage( + message_arena, channel, submessage_arena); + } + + } else { + + } + channel_ = channel; + // @@protoc_insertion_point(field_set_allocated:xla.CreateChannelHandleResponse.channel) +} + +// ------------------------------------------------------------------- + +// UnregisterRequest + +// repeated .xla.GlobalDataHandle data = 1; +inline int UnregisterRequest::data_size() const { + return data_.size(); +} +inline ::xla::GlobalDataHandle* UnregisterRequest::mutable_data(int index) { + // @@protoc_insertion_point(field_mutable:xla.UnregisterRequest.data) + return data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* +UnregisterRequest::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:xla.UnregisterRequest.data) + return &data_; +} +inline const ::xla::GlobalDataHandle& UnregisterRequest::data(int index) const { + // @@protoc_insertion_point(field_get:xla.UnregisterRequest.data) + return data_.Get(index); +} +inline ::xla::GlobalDataHandle* UnregisterRequest::add_data() { + // @@protoc_insertion_point(field_add:xla.UnregisterRequest.data) + return data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& +UnregisterRequest::data() const { + // @@protoc_insertion_point(field_list:xla.UnregisterRequest.data) + return data_; +} + +// ------------------------------------------------------------------- + +// UnregisterResponse + +// ------------------------------------------------------------------- + +// CompileRequest + +// .xla.HloModuleProto computation = 1; +inline bool CompileRequest::has_computation() const { + return this != internal_default_instance() && computation_ != NULL; +} +inline const ::xla::HloModuleProto& CompileRequest::_internal_computation() const { + return *computation_; +} +inline const ::xla::HloModuleProto& CompileRequest::computation() const { + const ::xla::HloModuleProto* p = computation_; + // @@protoc_insertion_point(field_get:xla.CompileRequest.computation) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloModuleProto_default_instance_); +} +inline ::xla::HloModuleProto* CompileRequest::release_computation() { + // @@protoc_insertion_point(field_release:xla.CompileRequest.computation) + + ::xla::HloModuleProto* temp = computation_; + computation_ = NULL; + return temp; +} +inline ::xla::HloModuleProto* CompileRequest::mutable_computation() { + + if (computation_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloModuleProto>(GetArenaNoVirtual()); + computation_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.CompileRequest.computation) + return computation_; +} +inline void CompileRequest::set_allocated_computation(::xla::HloModuleProto* computation) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(computation_); + } + if (computation) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(computation)->GetArena(); + if (message_arena != submessage_arena) { + computation = ::google::protobuf::internal::GetOwnedMessage( + message_arena, computation, submessage_arena); + } + + } else { + + } + computation_ = computation; + // @@protoc_insertion_point(field_set_allocated:xla.CompileRequest.computation) +} + +// .xla.ExecutionOptions execution_options = 2; +inline bool CompileRequest::has_execution_options() const { + return this != internal_default_instance() && execution_options_ != NULL; +} +inline void CompileRequest::clear_execution_options() { + if (GetArenaNoVirtual() == NULL && execution_options_ != NULL) { + delete execution_options_; + } + execution_options_ = NULL; +} +inline const ::xla::ExecutionOptions& CompileRequest::_internal_execution_options() const { + return *execution_options_; +} +inline const ::xla::ExecutionOptions& CompileRequest::execution_options() const { + const ::xla::ExecutionOptions* p = execution_options_; + // @@protoc_insertion_point(field_get:xla.CompileRequest.execution_options) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ExecutionOptions_default_instance_); +} +inline ::xla::ExecutionOptions* CompileRequest::release_execution_options() { + // @@protoc_insertion_point(field_release:xla.CompileRequest.execution_options) + + ::xla::ExecutionOptions* temp = execution_options_; + execution_options_ = NULL; + return temp; +} +inline ::xla::ExecutionOptions* CompileRequest::mutable_execution_options() { + + if (execution_options_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ExecutionOptions>(GetArenaNoVirtual()); + execution_options_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.CompileRequest.execution_options) + return execution_options_; +} +inline void CompileRequest::set_allocated_execution_options(::xla::ExecutionOptions* execution_options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete execution_options_; + } + if (execution_options) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + execution_options = ::google::protobuf::internal::GetOwnedMessage( + message_arena, execution_options, submessage_arena); + } + + } else { + + } + execution_options_ = execution_options; + // @@protoc_insertion_point(field_set_allocated:xla.CompileRequest.execution_options) +} + +// repeated .xla.ShapeProto input_shape_with_layout = 3; +inline int CompileRequest::input_shape_with_layout_size() const { + return input_shape_with_layout_.size(); +} +inline ::xla::ShapeProto* CompileRequest::mutable_input_shape_with_layout(int index) { + // @@protoc_insertion_point(field_mutable:xla.CompileRequest.input_shape_with_layout) + return input_shape_with_layout_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* +CompileRequest::mutable_input_shape_with_layout() { + // @@protoc_insertion_point(field_mutable_list:xla.CompileRequest.input_shape_with_layout) + return &input_shape_with_layout_; +} +inline const ::xla::ShapeProto& CompileRequest::input_shape_with_layout(int index) const { + // @@protoc_insertion_point(field_get:xla.CompileRequest.input_shape_with_layout) + return input_shape_with_layout_.Get(index); +} +inline ::xla::ShapeProto* CompileRequest::add_input_shape_with_layout() { + // @@protoc_insertion_point(field_add:xla.CompileRequest.input_shape_with_layout) + return input_shape_with_layout_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& +CompileRequest::input_shape_with_layout() const { + // @@protoc_insertion_point(field_list:xla.CompileRequest.input_shape_with_layout) + return input_shape_with_layout_; +} + +// ------------------------------------------------------------------- + +// CompileResponse + +// .xla.ExecutionHandle handle = 1; +inline bool CompileResponse::has_handle() const { + return this != internal_default_instance() && handle_ != NULL; +} +inline const ::xla::ExecutionHandle& CompileResponse::_internal_handle() const { + return *handle_; +} +inline const ::xla::ExecutionHandle& CompileResponse::handle() const { + const ::xla::ExecutionHandle* p = handle_; + // @@protoc_insertion_point(field_get:xla.CompileResponse.handle) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ExecutionHandle_default_instance_); +} +inline ::xla::ExecutionHandle* CompileResponse::release_handle() { + // @@protoc_insertion_point(field_release:xla.CompileResponse.handle) + + ::xla::ExecutionHandle* temp = handle_; + handle_ = NULL; + return temp; +} +inline ::xla::ExecutionHandle* CompileResponse::mutable_handle() { + + if (handle_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ExecutionHandle>(GetArenaNoVirtual()); + handle_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.CompileResponse.handle) + return handle_; +} +inline void CompileResponse::set_allocated_handle(::xla::ExecutionHandle* handle) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(handle_); + } + if (handle) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(handle)->GetArena(); + if (message_arena != submessage_arena) { + handle = ::google::protobuf::internal::GetOwnedMessage( + message_arena, handle, submessage_arena); + } + + } else { + + } + handle_ = handle; + // @@protoc_insertion_point(field_set_allocated:xla.CompileResponse.handle) +} + +// ------------------------------------------------------------------- + +// ExecuteRequest + +// .xla.ExecutionHandle handle = 1; +inline bool ExecuteRequest::has_handle() const { + return this != internal_default_instance() && handle_ != NULL; +} +inline const ::xla::ExecutionHandle& ExecuteRequest::_internal_handle() const { + return *handle_; +} +inline const ::xla::ExecutionHandle& ExecuteRequest::handle() const { + const ::xla::ExecutionHandle* p = handle_; + // @@protoc_insertion_point(field_get:xla.ExecuteRequest.handle) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ExecutionHandle_default_instance_); +} +inline ::xla::ExecutionHandle* ExecuteRequest::release_handle() { + // @@protoc_insertion_point(field_release:xla.ExecuteRequest.handle) + + ::xla::ExecutionHandle* temp = handle_; + handle_ = NULL; + return temp; +} +inline ::xla::ExecutionHandle* ExecuteRequest::mutable_handle() { + + if (handle_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ExecutionHandle>(GetArenaNoVirtual()); + handle_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ExecuteRequest.handle) + return handle_; +} +inline void ExecuteRequest::set_allocated_handle(::xla::ExecutionHandle* handle) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(handle_); + } + if (handle) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(handle)->GetArena(); + if (message_arena != submessage_arena) { + handle = ::google::protobuf::internal::GetOwnedMessage( + message_arena, handle, submessage_arena); + } + + } else { + + } + handle_ = handle; + // @@protoc_insertion_point(field_set_allocated:xla.ExecuteRequest.handle) +} + +// repeated .xla.GlobalDataHandle arguments = 2; +inline int ExecuteRequest::arguments_size() const { + return arguments_.size(); +} +inline ::xla::GlobalDataHandle* ExecuteRequest::mutable_arguments(int index) { + // @@protoc_insertion_point(field_mutable:xla.ExecuteRequest.arguments) + return arguments_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* +ExecuteRequest::mutable_arguments() { + // @@protoc_insertion_point(field_mutable_list:xla.ExecuteRequest.arguments) + return &arguments_; +} +inline const ::xla::GlobalDataHandle& ExecuteRequest::arguments(int index) const { + // @@protoc_insertion_point(field_get:xla.ExecuteRequest.arguments) + return arguments_.Get(index); +} +inline ::xla::GlobalDataHandle* ExecuteRequest::add_arguments() { + // @@protoc_insertion_point(field_add:xla.ExecuteRequest.arguments) + return arguments_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& +ExecuteRequest::arguments() const { + // @@protoc_insertion_point(field_list:xla.ExecuteRequest.arguments) + return arguments_; +} + +// ------------------------------------------------------------------- + +// ExecuteGraphRequest + +// .xla.HloModuleProto computation = 1; +inline bool ExecuteGraphRequest::has_computation() const { + return this != internal_default_instance() && computation_ != NULL; +} +inline const ::xla::HloModuleProto& ExecuteGraphRequest::_internal_computation() const { + return *computation_; +} +inline const ::xla::HloModuleProto& ExecuteGraphRequest::computation() const { + const ::xla::HloModuleProto* p = computation_; + // @@protoc_insertion_point(field_get:xla.ExecuteGraphRequest.computation) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloModuleProto_default_instance_); +} +inline ::xla::HloModuleProto* ExecuteGraphRequest::release_computation() { + // @@protoc_insertion_point(field_release:xla.ExecuteGraphRequest.computation) + + ::xla::HloModuleProto* temp = computation_; + computation_ = NULL; + return temp; +} +inline ::xla::HloModuleProto* ExecuteGraphRequest::mutable_computation() { + + if (computation_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloModuleProto>(GetArenaNoVirtual()); + computation_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ExecuteGraphRequest.computation) + return computation_; +} +inline void ExecuteGraphRequest::set_allocated_computation(::xla::HloModuleProto* computation) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(computation_); + } + if (computation) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(computation)->GetArena(); + if (message_arena != submessage_arena) { + computation = ::google::protobuf::internal::GetOwnedMessage( + message_arena, computation, submessage_arena); + } + + } else { + + } + computation_ = computation; + // @@protoc_insertion_point(field_set_allocated:xla.ExecuteGraphRequest.computation) +} + +// repeated .xla.GlobalDataHandle arguments = 2; +inline int ExecuteGraphRequest::arguments_size() const { + return arguments_.size(); +} +inline ::xla::GlobalDataHandle* ExecuteGraphRequest::mutable_arguments(int index) { + // @@protoc_insertion_point(field_mutable:xla.ExecuteGraphRequest.arguments) + return arguments_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* +ExecuteGraphRequest::mutable_arguments() { + // @@protoc_insertion_point(field_mutable_list:xla.ExecuteGraphRequest.arguments) + return &arguments_; +} +inline const ::xla::GlobalDataHandle& ExecuteGraphRequest::arguments(int index) const { + // @@protoc_insertion_point(field_get:xla.ExecuteGraphRequest.arguments) + return arguments_.Get(index); +} +inline ::xla::GlobalDataHandle* ExecuteGraphRequest::add_arguments() { + // @@protoc_insertion_point(field_add:xla.ExecuteGraphRequest.arguments) + return arguments_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& +ExecuteGraphRequest::arguments() const { + // @@protoc_insertion_point(field_list:xla.ExecuteGraphRequest.arguments) + return arguments_; +} + +// .xla.ExecutionOptions execution_options = 3; +inline bool ExecuteGraphRequest::has_execution_options() const { + return this != internal_default_instance() && execution_options_ != NULL; +} +inline void ExecuteGraphRequest::clear_execution_options() { + if (GetArenaNoVirtual() == NULL && execution_options_ != NULL) { + delete execution_options_; + } + execution_options_ = NULL; +} +inline const ::xla::ExecutionOptions& ExecuteGraphRequest::_internal_execution_options() const { + return *execution_options_; +} +inline const ::xla::ExecutionOptions& ExecuteGraphRequest::execution_options() const { + const ::xla::ExecutionOptions* p = execution_options_; + // @@protoc_insertion_point(field_get:xla.ExecuteGraphRequest.execution_options) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ExecutionOptions_default_instance_); +} +inline ::xla::ExecutionOptions* ExecuteGraphRequest::release_execution_options() { + // @@protoc_insertion_point(field_release:xla.ExecuteGraphRequest.execution_options) + + ::xla::ExecutionOptions* temp = execution_options_; + execution_options_ = NULL; + return temp; +} +inline ::xla::ExecutionOptions* ExecuteGraphRequest::mutable_execution_options() { + + if (execution_options_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ExecutionOptions>(GetArenaNoVirtual()); + execution_options_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ExecuteGraphRequest.execution_options) + return execution_options_; +} +inline void ExecuteGraphRequest::set_allocated_execution_options(::xla::ExecutionOptions* execution_options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete execution_options_; + } + if (execution_options) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + execution_options = ::google::protobuf::internal::GetOwnedMessage( + message_arena, execution_options, submessage_arena); + } + + } else { + + } + execution_options_ = execution_options; + // @@protoc_insertion_point(field_set_allocated:xla.ExecuteGraphRequest.execution_options) +} + +// ------------------------------------------------------------------- + +// ExecuteGraphParallelRequest + +// repeated .xla.ExecuteGraphRequest requests = 1; +inline int ExecuteGraphParallelRequest::requests_size() const { + return requests_.size(); +} +inline void ExecuteGraphParallelRequest::clear_requests() { + requests_.Clear(); +} +inline ::xla::ExecuteGraphRequest* ExecuteGraphParallelRequest::mutable_requests(int index) { + // @@protoc_insertion_point(field_mutable:xla.ExecuteGraphParallelRequest.requests) + return requests_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ExecuteGraphRequest >* +ExecuteGraphParallelRequest::mutable_requests() { + // @@protoc_insertion_point(field_mutable_list:xla.ExecuteGraphParallelRequest.requests) + return &requests_; +} +inline const ::xla::ExecuteGraphRequest& ExecuteGraphParallelRequest::requests(int index) const { + // @@protoc_insertion_point(field_get:xla.ExecuteGraphParallelRequest.requests) + return requests_.Get(index); +} +inline ::xla::ExecuteGraphRequest* ExecuteGraphParallelRequest::add_requests() { + // @@protoc_insertion_point(field_add:xla.ExecuteGraphParallelRequest.requests) + return requests_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ExecuteGraphRequest >& +ExecuteGraphParallelRequest::requests() const { + // @@protoc_insertion_point(field_list:xla.ExecuteGraphParallelRequest.requests) + return requests_; +} + +// ------------------------------------------------------------------- + +// ExecuteResponse + +// .xla.GlobalDataHandle output = 1; +inline bool ExecuteResponse::has_output() const { + return this != internal_default_instance() && output_ != NULL; +} +inline const ::xla::GlobalDataHandle& ExecuteResponse::_internal_output() const { + return *output_; +} +inline const ::xla::GlobalDataHandle& ExecuteResponse::output() const { + const ::xla::GlobalDataHandle* p = output_; + // @@protoc_insertion_point(field_get:xla.ExecuteResponse.output) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* ExecuteResponse::release_output() { + // @@protoc_insertion_point(field_release:xla.ExecuteResponse.output) + + ::xla::GlobalDataHandle* temp = output_; + output_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* ExecuteResponse::mutable_output() { + + if (output_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + output_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ExecuteResponse.output) + return output_; +} +inline void ExecuteResponse::set_allocated_output(::xla::GlobalDataHandle* output) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(output_); + } + if (output) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(output)->GetArena(); + if (message_arena != submessage_arena) { + output = ::google::protobuf::internal::GetOwnedMessage( + message_arena, output, submessage_arena); + } + + } else { + + } + output_ = output; + // @@protoc_insertion_point(field_set_allocated:xla.ExecuteResponse.output) +} + +// .xla.ExecutionProfile profile = 2; +inline bool ExecuteResponse::has_profile() const { + return this != internal_default_instance() && profile_ != NULL; +} +inline const ::xla::ExecutionProfile& ExecuteResponse::_internal_profile() const { + return *profile_; +} +inline const ::xla::ExecutionProfile& ExecuteResponse::profile() const { + const ::xla::ExecutionProfile* p = profile_; + // @@protoc_insertion_point(field_get:xla.ExecuteResponse.profile) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ExecutionProfile_default_instance_); +} +inline ::xla::ExecutionProfile* ExecuteResponse::release_profile() { + // @@protoc_insertion_point(field_release:xla.ExecuteResponse.profile) + + ::xla::ExecutionProfile* temp = profile_; + profile_ = NULL; + return temp; +} +inline ::xla::ExecutionProfile* ExecuteResponse::mutable_profile() { + + if (profile_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ExecutionProfile>(GetArenaNoVirtual()); + profile_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ExecuteResponse.profile) + return profile_; +} +inline void ExecuteResponse::set_allocated_profile(::xla::ExecutionProfile* profile) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(profile_); + } + if (profile) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(profile)->GetArena(); + if (message_arena != submessage_arena) { + profile = ::google::protobuf::internal::GetOwnedMessage( + message_arena, profile, submessage_arena); + } + + } else { + + } + profile_ = profile; + // @@protoc_insertion_point(field_set_allocated:xla.ExecuteResponse.profile) +} + +// ------------------------------------------------------------------- + +// ExecuteParallelResponse + +// repeated .xla.ExecuteResponse responses = 1; +inline int ExecuteParallelResponse::responses_size() const { + return responses_.size(); +} +inline void ExecuteParallelResponse::clear_responses() { + responses_.Clear(); +} +inline ::xla::ExecuteResponse* ExecuteParallelResponse::mutable_responses(int index) { + // @@protoc_insertion_point(field_mutable:xla.ExecuteParallelResponse.responses) + return responses_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ExecuteResponse >* +ExecuteParallelResponse::mutable_responses() { + // @@protoc_insertion_point(field_mutable_list:xla.ExecuteParallelResponse.responses) + return &responses_; +} +inline const ::xla::ExecuteResponse& ExecuteParallelResponse::responses(int index) const { + // @@protoc_insertion_point(field_get:xla.ExecuteParallelResponse.responses) + return responses_.Get(index); +} +inline ::xla::ExecuteResponse* ExecuteParallelResponse::add_responses() { + // @@protoc_insertion_point(field_add:xla.ExecuteParallelResponse.responses) + return responses_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ExecuteResponse >& +ExecuteParallelResponse::responses() const { + // @@protoc_insertion_point(field_list:xla.ExecuteParallelResponse.responses) + return responses_; +} + +// ------------------------------------------------------------------- + +// WaitForExecutionRequest + +// .xla.ExecutionHandle execution = 1; +inline bool WaitForExecutionRequest::has_execution() const { + return this != internal_default_instance() && execution_ != NULL; +} +inline const ::xla::ExecutionHandle& WaitForExecutionRequest::_internal_execution() const { + return *execution_; +} +inline const ::xla::ExecutionHandle& WaitForExecutionRequest::execution() const { + const ::xla::ExecutionHandle* p = execution_; + // @@protoc_insertion_point(field_get:xla.WaitForExecutionRequest.execution) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ExecutionHandle_default_instance_); +} +inline ::xla::ExecutionHandle* WaitForExecutionRequest::release_execution() { + // @@protoc_insertion_point(field_release:xla.WaitForExecutionRequest.execution) + + ::xla::ExecutionHandle* temp = execution_; + execution_ = NULL; + return temp; +} +inline ::xla::ExecutionHandle* WaitForExecutionRequest::mutable_execution() { + + if (execution_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ExecutionHandle>(GetArenaNoVirtual()); + execution_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.WaitForExecutionRequest.execution) + return execution_; +} +inline void WaitForExecutionRequest::set_allocated_execution(::xla::ExecutionHandle* execution) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(execution_); + } + if (execution) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(execution)->GetArena(); + if (message_arena != submessage_arena) { + execution = ::google::protobuf::internal::GetOwnedMessage( + message_arena, execution, submessage_arena); + } + + } else { + + } + execution_ = execution; + // @@protoc_insertion_point(field_set_allocated:xla.WaitForExecutionRequest.execution) +} + +// ------------------------------------------------------------------- + +// WaitForExecutionResponse + +// .xla.GlobalDataHandle output = 1; +inline bool WaitForExecutionResponse::has_output() const { + return this != internal_default_instance() && output_ != NULL; +} +inline const ::xla::GlobalDataHandle& WaitForExecutionResponse::_internal_output() const { + return *output_; +} +inline const ::xla::GlobalDataHandle& WaitForExecutionResponse::output() const { + const ::xla::GlobalDataHandle* p = output_; + // @@protoc_insertion_point(field_get:xla.WaitForExecutionResponse.output) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* WaitForExecutionResponse::release_output() { + // @@protoc_insertion_point(field_release:xla.WaitForExecutionResponse.output) + + ::xla::GlobalDataHandle* temp = output_; + output_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* WaitForExecutionResponse::mutable_output() { + + if (output_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + output_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.WaitForExecutionResponse.output) + return output_; +} +inline void WaitForExecutionResponse::set_allocated_output(::xla::GlobalDataHandle* output) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(output_); + } + if (output) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(output)->GetArena(); + if (message_arena != submessage_arena) { + output = ::google::protobuf::internal::GetOwnedMessage( + message_arena, output, submessage_arena); + } + + } else { + + } + output_ = output; + // @@protoc_insertion_point(field_set_allocated:xla.WaitForExecutionResponse.output) +} + +// .xla.ExecutionProfile profile = 2; +inline bool WaitForExecutionResponse::has_profile() const { + return this != internal_default_instance() && profile_ != NULL; +} +inline const ::xla::ExecutionProfile& WaitForExecutionResponse::_internal_profile() const { + return *profile_; +} +inline const ::xla::ExecutionProfile& WaitForExecutionResponse::profile() const { + const ::xla::ExecutionProfile* p = profile_; + // @@protoc_insertion_point(field_get:xla.WaitForExecutionResponse.profile) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ExecutionProfile_default_instance_); +} +inline ::xla::ExecutionProfile* WaitForExecutionResponse::release_profile() { + // @@protoc_insertion_point(field_release:xla.WaitForExecutionResponse.profile) + + ::xla::ExecutionProfile* temp = profile_; + profile_ = NULL; + return temp; +} +inline ::xla::ExecutionProfile* WaitForExecutionResponse::mutable_profile() { + + if (profile_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ExecutionProfile>(GetArenaNoVirtual()); + profile_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.WaitForExecutionResponse.profile) + return profile_; +} +inline void WaitForExecutionResponse::set_allocated_profile(::xla::ExecutionProfile* profile) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(profile_); + } + if (profile) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(profile)->GetArena(); + if (message_arena != submessage_arena) { + profile = ::google::protobuf::internal::GetOwnedMessage( + message_arena, profile, submessage_arena); + } + + } else { + + } + profile_ = profile; + // @@protoc_insertion_point(field_set_allocated:xla.WaitForExecutionResponse.profile) +} + +// ------------------------------------------------------------------- + +// ComputeConstantGraphRequest + +// .xla.HloModuleProto computation = 1; +inline bool ComputeConstantGraphRequest::has_computation() const { + return this != internal_default_instance() && computation_ != NULL; +} +inline const ::xla::HloModuleProto& ComputeConstantGraphRequest::_internal_computation() const { + return *computation_; +} +inline const ::xla::HloModuleProto& ComputeConstantGraphRequest::computation() const { + const ::xla::HloModuleProto* p = computation_; + // @@protoc_insertion_point(field_get:xla.ComputeConstantGraphRequest.computation) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloModuleProto_default_instance_); +} +inline ::xla::HloModuleProto* ComputeConstantGraphRequest::release_computation() { + // @@protoc_insertion_point(field_release:xla.ComputeConstantGraphRequest.computation) + + ::xla::HloModuleProto* temp = computation_; + computation_ = NULL; + return temp; +} +inline ::xla::HloModuleProto* ComputeConstantGraphRequest::mutable_computation() { + + if (computation_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloModuleProto>(GetArenaNoVirtual()); + computation_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ComputeConstantGraphRequest.computation) + return computation_; +} +inline void ComputeConstantGraphRequest::set_allocated_computation(::xla::HloModuleProto* computation) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(computation_); + } + if (computation) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(computation)->GetArena(); + if (message_arena != submessage_arena) { + computation = ::google::protobuf::internal::GetOwnedMessage( + message_arena, computation, submessage_arena); + } + + } else { + + } + computation_ = computation; + // @@protoc_insertion_point(field_set_allocated:xla.ComputeConstantGraphRequest.computation) +} + +// .xla.LayoutProto output_layout = 2; +inline bool ComputeConstantGraphRequest::has_output_layout() const { + return this != internal_default_instance() && output_layout_ != NULL; +} +inline const ::xla::LayoutProto& ComputeConstantGraphRequest::_internal_output_layout() const { + return *output_layout_; +} +inline const ::xla::LayoutProto& ComputeConstantGraphRequest::output_layout() const { + const ::xla::LayoutProto* p = output_layout_; + // @@protoc_insertion_point(field_get:xla.ComputeConstantGraphRequest.output_layout) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LayoutProto_default_instance_); +} +inline ::xla::LayoutProto* ComputeConstantGraphRequest::release_output_layout() { + // @@protoc_insertion_point(field_release:xla.ComputeConstantGraphRequest.output_layout) + + ::xla::LayoutProto* temp = output_layout_; + output_layout_ = NULL; + return temp; +} +inline ::xla::LayoutProto* ComputeConstantGraphRequest::mutable_output_layout() { + + if (output_layout_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LayoutProto>(GetArenaNoVirtual()); + output_layout_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ComputeConstantGraphRequest.output_layout) + return output_layout_; +} +inline void ComputeConstantGraphRequest::set_allocated_output_layout(::xla::LayoutProto* output_layout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(output_layout_); + } + if (output_layout) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(output_layout)->GetArena(); + if (message_arena != submessage_arena) { + output_layout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, output_layout, submessage_arena); + } + + } else { + + } + output_layout_ = output_layout; + // @@protoc_insertion_point(field_set_allocated:xla.ComputeConstantGraphRequest.output_layout) +} + +// ------------------------------------------------------------------- + +// ComputeConstantResponse + +// .xla.LiteralProto literal = 1; +inline bool ComputeConstantResponse::has_literal() const { + return this != internal_default_instance() && literal_ != NULL; +} +inline const ::xla::LiteralProto& ComputeConstantResponse::_internal_literal() const { + return *literal_; +} +inline const ::xla::LiteralProto& ComputeConstantResponse::literal() const { + const ::xla::LiteralProto* p = literal_; + // @@protoc_insertion_point(field_get:xla.ComputeConstantResponse.literal) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* ComputeConstantResponse::release_literal() { + // @@protoc_insertion_point(field_release:xla.ComputeConstantResponse.literal) + + ::xla::LiteralProto* temp = literal_; + literal_ = NULL; + return temp; +} +inline ::xla::LiteralProto* ComputeConstantResponse::mutable_literal() { + + if (literal_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + literal_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ComputeConstantResponse.literal) + return literal_; +} +inline void ComputeConstantResponse::set_allocated_literal(::xla::LiteralProto* literal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(literal_); + } + if (literal) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(literal)->GetArena(); + if (message_arena != submessage_arena) { + literal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, literal, submessage_arena); + } + + } else { + + } + literal_ = literal; + // @@protoc_insertion_point(field_set_allocated:xla.ComputeConstantResponse.literal) +} + +// ------------------------------------------------------------------- + +// DeconstructTupleRequest + +// .xla.GlobalDataHandle tuple_handle = 2; +inline bool DeconstructTupleRequest::has_tuple_handle() const { + return this != internal_default_instance() && tuple_handle_ != NULL; +} +inline const ::xla::GlobalDataHandle& DeconstructTupleRequest::_internal_tuple_handle() const { + return *tuple_handle_; +} +inline const ::xla::GlobalDataHandle& DeconstructTupleRequest::tuple_handle() const { + const ::xla::GlobalDataHandle* p = tuple_handle_; + // @@protoc_insertion_point(field_get:xla.DeconstructTupleRequest.tuple_handle) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* DeconstructTupleRequest::release_tuple_handle() { + // @@protoc_insertion_point(field_release:xla.DeconstructTupleRequest.tuple_handle) + + ::xla::GlobalDataHandle* temp = tuple_handle_; + tuple_handle_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* DeconstructTupleRequest::mutable_tuple_handle() { + + if (tuple_handle_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + tuple_handle_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.DeconstructTupleRequest.tuple_handle) + return tuple_handle_; +} +inline void DeconstructTupleRequest::set_allocated_tuple_handle(::xla::GlobalDataHandle* tuple_handle) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(tuple_handle_); + } + if (tuple_handle) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tuple_handle)->GetArena(); + if (message_arena != submessage_arena) { + tuple_handle = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tuple_handle, submessage_arena); + } + + } else { + + } + tuple_handle_ = tuple_handle; + // @@protoc_insertion_point(field_set_allocated:xla.DeconstructTupleRequest.tuple_handle) +} + +// ------------------------------------------------------------------- + +// DeconstructTupleResponse + +// repeated .xla.GlobalDataHandle element_handles = 1; +inline int DeconstructTupleResponse::element_handles_size() const { + return element_handles_.size(); +} +inline ::xla::GlobalDataHandle* DeconstructTupleResponse::mutable_element_handles(int index) { + // @@protoc_insertion_point(field_mutable:xla.DeconstructTupleResponse.element_handles) + return element_handles_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* +DeconstructTupleResponse::mutable_element_handles() { + // @@protoc_insertion_point(field_mutable_list:xla.DeconstructTupleResponse.element_handles) + return &element_handles_; +} +inline const ::xla::GlobalDataHandle& DeconstructTupleResponse::element_handles(int index) const { + // @@protoc_insertion_point(field_get:xla.DeconstructTupleResponse.element_handles) + return element_handles_.Get(index); +} +inline ::xla::GlobalDataHandle* DeconstructTupleResponse::add_element_handles() { + // @@protoc_insertion_point(field_add:xla.DeconstructTupleResponse.element_handles) + return element_handles_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& +DeconstructTupleResponse::element_handles() const { + // @@protoc_insertion_point(field_list:xla.DeconstructTupleResponse.element_handles) + return element_handles_; +} + +// ------------------------------------------------------------------- + +// LoadDataRequest + +// string columnio_tablet_path = 1; +inline void LoadDataRequest::clear_columnio_tablet_path() { + columnio_tablet_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& LoadDataRequest::columnio_tablet_path() const { + // @@protoc_insertion_point(field_get:xla.LoadDataRequest.columnio_tablet_path) + return columnio_tablet_path_.GetNoArena(); +} +inline void LoadDataRequest::set_columnio_tablet_path(const ::std::string& value) { + + columnio_tablet_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.LoadDataRequest.columnio_tablet_path) +} +#if LANG_CXX11 +inline void LoadDataRequest::set_columnio_tablet_path(::std::string&& value) { + + columnio_tablet_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.LoadDataRequest.columnio_tablet_path) +} +#endif +inline void LoadDataRequest::set_columnio_tablet_path(const char* value) { + GOOGLE_DCHECK(value != NULL); + + columnio_tablet_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.LoadDataRequest.columnio_tablet_path) +} +inline void LoadDataRequest::set_columnio_tablet_path(const char* value, size_t size) { + + columnio_tablet_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.LoadDataRequest.columnio_tablet_path) +} +inline ::std::string* LoadDataRequest::mutable_columnio_tablet_path() { + + // @@protoc_insertion_point(field_mutable:xla.LoadDataRequest.columnio_tablet_path) + return columnio_tablet_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LoadDataRequest::release_columnio_tablet_path() { + // @@protoc_insertion_point(field_release:xla.LoadDataRequest.columnio_tablet_path) + + return columnio_tablet_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void LoadDataRequest::set_allocated_columnio_tablet_path(::std::string* columnio_tablet_path) { + if (columnio_tablet_path != NULL) { + + } else { + + } + columnio_tablet_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), columnio_tablet_path); + // @@protoc_insertion_point(field_set_allocated:xla.LoadDataRequest.columnio_tablet_path) +} + +// string columnio_field = 2; +inline void LoadDataRequest::clear_columnio_field() { + columnio_field_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& LoadDataRequest::columnio_field() const { + // @@protoc_insertion_point(field_get:xla.LoadDataRequest.columnio_field) + return columnio_field_.GetNoArena(); +} +inline void LoadDataRequest::set_columnio_field(const ::std::string& value) { + + columnio_field_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xla.LoadDataRequest.columnio_field) +} +#if LANG_CXX11 +inline void LoadDataRequest::set_columnio_field(::std::string&& value) { + + columnio_field_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xla.LoadDataRequest.columnio_field) +} +#endif +inline void LoadDataRequest::set_columnio_field(const char* value) { + GOOGLE_DCHECK(value != NULL); + + columnio_field_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xla.LoadDataRequest.columnio_field) +} +inline void LoadDataRequest::set_columnio_field(const char* value, size_t size) { + + columnio_field_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xla.LoadDataRequest.columnio_field) +} +inline ::std::string* LoadDataRequest::mutable_columnio_field() { + + // @@protoc_insertion_point(field_mutable:xla.LoadDataRequest.columnio_field) + return columnio_field_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LoadDataRequest::release_columnio_field() { + // @@protoc_insertion_point(field_release:xla.LoadDataRequest.columnio_field) + + return columnio_field_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void LoadDataRequest::set_allocated_columnio_field(::std::string* columnio_field) { + if (columnio_field != NULL) { + + } else { + + } + columnio_field_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), columnio_field); + // @@protoc_insertion_point(field_set_allocated:xla.LoadDataRequest.columnio_field) +} + +// .xla.ShapeProto element_shape = 3; +inline bool LoadDataRequest::has_element_shape() const { + return this != internal_default_instance() && element_shape_ != NULL; +} +inline const ::xla::ShapeProto& LoadDataRequest::_internal_element_shape() const { + return *element_shape_; +} +inline const ::xla::ShapeProto& LoadDataRequest::element_shape() const { + const ::xla::ShapeProto* p = element_shape_; + // @@protoc_insertion_point(field_get:xla.LoadDataRequest.element_shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* LoadDataRequest::release_element_shape() { + // @@protoc_insertion_point(field_release:xla.LoadDataRequest.element_shape) + + ::xla::ShapeProto* temp = element_shape_; + element_shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* LoadDataRequest::mutable_element_shape() { + + if (element_shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + element_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.LoadDataRequest.element_shape) + return element_shape_; +} +inline void LoadDataRequest::set_allocated_element_shape(::xla::ShapeProto* element_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(element_shape_); + } + if (element_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(element_shape)->GetArena(); + if (message_arena != submessage_arena) { + element_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, element_shape, submessage_arena); + } + + } else { + + } + element_shape_ = element_shape; + // @@protoc_insertion_point(field_set_allocated:xla.LoadDataRequest.element_shape) +} + +// int64 offset = 4; +inline void LoadDataRequest::clear_offset() { + offset_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LoadDataRequest::offset() const { + // @@protoc_insertion_point(field_get:xla.LoadDataRequest.offset) + return offset_; +} +inline void LoadDataRequest::set_offset(::google::protobuf::int64 value) { + + offset_ = value; + // @@protoc_insertion_point(field_set:xla.LoadDataRequest.offset) +} + +// int64 limit = 5; +inline void LoadDataRequest::clear_limit() { + limit_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LoadDataRequest::limit() const { + // @@protoc_insertion_point(field_get:xla.LoadDataRequest.limit) + return limit_; +} +inline void LoadDataRequest::set_limit(::google::protobuf::int64 value) { + + limit_ = value; + // @@protoc_insertion_point(field_set:xla.LoadDataRequest.limit) +} + +// bool zip = 6; +inline void LoadDataRequest::clear_zip() { + zip_ = false; +} +inline bool LoadDataRequest::zip() const { + // @@protoc_insertion_point(field_get:xla.LoadDataRequest.zip) + return zip_; +} +inline void LoadDataRequest::set_zip(bool value) { + + zip_ = value; + // @@protoc_insertion_point(field_set:xla.LoadDataRequest.zip) +} + +// ------------------------------------------------------------------- + +// LoadDataResponse + +// .xla.GlobalDataHandle data = 1; +inline bool LoadDataResponse::has_data() const { + return this != internal_default_instance() && data_ != NULL; +} +inline const ::xla::GlobalDataHandle& LoadDataResponse::_internal_data() const { + return *data_; +} +inline const ::xla::GlobalDataHandle& LoadDataResponse::data() const { + const ::xla::GlobalDataHandle* p = data_; + // @@protoc_insertion_point(field_get:xla.LoadDataResponse.data) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* LoadDataResponse::release_data() { + // @@protoc_insertion_point(field_release:xla.LoadDataResponse.data) + + ::xla::GlobalDataHandle* temp = data_; + data_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* LoadDataResponse::mutable_data() { + + if (data_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + data_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.LoadDataResponse.data) + return data_; +} +inline void LoadDataResponse::set_allocated_data(::xla::GlobalDataHandle* data) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(data_); + } + if (data) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(data)->GetArena(); + if (message_arena != submessage_arena) { + data = ::google::protobuf::internal::GetOwnedMessage( + message_arena, data, submessage_arena); + } + + } else { + + } + data_ = data; + // @@protoc_insertion_point(field_set_allocated:xla.LoadDataResponse.data) +} + +// .xla.ShapeProto data_shape = 2; +inline bool LoadDataResponse::has_data_shape() const { + return this != internal_default_instance() && data_shape_ != NULL; +} +inline const ::xla::ShapeProto& LoadDataResponse::_internal_data_shape() const { + return *data_shape_; +} +inline const ::xla::ShapeProto& LoadDataResponse::data_shape() const { + const ::xla::ShapeProto* p = data_shape_; + // @@protoc_insertion_point(field_get:xla.LoadDataResponse.data_shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* LoadDataResponse::release_data_shape() { + // @@protoc_insertion_point(field_release:xla.LoadDataResponse.data_shape) + + ::xla::ShapeProto* temp = data_shape_; + data_shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* LoadDataResponse::mutable_data_shape() { + + if (data_shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + data_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.LoadDataResponse.data_shape) + return data_shape_; +} +inline void LoadDataResponse::set_allocated_data_shape(::xla::ShapeProto* data_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(data_shape_); + } + if (data_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(data_shape)->GetArena(); + if (message_arena != submessage_arena) { + data_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, data_shape, submessage_arena); + } + + } else { + + } + data_shape_ = data_shape; + // @@protoc_insertion_point(field_set_allocated:xla.LoadDataResponse.data_shape) +} + +// int64 available_rows = 3; +inline void LoadDataResponse::clear_available_rows() { + available_rows_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LoadDataResponse::available_rows() const { + // @@protoc_insertion_point(field_get:xla.LoadDataResponse.available_rows) + return available_rows_; +} +inline void LoadDataResponse::set_available_rows(::google::protobuf::int64 value) { + + available_rows_ = value; + // @@protoc_insertion_point(field_set:xla.LoadDataResponse.available_rows) +} + +// int64 rows_loaded = 4; +inline void LoadDataResponse::clear_rows_loaded() { + rows_loaded_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LoadDataResponse::rows_loaded() const { + // @@protoc_insertion_point(field_get:xla.LoadDataResponse.rows_loaded) + return rows_loaded_; +} +inline void LoadDataResponse::set_rows_loaded(::google::protobuf::int64 value) { + + rows_loaded_ = value; + // @@protoc_insertion_point(field_set:xla.LoadDataResponse.rows_loaded) +} + +// int64 nanoseconds = 5; +inline void LoadDataResponse::clear_nanoseconds() { + nanoseconds_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LoadDataResponse::nanoseconds() const { + // @@protoc_insertion_point(field_get:xla.LoadDataResponse.nanoseconds) + return nanoseconds_; +} +inline void LoadDataResponse::set_nanoseconds(::google::protobuf::int64 value) { + + nanoseconds_ = value; + // @@protoc_insertion_point(field_set:xla.LoadDataResponse.nanoseconds) +} + +// ------------------------------------------------------------------- + +// GetShapeRequest + +// .xla.GlobalDataHandle data = 1; +inline bool GetShapeRequest::has_data() const { + return this != internal_default_instance() && data_ != NULL; +} +inline const ::xla::GlobalDataHandle& GetShapeRequest::_internal_data() const { + return *data_; +} +inline const ::xla::GlobalDataHandle& GetShapeRequest::data() const { + const ::xla::GlobalDataHandle* p = data_; + // @@protoc_insertion_point(field_get:xla.GetShapeRequest.data) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* GetShapeRequest::release_data() { + // @@protoc_insertion_point(field_release:xla.GetShapeRequest.data) + + ::xla::GlobalDataHandle* temp = data_; + data_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* GetShapeRequest::mutable_data() { + + if (data_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + data_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.GetShapeRequest.data) + return data_; +} +inline void GetShapeRequest::set_allocated_data(::xla::GlobalDataHandle* data) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(data_); + } + if (data) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(data)->GetArena(); + if (message_arena != submessage_arena) { + data = ::google::protobuf::internal::GetOwnedMessage( + message_arena, data, submessage_arena); + } + + } else { + + } + data_ = data; + // @@protoc_insertion_point(field_set_allocated:xla.GetShapeRequest.data) +} + +// ------------------------------------------------------------------- + +// GetShapeResponse + +// .xla.ShapeProto shape = 1; +inline bool GetShapeResponse::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::xla::ShapeProto& GetShapeResponse::_internal_shape() const { + return *shape_; +} +inline const ::xla::ShapeProto& GetShapeResponse::shape() const { + const ::xla::ShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:xla.GetShapeResponse.shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* GetShapeResponse::release_shape() { + // @@protoc_insertion_point(field_release:xla.GetShapeResponse.shape) + + ::xla::ShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* GetShapeResponse::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.GetShapeResponse.shape) + return shape_; +} +inline void GetShapeResponse::set_allocated_shape(::xla::ShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:xla.GetShapeResponse.shape) +} + +// ------------------------------------------------------------------- + +// UnpackRequest + +// .xla.GlobalDataHandle data = 1; +inline bool UnpackRequest::has_data() const { + return this != internal_default_instance() && data_ != NULL; +} +inline const ::xla::GlobalDataHandle& UnpackRequest::_internal_data() const { + return *data_; +} +inline const ::xla::GlobalDataHandle& UnpackRequest::data() const { + const ::xla::GlobalDataHandle* p = data_; + // @@protoc_insertion_point(field_get:xla.UnpackRequest.data) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_GlobalDataHandle_default_instance_); +} +inline ::xla::GlobalDataHandle* UnpackRequest::release_data() { + // @@protoc_insertion_point(field_release:xla.UnpackRequest.data) + + ::xla::GlobalDataHandle* temp = data_; + data_ = NULL; + return temp; +} +inline ::xla::GlobalDataHandle* UnpackRequest::mutable_data() { + + if (data_ == NULL) { + auto* p = CreateMaybeMessage<::xla::GlobalDataHandle>(GetArenaNoVirtual()); + data_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.UnpackRequest.data) + return data_; +} +inline void UnpackRequest::set_allocated_data(::xla::GlobalDataHandle* data) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(data_); + } + if (data) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(data)->GetArena(); + if (message_arena != submessage_arena) { + data = ::google::protobuf::internal::GetOwnedMessage( + message_arena, data, submessage_arena); + } + + } else { + + } + data_ = data; + // @@protoc_insertion_point(field_set_allocated:xla.UnpackRequest.data) +} + +// ------------------------------------------------------------------- + +// UnpackResponse + +// repeated .xla.GlobalDataHandle tied_data = 1; +inline int UnpackResponse::tied_data_size() const { + return tied_data_.size(); +} +inline ::xla::GlobalDataHandle* UnpackResponse::mutable_tied_data(int index) { + // @@protoc_insertion_point(field_mutable:xla.UnpackResponse.tied_data) + return tied_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >* +UnpackResponse::mutable_tied_data() { + // @@protoc_insertion_point(field_mutable_list:xla.UnpackResponse.tied_data) + return &tied_data_; +} +inline const ::xla::GlobalDataHandle& UnpackResponse::tied_data(int index) const { + // @@protoc_insertion_point(field_get:xla.UnpackResponse.tied_data) + return tied_data_.Get(index); +} +inline ::xla::GlobalDataHandle* UnpackResponse::add_tied_data() { + // @@protoc_insertion_point(field_add:xla.UnpackResponse.tied_data) + return tied_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::GlobalDataHandle >& +UnpackResponse::tied_data() const { + // @@protoc_insertion_point(field_list:xla.UnpackResponse.tied_data) + return tied_data_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace xla + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::xla::HloReducePrecisionOptions_Location> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::HloReducePrecisionOptions_Location>() { + return ::xla::HloReducePrecisionOptions_Location_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.proto new file mode 100644 index 0000000..6ee1443 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla.proto @@ -0,0 +1,468 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +import "diplomacy_tensorflow/compiler/xla/xla_data.proto"; +import "diplomacy_tensorflow/compiler/xla/service/hlo.proto"; + +package xla; + +// Options for the HLO insert-reduce-precision-operations pass. +message HloReducePrecisionOptions { + // Where and when the reduce-precision operations will be added. + enum Location { + // Add reduce-precision operations to the inputs of selected instructions. + // This is done before any optimization occurs. + OP_INPUTS = 0; + // Add reduce-precision operations to the outputs of selected instructions. + // This is done before any optimization occurs. + OP_OUTPUTS = 1; + // After operation-fusion occurs, add reduce-precision operations to the + // outputs of any selected instructions that have not been fused into + // fusion instructions. + UNFUSED_OP_OUTPUTS = 2; + // After operation-fusion occurs, add reduce-precision operations to the + // outputs of any fusion instructions that contain operations matching the + // selection criteria. + FUSION_INPUTS_BY_CONTENT = 3; + // After operation-fusion occurs, add reduce-precision operations to the + // outputs of any fusion instructions that contain operations matching the + // selection criteria. + FUSION_OUTPUTS_BY_CONTENT = 4; + } + Location location = 1; + + // Exponent and mantissa bit counts for the reduced precision. + uint32 exponent_bits = 2; + uint32 mantissa_bits = 3; + + // Operations matching these opcodes should be suffixed with reduce-precision + // operations. + repeated uint32 opcodes_to_suffix = 4; + + // Operations with names containing these substrings should be suffixed with + // reduce-precision operations. + repeated string opname_substrings_to_suffix = 5; +} + +// Debugging options for XLA. These options may change at any time - there are +// no guarantees about backward or forward compatibility for these fields. +message DebugOptions { + // HLO modules matching this regex will be dumped to a .dot file throughout + // various stages in compilation (file names are LOG(INFO)'d). Set to ".*" to + // dump *all* HLO modules. + string xla_generate_hlo_graph = 1; + + // Show addresses of HLO ops in graph dump. + bool xla_hlo_graph_addresses = 2; + + // Path to dump HLO graphs to. + string xla_hlo_graph_path = 4; + + // Dump HLO graphs as TensorFlow GraphDefs. + bool xla_hlo_dump_as_graphdef = 5; + + // HLO modules matching this regex will be dumped to LOG(INFO). Set to ".*" to + // dump *all* HLO modules. + string xla_log_hlo_text = 6; + + // Dump all HLO modules as text into the provided directory path. + string xla_generate_hlo_text_to = 7; + + // Dump Hlo after all hlo passes are executed as proto binary into this + // directory. + string xla_dump_optimized_hlo_proto_to = 8; + + // Instrument the computation to collect per-HLO cycle counts. + bool xla_hlo_profile = 9; + + // Dumps computations that XLA executes into the provided directory path. + string xla_dump_computations_to = 10; + + // Dumps parameters and results of computations that XLA executes into the + // provided directory path. + string xla_dump_executions_to = 11; + + // List of HLO passes to disable. These names must exactly match the pass + // names as specified by the HloPassInterface::name() method. + repeated string xla_disable_hlo_passes = 30; + + // Disables all HLO passes. Notes that some passes are necessary for + // correctness and the invariants that must be satisfied by "fully optimized" + // HLO are different for different devices and may change over time. The only + // "guarantee", such as it is, is that if you compile XLA and dump the + // optimized HLO for some graph, you should be able to run it again on the + // same device with the same build of XLA. + bool xla_disable_all_hlo_passes = 104; + + // Numerical optimization level for the XLA compiler backend; the specific + // interpretation of this value is left to the backends. + int32 xla_backend_optimization_level = 31; + + // Embed the compiler IR as a string in the executable. + bool xla_embed_ir_in_executable = 33; + + // Dump the compiler IR into this directory as individual files. + string xla_dump_ir_to = 34; + + // Eliminate implicit broadcasts when lowering user computations to HLO + // instructions; use explicit broadcast instead. + bool xla_eliminate_hlo_implicit_broadcast = 35; + + // When generating calls to Eigen in the CPU backend, use multi-threaded Eigen + // mode. + bool xla_cpu_multi_thread_eigen = 60; + + // Path to directory with cuda/ptx tools and libraries. + string xla_gpu_cuda_data_dir = 61; + + // Enable flush-to-zero semantics in the GPU backend. + bool xla_gpu_ftz = 62; + + // Disable multi-streaming in the GPU backend. + bool xla_gpu_disable_multi_streaming = 63; + + // If true, in LLVM-based backends, emit !alias.scope metadata in + // generated IR. + bool xla_llvm_enable_alias_scope_metadata = 70; + + // If true, in LLVM-based backends, emit !noalias metadata in the + // generated IR. + bool xla_llvm_enable_noalias_metadata = 71; + + // If true, in LLVM-based backends, emit !invariant.load metadata in + // the generated IR. + bool xla_llvm_enable_invariant_load_metadata = 72; + + // If true, a set of expensive LLVM optimization passes will not be run. + bool xla_llvm_disable_expensive_passes = 73; + + // Options for inserting reduce-precision operations for numerical + // experimentation. This is a repeated field, as we may want to have + // multiple passes with different parameters. + repeated HloReducePrecisionOptions hlo_reduce_precision_options = 80; + + // This is used by ClientLibraryTestBase::ComputeAndCompare*. If true, the + // computation will run n! times with all permunations of layouts for the + // output shape in rank n. For example, with a 3D shape, all permutations of + // the set {0, 1, 2} are tried. + bool xla_test_all_output_layouts = 90; + + // This is used by ClientLibraryTestBase::ComputeAndCompare*. If true, the + // computation will run for all permunations of layouts of all input + // arguments. For example, with 2 input arguments in 2D and 4D shapes, the + // computation will run 2! * 4! times. + bool xla_test_all_input_layouts = 91; + + // Assign colors based on sharding information when generating the Graphviz + // HLO graph. + bool xla_hlo_graph_sharding_color = 92; + + // Prefix the name scopes of the TF graph exports with "devX" device + // assignments, if available. + bool xla_hlo_tfgraph_device_scopes = 93; + + // If true, the GPU backend is free to use cudnn for HLO batch normalization + // ops. + bool xla_gpu_use_cudnn_batchnorm = 94; + + // Dump HLO before any hlo passes are executed as proto binary into this + // directory. + string xla_dump_unoptimized_hlo_proto_to = 95; + + // Dump HLO after each pass as an HloProto in binary file format into this + // directory. + string xla_dump_per_pass_hlo_proto_to = 96; + + // Generate calls to MKL-DNN in the CPU backend. + bool xla_cpu_use_mkl_dnn = 97; + + // Maximum kernel unroll factor for the GPU backend. + int32 xla_gpu_max_kernel_unroll_factor = 98; + + // When true, "unsafe" mathematical optimizations are enabled. These + // transformations include but are not limited to: + // + // - Reducing the precision of operations (e.g. using an approximate sin + // function, or transforming x/y into x * (1/y)). + // - Assuming that operations never produce or consume NaN or +/- Inf. + // - Assuming that +0 and -0 are indistinguishable. + bool xla_cpu_enable_fast_math = 99; + + // When true we lower the Minimum and Maximum hlos in the GPU backend such + // that Min(NotNaN, NaN) = Min(NaN, NotNaN) = NotNaN. In other words, if flag + // this is true we don't propagate NaNs through Min and Max. + bool xla_gpu_enable_fast_min_max = 100; + + // Crashes the program when any kind of verification fails, instead of just + // logging the failures. One example is cross checking of convolution results + // among different algorithms. + bool xla_gpu_crash_on_verification_failures = 101; + + // Force the host platform to pretend that there are these many host + // "devices". All these devices are backed by the same threadpool. Defaults + // to 1. + // + // Setting this to anything other than 1 can increase overhead from context + // switching but we let the user override this behavior to help run tests on + // the host that run models in parallel across multiple devices. + int32 xla_force_host_platform_device_count = 102; + + // If set to true XLA:GPU invokes `ptxas` with -O0 (default is -O3). + bool xla_gpu_disable_ptxas_optimizations = 103; + + // Dump HLO graphs as an HTML (DOT -> SVG inlined in HTML) + bool xla_hlo_dump_as_html = 105; + + // Enable fast math with eigen in the HLO evaluator. + bool xla_hlo_evaluator_use_fast_path = 106; + + // Next id: 107 + + // Extra options to pass to the compilation backend (e.g. LLVM); specific + // interpretation of these values is left to the backend. + map xla_backend_extra_options = 500; +} + +// These settings control how XLA compiles and/or runs code. Not all settings +// will have an effect on every platform. +// +// When adding new fields, keep in mind that boolean fields default to false. +message ExecutionOptions { + // This optional field's layout is used as a hint when storing the output of + // this computation. Subsequent transfers of this output array to the client + // may be faster when using this layout. + // + // We use a Shape here to accommodate computations that return a tuple. + ShapeProto shape_with_output_layout = 2; + + // Used to seed random-number generators used in this computation. If this is + // 0, we generate a seed ourselves. + // + // TODO(b/32083678): Changing the seed unnecessarily forces a recompilation. + uint64 seed = 3; + + DebugOptions debug_options = 4; + + // This optional field specifies a particular set of devices to run the + // computation on. The computation will be partitioned across these devices. + // If not provided, the default device will be chosen. + repeated DeviceHandle device_handles = 5; +} + +message GetDeviceHandlesRequest { + int64 device_count = 1; +} + +message GetDeviceHandlesResponse { + repeated DeviceHandle device_handles = 1; +} + +message TransferToClientRequest { + GlobalDataHandle data = 1; + + // This optional field directs the service to return the literal in this + // layout. A shape is used to hold the layout to accommodate tuples. + ShapeProto shape_with_layout = 2; +} + +message TransferToClientResponse { + LiteralProto literal = 1; +} + +message TransferToServerRequest { + LiteralProto literal = 1; + DeviceHandle device_handle = 2; +} + +message TransferToServerResponse { + GlobalDataHandle data = 1; +} + +message TransferToInfeedRequest { + LiteralProto literal = 1; + int64 replica_id = 2; + DeviceHandle device_handle = 3; +} + +message TransferToInfeedResponse { +} + +message TransferFromOutfeedRequest { + // This optional field directs the service to return the literal in this + // layout. A shape is used to hold the layout to accommodate tuples. + ShapeProto shape_with_layout = 1; + + int64 replica_id = 2; + DeviceHandle device_handle = 3; +} + +message TransferFromOutfeedResponse { + LiteralProto literal = 1; +} + +message ResetDeviceRequest { + DeviceHandle device_handle = 1; +} + +message ResetDeviceResponse { +} + +message ComputationGraphStatsRequest { + HloModuleProto computation = 1; + DebugOptions debug_options = 2; +} + +message ComputationStatsResponse { + ComputationStats stats = 1; +} + +message CreateChannelHandleRequest { + ChannelHandle.ChannelType channel_type = 1; +} + +message CreateChannelHandleResponse { + ChannelHandle channel = 1; +} + +message UnregisterRequest { + repeated GlobalDataHandle data = 1; +} + +message UnregisterResponse { +} + +message CompileRequest { + // The graph to be compiled. + HloModuleProto computation = 1; + + // Options that affect how XLA compiles code to service this request. + ExecutionOptions execution_options = 2; + + // The layouts of the input arguments. If not set, the default layout will be + // used. Although the real arguments are not needed in compilation, the + // layouts of the arguments can affect the compilation. + repeated ShapeProto input_shape_with_layout = 3; +} + +message CompileResponse { + // The handle to the executable. + ExecutionHandle handle = 1; +} + +message ExecuteRequest { + ExecutionHandle handle = 1; + + // The shape and layout of the arguments must be the same as the those of the + // executable's parameters. + repeated GlobalDataHandle arguments = 2; +} + +// TODO(b/118493728): Remove this and ExecuteGraphParallelRequest and replace +// the uses with calls to Compile and Execute. +message ExecuteGraphRequest { + HloModuleProto computation = 1; + repeated GlobalDataHandle arguments = 2; + + // Options that affect how XLA compiles and runs code to service this request. + ExecutionOptions execution_options = 3; +} + +message ExecuteGraphParallelRequest { + repeated ExecuteGraphRequest requests = 1; +} + +message ExecuteResponse { + GlobalDataHandle output = 1; + ExecutionProfile profile = 2; +} + +message ExecuteParallelResponse { + repeated ExecuteResponse responses = 1; +} + +message WaitForExecutionRequest { + ExecutionHandle execution = 1; +} + +message WaitForExecutionResponse { + GlobalDataHandle output = 1; + ExecutionProfile profile = 2; +} + +message ComputeConstantGraphRequest { + HloModuleProto computation = 1; + LayoutProto output_layout = 2; +} + +message ComputeConstantResponse { + // A LiteralProto is returned directly for this request. + LiteralProto literal = 1; +} + +message DeconstructTupleRequest { + GlobalDataHandle tuple_handle = 2; +} + +message DeconstructTupleResponse { + repeated GlobalDataHandle element_handles = 1; +} + +message LoadDataRequest { + // Describes the path of the ColumnIO tablet to load. + string columnio_tablet_path = 1; + + // Describes the field to load within the ColumnIO tablet. + string columnio_field = 2; + + // Individual element shape, excluding rows. + ShapeProto element_shape = 3; + + // Warning: ColumnIO does not support random-access, so use offset with + // caution in performance-critical scenarios. + int64 offset = 4; + + // Maximum number of elements (with shape element_shape) to load. + int64 limit = 5; + + // If more than one item is requested (via limit > 1), then this request + // attribute zips together the produced vectors. + bool zip = 6; +} + +message LoadDataResponse { + GlobalDataHandle data = 1; + ShapeProto data_shape = 2; + int64 available_rows = 3; + int64 rows_loaded = 4; + int64 nanoseconds = 5; +} + +message GetShapeRequest { + GlobalDataHandle data = 1; +} + +message GetShapeResponse { + ShapeProto shape = 1; +} + +message UnpackRequest { + GlobalDataHandle data = 1; +} + +message UnpackResponse { + repeated GlobalDataHandle tied_data = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.pb.cc new file mode 100644 index 0000000..45a9fcf --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.pb.cc @@ -0,0 +1,11491 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/xla_data.proto + +#include "diplomacy_tensorflow/compiler/xla/xla_data.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DeviceAssignmentProto_ComputationDevice; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_PaddingConfig_PaddingConfigDimension; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TileProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_WindowDimension; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LayoutProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LiteralProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_OpSharding; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto +namespace xla { +class PaddingConfig_PaddingConfigDimensionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PaddingConfig_PaddingConfigDimension_default_instance_; +class PaddingConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PaddingConfig_default_instance_; +class TileProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TileProto_default_instance_; +class LayoutProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LayoutProto_default_instance_; +class ShapeProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ShapeProto_default_instance_; +class ProgramShapeProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProgramShapeProto_default_instance_; +class ComputationStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ComputationStats_default_instance_; +class OpMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpMetadata_default_instance_; +class ExecutionProfileDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecutionProfile_default_instance_; +class ExecutionHandleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExecutionHandle_default_instance_; +class GlobalDataHandleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GlobalDataHandle_default_instance_; +class DeviceHandleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceHandle_default_instance_; +class ChannelHandleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ChannelHandle_default_instance_; +class DeviceAssignmentProto_ComputationDeviceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceAssignmentProto_ComputationDevice_default_instance_; +class DeviceAssignmentProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceAssignmentProto_default_instance_; +class LiteralProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LiteralProto_default_instance_; +class WindowDimensionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _WindowDimension_default_instance_; +class WindowDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Window_default_instance_; +class GatherDimensionNumbersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GatherDimensionNumbers_default_instance_; +class ScatterDimensionNumbersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ScatterDimensionNumbers_default_instance_; +class ConvolutionDimensionNumbersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ConvolutionDimensionNumbers_default_instance_; +class DotDimensionNumbersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DotDimensionNumbers_default_instance_; +class OpShardingDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpSharding_default_instance_; +class ReplicaGroupDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ReplicaGroup_default_instance_; +class SourceTargetDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SourceTarget_default_instance_; +class PrecisionConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _PrecisionConfig_default_instance_; +} // namespace xla +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto { +static void InitDefaultsPaddingConfig_PaddingConfigDimension() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_PaddingConfig_PaddingConfigDimension_default_instance_; + new (ptr) ::xla::PaddingConfig_PaddingConfigDimension(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::PaddingConfig_PaddingConfigDimension::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_PaddingConfig_PaddingConfigDimension = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsPaddingConfig_PaddingConfigDimension}, {}}; + +static void InitDefaultsPaddingConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_PaddingConfig_default_instance_; + new (ptr) ::xla::PaddingConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::PaddingConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_PaddingConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsPaddingConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig_PaddingConfigDimension.base,}}; + +static void InitDefaultsTileProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_TileProto_default_instance_; + new (ptr) ::xla::TileProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::TileProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TileProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTileProto}, {}}; + +static void InitDefaultsLayoutProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_LayoutProto_default_instance_; + new (ptr) ::xla::LayoutProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::LayoutProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_LayoutProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsLayoutProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_TileProto.base,}}; + +static void InitDefaultsShapeProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ShapeProto_default_instance_; + new (ptr) ::xla::ShapeProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ShapeProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ShapeProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsShapeProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LayoutProto.base,}}; + +static void InitDefaultsProgramShapeProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ProgramShapeProto_default_instance_; + new (ptr) ::xla::ProgramShapeProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ProgramShapeProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ProgramShapeProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsProgramShapeProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsComputationStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ComputationStats_default_instance_; + new (ptr) ::xla::ComputationStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ComputationStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ComputationStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsComputationStats}, {}}; + +static void InitDefaultsOpMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_OpMetadata_default_instance_; + new (ptr) ::xla::OpMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::OpMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_OpMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsOpMetadata}, {}}; + +static void InitDefaultsExecutionProfile() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecutionProfile_default_instance_; + new (ptr) ::xla::ExecutionProfile(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecutionProfile::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ExecutionProfile = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsExecutionProfile}, {}}; + +static void InitDefaultsExecutionHandle() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ExecutionHandle_default_instance_; + new (ptr) ::xla::ExecutionHandle(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ExecutionHandle::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ExecutionHandle = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsExecutionHandle}, {}}; + +static void InitDefaultsGlobalDataHandle() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_GlobalDataHandle_default_instance_; + new (ptr) ::xla::GlobalDataHandle(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::GlobalDataHandle::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GlobalDataHandle = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGlobalDataHandle}, {}}; + +static void InitDefaultsDeviceHandle() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DeviceHandle_default_instance_; + new (ptr) ::xla::DeviceHandle(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DeviceHandle::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DeviceHandle = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDeviceHandle}, {}}; + +static void InitDefaultsChannelHandle() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ChannelHandle_default_instance_; + new (ptr) ::xla::ChannelHandle(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ChannelHandle::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ChannelHandle = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsChannelHandle}, {}}; + +static void InitDefaultsDeviceAssignmentProto_ComputationDevice() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DeviceAssignmentProto_ComputationDevice_default_instance_; + new (ptr) ::xla::DeviceAssignmentProto_ComputationDevice(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DeviceAssignmentProto_ComputationDevice::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DeviceAssignmentProto_ComputationDevice = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDeviceAssignmentProto_ComputationDevice}, {}}; + +static void InitDefaultsDeviceAssignmentProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DeviceAssignmentProto_default_instance_; + new (ptr) ::xla::DeviceAssignmentProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DeviceAssignmentProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeviceAssignmentProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeviceAssignmentProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceAssignmentProto_ComputationDevice.base,}}; + +static void InitDefaultsLiteralProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_LiteralProto_default_instance_; + new (ptr) ::xla::LiteralProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::LiteralProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_LiteralProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsLiteralProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsWindowDimension() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_WindowDimension_default_instance_; + new (ptr) ::xla::WindowDimension(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::WindowDimension::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_WindowDimension = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsWindowDimension}, {}}; + +static void InitDefaultsWindow() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_Window_default_instance_; + new (ptr) ::xla::Window(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::Window::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Window = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsWindow}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_WindowDimension.base,}}; + +static void InitDefaultsGatherDimensionNumbers() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_GatherDimensionNumbers_default_instance_; + new (ptr) ::xla::GatherDimensionNumbers(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::GatherDimensionNumbers::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GatherDimensionNumbers = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGatherDimensionNumbers}, {}}; + +static void InitDefaultsScatterDimensionNumbers() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ScatterDimensionNumbers_default_instance_; + new (ptr) ::xla::ScatterDimensionNumbers(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ScatterDimensionNumbers::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ScatterDimensionNumbers = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsScatterDimensionNumbers}, {}}; + +static void InitDefaultsConvolutionDimensionNumbers() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ConvolutionDimensionNumbers_default_instance_; + new (ptr) ::xla::ConvolutionDimensionNumbers(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ConvolutionDimensionNumbers::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ConvolutionDimensionNumbers = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsConvolutionDimensionNumbers}, {}}; + +static void InitDefaultsDotDimensionNumbers() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_DotDimensionNumbers_default_instance_; + new (ptr) ::xla::DotDimensionNumbers(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::DotDimensionNumbers::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DotDimensionNumbers = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDotDimensionNumbers}, {}}; + +static void InitDefaultsOpSharding() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_OpSharding_default_instance_; + new (ptr) ::xla::OpSharding(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::OpSharding::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_OpSharding = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsOpSharding}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base,}}; + +static void InitDefaultsReplicaGroup() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_ReplicaGroup_default_instance_; + new (ptr) ::xla::ReplicaGroup(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::ReplicaGroup::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ReplicaGroup = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsReplicaGroup}, {}}; + +static void InitDefaultsSourceTarget() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_SourceTarget_default_instance_; + new (ptr) ::xla::SourceTarget(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::SourceTarget::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SourceTarget = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSourceTarget}, {}}; + +static void InitDefaultsPrecisionConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xla::_PrecisionConfig_default_instance_; + new (ptr) ::xla::PrecisionConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xla::PrecisionConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_PrecisionConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsPrecisionConfig}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_PaddingConfig_PaddingConfigDimension.base); + ::google::protobuf::internal::InitSCC(&scc_info_PaddingConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_TileProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_LayoutProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_ShapeProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProgramShapeProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_ComputationStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecutionProfile.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExecutionHandle.base); + ::google::protobuf::internal::InitSCC(&scc_info_GlobalDataHandle.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceHandle.base); + ::google::protobuf::internal::InitSCC(&scc_info_ChannelHandle.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceAssignmentProto_ComputationDevice.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceAssignmentProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_LiteralProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_WindowDimension.base); + ::google::protobuf::internal::InitSCC(&scc_info_Window.base); + ::google::protobuf::internal::InitSCC(&scc_info_GatherDimensionNumbers.base); + ::google::protobuf::internal::InitSCC(&scc_info_ScatterDimensionNumbers.base); + ::google::protobuf::internal::InitSCC(&scc_info_ConvolutionDimensionNumbers.base); + ::google::protobuf::internal::InitSCC(&scc_info_DotDimensionNumbers.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpSharding.base); + ::google::protobuf::internal::InitSCC(&scc_info_ReplicaGroup.base); + ::google::protobuf::internal::InitSCC(&scc_info_SourceTarget.base); + ::google::protobuf::internal::InitSCC(&scc_info_PrecisionConfig.base); +} + +::google::protobuf::Metadata file_level_metadata[26]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[7]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PaddingConfig_PaddingConfigDimension, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PaddingConfig_PaddingConfigDimension, edge_padding_low_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PaddingConfig_PaddingConfigDimension, edge_padding_high_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PaddingConfig_PaddingConfigDimension, interior_padding_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PaddingConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PaddingConfig, dimensions_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TileProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::TileProto, dimensions_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LayoutProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LayoutProto, format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LayoutProto, minor_to_major_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LayoutProto, max_sparse_elements_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LayoutProto, tiles_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LayoutProto, element_size_in_bits_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ShapeProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ShapeProto, element_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ShapeProto, dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ShapeProto, tuple_shapes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ShapeProto, layout_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ProgramShapeProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ProgramShapeProto, parameters_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ProgramShapeProto, result_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ProgramShapeProto, parameter_names_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationStats, flop_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ComputationStats, transcendental_count_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpMetadata, op_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpMetadata, op_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpMetadata, source_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpMetadata, source_line_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionProfile, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionProfile, compilation_cache_hit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionProfile, compile_time_ms_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionProfile, compute_cycle_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionProfile, compute_time_ns_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionProfile, compute_and_transfer_time_ns_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionProfile, executable_size_in_bytes_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionHandle, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ExecutionHandle, handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GlobalDataHandle, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GlobalDataHandle, handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceHandle, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceHandle, handle_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceHandle, device_count_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ChannelHandle, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ChannelHandle, handle_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ChannelHandle, type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceAssignmentProto_ComputationDevice, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceAssignmentProto_ComputationDevice, replica_device_ids_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceAssignmentProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceAssignmentProto, replica_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceAssignmentProto, computation_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DeviceAssignmentProto, computation_devices_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, preds_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, s8s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, u8s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, s32s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, s64s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, u32s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, u64s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, f32s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, f64s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, c64s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, tuple_literals_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, f16s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, bf16s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, u16s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, s16s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::LiteralProto, sparse_indices_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, padding_low_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, padding_high_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, window_dilation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, base_dilation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::WindowDimension, window_reversal_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::Window, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::Window, dimensions_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GatherDimensionNumbers, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GatherDimensionNumbers, offset_dims_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GatherDimensionNumbers, collapsed_slice_dims_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GatherDimensionNumbers, start_index_map_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::GatherDimensionNumbers, index_vector_dim_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ScatterDimensionNumbers, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ScatterDimensionNumbers, update_window_dims_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ScatterDimensionNumbers, inserted_window_dims_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ScatterDimensionNumbers, scatter_dims_to_operand_dims_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ScatterDimensionNumbers, index_vector_dim_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, input_batch_dimension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, input_feature_dimension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, input_spatial_dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, kernel_input_feature_dimension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, kernel_output_feature_dimension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, kernel_spatial_dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, output_batch_dimension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, output_feature_dimension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ConvolutionDimensionNumbers, output_spatial_dimensions_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DotDimensionNumbers, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DotDimensionNumbers, lhs_contracting_dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DotDimensionNumbers, rhs_contracting_dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DotDimensionNumbers, lhs_batch_dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::DotDimensionNumbers, rhs_batch_dimensions_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpSharding, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpSharding, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpSharding, tile_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpSharding, tile_assignment_dimensions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpSharding, tile_assignment_devices_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::OpSharding, tuple_shardings_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ReplicaGroup, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::ReplicaGroup, replica_ids_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::SourceTarget, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::SourceTarget, source_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::SourceTarget, target_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PrecisionConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xla::PrecisionConfig, operand_precision_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::xla::PaddingConfig_PaddingConfigDimension)}, + { 8, -1, sizeof(::xla::PaddingConfig)}, + { 14, -1, sizeof(::xla::TileProto)}, + { 20, -1, sizeof(::xla::LayoutProto)}, + { 30, -1, sizeof(::xla::ShapeProto)}, + { 39, -1, sizeof(::xla::ProgramShapeProto)}, + { 47, -1, sizeof(::xla::ComputationStats)}, + { 54, -1, sizeof(::xla::OpMetadata)}, + { 63, -1, sizeof(::xla::ExecutionProfile)}, + { 74, -1, sizeof(::xla::ExecutionHandle)}, + { 80, -1, sizeof(::xla::GlobalDataHandle)}, + { 86, -1, sizeof(::xla::DeviceHandle)}, + { 93, -1, sizeof(::xla::ChannelHandle)}, + { 100, -1, sizeof(::xla::DeviceAssignmentProto_ComputationDevice)}, + { 106, -1, sizeof(::xla::DeviceAssignmentProto)}, + { 114, -1, sizeof(::xla::LiteralProto)}, + { 136, -1, sizeof(::xla::WindowDimension)}, + { 148, -1, sizeof(::xla::Window)}, + { 154, -1, sizeof(::xla::GatherDimensionNumbers)}, + { 163, -1, sizeof(::xla::ScatterDimensionNumbers)}, + { 172, -1, sizeof(::xla::ConvolutionDimensionNumbers)}, + { 186, -1, sizeof(::xla::DotDimensionNumbers)}, + { 195, -1, sizeof(::xla::OpSharding)}, + { 205, -1, sizeof(::xla::ReplicaGroup)}, + { 211, -1, sizeof(::xla::SourceTarget)}, + { 218, -1, sizeof(::xla::PrecisionConfig)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::xla::_PaddingConfig_PaddingConfigDimension_default_instance_), + reinterpret_cast(&::xla::_PaddingConfig_default_instance_), + reinterpret_cast(&::xla::_TileProto_default_instance_), + reinterpret_cast(&::xla::_LayoutProto_default_instance_), + reinterpret_cast(&::xla::_ShapeProto_default_instance_), + reinterpret_cast(&::xla::_ProgramShapeProto_default_instance_), + reinterpret_cast(&::xla::_ComputationStats_default_instance_), + reinterpret_cast(&::xla::_OpMetadata_default_instance_), + reinterpret_cast(&::xla::_ExecutionProfile_default_instance_), + reinterpret_cast(&::xla::_ExecutionHandle_default_instance_), + reinterpret_cast(&::xla::_GlobalDataHandle_default_instance_), + reinterpret_cast(&::xla::_DeviceHandle_default_instance_), + reinterpret_cast(&::xla::_ChannelHandle_default_instance_), + reinterpret_cast(&::xla::_DeviceAssignmentProto_ComputationDevice_default_instance_), + reinterpret_cast(&::xla::_DeviceAssignmentProto_default_instance_), + reinterpret_cast(&::xla::_LiteralProto_default_instance_), + reinterpret_cast(&::xla::_WindowDimension_default_instance_), + reinterpret_cast(&::xla::_Window_default_instance_), + reinterpret_cast(&::xla::_GatherDimensionNumbers_default_instance_), + reinterpret_cast(&::xla::_ScatterDimensionNumbers_default_instance_), + reinterpret_cast(&::xla::_ConvolutionDimensionNumbers_default_instance_), + reinterpret_cast(&::xla::_DotDimensionNumbers_default_instance_), + reinterpret_cast(&::xla::_OpSharding_default_instance_), + reinterpret_cast(&::xla::_ReplicaGroup_default_instance_), + reinterpret_cast(&::xla::_SourceTarget_default_instance_), + reinterpret_cast(&::xla::_PrecisionConfig_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/xla/xla_data.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 26); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n0diplomacy_tensorflow/compiler/xla/xla_" + "data.proto\022\003xla\"\267\001\n\rPaddingConfig\022=\n\ndim" + "ensions\030\001 \003(\0132).xla.PaddingConfig.Paddin" + "gConfigDimension\032g\n\026PaddingConfigDimensi" + "on\022\030\n\020edge_padding_low\030\001 \001(\003\022\031\n\021edge_pad" + "ding_high\030\002 \001(\003\022\030\n\020interior_padding\030\003 \001(" + "\003\"\037\n\tTileProto\022\022\n\ndimensions\030\001 \003(\003\"\312\001\n\013L" + "ayoutProto\022\033\n\006format\030\004 \001(\0162\013.xla.Format\022" + "\026\n\016minor_to_major\030\001 \003(\003\022\033\n\023max_sparse_el" + "ements\030\005 \001(\003\022\035\n\005tiles\030\006 \003(\0132\016.xla.TilePr" + "oto\022\034\n\024element_size_in_bits\030\007 \001(\003J\004\010\002\020\003J" + "\004\010\003\020\004R\021padded_dimensionsR\rpadding_value\"" + "\237\001\n\nShapeProto\022(\n\014element_type\030\002 \001(\0162\022.x" + "la.PrimitiveType\022\022\n\ndimensions\030\003 \003(\003\022%\n\014" + "tuple_shapes\030\004 \003(\0132\017.xla.ShapeProto\022 \n\006l" + "ayout\030\005 \001(\0132\020.xla.LayoutProtoJ\004\010\001\020\002R\004ran" + "k\"r\n\021ProgramShapeProto\022#\n\nparameters\030\001 \003" + "(\0132\017.xla.ShapeProto\022\037\n\006result\030\002 \001(\0132\017.xl" + "a.ShapeProto\022\027\n\017parameter_names\030\003 \003(\t\"D\n" + "\020ComputationStats\022\022\n\nflop_count\030\001 \001(\001\022\034\n" + "\024transcendental_count\030\002 \001(\001\"X\n\nOpMetadat" + "a\022\017\n\007op_type\030\001 \001(\t\022\017\n\007op_name\030\002 \001(\t\022\023\n\013s" + "ource_file\030\003 \001(\t\022\023\n\013source_line\030\004 \001(\005\"\310\001" + "\n\020ExecutionProfile\022\035\n\025compilation_cache_" + "hit\030\001 \001(\010\022\027\n\017compile_time_ms\030\002 \001(\003\022\033\n\023co" + "mpute_cycle_count\030\003 \001(\003\022\027\n\017compute_time_" + "ns\030\004 \001(\003\022$\n\034compute_and_transfer_time_ns" + "\030\005 \001(\003\022 \n\030executable_size_in_bytes\030\006 \001(\003" + "\"!\n\017ExecutionHandle\022\016\n\006handle\030\001 \001(\003\"\"\n\020G" + "lobalDataHandle\022\016\n\006handle\030\001 \001(\003\"4\n\014Devic" + "eHandle\022\016\n\006handle\030\001 \001(\003\022\024\n\014device_count\030" + "\002 \001(\003\"\264\001\n\rChannelHandle\022\016\n\006handle\030\001 \001(\003\022" + ",\n\004type\030\002 \001(\0162\036.xla.ChannelHandle.Channe" + "lType\"e\n\013ChannelType\022\030\n\024CHANNEL_TYPE_INV" + "ALID\020\000\022\024\n\020DEVICE_TO_DEVICE\020\001\022\022\n\016DEVICE_T" + "O_HOST\020\002\022\022\n\016HOST_TO_DEVICE\020\003\"\305\001\n\025DeviceA" + "ssignmentProto\022\025\n\rreplica_count\030\001 \001(\005\022\031\n" + "\021computation_count\030\002 \001(\005\022I\n\023computation_" + "devices\030\003 \003(\0132,.xla.DeviceAssignmentProt" + "o.ComputationDevice\032/\n\021ComputationDevice" + "\022\032\n\022replica_device_ids\030\001 \003(\005\"\265\002\n\014Literal" + "Proto\022\036\n\005shape\030\001 \001(\0132\017.xla.ShapeProto\022\r\n" + "\005preds\030\002 \003(\010\022\013\n\003s8s\030\017 \001(\014\022\013\n\003u8s\030\003 \001(\014\022\014" + "\n\004s32s\030\004 \003(\005\022\014\n\004s64s\030\005 \003(\003\022\014\n\004u32s\030\006 \003(\r" + "\022\014\n\004u64s\030\007 \003(\004\022\014\n\004f32s\030\010 \003(\002\022\014\n\004f64s\030\t \003" + "(\001\022\014\n\004c64s\030\014 \003(\002\022)\n\016tuple_literals\030\n \003(\013" + "2\021.xla.LiteralProto\022\014\n\004f16s\030\013 \001(\014\022\r\n\005bf1" + "6s\030\r \001(\014\022\014\n\004u16s\030\020 \001(\014\022\014\n\004s16s\030\021 \001(\014\022\026\n\016" + "sparse_indices\030\016 \003(\003\"\243\001\n\017WindowDimension" + "\022\014\n\004size\030\001 \001(\003\022\016\n\006stride\030\002 \001(\003\022\023\n\013paddin" + "g_low\030\003 \001(\003\022\024\n\014padding_high\030\004 \001(\003\022\027\n\017win" + "dow_dilation\030\005 \001(\003\022\025\n\rbase_dilation\030\006 \001(" + "\003\022\027\n\017window_reversal\030\007 \001(\010\"2\n\006Window\022(\n\n" + "dimensions\030\001 \003(\0132\024.xla.WindowDimension\"~" + "\n\026GatherDimensionNumbers\022\023\n\013offset_dims\030" + "\001 \003(\003\022\034\n\024collapsed_slice_dims\030\002 \003(\003\022\027\n\017s" + "tart_index_map\030\003 \003(\003\022\030\n\020index_vector_dim" + "\030\004 \001(\003\"\223\001\n\027ScatterDimensionNumbers\022\032\n\022up" + "date_window_dims\030\001 \003(\003\022\034\n\024inserted_windo" + "w_dims\030\002 \003(\003\022$\n\034scatter_dims_to_operand_" + "dims\030\003 \003(\003\022\030\n\020index_vector_dim\030\004 \001(\003\"\330\002\n" + "\033ConvolutionDimensionNumbers\022\035\n\025input_ba" + "tch_dimension\030\007 \001(\003\022\037\n\027input_feature_dim" + "ension\030\010 \001(\003\022 \n\030input_spatial_dimensions" + "\030\013 \003(\003\022&\n\036kernel_input_feature_dimension" + "\030\003 \001(\003\022\'\n\037kernel_output_feature_dimensio" + "n\030\004 \001(\003\022!\n\031kernel_spatial_dimensions\030\006 \003" + "(\003\022\036\n\026output_batch_dimension\030\t \001(\003\022 \n\030ou" + "tput_feature_dimension\030\n \001(\003\022!\n\031output_s" + "patial_dimensions\030\014 \003(\003\"\231\001\n\023DotDimension" + "Numbers\022\"\n\032lhs_contracting_dimensions\030\001 " + "\003(\003\022\"\n\032rhs_contracting_dimensions\030\002 \003(\003\022" + "\034\n\024lhs_batch_dimensions\030\003 \003(\003\022\034\n\024rhs_bat" + "ch_dimensions\030\004 \003(\003\"\377\001\n\nOpSharding\022\"\n\004ty" + "pe\030\001 \001(\0162\024.xla.OpSharding.Type\022#\n\ntile_s" + "hape\030\002 \001(\0132\017.xla.ShapeProto\022\"\n\032tile_assi" + "gnment_dimensions\030\003 \003(\003\022\037\n\027tile_assignme" + "nt_devices\030\004 \003(\003\022(\n\017tuple_shardings\030\005 \003(" + "\0132\017.xla.OpSharding\"9\n\004Type\022\016\n\nREPLICATED" + "\020\000\022\013\n\007MAXIMAL\020\001\022\t\n\005TUPLE\020\002\022\t\n\005OTHER\020\003\"#\n" + "\014ReplicaGroup\022\023\n\013replica_ids\030\001 \003(\003\".\n\014So" + "urceTarget\022\016\n\006source\030\001 \001(\003\022\016\n\006target\030\002 \001" + "(\003\"}\n\017PrecisionConfig\0229\n\021operand_precisi" + "on\030\001 \003(\0162\036.xla.PrecisionConfig.Precision" + "\"/\n\tPrecision\022\013\n\007DEFAULT\020\000\022\010\n\004HIGH\020\001\022\013\n\007" + "HIGHEST\020\002*\313\001\n\rPrimitiveType\022\032\n\026PRIMITIVE" + "_TYPE_INVALID\020\000\022\010\n\004PRED\020\001\022\006\n\002S8\020\002\022\007\n\003S16" + "\020\003\022\007\n\003S32\020\004\022\007\n\003S64\020\005\022\006\n\002U8\020\006\022\007\n\003U16\020\007\022\007\n" + "\003U32\020\010\022\007\n\003U64\020\t\022\007\n\003F16\020\n\022\007\n\003F32\020\013\022\010\n\004BF1" + "6\020\020\022\007\n\003F64\020\014\022\007\n\003C64\020\017\022\t\n\005TUPLE\020\r\022\n\n\006OPAQ" + "UE\020\016\022\t\n\005TOKEN\020\021*3\n\006Format\022\022\n\016INVALID_FOR" + "MAT\020\000\022\t\n\005DENSE\020\001\022\n\n\006SPARSE\020\002*1\n\007FftType\022" + "\007\n\003FFT\020\000\022\010\n\004IFFT\020\001\022\010\n\004RFFT\020\002\022\t\n\005IRFFT\020\003*" + "F\n\022RandomDistribution\022\017\n\013RNG_INVALID\020\000\022\017" + "\n\013RNG_UNIFORM\020\001\022\016\n\nRNG_NORMAL\020\002B\003\370\001\001b\006pr" + "oto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 3804); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/xla/xla_data.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto +namespace xla { +const ::google::protobuf::EnumDescriptor* ChannelHandle_ChannelType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_enum_descriptors[0]; +} +bool ChannelHandle_ChannelType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const ChannelHandle_ChannelType ChannelHandle::CHANNEL_TYPE_INVALID; +const ChannelHandle_ChannelType ChannelHandle::DEVICE_TO_DEVICE; +const ChannelHandle_ChannelType ChannelHandle::DEVICE_TO_HOST; +const ChannelHandle_ChannelType ChannelHandle::HOST_TO_DEVICE; +const ChannelHandle_ChannelType ChannelHandle::ChannelType_MIN; +const ChannelHandle_ChannelType ChannelHandle::ChannelType_MAX; +const int ChannelHandle::ChannelType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* OpSharding_Type_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_enum_descriptors[1]; +} +bool OpSharding_Type_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const OpSharding_Type OpSharding::REPLICATED; +const OpSharding_Type OpSharding::MAXIMAL; +const OpSharding_Type OpSharding::TUPLE; +const OpSharding_Type OpSharding::OTHER; +const OpSharding_Type OpSharding::Type_MIN; +const OpSharding_Type OpSharding::Type_MAX; +const int OpSharding::Type_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* PrecisionConfig_Precision_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_enum_descriptors[2]; +} +bool PrecisionConfig_Precision_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const PrecisionConfig_Precision PrecisionConfig::DEFAULT; +const PrecisionConfig_Precision PrecisionConfig::HIGH; +const PrecisionConfig_Precision PrecisionConfig::HIGHEST; +const PrecisionConfig_Precision PrecisionConfig::Precision_MIN; +const PrecisionConfig_Precision PrecisionConfig::Precision_MAX; +const int PrecisionConfig::Precision_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* PrimitiveType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_enum_descriptors[3]; +} +bool PrimitiveType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* Format_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_enum_descriptors[4]; +} +bool Format_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* FftType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_enum_descriptors[5]; +} +bool FftType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* RandomDistribution_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_enum_descriptors[6]; +} +bool RandomDistribution_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + + +// =================================================================== + +void PaddingConfig_PaddingConfigDimension::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PaddingConfig_PaddingConfigDimension::kEdgePaddingLowFieldNumber; +const int PaddingConfig_PaddingConfigDimension::kEdgePaddingHighFieldNumber; +const int PaddingConfig_PaddingConfigDimension::kInteriorPaddingFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PaddingConfig_PaddingConfigDimension::PaddingConfig_PaddingConfigDimension() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig_PaddingConfigDimension.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.PaddingConfig.PaddingConfigDimension) +} +PaddingConfig_PaddingConfigDimension::PaddingConfig_PaddingConfigDimension(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig_PaddingConfigDimension.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.PaddingConfig.PaddingConfigDimension) +} +PaddingConfig_PaddingConfigDimension::PaddingConfig_PaddingConfigDimension(const PaddingConfig_PaddingConfigDimension& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&edge_padding_low_, &from.edge_padding_low_, + static_cast(reinterpret_cast(&interior_padding_) - + reinterpret_cast(&edge_padding_low_)) + sizeof(interior_padding_)); + // @@protoc_insertion_point(copy_constructor:xla.PaddingConfig.PaddingConfigDimension) +} + +void PaddingConfig_PaddingConfigDimension::SharedCtor() { + ::memset(&edge_padding_low_, 0, static_cast( + reinterpret_cast(&interior_padding_) - + reinterpret_cast(&edge_padding_low_)) + sizeof(interior_padding_)); +} + +PaddingConfig_PaddingConfigDimension::~PaddingConfig_PaddingConfigDimension() { + // @@protoc_insertion_point(destructor:xla.PaddingConfig.PaddingConfigDimension) + SharedDtor(); +} + +void PaddingConfig_PaddingConfigDimension::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void PaddingConfig_PaddingConfigDimension::ArenaDtor(void* object) { + PaddingConfig_PaddingConfigDimension* _this = reinterpret_cast< PaddingConfig_PaddingConfigDimension* >(object); + (void)_this; +} +void PaddingConfig_PaddingConfigDimension::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void PaddingConfig_PaddingConfigDimension::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* PaddingConfig_PaddingConfigDimension::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const PaddingConfig_PaddingConfigDimension& PaddingConfig_PaddingConfigDimension::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig_PaddingConfigDimension.base); + return *internal_default_instance(); +} + + +void PaddingConfig_PaddingConfigDimension::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.PaddingConfig.PaddingConfigDimension) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&edge_padding_low_, 0, static_cast( + reinterpret_cast(&interior_padding_) - + reinterpret_cast(&edge_padding_low_)) + sizeof(interior_padding_)); + _internal_metadata_.Clear(); +} + +bool PaddingConfig_PaddingConfigDimension::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.PaddingConfig.PaddingConfigDimension) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 edge_padding_low = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &edge_padding_low_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 edge_padding_high = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &edge_padding_high_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 interior_padding = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &interior_padding_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.PaddingConfig.PaddingConfigDimension) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.PaddingConfig.PaddingConfigDimension) + return false; +#undef DO_ +} + +void PaddingConfig_PaddingConfigDimension::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.PaddingConfig.PaddingConfigDimension) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 edge_padding_low = 1; + if (this->edge_padding_low() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->edge_padding_low(), output); + } + + // int64 edge_padding_high = 2; + if (this->edge_padding_high() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->edge_padding_high(), output); + } + + // int64 interior_padding = 3; + if (this->interior_padding() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->interior_padding(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.PaddingConfig.PaddingConfigDimension) +} + +::google::protobuf::uint8* PaddingConfig_PaddingConfigDimension::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.PaddingConfig.PaddingConfigDimension) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 edge_padding_low = 1; + if (this->edge_padding_low() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->edge_padding_low(), target); + } + + // int64 edge_padding_high = 2; + if (this->edge_padding_high() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->edge_padding_high(), target); + } + + // int64 interior_padding = 3; + if (this->interior_padding() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->interior_padding(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.PaddingConfig.PaddingConfigDimension) + return target; +} + +size_t PaddingConfig_PaddingConfigDimension::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.PaddingConfig.PaddingConfigDimension) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 edge_padding_low = 1; + if (this->edge_padding_low() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->edge_padding_low()); + } + + // int64 edge_padding_high = 2; + if (this->edge_padding_high() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->edge_padding_high()); + } + + // int64 interior_padding = 3; + if (this->interior_padding() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->interior_padding()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PaddingConfig_PaddingConfigDimension::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.PaddingConfig.PaddingConfigDimension) + GOOGLE_DCHECK_NE(&from, this); + const PaddingConfig_PaddingConfigDimension* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.PaddingConfig.PaddingConfigDimension) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.PaddingConfig.PaddingConfigDimension) + MergeFrom(*source); + } +} + +void PaddingConfig_PaddingConfigDimension::MergeFrom(const PaddingConfig_PaddingConfigDimension& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.PaddingConfig.PaddingConfigDimension) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.edge_padding_low() != 0) { + set_edge_padding_low(from.edge_padding_low()); + } + if (from.edge_padding_high() != 0) { + set_edge_padding_high(from.edge_padding_high()); + } + if (from.interior_padding() != 0) { + set_interior_padding(from.interior_padding()); + } +} + +void PaddingConfig_PaddingConfigDimension::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.PaddingConfig.PaddingConfigDimension) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PaddingConfig_PaddingConfigDimension::CopyFrom(const PaddingConfig_PaddingConfigDimension& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.PaddingConfig.PaddingConfigDimension) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PaddingConfig_PaddingConfigDimension::IsInitialized() const { + return true; +} + +void PaddingConfig_PaddingConfigDimension::Swap(PaddingConfig_PaddingConfigDimension* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + PaddingConfig_PaddingConfigDimension* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void PaddingConfig_PaddingConfigDimension::UnsafeArenaSwap(PaddingConfig_PaddingConfigDimension* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void PaddingConfig_PaddingConfigDimension::InternalSwap(PaddingConfig_PaddingConfigDimension* other) { + using std::swap; + swap(edge_padding_low_, other->edge_padding_low_); + swap(edge_padding_high_, other->edge_padding_high_); + swap(interior_padding_, other->interior_padding_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata PaddingConfig_PaddingConfigDimension::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void PaddingConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PaddingConfig::kDimensionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PaddingConfig::PaddingConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.PaddingConfig) +} +PaddingConfig::PaddingConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dimensions_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.PaddingConfig) +} +PaddingConfig::PaddingConfig(const PaddingConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dimensions_(from.dimensions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.PaddingConfig) +} + +void PaddingConfig::SharedCtor() { +} + +PaddingConfig::~PaddingConfig() { + // @@protoc_insertion_point(destructor:xla.PaddingConfig) + SharedDtor(); +} + +void PaddingConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void PaddingConfig::ArenaDtor(void* object) { + PaddingConfig* _this = reinterpret_cast< PaddingConfig* >(object); + (void)_this; +} +void PaddingConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void PaddingConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* PaddingConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const PaddingConfig& PaddingConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PaddingConfig.base); + return *internal_default_instance(); +} + + +void PaddingConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.PaddingConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dimensions_.Clear(); + _internal_metadata_.Clear(); +} + +bool PaddingConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.PaddingConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.PaddingConfig.PaddingConfigDimension dimensions = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_dimensions())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.PaddingConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.PaddingConfig) + return false; +#undef DO_ +} + +void PaddingConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.PaddingConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.PaddingConfig.PaddingConfigDimension dimensions = 1; + for (unsigned int i = 0, + n = static_cast(this->dimensions_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->dimensions(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.PaddingConfig) +} + +::google::protobuf::uint8* PaddingConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.PaddingConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.PaddingConfig.PaddingConfigDimension dimensions = 1; + for (unsigned int i = 0, + n = static_cast(this->dimensions_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->dimensions(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.PaddingConfig) + return target; +} + +size_t PaddingConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.PaddingConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.PaddingConfig.PaddingConfigDimension dimensions = 1; + { + unsigned int count = static_cast(this->dimensions_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->dimensions(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PaddingConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.PaddingConfig) + GOOGLE_DCHECK_NE(&from, this); + const PaddingConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.PaddingConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.PaddingConfig) + MergeFrom(*source); + } +} + +void PaddingConfig::MergeFrom(const PaddingConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.PaddingConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dimensions_.MergeFrom(from.dimensions_); +} + +void PaddingConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.PaddingConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PaddingConfig::CopyFrom(const PaddingConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.PaddingConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PaddingConfig::IsInitialized() const { + return true; +} + +void PaddingConfig::Swap(PaddingConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + PaddingConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void PaddingConfig::UnsafeArenaSwap(PaddingConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void PaddingConfig::InternalSwap(PaddingConfig* other) { + using std::swap; + CastToBase(&dimensions_)->InternalSwap(CastToBase(&other->dimensions_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata PaddingConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TileProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TileProto::kDimensionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TileProto::TileProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_TileProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.TileProto) +} +TileProto::TileProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dimensions_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_TileProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.TileProto) +} +TileProto::TileProto(const TileProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dimensions_(from.dimensions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.TileProto) +} + +void TileProto::SharedCtor() { +} + +TileProto::~TileProto() { + // @@protoc_insertion_point(destructor:xla.TileProto) + SharedDtor(); +} + +void TileProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TileProto::ArenaDtor(void* object) { + TileProto* _this = reinterpret_cast< TileProto* >(object); + (void)_this; +} +void TileProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TileProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TileProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TileProto& TileProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_TileProto.base); + return *internal_default_instance(); +} + + +void TileProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.TileProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dimensions_.Clear(); + _internal_metadata_.Clear(); +} + +bool TileProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.TileProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 dimensions = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.TileProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.TileProto) + return false; +#undef DO_ +} + +void TileProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.TileProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 dimensions = 1; + if (this->dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->dimensions(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.TileProto) +} + +::google::protobuf::uint8* TileProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.TileProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 dimensions = 1; + if (this->dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->dimensions_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.TileProto) + return target; +} + +size_t TileProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.TileProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 dimensions = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TileProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.TileProto) + GOOGLE_DCHECK_NE(&from, this); + const TileProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.TileProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.TileProto) + MergeFrom(*source); + } +} + +void TileProto::MergeFrom(const TileProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.TileProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dimensions_.MergeFrom(from.dimensions_); +} + +void TileProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.TileProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TileProto::CopyFrom(const TileProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.TileProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TileProto::IsInitialized() const { + return true; +} + +void TileProto::Swap(TileProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TileProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TileProto::UnsafeArenaSwap(TileProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TileProto::InternalSwap(TileProto* other) { + using std::swap; + dimensions_.InternalSwap(&other->dimensions_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TileProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LayoutProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LayoutProto::kFormatFieldNumber; +const int LayoutProto::kMinorToMajorFieldNumber; +const int LayoutProto::kMaxSparseElementsFieldNumber; +const int LayoutProto::kTilesFieldNumber; +const int LayoutProto::kElementSizeInBitsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LayoutProto::LayoutProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LayoutProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.LayoutProto) +} +LayoutProto::LayoutProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + minor_to_major_(arena), + tiles_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LayoutProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.LayoutProto) +} +LayoutProto::LayoutProto(const LayoutProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + minor_to_major_(from.minor_to_major_), + tiles_(from.tiles_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&max_sparse_elements_, &from.max_sparse_elements_, + static_cast(reinterpret_cast(&element_size_in_bits_) - + reinterpret_cast(&max_sparse_elements_)) + sizeof(element_size_in_bits_)); + // @@protoc_insertion_point(copy_constructor:xla.LayoutProto) +} + +void LayoutProto::SharedCtor() { + ::memset(&max_sparse_elements_, 0, static_cast( + reinterpret_cast(&element_size_in_bits_) - + reinterpret_cast(&max_sparse_elements_)) + sizeof(element_size_in_bits_)); +} + +LayoutProto::~LayoutProto() { + // @@protoc_insertion_point(destructor:xla.LayoutProto) + SharedDtor(); +} + +void LayoutProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void LayoutProto::ArenaDtor(void* object) { + LayoutProto* _this = reinterpret_cast< LayoutProto* >(object); + (void)_this; +} +void LayoutProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LayoutProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LayoutProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LayoutProto& LayoutProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LayoutProto.base); + return *internal_default_instance(); +} + + +void LayoutProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.LayoutProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + minor_to_major_.Clear(); + tiles_.Clear(); + ::memset(&max_sparse_elements_, 0, static_cast( + reinterpret_cast(&element_size_in_bits_) - + reinterpret_cast(&max_sparse_elements_)) + sizeof(element_size_in_bits_)); + _internal_metadata_.Clear(); +} + +bool LayoutProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.LayoutProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 minor_to_major = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_minor_to_major()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_minor_to_major()))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.Format format = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_format(static_cast< ::xla::Format >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int64 max_sparse_elements = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &max_sparse_elements_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.TileProto tiles = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tiles())); + } else { + goto handle_unusual; + } + break; + } + + // int64 element_size_in_bits = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &element_size_in_bits_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.LayoutProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.LayoutProto) + return false; +#undef DO_ +} + +void LayoutProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.LayoutProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 minor_to_major = 1; + if (this->minor_to_major_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _minor_to_major_cached_byte_size_)); + } + for (int i = 0, n = this->minor_to_major_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->minor_to_major(i), output); + } + + // .xla.Format format = 4; + if (this->format() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->format(), output); + } + + // int64 max_sparse_elements = 5; + if (this->max_sparse_elements() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->max_sparse_elements(), output); + } + + // repeated .xla.TileProto tiles = 6; + for (unsigned int i = 0, + n = static_cast(this->tiles_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, + this->tiles(static_cast(i)), + output); + } + + // int64 element_size_in_bits = 7; + if (this->element_size_in_bits() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(7, this->element_size_in_bits(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.LayoutProto) +} + +::google::protobuf::uint8* LayoutProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.LayoutProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 minor_to_major = 1; + if (this->minor_to_major_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _minor_to_major_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->minor_to_major_, target); + } + + // .xla.Format format = 4; + if (this->format() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->format(), target); + } + + // int64 max_sparse_elements = 5; + if (this->max_sparse_elements() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->max_sparse_elements(), target); + } + + // repeated .xla.TileProto tiles = 6; + for (unsigned int i = 0, + n = static_cast(this->tiles_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->tiles(static_cast(i)), deterministic, target); + } + + // int64 element_size_in_bits = 7; + if (this->element_size_in_bits() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(7, this->element_size_in_bits(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.LayoutProto) + return target; +} + +size_t LayoutProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.LayoutProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 minor_to_major = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->minor_to_major_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _minor_to_major_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .xla.TileProto tiles = 6; + { + unsigned int count = static_cast(this->tiles_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tiles(static_cast(i))); + } + } + + // int64 max_sparse_elements = 5; + if (this->max_sparse_elements() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->max_sparse_elements()); + } + + // .xla.Format format = 4; + if (this->format() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->format()); + } + + // int64 element_size_in_bits = 7; + if (this->element_size_in_bits() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->element_size_in_bits()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LayoutProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.LayoutProto) + GOOGLE_DCHECK_NE(&from, this); + const LayoutProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.LayoutProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.LayoutProto) + MergeFrom(*source); + } +} + +void LayoutProto::MergeFrom(const LayoutProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.LayoutProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + minor_to_major_.MergeFrom(from.minor_to_major_); + tiles_.MergeFrom(from.tiles_); + if (from.max_sparse_elements() != 0) { + set_max_sparse_elements(from.max_sparse_elements()); + } + if (from.format() != 0) { + set_format(from.format()); + } + if (from.element_size_in_bits() != 0) { + set_element_size_in_bits(from.element_size_in_bits()); + } +} + +void LayoutProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.LayoutProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LayoutProto::CopyFrom(const LayoutProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.LayoutProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LayoutProto::IsInitialized() const { + return true; +} + +void LayoutProto::Swap(LayoutProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LayoutProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LayoutProto::UnsafeArenaSwap(LayoutProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LayoutProto::InternalSwap(LayoutProto* other) { + using std::swap; + minor_to_major_.InternalSwap(&other->minor_to_major_); + CastToBase(&tiles_)->InternalSwap(CastToBase(&other->tiles_)); + swap(max_sparse_elements_, other->max_sparse_elements_); + swap(format_, other->format_); + swap(element_size_in_bits_, other->element_size_in_bits_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LayoutProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ShapeProto::InitAsDefaultInstance() { + ::xla::_ShapeProto_default_instance_._instance.get_mutable()->layout_ = const_cast< ::xla::LayoutProto*>( + ::xla::LayoutProto::internal_default_instance()); +} +void ShapeProto::unsafe_arena_set_allocated_layout( + ::xla::LayoutProto* layout) { + if (GetArenaNoVirtual() == NULL) { + delete layout_; + } + layout_ = layout; + if (layout) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.ShapeProto.layout) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ShapeProto::kElementTypeFieldNumber; +const int ShapeProto::kDimensionsFieldNumber; +const int ShapeProto::kTupleShapesFieldNumber; +const int ShapeProto::kLayoutFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ShapeProto::ShapeProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ShapeProto) +} +ShapeProto::ShapeProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dimensions_(arena), + tuple_shapes_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ShapeProto) +} +ShapeProto::ShapeProto(const ShapeProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dimensions_(from.dimensions_), + tuple_shapes_(from.tuple_shapes_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_layout()) { + layout_ = new ::xla::LayoutProto(*from.layout_); + } else { + layout_ = NULL; + } + element_type_ = from.element_type_; + // @@protoc_insertion_point(copy_constructor:xla.ShapeProto) +} + +void ShapeProto::SharedCtor() { + ::memset(&layout_, 0, static_cast( + reinterpret_cast(&element_type_) - + reinterpret_cast(&layout_)) + sizeof(element_type_)); +} + +ShapeProto::~ShapeProto() { + // @@protoc_insertion_point(destructor:xla.ShapeProto) + SharedDtor(); +} + +void ShapeProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete layout_; +} + +void ShapeProto::ArenaDtor(void* object) { + ShapeProto* _this = reinterpret_cast< ShapeProto* >(object); + (void)_this; +} +void ShapeProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ShapeProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ShapeProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ShapeProto& ShapeProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ShapeProto.base); + return *internal_default_instance(); +} + + +void ShapeProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dimensions_.Clear(); + tuple_shapes_.Clear(); + if (GetArenaNoVirtual() == NULL && layout_ != NULL) { + delete layout_; + } + layout_ = NULL; + element_type_ = 0; + _internal_metadata_.Clear(); +} + +bool ShapeProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ShapeProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.PrimitiveType element_type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_element_type(static_cast< ::xla::PrimitiveType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 dimensions = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.ShapeProto tuple_shapes = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tuple_shapes())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.LayoutProto layout = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_layout())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ShapeProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ShapeProto) + return false; +#undef DO_ +} + +void ShapeProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.PrimitiveType element_type = 2; + if (this->element_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->element_type(), output); + } + + // repeated int64 dimensions = 3; + if (this->dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->dimensions(i), output); + } + + // repeated .xla.ShapeProto tuple_shapes = 4; + for (unsigned int i = 0, + n = static_cast(this->tuple_shapes_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->tuple_shapes(static_cast(i)), + output); + } + + // .xla.LayoutProto layout = 5; + if (this->has_layout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_layout(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ShapeProto) +} + +::google::protobuf::uint8* ShapeProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.PrimitiveType element_type = 2; + if (this->element_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->element_type(), target); + } + + // repeated int64 dimensions = 3; + if (this->dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->dimensions_, target); + } + + // repeated .xla.ShapeProto tuple_shapes = 4; + for (unsigned int i = 0, + n = static_cast(this->tuple_shapes_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->tuple_shapes(static_cast(i)), deterministic, target); + } + + // .xla.LayoutProto layout = 5; + if (this->has_layout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_layout(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ShapeProto) + return target; +} + +size_t ShapeProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ShapeProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 dimensions = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .xla.ShapeProto tuple_shapes = 4; + { + unsigned int count = static_cast(this->tuple_shapes_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tuple_shapes(static_cast(i))); + } + } + + // .xla.LayoutProto layout = 5; + if (this->has_layout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *layout_); + } + + // .xla.PrimitiveType element_type = 2; + if (this->element_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->element_type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ShapeProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ShapeProto) + GOOGLE_DCHECK_NE(&from, this); + const ShapeProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ShapeProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ShapeProto) + MergeFrom(*source); + } +} + +void ShapeProto::MergeFrom(const ShapeProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ShapeProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dimensions_.MergeFrom(from.dimensions_); + tuple_shapes_.MergeFrom(from.tuple_shapes_); + if (from.has_layout()) { + mutable_layout()->::xla::LayoutProto::MergeFrom(from.layout()); + } + if (from.element_type() != 0) { + set_element_type(from.element_type()); + } +} + +void ShapeProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ShapeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ShapeProto::CopyFrom(const ShapeProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ShapeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ShapeProto::IsInitialized() const { + return true; +} + +void ShapeProto::Swap(ShapeProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ShapeProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ShapeProto::UnsafeArenaSwap(ShapeProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ShapeProto::InternalSwap(ShapeProto* other) { + using std::swap; + dimensions_.InternalSwap(&other->dimensions_); + CastToBase(&tuple_shapes_)->InternalSwap(CastToBase(&other->tuple_shapes_)); + swap(layout_, other->layout_); + swap(element_type_, other->element_type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ShapeProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ProgramShapeProto::InitAsDefaultInstance() { + ::xla::_ProgramShapeProto_default_instance_._instance.get_mutable()->result_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); +} +void ProgramShapeProto::unsafe_arena_set_allocated_result( + ::xla::ShapeProto* result) { + if (GetArenaNoVirtual() == NULL) { + delete result_; + } + result_ = result; + if (result) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.ProgramShapeProto.result) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProgramShapeProto::kParametersFieldNumber; +const int ProgramShapeProto::kResultFieldNumber; +const int ProgramShapeProto::kParameterNamesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProgramShapeProto::ProgramShapeProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ProgramShapeProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ProgramShapeProto) +} +ProgramShapeProto::ProgramShapeProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + parameters_(arena), + parameter_names_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ProgramShapeProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ProgramShapeProto) +} +ProgramShapeProto::ProgramShapeProto(const ProgramShapeProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + parameters_(from.parameters_), + parameter_names_(from.parameter_names_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_result()) { + result_ = new ::xla::ShapeProto(*from.result_); + } else { + result_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.ProgramShapeProto) +} + +void ProgramShapeProto::SharedCtor() { + result_ = NULL; +} + +ProgramShapeProto::~ProgramShapeProto() { + // @@protoc_insertion_point(destructor:xla.ProgramShapeProto) + SharedDtor(); +} + +void ProgramShapeProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete result_; +} + +void ProgramShapeProto::ArenaDtor(void* object) { + ProgramShapeProto* _this = reinterpret_cast< ProgramShapeProto* >(object); + (void)_this; +} +void ProgramShapeProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ProgramShapeProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProgramShapeProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProgramShapeProto& ProgramShapeProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ProgramShapeProto.base); + return *internal_default_instance(); +} + + +void ProgramShapeProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ProgramShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + parameters_.Clear(); + parameter_names_.Clear(); + if (GetArenaNoVirtual() == NULL && result_ != NULL) { + delete result_; + } + result_ = NULL; + _internal_metadata_.Clear(); +} + +bool ProgramShapeProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ProgramShapeProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.ShapeProto parameters = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_parameters())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ShapeProto result = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_result())); + } else { + goto handle_unusual; + } + break; + } + + // repeated string parameter_names = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_parameter_names())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->parameter_names(this->parameter_names_size() - 1).data(), + static_cast(this->parameter_names(this->parameter_names_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.ProgramShapeProto.parameter_names")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ProgramShapeProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ProgramShapeProto) + return false; +#undef DO_ +} + +void ProgramShapeProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ProgramShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.ShapeProto parameters = 1; + for (unsigned int i = 0, + n = static_cast(this->parameters_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->parameters(static_cast(i)), + output); + } + + // .xla.ShapeProto result = 2; + if (this->has_result()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_result(), output); + } + + // repeated string parameter_names = 3; + for (int i = 0, n = this->parameter_names_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->parameter_names(i).data(), static_cast(this->parameter_names(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.ProgramShapeProto.parameter_names"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->parameter_names(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ProgramShapeProto) +} + +::google::protobuf::uint8* ProgramShapeProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ProgramShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.ShapeProto parameters = 1; + for (unsigned int i = 0, + n = static_cast(this->parameters_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->parameters(static_cast(i)), deterministic, target); + } + + // .xla.ShapeProto result = 2; + if (this->has_result()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_result(), deterministic, target); + } + + // repeated string parameter_names = 3; + for (int i = 0, n = this->parameter_names_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->parameter_names(i).data(), static_cast(this->parameter_names(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.ProgramShapeProto.parameter_names"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->parameter_names(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ProgramShapeProto) + return target; +} + +size_t ProgramShapeProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ProgramShapeProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.ShapeProto parameters = 1; + { + unsigned int count = static_cast(this->parameters_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->parameters(static_cast(i))); + } + } + + // repeated string parameter_names = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->parameter_names_size()); + for (int i = 0, n = this->parameter_names_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->parameter_names(i)); + } + + // .xla.ShapeProto result = 2; + if (this->has_result()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *result_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProgramShapeProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ProgramShapeProto) + GOOGLE_DCHECK_NE(&from, this); + const ProgramShapeProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ProgramShapeProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ProgramShapeProto) + MergeFrom(*source); + } +} + +void ProgramShapeProto::MergeFrom(const ProgramShapeProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ProgramShapeProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + parameters_.MergeFrom(from.parameters_); + parameter_names_.MergeFrom(from.parameter_names_); + if (from.has_result()) { + mutable_result()->::xla::ShapeProto::MergeFrom(from.result()); + } +} + +void ProgramShapeProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ProgramShapeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProgramShapeProto::CopyFrom(const ProgramShapeProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ProgramShapeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProgramShapeProto::IsInitialized() const { + return true; +} + +void ProgramShapeProto::Swap(ProgramShapeProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ProgramShapeProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ProgramShapeProto::UnsafeArenaSwap(ProgramShapeProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ProgramShapeProto::InternalSwap(ProgramShapeProto* other) { + using std::swap; + CastToBase(¶meters_)->InternalSwap(CastToBase(&other->parameters_)); + parameter_names_.InternalSwap(CastToBase(&other->parameter_names_)); + swap(result_, other->result_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProgramShapeProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ComputationStats::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ComputationStats::kFlopCountFieldNumber; +const int ComputationStats::kTranscendentalCountFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ComputationStats::ComputationStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ComputationStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ComputationStats) +} +ComputationStats::ComputationStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ComputationStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ComputationStats) +} +ComputationStats::ComputationStats(const ComputationStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&flop_count_, &from.flop_count_, + static_cast(reinterpret_cast(&transcendental_count_) - + reinterpret_cast(&flop_count_)) + sizeof(transcendental_count_)); + // @@protoc_insertion_point(copy_constructor:xla.ComputationStats) +} + +void ComputationStats::SharedCtor() { + ::memset(&flop_count_, 0, static_cast( + reinterpret_cast(&transcendental_count_) - + reinterpret_cast(&flop_count_)) + sizeof(transcendental_count_)); +} + +ComputationStats::~ComputationStats() { + // @@protoc_insertion_point(destructor:xla.ComputationStats) + SharedDtor(); +} + +void ComputationStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ComputationStats::ArenaDtor(void* object) { + ComputationStats* _this = reinterpret_cast< ComputationStats* >(object); + (void)_this; +} +void ComputationStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ComputationStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ComputationStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ComputationStats& ComputationStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ComputationStats.base); + return *internal_default_instance(); +} + + +void ComputationStats::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ComputationStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&flop_count_, 0, static_cast( + reinterpret_cast(&transcendental_count_) - + reinterpret_cast(&flop_count_)) + sizeof(transcendental_count_)); + _internal_metadata_.Clear(); +} + +bool ComputationStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ComputationStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // double flop_count = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &flop_count_))); + } else { + goto handle_unusual; + } + break; + } + + // double transcendental_count = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &transcendental_count_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ComputationStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ComputationStats) + return false; +#undef DO_ +} + +void ComputationStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ComputationStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double flop_count = 1; + if (this->flop_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->flop_count(), output); + } + + // double transcendental_count = 2; + if (this->transcendental_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->transcendental_count(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ComputationStats) +} + +::google::protobuf::uint8* ComputationStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ComputationStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double flop_count = 1; + if (this->flop_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->flop_count(), target); + } + + // double transcendental_count = 2; + if (this->transcendental_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->transcendental_count(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ComputationStats) + return target; +} + +size_t ComputationStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ComputationStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // double flop_count = 1; + if (this->flop_count() != 0) { + total_size += 1 + 8; + } + + // double transcendental_count = 2; + if (this->transcendental_count() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ComputationStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ComputationStats) + GOOGLE_DCHECK_NE(&from, this); + const ComputationStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ComputationStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ComputationStats) + MergeFrom(*source); + } +} + +void ComputationStats::MergeFrom(const ComputationStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ComputationStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.flop_count() != 0) { + set_flop_count(from.flop_count()); + } + if (from.transcendental_count() != 0) { + set_transcendental_count(from.transcendental_count()); + } +} + +void ComputationStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ComputationStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ComputationStats::CopyFrom(const ComputationStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ComputationStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ComputationStats::IsInitialized() const { + return true; +} + +void ComputationStats::Swap(ComputationStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ComputationStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ComputationStats::UnsafeArenaSwap(ComputationStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ComputationStats::InternalSwap(ComputationStats* other) { + using std::swap; + swap(flop_count_, other->flop_count_); + swap(transcendental_count_, other->transcendental_count_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ComputationStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpMetadata::kOpTypeFieldNumber; +const int OpMetadata::kOpNameFieldNumber; +const int OpMetadata::kSourceFileFieldNumber; +const int OpMetadata::kSourceLineFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpMetadata::OpMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.OpMetadata) +} +OpMetadata::OpMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.OpMetadata) +} +OpMetadata::OpMetadata(const OpMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + op_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.op_type().size() > 0) { + op_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op_type(), + GetArenaNoVirtual()); + } + op_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.op_name().size() > 0) { + op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op_name(), + GetArenaNoVirtual()); + } + source_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.source_file().size() > 0) { + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_file(), + GetArenaNoVirtual()); + } + source_line_ = from.source_line_; + // @@protoc_insertion_point(copy_constructor:xla.OpMetadata) +} + +void OpMetadata::SharedCtor() { + op_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + op_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_line_ = 0; +} + +OpMetadata::~OpMetadata() { + // @@protoc_insertion_point(destructor:xla.OpMetadata) + SharedDtor(); +} + +void OpMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + op_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + op_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void OpMetadata::ArenaDtor(void* object) { + OpMetadata* _this = reinterpret_cast< OpMetadata* >(object); + (void)_this; +} +void OpMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpMetadata& OpMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpMetadata.base); + return *internal_default_instance(); +} + + +void OpMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.OpMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + op_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + op_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + source_file_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + source_line_ = 0; + _internal_metadata_.Clear(); +} + +bool OpMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.OpMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string op_type = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op_type().data(), static_cast(this->op_type().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.OpMetadata.op_type")); + } else { + goto handle_unusual; + } + break; + } + + // string op_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op_name().data(), static_cast(this->op_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.OpMetadata.op_name")); + } else { + goto handle_unusual; + } + break; + } + + // string source_file = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source_file())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->source_file().data(), static_cast(this->source_file().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xla.OpMetadata.source_file")); + } else { + goto handle_unusual; + } + break; + } + + // int32 source_line = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &source_line_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.OpMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.OpMetadata) + return false; +#undef DO_ +} + +void OpMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.OpMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op_type = 1; + if (this->op_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op_type().data(), static_cast(this->op_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.OpMetadata.op_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->op_type(), output); + } + + // string op_name = 2; + if (this->op_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op_name().data(), static_cast(this->op_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.OpMetadata.op_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->op_name(), output); + } + + // string source_file = 3; + if (this->source_file().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->source_file().data(), static_cast(this->source_file().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.OpMetadata.source_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->source_file(), output); + } + + // int32 source_line = 4; + if (this->source_line() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->source_line(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.OpMetadata) +} + +::google::protobuf::uint8* OpMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.OpMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op_type = 1; + if (this->op_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op_type().data(), static_cast(this->op_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.OpMetadata.op_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->op_type(), target); + } + + // string op_name = 2; + if (this->op_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op_name().data(), static_cast(this->op_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.OpMetadata.op_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->op_name(), target); + } + + // string source_file = 3; + if (this->source_file().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->source_file().data(), static_cast(this->source_file().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xla.OpMetadata.source_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->source_file(), target); + } + + // int32 source_line = 4; + if (this->source_line() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->source_line(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.OpMetadata) + return target; +} + +size_t OpMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.OpMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string op_type = 1; + if (this->op_type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op_type()); + } + + // string op_name = 2; + if (this->op_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op_name()); + } + + // string source_file = 3; + if (this->source_file().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source_file()); + } + + // int32 source_line = 4; + if (this->source_line() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->source_line()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.OpMetadata) + GOOGLE_DCHECK_NE(&from, this); + const OpMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.OpMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.OpMetadata) + MergeFrom(*source); + } +} + +void OpMetadata::MergeFrom(const OpMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.OpMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.op_type().size() > 0) { + set_op_type(from.op_type()); + } + if (from.op_name().size() > 0) { + set_op_name(from.op_name()); + } + if (from.source_file().size() > 0) { + set_source_file(from.source_file()); + } + if (from.source_line() != 0) { + set_source_line(from.source_line()); + } +} + +void OpMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.OpMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpMetadata::CopyFrom(const OpMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.OpMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpMetadata::IsInitialized() const { + return true; +} + +void OpMetadata::Swap(OpMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpMetadata::UnsafeArenaSwap(OpMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpMetadata::InternalSwap(OpMetadata* other) { + using std::swap; + op_type_.Swap(&other->op_type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + op_name_.Swap(&other->op_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + source_file_.Swap(&other->source_file_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(source_line_, other->source_line_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecutionProfile::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecutionProfile::kCompilationCacheHitFieldNumber; +const int ExecutionProfile::kCompileTimeMsFieldNumber; +const int ExecutionProfile::kComputeCycleCountFieldNumber; +const int ExecutionProfile::kComputeTimeNsFieldNumber; +const int ExecutionProfile::kComputeAndTransferTimeNsFieldNumber; +const int ExecutionProfile::kExecutableSizeInBytesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecutionProfile::ExecutionProfile() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionProfile.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecutionProfile) +} +ExecutionProfile::ExecutionProfile(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionProfile.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ExecutionProfile) +} +ExecutionProfile::ExecutionProfile(const ExecutionProfile& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&compile_time_ms_, &from.compile_time_ms_, + static_cast(reinterpret_cast(&compilation_cache_hit_) - + reinterpret_cast(&compile_time_ms_)) + sizeof(compilation_cache_hit_)); + // @@protoc_insertion_point(copy_constructor:xla.ExecutionProfile) +} + +void ExecutionProfile::SharedCtor() { + ::memset(&compile_time_ms_, 0, static_cast( + reinterpret_cast(&compilation_cache_hit_) - + reinterpret_cast(&compile_time_ms_)) + sizeof(compilation_cache_hit_)); +} + +ExecutionProfile::~ExecutionProfile() { + // @@protoc_insertion_point(destructor:xla.ExecutionProfile) + SharedDtor(); +} + +void ExecutionProfile::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ExecutionProfile::ArenaDtor(void* object) { + ExecutionProfile* _this = reinterpret_cast< ExecutionProfile* >(object); + (void)_this; +} +void ExecutionProfile::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ExecutionProfile::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecutionProfile::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecutionProfile& ExecutionProfile::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionProfile.base); + return *internal_default_instance(); +} + + +void ExecutionProfile::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecutionProfile) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&compile_time_ms_, 0, static_cast( + reinterpret_cast(&compilation_cache_hit_) - + reinterpret_cast(&compile_time_ms_)) + sizeof(compilation_cache_hit_)); + _internal_metadata_.Clear(); +} + +bool ExecutionProfile::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecutionProfile) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // bool compilation_cache_hit = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &compilation_cache_hit_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compile_time_ms = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compile_time_ms_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compute_cycle_count = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compute_cycle_count_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compute_time_ns = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compute_time_ns_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compute_and_transfer_time_ns = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compute_and_transfer_time_ns_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 executable_size_in_bytes = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &executable_size_in_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecutionProfile) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecutionProfile) + return false; +#undef DO_ +} + +void ExecutionProfile::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecutionProfile) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool compilation_cache_hit = 1; + if (this->compilation_cache_hit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->compilation_cache_hit(), output); + } + + // int64 compile_time_ms = 2; + if (this->compile_time_ms() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->compile_time_ms(), output); + } + + // int64 compute_cycle_count = 3; + if (this->compute_cycle_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->compute_cycle_count(), output); + } + + // int64 compute_time_ns = 4; + if (this->compute_time_ns() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->compute_time_ns(), output); + } + + // int64 compute_and_transfer_time_ns = 5; + if (this->compute_and_transfer_time_ns() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->compute_and_transfer_time_ns(), output); + } + + // int64 executable_size_in_bytes = 6; + if (this->executable_size_in_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->executable_size_in_bytes(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecutionProfile) +} + +::google::protobuf::uint8* ExecutionProfile::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecutionProfile) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool compilation_cache_hit = 1; + if (this->compilation_cache_hit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->compilation_cache_hit(), target); + } + + // int64 compile_time_ms = 2; + if (this->compile_time_ms() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->compile_time_ms(), target); + } + + // int64 compute_cycle_count = 3; + if (this->compute_cycle_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->compute_cycle_count(), target); + } + + // int64 compute_time_ns = 4; + if (this->compute_time_ns() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->compute_time_ns(), target); + } + + // int64 compute_and_transfer_time_ns = 5; + if (this->compute_and_transfer_time_ns() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->compute_and_transfer_time_ns(), target); + } + + // int64 executable_size_in_bytes = 6; + if (this->executable_size_in_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->executable_size_in_bytes(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecutionProfile) + return target; +} + +size_t ExecutionProfile::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecutionProfile) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 compile_time_ms = 2; + if (this->compile_time_ms() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compile_time_ms()); + } + + // int64 compute_cycle_count = 3; + if (this->compute_cycle_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compute_cycle_count()); + } + + // int64 compute_time_ns = 4; + if (this->compute_time_ns() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compute_time_ns()); + } + + // int64 compute_and_transfer_time_ns = 5; + if (this->compute_and_transfer_time_ns() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compute_and_transfer_time_ns()); + } + + // int64 executable_size_in_bytes = 6; + if (this->executable_size_in_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->executable_size_in_bytes()); + } + + // bool compilation_cache_hit = 1; + if (this->compilation_cache_hit() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecutionProfile::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecutionProfile) + GOOGLE_DCHECK_NE(&from, this); + const ExecutionProfile* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecutionProfile) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecutionProfile) + MergeFrom(*source); + } +} + +void ExecutionProfile::MergeFrom(const ExecutionProfile& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecutionProfile) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.compile_time_ms() != 0) { + set_compile_time_ms(from.compile_time_ms()); + } + if (from.compute_cycle_count() != 0) { + set_compute_cycle_count(from.compute_cycle_count()); + } + if (from.compute_time_ns() != 0) { + set_compute_time_ns(from.compute_time_ns()); + } + if (from.compute_and_transfer_time_ns() != 0) { + set_compute_and_transfer_time_ns(from.compute_and_transfer_time_ns()); + } + if (from.executable_size_in_bytes() != 0) { + set_executable_size_in_bytes(from.executable_size_in_bytes()); + } + if (from.compilation_cache_hit() != 0) { + set_compilation_cache_hit(from.compilation_cache_hit()); + } +} + +void ExecutionProfile::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecutionProfile) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecutionProfile::CopyFrom(const ExecutionProfile& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecutionProfile) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecutionProfile::IsInitialized() const { + return true; +} + +void ExecutionProfile::Swap(ExecutionProfile* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ExecutionProfile* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ExecutionProfile::UnsafeArenaSwap(ExecutionProfile* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ExecutionProfile::InternalSwap(ExecutionProfile* other) { + using std::swap; + swap(compile_time_ms_, other->compile_time_ms_); + swap(compute_cycle_count_, other->compute_cycle_count_); + swap(compute_time_ns_, other->compute_time_ns_); + swap(compute_and_transfer_time_ns_, other->compute_and_transfer_time_ns_); + swap(executable_size_in_bytes_, other->executable_size_in_bytes_); + swap(compilation_cache_hit_, other->compilation_cache_hit_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecutionProfile::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExecutionHandle::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExecutionHandle::kHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExecutionHandle::ExecutionHandle() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionHandle.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ExecutionHandle) +} +ExecutionHandle::ExecutionHandle(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionHandle.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ExecutionHandle) +} +ExecutionHandle::ExecutionHandle(const ExecutionHandle& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + handle_ = from.handle_; + // @@protoc_insertion_point(copy_constructor:xla.ExecutionHandle) +} + +void ExecutionHandle::SharedCtor() { + handle_ = GOOGLE_LONGLONG(0); +} + +ExecutionHandle::~ExecutionHandle() { + // @@protoc_insertion_point(destructor:xla.ExecutionHandle) + SharedDtor(); +} + +void ExecutionHandle::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ExecutionHandle::ArenaDtor(void* object) { + ExecutionHandle* _this = reinterpret_cast< ExecutionHandle* >(object); + (void)_this; +} +void ExecutionHandle::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ExecutionHandle::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExecutionHandle::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExecutionHandle& ExecutionHandle::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ExecutionHandle.base); + return *internal_default_instance(); +} + + +void ExecutionHandle::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ExecutionHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + handle_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool ExecutionHandle::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ExecutionHandle) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 handle = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &handle_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ExecutionHandle) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ExecutionHandle) + return false; +#undef DO_ +} + +void ExecutionHandle::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ExecutionHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ExecutionHandle) +} + +::google::protobuf::uint8* ExecutionHandle::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ExecutionHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->handle(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ExecutionHandle) + return target; +} + +size_t ExecutionHandle::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ExecutionHandle) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 handle = 1; + if (this->handle() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->handle()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExecutionHandle::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ExecutionHandle) + GOOGLE_DCHECK_NE(&from, this); + const ExecutionHandle* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ExecutionHandle) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ExecutionHandle) + MergeFrom(*source); + } +} + +void ExecutionHandle::MergeFrom(const ExecutionHandle& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ExecutionHandle) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.handle() != 0) { + set_handle(from.handle()); + } +} + +void ExecutionHandle::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ExecutionHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExecutionHandle::CopyFrom(const ExecutionHandle& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ExecutionHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExecutionHandle::IsInitialized() const { + return true; +} + +void ExecutionHandle::Swap(ExecutionHandle* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ExecutionHandle* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ExecutionHandle::UnsafeArenaSwap(ExecutionHandle* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ExecutionHandle::InternalSwap(ExecutionHandle* other) { + using std::swap; + swap(handle_, other->handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExecutionHandle::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GlobalDataHandle::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GlobalDataHandle::kHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GlobalDataHandle::GlobalDataHandle() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.GlobalDataHandle) +} +GlobalDataHandle::GlobalDataHandle(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.GlobalDataHandle) +} +GlobalDataHandle::GlobalDataHandle(const GlobalDataHandle& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + handle_ = from.handle_; + // @@protoc_insertion_point(copy_constructor:xla.GlobalDataHandle) +} + +void GlobalDataHandle::SharedCtor() { + handle_ = GOOGLE_LONGLONG(0); +} + +GlobalDataHandle::~GlobalDataHandle() { + // @@protoc_insertion_point(destructor:xla.GlobalDataHandle) + SharedDtor(); +} + +void GlobalDataHandle::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GlobalDataHandle::ArenaDtor(void* object) { + GlobalDataHandle* _this = reinterpret_cast< GlobalDataHandle* >(object); + (void)_this; +} +void GlobalDataHandle::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GlobalDataHandle::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GlobalDataHandle::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GlobalDataHandle& GlobalDataHandle::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GlobalDataHandle.base); + return *internal_default_instance(); +} + + +void GlobalDataHandle::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.GlobalDataHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + handle_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool GlobalDataHandle::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.GlobalDataHandle) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 handle = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &handle_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.GlobalDataHandle) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.GlobalDataHandle) + return false; +#undef DO_ +} + +void GlobalDataHandle::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.GlobalDataHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.GlobalDataHandle) +} + +::google::protobuf::uint8* GlobalDataHandle::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.GlobalDataHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->handle(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.GlobalDataHandle) + return target; +} + +size_t GlobalDataHandle::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.GlobalDataHandle) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 handle = 1; + if (this->handle() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->handle()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GlobalDataHandle::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.GlobalDataHandle) + GOOGLE_DCHECK_NE(&from, this); + const GlobalDataHandle* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.GlobalDataHandle) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.GlobalDataHandle) + MergeFrom(*source); + } +} + +void GlobalDataHandle::MergeFrom(const GlobalDataHandle& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.GlobalDataHandle) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.handle() != 0) { + set_handle(from.handle()); + } +} + +void GlobalDataHandle::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.GlobalDataHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GlobalDataHandle::CopyFrom(const GlobalDataHandle& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.GlobalDataHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GlobalDataHandle::IsInitialized() const { + return true; +} + +void GlobalDataHandle::Swap(GlobalDataHandle* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GlobalDataHandle* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GlobalDataHandle::UnsafeArenaSwap(GlobalDataHandle* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GlobalDataHandle::InternalSwap(GlobalDataHandle* other) { + using std::swap; + swap(handle_, other->handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GlobalDataHandle::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceHandle::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceHandle::kHandleFieldNumber; +const int DeviceHandle::kDeviceCountFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceHandle::DeviceHandle() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DeviceHandle) +} +DeviceHandle::DeviceHandle(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.DeviceHandle) +} +DeviceHandle::DeviceHandle(const DeviceHandle& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&handle_, &from.handle_, + static_cast(reinterpret_cast(&device_count_) - + reinterpret_cast(&handle_)) + sizeof(device_count_)); + // @@protoc_insertion_point(copy_constructor:xla.DeviceHandle) +} + +void DeviceHandle::SharedCtor() { + ::memset(&handle_, 0, static_cast( + reinterpret_cast(&device_count_) - + reinterpret_cast(&handle_)) + sizeof(device_count_)); +} + +DeviceHandle::~DeviceHandle() { + // @@protoc_insertion_point(destructor:xla.DeviceHandle) + SharedDtor(); +} + +void DeviceHandle::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DeviceHandle::ArenaDtor(void* object) { + DeviceHandle* _this = reinterpret_cast< DeviceHandle* >(object); + (void)_this; +} +void DeviceHandle::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DeviceHandle::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceHandle::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceHandle& DeviceHandle::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceHandle.base); + return *internal_default_instance(); +} + + +void DeviceHandle::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DeviceHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&handle_, 0, static_cast( + reinterpret_cast(&device_count_) - + reinterpret_cast(&handle_)) + sizeof(device_count_)); + _internal_metadata_.Clear(); +} + +bool DeviceHandle::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DeviceHandle) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 handle = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &handle_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 device_count = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_count_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DeviceHandle) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DeviceHandle) + return false; +#undef DO_ +} + +void DeviceHandle::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DeviceHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->handle(), output); + } + + // int64 device_count = 2; + if (this->device_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->device_count(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DeviceHandle) +} + +::google::protobuf::uint8* DeviceHandle::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DeviceHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->handle(), target); + } + + // int64 device_count = 2; + if (this->device_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->device_count(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DeviceHandle) + return target; +} + +size_t DeviceHandle::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DeviceHandle) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 handle = 1; + if (this->handle() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->handle()); + } + + // int64 device_count = 2; + if (this->device_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_count()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceHandle::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DeviceHandle) + GOOGLE_DCHECK_NE(&from, this); + const DeviceHandle* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DeviceHandle) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DeviceHandle) + MergeFrom(*source); + } +} + +void DeviceHandle::MergeFrom(const DeviceHandle& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DeviceHandle) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.handle() != 0) { + set_handle(from.handle()); + } + if (from.device_count() != 0) { + set_device_count(from.device_count()); + } +} + +void DeviceHandle::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DeviceHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceHandle::CopyFrom(const DeviceHandle& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DeviceHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceHandle::IsInitialized() const { + return true; +} + +void DeviceHandle::Swap(DeviceHandle* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DeviceHandle* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DeviceHandle::UnsafeArenaSwap(DeviceHandle* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DeviceHandle::InternalSwap(DeviceHandle* other) { + using std::swap; + swap(handle_, other->handle_); + swap(device_count_, other->device_count_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceHandle::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ChannelHandle::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ChannelHandle::kHandleFieldNumber; +const int ChannelHandle::kTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ChannelHandle::ChannelHandle() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ChannelHandle.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ChannelHandle) +} +ChannelHandle::ChannelHandle(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ChannelHandle.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ChannelHandle) +} +ChannelHandle::ChannelHandle(const ChannelHandle& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&handle_, &from.handle_, + static_cast(reinterpret_cast(&type_) - + reinterpret_cast(&handle_)) + sizeof(type_)); + // @@protoc_insertion_point(copy_constructor:xla.ChannelHandle) +} + +void ChannelHandle::SharedCtor() { + ::memset(&handle_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&handle_)) + sizeof(type_)); +} + +ChannelHandle::~ChannelHandle() { + // @@protoc_insertion_point(destructor:xla.ChannelHandle) + SharedDtor(); +} + +void ChannelHandle::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ChannelHandle::ArenaDtor(void* object) { + ChannelHandle* _this = reinterpret_cast< ChannelHandle* >(object); + (void)_this; +} +void ChannelHandle::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ChannelHandle::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ChannelHandle::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ChannelHandle& ChannelHandle::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ChannelHandle.base); + return *internal_default_instance(); +} + + +void ChannelHandle::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ChannelHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&handle_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&handle_)) + sizeof(type_)); + _internal_metadata_.Clear(); +} + +bool ChannelHandle::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ChannelHandle) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 handle = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &handle_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ChannelHandle.ChannelType type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::xla::ChannelHandle_ChannelType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ChannelHandle) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ChannelHandle) + return false; +#undef DO_ +} + +void ChannelHandle::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ChannelHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->handle(), output); + } + + // .xla.ChannelHandle.ChannelType type = 2; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ChannelHandle) +} + +::google::protobuf::uint8* ChannelHandle::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ChannelHandle) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 handle = 1; + if (this->handle() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->handle(), target); + } + + // .xla.ChannelHandle.ChannelType type = 2; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->type(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ChannelHandle) + return target; +} + +size_t ChannelHandle::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ChannelHandle) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 handle = 1; + if (this->handle() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->handle()); + } + + // .xla.ChannelHandle.ChannelType type = 2; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ChannelHandle::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ChannelHandle) + GOOGLE_DCHECK_NE(&from, this); + const ChannelHandle* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ChannelHandle) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ChannelHandle) + MergeFrom(*source); + } +} + +void ChannelHandle::MergeFrom(const ChannelHandle& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ChannelHandle) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.handle() != 0) { + set_handle(from.handle()); + } + if (from.type() != 0) { + set_type(from.type()); + } +} + +void ChannelHandle::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ChannelHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ChannelHandle::CopyFrom(const ChannelHandle& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ChannelHandle) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ChannelHandle::IsInitialized() const { + return true; +} + +void ChannelHandle::Swap(ChannelHandle* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ChannelHandle* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ChannelHandle::UnsafeArenaSwap(ChannelHandle* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ChannelHandle::InternalSwap(ChannelHandle* other) { + using std::swap; + swap(handle_, other->handle_); + swap(type_, other->type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ChannelHandle::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceAssignmentProto_ComputationDevice::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceAssignmentProto_ComputationDevice::kReplicaDeviceIdsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceAssignmentProto_ComputationDevice::DeviceAssignmentProto_ComputationDevice() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceAssignmentProto_ComputationDevice.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DeviceAssignmentProto.ComputationDevice) +} +DeviceAssignmentProto_ComputationDevice::DeviceAssignmentProto_ComputationDevice(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + replica_device_ids_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceAssignmentProto_ComputationDevice.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.DeviceAssignmentProto.ComputationDevice) +} +DeviceAssignmentProto_ComputationDevice::DeviceAssignmentProto_ComputationDevice(const DeviceAssignmentProto_ComputationDevice& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + replica_device_ids_(from.replica_device_ids_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.DeviceAssignmentProto.ComputationDevice) +} + +void DeviceAssignmentProto_ComputationDevice::SharedCtor() { +} + +DeviceAssignmentProto_ComputationDevice::~DeviceAssignmentProto_ComputationDevice() { + // @@protoc_insertion_point(destructor:xla.DeviceAssignmentProto.ComputationDevice) + SharedDtor(); +} + +void DeviceAssignmentProto_ComputationDevice::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DeviceAssignmentProto_ComputationDevice::ArenaDtor(void* object) { + DeviceAssignmentProto_ComputationDevice* _this = reinterpret_cast< DeviceAssignmentProto_ComputationDevice* >(object); + (void)_this; +} +void DeviceAssignmentProto_ComputationDevice::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DeviceAssignmentProto_ComputationDevice::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceAssignmentProto_ComputationDevice::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceAssignmentProto_ComputationDevice& DeviceAssignmentProto_ComputationDevice::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceAssignmentProto_ComputationDevice.base); + return *internal_default_instance(); +} + + +void DeviceAssignmentProto_ComputationDevice::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DeviceAssignmentProto.ComputationDevice) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + replica_device_ids_.Clear(); + _internal_metadata_.Clear(); +} + +bool DeviceAssignmentProto_ComputationDevice::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DeviceAssignmentProto.ComputationDevice) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 replica_device_ids = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_replica_device_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10u, input, this->mutable_replica_device_ids()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DeviceAssignmentProto.ComputationDevice) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DeviceAssignmentProto.ComputationDevice) + return false; +#undef DO_ +} + +void DeviceAssignmentProto_ComputationDevice::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DeviceAssignmentProto.ComputationDevice) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 replica_device_ids = 1; + if (this->replica_device_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _replica_device_ids_cached_byte_size_)); + } + for (int i = 0, n = this->replica_device_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->replica_device_ids(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DeviceAssignmentProto.ComputationDevice) +} + +::google::protobuf::uint8* DeviceAssignmentProto_ComputationDevice::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DeviceAssignmentProto.ComputationDevice) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 replica_device_ids = 1; + if (this->replica_device_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _replica_device_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->replica_device_ids_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DeviceAssignmentProto.ComputationDevice) + return target; +} + +size_t DeviceAssignmentProto_ComputationDevice::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DeviceAssignmentProto.ComputationDevice) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 replica_device_ids = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->replica_device_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _replica_device_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceAssignmentProto_ComputationDevice::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DeviceAssignmentProto.ComputationDevice) + GOOGLE_DCHECK_NE(&from, this); + const DeviceAssignmentProto_ComputationDevice* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DeviceAssignmentProto.ComputationDevice) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DeviceAssignmentProto.ComputationDevice) + MergeFrom(*source); + } +} + +void DeviceAssignmentProto_ComputationDevice::MergeFrom(const DeviceAssignmentProto_ComputationDevice& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DeviceAssignmentProto.ComputationDevice) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + replica_device_ids_.MergeFrom(from.replica_device_ids_); +} + +void DeviceAssignmentProto_ComputationDevice::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DeviceAssignmentProto.ComputationDevice) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceAssignmentProto_ComputationDevice::CopyFrom(const DeviceAssignmentProto_ComputationDevice& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DeviceAssignmentProto.ComputationDevice) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceAssignmentProto_ComputationDevice::IsInitialized() const { + return true; +} + +void DeviceAssignmentProto_ComputationDevice::Swap(DeviceAssignmentProto_ComputationDevice* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DeviceAssignmentProto_ComputationDevice* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DeviceAssignmentProto_ComputationDevice::UnsafeArenaSwap(DeviceAssignmentProto_ComputationDevice* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DeviceAssignmentProto_ComputationDevice::InternalSwap(DeviceAssignmentProto_ComputationDevice* other) { + using std::swap; + replica_device_ids_.InternalSwap(&other->replica_device_ids_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceAssignmentProto_ComputationDevice::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceAssignmentProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceAssignmentProto::kReplicaCountFieldNumber; +const int DeviceAssignmentProto::kComputationCountFieldNumber; +const int DeviceAssignmentProto::kComputationDevicesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceAssignmentProto::DeviceAssignmentProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceAssignmentProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DeviceAssignmentProto) +} +DeviceAssignmentProto::DeviceAssignmentProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + computation_devices_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceAssignmentProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.DeviceAssignmentProto) +} +DeviceAssignmentProto::DeviceAssignmentProto(const DeviceAssignmentProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + computation_devices_(from.computation_devices_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&replica_count_, &from.replica_count_, + static_cast(reinterpret_cast(&computation_count_) - + reinterpret_cast(&replica_count_)) + sizeof(computation_count_)); + // @@protoc_insertion_point(copy_constructor:xla.DeviceAssignmentProto) +} + +void DeviceAssignmentProto::SharedCtor() { + ::memset(&replica_count_, 0, static_cast( + reinterpret_cast(&computation_count_) - + reinterpret_cast(&replica_count_)) + sizeof(computation_count_)); +} + +DeviceAssignmentProto::~DeviceAssignmentProto() { + // @@protoc_insertion_point(destructor:xla.DeviceAssignmentProto) + SharedDtor(); +} + +void DeviceAssignmentProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DeviceAssignmentProto::ArenaDtor(void* object) { + DeviceAssignmentProto* _this = reinterpret_cast< DeviceAssignmentProto* >(object); + (void)_this; +} +void DeviceAssignmentProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DeviceAssignmentProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceAssignmentProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceAssignmentProto& DeviceAssignmentProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DeviceAssignmentProto.base); + return *internal_default_instance(); +} + + +void DeviceAssignmentProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DeviceAssignmentProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + computation_devices_.Clear(); + ::memset(&replica_count_, 0, static_cast( + reinterpret_cast(&computation_count_) - + reinterpret_cast(&replica_count_)) + sizeof(computation_count_)); + _internal_metadata_.Clear(); +} + +bool DeviceAssignmentProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DeviceAssignmentProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 replica_count = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &replica_count_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 computation_count = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &computation_count_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.DeviceAssignmentProto.ComputationDevice computation_devices = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_computation_devices())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DeviceAssignmentProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DeviceAssignmentProto) + return false; +#undef DO_ +} + +void DeviceAssignmentProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DeviceAssignmentProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replica_count = 1; + if (this->replica_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->replica_count(), output); + } + + // int32 computation_count = 2; + if (this->computation_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->computation_count(), output); + } + + // repeated .xla.DeviceAssignmentProto.ComputationDevice computation_devices = 3; + for (unsigned int i = 0, + n = static_cast(this->computation_devices_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->computation_devices(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DeviceAssignmentProto) +} + +::google::protobuf::uint8* DeviceAssignmentProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DeviceAssignmentProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 replica_count = 1; + if (this->replica_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->replica_count(), target); + } + + // int32 computation_count = 2; + if (this->computation_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->computation_count(), target); + } + + // repeated .xla.DeviceAssignmentProto.ComputationDevice computation_devices = 3; + for (unsigned int i = 0, + n = static_cast(this->computation_devices_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->computation_devices(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DeviceAssignmentProto) + return target; +} + +size_t DeviceAssignmentProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DeviceAssignmentProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.DeviceAssignmentProto.ComputationDevice computation_devices = 3; + { + unsigned int count = static_cast(this->computation_devices_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->computation_devices(static_cast(i))); + } + } + + // int32 replica_count = 1; + if (this->replica_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->replica_count()); + } + + // int32 computation_count = 2; + if (this->computation_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->computation_count()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceAssignmentProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DeviceAssignmentProto) + GOOGLE_DCHECK_NE(&from, this); + const DeviceAssignmentProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DeviceAssignmentProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DeviceAssignmentProto) + MergeFrom(*source); + } +} + +void DeviceAssignmentProto::MergeFrom(const DeviceAssignmentProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DeviceAssignmentProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + computation_devices_.MergeFrom(from.computation_devices_); + if (from.replica_count() != 0) { + set_replica_count(from.replica_count()); + } + if (from.computation_count() != 0) { + set_computation_count(from.computation_count()); + } +} + +void DeviceAssignmentProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DeviceAssignmentProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceAssignmentProto::CopyFrom(const DeviceAssignmentProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DeviceAssignmentProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceAssignmentProto::IsInitialized() const { + return true; +} + +void DeviceAssignmentProto::Swap(DeviceAssignmentProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DeviceAssignmentProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DeviceAssignmentProto::UnsafeArenaSwap(DeviceAssignmentProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DeviceAssignmentProto::InternalSwap(DeviceAssignmentProto* other) { + using std::swap; + CastToBase(&computation_devices_)->InternalSwap(CastToBase(&other->computation_devices_)); + swap(replica_count_, other->replica_count_); + swap(computation_count_, other->computation_count_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceAssignmentProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LiteralProto::InitAsDefaultInstance() { + ::xla::_LiteralProto_default_instance_._instance.get_mutable()->shape_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); +} +void LiteralProto::unsafe_arena_set_allocated_shape( + ::xla::ShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LiteralProto.shape) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LiteralProto::kShapeFieldNumber; +const int LiteralProto::kPredsFieldNumber; +const int LiteralProto::kS8SFieldNumber; +const int LiteralProto::kU8SFieldNumber; +const int LiteralProto::kS32SFieldNumber; +const int LiteralProto::kS64SFieldNumber; +const int LiteralProto::kU32SFieldNumber; +const int LiteralProto::kU64SFieldNumber; +const int LiteralProto::kF32SFieldNumber; +const int LiteralProto::kF64SFieldNumber; +const int LiteralProto::kC64SFieldNumber; +const int LiteralProto::kTupleLiteralsFieldNumber; +const int LiteralProto::kF16SFieldNumber; +const int LiteralProto::kBf16SFieldNumber; +const int LiteralProto::kU16SFieldNumber; +const int LiteralProto::kS16SFieldNumber; +const int LiteralProto::kSparseIndicesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LiteralProto::LiteralProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.LiteralProto) +} +LiteralProto::LiteralProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + preds_(arena), + s32s_(arena), + s64s_(arena), + u32s_(arena), + u64s_(arena), + f32s_(arena), + f64s_(arena), + tuple_literals_(arena), + c64s_(arena), + sparse_indices_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.LiteralProto) +} +LiteralProto::LiteralProto(const LiteralProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + preds_(from.preds_), + s32s_(from.s32s_), + s64s_(from.s64s_), + u32s_(from.u32s_), + u64s_(from.u64s_), + f32s_(from.f32s_), + f64s_(from.f64s_), + tuple_literals_(from.tuple_literals_), + c64s_(from.c64s_), + sparse_indices_(from.sparse_indices_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + u8s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.u8s().size() > 0) { + u8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.u8s(), + GetArenaNoVirtual()); + } + f16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.f16s().size() > 0) { + f16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.f16s(), + GetArenaNoVirtual()); + } + bf16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.bf16s().size() > 0) { + bf16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.bf16s(), + GetArenaNoVirtual()); + } + s8s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.s8s().size() > 0) { + s8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.s8s(), + GetArenaNoVirtual()); + } + u16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.u16s().size() > 0) { + u16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.u16s(), + GetArenaNoVirtual()); + } + s16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.s16s().size() > 0) { + s16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.s16s(), + GetArenaNoVirtual()); + } + if (from.has_shape()) { + shape_ = new ::xla::ShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xla.LiteralProto) +} + +void LiteralProto::SharedCtor() { + u8s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + f16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bf16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + s8s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + u16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + s16s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + shape_ = NULL; +} + +LiteralProto::~LiteralProto() { + // @@protoc_insertion_point(destructor:xla.LiteralProto) + SharedDtor(); +} + +void LiteralProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + u8s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + f16s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bf16s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + s8s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + u16s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + s16s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete shape_; +} + +void LiteralProto::ArenaDtor(void* object) { + LiteralProto* _this = reinterpret_cast< LiteralProto* >(object); + (void)_this; +} +void LiteralProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LiteralProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LiteralProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LiteralProto& LiteralProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base); + return *internal_default_instance(); +} + + +void LiteralProto::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.LiteralProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + preds_.Clear(); + s32s_.Clear(); + s64s_.Clear(); + u32s_.Clear(); + u64s_.Clear(); + f32s_.Clear(); + f64s_.Clear(); + tuple_literals_.Clear(); + c64s_.Clear(); + sparse_indices_.Clear(); + u8s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + f16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + bf16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + s8s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + u16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + s16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + _internal_metadata_.Clear(); +} + +bool LiteralProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.LiteralProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.ShapeProto shape = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // repeated bool preds = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_preds()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 18u, input, this->mutable_preds()))); + } else { + goto handle_unusual; + } + break; + } + + // bytes u8s = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_u8s())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 s32s = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_s32s()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 34u, input, this->mutable_s32s()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 s64s = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_s64s()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 42u, input, this->mutable_s64s()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 u32s = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_u32s()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 50u, input, this->mutable_u32s()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint64 u64s = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, this->mutable_u64s()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + 1, 58u, input, this->mutable_u64s()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated float f32s = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_f32s()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(69u /* 69 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 66u, input, this->mutable_f32s()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated double f64s = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_f64s()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(73u /* 73 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 74u, input, this->mutable_f64s()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.LiteralProto tuple_literals = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tuple_literals())); + } else { + goto handle_unusual; + } + break; + } + + // bytes f16s = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_f16s())); + } else { + goto handle_unusual; + } + break; + } + + // repeated float c64s = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_c64s()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(101u /* 101 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 98u, input, this->mutable_c64s()))); + } else { + goto handle_unusual; + } + break; + } + + // bytes bf16s = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_bf16s())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 sparse_indices = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_sparse_indices()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 114u, input, this->mutable_sparse_indices()))); + } else { + goto handle_unusual; + } + break; + } + + // bytes s8s = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_s8s())); + } else { + goto handle_unusual; + } + break; + } + + // bytes u16s = 16; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(130u /* 130 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_u16s())); + } else { + goto handle_unusual; + } + break; + } + + // bytes s16s = 17; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(138u /* 138 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_s16s())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.LiteralProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.LiteralProto) + return false; +#undef DO_ +} + +void LiteralProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.LiteralProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape = 1; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_shape(), output); + } + + // repeated bool preds = 2; + if (this->preds_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _preds_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteBoolArray( + this->preds().data(), this->preds_size(), output); + } + + // bytes u8s = 3; + if (this->u8s().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->u8s(), output); + } + + // repeated int32 s32s = 4; + if (this->s32s_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _s32s_cached_byte_size_)); + } + for (int i = 0, n = this->s32s_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->s32s(i), output); + } + + // repeated int64 s64s = 5; + if (this->s64s_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _s64s_cached_byte_size_)); + } + for (int i = 0, n = this->s64s_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->s64s(i), output); + } + + // repeated uint32 u32s = 6; + if (this->u32s_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _u32s_cached_byte_size_)); + } + for (int i = 0, n = this->u32s_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->u32s(i), output); + } + + // repeated uint64 u64s = 7; + if (this->u64s_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _u64s_cached_byte_size_)); + } + for (int i = 0, n = this->u64s_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag( + this->u64s(i), output); + } + + // repeated float f32s = 8; + if (this->f32s_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _f32s_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->f32s().data(), this->f32s_size(), output); + } + + // repeated double f64s = 9; + if (this->f64s_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _f64s_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteDoubleArray( + this->f64s().data(), this->f64s_size(), output); + } + + // repeated .xla.LiteralProto tuple_literals = 10; + for (unsigned int i = 0, + n = static_cast(this->tuple_literals_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, + this->tuple_literals(static_cast(i)), + output); + } + + // bytes f16s = 11; + if (this->f16s().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 11, this->f16s(), output); + } + + // repeated float c64s = 12; + if (this->c64s_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _c64s_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->c64s().data(), this->c64s_size(), output); + } + + // bytes bf16s = 13; + if (this->bf16s().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 13, this->bf16s(), output); + } + + // repeated int64 sparse_indices = 14; + if (this->sparse_indices_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(14, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _sparse_indices_cached_byte_size_)); + } + for (int i = 0, n = this->sparse_indices_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->sparse_indices(i), output); + } + + // bytes s8s = 15; + if (this->s8s().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 15, this->s8s(), output); + } + + // bytes u16s = 16; + if (this->u16s().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 16, this->u16s(), output); + } + + // bytes s16s = 17; + if (this->s16s().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 17, this->s16s(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.LiteralProto) +} + +::google::protobuf::uint8* LiteralProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.LiteralProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.ShapeProto shape = 1; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_shape(), deterministic, target); + } + + // repeated bool preds = 2; + if (this->preds_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _preds_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteBoolNoTagToArray(this->preds_, target); + } + + // bytes u8s = 3; + if (this->u8s().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->u8s(), target); + } + + // repeated int32 s32s = 4; + if (this->s32s_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _s32s_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->s32s_, target); + } + + // repeated int64 s64s = 5; + if (this->s64s_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _s64s_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->s64s_, target); + } + + // repeated uint32 u32s = 6; + if (this->u32s_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _u32s_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->u32s_, target); + } + + // repeated uint64 u64s = 7; + if (this->u64s_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 7, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _u64s_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt64NoTagToArray(this->u64s_, target); + } + + // repeated float f32s = 8; + if (this->f32s_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 8, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _f32s_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->f32s_, target); + } + + // repeated double f64s = 9; + if (this->f64s_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 9, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _f64s_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->f64s_, target); + } + + // repeated .xla.LiteralProto tuple_literals = 10; + for (unsigned int i = 0, + n = static_cast(this->tuple_literals_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 10, this->tuple_literals(static_cast(i)), deterministic, target); + } + + // bytes f16s = 11; + if (this->f16s().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 11, this->f16s(), target); + } + + // repeated float c64s = 12; + if (this->c64s_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 12, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _c64s_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->c64s_, target); + } + + // bytes bf16s = 13; + if (this->bf16s().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 13, this->bf16s(), target); + } + + // repeated int64 sparse_indices = 14; + if (this->sparse_indices_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 14, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _sparse_indices_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->sparse_indices_, target); + } + + // bytes s8s = 15; + if (this->s8s().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 15, this->s8s(), target); + } + + // bytes u16s = 16; + if (this->u16s().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 16, this->u16s(), target); + } + + // bytes s16s = 17; + if (this->s16s().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 17, this->s16s(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.LiteralProto) + return target; +} + +size_t LiteralProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.LiteralProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated bool preds = 2; + { + unsigned int count = static_cast(this->preds_size()); + size_t data_size = 1UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _preds_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int32 s32s = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->s32s_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _s32s_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 s64s = 5; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->s64s_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _s64s_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 u32s = 6; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->u32s_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _u32s_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint64 u64s = 7; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt64Size(this->u64s_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _u64s_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float f32s = 8; + { + unsigned int count = static_cast(this->f32s_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _f32s_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double f64s = 9; + { + unsigned int count = static_cast(this->f64s_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _f64s_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .xla.LiteralProto tuple_literals = 10; + { + unsigned int count = static_cast(this->tuple_literals_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tuple_literals(static_cast(i))); + } + } + + // repeated float c64s = 12; + { + unsigned int count = static_cast(this->c64s_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _c64s_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 sparse_indices = 14; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->sparse_indices_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _sparse_indices_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // bytes u8s = 3; + if (this->u8s().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->u8s()); + } + + // bytes f16s = 11; + if (this->f16s().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->f16s()); + } + + // bytes bf16s = 13; + if (this->bf16s().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->bf16s()); + } + + // bytes s8s = 15; + if (this->s8s().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->s8s()); + } + + // bytes u16s = 16; + if (this->u16s().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->u16s()); + } + + // bytes s16s = 17; + if (this->s16s().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->s16s()); + } + + // .xla.ShapeProto shape = 1; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LiteralProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.LiteralProto) + GOOGLE_DCHECK_NE(&from, this); + const LiteralProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.LiteralProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.LiteralProto) + MergeFrom(*source); + } +} + +void LiteralProto::MergeFrom(const LiteralProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.LiteralProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + preds_.MergeFrom(from.preds_); + s32s_.MergeFrom(from.s32s_); + s64s_.MergeFrom(from.s64s_); + u32s_.MergeFrom(from.u32s_); + u64s_.MergeFrom(from.u64s_); + f32s_.MergeFrom(from.f32s_); + f64s_.MergeFrom(from.f64s_); + tuple_literals_.MergeFrom(from.tuple_literals_); + c64s_.MergeFrom(from.c64s_); + sparse_indices_.MergeFrom(from.sparse_indices_); + if (from.u8s().size() > 0) { + set_u8s(from.u8s()); + } + if (from.f16s().size() > 0) { + set_f16s(from.f16s()); + } + if (from.bf16s().size() > 0) { + set_bf16s(from.bf16s()); + } + if (from.s8s().size() > 0) { + set_s8s(from.s8s()); + } + if (from.u16s().size() > 0) { + set_u16s(from.u16s()); + } + if (from.s16s().size() > 0) { + set_s16s(from.s16s()); + } + if (from.has_shape()) { + mutable_shape()->::xla::ShapeProto::MergeFrom(from.shape()); + } +} + +void LiteralProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.LiteralProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LiteralProto::CopyFrom(const LiteralProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.LiteralProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LiteralProto::IsInitialized() const { + return true; +} + +void LiteralProto::Swap(LiteralProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LiteralProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LiteralProto::UnsafeArenaSwap(LiteralProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LiteralProto::InternalSwap(LiteralProto* other) { + using std::swap; + preds_.InternalSwap(&other->preds_); + s32s_.InternalSwap(&other->s32s_); + s64s_.InternalSwap(&other->s64s_); + u32s_.InternalSwap(&other->u32s_); + u64s_.InternalSwap(&other->u64s_); + f32s_.InternalSwap(&other->f32s_); + f64s_.InternalSwap(&other->f64s_); + CastToBase(&tuple_literals_)->InternalSwap(CastToBase(&other->tuple_literals_)); + c64s_.InternalSwap(&other->c64s_); + sparse_indices_.InternalSwap(&other->sparse_indices_); + u8s_.Swap(&other->u8s_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + f16s_.Swap(&other->f16s_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + bf16s_.Swap(&other->bf16s_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + s8s_.Swap(&other->s8s_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + u16s_.Swap(&other->u16s_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + s16s_.Swap(&other->s16s_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(shape_, other->shape_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LiteralProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void WindowDimension::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int WindowDimension::kSizeFieldNumber; +const int WindowDimension::kStrideFieldNumber; +const int WindowDimension::kPaddingLowFieldNumber; +const int WindowDimension::kPaddingHighFieldNumber; +const int WindowDimension::kWindowDilationFieldNumber; +const int WindowDimension::kBaseDilationFieldNumber; +const int WindowDimension::kWindowReversalFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +WindowDimension::WindowDimension() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_WindowDimension.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.WindowDimension) +} +WindowDimension::WindowDimension(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_WindowDimension.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.WindowDimension) +} +WindowDimension::WindowDimension(const WindowDimension& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&size_, &from.size_, + static_cast(reinterpret_cast(&window_reversal_) - + reinterpret_cast(&size_)) + sizeof(window_reversal_)); + // @@protoc_insertion_point(copy_constructor:xla.WindowDimension) +} + +void WindowDimension::SharedCtor() { + ::memset(&size_, 0, static_cast( + reinterpret_cast(&window_reversal_) - + reinterpret_cast(&size_)) + sizeof(window_reversal_)); +} + +WindowDimension::~WindowDimension() { + // @@protoc_insertion_point(destructor:xla.WindowDimension) + SharedDtor(); +} + +void WindowDimension::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void WindowDimension::ArenaDtor(void* object) { + WindowDimension* _this = reinterpret_cast< WindowDimension* >(object); + (void)_this; +} +void WindowDimension::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void WindowDimension::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* WindowDimension::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const WindowDimension& WindowDimension::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_WindowDimension.base); + return *internal_default_instance(); +} + + +void WindowDimension::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.WindowDimension) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&size_, 0, static_cast( + reinterpret_cast(&window_reversal_) - + reinterpret_cast(&size_)) + sizeof(window_reversal_)); + _internal_metadata_.Clear(); +} + +bool WindowDimension::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.WindowDimension) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 size = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 stride = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &stride_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 padding_low = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &padding_low_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 padding_high = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &padding_high_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 window_dilation = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &window_dilation_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 base_dilation = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &base_dilation_))); + } else { + goto handle_unusual; + } + break; + } + + // bool window_reversal = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &window_reversal_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.WindowDimension) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.WindowDimension) + return false; +#undef DO_ +} + +void WindowDimension::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.WindowDimension) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 size = 1; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->size(), output); + } + + // int64 stride = 2; + if (this->stride() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->stride(), output); + } + + // int64 padding_low = 3; + if (this->padding_low() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->padding_low(), output); + } + + // int64 padding_high = 4; + if (this->padding_high() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->padding_high(), output); + } + + // int64 window_dilation = 5; + if (this->window_dilation() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->window_dilation(), output); + } + + // int64 base_dilation = 6; + if (this->base_dilation() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->base_dilation(), output); + } + + // bool window_reversal = 7; + if (this->window_reversal() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->window_reversal(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.WindowDimension) +} + +::google::protobuf::uint8* WindowDimension::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.WindowDimension) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 size = 1; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->size(), target); + } + + // int64 stride = 2; + if (this->stride() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->stride(), target); + } + + // int64 padding_low = 3; + if (this->padding_low() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->padding_low(), target); + } + + // int64 padding_high = 4; + if (this->padding_high() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->padding_high(), target); + } + + // int64 window_dilation = 5; + if (this->window_dilation() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->window_dilation(), target); + } + + // int64 base_dilation = 6; + if (this->base_dilation() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->base_dilation(), target); + } + + // bool window_reversal = 7; + if (this->window_reversal() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->window_reversal(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.WindowDimension) + return target; +} + +size_t WindowDimension::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.WindowDimension) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 size = 1; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->size()); + } + + // int64 stride = 2; + if (this->stride() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->stride()); + } + + // int64 padding_low = 3; + if (this->padding_low() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->padding_low()); + } + + // int64 padding_high = 4; + if (this->padding_high() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->padding_high()); + } + + // int64 window_dilation = 5; + if (this->window_dilation() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->window_dilation()); + } + + // int64 base_dilation = 6; + if (this->base_dilation() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->base_dilation()); + } + + // bool window_reversal = 7; + if (this->window_reversal() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WindowDimension::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.WindowDimension) + GOOGLE_DCHECK_NE(&from, this); + const WindowDimension* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.WindowDimension) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.WindowDimension) + MergeFrom(*source); + } +} + +void WindowDimension::MergeFrom(const WindowDimension& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.WindowDimension) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.size() != 0) { + set_size(from.size()); + } + if (from.stride() != 0) { + set_stride(from.stride()); + } + if (from.padding_low() != 0) { + set_padding_low(from.padding_low()); + } + if (from.padding_high() != 0) { + set_padding_high(from.padding_high()); + } + if (from.window_dilation() != 0) { + set_window_dilation(from.window_dilation()); + } + if (from.base_dilation() != 0) { + set_base_dilation(from.base_dilation()); + } + if (from.window_reversal() != 0) { + set_window_reversal(from.window_reversal()); + } +} + +void WindowDimension::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.WindowDimension) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WindowDimension::CopyFrom(const WindowDimension& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.WindowDimension) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WindowDimension::IsInitialized() const { + return true; +} + +void WindowDimension::Swap(WindowDimension* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + WindowDimension* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void WindowDimension::UnsafeArenaSwap(WindowDimension* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void WindowDimension::InternalSwap(WindowDimension* other) { + using std::swap; + swap(size_, other->size_); + swap(stride_, other->stride_); + swap(padding_low_, other->padding_low_); + swap(padding_high_, other->padding_high_); + swap(window_dilation_, other->window_dilation_); + swap(base_dilation_, other->base_dilation_); + swap(window_reversal_, other->window_reversal_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata WindowDimension::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Window::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Window::kDimensionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Window::Window() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_Window.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.Window) +} +Window::Window(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dimensions_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_Window.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.Window) +} +Window::Window(const Window& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dimensions_(from.dimensions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.Window) +} + +void Window::SharedCtor() { +} + +Window::~Window() { + // @@protoc_insertion_point(destructor:xla.Window) + SharedDtor(); +} + +void Window::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Window::ArenaDtor(void* object) { + Window* _this = reinterpret_cast< Window* >(object); + (void)_this; +} +void Window::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Window::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Window::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Window& Window::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_Window.base); + return *internal_default_instance(); +} + + +void Window::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.Window) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dimensions_.Clear(); + _internal_metadata_.Clear(); +} + +bool Window::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.Window) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.WindowDimension dimensions = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_dimensions())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.Window) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.Window) + return false; +#undef DO_ +} + +void Window::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.Window) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.WindowDimension dimensions = 1; + for (unsigned int i = 0, + n = static_cast(this->dimensions_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->dimensions(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.Window) +} + +::google::protobuf::uint8* Window::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.Window) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.WindowDimension dimensions = 1; + for (unsigned int i = 0, + n = static_cast(this->dimensions_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->dimensions(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.Window) + return target; +} + +size_t Window::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.Window) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.WindowDimension dimensions = 1; + { + unsigned int count = static_cast(this->dimensions_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->dimensions(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Window::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.Window) + GOOGLE_DCHECK_NE(&from, this); + const Window* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.Window) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.Window) + MergeFrom(*source); + } +} + +void Window::MergeFrom(const Window& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.Window) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dimensions_.MergeFrom(from.dimensions_); +} + +void Window::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.Window) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Window::CopyFrom(const Window& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.Window) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Window::IsInitialized() const { + return true; +} + +void Window::Swap(Window* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Window* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Window::UnsafeArenaSwap(Window* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Window::InternalSwap(Window* other) { + using std::swap; + CastToBase(&dimensions_)->InternalSwap(CastToBase(&other->dimensions_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Window::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GatherDimensionNumbers::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GatherDimensionNumbers::kOffsetDimsFieldNumber; +const int GatherDimensionNumbers::kCollapsedSliceDimsFieldNumber; +const int GatherDimensionNumbers::kStartIndexMapFieldNumber; +const int GatherDimensionNumbers::kIndexVectorDimFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GatherDimensionNumbers::GatherDimensionNumbers() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GatherDimensionNumbers.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.GatherDimensionNumbers) +} +GatherDimensionNumbers::GatherDimensionNumbers(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + offset_dims_(arena), + collapsed_slice_dims_(arena), + start_index_map_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GatherDimensionNumbers.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.GatherDimensionNumbers) +} +GatherDimensionNumbers::GatherDimensionNumbers(const GatherDimensionNumbers& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + offset_dims_(from.offset_dims_), + collapsed_slice_dims_(from.collapsed_slice_dims_), + start_index_map_(from.start_index_map_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + index_vector_dim_ = from.index_vector_dim_; + // @@protoc_insertion_point(copy_constructor:xla.GatherDimensionNumbers) +} + +void GatherDimensionNumbers::SharedCtor() { + index_vector_dim_ = GOOGLE_LONGLONG(0); +} + +GatherDimensionNumbers::~GatherDimensionNumbers() { + // @@protoc_insertion_point(destructor:xla.GatherDimensionNumbers) + SharedDtor(); +} + +void GatherDimensionNumbers::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GatherDimensionNumbers::ArenaDtor(void* object) { + GatherDimensionNumbers* _this = reinterpret_cast< GatherDimensionNumbers* >(object); + (void)_this; +} +void GatherDimensionNumbers::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GatherDimensionNumbers::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GatherDimensionNumbers::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GatherDimensionNumbers& GatherDimensionNumbers::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_GatherDimensionNumbers.base); + return *internal_default_instance(); +} + + +void GatherDimensionNumbers::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.GatherDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + offset_dims_.Clear(); + collapsed_slice_dims_.Clear(); + start_index_map_.Clear(); + index_vector_dim_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool GatherDimensionNumbers::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.GatherDimensionNumbers) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 offset_dims = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_offset_dims()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_offset_dims()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 collapsed_slice_dims = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_collapsed_slice_dims()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_collapsed_slice_dims()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 start_index_map = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_start_index_map()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_start_index_map()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 index_vector_dim = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &index_vector_dim_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.GatherDimensionNumbers) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.GatherDimensionNumbers) + return false; +#undef DO_ +} + +void GatherDimensionNumbers::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.GatherDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 offset_dims = 1; + if (this->offset_dims_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _offset_dims_cached_byte_size_)); + } + for (int i = 0, n = this->offset_dims_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->offset_dims(i), output); + } + + // repeated int64 collapsed_slice_dims = 2; + if (this->collapsed_slice_dims_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _collapsed_slice_dims_cached_byte_size_)); + } + for (int i = 0, n = this->collapsed_slice_dims_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->collapsed_slice_dims(i), output); + } + + // repeated int64 start_index_map = 3; + if (this->start_index_map_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _start_index_map_cached_byte_size_)); + } + for (int i = 0, n = this->start_index_map_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->start_index_map(i), output); + } + + // int64 index_vector_dim = 4; + if (this->index_vector_dim() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->index_vector_dim(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.GatherDimensionNumbers) +} + +::google::protobuf::uint8* GatherDimensionNumbers::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.GatherDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 offset_dims = 1; + if (this->offset_dims_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _offset_dims_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->offset_dims_, target); + } + + // repeated int64 collapsed_slice_dims = 2; + if (this->collapsed_slice_dims_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _collapsed_slice_dims_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->collapsed_slice_dims_, target); + } + + // repeated int64 start_index_map = 3; + if (this->start_index_map_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _start_index_map_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->start_index_map_, target); + } + + // int64 index_vector_dim = 4; + if (this->index_vector_dim() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->index_vector_dim(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.GatherDimensionNumbers) + return target; +} + +size_t GatherDimensionNumbers::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.GatherDimensionNumbers) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 offset_dims = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->offset_dims_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _offset_dims_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 collapsed_slice_dims = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->collapsed_slice_dims_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _collapsed_slice_dims_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 start_index_map = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->start_index_map_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _start_index_map_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 index_vector_dim = 4; + if (this->index_vector_dim() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->index_vector_dim()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GatherDimensionNumbers::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.GatherDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + const GatherDimensionNumbers* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.GatherDimensionNumbers) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.GatherDimensionNumbers) + MergeFrom(*source); + } +} + +void GatherDimensionNumbers::MergeFrom(const GatherDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.GatherDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + offset_dims_.MergeFrom(from.offset_dims_); + collapsed_slice_dims_.MergeFrom(from.collapsed_slice_dims_); + start_index_map_.MergeFrom(from.start_index_map_); + if (from.index_vector_dim() != 0) { + set_index_vector_dim(from.index_vector_dim()); + } +} + +void GatherDimensionNumbers::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.GatherDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GatherDimensionNumbers::CopyFrom(const GatherDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.GatherDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GatherDimensionNumbers::IsInitialized() const { + return true; +} + +void GatherDimensionNumbers::Swap(GatherDimensionNumbers* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GatherDimensionNumbers* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GatherDimensionNumbers::UnsafeArenaSwap(GatherDimensionNumbers* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GatherDimensionNumbers::InternalSwap(GatherDimensionNumbers* other) { + using std::swap; + offset_dims_.InternalSwap(&other->offset_dims_); + collapsed_slice_dims_.InternalSwap(&other->collapsed_slice_dims_); + start_index_map_.InternalSwap(&other->start_index_map_); + swap(index_vector_dim_, other->index_vector_dim_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GatherDimensionNumbers::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ScatterDimensionNumbers::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ScatterDimensionNumbers::kUpdateWindowDimsFieldNumber; +const int ScatterDimensionNumbers::kInsertedWindowDimsFieldNumber; +const int ScatterDimensionNumbers::kScatterDimsToOperandDimsFieldNumber; +const int ScatterDimensionNumbers::kIndexVectorDimFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ScatterDimensionNumbers::ScatterDimensionNumbers() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ScatterDimensionNumbers.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ScatterDimensionNumbers) +} +ScatterDimensionNumbers::ScatterDimensionNumbers(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + update_window_dims_(arena), + inserted_window_dims_(arena), + scatter_dims_to_operand_dims_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ScatterDimensionNumbers.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ScatterDimensionNumbers) +} +ScatterDimensionNumbers::ScatterDimensionNumbers(const ScatterDimensionNumbers& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + update_window_dims_(from.update_window_dims_), + inserted_window_dims_(from.inserted_window_dims_), + scatter_dims_to_operand_dims_(from.scatter_dims_to_operand_dims_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + index_vector_dim_ = from.index_vector_dim_; + // @@protoc_insertion_point(copy_constructor:xla.ScatterDimensionNumbers) +} + +void ScatterDimensionNumbers::SharedCtor() { + index_vector_dim_ = GOOGLE_LONGLONG(0); +} + +ScatterDimensionNumbers::~ScatterDimensionNumbers() { + // @@protoc_insertion_point(destructor:xla.ScatterDimensionNumbers) + SharedDtor(); +} + +void ScatterDimensionNumbers::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ScatterDimensionNumbers::ArenaDtor(void* object) { + ScatterDimensionNumbers* _this = reinterpret_cast< ScatterDimensionNumbers* >(object); + (void)_this; +} +void ScatterDimensionNumbers::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ScatterDimensionNumbers::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ScatterDimensionNumbers::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ScatterDimensionNumbers& ScatterDimensionNumbers::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ScatterDimensionNumbers.base); + return *internal_default_instance(); +} + + +void ScatterDimensionNumbers::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ScatterDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + update_window_dims_.Clear(); + inserted_window_dims_.Clear(); + scatter_dims_to_operand_dims_.Clear(); + index_vector_dim_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool ScatterDimensionNumbers::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ScatterDimensionNumbers) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 update_window_dims = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_update_window_dims()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_update_window_dims()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 inserted_window_dims = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_inserted_window_dims()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_inserted_window_dims()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 scatter_dims_to_operand_dims = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_scatter_dims_to_operand_dims()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_scatter_dims_to_operand_dims()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 index_vector_dim = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &index_vector_dim_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ScatterDimensionNumbers) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ScatterDimensionNumbers) + return false; +#undef DO_ +} + +void ScatterDimensionNumbers::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ScatterDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 update_window_dims = 1; + if (this->update_window_dims_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _update_window_dims_cached_byte_size_)); + } + for (int i = 0, n = this->update_window_dims_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->update_window_dims(i), output); + } + + // repeated int64 inserted_window_dims = 2; + if (this->inserted_window_dims_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _inserted_window_dims_cached_byte_size_)); + } + for (int i = 0, n = this->inserted_window_dims_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->inserted_window_dims(i), output); + } + + // repeated int64 scatter_dims_to_operand_dims = 3; + if (this->scatter_dims_to_operand_dims_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _scatter_dims_to_operand_dims_cached_byte_size_)); + } + for (int i = 0, n = this->scatter_dims_to_operand_dims_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->scatter_dims_to_operand_dims(i), output); + } + + // int64 index_vector_dim = 4; + if (this->index_vector_dim() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->index_vector_dim(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ScatterDimensionNumbers) +} + +::google::protobuf::uint8* ScatterDimensionNumbers::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ScatterDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 update_window_dims = 1; + if (this->update_window_dims_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _update_window_dims_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->update_window_dims_, target); + } + + // repeated int64 inserted_window_dims = 2; + if (this->inserted_window_dims_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _inserted_window_dims_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->inserted_window_dims_, target); + } + + // repeated int64 scatter_dims_to_operand_dims = 3; + if (this->scatter_dims_to_operand_dims_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _scatter_dims_to_operand_dims_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->scatter_dims_to_operand_dims_, target); + } + + // int64 index_vector_dim = 4; + if (this->index_vector_dim() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->index_vector_dim(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ScatterDimensionNumbers) + return target; +} + +size_t ScatterDimensionNumbers::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ScatterDimensionNumbers) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 update_window_dims = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->update_window_dims_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _update_window_dims_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 inserted_window_dims = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->inserted_window_dims_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _inserted_window_dims_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 scatter_dims_to_operand_dims = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->scatter_dims_to_operand_dims_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _scatter_dims_to_operand_dims_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 index_vector_dim = 4; + if (this->index_vector_dim() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->index_vector_dim()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ScatterDimensionNumbers::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ScatterDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + const ScatterDimensionNumbers* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ScatterDimensionNumbers) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ScatterDimensionNumbers) + MergeFrom(*source); + } +} + +void ScatterDimensionNumbers::MergeFrom(const ScatterDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ScatterDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + update_window_dims_.MergeFrom(from.update_window_dims_); + inserted_window_dims_.MergeFrom(from.inserted_window_dims_); + scatter_dims_to_operand_dims_.MergeFrom(from.scatter_dims_to_operand_dims_); + if (from.index_vector_dim() != 0) { + set_index_vector_dim(from.index_vector_dim()); + } +} + +void ScatterDimensionNumbers::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ScatterDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ScatterDimensionNumbers::CopyFrom(const ScatterDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ScatterDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ScatterDimensionNumbers::IsInitialized() const { + return true; +} + +void ScatterDimensionNumbers::Swap(ScatterDimensionNumbers* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ScatterDimensionNumbers* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ScatterDimensionNumbers::UnsafeArenaSwap(ScatterDimensionNumbers* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ScatterDimensionNumbers::InternalSwap(ScatterDimensionNumbers* other) { + using std::swap; + update_window_dims_.InternalSwap(&other->update_window_dims_); + inserted_window_dims_.InternalSwap(&other->inserted_window_dims_); + scatter_dims_to_operand_dims_.InternalSwap(&other->scatter_dims_to_operand_dims_); + swap(index_vector_dim_, other->index_vector_dim_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ScatterDimensionNumbers::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ConvolutionDimensionNumbers::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ConvolutionDimensionNumbers::kInputBatchDimensionFieldNumber; +const int ConvolutionDimensionNumbers::kInputFeatureDimensionFieldNumber; +const int ConvolutionDimensionNumbers::kInputSpatialDimensionsFieldNumber; +const int ConvolutionDimensionNumbers::kKernelInputFeatureDimensionFieldNumber; +const int ConvolutionDimensionNumbers::kKernelOutputFeatureDimensionFieldNumber; +const int ConvolutionDimensionNumbers::kKernelSpatialDimensionsFieldNumber; +const int ConvolutionDimensionNumbers::kOutputBatchDimensionFieldNumber; +const int ConvolutionDimensionNumbers::kOutputFeatureDimensionFieldNumber; +const int ConvolutionDimensionNumbers::kOutputSpatialDimensionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ConvolutionDimensionNumbers::ConvolutionDimensionNumbers() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ConvolutionDimensionNumbers.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ConvolutionDimensionNumbers) +} +ConvolutionDimensionNumbers::ConvolutionDimensionNumbers(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + kernel_spatial_dimensions_(arena), + input_spatial_dimensions_(arena), + output_spatial_dimensions_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ConvolutionDimensionNumbers.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ConvolutionDimensionNumbers) +} +ConvolutionDimensionNumbers::ConvolutionDimensionNumbers(const ConvolutionDimensionNumbers& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + kernel_spatial_dimensions_(from.kernel_spatial_dimensions_), + input_spatial_dimensions_(from.input_spatial_dimensions_), + output_spatial_dimensions_(from.output_spatial_dimensions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&kernel_input_feature_dimension_, &from.kernel_input_feature_dimension_, + static_cast(reinterpret_cast(&output_feature_dimension_) - + reinterpret_cast(&kernel_input_feature_dimension_)) + sizeof(output_feature_dimension_)); + // @@protoc_insertion_point(copy_constructor:xla.ConvolutionDimensionNumbers) +} + +void ConvolutionDimensionNumbers::SharedCtor() { + ::memset(&kernel_input_feature_dimension_, 0, static_cast( + reinterpret_cast(&output_feature_dimension_) - + reinterpret_cast(&kernel_input_feature_dimension_)) + sizeof(output_feature_dimension_)); +} + +ConvolutionDimensionNumbers::~ConvolutionDimensionNumbers() { + // @@protoc_insertion_point(destructor:xla.ConvolutionDimensionNumbers) + SharedDtor(); +} + +void ConvolutionDimensionNumbers::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ConvolutionDimensionNumbers::ArenaDtor(void* object) { + ConvolutionDimensionNumbers* _this = reinterpret_cast< ConvolutionDimensionNumbers* >(object); + (void)_this; +} +void ConvolutionDimensionNumbers::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ConvolutionDimensionNumbers::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ConvolutionDimensionNumbers::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ConvolutionDimensionNumbers& ConvolutionDimensionNumbers::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ConvolutionDimensionNumbers.base); + return *internal_default_instance(); +} + + +void ConvolutionDimensionNumbers::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ConvolutionDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + kernel_spatial_dimensions_.Clear(); + input_spatial_dimensions_.Clear(); + output_spatial_dimensions_.Clear(); + ::memset(&kernel_input_feature_dimension_, 0, static_cast( + reinterpret_cast(&output_feature_dimension_) - + reinterpret_cast(&kernel_input_feature_dimension_)) + sizeof(output_feature_dimension_)); + _internal_metadata_.Clear(); +} + +bool ConvolutionDimensionNumbers::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ConvolutionDimensionNumbers) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 kernel_input_feature_dimension = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &kernel_input_feature_dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 kernel_output_feature_dimension = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &kernel_output_feature_dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 kernel_spatial_dimensions = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_kernel_spatial_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 50u, input, this->mutable_kernel_spatial_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 input_batch_dimension = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &input_batch_dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 input_feature_dimension = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &input_feature_dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 output_batch_dimension = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &output_batch_dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 output_feature_dimension = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &output_feature_dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 input_spatial_dimensions = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_input_spatial_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 90u, input, this->mutable_input_spatial_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 output_spatial_dimensions = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_output_spatial_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 98u, input, this->mutable_output_spatial_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ConvolutionDimensionNumbers) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ConvolutionDimensionNumbers) + return false; +#undef DO_ +} + +void ConvolutionDimensionNumbers::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ConvolutionDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 kernel_input_feature_dimension = 3; + if (this->kernel_input_feature_dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->kernel_input_feature_dimension(), output); + } + + // int64 kernel_output_feature_dimension = 4; + if (this->kernel_output_feature_dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->kernel_output_feature_dimension(), output); + } + + // repeated int64 kernel_spatial_dimensions = 6; + if (this->kernel_spatial_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _kernel_spatial_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->kernel_spatial_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->kernel_spatial_dimensions(i), output); + } + + // int64 input_batch_dimension = 7; + if (this->input_batch_dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(7, this->input_batch_dimension(), output); + } + + // int64 input_feature_dimension = 8; + if (this->input_feature_dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(8, this->input_feature_dimension(), output); + } + + // int64 output_batch_dimension = 9; + if (this->output_batch_dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(9, this->output_batch_dimension(), output); + } + + // int64 output_feature_dimension = 10; + if (this->output_feature_dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(10, this->output_feature_dimension(), output); + } + + // repeated int64 input_spatial_dimensions = 11; + if (this->input_spatial_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _input_spatial_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->input_spatial_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->input_spatial_dimensions(i), output); + } + + // repeated int64 output_spatial_dimensions = 12; + if (this->output_spatial_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _output_spatial_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->output_spatial_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->output_spatial_dimensions(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ConvolutionDimensionNumbers) +} + +::google::protobuf::uint8* ConvolutionDimensionNumbers::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ConvolutionDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 kernel_input_feature_dimension = 3; + if (this->kernel_input_feature_dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->kernel_input_feature_dimension(), target); + } + + // int64 kernel_output_feature_dimension = 4; + if (this->kernel_output_feature_dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->kernel_output_feature_dimension(), target); + } + + // repeated int64 kernel_spatial_dimensions = 6; + if (this->kernel_spatial_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _kernel_spatial_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->kernel_spatial_dimensions_, target); + } + + // int64 input_batch_dimension = 7; + if (this->input_batch_dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(7, this->input_batch_dimension(), target); + } + + // int64 input_feature_dimension = 8; + if (this->input_feature_dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(8, this->input_feature_dimension(), target); + } + + // int64 output_batch_dimension = 9; + if (this->output_batch_dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(9, this->output_batch_dimension(), target); + } + + // int64 output_feature_dimension = 10; + if (this->output_feature_dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(10, this->output_feature_dimension(), target); + } + + // repeated int64 input_spatial_dimensions = 11; + if (this->input_spatial_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 11, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _input_spatial_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->input_spatial_dimensions_, target); + } + + // repeated int64 output_spatial_dimensions = 12; + if (this->output_spatial_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 12, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _output_spatial_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->output_spatial_dimensions_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ConvolutionDimensionNumbers) + return target; +} + +size_t ConvolutionDimensionNumbers::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ConvolutionDimensionNumbers) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 kernel_spatial_dimensions = 6; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->kernel_spatial_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _kernel_spatial_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 input_spatial_dimensions = 11; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->input_spatial_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _input_spatial_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 output_spatial_dimensions = 12; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->output_spatial_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _output_spatial_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 kernel_input_feature_dimension = 3; + if (this->kernel_input_feature_dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->kernel_input_feature_dimension()); + } + + // int64 kernel_output_feature_dimension = 4; + if (this->kernel_output_feature_dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->kernel_output_feature_dimension()); + } + + // int64 input_batch_dimension = 7; + if (this->input_batch_dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->input_batch_dimension()); + } + + // int64 input_feature_dimension = 8; + if (this->input_feature_dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->input_feature_dimension()); + } + + // int64 output_batch_dimension = 9; + if (this->output_batch_dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->output_batch_dimension()); + } + + // int64 output_feature_dimension = 10; + if (this->output_feature_dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->output_feature_dimension()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ConvolutionDimensionNumbers::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ConvolutionDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + const ConvolutionDimensionNumbers* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ConvolutionDimensionNumbers) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ConvolutionDimensionNumbers) + MergeFrom(*source); + } +} + +void ConvolutionDimensionNumbers::MergeFrom(const ConvolutionDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ConvolutionDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + kernel_spatial_dimensions_.MergeFrom(from.kernel_spatial_dimensions_); + input_spatial_dimensions_.MergeFrom(from.input_spatial_dimensions_); + output_spatial_dimensions_.MergeFrom(from.output_spatial_dimensions_); + if (from.kernel_input_feature_dimension() != 0) { + set_kernel_input_feature_dimension(from.kernel_input_feature_dimension()); + } + if (from.kernel_output_feature_dimension() != 0) { + set_kernel_output_feature_dimension(from.kernel_output_feature_dimension()); + } + if (from.input_batch_dimension() != 0) { + set_input_batch_dimension(from.input_batch_dimension()); + } + if (from.input_feature_dimension() != 0) { + set_input_feature_dimension(from.input_feature_dimension()); + } + if (from.output_batch_dimension() != 0) { + set_output_batch_dimension(from.output_batch_dimension()); + } + if (from.output_feature_dimension() != 0) { + set_output_feature_dimension(from.output_feature_dimension()); + } +} + +void ConvolutionDimensionNumbers::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ConvolutionDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ConvolutionDimensionNumbers::CopyFrom(const ConvolutionDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ConvolutionDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ConvolutionDimensionNumbers::IsInitialized() const { + return true; +} + +void ConvolutionDimensionNumbers::Swap(ConvolutionDimensionNumbers* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ConvolutionDimensionNumbers* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ConvolutionDimensionNumbers::UnsafeArenaSwap(ConvolutionDimensionNumbers* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ConvolutionDimensionNumbers::InternalSwap(ConvolutionDimensionNumbers* other) { + using std::swap; + kernel_spatial_dimensions_.InternalSwap(&other->kernel_spatial_dimensions_); + input_spatial_dimensions_.InternalSwap(&other->input_spatial_dimensions_); + output_spatial_dimensions_.InternalSwap(&other->output_spatial_dimensions_); + swap(kernel_input_feature_dimension_, other->kernel_input_feature_dimension_); + swap(kernel_output_feature_dimension_, other->kernel_output_feature_dimension_); + swap(input_batch_dimension_, other->input_batch_dimension_); + swap(input_feature_dimension_, other->input_feature_dimension_); + swap(output_batch_dimension_, other->output_batch_dimension_); + swap(output_feature_dimension_, other->output_feature_dimension_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ConvolutionDimensionNumbers::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DotDimensionNumbers::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DotDimensionNumbers::kLhsContractingDimensionsFieldNumber; +const int DotDimensionNumbers::kRhsContractingDimensionsFieldNumber; +const int DotDimensionNumbers::kLhsBatchDimensionsFieldNumber; +const int DotDimensionNumbers::kRhsBatchDimensionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DotDimensionNumbers::DotDimensionNumbers() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DotDimensionNumbers.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.DotDimensionNumbers) +} +DotDimensionNumbers::DotDimensionNumbers(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + lhs_contracting_dimensions_(arena), + rhs_contracting_dimensions_(arena), + lhs_batch_dimensions_(arena), + rhs_batch_dimensions_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DotDimensionNumbers.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.DotDimensionNumbers) +} +DotDimensionNumbers::DotDimensionNumbers(const DotDimensionNumbers& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + lhs_contracting_dimensions_(from.lhs_contracting_dimensions_), + rhs_contracting_dimensions_(from.rhs_contracting_dimensions_), + lhs_batch_dimensions_(from.lhs_batch_dimensions_), + rhs_batch_dimensions_(from.rhs_batch_dimensions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.DotDimensionNumbers) +} + +void DotDimensionNumbers::SharedCtor() { +} + +DotDimensionNumbers::~DotDimensionNumbers() { + // @@protoc_insertion_point(destructor:xla.DotDimensionNumbers) + SharedDtor(); +} + +void DotDimensionNumbers::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DotDimensionNumbers::ArenaDtor(void* object) { + DotDimensionNumbers* _this = reinterpret_cast< DotDimensionNumbers* >(object); + (void)_this; +} +void DotDimensionNumbers::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DotDimensionNumbers::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DotDimensionNumbers::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DotDimensionNumbers& DotDimensionNumbers::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_DotDimensionNumbers.base); + return *internal_default_instance(); +} + + +void DotDimensionNumbers::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.DotDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + lhs_contracting_dimensions_.Clear(); + rhs_contracting_dimensions_.Clear(); + lhs_batch_dimensions_.Clear(); + rhs_batch_dimensions_.Clear(); + _internal_metadata_.Clear(); +} + +bool DotDimensionNumbers::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.DotDimensionNumbers) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 lhs_contracting_dimensions = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_lhs_contracting_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_lhs_contracting_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 rhs_contracting_dimensions = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_rhs_contracting_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_rhs_contracting_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 lhs_batch_dimensions = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_lhs_batch_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_lhs_batch_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 rhs_batch_dimensions = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_rhs_batch_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 34u, input, this->mutable_rhs_batch_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.DotDimensionNumbers) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.DotDimensionNumbers) + return false; +#undef DO_ +} + +void DotDimensionNumbers::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.DotDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 lhs_contracting_dimensions = 1; + if (this->lhs_contracting_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _lhs_contracting_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->lhs_contracting_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->lhs_contracting_dimensions(i), output); + } + + // repeated int64 rhs_contracting_dimensions = 2; + if (this->rhs_contracting_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _rhs_contracting_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->rhs_contracting_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->rhs_contracting_dimensions(i), output); + } + + // repeated int64 lhs_batch_dimensions = 3; + if (this->lhs_batch_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _lhs_batch_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->lhs_batch_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->lhs_batch_dimensions(i), output); + } + + // repeated int64 rhs_batch_dimensions = 4; + if (this->rhs_batch_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _rhs_batch_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->rhs_batch_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->rhs_batch_dimensions(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.DotDimensionNumbers) +} + +::google::protobuf::uint8* DotDimensionNumbers::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.DotDimensionNumbers) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 lhs_contracting_dimensions = 1; + if (this->lhs_contracting_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _lhs_contracting_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->lhs_contracting_dimensions_, target); + } + + // repeated int64 rhs_contracting_dimensions = 2; + if (this->rhs_contracting_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _rhs_contracting_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->rhs_contracting_dimensions_, target); + } + + // repeated int64 lhs_batch_dimensions = 3; + if (this->lhs_batch_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _lhs_batch_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->lhs_batch_dimensions_, target); + } + + // repeated int64 rhs_batch_dimensions = 4; + if (this->rhs_batch_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _rhs_batch_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->rhs_batch_dimensions_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.DotDimensionNumbers) + return target; +} + +size_t DotDimensionNumbers::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.DotDimensionNumbers) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 lhs_contracting_dimensions = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->lhs_contracting_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _lhs_contracting_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 rhs_contracting_dimensions = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->rhs_contracting_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _rhs_contracting_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 lhs_batch_dimensions = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->lhs_batch_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _lhs_batch_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 rhs_batch_dimensions = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->rhs_batch_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _rhs_batch_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DotDimensionNumbers::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.DotDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + const DotDimensionNumbers* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.DotDimensionNumbers) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.DotDimensionNumbers) + MergeFrom(*source); + } +} + +void DotDimensionNumbers::MergeFrom(const DotDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.DotDimensionNumbers) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + lhs_contracting_dimensions_.MergeFrom(from.lhs_contracting_dimensions_); + rhs_contracting_dimensions_.MergeFrom(from.rhs_contracting_dimensions_); + lhs_batch_dimensions_.MergeFrom(from.lhs_batch_dimensions_); + rhs_batch_dimensions_.MergeFrom(from.rhs_batch_dimensions_); +} + +void DotDimensionNumbers::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.DotDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DotDimensionNumbers::CopyFrom(const DotDimensionNumbers& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.DotDimensionNumbers) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DotDimensionNumbers::IsInitialized() const { + return true; +} + +void DotDimensionNumbers::Swap(DotDimensionNumbers* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DotDimensionNumbers* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DotDimensionNumbers::UnsafeArenaSwap(DotDimensionNumbers* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DotDimensionNumbers::InternalSwap(DotDimensionNumbers* other) { + using std::swap; + lhs_contracting_dimensions_.InternalSwap(&other->lhs_contracting_dimensions_); + rhs_contracting_dimensions_.InternalSwap(&other->rhs_contracting_dimensions_); + lhs_batch_dimensions_.InternalSwap(&other->lhs_batch_dimensions_); + rhs_batch_dimensions_.InternalSwap(&other->rhs_batch_dimensions_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DotDimensionNumbers::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpSharding::InitAsDefaultInstance() { + ::xla::_OpSharding_default_instance_._instance.get_mutable()->tile_shape_ = const_cast< ::xla::ShapeProto*>( + ::xla::ShapeProto::internal_default_instance()); +} +void OpSharding::unsafe_arena_set_allocated_tile_shape( + ::xla::ShapeProto* tile_shape) { + if (GetArenaNoVirtual() == NULL) { + delete tile_shape_; + } + tile_shape_ = tile_shape; + if (tile_shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.OpSharding.tile_shape) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpSharding::kTypeFieldNumber; +const int OpSharding::kTileShapeFieldNumber; +const int OpSharding::kTileAssignmentDimensionsFieldNumber; +const int OpSharding::kTileAssignmentDevicesFieldNumber; +const int OpSharding::kTupleShardingsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpSharding::OpSharding() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpSharding.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.OpSharding) +} +OpSharding::OpSharding(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + tile_assignment_dimensions_(arena), + tile_assignment_devices_(arena), + tuple_shardings_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpSharding.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.OpSharding) +} +OpSharding::OpSharding(const OpSharding& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + tile_assignment_dimensions_(from.tile_assignment_dimensions_), + tile_assignment_devices_(from.tile_assignment_devices_), + tuple_shardings_(from.tuple_shardings_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_tile_shape()) { + tile_shape_ = new ::xla::ShapeProto(*from.tile_shape_); + } else { + tile_shape_ = NULL; + } + type_ = from.type_; + // @@protoc_insertion_point(copy_constructor:xla.OpSharding) +} + +void OpSharding::SharedCtor() { + ::memset(&tile_shape_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&tile_shape_)) + sizeof(type_)); +} + +OpSharding::~OpSharding() { + // @@protoc_insertion_point(destructor:xla.OpSharding) + SharedDtor(); +} + +void OpSharding::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete tile_shape_; +} + +void OpSharding::ArenaDtor(void* object) { + OpSharding* _this = reinterpret_cast< OpSharding* >(object); + (void)_this; +} +void OpSharding::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpSharding::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpSharding::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpSharding& OpSharding::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_OpSharding.base); + return *internal_default_instance(); +} + + +void OpSharding::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.OpSharding) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tile_assignment_dimensions_.Clear(); + tile_assignment_devices_.Clear(); + tuple_shardings_.Clear(); + if (GetArenaNoVirtual() == NULL && tile_shape_ != NULL) { + delete tile_shape_; + } + tile_shape_ = NULL; + type_ = 0; + _internal_metadata_.Clear(); +} + +bool OpSharding::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.OpSharding) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xla.OpSharding.Type type = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::xla::OpSharding_Type >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ShapeProto tile_shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tile_shape())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 tile_assignment_dimensions = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_tile_assignment_dimensions()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_tile_assignment_dimensions()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 tile_assignment_devices = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_tile_assignment_devices()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 34u, input, this->mutable_tile_assignment_devices()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.OpSharding tuple_shardings = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tuple_shardings())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.OpSharding) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.OpSharding) + return false; +#undef DO_ +} + +void OpSharding::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.OpSharding) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.OpSharding.Type type = 1; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->type(), output); + } + + // .xla.ShapeProto tile_shape = 2; + if (this->has_tile_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_tile_shape(), output); + } + + // repeated int64 tile_assignment_dimensions = 3; + if (this->tile_assignment_dimensions_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _tile_assignment_dimensions_cached_byte_size_)); + } + for (int i = 0, n = this->tile_assignment_dimensions_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->tile_assignment_dimensions(i), output); + } + + // repeated int64 tile_assignment_devices = 4; + if (this->tile_assignment_devices_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _tile_assignment_devices_cached_byte_size_)); + } + for (int i = 0, n = this->tile_assignment_devices_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->tile_assignment_devices(i), output); + } + + // repeated .xla.OpSharding tuple_shardings = 5; + for (unsigned int i = 0, + n = static_cast(this->tuple_shardings_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, + this->tuple_shardings(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.OpSharding) +} + +::google::protobuf::uint8* OpSharding::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.OpSharding) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xla.OpSharding.Type type = 1; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->type(), target); + } + + // .xla.ShapeProto tile_shape = 2; + if (this->has_tile_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_tile_shape(), deterministic, target); + } + + // repeated int64 tile_assignment_dimensions = 3; + if (this->tile_assignment_dimensions_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _tile_assignment_dimensions_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->tile_assignment_dimensions_, target); + } + + // repeated int64 tile_assignment_devices = 4; + if (this->tile_assignment_devices_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _tile_assignment_devices_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->tile_assignment_devices_, target); + } + + // repeated .xla.OpSharding tuple_shardings = 5; + for (unsigned int i = 0, + n = static_cast(this->tuple_shardings_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->tuple_shardings(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.OpSharding) + return target; +} + +size_t OpSharding::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.OpSharding) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 tile_assignment_dimensions = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->tile_assignment_dimensions_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _tile_assignment_dimensions_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 tile_assignment_devices = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->tile_assignment_devices_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _tile_assignment_devices_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .xla.OpSharding tuple_shardings = 5; + { + unsigned int count = static_cast(this->tuple_shardings_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tuple_shardings(static_cast(i))); + } + } + + // .xla.ShapeProto tile_shape = 2; + if (this->has_tile_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tile_shape_); + } + + // .xla.OpSharding.Type type = 1; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpSharding::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.OpSharding) + GOOGLE_DCHECK_NE(&from, this); + const OpSharding* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.OpSharding) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.OpSharding) + MergeFrom(*source); + } +} + +void OpSharding::MergeFrom(const OpSharding& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.OpSharding) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + tile_assignment_dimensions_.MergeFrom(from.tile_assignment_dimensions_); + tile_assignment_devices_.MergeFrom(from.tile_assignment_devices_); + tuple_shardings_.MergeFrom(from.tuple_shardings_); + if (from.has_tile_shape()) { + mutable_tile_shape()->::xla::ShapeProto::MergeFrom(from.tile_shape()); + } + if (from.type() != 0) { + set_type(from.type()); + } +} + +void OpSharding::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.OpSharding) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpSharding::CopyFrom(const OpSharding& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.OpSharding) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpSharding::IsInitialized() const { + return true; +} + +void OpSharding::Swap(OpSharding* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpSharding* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpSharding::UnsafeArenaSwap(OpSharding* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpSharding::InternalSwap(OpSharding* other) { + using std::swap; + tile_assignment_dimensions_.InternalSwap(&other->tile_assignment_dimensions_); + tile_assignment_devices_.InternalSwap(&other->tile_assignment_devices_); + CastToBase(&tuple_shardings_)->InternalSwap(CastToBase(&other->tuple_shardings_)); + swap(tile_shape_, other->tile_shape_); + swap(type_, other->type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpSharding::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ReplicaGroup::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ReplicaGroup::kReplicaIdsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ReplicaGroup::ReplicaGroup() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ReplicaGroup.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.ReplicaGroup) +} +ReplicaGroup::ReplicaGroup(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + replica_ids_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ReplicaGroup.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.ReplicaGroup) +} +ReplicaGroup::ReplicaGroup(const ReplicaGroup& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + replica_ids_(from.replica_ids_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.ReplicaGroup) +} + +void ReplicaGroup::SharedCtor() { +} + +ReplicaGroup::~ReplicaGroup() { + // @@protoc_insertion_point(destructor:xla.ReplicaGroup) + SharedDtor(); +} + +void ReplicaGroup::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ReplicaGroup::ArenaDtor(void* object) { + ReplicaGroup* _this = reinterpret_cast< ReplicaGroup* >(object); + (void)_this; +} +void ReplicaGroup::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ReplicaGroup::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ReplicaGroup::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ReplicaGroup& ReplicaGroup::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ReplicaGroup.base); + return *internal_default_instance(); +} + + +void ReplicaGroup::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.ReplicaGroup) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + replica_ids_.Clear(); + _internal_metadata_.Clear(); +} + +bool ReplicaGroup::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.ReplicaGroup) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 replica_ids = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_replica_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_replica_ids()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.ReplicaGroup) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.ReplicaGroup) + return false; +#undef DO_ +} + +void ReplicaGroup::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.ReplicaGroup) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 replica_ids = 1; + if (this->replica_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _replica_ids_cached_byte_size_)); + } + for (int i = 0, n = this->replica_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->replica_ids(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.ReplicaGroup) +} + +::google::protobuf::uint8* ReplicaGroup::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.ReplicaGroup) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 replica_ids = 1; + if (this->replica_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _replica_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->replica_ids_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.ReplicaGroup) + return target; +} + +size_t ReplicaGroup::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.ReplicaGroup) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 replica_ids = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->replica_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _replica_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ReplicaGroup::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.ReplicaGroup) + GOOGLE_DCHECK_NE(&from, this); + const ReplicaGroup* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.ReplicaGroup) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.ReplicaGroup) + MergeFrom(*source); + } +} + +void ReplicaGroup::MergeFrom(const ReplicaGroup& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.ReplicaGroup) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + replica_ids_.MergeFrom(from.replica_ids_); +} + +void ReplicaGroup::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.ReplicaGroup) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReplicaGroup::CopyFrom(const ReplicaGroup& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.ReplicaGroup) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReplicaGroup::IsInitialized() const { + return true; +} + +void ReplicaGroup::Swap(ReplicaGroup* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ReplicaGroup* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ReplicaGroup::UnsafeArenaSwap(ReplicaGroup* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ReplicaGroup::InternalSwap(ReplicaGroup* other) { + using std::swap; + replica_ids_.InternalSwap(&other->replica_ids_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ReplicaGroup::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SourceTarget::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SourceTarget::kSourceFieldNumber; +const int SourceTarget::kTargetFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SourceTarget::SourceTarget() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_SourceTarget.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.SourceTarget) +} +SourceTarget::SourceTarget(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_SourceTarget.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.SourceTarget) +} +SourceTarget::SourceTarget(const SourceTarget& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&source_, &from.source_, + static_cast(reinterpret_cast(&target_) - + reinterpret_cast(&source_)) + sizeof(target_)); + // @@protoc_insertion_point(copy_constructor:xla.SourceTarget) +} + +void SourceTarget::SharedCtor() { + ::memset(&source_, 0, static_cast( + reinterpret_cast(&target_) - + reinterpret_cast(&source_)) + sizeof(target_)); +} + +SourceTarget::~SourceTarget() { + // @@protoc_insertion_point(destructor:xla.SourceTarget) + SharedDtor(); +} + +void SourceTarget::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void SourceTarget::ArenaDtor(void* object) { + SourceTarget* _this = reinterpret_cast< SourceTarget* >(object); + (void)_this; +} +void SourceTarget::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SourceTarget::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SourceTarget::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SourceTarget& SourceTarget::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_SourceTarget.base); + return *internal_default_instance(); +} + + +void SourceTarget::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.SourceTarget) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&source_, 0, static_cast( + reinterpret_cast(&target_) - + reinterpret_cast(&source_)) + sizeof(target_)); + _internal_metadata_.Clear(); +} + +bool SourceTarget::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.SourceTarget) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 source = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &source_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 target = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &target_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.SourceTarget) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.SourceTarget) + return false; +#undef DO_ +} + +void SourceTarget::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.SourceTarget) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 source = 1; + if (this->source() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->source(), output); + } + + // int64 target = 2; + if (this->target() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->target(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.SourceTarget) +} + +::google::protobuf::uint8* SourceTarget::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.SourceTarget) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 source = 1; + if (this->source() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->source(), target); + } + + // int64 target = 2; + if (this->target() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->target(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.SourceTarget) + return target; +} + +size_t SourceTarget::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.SourceTarget) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 source = 1; + if (this->source() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->source()); + } + + // int64 target = 2; + if (this->target() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->target()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SourceTarget::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.SourceTarget) + GOOGLE_DCHECK_NE(&from, this); + const SourceTarget* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.SourceTarget) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.SourceTarget) + MergeFrom(*source); + } +} + +void SourceTarget::MergeFrom(const SourceTarget& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.SourceTarget) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.source() != 0) { + set_source(from.source()); + } + if (from.target() != 0) { + set_target(from.target()); + } +} + +void SourceTarget::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.SourceTarget) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SourceTarget::CopyFrom(const SourceTarget& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.SourceTarget) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SourceTarget::IsInitialized() const { + return true; +} + +void SourceTarget::Swap(SourceTarget* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SourceTarget* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SourceTarget::UnsafeArenaSwap(SourceTarget* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SourceTarget::InternalSwap(SourceTarget* other) { + using std::swap; + swap(source_, other->source_); + swap(target_, other->target_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SourceTarget::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void PrecisionConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PrecisionConfig::kOperandPrecisionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PrecisionConfig::PrecisionConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PrecisionConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xla.PrecisionConfig) +} +PrecisionConfig::PrecisionConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + operand_precision_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PrecisionConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:xla.PrecisionConfig) +} +PrecisionConfig::PrecisionConfig(const PrecisionConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + operand_precision_(from.operand_precision_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xla.PrecisionConfig) +} + +void PrecisionConfig::SharedCtor() { +} + +PrecisionConfig::~PrecisionConfig() { + // @@protoc_insertion_point(destructor:xla.PrecisionConfig) + SharedDtor(); +} + +void PrecisionConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void PrecisionConfig::ArenaDtor(void* object) { + PrecisionConfig* _this = reinterpret_cast< PrecisionConfig* >(object); + (void)_this; +} +void PrecisionConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void PrecisionConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* PrecisionConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const PrecisionConfig& PrecisionConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_PrecisionConfig.base); + return *internal_default_instance(); +} + + +void PrecisionConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:xla.PrecisionConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + operand_precision_.Clear(); + _internal_metadata_.Clear(); +} + +bool PrecisionConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xla.PrecisionConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xla.PrecisionConfig.Precision operand_precision = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + ::google::protobuf::uint32 length; + DO_(input->ReadVarint32(&length)); + ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast(length)); + while (input->BytesUntilLimit() > 0) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_operand_precision(static_cast< ::xla::PrecisionConfig_Precision >(value)); + } + input->PopLimit(limit); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_operand_precision(static_cast< ::xla::PrecisionConfig_Precision >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xla.PrecisionConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xla.PrecisionConfig) + return false; +#undef DO_ +} + +void PrecisionConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xla.PrecisionConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.PrecisionConfig.Precision operand_precision = 1; + if (this->operand_precision_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + output); + output->WriteVarint32( + static_cast< ::google::protobuf::uint32>(_operand_precision_cached_byte_size_)); + } + for (int i = 0, n = this->operand_precision_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag( + this->operand_precision(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xla.PrecisionConfig) +} + +::google::protobuf::uint8* PrecisionConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xla.PrecisionConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xla.PrecisionConfig.Precision operand_precision = 1; + if (this->operand_precision_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>( + _operand_precision_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray( + this->operand_precision_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xla.PrecisionConfig) + return target; +} + +size_t PrecisionConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xla.PrecisionConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.PrecisionConfig.Precision operand_precision = 1; + { + size_t data_size = 0; + unsigned int count = static_cast(this->operand_precision_size());for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->operand_precision(static_cast(i))); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _operand_precision_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PrecisionConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xla.PrecisionConfig) + GOOGLE_DCHECK_NE(&from, this); + const PrecisionConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xla.PrecisionConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xla.PrecisionConfig) + MergeFrom(*source); + } +} + +void PrecisionConfig::MergeFrom(const PrecisionConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xla.PrecisionConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + operand_precision_.MergeFrom(from.operand_precision_); +} + +void PrecisionConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xla.PrecisionConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PrecisionConfig::CopyFrom(const PrecisionConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xla.PrecisionConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PrecisionConfig::IsInitialized() const { + return true; +} + +void PrecisionConfig::Swap(PrecisionConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + PrecisionConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void PrecisionConfig::UnsafeArenaSwap(PrecisionConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void PrecisionConfig::InternalSwap(PrecisionConfig* other) { + using std::swap; + operand_precision_.InternalSwap(&other->operand_precision_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata PrecisionConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace xla +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::PaddingConfig_PaddingConfigDimension* Arena::CreateMaybeMessage< ::xla::PaddingConfig_PaddingConfigDimension >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::PaddingConfig_PaddingConfigDimension >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::PaddingConfig* Arena::CreateMaybeMessage< ::xla::PaddingConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::PaddingConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::TileProto* Arena::CreateMaybeMessage< ::xla::TileProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::TileProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::LayoutProto* Arena::CreateMaybeMessage< ::xla::LayoutProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::LayoutProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ShapeProto* Arena::CreateMaybeMessage< ::xla::ShapeProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ShapeProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ProgramShapeProto* Arena::CreateMaybeMessage< ::xla::ProgramShapeProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ProgramShapeProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ComputationStats* Arena::CreateMaybeMessage< ::xla::ComputationStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ComputationStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::OpMetadata* Arena::CreateMaybeMessage< ::xla::OpMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::OpMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecutionProfile* Arena::CreateMaybeMessage< ::xla::ExecutionProfile >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ExecutionProfile >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ExecutionHandle* Arena::CreateMaybeMessage< ::xla::ExecutionHandle >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ExecutionHandle >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::GlobalDataHandle* Arena::CreateMaybeMessage< ::xla::GlobalDataHandle >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::GlobalDataHandle >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DeviceHandle* Arena::CreateMaybeMessage< ::xla::DeviceHandle >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::DeviceHandle >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ChannelHandle* Arena::CreateMaybeMessage< ::xla::ChannelHandle >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ChannelHandle >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DeviceAssignmentProto_ComputationDevice* Arena::CreateMaybeMessage< ::xla::DeviceAssignmentProto_ComputationDevice >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::DeviceAssignmentProto_ComputationDevice >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DeviceAssignmentProto* Arena::CreateMaybeMessage< ::xla::DeviceAssignmentProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::DeviceAssignmentProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::LiteralProto* Arena::CreateMaybeMessage< ::xla::LiteralProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::LiteralProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::WindowDimension* Arena::CreateMaybeMessage< ::xla::WindowDimension >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::WindowDimension >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::Window* Arena::CreateMaybeMessage< ::xla::Window >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::Window >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::GatherDimensionNumbers* Arena::CreateMaybeMessage< ::xla::GatherDimensionNumbers >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::GatherDimensionNumbers >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ScatterDimensionNumbers* Arena::CreateMaybeMessage< ::xla::ScatterDimensionNumbers >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ScatterDimensionNumbers >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ConvolutionDimensionNumbers* Arena::CreateMaybeMessage< ::xla::ConvolutionDimensionNumbers >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ConvolutionDimensionNumbers >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::DotDimensionNumbers* Arena::CreateMaybeMessage< ::xla::DotDimensionNumbers >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::DotDimensionNumbers >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::OpSharding* Arena::CreateMaybeMessage< ::xla::OpSharding >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::OpSharding >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::ReplicaGroup* Arena::CreateMaybeMessage< ::xla::ReplicaGroup >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::ReplicaGroup >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::SourceTarget* Arena::CreateMaybeMessage< ::xla::SourceTarget >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::SourceTarget >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xla::PrecisionConfig* Arena::CreateMaybeMessage< ::xla::PrecisionConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::xla::PrecisionConfig >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.pb.h new file mode 100644 index 0000000..0f46e1b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.pb.h @@ -0,0 +1,7375 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xla/xla_data.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[26]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto +namespace xla { +class ChannelHandle; +class ChannelHandleDefaultTypeInternal; +extern ChannelHandleDefaultTypeInternal _ChannelHandle_default_instance_; +class ComputationStats; +class ComputationStatsDefaultTypeInternal; +extern ComputationStatsDefaultTypeInternal _ComputationStats_default_instance_; +class ConvolutionDimensionNumbers; +class ConvolutionDimensionNumbersDefaultTypeInternal; +extern ConvolutionDimensionNumbersDefaultTypeInternal _ConvolutionDimensionNumbers_default_instance_; +class DeviceAssignmentProto; +class DeviceAssignmentProtoDefaultTypeInternal; +extern DeviceAssignmentProtoDefaultTypeInternal _DeviceAssignmentProto_default_instance_; +class DeviceAssignmentProto_ComputationDevice; +class DeviceAssignmentProto_ComputationDeviceDefaultTypeInternal; +extern DeviceAssignmentProto_ComputationDeviceDefaultTypeInternal _DeviceAssignmentProto_ComputationDevice_default_instance_; +class DeviceHandle; +class DeviceHandleDefaultTypeInternal; +extern DeviceHandleDefaultTypeInternal _DeviceHandle_default_instance_; +class DotDimensionNumbers; +class DotDimensionNumbersDefaultTypeInternal; +extern DotDimensionNumbersDefaultTypeInternal _DotDimensionNumbers_default_instance_; +class ExecutionHandle; +class ExecutionHandleDefaultTypeInternal; +extern ExecutionHandleDefaultTypeInternal _ExecutionHandle_default_instance_; +class ExecutionProfile; +class ExecutionProfileDefaultTypeInternal; +extern ExecutionProfileDefaultTypeInternal _ExecutionProfile_default_instance_; +class GatherDimensionNumbers; +class GatherDimensionNumbersDefaultTypeInternal; +extern GatherDimensionNumbersDefaultTypeInternal _GatherDimensionNumbers_default_instance_; +class GlobalDataHandle; +class GlobalDataHandleDefaultTypeInternal; +extern GlobalDataHandleDefaultTypeInternal _GlobalDataHandle_default_instance_; +class LayoutProto; +class LayoutProtoDefaultTypeInternal; +extern LayoutProtoDefaultTypeInternal _LayoutProto_default_instance_; +class LiteralProto; +class LiteralProtoDefaultTypeInternal; +extern LiteralProtoDefaultTypeInternal _LiteralProto_default_instance_; +class OpMetadata; +class OpMetadataDefaultTypeInternal; +extern OpMetadataDefaultTypeInternal _OpMetadata_default_instance_; +class OpSharding; +class OpShardingDefaultTypeInternal; +extern OpShardingDefaultTypeInternal _OpSharding_default_instance_; +class PaddingConfig; +class PaddingConfigDefaultTypeInternal; +extern PaddingConfigDefaultTypeInternal _PaddingConfig_default_instance_; +class PaddingConfig_PaddingConfigDimension; +class PaddingConfig_PaddingConfigDimensionDefaultTypeInternal; +extern PaddingConfig_PaddingConfigDimensionDefaultTypeInternal _PaddingConfig_PaddingConfigDimension_default_instance_; +class PrecisionConfig; +class PrecisionConfigDefaultTypeInternal; +extern PrecisionConfigDefaultTypeInternal _PrecisionConfig_default_instance_; +class ProgramShapeProto; +class ProgramShapeProtoDefaultTypeInternal; +extern ProgramShapeProtoDefaultTypeInternal _ProgramShapeProto_default_instance_; +class ReplicaGroup; +class ReplicaGroupDefaultTypeInternal; +extern ReplicaGroupDefaultTypeInternal _ReplicaGroup_default_instance_; +class ScatterDimensionNumbers; +class ScatterDimensionNumbersDefaultTypeInternal; +extern ScatterDimensionNumbersDefaultTypeInternal _ScatterDimensionNumbers_default_instance_; +class ShapeProto; +class ShapeProtoDefaultTypeInternal; +extern ShapeProtoDefaultTypeInternal _ShapeProto_default_instance_; +class SourceTarget; +class SourceTargetDefaultTypeInternal; +extern SourceTargetDefaultTypeInternal _SourceTarget_default_instance_; +class TileProto; +class TileProtoDefaultTypeInternal; +extern TileProtoDefaultTypeInternal _TileProto_default_instance_; +class Window; +class WindowDefaultTypeInternal; +extern WindowDefaultTypeInternal _Window_default_instance_; +class WindowDimension; +class WindowDimensionDefaultTypeInternal; +extern WindowDimensionDefaultTypeInternal _WindowDimension_default_instance_; +} // namespace xla +namespace google { +namespace protobuf { +template<> ::xla::ChannelHandle* Arena::CreateMaybeMessage<::xla::ChannelHandle>(Arena*); +template<> ::xla::ComputationStats* Arena::CreateMaybeMessage<::xla::ComputationStats>(Arena*); +template<> ::xla::ConvolutionDimensionNumbers* Arena::CreateMaybeMessage<::xla::ConvolutionDimensionNumbers>(Arena*); +template<> ::xla::DeviceAssignmentProto* Arena::CreateMaybeMessage<::xla::DeviceAssignmentProto>(Arena*); +template<> ::xla::DeviceAssignmentProto_ComputationDevice* Arena::CreateMaybeMessage<::xla::DeviceAssignmentProto_ComputationDevice>(Arena*); +template<> ::xla::DeviceHandle* Arena::CreateMaybeMessage<::xla::DeviceHandle>(Arena*); +template<> ::xla::DotDimensionNumbers* Arena::CreateMaybeMessage<::xla::DotDimensionNumbers>(Arena*); +template<> ::xla::ExecutionHandle* Arena::CreateMaybeMessage<::xla::ExecutionHandle>(Arena*); +template<> ::xla::ExecutionProfile* Arena::CreateMaybeMessage<::xla::ExecutionProfile>(Arena*); +template<> ::xla::GatherDimensionNumbers* Arena::CreateMaybeMessage<::xla::GatherDimensionNumbers>(Arena*); +template<> ::xla::GlobalDataHandle* Arena::CreateMaybeMessage<::xla::GlobalDataHandle>(Arena*); +template<> ::xla::LayoutProto* Arena::CreateMaybeMessage<::xla::LayoutProto>(Arena*); +template<> ::xla::LiteralProto* Arena::CreateMaybeMessage<::xla::LiteralProto>(Arena*); +template<> ::xla::OpMetadata* Arena::CreateMaybeMessage<::xla::OpMetadata>(Arena*); +template<> ::xla::OpSharding* Arena::CreateMaybeMessage<::xla::OpSharding>(Arena*); +template<> ::xla::PaddingConfig* Arena::CreateMaybeMessage<::xla::PaddingConfig>(Arena*); +template<> ::xla::PaddingConfig_PaddingConfigDimension* Arena::CreateMaybeMessage<::xla::PaddingConfig_PaddingConfigDimension>(Arena*); +template<> ::xla::PrecisionConfig* Arena::CreateMaybeMessage<::xla::PrecisionConfig>(Arena*); +template<> ::xla::ProgramShapeProto* Arena::CreateMaybeMessage<::xla::ProgramShapeProto>(Arena*); +template<> ::xla::ReplicaGroup* Arena::CreateMaybeMessage<::xla::ReplicaGroup>(Arena*); +template<> ::xla::ScatterDimensionNumbers* Arena::CreateMaybeMessage<::xla::ScatterDimensionNumbers>(Arena*); +template<> ::xla::ShapeProto* Arena::CreateMaybeMessage<::xla::ShapeProto>(Arena*); +template<> ::xla::SourceTarget* Arena::CreateMaybeMessage<::xla::SourceTarget>(Arena*); +template<> ::xla::TileProto* Arena::CreateMaybeMessage<::xla::TileProto>(Arena*); +template<> ::xla::Window* Arena::CreateMaybeMessage<::xla::Window>(Arena*); +template<> ::xla::WindowDimension* Arena::CreateMaybeMessage<::xla::WindowDimension>(Arena*); +} // namespace protobuf +} // namespace google +namespace xla { + +enum ChannelHandle_ChannelType { + ChannelHandle_ChannelType_CHANNEL_TYPE_INVALID = 0, + ChannelHandle_ChannelType_DEVICE_TO_DEVICE = 1, + ChannelHandle_ChannelType_DEVICE_TO_HOST = 2, + ChannelHandle_ChannelType_HOST_TO_DEVICE = 3, + ChannelHandle_ChannelType_ChannelHandle_ChannelType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + ChannelHandle_ChannelType_ChannelHandle_ChannelType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool ChannelHandle_ChannelType_IsValid(int value); +const ChannelHandle_ChannelType ChannelHandle_ChannelType_ChannelType_MIN = ChannelHandle_ChannelType_CHANNEL_TYPE_INVALID; +const ChannelHandle_ChannelType ChannelHandle_ChannelType_ChannelType_MAX = ChannelHandle_ChannelType_HOST_TO_DEVICE; +const int ChannelHandle_ChannelType_ChannelType_ARRAYSIZE = ChannelHandle_ChannelType_ChannelType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ChannelHandle_ChannelType_descriptor(); +inline const ::std::string& ChannelHandle_ChannelType_Name(ChannelHandle_ChannelType value) { + return ::google::protobuf::internal::NameOfEnum( + ChannelHandle_ChannelType_descriptor(), value); +} +inline bool ChannelHandle_ChannelType_Parse( + const ::std::string& name, ChannelHandle_ChannelType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ChannelHandle_ChannelType_descriptor(), name, value); +} +enum OpSharding_Type { + OpSharding_Type_REPLICATED = 0, + OpSharding_Type_MAXIMAL = 1, + OpSharding_Type_TUPLE = 2, + OpSharding_Type_OTHER = 3, + OpSharding_Type_OpSharding_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + OpSharding_Type_OpSharding_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool OpSharding_Type_IsValid(int value); +const OpSharding_Type OpSharding_Type_Type_MIN = OpSharding_Type_REPLICATED; +const OpSharding_Type OpSharding_Type_Type_MAX = OpSharding_Type_OTHER; +const int OpSharding_Type_Type_ARRAYSIZE = OpSharding_Type_Type_MAX + 1; + +const ::google::protobuf::EnumDescriptor* OpSharding_Type_descriptor(); +inline const ::std::string& OpSharding_Type_Name(OpSharding_Type value) { + return ::google::protobuf::internal::NameOfEnum( + OpSharding_Type_descriptor(), value); +} +inline bool OpSharding_Type_Parse( + const ::std::string& name, OpSharding_Type* value) { + return ::google::protobuf::internal::ParseNamedEnum( + OpSharding_Type_descriptor(), name, value); +} +enum PrecisionConfig_Precision { + PrecisionConfig_Precision_DEFAULT = 0, + PrecisionConfig_Precision_HIGH = 1, + PrecisionConfig_Precision_HIGHEST = 2, + PrecisionConfig_Precision_PrecisionConfig_Precision_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + PrecisionConfig_Precision_PrecisionConfig_Precision_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool PrecisionConfig_Precision_IsValid(int value); +const PrecisionConfig_Precision PrecisionConfig_Precision_Precision_MIN = PrecisionConfig_Precision_DEFAULT; +const PrecisionConfig_Precision PrecisionConfig_Precision_Precision_MAX = PrecisionConfig_Precision_HIGHEST; +const int PrecisionConfig_Precision_Precision_ARRAYSIZE = PrecisionConfig_Precision_Precision_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PrecisionConfig_Precision_descriptor(); +inline const ::std::string& PrecisionConfig_Precision_Name(PrecisionConfig_Precision value) { + return ::google::protobuf::internal::NameOfEnum( + PrecisionConfig_Precision_descriptor(), value); +} +inline bool PrecisionConfig_Precision_Parse( + const ::std::string& name, PrecisionConfig_Precision* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PrecisionConfig_Precision_descriptor(), name, value); +} +enum PrimitiveType { + PRIMITIVE_TYPE_INVALID = 0, + PRED = 1, + S8 = 2, + S16 = 3, + S32 = 4, + S64 = 5, + U8 = 6, + U16 = 7, + U32 = 8, + U64 = 9, + F16 = 10, + F32 = 11, + BF16 = 16, + F64 = 12, + C64 = 15, + TUPLE = 13, + OPAQUE = 14, + TOKEN = 17, + PrimitiveType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + PrimitiveType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool PrimitiveType_IsValid(int value); +const PrimitiveType PrimitiveType_MIN = PRIMITIVE_TYPE_INVALID; +const PrimitiveType PrimitiveType_MAX = TOKEN; +const int PrimitiveType_ARRAYSIZE = PrimitiveType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PrimitiveType_descriptor(); +inline const ::std::string& PrimitiveType_Name(PrimitiveType value) { + return ::google::protobuf::internal::NameOfEnum( + PrimitiveType_descriptor(), value); +} +inline bool PrimitiveType_Parse( + const ::std::string& name, PrimitiveType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PrimitiveType_descriptor(), name, value); +} +enum Format { + INVALID_FORMAT = 0, + DENSE = 1, + SPARSE = 2, + Format_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + Format_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool Format_IsValid(int value); +const Format Format_MIN = INVALID_FORMAT; +const Format Format_MAX = SPARSE; +const int Format_ARRAYSIZE = Format_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Format_descriptor(); +inline const ::std::string& Format_Name(Format value) { + return ::google::protobuf::internal::NameOfEnum( + Format_descriptor(), value); +} +inline bool Format_Parse( + const ::std::string& name, Format* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Format_descriptor(), name, value); +} +enum FftType { + FFT = 0, + IFFT = 1, + RFFT = 2, + IRFFT = 3, + FftType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + FftType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool FftType_IsValid(int value); +const FftType FftType_MIN = FFT; +const FftType FftType_MAX = IRFFT; +const int FftType_ARRAYSIZE = FftType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* FftType_descriptor(); +inline const ::std::string& FftType_Name(FftType value) { + return ::google::protobuf::internal::NameOfEnum( + FftType_descriptor(), value); +} +inline bool FftType_Parse( + const ::std::string& name, FftType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FftType_descriptor(), name, value); +} +enum RandomDistribution { + RNG_INVALID = 0, + RNG_UNIFORM = 1, + RNG_NORMAL = 2, + RandomDistribution_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + RandomDistribution_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool RandomDistribution_IsValid(int value); +const RandomDistribution RandomDistribution_MIN = RNG_INVALID; +const RandomDistribution RandomDistribution_MAX = RNG_NORMAL; +const int RandomDistribution_ARRAYSIZE = RandomDistribution_MAX + 1; + +const ::google::protobuf::EnumDescriptor* RandomDistribution_descriptor(); +inline const ::std::string& RandomDistribution_Name(RandomDistribution value) { + return ::google::protobuf::internal::NameOfEnum( + RandomDistribution_descriptor(), value); +} +inline bool RandomDistribution_Parse( + const ::std::string& name, RandomDistribution* value) { + return ::google::protobuf::internal::ParseNamedEnum( + RandomDistribution_descriptor(), name, value); +} +// =================================================================== + +class PaddingConfig_PaddingConfigDimension : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.PaddingConfig.PaddingConfigDimension) */ { + public: + PaddingConfig_PaddingConfigDimension(); + virtual ~PaddingConfig_PaddingConfigDimension(); + + PaddingConfig_PaddingConfigDimension(const PaddingConfig_PaddingConfigDimension& from); + + inline PaddingConfig_PaddingConfigDimension& operator=(const PaddingConfig_PaddingConfigDimension& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + PaddingConfig_PaddingConfigDimension(PaddingConfig_PaddingConfigDimension&& from) noexcept + : PaddingConfig_PaddingConfigDimension() { + *this = ::std::move(from); + } + + inline PaddingConfig_PaddingConfigDimension& operator=(PaddingConfig_PaddingConfigDimension&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const PaddingConfig_PaddingConfigDimension& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const PaddingConfig_PaddingConfigDimension* internal_default_instance() { + return reinterpret_cast( + &_PaddingConfig_PaddingConfigDimension_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(PaddingConfig_PaddingConfigDimension* other); + void Swap(PaddingConfig_PaddingConfigDimension* other); + friend void swap(PaddingConfig_PaddingConfigDimension& a, PaddingConfig_PaddingConfigDimension& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline PaddingConfig_PaddingConfigDimension* New() const final { + return CreateMaybeMessage(NULL); + } + + PaddingConfig_PaddingConfigDimension* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const PaddingConfig_PaddingConfigDimension& from); + void MergeFrom(const PaddingConfig_PaddingConfigDimension& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PaddingConfig_PaddingConfigDimension* other); + protected: + explicit PaddingConfig_PaddingConfigDimension(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 edge_padding_low = 1; + void clear_edge_padding_low(); + static const int kEdgePaddingLowFieldNumber = 1; + ::google::protobuf::int64 edge_padding_low() const; + void set_edge_padding_low(::google::protobuf::int64 value); + + // int64 edge_padding_high = 2; + void clear_edge_padding_high(); + static const int kEdgePaddingHighFieldNumber = 2; + ::google::protobuf::int64 edge_padding_high() const; + void set_edge_padding_high(::google::protobuf::int64 value); + + // int64 interior_padding = 3; + void clear_interior_padding(); + static const int kInteriorPaddingFieldNumber = 3; + ::google::protobuf::int64 interior_padding() const; + void set_interior_padding(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.PaddingConfig.PaddingConfigDimension) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 edge_padding_low_; + ::google::protobuf::int64 edge_padding_high_; + ::google::protobuf::int64 interior_padding_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class PaddingConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.PaddingConfig) */ { + public: + PaddingConfig(); + virtual ~PaddingConfig(); + + PaddingConfig(const PaddingConfig& from); + + inline PaddingConfig& operator=(const PaddingConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + PaddingConfig(PaddingConfig&& from) noexcept + : PaddingConfig() { + *this = ::std::move(from); + } + + inline PaddingConfig& operator=(PaddingConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const PaddingConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const PaddingConfig* internal_default_instance() { + return reinterpret_cast( + &_PaddingConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(PaddingConfig* other); + void Swap(PaddingConfig* other); + friend void swap(PaddingConfig& a, PaddingConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline PaddingConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + PaddingConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const PaddingConfig& from); + void MergeFrom(const PaddingConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PaddingConfig* other); + protected: + explicit PaddingConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef PaddingConfig_PaddingConfigDimension PaddingConfigDimension; + + // accessors ------------------------------------------------------- + + // repeated .xla.PaddingConfig.PaddingConfigDimension dimensions = 1; + int dimensions_size() const; + void clear_dimensions(); + static const int kDimensionsFieldNumber = 1; + ::xla::PaddingConfig_PaddingConfigDimension* mutable_dimensions(int index); + ::google::protobuf::RepeatedPtrField< ::xla::PaddingConfig_PaddingConfigDimension >* + mutable_dimensions(); + const ::xla::PaddingConfig_PaddingConfigDimension& dimensions(int index) const; + ::xla::PaddingConfig_PaddingConfigDimension* add_dimensions(); + const ::google::protobuf::RepeatedPtrField< ::xla::PaddingConfig_PaddingConfigDimension >& + dimensions() const; + + // @@protoc_insertion_point(class_scope:xla.PaddingConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::PaddingConfig_PaddingConfigDimension > dimensions_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TileProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.TileProto) */ { + public: + TileProto(); + virtual ~TileProto(); + + TileProto(const TileProto& from); + + inline TileProto& operator=(const TileProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TileProto(TileProto&& from) noexcept + : TileProto() { + *this = ::std::move(from); + } + + inline TileProto& operator=(TileProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TileProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TileProto* internal_default_instance() { + return reinterpret_cast( + &_TileProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(TileProto* other); + void Swap(TileProto* other); + friend void swap(TileProto& a, TileProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TileProto* New() const final { + return CreateMaybeMessage(NULL); + } + + TileProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TileProto& from); + void MergeFrom(const TileProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TileProto* other); + protected: + explicit TileProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 dimensions = 1; + int dimensions_size() const; + void clear_dimensions(); + static const int kDimensionsFieldNumber = 1; + ::google::protobuf::int64 dimensions(int index) const; + void set_dimensions(int index, ::google::protobuf::int64 value); + void add_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dimensions(); + + // @@protoc_insertion_point(class_scope:xla.TileProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dimensions_; + mutable int _dimensions_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LayoutProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.LayoutProto) */ { + public: + LayoutProto(); + virtual ~LayoutProto(); + + LayoutProto(const LayoutProto& from); + + inline LayoutProto& operator=(const LayoutProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LayoutProto(LayoutProto&& from) noexcept + : LayoutProto() { + *this = ::std::move(from); + } + + inline LayoutProto& operator=(LayoutProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LayoutProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LayoutProto* internal_default_instance() { + return reinterpret_cast( + &_LayoutProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(LayoutProto* other); + void Swap(LayoutProto* other); + friend void swap(LayoutProto& a, LayoutProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LayoutProto* New() const final { + return CreateMaybeMessage(NULL); + } + + LayoutProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LayoutProto& from); + void MergeFrom(const LayoutProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LayoutProto* other); + protected: + explicit LayoutProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 minor_to_major = 1; + int minor_to_major_size() const; + void clear_minor_to_major(); + static const int kMinorToMajorFieldNumber = 1; + ::google::protobuf::int64 minor_to_major(int index) const; + void set_minor_to_major(int index, ::google::protobuf::int64 value); + void add_minor_to_major(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + minor_to_major() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_minor_to_major(); + + // repeated .xla.TileProto tiles = 6; + int tiles_size() const; + void clear_tiles(); + static const int kTilesFieldNumber = 6; + ::xla::TileProto* mutable_tiles(int index); + ::google::protobuf::RepeatedPtrField< ::xla::TileProto >* + mutable_tiles(); + const ::xla::TileProto& tiles(int index) const; + ::xla::TileProto* add_tiles(); + const ::google::protobuf::RepeatedPtrField< ::xla::TileProto >& + tiles() const; + + // int64 max_sparse_elements = 5; + void clear_max_sparse_elements(); + static const int kMaxSparseElementsFieldNumber = 5; + ::google::protobuf::int64 max_sparse_elements() const; + void set_max_sparse_elements(::google::protobuf::int64 value); + + // .xla.Format format = 4; + void clear_format(); + static const int kFormatFieldNumber = 4; + ::xla::Format format() const; + void set_format(::xla::Format value); + + // int64 element_size_in_bits = 7; + void clear_element_size_in_bits(); + static const int kElementSizeInBitsFieldNumber = 7; + ::google::protobuf::int64 element_size_in_bits() const; + void set_element_size_in_bits(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.LayoutProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > minor_to_major_; + mutable int _minor_to_major_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::xla::TileProto > tiles_; + ::google::protobuf::int64 max_sparse_elements_; + int format_; + ::google::protobuf::int64 element_size_in_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ShapeProto) */ { + public: + ShapeProto(); + virtual ~ShapeProto(); + + ShapeProto(const ShapeProto& from); + + inline ShapeProto& operator=(const ShapeProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ShapeProto(ShapeProto&& from) noexcept + : ShapeProto() { + *this = ::std::move(from); + } + + inline ShapeProto& operator=(ShapeProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ShapeProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ShapeProto* internal_default_instance() { + return reinterpret_cast( + &_ShapeProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(ShapeProto* other); + void Swap(ShapeProto* other); + friend void swap(ShapeProto& a, ShapeProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ShapeProto* New() const final { + return CreateMaybeMessage(NULL); + } + + ShapeProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ShapeProto& from); + void MergeFrom(const ShapeProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ShapeProto* other); + protected: + explicit ShapeProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 dimensions = 3; + int dimensions_size() const; + void clear_dimensions(); + static const int kDimensionsFieldNumber = 3; + ::google::protobuf::int64 dimensions(int index) const; + void set_dimensions(int index, ::google::protobuf::int64 value); + void add_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dimensions(); + + // repeated .xla.ShapeProto tuple_shapes = 4; + int tuple_shapes_size() const; + void clear_tuple_shapes(); + static const int kTupleShapesFieldNumber = 4; + ::xla::ShapeProto* mutable_tuple_shapes(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* + mutable_tuple_shapes(); + const ::xla::ShapeProto& tuple_shapes(int index) const; + ::xla::ShapeProto* add_tuple_shapes(); + const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& + tuple_shapes() const; + + // .xla.LayoutProto layout = 5; + bool has_layout() const; + void clear_layout(); + static const int kLayoutFieldNumber = 5; + private: + const ::xla::LayoutProto& _internal_layout() const; + public: + const ::xla::LayoutProto& layout() const; + ::xla::LayoutProto* release_layout(); + ::xla::LayoutProto* mutable_layout(); + void set_allocated_layout(::xla::LayoutProto* layout); + void unsafe_arena_set_allocated_layout( + ::xla::LayoutProto* layout); + ::xla::LayoutProto* unsafe_arena_release_layout(); + + // .xla.PrimitiveType element_type = 2; + void clear_element_type(); + static const int kElementTypeFieldNumber = 2; + ::xla::PrimitiveType element_type() const; + void set_element_type(::xla::PrimitiveType value); + + // @@protoc_insertion_point(class_scope:xla.ShapeProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dimensions_; + mutable int _dimensions_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto > tuple_shapes_; + ::xla::LayoutProto* layout_; + int element_type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProgramShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ProgramShapeProto) */ { + public: + ProgramShapeProto(); + virtual ~ProgramShapeProto(); + + ProgramShapeProto(const ProgramShapeProto& from); + + inline ProgramShapeProto& operator=(const ProgramShapeProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProgramShapeProto(ProgramShapeProto&& from) noexcept + : ProgramShapeProto() { + *this = ::std::move(from); + } + + inline ProgramShapeProto& operator=(ProgramShapeProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ProgramShapeProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProgramShapeProto* internal_default_instance() { + return reinterpret_cast( + &_ProgramShapeProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(ProgramShapeProto* other); + void Swap(ProgramShapeProto* other); + friend void swap(ProgramShapeProto& a, ProgramShapeProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProgramShapeProto* New() const final { + return CreateMaybeMessage(NULL); + } + + ProgramShapeProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProgramShapeProto& from); + void MergeFrom(const ProgramShapeProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProgramShapeProto* other); + protected: + explicit ProgramShapeProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.ShapeProto parameters = 1; + int parameters_size() const; + void clear_parameters(); + static const int kParametersFieldNumber = 1; + ::xla::ShapeProto* mutable_parameters(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* + mutable_parameters(); + const ::xla::ShapeProto& parameters(int index) const; + ::xla::ShapeProto* add_parameters(); + const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& + parameters() const; + + // repeated string parameter_names = 3; + int parameter_names_size() const; + void clear_parameter_names(); + static const int kParameterNamesFieldNumber = 3; + const ::std::string& parameter_names(int index) const; + ::std::string* mutable_parameter_names(int index); + void set_parameter_names(int index, const ::std::string& value); + #if LANG_CXX11 + void set_parameter_names(int index, ::std::string&& value); + #endif + void set_parameter_names(int index, const char* value); + void set_parameter_names(int index, const char* value, size_t size); + ::std::string* add_parameter_names(); + void add_parameter_names(const ::std::string& value); + #if LANG_CXX11 + void add_parameter_names(::std::string&& value); + #endif + void add_parameter_names(const char* value); + void add_parameter_names(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& parameter_names() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_parameter_names(); + + // .xla.ShapeProto result = 2; + bool has_result() const; + void clear_result(); + static const int kResultFieldNumber = 2; + private: + const ::xla::ShapeProto& _internal_result() const; + public: + const ::xla::ShapeProto& result() const; + ::xla::ShapeProto* release_result(); + ::xla::ShapeProto* mutable_result(); + void set_allocated_result(::xla::ShapeProto* result); + void unsafe_arena_set_allocated_result( + ::xla::ShapeProto* result); + ::xla::ShapeProto* unsafe_arena_release_result(); + + // @@protoc_insertion_point(class_scope:xla.ProgramShapeProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto > parameters_; + ::google::protobuf::RepeatedPtrField< ::std::string> parameter_names_; + ::xla::ShapeProto* result_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ComputationStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ComputationStats) */ { + public: + ComputationStats(); + virtual ~ComputationStats(); + + ComputationStats(const ComputationStats& from); + + inline ComputationStats& operator=(const ComputationStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ComputationStats(ComputationStats&& from) noexcept + : ComputationStats() { + *this = ::std::move(from); + } + + inline ComputationStats& operator=(ComputationStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ComputationStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ComputationStats* internal_default_instance() { + return reinterpret_cast( + &_ComputationStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(ComputationStats* other); + void Swap(ComputationStats* other); + friend void swap(ComputationStats& a, ComputationStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ComputationStats* New() const final { + return CreateMaybeMessage(NULL); + } + + ComputationStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ComputationStats& from); + void MergeFrom(const ComputationStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ComputationStats* other); + protected: + explicit ComputationStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // double flop_count = 1; + void clear_flop_count(); + static const int kFlopCountFieldNumber = 1; + double flop_count() const; + void set_flop_count(double value); + + // double transcendental_count = 2; + void clear_transcendental_count(); + static const int kTranscendentalCountFieldNumber = 2; + double transcendental_count() const; + void set_transcendental_count(double value); + + // @@protoc_insertion_point(class_scope:xla.ComputationStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + double flop_count_; + double transcendental_count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.OpMetadata) */ { + public: + OpMetadata(); + virtual ~OpMetadata(); + + OpMetadata(const OpMetadata& from); + + inline OpMetadata& operator=(const OpMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpMetadata(OpMetadata&& from) noexcept + : OpMetadata() { + *this = ::std::move(from); + } + + inline OpMetadata& operator=(OpMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpMetadata* internal_default_instance() { + return reinterpret_cast( + &_OpMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(OpMetadata* other); + void Swap(OpMetadata* other); + friend void swap(OpMetadata& a, OpMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + OpMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpMetadata& from); + void MergeFrom(const OpMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpMetadata* other); + protected: + explicit OpMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string op_type = 1; + void clear_op_type(); + static const int kOpTypeFieldNumber = 1; + const ::std::string& op_type() const; + void set_op_type(const ::std::string& value); + #if LANG_CXX11 + void set_op_type(::std::string&& value); + #endif + void set_op_type(const char* value); + void set_op_type(const char* value, size_t size); + ::std::string* mutable_op_type(); + ::std::string* release_op_type(); + void set_allocated_op_type(::std::string* op_type); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_op_type(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_op_type( + ::std::string* op_type); + + // string op_name = 2; + void clear_op_name(); + static const int kOpNameFieldNumber = 2; + const ::std::string& op_name() const; + void set_op_name(const ::std::string& value); + #if LANG_CXX11 + void set_op_name(::std::string&& value); + #endif + void set_op_name(const char* value); + void set_op_name(const char* value, size_t size); + ::std::string* mutable_op_name(); + ::std::string* release_op_name(); + void set_allocated_op_name(::std::string* op_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_op_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_op_name( + ::std::string* op_name); + + // string source_file = 3; + void clear_source_file(); + static const int kSourceFileFieldNumber = 3; + const ::std::string& source_file() const; + void set_source_file(const ::std::string& value); + #if LANG_CXX11 + void set_source_file(::std::string&& value); + #endif + void set_source_file(const char* value); + void set_source_file(const char* value, size_t size); + ::std::string* mutable_source_file(); + ::std::string* release_source_file(); + void set_allocated_source_file(::std::string* source_file); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_source_file(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_source_file( + ::std::string* source_file); + + // int32 source_line = 4; + void clear_source_line(); + static const int kSourceLineFieldNumber = 4; + ::google::protobuf::int32 source_line() const; + void set_source_line(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:xla.OpMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr op_type_; + ::google::protobuf::internal::ArenaStringPtr op_name_; + ::google::protobuf::internal::ArenaStringPtr source_file_; + ::google::protobuf::int32 source_line_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecutionProfile : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecutionProfile) */ { + public: + ExecutionProfile(); + virtual ~ExecutionProfile(); + + ExecutionProfile(const ExecutionProfile& from); + + inline ExecutionProfile& operator=(const ExecutionProfile& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecutionProfile(ExecutionProfile&& from) noexcept + : ExecutionProfile() { + *this = ::std::move(from); + } + + inline ExecutionProfile& operator=(ExecutionProfile&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecutionProfile& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecutionProfile* internal_default_instance() { + return reinterpret_cast( + &_ExecutionProfile_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(ExecutionProfile* other); + void Swap(ExecutionProfile* other); + friend void swap(ExecutionProfile& a, ExecutionProfile& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecutionProfile* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecutionProfile* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecutionProfile& from); + void MergeFrom(const ExecutionProfile& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecutionProfile* other); + protected: + explicit ExecutionProfile(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 compile_time_ms = 2; + void clear_compile_time_ms(); + static const int kCompileTimeMsFieldNumber = 2; + ::google::protobuf::int64 compile_time_ms() const; + void set_compile_time_ms(::google::protobuf::int64 value); + + // int64 compute_cycle_count = 3; + void clear_compute_cycle_count(); + static const int kComputeCycleCountFieldNumber = 3; + ::google::protobuf::int64 compute_cycle_count() const; + void set_compute_cycle_count(::google::protobuf::int64 value); + + // int64 compute_time_ns = 4; + void clear_compute_time_ns(); + static const int kComputeTimeNsFieldNumber = 4; + ::google::protobuf::int64 compute_time_ns() const; + void set_compute_time_ns(::google::protobuf::int64 value); + + // int64 compute_and_transfer_time_ns = 5; + void clear_compute_and_transfer_time_ns(); + static const int kComputeAndTransferTimeNsFieldNumber = 5; + ::google::protobuf::int64 compute_and_transfer_time_ns() const; + void set_compute_and_transfer_time_ns(::google::protobuf::int64 value); + + // int64 executable_size_in_bytes = 6; + void clear_executable_size_in_bytes(); + static const int kExecutableSizeInBytesFieldNumber = 6; + ::google::protobuf::int64 executable_size_in_bytes() const; + void set_executable_size_in_bytes(::google::protobuf::int64 value); + + // bool compilation_cache_hit = 1; + void clear_compilation_cache_hit(); + static const int kCompilationCacheHitFieldNumber = 1; + bool compilation_cache_hit() const; + void set_compilation_cache_hit(bool value); + + // @@protoc_insertion_point(class_scope:xla.ExecutionProfile) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 compile_time_ms_; + ::google::protobuf::int64 compute_cycle_count_; + ::google::protobuf::int64 compute_time_ns_; + ::google::protobuf::int64 compute_and_transfer_time_ns_; + ::google::protobuf::int64 executable_size_in_bytes_; + bool compilation_cache_hit_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExecutionHandle : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ExecutionHandle) */ { + public: + ExecutionHandle(); + virtual ~ExecutionHandle(); + + ExecutionHandle(const ExecutionHandle& from); + + inline ExecutionHandle& operator=(const ExecutionHandle& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExecutionHandle(ExecutionHandle&& from) noexcept + : ExecutionHandle() { + *this = ::std::move(from); + } + + inline ExecutionHandle& operator=(ExecutionHandle&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ExecutionHandle& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExecutionHandle* internal_default_instance() { + return reinterpret_cast( + &_ExecutionHandle_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void UnsafeArenaSwap(ExecutionHandle* other); + void Swap(ExecutionHandle* other); + friend void swap(ExecutionHandle& a, ExecutionHandle& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExecutionHandle* New() const final { + return CreateMaybeMessage(NULL); + } + + ExecutionHandle* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExecutionHandle& from); + void MergeFrom(const ExecutionHandle& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExecutionHandle* other); + protected: + explicit ExecutionHandle(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 handle = 1; + void clear_handle(); + static const int kHandleFieldNumber = 1; + ::google::protobuf::int64 handle() const; + void set_handle(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.ExecutionHandle) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GlobalDataHandle : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.GlobalDataHandle) */ { + public: + GlobalDataHandle(); + virtual ~GlobalDataHandle(); + + GlobalDataHandle(const GlobalDataHandle& from); + + inline GlobalDataHandle& operator=(const GlobalDataHandle& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GlobalDataHandle(GlobalDataHandle&& from) noexcept + : GlobalDataHandle() { + *this = ::std::move(from); + } + + inline GlobalDataHandle& operator=(GlobalDataHandle&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GlobalDataHandle& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GlobalDataHandle* internal_default_instance() { + return reinterpret_cast( + &_GlobalDataHandle_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void UnsafeArenaSwap(GlobalDataHandle* other); + void Swap(GlobalDataHandle* other); + friend void swap(GlobalDataHandle& a, GlobalDataHandle& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GlobalDataHandle* New() const final { + return CreateMaybeMessage(NULL); + } + + GlobalDataHandle* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GlobalDataHandle& from); + void MergeFrom(const GlobalDataHandle& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GlobalDataHandle* other); + protected: + explicit GlobalDataHandle(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 handle = 1; + void clear_handle(); + static const int kHandleFieldNumber = 1; + ::google::protobuf::int64 handle() const; + void set_handle(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.GlobalDataHandle) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceHandle : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DeviceHandle) */ { + public: + DeviceHandle(); + virtual ~DeviceHandle(); + + DeviceHandle(const DeviceHandle& from); + + inline DeviceHandle& operator=(const DeviceHandle& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceHandle(DeviceHandle&& from) noexcept + : DeviceHandle() { + *this = ::std::move(from); + } + + inline DeviceHandle& operator=(DeviceHandle&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceHandle& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceHandle* internal_default_instance() { + return reinterpret_cast( + &_DeviceHandle_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void UnsafeArenaSwap(DeviceHandle* other); + void Swap(DeviceHandle* other); + friend void swap(DeviceHandle& a, DeviceHandle& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceHandle* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceHandle* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceHandle& from); + void MergeFrom(const DeviceHandle& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceHandle* other); + protected: + explicit DeviceHandle(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 handle = 1; + void clear_handle(); + static const int kHandleFieldNumber = 1; + ::google::protobuf::int64 handle() const; + void set_handle(::google::protobuf::int64 value); + + // int64 device_count = 2; + void clear_device_count(); + static const int kDeviceCountFieldNumber = 2; + ::google::protobuf::int64 device_count() const; + void set_device_count(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.DeviceHandle) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 handle_; + ::google::protobuf::int64 device_count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ChannelHandle : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ChannelHandle) */ { + public: + ChannelHandle(); + virtual ~ChannelHandle(); + + ChannelHandle(const ChannelHandle& from); + + inline ChannelHandle& operator=(const ChannelHandle& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ChannelHandle(ChannelHandle&& from) noexcept + : ChannelHandle() { + *this = ::std::move(from); + } + + inline ChannelHandle& operator=(ChannelHandle&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ChannelHandle& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ChannelHandle* internal_default_instance() { + return reinterpret_cast( + &_ChannelHandle_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void UnsafeArenaSwap(ChannelHandle* other); + void Swap(ChannelHandle* other); + friend void swap(ChannelHandle& a, ChannelHandle& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ChannelHandle* New() const final { + return CreateMaybeMessage(NULL); + } + + ChannelHandle* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ChannelHandle& from); + void MergeFrom(const ChannelHandle& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ChannelHandle* other); + protected: + explicit ChannelHandle(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef ChannelHandle_ChannelType ChannelType; + static const ChannelType CHANNEL_TYPE_INVALID = + ChannelHandle_ChannelType_CHANNEL_TYPE_INVALID; + static const ChannelType DEVICE_TO_DEVICE = + ChannelHandle_ChannelType_DEVICE_TO_DEVICE; + static const ChannelType DEVICE_TO_HOST = + ChannelHandle_ChannelType_DEVICE_TO_HOST; + static const ChannelType HOST_TO_DEVICE = + ChannelHandle_ChannelType_HOST_TO_DEVICE; + static inline bool ChannelType_IsValid(int value) { + return ChannelHandle_ChannelType_IsValid(value); + } + static const ChannelType ChannelType_MIN = + ChannelHandle_ChannelType_ChannelType_MIN; + static const ChannelType ChannelType_MAX = + ChannelHandle_ChannelType_ChannelType_MAX; + static const int ChannelType_ARRAYSIZE = + ChannelHandle_ChannelType_ChannelType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + ChannelType_descriptor() { + return ChannelHandle_ChannelType_descriptor(); + } + static inline const ::std::string& ChannelType_Name(ChannelType value) { + return ChannelHandle_ChannelType_Name(value); + } + static inline bool ChannelType_Parse(const ::std::string& name, + ChannelType* value) { + return ChannelHandle_ChannelType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // int64 handle = 1; + void clear_handle(); + static const int kHandleFieldNumber = 1; + ::google::protobuf::int64 handle() const; + void set_handle(::google::protobuf::int64 value); + + // .xla.ChannelHandle.ChannelType type = 2; + void clear_type(); + static const int kTypeFieldNumber = 2; + ::xla::ChannelHandle_ChannelType type() const; + void set_type(::xla::ChannelHandle_ChannelType value); + + // @@protoc_insertion_point(class_scope:xla.ChannelHandle) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 handle_; + int type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceAssignmentProto_ComputationDevice : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DeviceAssignmentProto.ComputationDevice) */ { + public: + DeviceAssignmentProto_ComputationDevice(); + virtual ~DeviceAssignmentProto_ComputationDevice(); + + DeviceAssignmentProto_ComputationDevice(const DeviceAssignmentProto_ComputationDevice& from); + + inline DeviceAssignmentProto_ComputationDevice& operator=(const DeviceAssignmentProto_ComputationDevice& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceAssignmentProto_ComputationDevice(DeviceAssignmentProto_ComputationDevice&& from) noexcept + : DeviceAssignmentProto_ComputationDevice() { + *this = ::std::move(from); + } + + inline DeviceAssignmentProto_ComputationDevice& operator=(DeviceAssignmentProto_ComputationDevice&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceAssignmentProto_ComputationDevice& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceAssignmentProto_ComputationDevice* internal_default_instance() { + return reinterpret_cast( + &_DeviceAssignmentProto_ComputationDevice_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void UnsafeArenaSwap(DeviceAssignmentProto_ComputationDevice* other); + void Swap(DeviceAssignmentProto_ComputationDevice* other); + friend void swap(DeviceAssignmentProto_ComputationDevice& a, DeviceAssignmentProto_ComputationDevice& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceAssignmentProto_ComputationDevice* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceAssignmentProto_ComputationDevice* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceAssignmentProto_ComputationDevice& from); + void MergeFrom(const DeviceAssignmentProto_ComputationDevice& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceAssignmentProto_ComputationDevice* other); + protected: + explicit DeviceAssignmentProto_ComputationDevice(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 replica_device_ids = 1; + int replica_device_ids_size() const; + void clear_replica_device_ids(); + static const int kReplicaDeviceIdsFieldNumber = 1; + ::google::protobuf::int32 replica_device_ids(int index) const; + void set_replica_device_ids(int index, ::google::protobuf::int32 value); + void add_replica_device_ids(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + replica_device_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_replica_device_ids(); + + // @@protoc_insertion_point(class_scope:xla.DeviceAssignmentProto.ComputationDevice) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > replica_device_ids_; + mutable int _replica_device_ids_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceAssignmentProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DeviceAssignmentProto) */ { + public: + DeviceAssignmentProto(); + virtual ~DeviceAssignmentProto(); + + DeviceAssignmentProto(const DeviceAssignmentProto& from); + + inline DeviceAssignmentProto& operator=(const DeviceAssignmentProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceAssignmentProto(DeviceAssignmentProto&& from) noexcept + : DeviceAssignmentProto() { + *this = ::std::move(from); + } + + inline DeviceAssignmentProto& operator=(DeviceAssignmentProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceAssignmentProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceAssignmentProto* internal_default_instance() { + return reinterpret_cast( + &_DeviceAssignmentProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + void UnsafeArenaSwap(DeviceAssignmentProto* other); + void Swap(DeviceAssignmentProto* other); + friend void swap(DeviceAssignmentProto& a, DeviceAssignmentProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceAssignmentProto* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceAssignmentProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceAssignmentProto& from); + void MergeFrom(const DeviceAssignmentProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceAssignmentProto* other); + protected: + explicit DeviceAssignmentProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef DeviceAssignmentProto_ComputationDevice ComputationDevice; + + // accessors ------------------------------------------------------- + + // repeated .xla.DeviceAssignmentProto.ComputationDevice computation_devices = 3; + int computation_devices_size() const; + void clear_computation_devices(); + static const int kComputationDevicesFieldNumber = 3; + ::xla::DeviceAssignmentProto_ComputationDevice* mutable_computation_devices(int index); + ::google::protobuf::RepeatedPtrField< ::xla::DeviceAssignmentProto_ComputationDevice >* + mutable_computation_devices(); + const ::xla::DeviceAssignmentProto_ComputationDevice& computation_devices(int index) const; + ::xla::DeviceAssignmentProto_ComputationDevice* add_computation_devices(); + const ::google::protobuf::RepeatedPtrField< ::xla::DeviceAssignmentProto_ComputationDevice >& + computation_devices() const; + + // int32 replica_count = 1; + void clear_replica_count(); + static const int kReplicaCountFieldNumber = 1; + ::google::protobuf::int32 replica_count() const; + void set_replica_count(::google::protobuf::int32 value); + + // int32 computation_count = 2; + void clear_computation_count(); + static const int kComputationCountFieldNumber = 2; + ::google::protobuf::int32 computation_count() const; + void set_computation_count(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:xla.DeviceAssignmentProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::DeviceAssignmentProto_ComputationDevice > computation_devices_; + ::google::protobuf::int32 replica_count_; + ::google::protobuf::int32 computation_count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LiteralProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.LiteralProto) */ { + public: + LiteralProto(); + virtual ~LiteralProto(); + + LiteralProto(const LiteralProto& from); + + inline LiteralProto& operator=(const LiteralProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LiteralProto(LiteralProto&& from) noexcept + : LiteralProto() { + *this = ::std::move(from); + } + + inline LiteralProto& operator=(LiteralProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LiteralProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LiteralProto* internal_default_instance() { + return reinterpret_cast( + &_LiteralProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void UnsafeArenaSwap(LiteralProto* other); + void Swap(LiteralProto* other); + friend void swap(LiteralProto& a, LiteralProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LiteralProto* New() const final { + return CreateMaybeMessage(NULL); + } + + LiteralProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LiteralProto& from); + void MergeFrom(const LiteralProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LiteralProto* other); + protected: + explicit LiteralProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bool preds = 2; + int preds_size() const; + void clear_preds(); + static const int kPredsFieldNumber = 2; + bool preds(int index) const; + void set_preds(int index, bool value); + void add_preds(bool value); + const ::google::protobuf::RepeatedField< bool >& + preds() const; + ::google::protobuf::RepeatedField< bool >* + mutable_preds(); + + // repeated int32 s32s = 4; + int s32s_size() const; + void clear_s32s(); + static const int kS32SFieldNumber = 4; + ::google::protobuf::int32 s32s(int index) const; + void set_s32s(int index, ::google::protobuf::int32 value); + void add_s32s(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + s32s() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_s32s(); + + // repeated int64 s64s = 5; + int s64s_size() const; + void clear_s64s(); + static const int kS64SFieldNumber = 5; + ::google::protobuf::int64 s64s(int index) const; + void set_s64s(int index, ::google::protobuf::int64 value); + void add_s64s(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + s64s() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_s64s(); + + // repeated uint32 u32s = 6; + int u32s_size() const; + void clear_u32s(); + static const int kU32SFieldNumber = 6; + ::google::protobuf::uint32 u32s(int index) const; + void set_u32s(int index, ::google::protobuf::uint32 value); + void add_u32s(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + u32s() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_u32s(); + + // repeated uint64 u64s = 7; + int u64s_size() const; + void clear_u64s(); + static const int kU64SFieldNumber = 7; + ::google::protobuf::uint64 u64s(int index) const; + void set_u64s(int index, ::google::protobuf::uint64 value); + void add_u64s(::google::protobuf::uint64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >& + u64s() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >* + mutable_u64s(); + + // repeated float f32s = 8; + int f32s_size() const; + void clear_f32s(); + static const int kF32SFieldNumber = 8; + float f32s(int index) const; + void set_f32s(int index, float value); + void add_f32s(float value); + const ::google::protobuf::RepeatedField< float >& + f32s() const; + ::google::protobuf::RepeatedField< float >* + mutable_f32s(); + + // repeated double f64s = 9; + int f64s_size() const; + void clear_f64s(); + static const int kF64SFieldNumber = 9; + double f64s(int index) const; + void set_f64s(int index, double value); + void add_f64s(double value); + const ::google::protobuf::RepeatedField< double >& + f64s() const; + ::google::protobuf::RepeatedField< double >* + mutable_f64s(); + + // repeated .xla.LiteralProto tuple_literals = 10; + int tuple_literals_size() const; + void clear_tuple_literals(); + static const int kTupleLiteralsFieldNumber = 10; + ::xla::LiteralProto* mutable_tuple_literals(int index); + ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >* + mutable_tuple_literals(); + const ::xla::LiteralProto& tuple_literals(int index) const; + ::xla::LiteralProto* add_tuple_literals(); + const ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >& + tuple_literals() const; + + // repeated float c64s = 12; + int c64s_size() const; + void clear_c64s(); + static const int kC64SFieldNumber = 12; + float c64s(int index) const; + void set_c64s(int index, float value); + void add_c64s(float value); + const ::google::protobuf::RepeatedField< float >& + c64s() const; + ::google::protobuf::RepeatedField< float >* + mutable_c64s(); + + // repeated int64 sparse_indices = 14; + int sparse_indices_size() const; + void clear_sparse_indices(); + static const int kSparseIndicesFieldNumber = 14; + ::google::protobuf::int64 sparse_indices(int index) const; + void set_sparse_indices(int index, ::google::protobuf::int64 value); + void add_sparse_indices(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + sparse_indices() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_sparse_indices(); + + // bytes u8s = 3; + void clear_u8s(); + static const int kU8SFieldNumber = 3; + const ::std::string& u8s() const; + void set_u8s(const ::std::string& value); + #if LANG_CXX11 + void set_u8s(::std::string&& value); + #endif + void set_u8s(const char* value); + void set_u8s(const void* value, size_t size); + ::std::string* mutable_u8s(); + ::std::string* release_u8s(); + void set_allocated_u8s(::std::string* u8s); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_u8s(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_u8s( + ::std::string* u8s); + + // bytes f16s = 11; + void clear_f16s(); + static const int kF16SFieldNumber = 11; + const ::std::string& f16s() const; + void set_f16s(const ::std::string& value); + #if LANG_CXX11 + void set_f16s(::std::string&& value); + #endif + void set_f16s(const char* value); + void set_f16s(const void* value, size_t size); + ::std::string* mutable_f16s(); + ::std::string* release_f16s(); + void set_allocated_f16s(::std::string* f16s); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_f16s(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_f16s( + ::std::string* f16s); + + // bytes bf16s = 13; + void clear_bf16s(); + static const int kBf16SFieldNumber = 13; + const ::std::string& bf16s() const; + void set_bf16s(const ::std::string& value); + #if LANG_CXX11 + void set_bf16s(::std::string&& value); + #endif + void set_bf16s(const char* value); + void set_bf16s(const void* value, size_t size); + ::std::string* mutable_bf16s(); + ::std::string* release_bf16s(); + void set_allocated_bf16s(::std::string* bf16s); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_bf16s(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_bf16s( + ::std::string* bf16s); + + // bytes s8s = 15; + void clear_s8s(); + static const int kS8SFieldNumber = 15; + const ::std::string& s8s() const; + void set_s8s(const ::std::string& value); + #if LANG_CXX11 + void set_s8s(::std::string&& value); + #endif + void set_s8s(const char* value); + void set_s8s(const void* value, size_t size); + ::std::string* mutable_s8s(); + ::std::string* release_s8s(); + void set_allocated_s8s(::std::string* s8s); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_s8s(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_s8s( + ::std::string* s8s); + + // bytes u16s = 16; + void clear_u16s(); + static const int kU16SFieldNumber = 16; + const ::std::string& u16s() const; + void set_u16s(const ::std::string& value); + #if LANG_CXX11 + void set_u16s(::std::string&& value); + #endif + void set_u16s(const char* value); + void set_u16s(const void* value, size_t size); + ::std::string* mutable_u16s(); + ::std::string* release_u16s(); + void set_allocated_u16s(::std::string* u16s); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_u16s(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_u16s( + ::std::string* u16s); + + // bytes s16s = 17; + void clear_s16s(); + static const int kS16SFieldNumber = 17; + const ::std::string& s16s() const; + void set_s16s(const ::std::string& value); + #if LANG_CXX11 + void set_s16s(::std::string&& value); + #endif + void set_s16s(const char* value); + void set_s16s(const void* value, size_t size); + ::std::string* mutable_s16s(); + ::std::string* release_s16s(); + void set_allocated_s16s(::std::string* s16s); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_s16s(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_s16s( + ::std::string* s16s); + + // .xla.ShapeProto shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + private: + const ::xla::ShapeProto& _internal_shape() const; + public: + const ::xla::ShapeProto& shape() const; + ::xla::ShapeProto* release_shape(); + ::xla::ShapeProto* mutable_shape(); + void set_allocated_shape(::xla::ShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::xla::ShapeProto* shape); + ::xla::ShapeProto* unsafe_arena_release_shape(); + + // @@protoc_insertion_point(class_scope:xla.LiteralProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< bool > preds_; + mutable int _preds_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > s32s_; + mutable int _s32s_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > s64s_; + mutable int _s64s_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > u32s_; + mutable int _u32s_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint64 > u64s_; + mutable int _u64s_cached_byte_size_; + ::google::protobuf::RepeatedField< float > f32s_; + mutable int _f32s_cached_byte_size_; + ::google::protobuf::RepeatedField< double > f64s_; + mutable int _f64s_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto > tuple_literals_; + ::google::protobuf::RepeatedField< float > c64s_; + mutable int _c64s_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > sparse_indices_; + mutable int _sparse_indices_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr u8s_; + ::google::protobuf::internal::ArenaStringPtr f16s_; + ::google::protobuf::internal::ArenaStringPtr bf16s_; + ::google::protobuf::internal::ArenaStringPtr s8s_; + ::google::protobuf::internal::ArenaStringPtr u16s_; + ::google::protobuf::internal::ArenaStringPtr s16s_; + ::xla::ShapeProto* shape_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class WindowDimension : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.WindowDimension) */ { + public: + WindowDimension(); + virtual ~WindowDimension(); + + WindowDimension(const WindowDimension& from); + + inline WindowDimension& operator=(const WindowDimension& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + WindowDimension(WindowDimension&& from) noexcept + : WindowDimension() { + *this = ::std::move(from); + } + + inline WindowDimension& operator=(WindowDimension&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const WindowDimension& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WindowDimension* internal_default_instance() { + return reinterpret_cast( + &_WindowDimension_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + void UnsafeArenaSwap(WindowDimension* other); + void Swap(WindowDimension* other); + friend void swap(WindowDimension& a, WindowDimension& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline WindowDimension* New() const final { + return CreateMaybeMessage(NULL); + } + + WindowDimension* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const WindowDimension& from); + void MergeFrom(const WindowDimension& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WindowDimension* other); + protected: + explicit WindowDimension(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 size = 1; + void clear_size(); + static const int kSizeFieldNumber = 1; + ::google::protobuf::int64 size() const; + void set_size(::google::protobuf::int64 value); + + // int64 stride = 2; + void clear_stride(); + static const int kStrideFieldNumber = 2; + ::google::protobuf::int64 stride() const; + void set_stride(::google::protobuf::int64 value); + + // int64 padding_low = 3; + void clear_padding_low(); + static const int kPaddingLowFieldNumber = 3; + ::google::protobuf::int64 padding_low() const; + void set_padding_low(::google::protobuf::int64 value); + + // int64 padding_high = 4; + void clear_padding_high(); + static const int kPaddingHighFieldNumber = 4; + ::google::protobuf::int64 padding_high() const; + void set_padding_high(::google::protobuf::int64 value); + + // int64 window_dilation = 5; + void clear_window_dilation(); + static const int kWindowDilationFieldNumber = 5; + ::google::protobuf::int64 window_dilation() const; + void set_window_dilation(::google::protobuf::int64 value); + + // int64 base_dilation = 6; + void clear_base_dilation(); + static const int kBaseDilationFieldNumber = 6; + ::google::protobuf::int64 base_dilation() const; + void set_base_dilation(::google::protobuf::int64 value); + + // bool window_reversal = 7; + void clear_window_reversal(); + static const int kWindowReversalFieldNumber = 7; + bool window_reversal() const; + void set_window_reversal(bool value); + + // @@protoc_insertion_point(class_scope:xla.WindowDimension) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 size_; + ::google::protobuf::int64 stride_; + ::google::protobuf::int64 padding_low_; + ::google::protobuf::int64 padding_high_; + ::google::protobuf::int64 window_dilation_; + ::google::protobuf::int64 base_dilation_; + bool window_reversal_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Window : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.Window) */ { + public: + Window(); + virtual ~Window(); + + Window(const Window& from); + + inline Window& operator=(const Window& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Window(Window&& from) noexcept + : Window() { + *this = ::std::move(from); + } + + inline Window& operator=(Window&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Window& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Window* internal_default_instance() { + return reinterpret_cast( + &_Window_default_instance_); + } + static constexpr int kIndexInFileMessages = + 17; + + void UnsafeArenaSwap(Window* other); + void Swap(Window* other); + friend void swap(Window& a, Window& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Window* New() const final { + return CreateMaybeMessage(NULL); + } + + Window* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Window& from); + void MergeFrom(const Window& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Window* other); + protected: + explicit Window(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.WindowDimension dimensions = 1; + int dimensions_size() const; + void clear_dimensions(); + static const int kDimensionsFieldNumber = 1; + ::xla::WindowDimension* mutable_dimensions(int index); + ::google::protobuf::RepeatedPtrField< ::xla::WindowDimension >* + mutable_dimensions(); + const ::xla::WindowDimension& dimensions(int index) const; + ::xla::WindowDimension* add_dimensions(); + const ::google::protobuf::RepeatedPtrField< ::xla::WindowDimension >& + dimensions() const; + + // @@protoc_insertion_point(class_scope:xla.Window) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::WindowDimension > dimensions_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GatherDimensionNumbers : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.GatherDimensionNumbers) */ { + public: + GatherDimensionNumbers(); + virtual ~GatherDimensionNumbers(); + + GatherDimensionNumbers(const GatherDimensionNumbers& from); + + inline GatherDimensionNumbers& operator=(const GatherDimensionNumbers& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GatherDimensionNumbers(GatherDimensionNumbers&& from) noexcept + : GatherDimensionNumbers() { + *this = ::std::move(from); + } + + inline GatherDimensionNumbers& operator=(GatherDimensionNumbers&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GatherDimensionNumbers& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GatherDimensionNumbers* internal_default_instance() { + return reinterpret_cast( + &_GatherDimensionNumbers_default_instance_); + } + static constexpr int kIndexInFileMessages = + 18; + + void UnsafeArenaSwap(GatherDimensionNumbers* other); + void Swap(GatherDimensionNumbers* other); + friend void swap(GatherDimensionNumbers& a, GatherDimensionNumbers& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GatherDimensionNumbers* New() const final { + return CreateMaybeMessage(NULL); + } + + GatherDimensionNumbers* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GatherDimensionNumbers& from); + void MergeFrom(const GatherDimensionNumbers& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GatherDimensionNumbers* other); + protected: + explicit GatherDimensionNumbers(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 offset_dims = 1; + int offset_dims_size() const; + void clear_offset_dims(); + static const int kOffsetDimsFieldNumber = 1; + ::google::protobuf::int64 offset_dims(int index) const; + void set_offset_dims(int index, ::google::protobuf::int64 value); + void add_offset_dims(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + offset_dims() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_offset_dims(); + + // repeated int64 collapsed_slice_dims = 2; + int collapsed_slice_dims_size() const; + void clear_collapsed_slice_dims(); + static const int kCollapsedSliceDimsFieldNumber = 2; + ::google::protobuf::int64 collapsed_slice_dims(int index) const; + void set_collapsed_slice_dims(int index, ::google::protobuf::int64 value); + void add_collapsed_slice_dims(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + collapsed_slice_dims() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_collapsed_slice_dims(); + + // repeated int64 start_index_map = 3; + int start_index_map_size() const; + void clear_start_index_map(); + static const int kStartIndexMapFieldNumber = 3; + ::google::protobuf::int64 start_index_map(int index) const; + void set_start_index_map(int index, ::google::protobuf::int64 value); + void add_start_index_map(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + start_index_map() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_start_index_map(); + + // int64 index_vector_dim = 4; + void clear_index_vector_dim(); + static const int kIndexVectorDimFieldNumber = 4; + ::google::protobuf::int64 index_vector_dim() const; + void set_index_vector_dim(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.GatherDimensionNumbers) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > offset_dims_; + mutable int _offset_dims_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > collapsed_slice_dims_; + mutable int _collapsed_slice_dims_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > start_index_map_; + mutable int _start_index_map_cached_byte_size_; + ::google::protobuf::int64 index_vector_dim_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ScatterDimensionNumbers : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ScatterDimensionNumbers) */ { + public: + ScatterDimensionNumbers(); + virtual ~ScatterDimensionNumbers(); + + ScatterDimensionNumbers(const ScatterDimensionNumbers& from); + + inline ScatterDimensionNumbers& operator=(const ScatterDimensionNumbers& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ScatterDimensionNumbers(ScatterDimensionNumbers&& from) noexcept + : ScatterDimensionNumbers() { + *this = ::std::move(from); + } + + inline ScatterDimensionNumbers& operator=(ScatterDimensionNumbers&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ScatterDimensionNumbers& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ScatterDimensionNumbers* internal_default_instance() { + return reinterpret_cast( + &_ScatterDimensionNumbers_default_instance_); + } + static constexpr int kIndexInFileMessages = + 19; + + void UnsafeArenaSwap(ScatterDimensionNumbers* other); + void Swap(ScatterDimensionNumbers* other); + friend void swap(ScatterDimensionNumbers& a, ScatterDimensionNumbers& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ScatterDimensionNumbers* New() const final { + return CreateMaybeMessage(NULL); + } + + ScatterDimensionNumbers* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ScatterDimensionNumbers& from); + void MergeFrom(const ScatterDimensionNumbers& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ScatterDimensionNumbers* other); + protected: + explicit ScatterDimensionNumbers(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 update_window_dims = 1; + int update_window_dims_size() const; + void clear_update_window_dims(); + static const int kUpdateWindowDimsFieldNumber = 1; + ::google::protobuf::int64 update_window_dims(int index) const; + void set_update_window_dims(int index, ::google::protobuf::int64 value); + void add_update_window_dims(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + update_window_dims() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_update_window_dims(); + + // repeated int64 inserted_window_dims = 2; + int inserted_window_dims_size() const; + void clear_inserted_window_dims(); + static const int kInsertedWindowDimsFieldNumber = 2; + ::google::protobuf::int64 inserted_window_dims(int index) const; + void set_inserted_window_dims(int index, ::google::protobuf::int64 value); + void add_inserted_window_dims(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + inserted_window_dims() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_inserted_window_dims(); + + // repeated int64 scatter_dims_to_operand_dims = 3; + int scatter_dims_to_operand_dims_size() const; + void clear_scatter_dims_to_operand_dims(); + static const int kScatterDimsToOperandDimsFieldNumber = 3; + ::google::protobuf::int64 scatter_dims_to_operand_dims(int index) const; + void set_scatter_dims_to_operand_dims(int index, ::google::protobuf::int64 value); + void add_scatter_dims_to_operand_dims(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + scatter_dims_to_operand_dims() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_scatter_dims_to_operand_dims(); + + // int64 index_vector_dim = 4; + void clear_index_vector_dim(); + static const int kIndexVectorDimFieldNumber = 4; + ::google::protobuf::int64 index_vector_dim() const; + void set_index_vector_dim(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.ScatterDimensionNumbers) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > update_window_dims_; + mutable int _update_window_dims_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > inserted_window_dims_; + mutable int _inserted_window_dims_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > scatter_dims_to_operand_dims_; + mutable int _scatter_dims_to_operand_dims_cached_byte_size_; + ::google::protobuf::int64 index_vector_dim_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ConvolutionDimensionNumbers : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ConvolutionDimensionNumbers) */ { + public: + ConvolutionDimensionNumbers(); + virtual ~ConvolutionDimensionNumbers(); + + ConvolutionDimensionNumbers(const ConvolutionDimensionNumbers& from); + + inline ConvolutionDimensionNumbers& operator=(const ConvolutionDimensionNumbers& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ConvolutionDimensionNumbers(ConvolutionDimensionNumbers&& from) noexcept + : ConvolutionDimensionNumbers() { + *this = ::std::move(from); + } + + inline ConvolutionDimensionNumbers& operator=(ConvolutionDimensionNumbers&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ConvolutionDimensionNumbers& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ConvolutionDimensionNumbers* internal_default_instance() { + return reinterpret_cast( + &_ConvolutionDimensionNumbers_default_instance_); + } + static constexpr int kIndexInFileMessages = + 20; + + void UnsafeArenaSwap(ConvolutionDimensionNumbers* other); + void Swap(ConvolutionDimensionNumbers* other); + friend void swap(ConvolutionDimensionNumbers& a, ConvolutionDimensionNumbers& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ConvolutionDimensionNumbers* New() const final { + return CreateMaybeMessage(NULL); + } + + ConvolutionDimensionNumbers* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ConvolutionDimensionNumbers& from); + void MergeFrom(const ConvolutionDimensionNumbers& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ConvolutionDimensionNumbers* other); + protected: + explicit ConvolutionDimensionNumbers(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 kernel_spatial_dimensions = 6; + int kernel_spatial_dimensions_size() const; + void clear_kernel_spatial_dimensions(); + static const int kKernelSpatialDimensionsFieldNumber = 6; + ::google::protobuf::int64 kernel_spatial_dimensions(int index) const; + void set_kernel_spatial_dimensions(int index, ::google::protobuf::int64 value); + void add_kernel_spatial_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + kernel_spatial_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_kernel_spatial_dimensions(); + + // repeated int64 input_spatial_dimensions = 11; + int input_spatial_dimensions_size() const; + void clear_input_spatial_dimensions(); + static const int kInputSpatialDimensionsFieldNumber = 11; + ::google::protobuf::int64 input_spatial_dimensions(int index) const; + void set_input_spatial_dimensions(int index, ::google::protobuf::int64 value); + void add_input_spatial_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + input_spatial_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_input_spatial_dimensions(); + + // repeated int64 output_spatial_dimensions = 12; + int output_spatial_dimensions_size() const; + void clear_output_spatial_dimensions(); + static const int kOutputSpatialDimensionsFieldNumber = 12; + ::google::protobuf::int64 output_spatial_dimensions(int index) const; + void set_output_spatial_dimensions(int index, ::google::protobuf::int64 value); + void add_output_spatial_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + output_spatial_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_output_spatial_dimensions(); + + // int64 kernel_input_feature_dimension = 3; + void clear_kernel_input_feature_dimension(); + static const int kKernelInputFeatureDimensionFieldNumber = 3; + ::google::protobuf::int64 kernel_input_feature_dimension() const; + void set_kernel_input_feature_dimension(::google::protobuf::int64 value); + + // int64 kernel_output_feature_dimension = 4; + void clear_kernel_output_feature_dimension(); + static const int kKernelOutputFeatureDimensionFieldNumber = 4; + ::google::protobuf::int64 kernel_output_feature_dimension() const; + void set_kernel_output_feature_dimension(::google::protobuf::int64 value); + + // int64 input_batch_dimension = 7; + void clear_input_batch_dimension(); + static const int kInputBatchDimensionFieldNumber = 7; + ::google::protobuf::int64 input_batch_dimension() const; + void set_input_batch_dimension(::google::protobuf::int64 value); + + // int64 input_feature_dimension = 8; + void clear_input_feature_dimension(); + static const int kInputFeatureDimensionFieldNumber = 8; + ::google::protobuf::int64 input_feature_dimension() const; + void set_input_feature_dimension(::google::protobuf::int64 value); + + // int64 output_batch_dimension = 9; + void clear_output_batch_dimension(); + static const int kOutputBatchDimensionFieldNumber = 9; + ::google::protobuf::int64 output_batch_dimension() const; + void set_output_batch_dimension(::google::protobuf::int64 value); + + // int64 output_feature_dimension = 10; + void clear_output_feature_dimension(); + static const int kOutputFeatureDimensionFieldNumber = 10; + ::google::protobuf::int64 output_feature_dimension() const; + void set_output_feature_dimension(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.ConvolutionDimensionNumbers) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > kernel_spatial_dimensions_; + mutable int _kernel_spatial_dimensions_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > input_spatial_dimensions_; + mutable int _input_spatial_dimensions_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > output_spatial_dimensions_; + mutable int _output_spatial_dimensions_cached_byte_size_; + ::google::protobuf::int64 kernel_input_feature_dimension_; + ::google::protobuf::int64 kernel_output_feature_dimension_; + ::google::protobuf::int64 input_batch_dimension_; + ::google::protobuf::int64 input_feature_dimension_; + ::google::protobuf::int64 output_batch_dimension_; + ::google::protobuf::int64 output_feature_dimension_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DotDimensionNumbers : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.DotDimensionNumbers) */ { + public: + DotDimensionNumbers(); + virtual ~DotDimensionNumbers(); + + DotDimensionNumbers(const DotDimensionNumbers& from); + + inline DotDimensionNumbers& operator=(const DotDimensionNumbers& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DotDimensionNumbers(DotDimensionNumbers&& from) noexcept + : DotDimensionNumbers() { + *this = ::std::move(from); + } + + inline DotDimensionNumbers& operator=(DotDimensionNumbers&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DotDimensionNumbers& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DotDimensionNumbers* internal_default_instance() { + return reinterpret_cast( + &_DotDimensionNumbers_default_instance_); + } + static constexpr int kIndexInFileMessages = + 21; + + void UnsafeArenaSwap(DotDimensionNumbers* other); + void Swap(DotDimensionNumbers* other); + friend void swap(DotDimensionNumbers& a, DotDimensionNumbers& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DotDimensionNumbers* New() const final { + return CreateMaybeMessage(NULL); + } + + DotDimensionNumbers* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DotDimensionNumbers& from); + void MergeFrom(const DotDimensionNumbers& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DotDimensionNumbers* other); + protected: + explicit DotDimensionNumbers(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 lhs_contracting_dimensions = 1; + int lhs_contracting_dimensions_size() const; + void clear_lhs_contracting_dimensions(); + static const int kLhsContractingDimensionsFieldNumber = 1; + ::google::protobuf::int64 lhs_contracting_dimensions(int index) const; + void set_lhs_contracting_dimensions(int index, ::google::protobuf::int64 value); + void add_lhs_contracting_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + lhs_contracting_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_lhs_contracting_dimensions(); + + // repeated int64 rhs_contracting_dimensions = 2; + int rhs_contracting_dimensions_size() const; + void clear_rhs_contracting_dimensions(); + static const int kRhsContractingDimensionsFieldNumber = 2; + ::google::protobuf::int64 rhs_contracting_dimensions(int index) const; + void set_rhs_contracting_dimensions(int index, ::google::protobuf::int64 value); + void add_rhs_contracting_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + rhs_contracting_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_rhs_contracting_dimensions(); + + // repeated int64 lhs_batch_dimensions = 3; + int lhs_batch_dimensions_size() const; + void clear_lhs_batch_dimensions(); + static const int kLhsBatchDimensionsFieldNumber = 3; + ::google::protobuf::int64 lhs_batch_dimensions(int index) const; + void set_lhs_batch_dimensions(int index, ::google::protobuf::int64 value); + void add_lhs_batch_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + lhs_batch_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_lhs_batch_dimensions(); + + // repeated int64 rhs_batch_dimensions = 4; + int rhs_batch_dimensions_size() const; + void clear_rhs_batch_dimensions(); + static const int kRhsBatchDimensionsFieldNumber = 4; + ::google::protobuf::int64 rhs_batch_dimensions(int index) const; + void set_rhs_batch_dimensions(int index, ::google::protobuf::int64 value); + void add_rhs_batch_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + rhs_batch_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_rhs_batch_dimensions(); + + // @@protoc_insertion_point(class_scope:xla.DotDimensionNumbers) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > lhs_contracting_dimensions_; + mutable int _lhs_contracting_dimensions_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > rhs_contracting_dimensions_; + mutable int _rhs_contracting_dimensions_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > lhs_batch_dimensions_; + mutable int _lhs_batch_dimensions_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > rhs_batch_dimensions_; + mutable int _rhs_batch_dimensions_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpSharding : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.OpSharding) */ { + public: + OpSharding(); + virtual ~OpSharding(); + + OpSharding(const OpSharding& from); + + inline OpSharding& operator=(const OpSharding& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpSharding(OpSharding&& from) noexcept + : OpSharding() { + *this = ::std::move(from); + } + + inline OpSharding& operator=(OpSharding&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpSharding& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpSharding* internal_default_instance() { + return reinterpret_cast( + &_OpSharding_default_instance_); + } + static constexpr int kIndexInFileMessages = + 22; + + void UnsafeArenaSwap(OpSharding* other); + void Swap(OpSharding* other); + friend void swap(OpSharding& a, OpSharding& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpSharding* New() const final { + return CreateMaybeMessage(NULL); + } + + OpSharding* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpSharding& from); + void MergeFrom(const OpSharding& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpSharding* other); + protected: + explicit OpSharding(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef OpSharding_Type Type; + static const Type REPLICATED = + OpSharding_Type_REPLICATED; + static const Type MAXIMAL = + OpSharding_Type_MAXIMAL; + static const Type TUPLE = + OpSharding_Type_TUPLE; + static const Type OTHER = + OpSharding_Type_OTHER; + static inline bool Type_IsValid(int value) { + return OpSharding_Type_IsValid(value); + } + static const Type Type_MIN = + OpSharding_Type_Type_MIN; + static const Type Type_MAX = + OpSharding_Type_Type_MAX; + static const int Type_ARRAYSIZE = + OpSharding_Type_Type_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Type_descriptor() { + return OpSharding_Type_descriptor(); + } + static inline const ::std::string& Type_Name(Type value) { + return OpSharding_Type_Name(value); + } + static inline bool Type_Parse(const ::std::string& name, + Type* value) { + return OpSharding_Type_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // repeated int64 tile_assignment_dimensions = 3; + int tile_assignment_dimensions_size() const; + void clear_tile_assignment_dimensions(); + static const int kTileAssignmentDimensionsFieldNumber = 3; + ::google::protobuf::int64 tile_assignment_dimensions(int index) const; + void set_tile_assignment_dimensions(int index, ::google::protobuf::int64 value); + void add_tile_assignment_dimensions(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + tile_assignment_dimensions() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_tile_assignment_dimensions(); + + // repeated int64 tile_assignment_devices = 4; + int tile_assignment_devices_size() const; + void clear_tile_assignment_devices(); + static const int kTileAssignmentDevicesFieldNumber = 4; + ::google::protobuf::int64 tile_assignment_devices(int index) const; + void set_tile_assignment_devices(int index, ::google::protobuf::int64 value); + void add_tile_assignment_devices(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + tile_assignment_devices() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_tile_assignment_devices(); + + // repeated .xla.OpSharding tuple_shardings = 5; + int tuple_shardings_size() const; + void clear_tuple_shardings(); + static const int kTupleShardingsFieldNumber = 5; + ::xla::OpSharding* mutable_tuple_shardings(int index); + ::google::protobuf::RepeatedPtrField< ::xla::OpSharding >* + mutable_tuple_shardings(); + const ::xla::OpSharding& tuple_shardings(int index) const; + ::xla::OpSharding* add_tuple_shardings(); + const ::google::protobuf::RepeatedPtrField< ::xla::OpSharding >& + tuple_shardings() const; + + // .xla.ShapeProto tile_shape = 2; + bool has_tile_shape() const; + void clear_tile_shape(); + static const int kTileShapeFieldNumber = 2; + private: + const ::xla::ShapeProto& _internal_tile_shape() const; + public: + const ::xla::ShapeProto& tile_shape() const; + ::xla::ShapeProto* release_tile_shape(); + ::xla::ShapeProto* mutable_tile_shape(); + void set_allocated_tile_shape(::xla::ShapeProto* tile_shape); + void unsafe_arena_set_allocated_tile_shape( + ::xla::ShapeProto* tile_shape); + ::xla::ShapeProto* unsafe_arena_release_tile_shape(); + + // .xla.OpSharding.Type type = 1; + void clear_type(); + static const int kTypeFieldNumber = 1; + ::xla::OpSharding_Type type() const; + void set_type(::xla::OpSharding_Type value); + + // @@protoc_insertion_point(class_scope:xla.OpSharding) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > tile_assignment_dimensions_; + mutable int _tile_assignment_dimensions_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > tile_assignment_devices_; + mutable int _tile_assignment_devices_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::xla::OpSharding > tuple_shardings_; + ::xla::ShapeProto* tile_shape_; + int type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ReplicaGroup : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.ReplicaGroup) */ { + public: + ReplicaGroup(); + virtual ~ReplicaGroup(); + + ReplicaGroup(const ReplicaGroup& from); + + inline ReplicaGroup& operator=(const ReplicaGroup& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ReplicaGroup(ReplicaGroup&& from) noexcept + : ReplicaGroup() { + *this = ::std::move(from); + } + + inline ReplicaGroup& operator=(ReplicaGroup&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ReplicaGroup& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ReplicaGroup* internal_default_instance() { + return reinterpret_cast( + &_ReplicaGroup_default_instance_); + } + static constexpr int kIndexInFileMessages = + 23; + + void UnsafeArenaSwap(ReplicaGroup* other); + void Swap(ReplicaGroup* other); + friend void swap(ReplicaGroup& a, ReplicaGroup& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ReplicaGroup* New() const final { + return CreateMaybeMessage(NULL); + } + + ReplicaGroup* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ReplicaGroup& from); + void MergeFrom(const ReplicaGroup& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ReplicaGroup* other); + protected: + explicit ReplicaGroup(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 replica_ids = 1; + int replica_ids_size() const; + void clear_replica_ids(); + static const int kReplicaIdsFieldNumber = 1; + ::google::protobuf::int64 replica_ids(int index) const; + void set_replica_ids(int index, ::google::protobuf::int64 value); + void add_replica_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + replica_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_replica_ids(); + + // @@protoc_insertion_point(class_scope:xla.ReplicaGroup) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > replica_ids_; + mutable int _replica_ids_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SourceTarget : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.SourceTarget) */ { + public: + SourceTarget(); + virtual ~SourceTarget(); + + SourceTarget(const SourceTarget& from); + + inline SourceTarget& operator=(const SourceTarget& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SourceTarget(SourceTarget&& from) noexcept + : SourceTarget() { + *this = ::std::move(from); + } + + inline SourceTarget& operator=(SourceTarget&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SourceTarget& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SourceTarget* internal_default_instance() { + return reinterpret_cast( + &_SourceTarget_default_instance_); + } + static constexpr int kIndexInFileMessages = + 24; + + void UnsafeArenaSwap(SourceTarget* other); + void Swap(SourceTarget* other); + friend void swap(SourceTarget& a, SourceTarget& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SourceTarget* New() const final { + return CreateMaybeMessage(NULL); + } + + SourceTarget* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SourceTarget& from); + void MergeFrom(const SourceTarget& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SourceTarget* other); + protected: + explicit SourceTarget(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 source = 1; + void clear_source(); + static const int kSourceFieldNumber = 1; + ::google::protobuf::int64 source() const; + void set_source(::google::protobuf::int64 value); + + // int64 target = 2; + void clear_target(); + static const int kTargetFieldNumber = 2; + ::google::protobuf::int64 target() const; + void set_target(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:xla.SourceTarget) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 source_; + ::google::protobuf::int64 target_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class PrecisionConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xla.PrecisionConfig) */ { + public: + PrecisionConfig(); + virtual ~PrecisionConfig(); + + PrecisionConfig(const PrecisionConfig& from); + + inline PrecisionConfig& operator=(const PrecisionConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + PrecisionConfig(PrecisionConfig&& from) noexcept + : PrecisionConfig() { + *this = ::std::move(from); + } + + inline PrecisionConfig& operator=(PrecisionConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const PrecisionConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const PrecisionConfig* internal_default_instance() { + return reinterpret_cast( + &_PrecisionConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 25; + + void UnsafeArenaSwap(PrecisionConfig* other); + void Swap(PrecisionConfig* other); + friend void swap(PrecisionConfig& a, PrecisionConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline PrecisionConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + PrecisionConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const PrecisionConfig& from); + void MergeFrom(const PrecisionConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PrecisionConfig* other); + protected: + explicit PrecisionConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef PrecisionConfig_Precision Precision; + static const Precision DEFAULT = + PrecisionConfig_Precision_DEFAULT; + static const Precision HIGH = + PrecisionConfig_Precision_HIGH; + static const Precision HIGHEST = + PrecisionConfig_Precision_HIGHEST; + static inline bool Precision_IsValid(int value) { + return PrecisionConfig_Precision_IsValid(value); + } + static const Precision Precision_MIN = + PrecisionConfig_Precision_Precision_MIN; + static const Precision Precision_MAX = + PrecisionConfig_Precision_Precision_MAX; + static const int Precision_ARRAYSIZE = + PrecisionConfig_Precision_Precision_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Precision_descriptor() { + return PrecisionConfig_Precision_descriptor(); + } + static inline const ::std::string& Precision_Name(Precision value) { + return PrecisionConfig_Precision_Name(value); + } + static inline bool Precision_Parse(const ::std::string& name, + Precision* value) { + return PrecisionConfig_Precision_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // repeated .xla.PrecisionConfig.Precision operand_precision = 1; + int operand_precision_size() const; + void clear_operand_precision(); + static const int kOperandPrecisionFieldNumber = 1; + ::xla::PrecisionConfig_Precision operand_precision(int index) const; + void set_operand_precision(int index, ::xla::PrecisionConfig_Precision value); + void add_operand_precision(::xla::PrecisionConfig_Precision value); + const ::google::protobuf::RepeatedField& operand_precision() const; + ::google::protobuf::RepeatedField* mutable_operand_precision(); + + // @@protoc_insertion_point(class_scope:xla.PrecisionConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField operand_precision_; + mutable int _operand_precision_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// PaddingConfig_PaddingConfigDimension + +// int64 edge_padding_low = 1; +inline void PaddingConfig_PaddingConfigDimension::clear_edge_padding_low() { + edge_padding_low_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 PaddingConfig_PaddingConfigDimension::edge_padding_low() const { + // @@protoc_insertion_point(field_get:xla.PaddingConfig.PaddingConfigDimension.edge_padding_low) + return edge_padding_low_; +} +inline void PaddingConfig_PaddingConfigDimension::set_edge_padding_low(::google::protobuf::int64 value) { + + edge_padding_low_ = value; + // @@protoc_insertion_point(field_set:xla.PaddingConfig.PaddingConfigDimension.edge_padding_low) +} + +// int64 edge_padding_high = 2; +inline void PaddingConfig_PaddingConfigDimension::clear_edge_padding_high() { + edge_padding_high_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 PaddingConfig_PaddingConfigDimension::edge_padding_high() const { + // @@protoc_insertion_point(field_get:xla.PaddingConfig.PaddingConfigDimension.edge_padding_high) + return edge_padding_high_; +} +inline void PaddingConfig_PaddingConfigDimension::set_edge_padding_high(::google::protobuf::int64 value) { + + edge_padding_high_ = value; + // @@protoc_insertion_point(field_set:xla.PaddingConfig.PaddingConfigDimension.edge_padding_high) +} + +// int64 interior_padding = 3; +inline void PaddingConfig_PaddingConfigDimension::clear_interior_padding() { + interior_padding_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 PaddingConfig_PaddingConfigDimension::interior_padding() const { + // @@protoc_insertion_point(field_get:xla.PaddingConfig.PaddingConfigDimension.interior_padding) + return interior_padding_; +} +inline void PaddingConfig_PaddingConfigDimension::set_interior_padding(::google::protobuf::int64 value) { + + interior_padding_ = value; + // @@protoc_insertion_point(field_set:xla.PaddingConfig.PaddingConfigDimension.interior_padding) +} + +// ------------------------------------------------------------------- + +// PaddingConfig + +// repeated .xla.PaddingConfig.PaddingConfigDimension dimensions = 1; +inline int PaddingConfig::dimensions_size() const { + return dimensions_.size(); +} +inline void PaddingConfig::clear_dimensions() { + dimensions_.Clear(); +} +inline ::xla::PaddingConfig_PaddingConfigDimension* PaddingConfig::mutable_dimensions(int index) { + // @@protoc_insertion_point(field_mutable:xla.PaddingConfig.dimensions) + return dimensions_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::PaddingConfig_PaddingConfigDimension >* +PaddingConfig::mutable_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.PaddingConfig.dimensions) + return &dimensions_; +} +inline const ::xla::PaddingConfig_PaddingConfigDimension& PaddingConfig::dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.PaddingConfig.dimensions) + return dimensions_.Get(index); +} +inline ::xla::PaddingConfig_PaddingConfigDimension* PaddingConfig::add_dimensions() { + // @@protoc_insertion_point(field_add:xla.PaddingConfig.dimensions) + return dimensions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::PaddingConfig_PaddingConfigDimension >& +PaddingConfig::dimensions() const { + // @@protoc_insertion_point(field_list:xla.PaddingConfig.dimensions) + return dimensions_; +} + +// ------------------------------------------------------------------- + +// TileProto + +// repeated int64 dimensions = 1; +inline int TileProto::dimensions_size() const { + return dimensions_.size(); +} +inline void TileProto::clear_dimensions() { + dimensions_.Clear(); +} +inline ::google::protobuf::int64 TileProto::dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.TileProto.dimensions) + return dimensions_.Get(index); +} +inline void TileProto::set_dimensions(int index, ::google::protobuf::int64 value) { + dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.TileProto.dimensions) +} +inline void TileProto::add_dimensions(::google::protobuf::int64 value) { + dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.TileProto.dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +TileProto::dimensions() const { + // @@protoc_insertion_point(field_list:xla.TileProto.dimensions) + return dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +TileProto::mutable_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.TileProto.dimensions) + return &dimensions_; +} + +// ------------------------------------------------------------------- + +// LayoutProto + +// .xla.Format format = 4; +inline void LayoutProto::clear_format() { + format_ = 0; +} +inline ::xla::Format LayoutProto::format() const { + // @@protoc_insertion_point(field_get:xla.LayoutProto.format) + return static_cast< ::xla::Format >(format_); +} +inline void LayoutProto::set_format(::xla::Format value) { + + format_ = value; + // @@protoc_insertion_point(field_set:xla.LayoutProto.format) +} + +// repeated int64 minor_to_major = 1; +inline int LayoutProto::minor_to_major_size() const { + return minor_to_major_.size(); +} +inline void LayoutProto::clear_minor_to_major() { + minor_to_major_.Clear(); +} +inline ::google::protobuf::int64 LayoutProto::minor_to_major(int index) const { + // @@protoc_insertion_point(field_get:xla.LayoutProto.minor_to_major) + return minor_to_major_.Get(index); +} +inline void LayoutProto::set_minor_to_major(int index, ::google::protobuf::int64 value) { + minor_to_major_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LayoutProto.minor_to_major) +} +inline void LayoutProto::add_minor_to_major(::google::protobuf::int64 value) { + minor_to_major_.Add(value); + // @@protoc_insertion_point(field_add:xla.LayoutProto.minor_to_major) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +LayoutProto::minor_to_major() const { + // @@protoc_insertion_point(field_list:xla.LayoutProto.minor_to_major) + return minor_to_major_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +LayoutProto::mutable_minor_to_major() { + // @@protoc_insertion_point(field_mutable_list:xla.LayoutProto.minor_to_major) + return &minor_to_major_; +} + +// int64 max_sparse_elements = 5; +inline void LayoutProto::clear_max_sparse_elements() { + max_sparse_elements_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LayoutProto::max_sparse_elements() const { + // @@protoc_insertion_point(field_get:xla.LayoutProto.max_sparse_elements) + return max_sparse_elements_; +} +inline void LayoutProto::set_max_sparse_elements(::google::protobuf::int64 value) { + + max_sparse_elements_ = value; + // @@protoc_insertion_point(field_set:xla.LayoutProto.max_sparse_elements) +} + +// repeated .xla.TileProto tiles = 6; +inline int LayoutProto::tiles_size() const { + return tiles_.size(); +} +inline void LayoutProto::clear_tiles() { + tiles_.Clear(); +} +inline ::xla::TileProto* LayoutProto::mutable_tiles(int index) { + // @@protoc_insertion_point(field_mutable:xla.LayoutProto.tiles) + return tiles_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::TileProto >* +LayoutProto::mutable_tiles() { + // @@protoc_insertion_point(field_mutable_list:xla.LayoutProto.tiles) + return &tiles_; +} +inline const ::xla::TileProto& LayoutProto::tiles(int index) const { + // @@protoc_insertion_point(field_get:xla.LayoutProto.tiles) + return tiles_.Get(index); +} +inline ::xla::TileProto* LayoutProto::add_tiles() { + // @@protoc_insertion_point(field_add:xla.LayoutProto.tiles) + return tiles_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::TileProto >& +LayoutProto::tiles() const { + // @@protoc_insertion_point(field_list:xla.LayoutProto.tiles) + return tiles_; +} + +// int64 element_size_in_bits = 7; +inline void LayoutProto::clear_element_size_in_bits() { + element_size_in_bits_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 LayoutProto::element_size_in_bits() const { + // @@protoc_insertion_point(field_get:xla.LayoutProto.element_size_in_bits) + return element_size_in_bits_; +} +inline void LayoutProto::set_element_size_in_bits(::google::protobuf::int64 value) { + + element_size_in_bits_ = value; + // @@protoc_insertion_point(field_set:xla.LayoutProto.element_size_in_bits) +} + +// ------------------------------------------------------------------- + +// ShapeProto + +// .xla.PrimitiveType element_type = 2; +inline void ShapeProto::clear_element_type() { + element_type_ = 0; +} +inline ::xla::PrimitiveType ShapeProto::element_type() const { + // @@protoc_insertion_point(field_get:xla.ShapeProto.element_type) + return static_cast< ::xla::PrimitiveType >(element_type_); +} +inline void ShapeProto::set_element_type(::xla::PrimitiveType value) { + + element_type_ = value; + // @@protoc_insertion_point(field_set:xla.ShapeProto.element_type) +} + +// repeated int64 dimensions = 3; +inline int ShapeProto::dimensions_size() const { + return dimensions_.size(); +} +inline void ShapeProto::clear_dimensions() { + dimensions_.Clear(); +} +inline ::google::protobuf::int64 ShapeProto::dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.ShapeProto.dimensions) + return dimensions_.Get(index); +} +inline void ShapeProto::set_dimensions(int index, ::google::protobuf::int64 value) { + dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ShapeProto.dimensions) +} +inline void ShapeProto::add_dimensions(::google::protobuf::int64 value) { + dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.ShapeProto.dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ShapeProto::dimensions() const { + // @@protoc_insertion_point(field_list:xla.ShapeProto.dimensions) + return dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ShapeProto::mutable_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.ShapeProto.dimensions) + return &dimensions_; +} + +// repeated .xla.ShapeProto tuple_shapes = 4; +inline int ShapeProto::tuple_shapes_size() const { + return tuple_shapes_.size(); +} +inline void ShapeProto::clear_tuple_shapes() { + tuple_shapes_.Clear(); +} +inline ::xla::ShapeProto* ShapeProto::mutable_tuple_shapes(int index) { + // @@protoc_insertion_point(field_mutable:xla.ShapeProto.tuple_shapes) + return tuple_shapes_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* +ShapeProto::mutable_tuple_shapes() { + // @@protoc_insertion_point(field_mutable_list:xla.ShapeProto.tuple_shapes) + return &tuple_shapes_; +} +inline const ::xla::ShapeProto& ShapeProto::tuple_shapes(int index) const { + // @@protoc_insertion_point(field_get:xla.ShapeProto.tuple_shapes) + return tuple_shapes_.Get(index); +} +inline ::xla::ShapeProto* ShapeProto::add_tuple_shapes() { + // @@protoc_insertion_point(field_add:xla.ShapeProto.tuple_shapes) + return tuple_shapes_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& +ShapeProto::tuple_shapes() const { + // @@protoc_insertion_point(field_list:xla.ShapeProto.tuple_shapes) + return tuple_shapes_; +} + +// .xla.LayoutProto layout = 5; +inline bool ShapeProto::has_layout() const { + return this != internal_default_instance() && layout_ != NULL; +} +inline void ShapeProto::clear_layout() { + if (GetArenaNoVirtual() == NULL && layout_ != NULL) { + delete layout_; + } + layout_ = NULL; +} +inline const ::xla::LayoutProto& ShapeProto::_internal_layout() const { + return *layout_; +} +inline const ::xla::LayoutProto& ShapeProto::layout() const { + const ::xla::LayoutProto* p = layout_; + // @@protoc_insertion_point(field_get:xla.ShapeProto.layout) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LayoutProto_default_instance_); +} +inline ::xla::LayoutProto* ShapeProto::release_layout() { + // @@protoc_insertion_point(field_release:xla.ShapeProto.layout) + + ::xla::LayoutProto* temp = layout_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + layout_ = NULL; + return temp; +} +inline ::xla::LayoutProto* ShapeProto::unsafe_arena_release_layout() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.ShapeProto.layout) + + ::xla::LayoutProto* temp = layout_; + layout_ = NULL; + return temp; +} +inline ::xla::LayoutProto* ShapeProto::mutable_layout() { + + if (layout_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LayoutProto>(GetArenaNoVirtual()); + layout_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ShapeProto.layout) + return layout_; +} +inline void ShapeProto::set_allocated_layout(::xla::LayoutProto* layout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete layout_; + } + if (layout) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(layout); + if (message_arena != submessage_arena) { + layout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, layout, submessage_arena); + } + + } else { + + } + layout_ = layout; + // @@protoc_insertion_point(field_set_allocated:xla.ShapeProto.layout) +} + +// ------------------------------------------------------------------- + +// ProgramShapeProto + +// repeated .xla.ShapeProto parameters = 1; +inline int ProgramShapeProto::parameters_size() const { + return parameters_.size(); +} +inline void ProgramShapeProto::clear_parameters() { + parameters_.Clear(); +} +inline ::xla::ShapeProto* ProgramShapeProto::mutable_parameters(int index) { + // @@protoc_insertion_point(field_mutable:xla.ProgramShapeProto.parameters) + return parameters_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >* +ProgramShapeProto::mutable_parameters() { + // @@protoc_insertion_point(field_mutable_list:xla.ProgramShapeProto.parameters) + return ¶meters_; +} +inline const ::xla::ShapeProto& ProgramShapeProto::parameters(int index) const { + // @@protoc_insertion_point(field_get:xla.ProgramShapeProto.parameters) + return parameters_.Get(index); +} +inline ::xla::ShapeProto* ProgramShapeProto::add_parameters() { + // @@protoc_insertion_point(field_add:xla.ProgramShapeProto.parameters) + return parameters_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ShapeProto >& +ProgramShapeProto::parameters() const { + // @@protoc_insertion_point(field_list:xla.ProgramShapeProto.parameters) + return parameters_; +} + +// .xla.ShapeProto result = 2; +inline bool ProgramShapeProto::has_result() const { + return this != internal_default_instance() && result_ != NULL; +} +inline void ProgramShapeProto::clear_result() { + if (GetArenaNoVirtual() == NULL && result_ != NULL) { + delete result_; + } + result_ = NULL; +} +inline const ::xla::ShapeProto& ProgramShapeProto::_internal_result() const { + return *result_; +} +inline const ::xla::ShapeProto& ProgramShapeProto::result() const { + const ::xla::ShapeProto* p = result_; + // @@protoc_insertion_point(field_get:xla.ProgramShapeProto.result) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* ProgramShapeProto::release_result() { + // @@protoc_insertion_point(field_release:xla.ProgramShapeProto.result) + + ::xla::ShapeProto* temp = result_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + result_ = NULL; + return temp; +} +inline ::xla::ShapeProto* ProgramShapeProto::unsafe_arena_release_result() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.ProgramShapeProto.result) + + ::xla::ShapeProto* temp = result_; + result_ = NULL; + return temp; +} +inline ::xla::ShapeProto* ProgramShapeProto::mutable_result() { + + if (result_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + result_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.ProgramShapeProto.result) + return result_; +} +inline void ProgramShapeProto::set_allocated_result(::xla::ShapeProto* result) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete result_; + } + if (result) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(result); + if (message_arena != submessage_arena) { + result = ::google::protobuf::internal::GetOwnedMessage( + message_arena, result, submessage_arena); + } + + } else { + + } + result_ = result; + // @@protoc_insertion_point(field_set_allocated:xla.ProgramShapeProto.result) +} + +// repeated string parameter_names = 3; +inline int ProgramShapeProto::parameter_names_size() const { + return parameter_names_.size(); +} +inline void ProgramShapeProto::clear_parameter_names() { + parameter_names_.Clear(); +} +inline const ::std::string& ProgramShapeProto::parameter_names(int index) const { + // @@protoc_insertion_point(field_get:xla.ProgramShapeProto.parameter_names) + return parameter_names_.Get(index); +} +inline ::std::string* ProgramShapeProto::mutable_parameter_names(int index) { + // @@protoc_insertion_point(field_mutable:xla.ProgramShapeProto.parameter_names) + return parameter_names_.Mutable(index); +} +inline void ProgramShapeProto::set_parameter_names(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:xla.ProgramShapeProto.parameter_names) + parameter_names_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void ProgramShapeProto::set_parameter_names(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:xla.ProgramShapeProto.parameter_names) + parameter_names_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void ProgramShapeProto::set_parameter_names(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + parameter_names_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:xla.ProgramShapeProto.parameter_names) +} +inline void ProgramShapeProto::set_parameter_names(int index, const char* value, size_t size) { + parameter_names_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:xla.ProgramShapeProto.parameter_names) +} +inline ::std::string* ProgramShapeProto::add_parameter_names() { + // @@protoc_insertion_point(field_add_mutable:xla.ProgramShapeProto.parameter_names) + return parameter_names_.Add(); +} +inline void ProgramShapeProto::add_parameter_names(const ::std::string& value) { + parameter_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add:xla.ProgramShapeProto.parameter_names) +} +#if LANG_CXX11 +inline void ProgramShapeProto::add_parameter_names(::std::string&& value) { + parameter_names_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:xla.ProgramShapeProto.parameter_names) +} +#endif +inline void ProgramShapeProto::add_parameter_names(const char* value) { + GOOGLE_DCHECK(value != NULL); + parameter_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:xla.ProgramShapeProto.parameter_names) +} +inline void ProgramShapeProto::add_parameter_names(const char* value, size_t size) { + parameter_names_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:xla.ProgramShapeProto.parameter_names) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ProgramShapeProto::parameter_names() const { + // @@protoc_insertion_point(field_list:xla.ProgramShapeProto.parameter_names) + return parameter_names_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ProgramShapeProto::mutable_parameter_names() { + // @@protoc_insertion_point(field_mutable_list:xla.ProgramShapeProto.parameter_names) + return ¶meter_names_; +} + +// ------------------------------------------------------------------- + +// ComputationStats + +// double flop_count = 1; +inline void ComputationStats::clear_flop_count() { + flop_count_ = 0; +} +inline double ComputationStats::flop_count() const { + // @@protoc_insertion_point(field_get:xla.ComputationStats.flop_count) + return flop_count_; +} +inline void ComputationStats::set_flop_count(double value) { + + flop_count_ = value; + // @@protoc_insertion_point(field_set:xla.ComputationStats.flop_count) +} + +// double transcendental_count = 2; +inline void ComputationStats::clear_transcendental_count() { + transcendental_count_ = 0; +} +inline double ComputationStats::transcendental_count() const { + // @@protoc_insertion_point(field_get:xla.ComputationStats.transcendental_count) + return transcendental_count_; +} +inline void ComputationStats::set_transcendental_count(double value) { + + transcendental_count_ = value; + // @@protoc_insertion_point(field_set:xla.ComputationStats.transcendental_count) +} + +// ------------------------------------------------------------------- + +// OpMetadata + +// string op_type = 1; +inline void OpMetadata::clear_op_type() { + op_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpMetadata::op_type() const { + // @@protoc_insertion_point(field_get:xla.OpMetadata.op_type) + return op_type_.Get(); +} +inline void OpMetadata::set_op_type(const ::std::string& value) { + + op_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.OpMetadata.op_type) +} +#if LANG_CXX11 +inline void OpMetadata::set_op_type(::std::string&& value) { + + op_type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.OpMetadata.op_type) +} +#endif +inline void OpMetadata::set_op_type(const char* value) { + GOOGLE_DCHECK(value != NULL); + + op_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.OpMetadata.op_type) +} +inline void OpMetadata::set_op_type(const char* value, + size_t size) { + + op_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.OpMetadata.op_type) +} +inline ::std::string* OpMetadata::mutable_op_type() { + + // @@protoc_insertion_point(field_mutable:xla.OpMetadata.op_type) + return op_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpMetadata::release_op_type() { + // @@protoc_insertion_point(field_release:xla.OpMetadata.op_type) + + return op_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpMetadata::set_allocated_op_type(::std::string* op_type) { + if (op_type != NULL) { + + } else { + + } + op_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op_type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.OpMetadata.op_type) +} +inline ::std::string* OpMetadata::unsafe_arena_release_op_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.OpMetadata.op_type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpMetadata::unsafe_arena_set_allocated_op_type( + ::std::string* op_type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op_type != NULL) { + + } else { + + } + op_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op_type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.OpMetadata.op_type) +} + +// string op_name = 2; +inline void OpMetadata::clear_op_name() { + op_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpMetadata::op_name() const { + // @@protoc_insertion_point(field_get:xla.OpMetadata.op_name) + return op_name_.Get(); +} +inline void OpMetadata::set_op_name(const ::std::string& value) { + + op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.OpMetadata.op_name) +} +#if LANG_CXX11 +inline void OpMetadata::set_op_name(::std::string&& value) { + + op_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.OpMetadata.op_name) +} +#endif +inline void OpMetadata::set_op_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.OpMetadata.op_name) +} +inline void OpMetadata::set_op_name(const char* value, + size_t size) { + + op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.OpMetadata.op_name) +} +inline ::std::string* OpMetadata::mutable_op_name() { + + // @@protoc_insertion_point(field_mutable:xla.OpMetadata.op_name) + return op_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpMetadata::release_op_name() { + // @@protoc_insertion_point(field_release:xla.OpMetadata.op_name) + + return op_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpMetadata::set_allocated_op_name(::std::string* op_name) { + if (op_name != NULL) { + + } else { + + } + op_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.OpMetadata.op_name) +} +inline ::std::string* OpMetadata::unsafe_arena_release_op_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.OpMetadata.op_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpMetadata::unsafe_arena_set_allocated_op_name( + ::std::string* op_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op_name != NULL) { + + } else { + + } + op_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.OpMetadata.op_name) +} + +// string source_file = 3; +inline void OpMetadata::clear_source_file() { + source_file_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpMetadata::source_file() const { + // @@protoc_insertion_point(field_get:xla.OpMetadata.source_file) + return source_file_.Get(); +} +inline void OpMetadata::set_source_file(const ::std::string& value) { + + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.OpMetadata.source_file) +} +#if LANG_CXX11 +inline void OpMetadata::set_source_file(::std::string&& value) { + + source_file_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.OpMetadata.source_file) +} +#endif +inline void OpMetadata::set_source_file(const char* value) { + GOOGLE_DCHECK(value != NULL); + + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.OpMetadata.source_file) +} +inline void OpMetadata::set_source_file(const char* value, + size_t size) { + + source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.OpMetadata.source_file) +} +inline ::std::string* OpMetadata::mutable_source_file() { + + // @@protoc_insertion_point(field_mutable:xla.OpMetadata.source_file) + return source_file_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpMetadata::release_source_file() { + // @@protoc_insertion_point(field_release:xla.OpMetadata.source_file) + + return source_file_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpMetadata::set_allocated_source_file(::std::string* source_file) { + if (source_file != NULL) { + + } else { + + } + source_file_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.OpMetadata.source_file) +} +inline ::std::string* OpMetadata::unsafe_arena_release_source_file() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.OpMetadata.source_file) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return source_file_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpMetadata::unsafe_arena_set_allocated_source_file( + ::std::string* source_file) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (source_file != NULL) { + + } else { + + } + source_file_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + source_file, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.OpMetadata.source_file) +} + +// int32 source_line = 4; +inline void OpMetadata::clear_source_line() { + source_line_ = 0; +} +inline ::google::protobuf::int32 OpMetadata::source_line() const { + // @@protoc_insertion_point(field_get:xla.OpMetadata.source_line) + return source_line_; +} +inline void OpMetadata::set_source_line(::google::protobuf::int32 value) { + + source_line_ = value; + // @@protoc_insertion_point(field_set:xla.OpMetadata.source_line) +} + +// ------------------------------------------------------------------- + +// ExecutionProfile + +// bool compilation_cache_hit = 1; +inline void ExecutionProfile::clear_compilation_cache_hit() { + compilation_cache_hit_ = false; +} +inline bool ExecutionProfile::compilation_cache_hit() const { + // @@protoc_insertion_point(field_get:xla.ExecutionProfile.compilation_cache_hit) + return compilation_cache_hit_; +} +inline void ExecutionProfile::set_compilation_cache_hit(bool value) { + + compilation_cache_hit_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionProfile.compilation_cache_hit) +} + +// int64 compile_time_ms = 2; +inline void ExecutionProfile::clear_compile_time_ms() { + compile_time_ms_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ExecutionProfile::compile_time_ms() const { + // @@protoc_insertion_point(field_get:xla.ExecutionProfile.compile_time_ms) + return compile_time_ms_; +} +inline void ExecutionProfile::set_compile_time_ms(::google::protobuf::int64 value) { + + compile_time_ms_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionProfile.compile_time_ms) +} + +// int64 compute_cycle_count = 3; +inline void ExecutionProfile::clear_compute_cycle_count() { + compute_cycle_count_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ExecutionProfile::compute_cycle_count() const { + // @@protoc_insertion_point(field_get:xla.ExecutionProfile.compute_cycle_count) + return compute_cycle_count_; +} +inline void ExecutionProfile::set_compute_cycle_count(::google::protobuf::int64 value) { + + compute_cycle_count_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionProfile.compute_cycle_count) +} + +// int64 compute_time_ns = 4; +inline void ExecutionProfile::clear_compute_time_ns() { + compute_time_ns_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ExecutionProfile::compute_time_ns() const { + // @@protoc_insertion_point(field_get:xla.ExecutionProfile.compute_time_ns) + return compute_time_ns_; +} +inline void ExecutionProfile::set_compute_time_ns(::google::protobuf::int64 value) { + + compute_time_ns_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionProfile.compute_time_ns) +} + +// int64 compute_and_transfer_time_ns = 5; +inline void ExecutionProfile::clear_compute_and_transfer_time_ns() { + compute_and_transfer_time_ns_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ExecutionProfile::compute_and_transfer_time_ns() const { + // @@protoc_insertion_point(field_get:xla.ExecutionProfile.compute_and_transfer_time_ns) + return compute_and_transfer_time_ns_; +} +inline void ExecutionProfile::set_compute_and_transfer_time_ns(::google::protobuf::int64 value) { + + compute_and_transfer_time_ns_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionProfile.compute_and_transfer_time_ns) +} + +// int64 executable_size_in_bytes = 6; +inline void ExecutionProfile::clear_executable_size_in_bytes() { + executable_size_in_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ExecutionProfile::executable_size_in_bytes() const { + // @@protoc_insertion_point(field_get:xla.ExecutionProfile.executable_size_in_bytes) + return executable_size_in_bytes_; +} +inline void ExecutionProfile::set_executable_size_in_bytes(::google::protobuf::int64 value) { + + executable_size_in_bytes_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionProfile.executable_size_in_bytes) +} + +// ------------------------------------------------------------------- + +// ExecutionHandle + +// int64 handle = 1; +inline void ExecutionHandle::clear_handle() { + handle_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ExecutionHandle::handle() const { + // @@protoc_insertion_point(field_get:xla.ExecutionHandle.handle) + return handle_; +} +inline void ExecutionHandle::set_handle(::google::protobuf::int64 value) { + + handle_ = value; + // @@protoc_insertion_point(field_set:xla.ExecutionHandle.handle) +} + +// ------------------------------------------------------------------- + +// GlobalDataHandle + +// int64 handle = 1; +inline void GlobalDataHandle::clear_handle() { + handle_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 GlobalDataHandle::handle() const { + // @@protoc_insertion_point(field_get:xla.GlobalDataHandle.handle) + return handle_; +} +inline void GlobalDataHandle::set_handle(::google::protobuf::int64 value) { + + handle_ = value; + // @@protoc_insertion_point(field_set:xla.GlobalDataHandle.handle) +} + +// ------------------------------------------------------------------- + +// DeviceHandle + +// int64 handle = 1; +inline void DeviceHandle::clear_handle() { + handle_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 DeviceHandle::handle() const { + // @@protoc_insertion_point(field_get:xla.DeviceHandle.handle) + return handle_; +} +inline void DeviceHandle::set_handle(::google::protobuf::int64 value) { + + handle_ = value; + // @@protoc_insertion_point(field_set:xla.DeviceHandle.handle) +} + +// int64 device_count = 2; +inline void DeviceHandle::clear_device_count() { + device_count_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 DeviceHandle::device_count() const { + // @@protoc_insertion_point(field_get:xla.DeviceHandle.device_count) + return device_count_; +} +inline void DeviceHandle::set_device_count(::google::protobuf::int64 value) { + + device_count_ = value; + // @@protoc_insertion_point(field_set:xla.DeviceHandle.device_count) +} + +// ------------------------------------------------------------------- + +// ChannelHandle + +// int64 handle = 1; +inline void ChannelHandle::clear_handle() { + handle_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ChannelHandle::handle() const { + // @@protoc_insertion_point(field_get:xla.ChannelHandle.handle) + return handle_; +} +inline void ChannelHandle::set_handle(::google::protobuf::int64 value) { + + handle_ = value; + // @@protoc_insertion_point(field_set:xla.ChannelHandle.handle) +} + +// .xla.ChannelHandle.ChannelType type = 2; +inline void ChannelHandle::clear_type() { + type_ = 0; +} +inline ::xla::ChannelHandle_ChannelType ChannelHandle::type() const { + // @@protoc_insertion_point(field_get:xla.ChannelHandle.type) + return static_cast< ::xla::ChannelHandle_ChannelType >(type_); +} +inline void ChannelHandle::set_type(::xla::ChannelHandle_ChannelType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:xla.ChannelHandle.type) +} + +// ------------------------------------------------------------------- + +// DeviceAssignmentProto_ComputationDevice + +// repeated int32 replica_device_ids = 1; +inline int DeviceAssignmentProto_ComputationDevice::replica_device_ids_size() const { + return replica_device_ids_.size(); +} +inline void DeviceAssignmentProto_ComputationDevice::clear_replica_device_ids() { + replica_device_ids_.Clear(); +} +inline ::google::protobuf::int32 DeviceAssignmentProto_ComputationDevice::replica_device_ids(int index) const { + // @@protoc_insertion_point(field_get:xla.DeviceAssignmentProto.ComputationDevice.replica_device_ids) + return replica_device_ids_.Get(index); +} +inline void DeviceAssignmentProto_ComputationDevice::set_replica_device_ids(int index, ::google::protobuf::int32 value) { + replica_device_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.DeviceAssignmentProto.ComputationDevice.replica_device_ids) +} +inline void DeviceAssignmentProto_ComputationDevice::add_replica_device_ids(::google::protobuf::int32 value) { + replica_device_ids_.Add(value); + // @@protoc_insertion_point(field_add:xla.DeviceAssignmentProto.ComputationDevice.replica_device_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +DeviceAssignmentProto_ComputationDevice::replica_device_ids() const { + // @@protoc_insertion_point(field_list:xla.DeviceAssignmentProto.ComputationDevice.replica_device_ids) + return replica_device_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +DeviceAssignmentProto_ComputationDevice::mutable_replica_device_ids() { + // @@protoc_insertion_point(field_mutable_list:xla.DeviceAssignmentProto.ComputationDevice.replica_device_ids) + return &replica_device_ids_; +} + +// ------------------------------------------------------------------- + +// DeviceAssignmentProto + +// int32 replica_count = 1; +inline void DeviceAssignmentProto::clear_replica_count() { + replica_count_ = 0; +} +inline ::google::protobuf::int32 DeviceAssignmentProto::replica_count() const { + // @@protoc_insertion_point(field_get:xla.DeviceAssignmentProto.replica_count) + return replica_count_; +} +inline void DeviceAssignmentProto::set_replica_count(::google::protobuf::int32 value) { + + replica_count_ = value; + // @@protoc_insertion_point(field_set:xla.DeviceAssignmentProto.replica_count) +} + +// int32 computation_count = 2; +inline void DeviceAssignmentProto::clear_computation_count() { + computation_count_ = 0; +} +inline ::google::protobuf::int32 DeviceAssignmentProto::computation_count() const { + // @@protoc_insertion_point(field_get:xla.DeviceAssignmentProto.computation_count) + return computation_count_; +} +inline void DeviceAssignmentProto::set_computation_count(::google::protobuf::int32 value) { + + computation_count_ = value; + // @@protoc_insertion_point(field_set:xla.DeviceAssignmentProto.computation_count) +} + +// repeated .xla.DeviceAssignmentProto.ComputationDevice computation_devices = 3; +inline int DeviceAssignmentProto::computation_devices_size() const { + return computation_devices_.size(); +} +inline void DeviceAssignmentProto::clear_computation_devices() { + computation_devices_.Clear(); +} +inline ::xla::DeviceAssignmentProto_ComputationDevice* DeviceAssignmentProto::mutable_computation_devices(int index) { + // @@protoc_insertion_point(field_mutable:xla.DeviceAssignmentProto.computation_devices) + return computation_devices_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::DeviceAssignmentProto_ComputationDevice >* +DeviceAssignmentProto::mutable_computation_devices() { + // @@protoc_insertion_point(field_mutable_list:xla.DeviceAssignmentProto.computation_devices) + return &computation_devices_; +} +inline const ::xla::DeviceAssignmentProto_ComputationDevice& DeviceAssignmentProto::computation_devices(int index) const { + // @@protoc_insertion_point(field_get:xla.DeviceAssignmentProto.computation_devices) + return computation_devices_.Get(index); +} +inline ::xla::DeviceAssignmentProto_ComputationDevice* DeviceAssignmentProto::add_computation_devices() { + // @@protoc_insertion_point(field_add:xla.DeviceAssignmentProto.computation_devices) + return computation_devices_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::DeviceAssignmentProto_ComputationDevice >& +DeviceAssignmentProto::computation_devices() const { + // @@protoc_insertion_point(field_list:xla.DeviceAssignmentProto.computation_devices) + return computation_devices_; +} + +// ------------------------------------------------------------------- + +// LiteralProto + +// .xla.ShapeProto shape = 1; +inline bool LiteralProto::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline void LiteralProto::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +inline const ::xla::ShapeProto& LiteralProto::_internal_shape() const { + return *shape_; +} +inline const ::xla::ShapeProto& LiteralProto::shape() const { + const ::xla::ShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:xla.LiteralProto.shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* LiteralProto::release_shape() { + // @@protoc_insertion_point(field_release:xla.LiteralProto.shape) + + ::xla::ShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* LiteralProto::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LiteralProto.shape) + + ::xla::ShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* LiteralProto::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.shape) + return shape_; +} +inline void LiteralProto::set_allocated_shape(::xla::ShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete shape_; + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(shape); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:xla.LiteralProto.shape) +} + +// repeated bool preds = 2; +inline int LiteralProto::preds_size() const { + return preds_.size(); +} +inline void LiteralProto::clear_preds() { + preds_.Clear(); +} +inline bool LiteralProto::preds(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.preds) + return preds_.Get(index); +} +inline void LiteralProto::set_preds(int index, bool value) { + preds_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.preds) +} +inline void LiteralProto::add_preds(bool value) { + preds_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.preds) +} +inline const ::google::protobuf::RepeatedField< bool >& +LiteralProto::preds() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.preds) + return preds_; +} +inline ::google::protobuf::RepeatedField< bool >* +LiteralProto::mutable_preds() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.preds) + return &preds_; +} + +// bytes s8s = 15; +inline void LiteralProto::clear_s8s() { + s8s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LiteralProto::s8s() const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.s8s) + return s8s_.Get(); +} +inline void LiteralProto::set_s8s(const ::std::string& value) { + + s8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LiteralProto.s8s) +} +#if LANG_CXX11 +inline void LiteralProto::set_s8s(::std::string&& value) { + + s8s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LiteralProto.s8s) +} +#endif +inline void LiteralProto::set_s8s(const char* value) { + GOOGLE_DCHECK(value != NULL); + + s8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LiteralProto.s8s) +} +inline void LiteralProto::set_s8s(const void* value, + size_t size) { + + s8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LiteralProto.s8s) +} +inline ::std::string* LiteralProto::mutable_s8s() { + + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.s8s) + return s8s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LiteralProto::release_s8s() { + // @@protoc_insertion_point(field_release:xla.LiteralProto.s8s) + + return s8s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LiteralProto::set_allocated_s8s(::std::string* s8s) { + if (s8s != NULL) { + + } else { + + } + s8s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s8s, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LiteralProto.s8s) +} +inline ::std::string* LiteralProto::unsafe_arena_release_s8s() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LiteralProto.s8s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return s8s_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LiteralProto::unsafe_arena_set_allocated_s8s( + ::std::string* s8s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (s8s != NULL) { + + } else { + + } + s8s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + s8s, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LiteralProto.s8s) +} + +// bytes u8s = 3; +inline void LiteralProto::clear_u8s() { + u8s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LiteralProto::u8s() const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.u8s) + return u8s_.Get(); +} +inline void LiteralProto::set_u8s(const ::std::string& value) { + + u8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LiteralProto.u8s) +} +#if LANG_CXX11 +inline void LiteralProto::set_u8s(::std::string&& value) { + + u8s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LiteralProto.u8s) +} +#endif +inline void LiteralProto::set_u8s(const char* value) { + GOOGLE_DCHECK(value != NULL); + + u8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LiteralProto.u8s) +} +inline void LiteralProto::set_u8s(const void* value, + size_t size) { + + u8s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LiteralProto.u8s) +} +inline ::std::string* LiteralProto::mutable_u8s() { + + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.u8s) + return u8s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LiteralProto::release_u8s() { + // @@protoc_insertion_point(field_release:xla.LiteralProto.u8s) + + return u8s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LiteralProto::set_allocated_u8s(::std::string* u8s) { + if (u8s != NULL) { + + } else { + + } + u8s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), u8s, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LiteralProto.u8s) +} +inline ::std::string* LiteralProto::unsafe_arena_release_u8s() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LiteralProto.u8s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return u8s_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LiteralProto::unsafe_arena_set_allocated_u8s( + ::std::string* u8s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (u8s != NULL) { + + } else { + + } + u8s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + u8s, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LiteralProto.u8s) +} + +// repeated int32 s32s = 4; +inline int LiteralProto::s32s_size() const { + return s32s_.size(); +} +inline void LiteralProto::clear_s32s() { + s32s_.Clear(); +} +inline ::google::protobuf::int32 LiteralProto::s32s(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.s32s) + return s32s_.Get(index); +} +inline void LiteralProto::set_s32s(int index, ::google::protobuf::int32 value) { + s32s_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.s32s) +} +inline void LiteralProto::add_s32s(::google::protobuf::int32 value) { + s32s_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.s32s) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +LiteralProto::s32s() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.s32s) + return s32s_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +LiteralProto::mutable_s32s() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.s32s) + return &s32s_; +} + +// repeated int64 s64s = 5; +inline int LiteralProto::s64s_size() const { + return s64s_.size(); +} +inline void LiteralProto::clear_s64s() { + s64s_.Clear(); +} +inline ::google::protobuf::int64 LiteralProto::s64s(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.s64s) + return s64s_.Get(index); +} +inline void LiteralProto::set_s64s(int index, ::google::protobuf::int64 value) { + s64s_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.s64s) +} +inline void LiteralProto::add_s64s(::google::protobuf::int64 value) { + s64s_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.s64s) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +LiteralProto::s64s() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.s64s) + return s64s_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +LiteralProto::mutable_s64s() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.s64s) + return &s64s_; +} + +// repeated uint32 u32s = 6; +inline int LiteralProto::u32s_size() const { + return u32s_.size(); +} +inline void LiteralProto::clear_u32s() { + u32s_.Clear(); +} +inline ::google::protobuf::uint32 LiteralProto::u32s(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.u32s) + return u32s_.Get(index); +} +inline void LiteralProto::set_u32s(int index, ::google::protobuf::uint32 value) { + u32s_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.u32s) +} +inline void LiteralProto::add_u32s(::google::protobuf::uint32 value) { + u32s_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.u32s) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +LiteralProto::u32s() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.u32s) + return u32s_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +LiteralProto::mutable_u32s() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.u32s) + return &u32s_; +} + +// repeated uint64 u64s = 7; +inline int LiteralProto::u64s_size() const { + return u64s_.size(); +} +inline void LiteralProto::clear_u64s() { + u64s_.Clear(); +} +inline ::google::protobuf::uint64 LiteralProto::u64s(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.u64s) + return u64s_.Get(index); +} +inline void LiteralProto::set_u64s(int index, ::google::protobuf::uint64 value) { + u64s_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.u64s) +} +inline void LiteralProto::add_u64s(::google::protobuf::uint64 value) { + u64s_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.u64s) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >& +LiteralProto::u64s() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.u64s) + return u64s_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >* +LiteralProto::mutable_u64s() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.u64s) + return &u64s_; +} + +// repeated float f32s = 8; +inline int LiteralProto::f32s_size() const { + return f32s_.size(); +} +inline void LiteralProto::clear_f32s() { + f32s_.Clear(); +} +inline float LiteralProto::f32s(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.f32s) + return f32s_.Get(index); +} +inline void LiteralProto::set_f32s(int index, float value) { + f32s_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.f32s) +} +inline void LiteralProto::add_f32s(float value) { + f32s_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.f32s) +} +inline const ::google::protobuf::RepeatedField< float >& +LiteralProto::f32s() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.f32s) + return f32s_; +} +inline ::google::protobuf::RepeatedField< float >* +LiteralProto::mutable_f32s() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.f32s) + return &f32s_; +} + +// repeated double f64s = 9; +inline int LiteralProto::f64s_size() const { + return f64s_.size(); +} +inline void LiteralProto::clear_f64s() { + f64s_.Clear(); +} +inline double LiteralProto::f64s(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.f64s) + return f64s_.Get(index); +} +inline void LiteralProto::set_f64s(int index, double value) { + f64s_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.f64s) +} +inline void LiteralProto::add_f64s(double value) { + f64s_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.f64s) +} +inline const ::google::protobuf::RepeatedField< double >& +LiteralProto::f64s() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.f64s) + return f64s_; +} +inline ::google::protobuf::RepeatedField< double >* +LiteralProto::mutable_f64s() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.f64s) + return &f64s_; +} + +// repeated float c64s = 12; +inline int LiteralProto::c64s_size() const { + return c64s_.size(); +} +inline void LiteralProto::clear_c64s() { + c64s_.Clear(); +} +inline float LiteralProto::c64s(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.c64s) + return c64s_.Get(index); +} +inline void LiteralProto::set_c64s(int index, float value) { + c64s_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.c64s) +} +inline void LiteralProto::add_c64s(float value) { + c64s_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.c64s) +} +inline const ::google::protobuf::RepeatedField< float >& +LiteralProto::c64s() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.c64s) + return c64s_; +} +inline ::google::protobuf::RepeatedField< float >* +LiteralProto::mutable_c64s() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.c64s) + return &c64s_; +} + +// repeated .xla.LiteralProto tuple_literals = 10; +inline int LiteralProto::tuple_literals_size() const { + return tuple_literals_.size(); +} +inline void LiteralProto::clear_tuple_literals() { + tuple_literals_.Clear(); +} +inline ::xla::LiteralProto* LiteralProto::mutable_tuple_literals(int index) { + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.tuple_literals) + return tuple_literals_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >* +LiteralProto::mutable_tuple_literals() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.tuple_literals) + return &tuple_literals_; +} +inline const ::xla::LiteralProto& LiteralProto::tuple_literals(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.tuple_literals) + return tuple_literals_.Get(index); +} +inline ::xla::LiteralProto* LiteralProto::add_tuple_literals() { + // @@protoc_insertion_point(field_add:xla.LiteralProto.tuple_literals) + return tuple_literals_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::LiteralProto >& +LiteralProto::tuple_literals() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.tuple_literals) + return tuple_literals_; +} + +// bytes f16s = 11; +inline void LiteralProto::clear_f16s() { + f16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LiteralProto::f16s() const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.f16s) + return f16s_.Get(); +} +inline void LiteralProto::set_f16s(const ::std::string& value) { + + f16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LiteralProto.f16s) +} +#if LANG_CXX11 +inline void LiteralProto::set_f16s(::std::string&& value) { + + f16s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LiteralProto.f16s) +} +#endif +inline void LiteralProto::set_f16s(const char* value) { + GOOGLE_DCHECK(value != NULL); + + f16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LiteralProto.f16s) +} +inline void LiteralProto::set_f16s(const void* value, + size_t size) { + + f16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LiteralProto.f16s) +} +inline ::std::string* LiteralProto::mutable_f16s() { + + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.f16s) + return f16s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LiteralProto::release_f16s() { + // @@protoc_insertion_point(field_release:xla.LiteralProto.f16s) + + return f16s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LiteralProto::set_allocated_f16s(::std::string* f16s) { + if (f16s != NULL) { + + } else { + + } + f16s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), f16s, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LiteralProto.f16s) +} +inline ::std::string* LiteralProto::unsafe_arena_release_f16s() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LiteralProto.f16s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return f16s_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LiteralProto::unsafe_arena_set_allocated_f16s( + ::std::string* f16s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (f16s != NULL) { + + } else { + + } + f16s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + f16s, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LiteralProto.f16s) +} + +// bytes bf16s = 13; +inline void LiteralProto::clear_bf16s() { + bf16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LiteralProto::bf16s() const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.bf16s) + return bf16s_.Get(); +} +inline void LiteralProto::set_bf16s(const ::std::string& value) { + + bf16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LiteralProto.bf16s) +} +#if LANG_CXX11 +inline void LiteralProto::set_bf16s(::std::string&& value) { + + bf16s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LiteralProto.bf16s) +} +#endif +inline void LiteralProto::set_bf16s(const char* value) { + GOOGLE_DCHECK(value != NULL); + + bf16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LiteralProto.bf16s) +} +inline void LiteralProto::set_bf16s(const void* value, + size_t size) { + + bf16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LiteralProto.bf16s) +} +inline ::std::string* LiteralProto::mutable_bf16s() { + + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.bf16s) + return bf16s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LiteralProto::release_bf16s() { + // @@protoc_insertion_point(field_release:xla.LiteralProto.bf16s) + + return bf16s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LiteralProto::set_allocated_bf16s(::std::string* bf16s) { + if (bf16s != NULL) { + + } else { + + } + bf16s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), bf16s, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LiteralProto.bf16s) +} +inline ::std::string* LiteralProto::unsafe_arena_release_bf16s() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LiteralProto.bf16s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return bf16s_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LiteralProto::unsafe_arena_set_allocated_bf16s( + ::std::string* bf16s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (bf16s != NULL) { + + } else { + + } + bf16s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + bf16s, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LiteralProto.bf16s) +} + +// bytes u16s = 16; +inline void LiteralProto::clear_u16s() { + u16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LiteralProto::u16s() const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.u16s) + return u16s_.Get(); +} +inline void LiteralProto::set_u16s(const ::std::string& value) { + + u16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LiteralProto.u16s) +} +#if LANG_CXX11 +inline void LiteralProto::set_u16s(::std::string&& value) { + + u16s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LiteralProto.u16s) +} +#endif +inline void LiteralProto::set_u16s(const char* value) { + GOOGLE_DCHECK(value != NULL); + + u16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LiteralProto.u16s) +} +inline void LiteralProto::set_u16s(const void* value, + size_t size) { + + u16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LiteralProto.u16s) +} +inline ::std::string* LiteralProto::mutable_u16s() { + + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.u16s) + return u16s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LiteralProto::release_u16s() { + // @@protoc_insertion_point(field_release:xla.LiteralProto.u16s) + + return u16s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LiteralProto::set_allocated_u16s(::std::string* u16s) { + if (u16s != NULL) { + + } else { + + } + u16s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), u16s, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LiteralProto.u16s) +} +inline ::std::string* LiteralProto::unsafe_arena_release_u16s() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LiteralProto.u16s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return u16s_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LiteralProto::unsafe_arena_set_allocated_u16s( + ::std::string* u16s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (u16s != NULL) { + + } else { + + } + u16s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + u16s, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LiteralProto.u16s) +} + +// bytes s16s = 17; +inline void LiteralProto::clear_s16s() { + s16s_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& LiteralProto::s16s() const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.s16s) + return s16s_.Get(); +} +inline void LiteralProto::set_s16s(const ::std::string& value) { + + s16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:xla.LiteralProto.s16s) +} +#if LANG_CXX11 +inline void LiteralProto::set_s16s(::std::string&& value) { + + s16s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:xla.LiteralProto.s16s) +} +#endif +inline void LiteralProto::set_s16s(const char* value) { + GOOGLE_DCHECK(value != NULL); + + s16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:xla.LiteralProto.s16s) +} +inline void LiteralProto::set_s16s(const void* value, + size_t size) { + + s16s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:xla.LiteralProto.s16s) +} +inline ::std::string* LiteralProto::mutable_s16s() { + + // @@protoc_insertion_point(field_mutable:xla.LiteralProto.s16s) + return s16s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* LiteralProto::release_s16s() { + // @@protoc_insertion_point(field_release:xla.LiteralProto.s16s) + + return s16s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void LiteralProto::set_allocated_s16s(::std::string* s16s) { + if (s16s != NULL) { + + } else { + + } + s16s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s16s, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:xla.LiteralProto.s16s) +} +inline ::std::string* LiteralProto::unsafe_arena_release_s16s() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.LiteralProto.s16s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return s16s_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void LiteralProto::unsafe_arena_set_allocated_s16s( + ::std::string* s16s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (s16s != NULL) { + + } else { + + } + s16s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + s16s, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xla.LiteralProto.s16s) +} + +// repeated int64 sparse_indices = 14; +inline int LiteralProto::sparse_indices_size() const { + return sparse_indices_.size(); +} +inline void LiteralProto::clear_sparse_indices() { + sparse_indices_.Clear(); +} +inline ::google::protobuf::int64 LiteralProto::sparse_indices(int index) const { + // @@protoc_insertion_point(field_get:xla.LiteralProto.sparse_indices) + return sparse_indices_.Get(index); +} +inline void LiteralProto::set_sparse_indices(int index, ::google::protobuf::int64 value) { + sparse_indices_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.LiteralProto.sparse_indices) +} +inline void LiteralProto::add_sparse_indices(::google::protobuf::int64 value) { + sparse_indices_.Add(value); + // @@protoc_insertion_point(field_add:xla.LiteralProto.sparse_indices) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +LiteralProto::sparse_indices() const { + // @@protoc_insertion_point(field_list:xla.LiteralProto.sparse_indices) + return sparse_indices_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +LiteralProto::mutable_sparse_indices() { + // @@protoc_insertion_point(field_mutable_list:xla.LiteralProto.sparse_indices) + return &sparse_indices_; +} + +// ------------------------------------------------------------------- + +// WindowDimension + +// int64 size = 1; +inline void WindowDimension::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 WindowDimension::size() const { + // @@protoc_insertion_point(field_get:xla.WindowDimension.size) + return size_; +} +inline void WindowDimension::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:xla.WindowDimension.size) +} + +// int64 stride = 2; +inline void WindowDimension::clear_stride() { + stride_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 WindowDimension::stride() const { + // @@protoc_insertion_point(field_get:xla.WindowDimension.stride) + return stride_; +} +inline void WindowDimension::set_stride(::google::protobuf::int64 value) { + + stride_ = value; + // @@protoc_insertion_point(field_set:xla.WindowDimension.stride) +} + +// int64 padding_low = 3; +inline void WindowDimension::clear_padding_low() { + padding_low_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 WindowDimension::padding_low() const { + // @@protoc_insertion_point(field_get:xla.WindowDimension.padding_low) + return padding_low_; +} +inline void WindowDimension::set_padding_low(::google::protobuf::int64 value) { + + padding_low_ = value; + // @@protoc_insertion_point(field_set:xla.WindowDimension.padding_low) +} + +// int64 padding_high = 4; +inline void WindowDimension::clear_padding_high() { + padding_high_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 WindowDimension::padding_high() const { + // @@protoc_insertion_point(field_get:xla.WindowDimension.padding_high) + return padding_high_; +} +inline void WindowDimension::set_padding_high(::google::protobuf::int64 value) { + + padding_high_ = value; + // @@protoc_insertion_point(field_set:xla.WindowDimension.padding_high) +} + +// int64 window_dilation = 5; +inline void WindowDimension::clear_window_dilation() { + window_dilation_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 WindowDimension::window_dilation() const { + // @@protoc_insertion_point(field_get:xla.WindowDimension.window_dilation) + return window_dilation_; +} +inline void WindowDimension::set_window_dilation(::google::protobuf::int64 value) { + + window_dilation_ = value; + // @@protoc_insertion_point(field_set:xla.WindowDimension.window_dilation) +} + +// int64 base_dilation = 6; +inline void WindowDimension::clear_base_dilation() { + base_dilation_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 WindowDimension::base_dilation() const { + // @@protoc_insertion_point(field_get:xla.WindowDimension.base_dilation) + return base_dilation_; +} +inline void WindowDimension::set_base_dilation(::google::protobuf::int64 value) { + + base_dilation_ = value; + // @@protoc_insertion_point(field_set:xla.WindowDimension.base_dilation) +} + +// bool window_reversal = 7; +inline void WindowDimension::clear_window_reversal() { + window_reversal_ = false; +} +inline bool WindowDimension::window_reversal() const { + // @@protoc_insertion_point(field_get:xla.WindowDimension.window_reversal) + return window_reversal_; +} +inline void WindowDimension::set_window_reversal(bool value) { + + window_reversal_ = value; + // @@protoc_insertion_point(field_set:xla.WindowDimension.window_reversal) +} + +// ------------------------------------------------------------------- + +// Window + +// repeated .xla.WindowDimension dimensions = 1; +inline int Window::dimensions_size() const { + return dimensions_.size(); +} +inline void Window::clear_dimensions() { + dimensions_.Clear(); +} +inline ::xla::WindowDimension* Window::mutable_dimensions(int index) { + // @@protoc_insertion_point(field_mutable:xla.Window.dimensions) + return dimensions_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::WindowDimension >* +Window::mutable_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.Window.dimensions) + return &dimensions_; +} +inline const ::xla::WindowDimension& Window::dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.Window.dimensions) + return dimensions_.Get(index); +} +inline ::xla::WindowDimension* Window::add_dimensions() { + // @@protoc_insertion_point(field_add:xla.Window.dimensions) + return dimensions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::WindowDimension >& +Window::dimensions() const { + // @@protoc_insertion_point(field_list:xla.Window.dimensions) + return dimensions_; +} + +// ------------------------------------------------------------------- + +// GatherDimensionNumbers + +// repeated int64 offset_dims = 1; +inline int GatherDimensionNumbers::offset_dims_size() const { + return offset_dims_.size(); +} +inline void GatherDimensionNumbers::clear_offset_dims() { + offset_dims_.Clear(); +} +inline ::google::protobuf::int64 GatherDimensionNumbers::offset_dims(int index) const { + // @@protoc_insertion_point(field_get:xla.GatherDimensionNumbers.offset_dims) + return offset_dims_.Get(index); +} +inline void GatherDimensionNumbers::set_offset_dims(int index, ::google::protobuf::int64 value) { + offset_dims_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.GatherDimensionNumbers.offset_dims) +} +inline void GatherDimensionNumbers::add_offset_dims(::google::protobuf::int64 value) { + offset_dims_.Add(value); + // @@protoc_insertion_point(field_add:xla.GatherDimensionNumbers.offset_dims) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +GatherDimensionNumbers::offset_dims() const { + // @@protoc_insertion_point(field_list:xla.GatherDimensionNumbers.offset_dims) + return offset_dims_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +GatherDimensionNumbers::mutable_offset_dims() { + // @@protoc_insertion_point(field_mutable_list:xla.GatherDimensionNumbers.offset_dims) + return &offset_dims_; +} + +// repeated int64 collapsed_slice_dims = 2; +inline int GatherDimensionNumbers::collapsed_slice_dims_size() const { + return collapsed_slice_dims_.size(); +} +inline void GatherDimensionNumbers::clear_collapsed_slice_dims() { + collapsed_slice_dims_.Clear(); +} +inline ::google::protobuf::int64 GatherDimensionNumbers::collapsed_slice_dims(int index) const { + // @@protoc_insertion_point(field_get:xla.GatherDimensionNumbers.collapsed_slice_dims) + return collapsed_slice_dims_.Get(index); +} +inline void GatherDimensionNumbers::set_collapsed_slice_dims(int index, ::google::protobuf::int64 value) { + collapsed_slice_dims_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.GatherDimensionNumbers.collapsed_slice_dims) +} +inline void GatherDimensionNumbers::add_collapsed_slice_dims(::google::protobuf::int64 value) { + collapsed_slice_dims_.Add(value); + // @@protoc_insertion_point(field_add:xla.GatherDimensionNumbers.collapsed_slice_dims) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +GatherDimensionNumbers::collapsed_slice_dims() const { + // @@protoc_insertion_point(field_list:xla.GatherDimensionNumbers.collapsed_slice_dims) + return collapsed_slice_dims_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +GatherDimensionNumbers::mutable_collapsed_slice_dims() { + // @@protoc_insertion_point(field_mutable_list:xla.GatherDimensionNumbers.collapsed_slice_dims) + return &collapsed_slice_dims_; +} + +// repeated int64 start_index_map = 3; +inline int GatherDimensionNumbers::start_index_map_size() const { + return start_index_map_.size(); +} +inline void GatherDimensionNumbers::clear_start_index_map() { + start_index_map_.Clear(); +} +inline ::google::protobuf::int64 GatherDimensionNumbers::start_index_map(int index) const { + // @@protoc_insertion_point(field_get:xla.GatherDimensionNumbers.start_index_map) + return start_index_map_.Get(index); +} +inline void GatherDimensionNumbers::set_start_index_map(int index, ::google::protobuf::int64 value) { + start_index_map_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.GatherDimensionNumbers.start_index_map) +} +inline void GatherDimensionNumbers::add_start_index_map(::google::protobuf::int64 value) { + start_index_map_.Add(value); + // @@protoc_insertion_point(field_add:xla.GatherDimensionNumbers.start_index_map) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +GatherDimensionNumbers::start_index_map() const { + // @@protoc_insertion_point(field_list:xla.GatherDimensionNumbers.start_index_map) + return start_index_map_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +GatherDimensionNumbers::mutable_start_index_map() { + // @@protoc_insertion_point(field_mutable_list:xla.GatherDimensionNumbers.start_index_map) + return &start_index_map_; +} + +// int64 index_vector_dim = 4; +inline void GatherDimensionNumbers::clear_index_vector_dim() { + index_vector_dim_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 GatherDimensionNumbers::index_vector_dim() const { + // @@protoc_insertion_point(field_get:xla.GatherDimensionNumbers.index_vector_dim) + return index_vector_dim_; +} +inline void GatherDimensionNumbers::set_index_vector_dim(::google::protobuf::int64 value) { + + index_vector_dim_ = value; + // @@protoc_insertion_point(field_set:xla.GatherDimensionNumbers.index_vector_dim) +} + +// ------------------------------------------------------------------- + +// ScatterDimensionNumbers + +// repeated int64 update_window_dims = 1; +inline int ScatterDimensionNumbers::update_window_dims_size() const { + return update_window_dims_.size(); +} +inline void ScatterDimensionNumbers::clear_update_window_dims() { + update_window_dims_.Clear(); +} +inline ::google::protobuf::int64 ScatterDimensionNumbers::update_window_dims(int index) const { + // @@protoc_insertion_point(field_get:xla.ScatterDimensionNumbers.update_window_dims) + return update_window_dims_.Get(index); +} +inline void ScatterDimensionNumbers::set_update_window_dims(int index, ::google::protobuf::int64 value) { + update_window_dims_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ScatterDimensionNumbers.update_window_dims) +} +inline void ScatterDimensionNumbers::add_update_window_dims(::google::protobuf::int64 value) { + update_window_dims_.Add(value); + // @@protoc_insertion_point(field_add:xla.ScatterDimensionNumbers.update_window_dims) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ScatterDimensionNumbers::update_window_dims() const { + // @@protoc_insertion_point(field_list:xla.ScatterDimensionNumbers.update_window_dims) + return update_window_dims_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ScatterDimensionNumbers::mutable_update_window_dims() { + // @@protoc_insertion_point(field_mutable_list:xla.ScatterDimensionNumbers.update_window_dims) + return &update_window_dims_; +} + +// repeated int64 inserted_window_dims = 2; +inline int ScatterDimensionNumbers::inserted_window_dims_size() const { + return inserted_window_dims_.size(); +} +inline void ScatterDimensionNumbers::clear_inserted_window_dims() { + inserted_window_dims_.Clear(); +} +inline ::google::protobuf::int64 ScatterDimensionNumbers::inserted_window_dims(int index) const { + // @@protoc_insertion_point(field_get:xla.ScatterDimensionNumbers.inserted_window_dims) + return inserted_window_dims_.Get(index); +} +inline void ScatterDimensionNumbers::set_inserted_window_dims(int index, ::google::protobuf::int64 value) { + inserted_window_dims_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ScatterDimensionNumbers.inserted_window_dims) +} +inline void ScatterDimensionNumbers::add_inserted_window_dims(::google::protobuf::int64 value) { + inserted_window_dims_.Add(value); + // @@protoc_insertion_point(field_add:xla.ScatterDimensionNumbers.inserted_window_dims) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ScatterDimensionNumbers::inserted_window_dims() const { + // @@protoc_insertion_point(field_list:xla.ScatterDimensionNumbers.inserted_window_dims) + return inserted_window_dims_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ScatterDimensionNumbers::mutable_inserted_window_dims() { + // @@protoc_insertion_point(field_mutable_list:xla.ScatterDimensionNumbers.inserted_window_dims) + return &inserted_window_dims_; +} + +// repeated int64 scatter_dims_to_operand_dims = 3; +inline int ScatterDimensionNumbers::scatter_dims_to_operand_dims_size() const { + return scatter_dims_to_operand_dims_.size(); +} +inline void ScatterDimensionNumbers::clear_scatter_dims_to_operand_dims() { + scatter_dims_to_operand_dims_.Clear(); +} +inline ::google::protobuf::int64 ScatterDimensionNumbers::scatter_dims_to_operand_dims(int index) const { + // @@protoc_insertion_point(field_get:xla.ScatterDimensionNumbers.scatter_dims_to_operand_dims) + return scatter_dims_to_operand_dims_.Get(index); +} +inline void ScatterDimensionNumbers::set_scatter_dims_to_operand_dims(int index, ::google::protobuf::int64 value) { + scatter_dims_to_operand_dims_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ScatterDimensionNumbers.scatter_dims_to_operand_dims) +} +inline void ScatterDimensionNumbers::add_scatter_dims_to_operand_dims(::google::protobuf::int64 value) { + scatter_dims_to_operand_dims_.Add(value); + // @@protoc_insertion_point(field_add:xla.ScatterDimensionNumbers.scatter_dims_to_operand_dims) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ScatterDimensionNumbers::scatter_dims_to_operand_dims() const { + // @@protoc_insertion_point(field_list:xla.ScatterDimensionNumbers.scatter_dims_to_operand_dims) + return scatter_dims_to_operand_dims_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ScatterDimensionNumbers::mutable_scatter_dims_to_operand_dims() { + // @@protoc_insertion_point(field_mutable_list:xla.ScatterDimensionNumbers.scatter_dims_to_operand_dims) + return &scatter_dims_to_operand_dims_; +} + +// int64 index_vector_dim = 4; +inline void ScatterDimensionNumbers::clear_index_vector_dim() { + index_vector_dim_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ScatterDimensionNumbers::index_vector_dim() const { + // @@protoc_insertion_point(field_get:xla.ScatterDimensionNumbers.index_vector_dim) + return index_vector_dim_; +} +inline void ScatterDimensionNumbers::set_index_vector_dim(::google::protobuf::int64 value) { + + index_vector_dim_ = value; + // @@protoc_insertion_point(field_set:xla.ScatterDimensionNumbers.index_vector_dim) +} + +// ------------------------------------------------------------------- + +// ConvolutionDimensionNumbers + +// int64 input_batch_dimension = 7; +inline void ConvolutionDimensionNumbers::clear_input_batch_dimension() { + input_batch_dimension_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::input_batch_dimension() const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.input_batch_dimension) + return input_batch_dimension_; +} +inline void ConvolutionDimensionNumbers::set_input_batch_dimension(::google::protobuf::int64 value) { + + input_batch_dimension_ = value; + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.input_batch_dimension) +} + +// int64 input_feature_dimension = 8; +inline void ConvolutionDimensionNumbers::clear_input_feature_dimension() { + input_feature_dimension_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::input_feature_dimension() const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.input_feature_dimension) + return input_feature_dimension_; +} +inline void ConvolutionDimensionNumbers::set_input_feature_dimension(::google::protobuf::int64 value) { + + input_feature_dimension_ = value; + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.input_feature_dimension) +} + +// repeated int64 input_spatial_dimensions = 11; +inline int ConvolutionDimensionNumbers::input_spatial_dimensions_size() const { + return input_spatial_dimensions_.size(); +} +inline void ConvolutionDimensionNumbers::clear_input_spatial_dimensions() { + input_spatial_dimensions_.Clear(); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::input_spatial_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.input_spatial_dimensions) + return input_spatial_dimensions_.Get(index); +} +inline void ConvolutionDimensionNumbers::set_input_spatial_dimensions(int index, ::google::protobuf::int64 value) { + input_spatial_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.input_spatial_dimensions) +} +inline void ConvolutionDimensionNumbers::add_input_spatial_dimensions(::google::protobuf::int64 value) { + input_spatial_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.ConvolutionDimensionNumbers.input_spatial_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ConvolutionDimensionNumbers::input_spatial_dimensions() const { + // @@protoc_insertion_point(field_list:xla.ConvolutionDimensionNumbers.input_spatial_dimensions) + return input_spatial_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ConvolutionDimensionNumbers::mutable_input_spatial_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.ConvolutionDimensionNumbers.input_spatial_dimensions) + return &input_spatial_dimensions_; +} + +// int64 kernel_input_feature_dimension = 3; +inline void ConvolutionDimensionNumbers::clear_kernel_input_feature_dimension() { + kernel_input_feature_dimension_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::kernel_input_feature_dimension() const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.kernel_input_feature_dimension) + return kernel_input_feature_dimension_; +} +inline void ConvolutionDimensionNumbers::set_kernel_input_feature_dimension(::google::protobuf::int64 value) { + + kernel_input_feature_dimension_ = value; + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.kernel_input_feature_dimension) +} + +// int64 kernel_output_feature_dimension = 4; +inline void ConvolutionDimensionNumbers::clear_kernel_output_feature_dimension() { + kernel_output_feature_dimension_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::kernel_output_feature_dimension() const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.kernel_output_feature_dimension) + return kernel_output_feature_dimension_; +} +inline void ConvolutionDimensionNumbers::set_kernel_output_feature_dimension(::google::protobuf::int64 value) { + + kernel_output_feature_dimension_ = value; + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.kernel_output_feature_dimension) +} + +// repeated int64 kernel_spatial_dimensions = 6; +inline int ConvolutionDimensionNumbers::kernel_spatial_dimensions_size() const { + return kernel_spatial_dimensions_.size(); +} +inline void ConvolutionDimensionNumbers::clear_kernel_spatial_dimensions() { + kernel_spatial_dimensions_.Clear(); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::kernel_spatial_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.kernel_spatial_dimensions) + return kernel_spatial_dimensions_.Get(index); +} +inline void ConvolutionDimensionNumbers::set_kernel_spatial_dimensions(int index, ::google::protobuf::int64 value) { + kernel_spatial_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.kernel_spatial_dimensions) +} +inline void ConvolutionDimensionNumbers::add_kernel_spatial_dimensions(::google::protobuf::int64 value) { + kernel_spatial_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.ConvolutionDimensionNumbers.kernel_spatial_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ConvolutionDimensionNumbers::kernel_spatial_dimensions() const { + // @@protoc_insertion_point(field_list:xla.ConvolutionDimensionNumbers.kernel_spatial_dimensions) + return kernel_spatial_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ConvolutionDimensionNumbers::mutable_kernel_spatial_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.ConvolutionDimensionNumbers.kernel_spatial_dimensions) + return &kernel_spatial_dimensions_; +} + +// int64 output_batch_dimension = 9; +inline void ConvolutionDimensionNumbers::clear_output_batch_dimension() { + output_batch_dimension_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::output_batch_dimension() const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.output_batch_dimension) + return output_batch_dimension_; +} +inline void ConvolutionDimensionNumbers::set_output_batch_dimension(::google::protobuf::int64 value) { + + output_batch_dimension_ = value; + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.output_batch_dimension) +} + +// int64 output_feature_dimension = 10; +inline void ConvolutionDimensionNumbers::clear_output_feature_dimension() { + output_feature_dimension_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::output_feature_dimension() const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.output_feature_dimension) + return output_feature_dimension_; +} +inline void ConvolutionDimensionNumbers::set_output_feature_dimension(::google::protobuf::int64 value) { + + output_feature_dimension_ = value; + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.output_feature_dimension) +} + +// repeated int64 output_spatial_dimensions = 12; +inline int ConvolutionDimensionNumbers::output_spatial_dimensions_size() const { + return output_spatial_dimensions_.size(); +} +inline void ConvolutionDimensionNumbers::clear_output_spatial_dimensions() { + output_spatial_dimensions_.Clear(); +} +inline ::google::protobuf::int64 ConvolutionDimensionNumbers::output_spatial_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.ConvolutionDimensionNumbers.output_spatial_dimensions) + return output_spatial_dimensions_.Get(index); +} +inline void ConvolutionDimensionNumbers::set_output_spatial_dimensions(int index, ::google::protobuf::int64 value) { + output_spatial_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ConvolutionDimensionNumbers.output_spatial_dimensions) +} +inline void ConvolutionDimensionNumbers::add_output_spatial_dimensions(::google::protobuf::int64 value) { + output_spatial_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.ConvolutionDimensionNumbers.output_spatial_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ConvolutionDimensionNumbers::output_spatial_dimensions() const { + // @@protoc_insertion_point(field_list:xla.ConvolutionDimensionNumbers.output_spatial_dimensions) + return output_spatial_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ConvolutionDimensionNumbers::mutable_output_spatial_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.ConvolutionDimensionNumbers.output_spatial_dimensions) + return &output_spatial_dimensions_; +} + +// ------------------------------------------------------------------- + +// DotDimensionNumbers + +// repeated int64 lhs_contracting_dimensions = 1; +inline int DotDimensionNumbers::lhs_contracting_dimensions_size() const { + return lhs_contracting_dimensions_.size(); +} +inline void DotDimensionNumbers::clear_lhs_contracting_dimensions() { + lhs_contracting_dimensions_.Clear(); +} +inline ::google::protobuf::int64 DotDimensionNumbers::lhs_contracting_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.DotDimensionNumbers.lhs_contracting_dimensions) + return lhs_contracting_dimensions_.Get(index); +} +inline void DotDimensionNumbers::set_lhs_contracting_dimensions(int index, ::google::protobuf::int64 value) { + lhs_contracting_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.DotDimensionNumbers.lhs_contracting_dimensions) +} +inline void DotDimensionNumbers::add_lhs_contracting_dimensions(::google::protobuf::int64 value) { + lhs_contracting_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.DotDimensionNumbers.lhs_contracting_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DotDimensionNumbers::lhs_contracting_dimensions() const { + // @@protoc_insertion_point(field_list:xla.DotDimensionNumbers.lhs_contracting_dimensions) + return lhs_contracting_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DotDimensionNumbers::mutable_lhs_contracting_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.DotDimensionNumbers.lhs_contracting_dimensions) + return &lhs_contracting_dimensions_; +} + +// repeated int64 rhs_contracting_dimensions = 2; +inline int DotDimensionNumbers::rhs_contracting_dimensions_size() const { + return rhs_contracting_dimensions_.size(); +} +inline void DotDimensionNumbers::clear_rhs_contracting_dimensions() { + rhs_contracting_dimensions_.Clear(); +} +inline ::google::protobuf::int64 DotDimensionNumbers::rhs_contracting_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.DotDimensionNumbers.rhs_contracting_dimensions) + return rhs_contracting_dimensions_.Get(index); +} +inline void DotDimensionNumbers::set_rhs_contracting_dimensions(int index, ::google::protobuf::int64 value) { + rhs_contracting_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.DotDimensionNumbers.rhs_contracting_dimensions) +} +inline void DotDimensionNumbers::add_rhs_contracting_dimensions(::google::protobuf::int64 value) { + rhs_contracting_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.DotDimensionNumbers.rhs_contracting_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DotDimensionNumbers::rhs_contracting_dimensions() const { + // @@protoc_insertion_point(field_list:xla.DotDimensionNumbers.rhs_contracting_dimensions) + return rhs_contracting_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DotDimensionNumbers::mutable_rhs_contracting_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.DotDimensionNumbers.rhs_contracting_dimensions) + return &rhs_contracting_dimensions_; +} + +// repeated int64 lhs_batch_dimensions = 3; +inline int DotDimensionNumbers::lhs_batch_dimensions_size() const { + return lhs_batch_dimensions_.size(); +} +inline void DotDimensionNumbers::clear_lhs_batch_dimensions() { + lhs_batch_dimensions_.Clear(); +} +inline ::google::protobuf::int64 DotDimensionNumbers::lhs_batch_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.DotDimensionNumbers.lhs_batch_dimensions) + return lhs_batch_dimensions_.Get(index); +} +inline void DotDimensionNumbers::set_lhs_batch_dimensions(int index, ::google::protobuf::int64 value) { + lhs_batch_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.DotDimensionNumbers.lhs_batch_dimensions) +} +inline void DotDimensionNumbers::add_lhs_batch_dimensions(::google::protobuf::int64 value) { + lhs_batch_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.DotDimensionNumbers.lhs_batch_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DotDimensionNumbers::lhs_batch_dimensions() const { + // @@protoc_insertion_point(field_list:xla.DotDimensionNumbers.lhs_batch_dimensions) + return lhs_batch_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DotDimensionNumbers::mutable_lhs_batch_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.DotDimensionNumbers.lhs_batch_dimensions) + return &lhs_batch_dimensions_; +} + +// repeated int64 rhs_batch_dimensions = 4; +inline int DotDimensionNumbers::rhs_batch_dimensions_size() const { + return rhs_batch_dimensions_.size(); +} +inline void DotDimensionNumbers::clear_rhs_batch_dimensions() { + rhs_batch_dimensions_.Clear(); +} +inline ::google::protobuf::int64 DotDimensionNumbers::rhs_batch_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.DotDimensionNumbers.rhs_batch_dimensions) + return rhs_batch_dimensions_.Get(index); +} +inline void DotDimensionNumbers::set_rhs_batch_dimensions(int index, ::google::protobuf::int64 value) { + rhs_batch_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.DotDimensionNumbers.rhs_batch_dimensions) +} +inline void DotDimensionNumbers::add_rhs_batch_dimensions(::google::protobuf::int64 value) { + rhs_batch_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.DotDimensionNumbers.rhs_batch_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DotDimensionNumbers::rhs_batch_dimensions() const { + // @@protoc_insertion_point(field_list:xla.DotDimensionNumbers.rhs_batch_dimensions) + return rhs_batch_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DotDimensionNumbers::mutable_rhs_batch_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.DotDimensionNumbers.rhs_batch_dimensions) + return &rhs_batch_dimensions_; +} + +// ------------------------------------------------------------------- + +// OpSharding + +// .xla.OpSharding.Type type = 1; +inline void OpSharding::clear_type() { + type_ = 0; +} +inline ::xla::OpSharding_Type OpSharding::type() const { + // @@protoc_insertion_point(field_get:xla.OpSharding.type) + return static_cast< ::xla::OpSharding_Type >(type_); +} +inline void OpSharding::set_type(::xla::OpSharding_Type value) { + + type_ = value; + // @@protoc_insertion_point(field_set:xla.OpSharding.type) +} + +// .xla.ShapeProto tile_shape = 2; +inline bool OpSharding::has_tile_shape() const { + return this != internal_default_instance() && tile_shape_ != NULL; +} +inline void OpSharding::clear_tile_shape() { + if (GetArenaNoVirtual() == NULL && tile_shape_ != NULL) { + delete tile_shape_; + } + tile_shape_ = NULL; +} +inline const ::xla::ShapeProto& OpSharding::_internal_tile_shape() const { + return *tile_shape_; +} +inline const ::xla::ShapeProto& OpSharding::tile_shape() const { + const ::xla::ShapeProto* p = tile_shape_; + // @@protoc_insertion_point(field_get:xla.OpSharding.tile_shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ShapeProto_default_instance_); +} +inline ::xla::ShapeProto* OpSharding::release_tile_shape() { + // @@protoc_insertion_point(field_release:xla.OpSharding.tile_shape) + + ::xla::ShapeProto* temp = tile_shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tile_shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* OpSharding::unsafe_arena_release_tile_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:xla.OpSharding.tile_shape) + + ::xla::ShapeProto* temp = tile_shape_; + tile_shape_ = NULL; + return temp; +} +inline ::xla::ShapeProto* OpSharding::mutable_tile_shape() { + + if (tile_shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ShapeProto>(GetArenaNoVirtual()); + tile_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xla.OpSharding.tile_shape) + return tile_shape_; +} +inline void OpSharding::set_allocated_tile_shape(::xla::ShapeProto* tile_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete tile_shape_; + } + if (tile_shape) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(tile_shape); + if (message_arena != submessage_arena) { + tile_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tile_shape, submessage_arena); + } + + } else { + + } + tile_shape_ = tile_shape; + // @@protoc_insertion_point(field_set_allocated:xla.OpSharding.tile_shape) +} + +// repeated int64 tile_assignment_dimensions = 3; +inline int OpSharding::tile_assignment_dimensions_size() const { + return tile_assignment_dimensions_.size(); +} +inline void OpSharding::clear_tile_assignment_dimensions() { + tile_assignment_dimensions_.Clear(); +} +inline ::google::protobuf::int64 OpSharding::tile_assignment_dimensions(int index) const { + // @@protoc_insertion_point(field_get:xla.OpSharding.tile_assignment_dimensions) + return tile_assignment_dimensions_.Get(index); +} +inline void OpSharding::set_tile_assignment_dimensions(int index, ::google::protobuf::int64 value) { + tile_assignment_dimensions_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.OpSharding.tile_assignment_dimensions) +} +inline void OpSharding::add_tile_assignment_dimensions(::google::protobuf::int64 value) { + tile_assignment_dimensions_.Add(value); + // @@protoc_insertion_point(field_add:xla.OpSharding.tile_assignment_dimensions) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +OpSharding::tile_assignment_dimensions() const { + // @@protoc_insertion_point(field_list:xla.OpSharding.tile_assignment_dimensions) + return tile_assignment_dimensions_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +OpSharding::mutable_tile_assignment_dimensions() { + // @@protoc_insertion_point(field_mutable_list:xla.OpSharding.tile_assignment_dimensions) + return &tile_assignment_dimensions_; +} + +// repeated int64 tile_assignment_devices = 4; +inline int OpSharding::tile_assignment_devices_size() const { + return tile_assignment_devices_.size(); +} +inline void OpSharding::clear_tile_assignment_devices() { + tile_assignment_devices_.Clear(); +} +inline ::google::protobuf::int64 OpSharding::tile_assignment_devices(int index) const { + // @@protoc_insertion_point(field_get:xla.OpSharding.tile_assignment_devices) + return tile_assignment_devices_.Get(index); +} +inline void OpSharding::set_tile_assignment_devices(int index, ::google::protobuf::int64 value) { + tile_assignment_devices_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.OpSharding.tile_assignment_devices) +} +inline void OpSharding::add_tile_assignment_devices(::google::protobuf::int64 value) { + tile_assignment_devices_.Add(value); + // @@protoc_insertion_point(field_add:xla.OpSharding.tile_assignment_devices) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +OpSharding::tile_assignment_devices() const { + // @@protoc_insertion_point(field_list:xla.OpSharding.tile_assignment_devices) + return tile_assignment_devices_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +OpSharding::mutable_tile_assignment_devices() { + // @@protoc_insertion_point(field_mutable_list:xla.OpSharding.tile_assignment_devices) + return &tile_assignment_devices_; +} + +// repeated .xla.OpSharding tuple_shardings = 5; +inline int OpSharding::tuple_shardings_size() const { + return tuple_shardings_.size(); +} +inline void OpSharding::clear_tuple_shardings() { + tuple_shardings_.Clear(); +} +inline ::xla::OpSharding* OpSharding::mutable_tuple_shardings(int index) { + // @@protoc_insertion_point(field_mutable:xla.OpSharding.tuple_shardings) + return tuple_shardings_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::OpSharding >* +OpSharding::mutable_tuple_shardings() { + // @@protoc_insertion_point(field_mutable_list:xla.OpSharding.tuple_shardings) + return &tuple_shardings_; +} +inline const ::xla::OpSharding& OpSharding::tuple_shardings(int index) const { + // @@protoc_insertion_point(field_get:xla.OpSharding.tuple_shardings) + return tuple_shardings_.Get(index); +} +inline ::xla::OpSharding* OpSharding::add_tuple_shardings() { + // @@protoc_insertion_point(field_add:xla.OpSharding.tuple_shardings) + return tuple_shardings_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::OpSharding >& +OpSharding::tuple_shardings() const { + // @@protoc_insertion_point(field_list:xla.OpSharding.tuple_shardings) + return tuple_shardings_; +} + +// ------------------------------------------------------------------- + +// ReplicaGroup + +// repeated int64 replica_ids = 1; +inline int ReplicaGroup::replica_ids_size() const { + return replica_ids_.size(); +} +inline void ReplicaGroup::clear_replica_ids() { + replica_ids_.Clear(); +} +inline ::google::protobuf::int64 ReplicaGroup::replica_ids(int index) const { + // @@protoc_insertion_point(field_get:xla.ReplicaGroup.replica_ids) + return replica_ids_.Get(index); +} +inline void ReplicaGroup::set_replica_ids(int index, ::google::protobuf::int64 value) { + replica_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.ReplicaGroup.replica_ids) +} +inline void ReplicaGroup::add_replica_ids(::google::protobuf::int64 value) { + replica_ids_.Add(value); + // @@protoc_insertion_point(field_add:xla.ReplicaGroup.replica_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +ReplicaGroup::replica_ids() const { + // @@protoc_insertion_point(field_list:xla.ReplicaGroup.replica_ids) + return replica_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +ReplicaGroup::mutable_replica_ids() { + // @@protoc_insertion_point(field_mutable_list:xla.ReplicaGroup.replica_ids) + return &replica_ids_; +} + +// ------------------------------------------------------------------- + +// SourceTarget + +// int64 source = 1; +inline void SourceTarget::clear_source() { + source_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 SourceTarget::source() const { + // @@protoc_insertion_point(field_get:xla.SourceTarget.source) + return source_; +} +inline void SourceTarget::set_source(::google::protobuf::int64 value) { + + source_ = value; + // @@protoc_insertion_point(field_set:xla.SourceTarget.source) +} + +// int64 target = 2; +inline void SourceTarget::clear_target() { + target_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 SourceTarget::target() const { + // @@protoc_insertion_point(field_get:xla.SourceTarget.target) + return target_; +} +inline void SourceTarget::set_target(::google::protobuf::int64 value) { + + target_ = value; + // @@protoc_insertion_point(field_set:xla.SourceTarget.target) +} + +// ------------------------------------------------------------------- + +// PrecisionConfig + +// repeated .xla.PrecisionConfig.Precision operand_precision = 1; +inline int PrecisionConfig::operand_precision_size() const { + return operand_precision_.size(); +} +inline void PrecisionConfig::clear_operand_precision() { + operand_precision_.Clear(); +} +inline ::xla::PrecisionConfig_Precision PrecisionConfig::operand_precision(int index) const { + // @@protoc_insertion_point(field_get:xla.PrecisionConfig.operand_precision) + return static_cast< ::xla::PrecisionConfig_Precision >(operand_precision_.Get(index)); +} +inline void PrecisionConfig::set_operand_precision(int index, ::xla::PrecisionConfig_Precision value) { + operand_precision_.Set(index, value); + // @@protoc_insertion_point(field_set:xla.PrecisionConfig.operand_precision) +} +inline void PrecisionConfig::add_operand_precision(::xla::PrecisionConfig_Precision value) { + operand_precision_.Add(value); + // @@protoc_insertion_point(field_add:xla.PrecisionConfig.operand_precision) +} +inline const ::google::protobuf::RepeatedField& +PrecisionConfig::operand_precision() const { + // @@protoc_insertion_point(field_list:xla.PrecisionConfig.operand_precision) + return operand_precision_; +} +inline ::google::protobuf::RepeatedField* +PrecisionConfig::mutable_operand_precision() { + // @@protoc_insertion_point(field_mutable_list:xla.PrecisionConfig.operand_precision) + return &operand_precision_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace xla + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::xla::ChannelHandle_ChannelType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::ChannelHandle_ChannelType>() { + return ::xla::ChannelHandle_ChannelType_descriptor(); +} +template <> struct is_proto_enum< ::xla::OpSharding_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::OpSharding_Type>() { + return ::xla::OpSharding_Type_descriptor(); +} +template <> struct is_proto_enum< ::xla::PrecisionConfig_Precision> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::PrecisionConfig_Precision>() { + return ::xla::PrecisionConfig_Precision_descriptor(); +} +template <> struct is_proto_enum< ::xla::PrimitiveType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::PrimitiveType>() { + return ::xla::PrimitiveType_descriptor(); +} +template <> struct is_proto_enum< ::xla::Format> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::Format>() { + return ::xla::Format_descriptor(); +} +template <> struct is_proto_enum< ::xla::FftType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::FftType>() { + return ::xla::FftType_descriptor(); +} +template <> struct is_proto_enum< ::xla::RandomDistribution> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::xla::RandomDistribution>() { + return ::xla::RandomDistribution_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.proto new file mode 100644 index 0000000..e9c86ab --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data.proto @@ -0,0 +1,595 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +package xla; +option cc_enable_arenas = true; + +// Primitive types are the individual values that can be held in rectangular +// multidimensional arrays. A description of the rectangular multidimensional +// array dimensions / primitive type is given by Shape, below. +enum PrimitiveType { + // Invalid primitive type to serve as default. + PRIMITIVE_TYPE_INVALID = 0; + + // Predicates are two-state booleans. + PRED = 1; + + // Signed integral values of fixed width. + S8 = 2; + S16 = 3; + S32 = 4; + S64 = 5; + + // Unsigned integral values of fixed width. + U8 = 6; + U16 = 7; + U32 = 8; + U64 = 9; + + // Floating-point values of fixed width. + // + // Note: if f16s are not natively supported on the device, they will be + // converted to f16 from f32 at arbirary points in the computation. + F16 = 10; + F32 = 11; + + // Truncated 16 bit floating-point format. This is similar to IEEE's 16 bit + // floating-point format, but uses 1 bit for the sign, 8 bits for the exponent + // and 7 bits for the mantissa. + BF16 = 16; + + F64 = 12; + + // Complex values of fixed width. + C64 = 15; // Paired F32 (real, imag), as in std::complex. + + // A tuple is a polymorphic sequence; e.g. a shape that holds different + // sub-shapes. They are used for things like returning multiple values from a + // computation; e.g. a computation that returns weights and biases may have a + // signature that results in a tuple like (f32[784x2000], f32[2000]) + // + // If a shape proto has the tuple element type, it may not have any entries + // in the dimensions field. + TUPLE = 13; + + // An opaque type used for passing context-specific data to a custom + // operation. Shapes of this primitive type will have empty dimensions and + // tuple_shapes fields. + OPAQUE = 14; + + // A token type threaded between side-effecting operations. Shapes of this + // primitive type will have empty dimensions and tuple_shapes fields. + TOKEN = 17; + + // Next = 18 +} + +// Describes the padding configuration for Pad operation. The padding amount on +// both edges as well as between the elements are specified for each dimension. +message PaddingConfig { + // Describes the padding configuration for a dimension. + message PaddingConfigDimension { + // Padding amount on the low-end (next to the index 0). May be negative. + int64 edge_padding_low = 1; + + // Padding amount on the high-end (next to the highest index). May be + // negative. + int64 edge_padding_high = 2; + + // Padding amount between the elements. May not be negative. + int64 interior_padding = 3; + } + + // The padding configuration for all dimensions. + repeated PaddingConfigDimension dimensions = 1; +} + +// A format specifies the method used by a layout to store an array in memory. +enum Format { + // TODO(b/120869032): Rename this to FORMAT_NONE or something else which + // better corresponds to its meaning. + INVALID_FORMAT = 0; + // The default layout, with exactly one storage location per element. + DENSE = 1; + // A sparsely encoded layout, providing only the index/value pairs of non-zero + // elements. + SPARSE = 2; +} + +// Describes a tile used in tiling-based layout. Refer to +// g3doc/third_party/tensorflow/compiler/xla/g3doc/layout_with_tiling.md for +// details about tiling-based layout. +message TileProto { + // Number of elements in each dimension of the tile. It's ordered from the + // most major dimension of the tile to the most minor dimension of the tile. + // The dimensions correspond to a suffix of the dimensions of the shape being + // tiled. + repeated int64 dimensions = 1; +} + +// A layout describes how the array is placed in (1D) memory space. This +// includes the minor-to-major ordering of dimensions within a shape. +// +// Clients must specify the layouts of input Literals to the +// computation. Layouts specified in interior operations which take Shapes (for +// example, Convert) are ignored. +// +// See the XLA documentation for more information on shapes and layouts. +// +// LINT.IfChange +message LayoutProto { + // The method used to store the data in memory. The format determines which of + // the other fields are used by the layout. + Format format = 4; + + // Sequence of dimension numbers, from minor (fastest varying index) to major + // (slowest varying index). This field is required. + repeated int64 minor_to_major = 1; + + reserved 2; + reserved "padded_dimensions"; + + reserved 3; + reserved "padding_value"; + + // The maximum number of elements that can be stored for SPARSE formats. This + // can be used to determine the maximum size in bytes of arrays stored in + // memory. This field must be unset unless the format is SPARSE. + int64 max_sparse_elements = 5; + + // A sequence of tiles, starting from the tile that's applied first to the + // Shape. + // + // TODO(b/119839262): implement tiling in each backend or add Unimplemented + // error. + repeated TileProto tiles = 6; + + // Bit size of each element. If the size is bigger than what the element + // type requires, the value is stored in the least significant + // bits and the additional most significant bits are filled with 0's. + // + // TODO(b/119839262): implement in each backend or add Unimplemented error. + int64 element_size_in_bits = 7; + + // Important: if any field is added, be sure to modify ShapeUtil::Equal() and + // LayoutUtil::Hash appropriately to account for the new field. +} +// LINT.ThenChange( \ +// https://www.tensorflow.org/code/tensorflow/compiler/xla/shape_util.cc, \ +// https://www.tensorflow.org/code/tensorflow/compiler/xla/layout_util.cc) + +// A shape describes the number of dimensions in the array, the size of each +// dimension, and the primitive component type. +// +// Tuples are a special case in that they have rank zero and have tuple_shapes +// defined. +// +// See the XLA documentation for more information on shapes and layouts. +// +// LINT.IfChange +message ShapeProto { + reserved 1; + reserved "rank"; + + // The element type for this shape. + PrimitiveType element_type = 2; + + // The size (number of elements) for each dimension. + // In XLA, dimensions are numbered from 0 to N-1 for an + // N-dimensional array. The first element of 'dimensions' is the size of + // dimension 0, the second element is the size of dimension 1, and so forth. + // Empty list indicates a scalar. + repeated int64 dimensions = 3; + + // For tuples only, the shapes of constitutent shapes in the tuple sequence. + repeated ShapeProto tuple_shapes = 4; + + // The layout used to back this shape. + LayoutProto layout = 5; + + // Important: if any field is added, be sure to modify ShapeUtil::Equal(), + // ShapeUtil::Compatible() and ShapeUtil::Hash() appropriately to account for + // the new field. +} +// LINT.ThenChange( \ +// https://www.tensorflow.org/code/tensorflow/compiler/xla/shape_util.cc) + +// Shape of the parameters and output of a computation (like a traditional +// function signature). +message ProgramShapeProto { + repeated ShapeProto parameters = 1; + ShapeProto result = 2; + repeated string parameter_names = 3; +} + +// Statistics of a computation. +message ComputationStats { + // The number of floating point operations in the computation. + double flop_count = 1; + + // The number of transcendental operations (e.g., exp) in the computation. + double transcendental_count = 2; +} + +// Symbolization metadata for HLO Instructions. +// +// This metadata is used for debugging XLA code generation, as well as +// performance profiling of XLA-generated executables. +message OpMetadata { + // The framework op name that generated this XLA op. + // + // Frameworks that build on top of XLA should mirror the names of their ops + // back to users by specifying the op_type. In this way, even if the + // framework's "ops" are implemented as multiple XLA HLO Ops, they can be + // grouped appropriately. (e.g. if a SoftMax layer is emitted into XLA as + // multiple ops, then each op should have the op_type be "SoftMax".) + string op_type = 1; + // The user-specified name of the op. + // + // This name is often unique within a computation. Note: some frameworks + // add auto-generated names if the user does not provide one. + string op_name = 2; + // Indicate a file and line that this op is associated to in a user's program. + // + // e.g. it could be the file and line of user code that generated the op. + string source_file = 3; + int32 source_line = 4; +} + +// Profile data from the execution of a computation. +message ExecutionProfile { + // Whether the executable was read from the compilation cache. + bool compilation_cache_hit = 1; + + // The time in milliseconds spent to compile the computation. This only set if + // the executable was not read from the compilation cache + // (compilation_cache_hit == false). + int64 compile_time_ms = 2; + + // The number of cycles spent for the computation. This does not include the + // time taken for the data transfers between the host and the device. This is + // a target-dependent field and only used for debugging purposes. + int64 compute_cycle_count = 3; + + // The time in nanoseconds spent for the computation, without data transfer. + int64 compute_time_ns = 4; + + // The time in nanoseconds spent for the entire computation, including the + // result data transfer time. Current implementation does not spend any cycles + // for the input data transfer since the memory is initialized with the proper + // values before the execution. + int64 compute_and_transfer_time_ns = 5; + + // The size of the binary code in the executable. + int64 executable_size_in_bytes = 6; +} + +// Handle given to a user that represents an execution that the user launched +// asynchronously on the device. +message ExecutionHandle { + int64 handle = 1; +} + +// Handle given to a user that represents a globally accessible allocation. +// Contrast this against a ComputationDataHandle, which is not globally +// accessible, since it only exists within a specific computation. +message GlobalDataHandle { + int64 handle = 1; +} + +// Handle given to a user that represents a replicated virtual device. Each +// replicated device represents N physical devices for execution where N is the +// number of replicas. +message DeviceHandle { + int64 handle = 1; + + // The number of model-parallel virtual devices that communicate via XLA + // Send/Recv instructions. + int64 device_count = 2; +} + +// Handle given to a user to represent a channel between two computations +// via a Send and Recv instruction pair. Channels are unbuffered, so Send +// Send instructions will be blocked until the data is transferred. +message ChannelHandle { + int64 handle = 1; + enum ChannelType { + // Invalid primitive type to serve as default. + CHANNEL_TYPE_INVALID = 0; + + // A channel for sending data between devices. + DEVICE_TO_DEVICE = 1; + + // A channel for sending data from the device to the host. Can only be used + // with a Send operation. + DEVICE_TO_HOST = 2; + + // A channel for sending data from the host to the device. Can only be used + // with a Recv operation. + HOST_TO_DEVICE = 3; + } + ChannelType type = 2; +} + +// DeviceAssignmentProto is a serialized form of DeviceAssignment class, which +// represents the device ids assigned to a set of replicated computations. +// See xla::DeviceAssignment class comment for more details. +message DeviceAssignmentProto { + int32 replica_count = 1; + int32 computation_count = 2; + + // Each logical computation runs on replica_count physical devices. + // ComputationDevice represents the device ids assinged to the replicas. + message ComputationDevice { + repeated int32 replica_device_ids = 1; + } + repeated ComputationDevice computation_devices = 3; +} + +// Literals are used when the server and client need to exchange materialized +// data / results. Literals are also used to describe constants used in +// computations. +// +// Transfers to/from the client are encoded in literal form, and the structure +// of the repeated fields is implied by the shape. +message LiteralProto { + ShapeProto shape = 1; + repeated bool preds = 2; + bytes s8s = 15; + bytes u8s = 3; + repeated int32 s32s = 4; + repeated int64 s64s = 5; + repeated uint32 u32s = 6; + repeated uint64 u64s = 7; + repeated float f32s = 8; + repeated double f64s = 9; + repeated float c64s = 12; // Stored as interleaved real, imag floats. + repeated LiteralProto tuple_literals = 10; + // The F16s, BF16s, U16s and S16s are encoded in little endian byte order + bytes f16s = 11; + bytes bf16s = 13; + bytes u16s = 16; + bytes s16s = 17; + repeated int64 sparse_indices = 14; + // Next = 18 +} + +message WindowDimension { + // The size of the window in this dimension. For a rectangle, this would be + // the width or height. + int64 size = 1; + + // The stride at which the window moves across the base area in this + // dimension. In other words, this is the spacing between different + // positions of the window in this dimension. + int64 stride = 2; + + // If positive, means the amount of padding to add to the base area at the low + // end of this dimension; if negative, its negative means the number of + // elements removed from the low end of this dimension. For example, in the + // horizontal dimension of a rectangle, this would be the number of padding + // values to pad on the left, given that indices increase when going right. + // The actual padding value depends upon the context. Convolution pads with + // zeros. ReduceWindow and SelectAndScatter pads with the reduce function's + // init value. + int64 padding_low = 3; + + // As padding_low, but on the high end of this dimension. For example, in the + // horizontal dimension of a rectangle, this would be the number of values to + // pad on the right, given that indices increase when going right. + int64 padding_high = 4; + + // Dilation factor of the sliding window in this dimension. A dilation factor + // of 1 means no dilation. window_dilation - 1 no-op entries ("holes") are + // implicitly placed between each kernel element. This value may not be less + // than 1. See documentation for convolution. + int64 window_dilation = 5; + + // Dilation factor of the base area in this dimension. A dilation factor of 1 + // means no dilation. base_dilation - 1 no-op entries ("holes") are implicitly + // placed between each base area element. This value may not be less than 1. + // See documentation for convolution. + int64 base_dilation = 6; + + // Window reversal means that this dimension was logically reversed before the + // operation. + bool window_reversal = 7; +} + +// Describes the windowing in an operation such as convolution. +// +// The window is moved across a base area and for each position of the +// window a computation is performed. The field below describes the +// window and the movement of the window across a base area. +message Window { + repeated WindowDimension dimensions = 1; +} + +// Describes the dimension numbers for a gather operation. +// +// See https://www.tensorflow.org/performance/xla/operation_semantics#gather for +// more details. +message GatherDimensionNumbers { + // "Window indices" is a term for a set of indices that index into the + // interior of a dynamic-slice from the input tensor, the starting indices for + // which were computed from output_gather_dims (see the operation semantic for + // how this is defined) and the start_indices tensor. + // + // The window indices for a specific output index Out is computed as: + // + // i = 0 + // for (k : [0, input_tensor_shape.rank)) + // window_indices[k] = + // if k in collapsed_slice_dims + // then 0 + // else Out[offset_dims[i++]] + repeated int64 offset_dims = 1; + repeated int64 collapsed_slice_dims = 2; + + // This is interpreted as a map from i to start_index_map[i]. It + // transforms the gather index looked up from the start_indices tensor into + // the starting index in the input space. + repeated int64 start_index_map = 3; + + // The dimension in the start_indices input that contains the starting + // indices. + int64 index_vector_dim = 4; +} + +// Describes the dimension numbers for a scatter operation. +// +// All the fields are similar to the corresponding fields in +// GatherDimensionNumbers. Differences are noted below. +message ScatterDimensionNumbers { + // The set of dimensions in the updates shape that are window dimensions. + repeated int64 update_window_dims = 1; + // The set of window dimensions that must be inserted into the updates shape. + repeated int64 inserted_window_dims = 2; + + repeated int64 scatter_dims_to_operand_dims = 3; + int64 index_vector_dim = 4; +} + +message ConvolutionDimensionNumbers { + // The number of the dimension that represents batch in the input. + int64 input_batch_dimension = 7; + + // The number of the dimension that represents features in the input. + int64 input_feature_dimension = 8; + + // The dimension numbers for the spatial dimensions that the window + // moves through in the input. + repeated int64 input_spatial_dimensions = 11; + + // The number of the dimension that represents input features in the + // convolutional kernel (rhs). + int64 kernel_input_feature_dimension = 3; + + // The number of the dimension that represents output features in + // the convolutional kernel (rhs). + int64 kernel_output_feature_dimension = 4; + + // The dimension numbers for the spatial dimensions that the window + // moves through in the kernel (rhs). window.strides(0) is the + // stride in the kernel_spatial_dimensions(0) dimension. + repeated int64 kernel_spatial_dimensions = 6; + + // The number of the dimension that represents batch in the output. + int64 output_batch_dimension = 9; + + // The number of the dimension that represents features in the output. + int64 output_feature_dimension = 10; + + // The dimension numbers for the spatial dimensions that the window + // moves through in the output. + repeated int64 output_spatial_dimensions = 12; + + // Next = 13 +}; + +enum FftType { + FFT = 0; // Forward FFT; complex in, complex out. + IFFT = 1; // Inverse FFT; complex in, complex out. + RFFT = 2; // Forward real FFT; real in, fft_length / 2 + 1 complex out + IRFFT = 3; // Inverse real FFT; fft_length / 2 + 1 complex in, + // fft_length real out +} + +message DotDimensionNumbers { + // The dimension numbers that represent the 'lhs' contracting dimensions. + repeated int64 lhs_contracting_dimensions = 1; + // The dimension numbers that represent the 'rhs' contracting dimensions. + repeated int64 rhs_contracting_dimensions = 2; + // The dimension numbers that represent the 'lhs' batch dimensions. + repeated int64 lhs_batch_dimensions = 3; + // The dimension numbers that represent the 'rhs' batch dimensions. + repeated int64 rhs_batch_dimensions = 4; +}; + +enum RandomDistribution { + RNG_INVALID = 0; + + // Creates a uniform-distribution-generated random number on the semi-open + // interval [parameter[0], parameter[1]). + RNG_UNIFORM = 1; + + // Creates a normal-distribution-generated random number with mean + // parameter[0] and standard deviation parameter[1]. + RNG_NORMAL = 2; + + // Next: 4 +} + +message OpSharding { + enum Type { + // This sharding is replicated across all devices (implies maximal, + // all other fields are unused). + REPLICATED = 0; + // This sharding is maximal - one device runs the entire operation. + MAXIMAL = 1; + // This sharding is a tuple - only the tuple_shardings field is valid. + TUPLE = 2; + // None of the above; tile_shape and tile_assignment are both used. + OTHER = 3; + } + Type type = 1; + // The shape of the sharded tile. + ShapeProto tile_shape = 2; + // The shape of the tile assignment tensor - this must be the same rank as + // tile_shape and the product of its dimensions must equal + // tile_assignment_devices.size(). + repeated int64 tile_assignment_dimensions = 3; + // Flattened list of device IDs. The order of flattening is the same as used + // by IndexUtil::MultiToLinearIndex(tile_assignment_shape). + repeated int64 tile_assignment_devices = 4; + // If type == TUPLE, the sub-shardings, one per leaf node in the tuple shape, + // in pre-order. The tuple shape could be nested; here we store just a + // flattened list of all leaves in the tuple shape. Note that the tuple shape + // is not stored here; shardings do not store the shapes to which they are + // applied, this is inferred from the instruction this sharding gets attached + // to. + repeated OpSharding tuple_shardings = 5; +} + +// Describes the replica groups in a cross replica op (e.g., all-reduce and +// all-to-all). +message ReplicaGroup { + // The ids of the replicas that belongs to the same group. The ordering of the + // ids matters in some op (e.g., all-to-all). + repeated int64 replica_ids = 1; +} + +// Describes the source target pair in the collective permute op. +message SourceTarget { + int64 source = 1; + int64 target = 2; +} + +// Used to indicate the precision configuration. It has backend specific +// meaning. +message PrecisionConfig { + enum Precision { + DEFAULT = 0; + HIGH = 1; + HIGHEST = 2; + + // Next: 3 + } + repeated Precision operand_precision = 1; + + // Next: 2 +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data_pb2.py new file mode 100644 index 0000000..8eb07e4 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_data_pb2.py @@ -0,0 +1,1835 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/xla/xla_data.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/xla/xla_data.proto', + package='xla', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n0diplomacy_tensorflow/compiler/xla/xla_data.proto\x12\x03xla\"\xb7\x01\n\rPaddingConfig\x12=\n\ndimensions\x18\x01 \x03(\x0b\x32).xla.PaddingConfig.PaddingConfigDimension\x1ag\n\x16PaddingConfigDimension\x12\x18\n\x10\x65\x64ge_padding_low\x18\x01 \x01(\x03\x12\x19\n\x11\x65\x64ge_padding_high\x18\x02 \x01(\x03\x12\x18\n\x10interior_padding\x18\x03 \x01(\x03\"\x1f\n\tTileProto\x12\x12\n\ndimensions\x18\x01 \x03(\x03\"\xca\x01\n\x0bLayoutProto\x12\x1b\n\x06\x66ormat\x18\x04 \x01(\x0e\x32\x0b.xla.Format\x12\x16\n\x0eminor_to_major\x18\x01 \x03(\x03\x12\x1b\n\x13max_sparse_elements\x18\x05 \x01(\x03\x12\x1d\n\x05tiles\x18\x06 \x03(\x0b\x32\x0e.xla.TileProto\x12\x1c\n\x14\x65lement_size_in_bits\x18\x07 \x01(\x03J\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04R\x11padded_dimensionsR\rpadding_value\"\x9f\x01\n\nShapeProto\x12(\n\x0c\x65lement_type\x18\x02 \x01(\x0e\x32\x12.xla.PrimitiveType\x12\x12\n\ndimensions\x18\x03 \x03(\x03\x12%\n\x0ctuple_shapes\x18\x04 \x03(\x0b\x32\x0f.xla.ShapeProto\x12 \n\x06layout\x18\x05 \x01(\x0b\x32\x10.xla.LayoutProtoJ\x04\x08\x01\x10\x02R\x04rank\"r\n\x11ProgramShapeProto\x12#\n\nparameters\x18\x01 \x03(\x0b\x32\x0f.xla.ShapeProto\x12\x1f\n\x06result\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x17\n\x0fparameter_names\x18\x03 \x03(\t\"D\n\x10\x43omputationStats\x12\x12\n\nflop_count\x18\x01 \x01(\x01\x12\x1c\n\x14transcendental_count\x18\x02 \x01(\x01\"X\n\nOpMetadata\x12\x0f\n\x07op_type\x18\x01 \x01(\t\x12\x0f\n\x07op_name\x18\x02 \x01(\t\x12\x13\n\x0bsource_file\x18\x03 \x01(\t\x12\x13\n\x0bsource_line\x18\x04 \x01(\x05\"\xc8\x01\n\x10\x45xecutionProfile\x12\x1d\n\x15\x63ompilation_cache_hit\x18\x01 \x01(\x08\x12\x17\n\x0f\x63ompile_time_ms\x18\x02 \x01(\x03\x12\x1b\n\x13\x63ompute_cycle_count\x18\x03 \x01(\x03\x12\x17\n\x0f\x63ompute_time_ns\x18\x04 \x01(\x03\x12$\n\x1c\x63ompute_and_transfer_time_ns\x18\x05 \x01(\x03\x12 \n\x18\x65xecutable_size_in_bytes\x18\x06 \x01(\x03\"!\n\x0f\x45xecutionHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"\"\n\x10GlobalDataHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\"4\n\x0c\x44\x65viceHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12\x14\n\x0c\x64\x65vice_count\x18\x02 \x01(\x03\"\xb4\x01\n\rChannelHandle\x12\x0e\n\x06handle\x18\x01 \x01(\x03\x12,\n\x04type\x18\x02 \x01(\x0e\x32\x1e.xla.ChannelHandle.ChannelType\"e\n\x0b\x43hannelType\x12\x18\n\x14\x43HANNEL_TYPE_INVALID\x10\x00\x12\x14\n\x10\x44\x45VICE_TO_DEVICE\x10\x01\x12\x12\n\x0e\x44\x45VICE_TO_HOST\x10\x02\x12\x12\n\x0eHOST_TO_DEVICE\x10\x03\"\xc5\x01\n\x15\x44\x65viceAssignmentProto\x12\x15\n\rreplica_count\x18\x01 \x01(\x05\x12\x19\n\x11\x63omputation_count\x18\x02 \x01(\x05\x12I\n\x13\x63omputation_devices\x18\x03 \x03(\x0b\x32,.xla.DeviceAssignmentProto.ComputationDevice\x1a/\n\x11\x43omputationDevice\x12\x1a\n\x12replica_device_ids\x18\x01 \x03(\x05\"\xb5\x02\n\x0cLiteralProto\x12\x1e\n\x05shape\x18\x01 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\r\n\x05preds\x18\x02 \x03(\x08\x12\x0b\n\x03s8s\x18\x0f \x01(\x0c\x12\x0b\n\x03u8s\x18\x03 \x01(\x0c\x12\x0c\n\x04s32s\x18\x04 \x03(\x05\x12\x0c\n\x04s64s\x18\x05 \x03(\x03\x12\x0c\n\x04u32s\x18\x06 \x03(\r\x12\x0c\n\x04u64s\x18\x07 \x03(\x04\x12\x0c\n\x04\x66\x33\x32s\x18\x08 \x03(\x02\x12\x0c\n\x04\x66\x36\x34s\x18\t \x03(\x01\x12\x0c\n\x04\x63\x36\x34s\x18\x0c \x03(\x02\x12)\n\x0etuple_literals\x18\n \x03(\x0b\x32\x11.xla.LiteralProto\x12\x0c\n\x04\x66\x31\x36s\x18\x0b \x01(\x0c\x12\r\n\x05\x62\x66\x31\x36s\x18\r \x01(\x0c\x12\x0c\n\x04u16s\x18\x10 \x01(\x0c\x12\x0c\n\x04s16s\x18\x11 \x01(\x0c\x12\x16\n\x0esparse_indices\x18\x0e \x03(\x03\"\xa3\x01\n\x0fWindowDimension\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0e\n\x06stride\x18\x02 \x01(\x03\x12\x13\n\x0bpadding_low\x18\x03 \x01(\x03\x12\x14\n\x0cpadding_high\x18\x04 \x01(\x03\x12\x17\n\x0fwindow_dilation\x18\x05 \x01(\x03\x12\x15\n\rbase_dilation\x18\x06 \x01(\x03\x12\x17\n\x0fwindow_reversal\x18\x07 \x01(\x08\"2\n\x06Window\x12(\n\ndimensions\x18\x01 \x03(\x0b\x32\x14.xla.WindowDimension\"~\n\x16GatherDimensionNumbers\x12\x13\n\x0boffset_dims\x18\x01 \x03(\x03\x12\x1c\n\x14\x63ollapsed_slice_dims\x18\x02 \x03(\x03\x12\x17\n\x0fstart_index_map\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\"\x93\x01\n\x17ScatterDimensionNumbers\x12\x1a\n\x12update_window_dims\x18\x01 \x03(\x03\x12\x1c\n\x14inserted_window_dims\x18\x02 \x03(\x03\x12$\n\x1cscatter_dims_to_operand_dims\x18\x03 \x03(\x03\x12\x18\n\x10index_vector_dim\x18\x04 \x01(\x03\"\xd8\x02\n\x1b\x43onvolutionDimensionNumbers\x12\x1d\n\x15input_batch_dimension\x18\x07 \x01(\x03\x12\x1f\n\x17input_feature_dimension\x18\x08 \x01(\x03\x12 \n\x18input_spatial_dimensions\x18\x0b \x03(\x03\x12&\n\x1ekernel_input_feature_dimension\x18\x03 \x01(\x03\x12\'\n\x1fkernel_output_feature_dimension\x18\x04 \x01(\x03\x12!\n\x19kernel_spatial_dimensions\x18\x06 \x03(\x03\x12\x1e\n\x16output_batch_dimension\x18\t \x01(\x03\x12 \n\x18output_feature_dimension\x18\n \x01(\x03\x12!\n\x19output_spatial_dimensions\x18\x0c \x03(\x03\"\x99\x01\n\x13\x44otDimensionNumbers\x12\"\n\x1alhs_contracting_dimensions\x18\x01 \x03(\x03\x12\"\n\x1arhs_contracting_dimensions\x18\x02 \x03(\x03\x12\x1c\n\x14lhs_batch_dimensions\x18\x03 \x03(\x03\x12\x1c\n\x14rhs_batch_dimensions\x18\x04 \x03(\x03\"\xff\x01\n\nOpSharding\x12\"\n\x04type\x18\x01 \x01(\x0e\x32\x14.xla.OpSharding.Type\x12#\n\ntile_shape\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\"\n\x1atile_assignment_dimensions\x18\x03 \x03(\x03\x12\x1f\n\x17tile_assignment_devices\x18\x04 \x03(\x03\x12(\n\x0ftuple_shardings\x18\x05 \x03(\x0b\x32\x0f.xla.OpSharding\"9\n\x04Type\x12\x0e\n\nREPLICATED\x10\x00\x12\x0b\n\x07MAXIMAL\x10\x01\x12\t\n\x05TUPLE\x10\x02\x12\t\n\x05OTHER\x10\x03\"#\n\x0cReplicaGroup\x12\x13\n\x0breplica_ids\x18\x01 \x03(\x03\".\n\x0cSourceTarget\x12\x0e\n\x06source\x18\x01 \x01(\x03\x12\x0e\n\x06target\x18\x02 \x01(\x03\"}\n\x0fPrecisionConfig\x12\x39\n\x11operand_precision\x18\x01 \x03(\x0e\x32\x1e.xla.PrecisionConfig.Precision\"/\n\tPrecision\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x08\n\x04HIGH\x10\x01\x12\x0b\n\x07HIGHEST\x10\x02*\xcb\x01\n\rPrimitiveType\x12\x1a\n\x16PRIMITIVE_TYPE_INVALID\x10\x00\x12\x08\n\x04PRED\x10\x01\x12\x06\n\x02S8\x10\x02\x12\x07\n\x03S16\x10\x03\x12\x07\n\x03S32\x10\x04\x12\x07\n\x03S64\x10\x05\x12\x06\n\x02U8\x10\x06\x12\x07\n\x03U16\x10\x07\x12\x07\n\x03U32\x10\x08\x12\x07\n\x03U64\x10\t\x12\x07\n\x03\x46\x31\x36\x10\n\x12\x07\n\x03\x46\x33\x32\x10\x0b\x12\x08\n\x04\x42\x46\x31\x36\x10\x10\x12\x07\n\x03\x46\x36\x34\x10\x0c\x12\x07\n\x03\x43\x36\x34\x10\x0f\x12\t\n\x05TUPLE\x10\r\x12\n\n\x06OPAQUE\x10\x0e\x12\t\n\x05TOKEN\x10\x11*3\n\x06\x46ormat\x12\x12\n\x0eINVALID_FORMAT\x10\x00\x12\t\n\x05\x44\x45NSE\x10\x01\x12\n\n\x06SPARSE\x10\x02*1\n\x07\x46\x66tType\x12\x07\n\x03\x46\x46T\x10\x00\x12\x08\n\x04IFFT\x10\x01\x12\x08\n\x04RFFT\x10\x02\x12\t\n\x05IRFFT\x10\x03*F\n\x12RandomDistribution\x12\x0f\n\x0bRNG_INVALID\x10\x00\x12\x0f\n\x0bRNG_UNIFORM\x10\x01\x12\x0e\n\nRNG_NORMAL\x10\x02\x42\x03\xf8\x01\x01\x62\x06proto3') +) + +_PRIMITIVETYPE = _descriptor.EnumDescriptor( + name='PrimitiveType', + full_name='xla.PrimitiveType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='PRIMITIVE_TYPE_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PRED', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='S8', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='S16', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='S32', index=4, number=4, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='S64', index=5, number=5, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='U8', index=6, number=6, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='U16', index=7, number=7, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='U32', index=8, number=8, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='U64', index=9, number=9, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='F16', index=10, number=10, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='F32', index=11, number=11, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BF16', index=12, number=16, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='F64', index=13, number=12, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='C64', index=14, number=15, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TUPLE', index=15, number=13, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OPAQUE', index=16, number=14, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TOKEN', index=17, number=17, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3412, + serialized_end=3615, +) +_sym_db.RegisterEnumDescriptor(_PRIMITIVETYPE) + +PrimitiveType = enum_type_wrapper.EnumTypeWrapper(_PRIMITIVETYPE) +_FORMAT = _descriptor.EnumDescriptor( + name='Format', + full_name='xla.Format', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='INVALID_FORMAT', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DENSE', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SPARSE', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3617, + serialized_end=3668, +) +_sym_db.RegisterEnumDescriptor(_FORMAT) + +Format = enum_type_wrapper.EnumTypeWrapper(_FORMAT) +_FFTTYPE = _descriptor.EnumDescriptor( + name='FftType', + full_name='xla.FftType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='FFT', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='IFFT', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RFFT', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='IRFFT', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3670, + serialized_end=3719, +) +_sym_db.RegisterEnumDescriptor(_FFTTYPE) + +FftType = enum_type_wrapper.EnumTypeWrapper(_FFTTYPE) +_RANDOMDISTRIBUTION = _descriptor.EnumDescriptor( + name='RandomDistribution', + full_name='xla.RandomDistribution', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='RNG_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RNG_UNIFORM', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RNG_NORMAL', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3721, + serialized_end=3791, +) +_sym_db.RegisterEnumDescriptor(_RANDOMDISTRIBUTION) + +RandomDistribution = enum_type_wrapper.EnumTypeWrapper(_RANDOMDISTRIBUTION) +PRIMITIVE_TYPE_INVALID = 0 +PRED = 1 +S8 = 2 +S16 = 3 +S32 = 4 +S64 = 5 +U8 = 6 +U16 = 7 +U32 = 8 +U64 = 9 +F16 = 10 +F32 = 11 +BF16 = 16 +F64 = 12 +C64 = 15 +TUPLE = 13 +OPAQUE = 14 +TOKEN = 17 +INVALID_FORMAT = 0 +DENSE = 1 +SPARSE = 2 +FFT = 0 +IFFT = 1 +RFFT = 2 +IRFFT = 3 +RNG_INVALID = 0 +RNG_UNIFORM = 1 +RNG_NORMAL = 2 + + +_CHANNELHANDLE_CHANNELTYPE = _descriptor.EnumDescriptor( + name='ChannelType', + full_name='xla.ChannelHandle.ChannelType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='CHANNEL_TYPE_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DEVICE_TO_DEVICE', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DEVICE_TO_HOST', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='HOST_TO_DEVICE', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1327, + serialized_end=1428, +) +_sym_db.RegisterEnumDescriptor(_CHANNELHANDLE_CHANNELTYPE) + +_OPSHARDING_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='xla.OpSharding.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='REPLICATED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MAXIMAL', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TUPLE', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OTHER', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3140, + serialized_end=3197, +) +_sym_db.RegisterEnumDescriptor(_OPSHARDING_TYPE) + +_PRECISIONCONFIG_PRECISION = _descriptor.EnumDescriptor( + name='Precision', + full_name='xla.PrecisionConfig.Precision', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DEFAULT', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='HIGH', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='HIGHEST', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3362, + serialized_end=3409, +) +_sym_db.RegisterEnumDescriptor(_PRECISIONCONFIG_PRECISION) + + +_PADDINGCONFIG_PADDINGCONFIGDIMENSION = _descriptor.Descriptor( + name='PaddingConfigDimension', + full_name='xla.PaddingConfig.PaddingConfigDimension', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='edge_padding_low', full_name='xla.PaddingConfig.PaddingConfigDimension.edge_padding_low', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='edge_padding_high', full_name='xla.PaddingConfig.PaddingConfigDimension.edge_padding_high', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='interior_padding', full_name='xla.PaddingConfig.PaddingConfigDimension.interior_padding', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=138, + serialized_end=241, +) + +_PADDINGCONFIG = _descriptor.Descriptor( + name='PaddingConfig', + full_name='xla.PaddingConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dimensions', full_name='xla.PaddingConfig.dimensions', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_PADDINGCONFIG_PADDINGCONFIGDIMENSION, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=58, + serialized_end=241, +) + + +_TILEPROTO = _descriptor.Descriptor( + name='TileProto', + full_name='xla.TileProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dimensions', full_name='xla.TileProto.dimensions', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=243, + serialized_end=274, +) + + +_LAYOUTPROTO = _descriptor.Descriptor( + name='LayoutProto', + full_name='xla.LayoutProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='format', full_name='xla.LayoutProto.format', index=0, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='minor_to_major', full_name='xla.LayoutProto.minor_to_major', index=1, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_sparse_elements', full_name='xla.LayoutProto.max_sparse_elements', index=2, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tiles', full_name='xla.LayoutProto.tiles', index=3, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='element_size_in_bits', full_name='xla.LayoutProto.element_size_in_bits', index=4, + number=7, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=277, + serialized_end=479, +) + + +_SHAPEPROTO = _descriptor.Descriptor( + name='ShapeProto', + full_name='xla.ShapeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='element_type', full_name='xla.ShapeProto.element_type', index=0, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dimensions', full_name='xla.ShapeProto.dimensions', index=1, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tuple_shapes', full_name='xla.ShapeProto.tuple_shapes', index=2, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='layout', full_name='xla.ShapeProto.layout', index=3, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=482, + serialized_end=641, +) + + +_PROGRAMSHAPEPROTO = _descriptor.Descriptor( + name='ProgramShapeProto', + full_name='xla.ProgramShapeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parameters', full_name='xla.ProgramShapeProto.parameters', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='result', full_name='xla.ProgramShapeProto.result', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='parameter_names', full_name='xla.ProgramShapeProto.parameter_names', index=2, + number=3, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=643, + serialized_end=757, +) + + +_COMPUTATIONSTATS = _descriptor.Descriptor( + name='ComputationStats', + full_name='xla.ComputationStats', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='flop_count', full_name='xla.ComputationStats.flop_count', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='transcendental_count', full_name='xla.ComputationStats.transcendental_count', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=759, + serialized_end=827, +) + + +_OPMETADATA = _descriptor.Descriptor( + name='OpMetadata', + full_name='xla.OpMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op_type', full_name='xla.OpMetadata.op_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='op_name', full_name='xla.OpMetadata.op_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='source_file', full_name='xla.OpMetadata.source_file', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='source_line', full_name='xla.OpMetadata.source_line', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=829, + serialized_end=917, +) + + +_EXECUTIONPROFILE = _descriptor.Descriptor( + name='ExecutionProfile', + full_name='xla.ExecutionProfile', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='compilation_cache_hit', full_name='xla.ExecutionProfile.compilation_cache_hit', index=0, + number=1, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compile_time_ms', full_name='xla.ExecutionProfile.compile_time_ms', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_cycle_count', full_name='xla.ExecutionProfile.compute_cycle_count', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_time_ns', full_name='xla.ExecutionProfile.compute_time_ns', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_and_transfer_time_ns', full_name='xla.ExecutionProfile.compute_and_transfer_time_ns', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='executable_size_in_bytes', full_name='xla.ExecutionProfile.executable_size_in_bytes', index=5, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=920, + serialized_end=1120, +) + + +_EXECUTIONHANDLE = _descriptor.Descriptor( + name='ExecutionHandle', + full_name='xla.ExecutionHandle', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='handle', full_name='xla.ExecutionHandle.handle', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1122, + serialized_end=1155, +) + + +_GLOBALDATAHANDLE = _descriptor.Descriptor( + name='GlobalDataHandle', + full_name='xla.GlobalDataHandle', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='handle', full_name='xla.GlobalDataHandle.handle', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1157, + serialized_end=1191, +) + + +_DEVICEHANDLE = _descriptor.Descriptor( + name='DeviceHandle', + full_name='xla.DeviceHandle', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='handle', full_name='xla.DeviceHandle.handle', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_count', full_name='xla.DeviceHandle.device_count', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1193, + serialized_end=1245, +) + + +_CHANNELHANDLE = _descriptor.Descriptor( + name='ChannelHandle', + full_name='xla.ChannelHandle', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='handle', full_name='xla.ChannelHandle.handle', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='xla.ChannelHandle.type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CHANNELHANDLE_CHANNELTYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1248, + serialized_end=1428, +) + + +_DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE = _descriptor.Descriptor( + name='ComputationDevice', + full_name='xla.DeviceAssignmentProto.ComputationDevice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='replica_device_ids', full_name='xla.DeviceAssignmentProto.ComputationDevice.replica_device_ids', index=0, + number=1, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1581, + serialized_end=1628, +) + +_DEVICEASSIGNMENTPROTO = _descriptor.Descriptor( + name='DeviceAssignmentProto', + full_name='xla.DeviceAssignmentProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='replica_count', full_name='xla.DeviceAssignmentProto.replica_count', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='computation_count', full_name='xla.DeviceAssignmentProto.computation_count', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='computation_devices', full_name='xla.DeviceAssignmentProto.computation_devices', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1431, + serialized_end=1628, +) + + +_LITERALPROTO = _descriptor.Descriptor( + name='LiteralProto', + full_name='xla.LiteralProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='shape', full_name='xla.LiteralProto.shape', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='preds', full_name='xla.LiteralProto.preds', index=1, + number=2, type=8, cpp_type=7, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='s8s', full_name='xla.LiteralProto.s8s', index=2, + number=15, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='u8s', full_name='xla.LiteralProto.u8s', index=3, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='s32s', full_name='xla.LiteralProto.s32s', index=4, + number=4, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='s64s', full_name='xla.LiteralProto.s64s', index=5, + number=5, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='u32s', full_name='xla.LiteralProto.u32s', index=6, + number=6, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='u64s', full_name='xla.LiteralProto.u64s', index=7, + number=7, type=4, cpp_type=4, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='f32s', full_name='xla.LiteralProto.f32s', index=8, + number=8, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='f64s', full_name='xla.LiteralProto.f64s', index=9, + number=9, type=1, cpp_type=5, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='c64s', full_name='xla.LiteralProto.c64s', index=10, + number=12, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tuple_literals', full_name='xla.LiteralProto.tuple_literals', index=11, + number=10, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='f16s', full_name='xla.LiteralProto.f16s', index=12, + number=11, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bf16s', full_name='xla.LiteralProto.bf16s', index=13, + number=13, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='u16s', full_name='xla.LiteralProto.u16s', index=14, + number=16, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='s16s', full_name='xla.LiteralProto.s16s', index=15, + number=17, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sparse_indices', full_name='xla.LiteralProto.sparse_indices', index=16, + number=14, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1631, + serialized_end=1940, +) + + +_WINDOWDIMENSION = _descriptor.Descriptor( + name='WindowDimension', + full_name='xla.WindowDimension', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='size', full_name='xla.WindowDimension.size', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='stride', full_name='xla.WindowDimension.stride', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='padding_low', full_name='xla.WindowDimension.padding_low', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='padding_high', full_name='xla.WindowDimension.padding_high', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='window_dilation', full_name='xla.WindowDimension.window_dilation', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='base_dilation', full_name='xla.WindowDimension.base_dilation', index=5, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='window_reversal', full_name='xla.WindowDimension.window_reversal', index=6, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1943, + serialized_end=2106, +) + + +_WINDOW = _descriptor.Descriptor( + name='Window', + full_name='xla.Window', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dimensions', full_name='xla.Window.dimensions', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2108, + serialized_end=2158, +) + + +_GATHERDIMENSIONNUMBERS = _descriptor.Descriptor( + name='GatherDimensionNumbers', + full_name='xla.GatherDimensionNumbers', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='offset_dims', full_name='xla.GatherDimensionNumbers.offset_dims', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='collapsed_slice_dims', full_name='xla.GatherDimensionNumbers.collapsed_slice_dims', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='start_index_map', full_name='xla.GatherDimensionNumbers.start_index_map', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='index_vector_dim', full_name='xla.GatherDimensionNumbers.index_vector_dim', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2160, + serialized_end=2286, +) + + +_SCATTERDIMENSIONNUMBERS = _descriptor.Descriptor( + name='ScatterDimensionNumbers', + full_name='xla.ScatterDimensionNumbers', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='update_window_dims', full_name='xla.ScatterDimensionNumbers.update_window_dims', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inserted_window_dims', full_name='xla.ScatterDimensionNumbers.inserted_window_dims', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='scatter_dims_to_operand_dims', full_name='xla.ScatterDimensionNumbers.scatter_dims_to_operand_dims', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='index_vector_dim', full_name='xla.ScatterDimensionNumbers.index_vector_dim', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2289, + serialized_end=2436, +) + + +_CONVOLUTIONDIMENSIONNUMBERS = _descriptor.Descriptor( + name='ConvolutionDimensionNumbers', + full_name='xla.ConvolutionDimensionNumbers', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input_batch_dimension', full_name='xla.ConvolutionDimensionNumbers.input_batch_dimension', index=0, + number=7, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input_feature_dimension', full_name='xla.ConvolutionDimensionNumbers.input_feature_dimension', index=1, + number=8, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input_spatial_dimensions', full_name='xla.ConvolutionDimensionNumbers.input_spatial_dimensions', index=2, + number=11, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='kernel_input_feature_dimension', full_name='xla.ConvolutionDimensionNumbers.kernel_input_feature_dimension', index=3, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='kernel_output_feature_dimension', full_name='xla.ConvolutionDimensionNumbers.kernel_output_feature_dimension', index=4, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='kernel_spatial_dimensions', full_name='xla.ConvolutionDimensionNumbers.kernel_spatial_dimensions', index=5, + number=6, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_batch_dimension', full_name='xla.ConvolutionDimensionNumbers.output_batch_dimension', index=6, + number=9, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_feature_dimension', full_name='xla.ConvolutionDimensionNumbers.output_feature_dimension', index=7, + number=10, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_spatial_dimensions', full_name='xla.ConvolutionDimensionNumbers.output_spatial_dimensions', index=8, + number=12, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2439, + serialized_end=2783, +) + + +_DOTDIMENSIONNUMBERS = _descriptor.Descriptor( + name='DotDimensionNumbers', + full_name='xla.DotDimensionNumbers', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='lhs_contracting_dimensions', full_name='xla.DotDimensionNumbers.lhs_contracting_dimensions', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rhs_contracting_dimensions', full_name='xla.DotDimensionNumbers.rhs_contracting_dimensions', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='lhs_batch_dimensions', full_name='xla.DotDimensionNumbers.lhs_batch_dimensions', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rhs_batch_dimensions', full_name='xla.DotDimensionNumbers.rhs_batch_dimensions', index=3, + number=4, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2786, + serialized_end=2939, +) + + +_OPSHARDING = _descriptor.Descriptor( + name='OpSharding', + full_name='xla.OpSharding', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='xla.OpSharding.type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tile_shape', full_name='xla.OpSharding.tile_shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tile_assignment_dimensions', full_name='xla.OpSharding.tile_assignment_dimensions', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tile_assignment_devices', full_name='xla.OpSharding.tile_assignment_devices', index=3, + number=4, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tuple_shardings', full_name='xla.OpSharding.tuple_shardings', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _OPSHARDING_TYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2942, + serialized_end=3197, +) + + +_REPLICAGROUP = _descriptor.Descriptor( + name='ReplicaGroup', + full_name='xla.ReplicaGroup', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='replica_ids', full_name='xla.ReplicaGroup.replica_ids', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3199, + serialized_end=3234, +) + + +_SOURCETARGET = _descriptor.Descriptor( + name='SourceTarget', + full_name='xla.SourceTarget', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='source', full_name='xla.SourceTarget.source', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='target', full_name='xla.SourceTarget.target', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3236, + serialized_end=3282, +) + + +_PRECISIONCONFIG = _descriptor.Descriptor( + name='PrecisionConfig', + full_name='xla.PrecisionConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='operand_precision', full_name='xla.PrecisionConfig.operand_precision', index=0, + number=1, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _PRECISIONCONFIG_PRECISION, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3284, + serialized_end=3409, +) + +_PADDINGCONFIG_PADDINGCONFIGDIMENSION.containing_type = _PADDINGCONFIG +_PADDINGCONFIG.fields_by_name['dimensions'].message_type = _PADDINGCONFIG_PADDINGCONFIGDIMENSION +_LAYOUTPROTO.fields_by_name['format'].enum_type = _FORMAT +_LAYOUTPROTO.fields_by_name['tiles'].message_type = _TILEPROTO +_SHAPEPROTO.fields_by_name['element_type'].enum_type = _PRIMITIVETYPE +_SHAPEPROTO.fields_by_name['tuple_shapes'].message_type = _SHAPEPROTO +_SHAPEPROTO.fields_by_name['layout'].message_type = _LAYOUTPROTO +_PROGRAMSHAPEPROTO.fields_by_name['parameters'].message_type = _SHAPEPROTO +_PROGRAMSHAPEPROTO.fields_by_name['result'].message_type = _SHAPEPROTO +_CHANNELHANDLE.fields_by_name['type'].enum_type = _CHANNELHANDLE_CHANNELTYPE +_CHANNELHANDLE_CHANNELTYPE.containing_type = _CHANNELHANDLE +_DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE.containing_type = _DEVICEASSIGNMENTPROTO +_DEVICEASSIGNMENTPROTO.fields_by_name['computation_devices'].message_type = _DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE +_LITERALPROTO.fields_by_name['shape'].message_type = _SHAPEPROTO +_LITERALPROTO.fields_by_name['tuple_literals'].message_type = _LITERALPROTO +_WINDOW.fields_by_name['dimensions'].message_type = _WINDOWDIMENSION +_OPSHARDING.fields_by_name['type'].enum_type = _OPSHARDING_TYPE +_OPSHARDING.fields_by_name['tile_shape'].message_type = _SHAPEPROTO +_OPSHARDING.fields_by_name['tuple_shardings'].message_type = _OPSHARDING +_OPSHARDING_TYPE.containing_type = _OPSHARDING +_PRECISIONCONFIG.fields_by_name['operand_precision'].enum_type = _PRECISIONCONFIG_PRECISION +_PRECISIONCONFIG_PRECISION.containing_type = _PRECISIONCONFIG +DESCRIPTOR.message_types_by_name['PaddingConfig'] = _PADDINGCONFIG +DESCRIPTOR.message_types_by_name['TileProto'] = _TILEPROTO +DESCRIPTOR.message_types_by_name['LayoutProto'] = _LAYOUTPROTO +DESCRIPTOR.message_types_by_name['ShapeProto'] = _SHAPEPROTO +DESCRIPTOR.message_types_by_name['ProgramShapeProto'] = _PROGRAMSHAPEPROTO +DESCRIPTOR.message_types_by_name['ComputationStats'] = _COMPUTATIONSTATS +DESCRIPTOR.message_types_by_name['OpMetadata'] = _OPMETADATA +DESCRIPTOR.message_types_by_name['ExecutionProfile'] = _EXECUTIONPROFILE +DESCRIPTOR.message_types_by_name['ExecutionHandle'] = _EXECUTIONHANDLE +DESCRIPTOR.message_types_by_name['GlobalDataHandle'] = _GLOBALDATAHANDLE +DESCRIPTOR.message_types_by_name['DeviceHandle'] = _DEVICEHANDLE +DESCRIPTOR.message_types_by_name['ChannelHandle'] = _CHANNELHANDLE +DESCRIPTOR.message_types_by_name['DeviceAssignmentProto'] = _DEVICEASSIGNMENTPROTO +DESCRIPTOR.message_types_by_name['LiteralProto'] = _LITERALPROTO +DESCRIPTOR.message_types_by_name['WindowDimension'] = _WINDOWDIMENSION +DESCRIPTOR.message_types_by_name['Window'] = _WINDOW +DESCRIPTOR.message_types_by_name['GatherDimensionNumbers'] = _GATHERDIMENSIONNUMBERS +DESCRIPTOR.message_types_by_name['ScatterDimensionNumbers'] = _SCATTERDIMENSIONNUMBERS +DESCRIPTOR.message_types_by_name['ConvolutionDimensionNumbers'] = _CONVOLUTIONDIMENSIONNUMBERS +DESCRIPTOR.message_types_by_name['DotDimensionNumbers'] = _DOTDIMENSIONNUMBERS +DESCRIPTOR.message_types_by_name['OpSharding'] = _OPSHARDING +DESCRIPTOR.message_types_by_name['ReplicaGroup'] = _REPLICAGROUP +DESCRIPTOR.message_types_by_name['SourceTarget'] = _SOURCETARGET +DESCRIPTOR.message_types_by_name['PrecisionConfig'] = _PRECISIONCONFIG +DESCRIPTOR.enum_types_by_name['PrimitiveType'] = _PRIMITIVETYPE +DESCRIPTOR.enum_types_by_name['Format'] = _FORMAT +DESCRIPTOR.enum_types_by_name['FftType'] = _FFTTYPE +DESCRIPTOR.enum_types_by_name['RandomDistribution'] = _RANDOMDISTRIBUTION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +PaddingConfig = _reflection.GeneratedProtocolMessageType('PaddingConfig', (_message.Message,), dict( + + PaddingConfigDimension = _reflection.GeneratedProtocolMessageType('PaddingConfigDimension', (_message.Message,), dict( + DESCRIPTOR = _PADDINGCONFIG_PADDINGCONFIGDIMENSION, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.PaddingConfig.PaddingConfigDimension) + )) + , + DESCRIPTOR = _PADDINGCONFIG, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.PaddingConfig) + )) +_sym_db.RegisterMessage(PaddingConfig) +_sym_db.RegisterMessage(PaddingConfig.PaddingConfigDimension) + +TileProto = _reflection.GeneratedProtocolMessageType('TileProto', (_message.Message,), dict( + DESCRIPTOR = _TILEPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.TileProto) + )) +_sym_db.RegisterMessage(TileProto) + +LayoutProto = _reflection.GeneratedProtocolMessageType('LayoutProto', (_message.Message,), dict( + DESCRIPTOR = _LAYOUTPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.LayoutProto) + )) +_sym_db.RegisterMessage(LayoutProto) + +ShapeProto = _reflection.GeneratedProtocolMessageType('ShapeProto', (_message.Message,), dict( + DESCRIPTOR = _SHAPEPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ShapeProto) + )) +_sym_db.RegisterMessage(ShapeProto) + +ProgramShapeProto = _reflection.GeneratedProtocolMessageType('ProgramShapeProto', (_message.Message,), dict( + DESCRIPTOR = _PROGRAMSHAPEPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ProgramShapeProto) + )) +_sym_db.RegisterMessage(ProgramShapeProto) + +ComputationStats = _reflection.GeneratedProtocolMessageType('ComputationStats', (_message.Message,), dict( + DESCRIPTOR = _COMPUTATIONSTATS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ComputationStats) + )) +_sym_db.RegisterMessage(ComputationStats) + +OpMetadata = _reflection.GeneratedProtocolMessageType('OpMetadata', (_message.Message,), dict( + DESCRIPTOR = _OPMETADATA, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.OpMetadata) + )) +_sym_db.RegisterMessage(OpMetadata) + +ExecutionProfile = _reflection.GeneratedProtocolMessageType('ExecutionProfile', (_message.Message,), dict( + DESCRIPTOR = _EXECUTIONPROFILE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecutionProfile) + )) +_sym_db.RegisterMessage(ExecutionProfile) + +ExecutionHandle = _reflection.GeneratedProtocolMessageType('ExecutionHandle', (_message.Message,), dict( + DESCRIPTOR = _EXECUTIONHANDLE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecutionHandle) + )) +_sym_db.RegisterMessage(ExecutionHandle) + +GlobalDataHandle = _reflection.GeneratedProtocolMessageType('GlobalDataHandle', (_message.Message,), dict( + DESCRIPTOR = _GLOBALDATAHANDLE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.GlobalDataHandle) + )) +_sym_db.RegisterMessage(GlobalDataHandle) + +DeviceHandle = _reflection.GeneratedProtocolMessageType('DeviceHandle', (_message.Message,), dict( + DESCRIPTOR = _DEVICEHANDLE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.DeviceHandle) + )) +_sym_db.RegisterMessage(DeviceHandle) + +ChannelHandle = _reflection.GeneratedProtocolMessageType('ChannelHandle', (_message.Message,), dict( + DESCRIPTOR = _CHANNELHANDLE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ChannelHandle) + )) +_sym_db.RegisterMessage(ChannelHandle) + +DeviceAssignmentProto = _reflection.GeneratedProtocolMessageType('DeviceAssignmentProto', (_message.Message,), dict( + + ComputationDevice = _reflection.GeneratedProtocolMessageType('ComputationDevice', (_message.Message,), dict( + DESCRIPTOR = _DEVICEASSIGNMENTPROTO_COMPUTATIONDEVICE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.DeviceAssignmentProto.ComputationDevice) + )) + , + DESCRIPTOR = _DEVICEASSIGNMENTPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.DeviceAssignmentProto) + )) +_sym_db.RegisterMessage(DeviceAssignmentProto) +_sym_db.RegisterMessage(DeviceAssignmentProto.ComputationDevice) + +LiteralProto = _reflection.GeneratedProtocolMessageType('LiteralProto', (_message.Message,), dict( + DESCRIPTOR = _LITERALPROTO, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.LiteralProto) + )) +_sym_db.RegisterMessage(LiteralProto) + +WindowDimension = _reflection.GeneratedProtocolMessageType('WindowDimension', (_message.Message,), dict( + DESCRIPTOR = _WINDOWDIMENSION, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.WindowDimension) + )) +_sym_db.RegisterMessage(WindowDimension) + +Window = _reflection.GeneratedProtocolMessageType('Window', (_message.Message,), dict( + DESCRIPTOR = _WINDOW, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.Window) + )) +_sym_db.RegisterMessage(Window) + +GatherDimensionNumbers = _reflection.GeneratedProtocolMessageType('GatherDimensionNumbers', (_message.Message,), dict( + DESCRIPTOR = _GATHERDIMENSIONNUMBERS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.GatherDimensionNumbers) + )) +_sym_db.RegisterMessage(GatherDimensionNumbers) + +ScatterDimensionNumbers = _reflection.GeneratedProtocolMessageType('ScatterDimensionNumbers', (_message.Message,), dict( + DESCRIPTOR = _SCATTERDIMENSIONNUMBERS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ScatterDimensionNumbers) + )) +_sym_db.RegisterMessage(ScatterDimensionNumbers) + +ConvolutionDimensionNumbers = _reflection.GeneratedProtocolMessageType('ConvolutionDimensionNumbers', (_message.Message,), dict( + DESCRIPTOR = _CONVOLUTIONDIMENSIONNUMBERS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ConvolutionDimensionNumbers) + )) +_sym_db.RegisterMessage(ConvolutionDimensionNumbers) + +DotDimensionNumbers = _reflection.GeneratedProtocolMessageType('DotDimensionNumbers', (_message.Message,), dict( + DESCRIPTOR = _DOTDIMENSIONNUMBERS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.DotDimensionNumbers) + )) +_sym_db.RegisterMessage(DotDimensionNumbers) + +OpSharding = _reflection.GeneratedProtocolMessageType('OpSharding', (_message.Message,), dict( + DESCRIPTOR = _OPSHARDING, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.OpSharding) + )) +_sym_db.RegisterMessage(OpSharding) + +ReplicaGroup = _reflection.GeneratedProtocolMessageType('ReplicaGroup', (_message.Message,), dict( + DESCRIPTOR = _REPLICAGROUP, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.ReplicaGroup) + )) +_sym_db.RegisterMessage(ReplicaGroup) + +SourceTarget = _reflection.GeneratedProtocolMessageType('SourceTarget', (_message.Message,), dict( + DESCRIPTOR = _SOURCETARGET, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.SourceTarget) + )) +_sym_db.RegisterMessage(SourceTarget) + +PrecisionConfig = _reflection.GeneratedProtocolMessageType('PrecisionConfig', (_message.Message,), dict( + DESCRIPTOR = _PRECISIONCONFIG, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_data_pb2' + # @@protoc_insertion_point(class_scope:xla.PrecisionConfig) + )) +_sym_db.RegisterMessage(PrecisionConfig) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_pb2.py new file mode 100644 index 0000000..980d2ad --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xla/xla_pb2.py @@ -0,0 +1,2212 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/xla/xla.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.compiler.xla import xla_data_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2 +from diplomacy_tensorflow.compiler.xla.service import hlo_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/xla/xla.proto', + package='xla', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n+diplomacy_tensorflow/compiler/xla/xla.proto\x12\x03xla\x1a\x30\x64iplomacy_tensorflow/compiler/xla/xla_data.proto\x1a\x33\x64iplomacy_tensorflow/compiler/xla/service/hlo.proto\"\xc4\x02\n\x19HloReducePrecisionOptions\x12\x39\n\x08location\x18\x01 \x01(\x0e\x32\'.xla.HloReducePrecisionOptions.Location\x12\x15\n\rexponent_bits\x18\x02 \x01(\r\x12\x15\n\rmantissa_bits\x18\x03 \x01(\r\x12\x19\n\x11opcodes_to_suffix\x18\x04 \x03(\r\x12#\n\x1bopname_substrings_to_suffix\x18\x05 \x03(\t\"~\n\x08Location\x12\r\n\tOP_INPUTS\x10\x00\x12\x0e\n\nOP_OUTPUTS\x10\x01\x12\x16\n\x12UNFUSED_OP_OUTPUTS\x10\x02\x12\x1c\n\x18\x46USION_INPUTS_BY_CONTENT\x10\x03\x12\x1d\n\x19\x46USION_OUTPUTS_BY_CONTENT\x10\x04\"\x9e\r\n\x0c\x44\x65\x62ugOptions\x12\x1e\n\x16xla_generate_hlo_graph\x18\x01 \x01(\t\x12\x1f\n\x17xla_hlo_graph_addresses\x18\x02 \x01(\x08\x12\x1a\n\x12xla_hlo_graph_path\x18\x04 \x01(\t\x12 \n\x18xla_hlo_dump_as_graphdef\x18\x05 \x01(\x08\x12\x18\n\x10xla_log_hlo_text\x18\x06 \x01(\t\x12 \n\x18xla_generate_hlo_text_to\x18\x07 \x01(\t\x12\'\n\x1fxla_dump_optimized_hlo_proto_to\x18\x08 \x01(\t\x12\x17\n\x0fxla_hlo_profile\x18\t \x01(\x08\x12 \n\x18xla_dump_computations_to\x18\n \x01(\t\x12\x1e\n\x16xla_dump_executions_to\x18\x0b \x01(\t\x12\x1e\n\x16xla_disable_hlo_passes\x18\x1e \x03(\t\x12\"\n\x1axla_disable_all_hlo_passes\x18h \x01(\x08\x12&\n\x1exla_backend_optimization_level\x18\x1f \x01(\x05\x12\"\n\x1axla_embed_ir_in_executable\x18! \x01(\x08\x12\x16\n\x0exla_dump_ir_to\x18\" \x01(\t\x12,\n$xla_eliminate_hlo_implicit_broadcast\x18# \x01(\x08\x12\"\n\x1axla_cpu_multi_thread_eigen\x18< \x01(\x08\x12\x1d\n\x15xla_gpu_cuda_data_dir\x18= \x01(\t\x12\x13\n\x0bxla_gpu_ftz\x18> \x01(\x08\x12\'\n\x1fxla_gpu_disable_multi_streaming\x18? \x01(\x08\x12,\n$xla_llvm_enable_alias_scope_metadata\x18\x46 \x01(\x08\x12(\n xla_llvm_enable_noalias_metadata\x18G \x01(\x08\x12/\n\'xla_llvm_enable_invariant_load_metadata\x18H \x01(\x08\x12)\n!xla_llvm_disable_expensive_passes\x18I \x01(\x08\x12\x44\n\x1chlo_reduce_precision_options\x18P \x03(\x0b\x32\x1e.xla.HloReducePrecisionOptions\x12#\n\x1bxla_test_all_output_layouts\x18Z \x01(\x08\x12\"\n\x1axla_test_all_input_layouts\x18[ \x01(\x08\x12$\n\x1cxla_hlo_graph_sharding_color\x18\\ \x01(\x08\x12%\n\x1dxla_hlo_tfgraph_device_scopes\x18] \x01(\x08\x12#\n\x1bxla_gpu_use_cudnn_batchnorm\x18^ \x01(\x08\x12)\n!xla_dump_unoptimized_hlo_proto_to\x18_ \x01(\t\x12&\n\x1exla_dump_per_pass_hlo_proto_to\x18` \x01(\t\x12\x1b\n\x13xla_cpu_use_mkl_dnn\x18\x61 \x01(\x08\x12(\n xla_gpu_max_kernel_unroll_factor\x18\x62 \x01(\x05\x12 \n\x18xla_cpu_enable_fast_math\x18\x63 \x01(\x08\x12#\n\x1bxla_gpu_enable_fast_min_max\x18\x64 \x01(\x08\x12.\n&xla_gpu_crash_on_verification_failures\x18\x65 \x01(\x08\x12,\n$xla_force_host_platform_device_count\x18\x66 \x01(\x05\x12+\n#xla_gpu_disable_ptxas_optimizations\x18g \x01(\x08\x12\x1c\n\x14xla_hlo_dump_as_html\x18i \x01(\x08\x12\'\n\x1fxla_hlo_evaluator_use_fast_path\x18j \x01(\x08\x12Q\n\x19xla_backend_extra_options\x18\xf4\x03 \x03(\x0b\x32-.xla.DebugOptions.XlaBackendExtraOptionsEntry\x1a=\n\x1bXlaBackendExtraOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa8\x01\n\x10\x45xecutionOptions\x12\x31\n\x18shape_with_output_layout\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x0c\n\x04seed\x18\x03 \x01(\x04\x12(\n\rdebug_options\x18\x04 \x01(\x0b\x32\x11.xla.DebugOptions\x12)\n\x0e\x64\x65vice_handles\x18\x05 \x03(\x0b\x32\x11.xla.DeviceHandle\"/\n\x17GetDeviceHandlesRequest\x12\x14\n\x0c\x64\x65vice_count\x18\x01 \x01(\x03\"E\n\x18GetDeviceHandlesResponse\x12)\n\x0e\x64\x65vice_handles\x18\x01 \x03(\x0b\x32\x11.xla.DeviceHandle\"j\n\x17TransferToClientRequest\x12#\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x15.xla.GlobalDataHandle\x12*\n\x11shape_with_layout\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\">\n\x18TransferToClientResponse\x12\"\n\x07literal\x18\x01 \x01(\x0b\x32\x11.xla.LiteralProto\"g\n\x17TransferToServerRequest\x12\"\n\x07literal\x18\x01 \x01(\x0b\x32\x11.xla.LiteralProto\x12(\n\rdevice_handle\x18\x02 \x01(\x0b\x32\x11.xla.DeviceHandle\"?\n\x18TransferToServerResponse\x12#\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x15.xla.GlobalDataHandle\"{\n\x17TransferToInfeedRequest\x12\"\n\x07literal\x18\x01 \x01(\x0b\x32\x11.xla.LiteralProto\x12\x12\n\nreplica_id\x18\x02 \x01(\x03\x12(\n\rdevice_handle\x18\x03 \x01(\x0b\x32\x11.xla.DeviceHandle\"\x1a\n\x18TransferToInfeedResponse\"\x86\x01\n\x1aTransferFromOutfeedRequest\x12*\n\x11shape_with_layout\x18\x01 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x12\n\nreplica_id\x18\x02 \x01(\x03\x12(\n\rdevice_handle\x18\x03 \x01(\x0b\x32\x11.xla.DeviceHandle\"A\n\x1bTransferFromOutfeedResponse\x12\"\n\x07literal\x18\x01 \x01(\x0b\x32\x11.xla.LiteralProto\">\n\x12ResetDeviceRequest\x12(\n\rdevice_handle\x18\x01 \x01(\x0b\x32\x11.xla.DeviceHandle\"\x15\n\x13ResetDeviceResponse\"r\n\x1c\x43omputationGraphStatsRequest\x12(\n\x0b\x63omputation\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12(\n\rdebug_options\x18\x02 \x01(\x0b\x32\x11.xla.DebugOptions\"@\n\x18\x43omputationStatsResponse\x12$\n\x05stats\x18\x01 \x01(\x0b\x32\x15.xla.ComputationStats\"R\n\x1a\x43reateChannelHandleRequest\x12\x34\n\x0c\x63hannel_type\x18\x01 \x01(\x0e\x32\x1e.xla.ChannelHandle.ChannelType\"B\n\x1b\x43reateChannelHandleResponse\x12#\n\x07\x63hannel\x18\x01 \x01(\x0b\x32\x12.xla.ChannelHandle\"8\n\x11UnregisterRequest\x12#\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x15.xla.GlobalDataHandle\"\x14\n\x12UnregisterResponse\"\x9e\x01\n\x0e\x43ompileRequest\x12(\n\x0b\x63omputation\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\x30\n\x11\x65xecution_options\x18\x02 \x01(\x0b\x32\x15.xla.ExecutionOptions\x12\x30\n\x17input_shape_with_layout\x18\x03 \x03(\x0b\x32\x0f.xla.ShapeProto\"7\n\x0f\x43ompileResponse\x12$\n\x06handle\x18\x01 \x01(\x0b\x32\x14.xla.ExecutionHandle\"`\n\x0e\x45xecuteRequest\x12$\n\x06handle\x18\x01 \x01(\x0b\x32\x14.xla.ExecutionHandle\x12(\n\targuments\x18\x02 \x03(\x0b\x32\x15.xla.GlobalDataHandle\"\x9b\x01\n\x13\x45xecuteGraphRequest\x12(\n\x0b\x63omputation\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12(\n\targuments\x18\x02 \x03(\x0b\x32\x15.xla.GlobalDataHandle\x12\x30\n\x11\x65xecution_options\x18\x03 \x01(\x0b\x32\x15.xla.ExecutionOptions\"I\n\x1b\x45xecuteGraphParallelRequest\x12*\n\x08requests\x18\x01 \x03(\x0b\x32\x18.xla.ExecuteGraphRequest\"`\n\x0f\x45xecuteResponse\x12%\n\x06output\x18\x01 \x01(\x0b\x32\x15.xla.GlobalDataHandle\x12&\n\x07profile\x18\x02 \x01(\x0b\x32\x15.xla.ExecutionProfile\"B\n\x17\x45xecuteParallelResponse\x12\'\n\tresponses\x18\x01 \x03(\x0b\x32\x14.xla.ExecuteResponse\"B\n\x17WaitForExecutionRequest\x12\'\n\texecution\x18\x01 \x01(\x0b\x32\x14.xla.ExecutionHandle\"i\n\x18WaitForExecutionResponse\x12%\n\x06output\x18\x01 \x01(\x0b\x32\x15.xla.GlobalDataHandle\x12&\n\x07profile\x18\x02 \x01(\x0b\x32\x15.xla.ExecutionProfile\"p\n\x1b\x43omputeConstantGraphRequest\x12(\n\x0b\x63omputation\x18\x01 \x01(\x0b\x32\x13.xla.HloModuleProto\x12\'\n\routput_layout\x18\x02 \x01(\x0b\x32\x10.xla.LayoutProto\"=\n\x17\x43omputeConstantResponse\x12\"\n\x07literal\x18\x01 \x01(\x0b\x32\x11.xla.LiteralProto\"F\n\x17\x44\x65\x63onstructTupleRequest\x12+\n\x0ctuple_handle\x18\x02 \x01(\x0b\x32\x15.xla.GlobalDataHandle\"J\n\x18\x44\x65\x63onstructTupleResponse\x12.\n\x0f\x65lement_handles\x18\x01 \x03(\x0b\x32\x15.xla.GlobalDataHandle\"\x9b\x01\n\x0fLoadDataRequest\x12\x1c\n\x14\x63olumnio_tablet_path\x18\x01 \x01(\t\x12\x16\n\x0e\x63olumnio_field\x18\x02 \x01(\t\x12&\n\relement_shape\x18\x03 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x0e\n\x06offset\x18\x04 \x01(\x03\x12\r\n\x05limit\x18\x05 \x01(\x03\x12\x0b\n\x03zip\x18\x06 \x01(\x08\"\x9e\x01\n\x10LoadDataResponse\x12#\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x15.xla.GlobalDataHandle\x12#\n\ndata_shape\x18\x02 \x01(\x0b\x32\x0f.xla.ShapeProto\x12\x16\n\x0e\x61vailable_rows\x18\x03 \x01(\x03\x12\x13\n\x0brows_loaded\x18\x04 \x01(\x03\x12\x13\n\x0bnanoseconds\x18\x05 \x01(\x03\"6\n\x0fGetShapeRequest\x12#\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x15.xla.GlobalDataHandle\"2\n\x10GetShapeResponse\x12\x1e\n\x05shape\x18\x01 \x01(\x0b\x32\x0f.xla.ShapeProto\"4\n\rUnpackRequest\x12#\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x15.xla.GlobalDataHandle\":\n\x0eUnpackResponse\x12(\n\ttied_data\x18\x01 \x03(\x0b\x32\x15.xla.GlobalDataHandleb\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2.DESCRIPTOR,]) + + + +_HLOREDUCEPRECISIONOPTIONS_LOCATION = _descriptor.EnumDescriptor( + name='Location', + full_name='xla.HloReducePrecisionOptions.Location', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='OP_INPUTS', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OP_OUTPUTS', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='UNFUSED_OP_OUTPUTS', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FUSION_INPUTS_BY_CONTENT', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FUSION_OUTPUTS_BY_CONTENT', index=4, number=4, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=354, + serialized_end=480, +) +_sym_db.RegisterEnumDescriptor(_HLOREDUCEPRECISIONOPTIONS_LOCATION) + + +_HLOREDUCEPRECISIONOPTIONS = _descriptor.Descriptor( + name='HloReducePrecisionOptions', + full_name='xla.HloReducePrecisionOptions', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='location', full_name='xla.HloReducePrecisionOptions.location', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='exponent_bits', full_name='xla.HloReducePrecisionOptions.exponent_bits', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mantissa_bits', full_name='xla.HloReducePrecisionOptions.mantissa_bits', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='opcodes_to_suffix', full_name='xla.HloReducePrecisionOptions.opcodes_to_suffix', index=3, + number=4, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='opname_substrings_to_suffix', full_name='xla.HloReducePrecisionOptions.opname_substrings_to_suffix', index=4, + number=5, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _HLOREDUCEPRECISIONOPTIONS_LOCATION, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=156, + serialized_end=480, +) + + +_DEBUGOPTIONS_XLABACKENDEXTRAOPTIONSENTRY = _descriptor.Descriptor( + name='XlaBackendExtraOptionsEntry', + full_name='xla.DebugOptions.XlaBackendExtraOptionsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='xla.DebugOptions.XlaBackendExtraOptionsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='xla.DebugOptions.XlaBackendExtraOptionsEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2116, + serialized_end=2177, +) + +_DEBUGOPTIONS = _descriptor.Descriptor( + name='DebugOptions', + full_name='xla.DebugOptions', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='xla_generate_hlo_graph', full_name='xla.DebugOptions.xla_generate_hlo_graph', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_graph_addresses', full_name='xla.DebugOptions.xla_hlo_graph_addresses', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_graph_path', full_name='xla.DebugOptions.xla_hlo_graph_path', index=2, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_dump_as_graphdef', full_name='xla.DebugOptions.xla_hlo_dump_as_graphdef', index=3, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_log_hlo_text', full_name='xla.DebugOptions.xla_log_hlo_text', index=4, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_generate_hlo_text_to', full_name='xla.DebugOptions.xla_generate_hlo_text_to', index=5, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_dump_optimized_hlo_proto_to', full_name='xla.DebugOptions.xla_dump_optimized_hlo_proto_to', index=6, + number=8, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_profile', full_name='xla.DebugOptions.xla_hlo_profile', index=7, + number=9, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_dump_computations_to', full_name='xla.DebugOptions.xla_dump_computations_to', index=8, + number=10, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_dump_executions_to', full_name='xla.DebugOptions.xla_dump_executions_to', index=9, + number=11, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_disable_hlo_passes', full_name='xla.DebugOptions.xla_disable_hlo_passes', index=10, + number=30, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_disable_all_hlo_passes', full_name='xla.DebugOptions.xla_disable_all_hlo_passes', index=11, + number=104, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_backend_optimization_level', full_name='xla.DebugOptions.xla_backend_optimization_level', index=12, + number=31, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_embed_ir_in_executable', full_name='xla.DebugOptions.xla_embed_ir_in_executable', index=13, + number=33, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_dump_ir_to', full_name='xla.DebugOptions.xla_dump_ir_to', index=14, + number=34, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_eliminate_hlo_implicit_broadcast', full_name='xla.DebugOptions.xla_eliminate_hlo_implicit_broadcast', index=15, + number=35, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_cpu_multi_thread_eigen', full_name='xla.DebugOptions.xla_cpu_multi_thread_eigen', index=16, + number=60, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_cuda_data_dir', full_name='xla.DebugOptions.xla_gpu_cuda_data_dir', index=17, + number=61, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_ftz', full_name='xla.DebugOptions.xla_gpu_ftz', index=18, + number=62, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_disable_multi_streaming', full_name='xla.DebugOptions.xla_gpu_disable_multi_streaming', index=19, + number=63, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_llvm_enable_alias_scope_metadata', full_name='xla.DebugOptions.xla_llvm_enable_alias_scope_metadata', index=20, + number=70, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_llvm_enable_noalias_metadata', full_name='xla.DebugOptions.xla_llvm_enable_noalias_metadata', index=21, + number=71, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_llvm_enable_invariant_load_metadata', full_name='xla.DebugOptions.xla_llvm_enable_invariant_load_metadata', index=22, + number=72, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_llvm_disable_expensive_passes', full_name='xla.DebugOptions.xla_llvm_disable_expensive_passes', index=23, + number=73, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='hlo_reduce_precision_options', full_name='xla.DebugOptions.hlo_reduce_precision_options', index=24, + number=80, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_test_all_output_layouts', full_name='xla.DebugOptions.xla_test_all_output_layouts', index=25, + number=90, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_test_all_input_layouts', full_name='xla.DebugOptions.xla_test_all_input_layouts', index=26, + number=91, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_graph_sharding_color', full_name='xla.DebugOptions.xla_hlo_graph_sharding_color', index=27, + number=92, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_tfgraph_device_scopes', full_name='xla.DebugOptions.xla_hlo_tfgraph_device_scopes', index=28, + number=93, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_use_cudnn_batchnorm', full_name='xla.DebugOptions.xla_gpu_use_cudnn_batchnorm', index=29, + number=94, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_dump_unoptimized_hlo_proto_to', full_name='xla.DebugOptions.xla_dump_unoptimized_hlo_proto_to', index=30, + number=95, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_dump_per_pass_hlo_proto_to', full_name='xla.DebugOptions.xla_dump_per_pass_hlo_proto_to', index=31, + number=96, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_cpu_use_mkl_dnn', full_name='xla.DebugOptions.xla_cpu_use_mkl_dnn', index=32, + number=97, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_max_kernel_unroll_factor', full_name='xla.DebugOptions.xla_gpu_max_kernel_unroll_factor', index=33, + number=98, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_cpu_enable_fast_math', full_name='xla.DebugOptions.xla_cpu_enable_fast_math', index=34, + number=99, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_enable_fast_min_max', full_name='xla.DebugOptions.xla_gpu_enable_fast_min_max', index=35, + number=100, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_crash_on_verification_failures', full_name='xla.DebugOptions.xla_gpu_crash_on_verification_failures', index=36, + number=101, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_force_host_platform_device_count', full_name='xla.DebugOptions.xla_force_host_platform_device_count', index=37, + number=102, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_gpu_disable_ptxas_optimizations', full_name='xla.DebugOptions.xla_gpu_disable_ptxas_optimizations', index=38, + number=103, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_dump_as_html', full_name='xla.DebugOptions.xla_hlo_dump_as_html', index=39, + number=105, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_hlo_evaluator_use_fast_path', full_name='xla.DebugOptions.xla_hlo_evaluator_use_fast_path', index=40, + number=106, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla_backend_extra_options', full_name='xla.DebugOptions.xla_backend_extra_options', index=41, + number=500, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_DEBUGOPTIONS_XLABACKENDEXTRAOPTIONSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=483, + serialized_end=2177, +) + + +_EXECUTIONOPTIONS = _descriptor.Descriptor( + name='ExecutionOptions', + full_name='xla.ExecutionOptions', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='shape_with_output_layout', full_name='xla.ExecutionOptions.shape_with_output_layout', index=0, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='seed', full_name='xla.ExecutionOptions.seed', index=1, + number=3, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='debug_options', full_name='xla.ExecutionOptions.debug_options', index=2, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_handles', full_name='xla.ExecutionOptions.device_handles', index=3, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2180, + serialized_end=2348, +) + + +_GETDEVICEHANDLESREQUEST = _descriptor.Descriptor( + name='GetDeviceHandlesRequest', + full_name='xla.GetDeviceHandlesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device_count', full_name='xla.GetDeviceHandlesRequest.device_count', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2350, + serialized_end=2397, +) + + +_GETDEVICEHANDLESRESPONSE = _descriptor.Descriptor( + name='GetDeviceHandlesResponse', + full_name='xla.GetDeviceHandlesResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device_handles', full_name='xla.GetDeviceHandlesResponse.device_handles', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2399, + serialized_end=2468, +) + + +_TRANSFERTOCLIENTREQUEST = _descriptor.Descriptor( + name='TransferToClientRequest', + full_name='xla.TransferToClientRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='data', full_name='xla.TransferToClientRequest.data', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape_with_layout', full_name='xla.TransferToClientRequest.shape_with_layout', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2470, + serialized_end=2576, +) + + +_TRANSFERTOCLIENTRESPONSE = _descriptor.Descriptor( + name='TransferToClientResponse', + full_name='xla.TransferToClientResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='literal', full_name='xla.TransferToClientResponse.literal', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2578, + serialized_end=2640, +) + + +_TRANSFERTOSERVERREQUEST = _descriptor.Descriptor( + name='TransferToServerRequest', + full_name='xla.TransferToServerRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='literal', full_name='xla.TransferToServerRequest.literal', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_handle', full_name='xla.TransferToServerRequest.device_handle', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2642, + serialized_end=2745, +) + + +_TRANSFERTOSERVERRESPONSE = _descriptor.Descriptor( + name='TransferToServerResponse', + full_name='xla.TransferToServerResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='data', full_name='xla.TransferToServerResponse.data', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2747, + serialized_end=2810, +) + + +_TRANSFERTOINFEEDREQUEST = _descriptor.Descriptor( + name='TransferToInfeedRequest', + full_name='xla.TransferToInfeedRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='literal', full_name='xla.TransferToInfeedRequest.literal', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='replica_id', full_name='xla.TransferToInfeedRequest.replica_id', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_handle', full_name='xla.TransferToInfeedRequest.device_handle', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2812, + serialized_end=2935, +) + + +_TRANSFERTOINFEEDRESPONSE = _descriptor.Descriptor( + name='TransferToInfeedResponse', + full_name='xla.TransferToInfeedResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2937, + serialized_end=2963, +) + + +_TRANSFERFROMOUTFEEDREQUEST = _descriptor.Descriptor( + name='TransferFromOutfeedRequest', + full_name='xla.TransferFromOutfeedRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='shape_with_layout', full_name='xla.TransferFromOutfeedRequest.shape_with_layout', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='replica_id', full_name='xla.TransferFromOutfeedRequest.replica_id', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_handle', full_name='xla.TransferFromOutfeedRequest.device_handle', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2966, + serialized_end=3100, +) + + +_TRANSFERFROMOUTFEEDRESPONSE = _descriptor.Descriptor( + name='TransferFromOutfeedResponse', + full_name='xla.TransferFromOutfeedResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='literal', full_name='xla.TransferFromOutfeedResponse.literal', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3102, + serialized_end=3167, +) + + +_RESETDEVICEREQUEST = _descriptor.Descriptor( + name='ResetDeviceRequest', + full_name='xla.ResetDeviceRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device_handle', full_name='xla.ResetDeviceRequest.device_handle', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3169, + serialized_end=3231, +) + + +_RESETDEVICERESPONSE = _descriptor.Descriptor( + name='ResetDeviceResponse', + full_name='xla.ResetDeviceResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3233, + serialized_end=3254, +) + + +_COMPUTATIONGRAPHSTATSREQUEST = _descriptor.Descriptor( + name='ComputationGraphStatsRequest', + full_name='xla.ComputationGraphStatsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='computation', full_name='xla.ComputationGraphStatsRequest.computation', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='debug_options', full_name='xla.ComputationGraphStatsRequest.debug_options', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3256, + serialized_end=3370, +) + + +_COMPUTATIONSTATSRESPONSE = _descriptor.Descriptor( + name='ComputationStatsResponse', + full_name='xla.ComputationStatsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='stats', full_name='xla.ComputationStatsResponse.stats', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3372, + serialized_end=3436, +) + + +_CREATECHANNELHANDLEREQUEST = _descriptor.Descriptor( + name='CreateChannelHandleRequest', + full_name='xla.CreateChannelHandleRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='channel_type', full_name='xla.CreateChannelHandleRequest.channel_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3438, + serialized_end=3520, +) + + +_CREATECHANNELHANDLERESPONSE = _descriptor.Descriptor( + name='CreateChannelHandleResponse', + full_name='xla.CreateChannelHandleResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='channel', full_name='xla.CreateChannelHandleResponse.channel', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3522, + serialized_end=3588, +) + + +_UNREGISTERREQUEST = _descriptor.Descriptor( + name='UnregisterRequest', + full_name='xla.UnregisterRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='data', full_name='xla.UnregisterRequest.data', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3590, + serialized_end=3646, +) + + +_UNREGISTERRESPONSE = _descriptor.Descriptor( + name='UnregisterResponse', + full_name='xla.UnregisterResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3648, + serialized_end=3668, +) + + +_COMPILEREQUEST = _descriptor.Descriptor( + name='CompileRequest', + full_name='xla.CompileRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='computation', full_name='xla.CompileRequest.computation', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='execution_options', full_name='xla.CompileRequest.execution_options', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input_shape_with_layout', full_name='xla.CompileRequest.input_shape_with_layout', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3671, + serialized_end=3829, +) + + +_COMPILERESPONSE = _descriptor.Descriptor( + name='CompileResponse', + full_name='xla.CompileResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='handle', full_name='xla.CompileResponse.handle', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3831, + serialized_end=3886, +) + + +_EXECUTEREQUEST = _descriptor.Descriptor( + name='ExecuteRequest', + full_name='xla.ExecuteRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='handle', full_name='xla.ExecuteRequest.handle', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='arguments', full_name='xla.ExecuteRequest.arguments', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3888, + serialized_end=3984, +) + + +_EXECUTEGRAPHREQUEST = _descriptor.Descriptor( + name='ExecuteGraphRequest', + full_name='xla.ExecuteGraphRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='computation', full_name='xla.ExecuteGraphRequest.computation', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='arguments', full_name='xla.ExecuteGraphRequest.arguments', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='execution_options', full_name='xla.ExecuteGraphRequest.execution_options', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3987, + serialized_end=4142, +) + + +_EXECUTEGRAPHPARALLELREQUEST = _descriptor.Descriptor( + name='ExecuteGraphParallelRequest', + full_name='xla.ExecuteGraphParallelRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='requests', full_name='xla.ExecuteGraphParallelRequest.requests', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4144, + serialized_end=4217, +) + + +_EXECUTERESPONSE = _descriptor.Descriptor( + name='ExecuteResponse', + full_name='xla.ExecuteResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='output', full_name='xla.ExecuteResponse.output', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='profile', full_name='xla.ExecuteResponse.profile', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4219, + serialized_end=4315, +) + + +_EXECUTEPARALLELRESPONSE = _descriptor.Descriptor( + name='ExecuteParallelResponse', + full_name='xla.ExecuteParallelResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='responses', full_name='xla.ExecuteParallelResponse.responses', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4317, + serialized_end=4383, +) + + +_WAITFOREXECUTIONREQUEST = _descriptor.Descriptor( + name='WaitForExecutionRequest', + full_name='xla.WaitForExecutionRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='execution', full_name='xla.WaitForExecutionRequest.execution', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4385, + serialized_end=4451, +) + + +_WAITFOREXECUTIONRESPONSE = _descriptor.Descriptor( + name='WaitForExecutionResponse', + full_name='xla.WaitForExecutionResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='output', full_name='xla.WaitForExecutionResponse.output', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='profile', full_name='xla.WaitForExecutionResponse.profile', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4453, + serialized_end=4558, +) + + +_COMPUTECONSTANTGRAPHREQUEST = _descriptor.Descriptor( + name='ComputeConstantGraphRequest', + full_name='xla.ComputeConstantGraphRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='computation', full_name='xla.ComputeConstantGraphRequest.computation', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_layout', full_name='xla.ComputeConstantGraphRequest.output_layout', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4560, + serialized_end=4672, +) + + +_COMPUTECONSTANTRESPONSE = _descriptor.Descriptor( + name='ComputeConstantResponse', + full_name='xla.ComputeConstantResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='literal', full_name='xla.ComputeConstantResponse.literal', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4674, + serialized_end=4735, +) + + +_DECONSTRUCTTUPLEREQUEST = _descriptor.Descriptor( + name='DeconstructTupleRequest', + full_name='xla.DeconstructTupleRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tuple_handle', full_name='xla.DeconstructTupleRequest.tuple_handle', index=0, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4737, + serialized_end=4807, +) + + +_DECONSTRUCTTUPLERESPONSE = _descriptor.Descriptor( + name='DeconstructTupleResponse', + full_name='xla.DeconstructTupleResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='element_handles', full_name='xla.DeconstructTupleResponse.element_handles', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4809, + serialized_end=4883, +) + + +_LOADDATAREQUEST = _descriptor.Descriptor( + name='LoadDataRequest', + full_name='xla.LoadDataRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='columnio_tablet_path', full_name='xla.LoadDataRequest.columnio_tablet_path', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='columnio_field', full_name='xla.LoadDataRequest.columnio_field', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='element_shape', full_name='xla.LoadDataRequest.element_shape', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='offset', full_name='xla.LoadDataRequest.offset', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='limit', full_name='xla.LoadDataRequest.limit', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='zip', full_name='xla.LoadDataRequest.zip', index=5, + number=6, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4886, + serialized_end=5041, +) + + +_LOADDATARESPONSE = _descriptor.Descriptor( + name='LoadDataResponse', + full_name='xla.LoadDataResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='data', full_name='xla.LoadDataResponse.data', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='data_shape', full_name='xla.LoadDataResponse.data_shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='available_rows', full_name='xla.LoadDataResponse.available_rows', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rows_loaded', full_name='xla.LoadDataResponse.rows_loaded', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='nanoseconds', full_name='xla.LoadDataResponse.nanoseconds', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5044, + serialized_end=5202, +) + + +_GETSHAPEREQUEST = _descriptor.Descriptor( + name='GetShapeRequest', + full_name='xla.GetShapeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='data', full_name='xla.GetShapeRequest.data', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5204, + serialized_end=5258, +) + + +_GETSHAPERESPONSE = _descriptor.Descriptor( + name='GetShapeResponse', + full_name='xla.GetShapeResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='shape', full_name='xla.GetShapeResponse.shape', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5260, + serialized_end=5310, +) + + +_UNPACKREQUEST = _descriptor.Descriptor( + name='UnpackRequest', + full_name='xla.UnpackRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='data', full_name='xla.UnpackRequest.data', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5312, + serialized_end=5364, +) + + +_UNPACKRESPONSE = _descriptor.Descriptor( + name='UnpackResponse', + full_name='xla.UnpackResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tied_data', full_name='xla.UnpackResponse.tied_data', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5366, + serialized_end=5424, +) + +_HLOREDUCEPRECISIONOPTIONS.fields_by_name['location'].enum_type = _HLOREDUCEPRECISIONOPTIONS_LOCATION +_HLOREDUCEPRECISIONOPTIONS_LOCATION.containing_type = _HLOREDUCEPRECISIONOPTIONS +_DEBUGOPTIONS_XLABACKENDEXTRAOPTIONSENTRY.containing_type = _DEBUGOPTIONS +_DEBUGOPTIONS.fields_by_name['hlo_reduce_precision_options'].message_type = _HLOREDUCEPRECISIONOPTIONS +_DEBUGOPTIONS.fields_by_name['xla_backend_extra_options'].message_type = _DEBUGOPTIONS_XLABACKENDEXTRAOPTIONSENTRY +_EXECUTIONOPTIONS.fields_by_name['shape_with_output_layout'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_EXECUTIONOPTIONS.fields_by_name['debug_options'].message_type = _DEBUGOPTIONS +_EXECUTIONOPTIONS.fields_by_name['device_handles'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._DEVICEHANDLE +_GETDEVICEHANDLESRESPONSE.fields_by_name['device_handles'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._DEVICEHANDLE +_TRANSFERTOCLIENTREQUEST.fields_by_name['data'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_TRANSFERTOCLIENTREQUEST.fields_by_name['shape_with_layout'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_TRANSFERTOCLIENTRESPONSE.fields_by_name['literal'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_TRANSFERTOSERVERREQUEST.fields_by_name['literal'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_TRANSFERTOSERVERREQUEST.fields_by_name['device_handle'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._DEVICEHANDLE +_TRANSFERTOSERVERRESPONSE.fields_by_name['data'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_TRANSFERTOINFEEDREQUEST.fields_by_name['literal'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_TRANSFERTOINFEEDREQUEST.fields_by_name['device_handle'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._DEVICEHANDLE +_TRANSFERFROMOUTFEEDREQUEST.fields_by_name['shape_with_layout'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_TRANSFERFROMOUTFEEDREQUEST.fields_by_name['device_handle'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._DEVICEHANDLE +_TRANSFERFROMOUTFEEDRESPONSE.fields_by_name['literal'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_RESETDEVICEREQUEST.fields_by_name['device_handle'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._DEVICEHANDLE +_COMPUTATIONGRAPHSTATSREQUEST.fields_by_name['computation'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2._HLOMODULEPROTO +_COMPUTATIONGRAPHSTATSREQUEST.fields_by_name['debug_options'].message_type = _DEBUGOPTIONS +_COMPUTATIONSTATSRESPONSE.fields_by_name['stats'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._COMPUTATIONSTATS +_CREATECHANNELHANDLEREQUEST.fields_by_name['channel_type'].enum_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._CHANNELHANDLE_CHANNELTYPE +_CREATECHANNELHANDLERESPONSE.fields_by_name['channel'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._CHANNELHANDLE +_UNREGISTERREQUEST.fields_by_name['data'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_COMPILEREQUEST.fields_by_name['computation'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2._HLOMODULEPROTO +_COMPILEREQUEST.fields_by_name['execution_options'].message_type = _EXECUTIONOPTIONS +_COMPILEREQUEST.fields_by_name['input_shape_with_layout'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_COMPILERESPONSE.fields_by_name['handle'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._EXECUTIONHANDLE +_EXECUTEREQUEST.fields_by_name['handle'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._EXECUTIONHANDLE +_EXECUTEREQUEST.fields_by_name['arguments'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_EXECUTEGRAPHREQUEST.fields_by_name['computation'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2._HLOMODULEPROTO +_EXECUTEGRAPHREQUEST.fields_by_name['arguments'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_EXECUTEGRAPHREQUEST.fields_by_name['execution_options'].message_type = _EXECUTIONOPTIONS +_EXECUTEGRAPHPARALLELREQUEST.fields_by_name['requests'].message_type = _EXECUTEGRAPHREQUEST +_EXECUTERESPONSE.fields_by_name['output'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_EXECUTERESPONSE.fields_by_name['profile'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._EXECUTIONPROFILE +_EXECUTEPARALLELRESPONSE.fields_by_name['responses'].message_type = _EXECUTERESPONSE +_WAITFOREXECUTIONREQUEST.fields_by_name['execution'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._EXECUTIONHANDLE +_WAITFOREXECUTIONRESPONSE.fields_by_name['output'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_WAITFOREXECUTIONRESPONSE.fields_by_name['profile'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._EXECUTIONPROFILE +_COMPUTECONSTANTGRAPHREQUEST.fields_by_name['computation'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2._HLOMODULEPROTO +_COMPUTECONSTANTGRAPHREQUEST.fields_by_name['output_layout'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LAYOUTPROTO +_COMPUTECONSTANTRESPONSE.fields_by_name['literal'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_DECONSTRUCTTUPLEREQUEST.fields_by_name['tuple_handle'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_DECONSTRUCTTUPLERESPONSE.fields_by_name['element_handles'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_LOADDATAREQUEST.fields_by_name['element_shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_LOADDATARESPONSE.fields_by_name['data'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_LOADDATARESPONSE.fields_by_name['data_shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_GETSHAPEREQUEST.fields_by_name['data'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_GETSHAPERESPONSE.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._SHAPEPROTO +_UNPACKREQUEST.fields_by_name['data'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +_UNPACKRESPONSE.fields_by_name['tied_data'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._GLOBALDATAHANDLE +DESCRIPTOR.message_types_by_name['HloReducePrecisionOptions'] = _HLOREDUCEPRECISIONOPTIONS +DESCRIPTOR.message_types_by_name['DebugOptions'] = _DEBUGOPTIONS +DESCRIPTOR.message_types_by_name['ExecutionOptions'] = _EXECUTIONOPTIONS +DESCRIPTOR.message_types_by_name['GetDeviceHandlesRequest'] = _GETDEVICEHANDLESREQUEST +DESCRIPTOR.message_types_by_name['GetDeviceHandlesResponse'] = _GETDEVICEHANDLESRESPONSE +DESCRIPTOR.message_types_by_name['TransferToClientRequest'] = _TRANSFERTOCLIENTREQUEST +DESCRIPTOR.message_types_by_name['TransferToClientResponse'] = _TRANSFERTOCLIENTRESPONSE +DESCRIPTOR.message_types_by_name['TransferToServerRequest'] = _TRANSFERTOSERVERREQUEST +DESCRIPTOR.message_types_by_name['TransferToServerResponse'] = _TRANSFERTOSERVERRESPONSE +DESCRIPTOR.message_types_by_name['TransferToInfeedRequest'] = _TRANSFERTOINFEEDREQUEST +DESCRIPTOR.message_types_by_name['TransferToInfeedResponse'] = _TRANSFERTOINFEEDRESPONSE +DESCRIPTOR.message_types_by_name['TransferFromOutfeedRequest'] = _TRANSFERFROMOUTFEEDREQUEST +DESCRIPTOR.message_types_by_name['TransferFromOutfeedResponse'] = _TRANSFERFROMOUTFEEDRESPONSE +DESCRIPTOR.message_types_by_name['ResetDeviceRequest'] = _RESETDEVICEREQUEST +DESCRIPTOR.message_types_by_name['ResetDeviceResponse'] = _RESETDEVICERESPONSE +DESCRIPTOR.message_types_by_name['ComputationGraphStatsRequest'] = _COMPUTATIONGRAPHSTATSREQUEST +DESCRIPTOR.message_types_by_name['ComputationStatsResponse'] = _COMPUTATIONSTATSRESPONSE +DESCRIPTOR.message_types_by_name['CreateChannelHandleRequest'] = _CREATECHANNELHANDLEREQUEST +DESCRIPTOR.message_types_by_name['CreateChannelHandleResponse'] = _CREATECHANNELHANDLERESPONSE +DESCRIPTOR.message_types_by_name['UnregisterRequest'] = _UNREGISTERREQUEST +DESCRIPTOR.message_types_by_name['UnregisterResponse'] = _UNREGISTERRESPONSE +DESCRIPTOR.message_types_by_name['CompileRequest'] = _COMPILEREQUEST +DESCRIPTOR.message_types_by_name['CompileResponse'] = _COMPILERESPONSE +DESCRIPTOR.message_types_by_name['ExecuteRequest'] = _EXECUTEREQUEST +DESCRIPTOR.message_types_by_name['ExecuteGraphRequest'] = _EXECUTEGRAPHREQUEST +DESCRIPTOR.message_types_by_name['ExecuteGraphParallelRequest'] = _EXECUTEGRAPHPARALLELREQUEST +DESCRIPTOR.message_types_by_name['ExecuteResponse'] = _EXECUTERESPONSE +DESCRIPTOR.message_types_by_name['ExecuteParallelResponse'] = _EXECUTEPARALLELRESPONSE +DESCRIPTOR.message_types_by_name['WaitForExecutionRequest'] = _WAITFOREXECUTIONREQUEST +DESCRIPTOR.message_types_by_name['WaitForExecutionResponse'] = _WAITFOREXECUTIONRESPONSE +DESCRIPTOR.message_types_by_name['ComputeConstantGraphRequest'] = _COMPUTECONSTANTGRAPHREQUEST +DESCRIPTOR.message_types_by_name['ComputeConstantResponse'] = _COMPUTECONSTANTRESPONSE +DESCRIPTOR.message_types_by_name['DeconstructTupleRequest'] = _DECONSTRUCTTUPLEREQUEST +DESCRIPTOR.message_types_by_name['DeconstructTupleResponse'] = _DECONSTRUCTTUPLERESPONSE +DESCRIPTOR.message_types_by_name['LoadDataRequest'] = _LOADDATAREQUEST +DESCRIPTOR.message_types_by_name['LoadDataResponse'] = _LOADDATARESPONSE +DESCRIPTOR.message_types_by_name['GetShapeRequest'] = _GETSHAPEREQUEST +DESCRIPTOR.message_types_by_name['GetShapeResponse'] = _GETSHAPERESPONSE +DESCRIPTOR.message_types_by_name['UnpackRequest'] = _UNPACKREQUEST +DESCRIPTOR.message_types_by_name['UnpackResponse'] = _UNPACKRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +HloReducePrecisionOptions = _reflection.GeneratedProtocolMessageType('HloReducePrecisionOptions', (_message.Message,), dict( + DESCRIPTOR = _HLOREDUCEPRECISIONOPTIONS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.HloReducePrecisionOptions) + )) +_sym_db.RegisterMessage(HloReducePrecisionOptions) + +DebugOptions = _reflection.GeneratedProtocolMessageType('DebugOptions', (_message.Message,), dict( + + XlaBackendExtraOptionsEntry = _reflection.GeneratedProtocolMessageType('XlaBackendExtraOptionsEntry', (_message.Message,), dict( + DESCRIPTOR = _DEBUGOPTIONS_XLABACKENDEXTRAOPTIONSENTRY, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.DebugOptions.XlaBackendExtraOptionsEntry) + )) + , + DESCRIPTOR = _DEBUGOPTIONS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.DebugOptions) + )) +_sym_db.RegisterMessage(DebugOptions) +_sym_db.RegisterMessage(DebugOptions.XlaBackendExtraOptionsEntry) + +ExecutionOptions = _reflection.GeneratedProtocolMessageType('ExecutionOptions', (_message.Message,), dict( + DESCRIPTOR = _EXECUTIONOPTIONS, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecutionOptions) + )) +_sym_db.RegisterMessage(ExecutionOptions) + +GetDeviceHandlesRequest = _reflection.GeneratedProtocolMessageType('GetDeviceHandlesRequest', (_message.Message,), dict( + DESCRIPTOR = _GETDEVICEHANDLESREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.GetDeviceHandlesRequest) + )) +_sym_db.RegisterMessage(GetDeviceHandlesRequest) + +GetDeviceHandlesResponse = _reflection.GeneratedProtocolMessageType('GetDeviceHandlesResponse', (_message.Message,), dict( + DESCRIPTOR = _GETDEVICEHANDLESRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.GetDeviceHandlesResponse) + )) +_sym_db.RegisterMessage(GetDeviceHandlesResponse) + +TransferToClientRequest = _reflection.GeneratedProtocolMessageType('TransferToClientRequest', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERTOCLIENTREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferToClientRequest) + )) +_sym_db.RegisterMessage(TransferToClientRequest) + +TransferToClientResponse = _reflection.GeneratedProtocolMessageType('TransferToClientResponse', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERTOCLIENTRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferToClientResponse) + )) +_sym_db.RegisterMessage(TransferToClientResponse) + +TransferToServerRequest = _reflection.GeneratedProtocolMessageType('TransferToServerRequest', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERTOSERVERREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferToServerRequest) + )) +_sym_db.RegisterMessage(TransferToServerRequest) + +TransferToServerResponse = _reflection.GeneratedProtocolMessageType('TransferToServerResponse', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERTOSERVERRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferToServerResponse) + )) +_sym_db.RegisterMessage(TransferToServerResponse) + +TransferToInfeedRequest = _reflection.GeneratedProtocolMessageType('TransferToInfeedRequest', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERTOINFEEDREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferToInfeedRequest) + )) +_sym_db.RegisterMessage(TransferToInfeedRequest) + +TransferToInfeedResponse = _reflection.GeneratedProtocolMessageType('TransferToInfeedResponse', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERTOINFEEDRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferToInfeedResponse) + )) +_sym_db.RegisterMessage(TransferToInfeedResponse) + +TransferFromOutfeedRequest = _reflection.GeneratedProtocolMessageType('TransferFromOutfeedRequest', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERFROMOUTFEEDREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferFromOutfeedRequest) + )) +_sym_db.RegisterMessage(TransferFromOutfeedRequest) + +TransferFromOutfeedResponse = _reflection.GeneratedProtocolMessageType('TransferFromOutfeedResponse', (_message.Message,), dict( + DESCRIPTOR = _TRANSFERFROMOUTFEEDRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.TransferFromOutfeedResponse) + )) +_sym_db.RegisterMessage(TransferFromOutfeedResponse) + +ResetDeviceRequest = _reflection.GeneratedProtocolMessageType('ResetDeviceRequest', (_message.Message,), dict( + DESCRIPTOR = _RESETDEVICEREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ResetDeviceRequest) + )) +_sym_db.RegisterMessage(ResetDeviceRequest) + +ResetDeviceResponse = _reflection.GeneratedProtocolMessageType('ResetDeviceResponse', (_message.Message,), dict( + DESCRIPTOR = _RESETDEVICERESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ResetDeviceResponse) + )) +_sym_db.RegisterMessage(ResetDeviceResponse) + +ComputationGraphStatsRequest = _reflection.GeneratedProtocolMessageType('ComputationGraphStatsRequest', (_message.Message,), dict( + DESCRIPTOR = _COMPUTATIONGRAPHSTATSREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ComputationGraphStatsRequest) + )) +_sym_db.RegisterMessage(ComputationGraphStatsRequest) + +ComputationStatsResponse = _reflection.GeneratedProtocolMessageType('ComputationStatsResponse', (_message.Message,), dict( + DESCRIPTOR = _COMPUTATIONSTATSRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ComputationStatsResponse) + )) +_sym_db.RegisterMessage(ComputationStatsResponse) + +CreateChannelHandleRequest = _reflection.GeneratedProtocolMessageType('CreateChannelHandleRequest', (_message.Message,), dict( + DESCRIPTOR = _CREATECHANNELHANDLEREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.CreateChannelHandleRequest) + )) +_sym_db.RegisterMessage(CreateChannelHandleRequest) + +CreateChannelHandleResponse = _reflection.GeneratedProtocolMessageType('CreateChannelHandleResponse', (_message.Message,), dict( + DESCRIPTOR = _CREATECHANNELHANDLERESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.CreateChannelHandleResponse) + )) +_sym_db.RegisterMessage(CreateChannelHandleResponse) + +UnregisterRequest = _reflection.GeneratedProtocolMessageType('UnregisterRequest', (_message.Message,), dict( + DESCRIPTOR = _UNREGISTERREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.UnregisterRequest) + )) +_sym_db.RegisterMessage(UnregisterRequest) + +UnregisterResponse = _reflection.GeneratedProtocolMessageType('UnregisterResponse', (_message.Message,), dict( + DESCRIPTOR = _UNREGISTERRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.UnregisterResponse) + )) +_sym_db.RegisterMessage(UnregisterResponse) + +CompileRequest = _reflection.GeneratedProtocolMessageType('CompileRequest', (_message.Message,), dict( + DESCRIPTOR = _COMPILEREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.CompileRequest) + )) +_sym_db.RegisterMessage(CompileRequest) + +CompileResponse = _reflection.GeneratedProtocolMessageType('CompileResponse', (_message.Message,), dict( + DESCRIPTOR = _COMPILERESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.CompileResponse) + )) +_sym_db.RegisterMessage(CompileResponse) + +ExecuteRequest = _reflection.GeneratedProtocolMessageType('ExecuteRequest', (_message.Message,), dict( + DESCRIPTOR = _EXECUTEREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecuteRequest) + )) +_sym_db.RegisterMessage(ExecuteRequest) + +ExecuteGraphRequest = _reflection.GeneratedProtocolMessageType('ExecuteGraphRequest', (_message.Message,), dict( + DESCRIPTOR = _EXECUTEGRAPHREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecuteGraphRequest) + )) +_sym_db.RegisterMessage(ExecuteGraphRequest) + +ExecuteGraphParallelRequest = _reflection.GeneratedProtocolMessageType('ExecuteGraphParallelRequest', (_message.Message,), dict( + DESCRIPTOR = _EXECUTEGRAPHPARALLELREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecuteGraphParallelRequest) + )) +_sym_db.RegisterMessage(ExecuteGraphParallelRequest) + +ExecuteResponse = _reflection.GeneratedProtocolMessageType('ExecuteResponse', (_message.Message,), dict( + DESCRIPTOR = _EXECUTERESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecuteResponse) + )) +_sym_db.RegisterMessage(ExecuteResponse) + +ExecuteParallelResponse = _reflection.GeneratedProtocolMessageType('ExecuteParallelResponse', (_message.Message,), dict( + DESCRIPTOR = _EXECUTEPARALLELRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ExecuteParallelResponse) + )) +_sym_db.RegisterMessage(ExecuteParallelResponse) + +WaitForExecutionRequest = _reflection.GeneratedProtocolMessageType('WaitForExecutionRequest', (_message.Message,), dict( + DESCRIPTOR = _WAITFOREXECUTIONREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.WaitForExecutionRequest) + )) +_sym_db.RegisterMessage(WaitForExecutionRequest) + +WaitForExecutionResponse = _reflection.GeneratedProtocolMessageType('WaitForExecutionResponse', (_message.Message,), dict( + DESCRIPTOR = _WAITFOREXECUTIONRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.WaitForExecutionResponse) + )) +_sym_db.RegisterMessage(WaitForExecutionResponse) + +ComputeConstantGraphRequest = _reflection.GeneratedProtocolMessageType('ComputeConstantGraphRequest', (_message.Message,), dict( + DESCRIPTOR = _COMPUTECONSTANTGRAPHREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ComputeConstantGraphRequest) + )) +_sym_db.RegisterMessage(ComputeConstantGraphRequest) + +ComputeConstantResponse = _reflection.GeneratedProtocolMessageType('ComputeConstantResponse', (_message.Message,), dict( + DESCRIPTOR = _COMPUTECONSTANTRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.ComputeConstantResponse) + )) +_sym_db.RegisterMessage(ComputeConstantResponse) + +DeconstructTupleRequest = _reflection.GeneratedProtocolMessageType('DeconstructTupleRequest', (_message.Message,), dict( + DESCRIPTOR = _DECONSTRUCTTUPLEREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.DeconstructTupleRequest) + )) +_sym_db.RegisterMessage(DeconstructTupleRequest) + +DeconstructTupleResponse = _reflection.GeneratedProtocolMessageType('DeconstructTupleResponse', (_message.Message,), dict( + DESCRIPTOR = _DECONSTRUCTTUPLERESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.DeconstructTupleResponse) + )) +_sym_db.RegisterMessage(DeconstructTupleResponse) + +LoadDataRequest = _reflection.GeneratedProtocolMessageType('LoadDataRequest', (_message.Message,), dict( + DESCRIPTOR = _LOADDATAREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.LoadDataRequest) + )) +_sym_db.RegisterMessage(LoadDataRequest) + +LoadDataResponse = _reflection.GeneratedProtocolMessageType('LoadDataResponse', (_message.Message,), dict( + DESCRIPTOR = _LOADDATARESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.LoadDataResponse) + )) +_sym_db.RegisterMessage(LoadDataResponse) + +GetShapeRequest = _reflection.GeneratedProtocolMessageType('GetShapeRequest', (_message.Message,), dict( + DESCRIPTOR = _GETSHAPEREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.GetShapeRequest) + )) +_sym_db.RegisterMessage(GetShapeRequest) + +GetShapeResponse = _reflection.GeneratedProtocolMessageType('GetShapeResponse', (_message.Message,), dict( + DESCRIPTOR = _GETSHAPERESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.GetShapeResponse) + )) +_sym_db.RegisterMessage(GetShapeResponse) + +UnpackRequest = _reflection.GeneratedProtocolMessageType('UnpackRequest', (_message.Message,), dict( + DESCRIPTOR = _UNPACKREQUEST, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.UnpackRequest) + )) +_sym_db.RegisterMessage(UnpackRequest) + +UnpackResponse = _reflection.GeneratedProtocolMessageType('UnpackResponse', (_message.Message,), dict( + DESCRIPTOR = _UNPACKRESPONSE, + __module__ = 'diplomacy_tensorflow.compiler.xla.xla_pb2' + # @@protoc_insertion_point(class_scope:xla.UnpackResponse) + )) +_sym_db.RegisterMessage(UnpackResponse) + + +_DEBUGOPTIONS_XLABACKENDEXTRAOPTIONSENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.pb.cc new file mode 100644 index 0000000..c4d935a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.pb.cc @@ -0,0 +1,2991 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xrt/xrt.proto + +#include "diplomacy_tensorflow/compiler/xrt/xrt.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HostComputeMetadata; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_HloSnapshot; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_DebugOptions; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LiteralProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ProgramShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_XLATupleNode; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DeviceAssignment; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DeviceAssignment_ComputationDevice; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_XLAComputationConfig; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto +namespace xrt { +class DeviceAssignment_ComputationDevice_DeviceMeshCoordinatesDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceAssignment_ComputationDevice_DeviceMeshCoordinates_default_instance_; +class DeviceAssignment_ComputationDeviceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceAssignment_ComputationDevice_default_instance_; +class DeviceAssignmentDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceAssignment_default_instance_; +class XLAComputationConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _XLAComputationConfig_default_instance_; +class XLAComputationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _XLAComputation_default_instance_; +class XLAAllocationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _XLAAllocation_default_instance_; +class XLATupleNodeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _XLATupleNode_default_instance_; +class XRTExecutionConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _XRTExecutionConfig_default_instance_; +} // namespace xrt +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto { +static void InitDefaultsDeviceAssignment_ComputationDevice_DeviceMeshCoordinates() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates_default_instance_; + new (ptr) ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDeviceAssignment_ComputationDevice_DeviceMeshCoordinates}, {}}; + +static void InitDefaultsDeviceAssignment_ComputationDevice() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_DeviceAssignment_ComputationDevice_default_instance_; + new (ptr) ::xrt::DeviceAssignment_ComputationDevice(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::DeviceAssignment_ComputationDevice::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeviceAssignment_ComputationDevice = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeviceAssignment_ComputationDevice}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates.base,}}; + +static void InitDefaultsDeviceAssignment() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_DeviceAssignment_default_instance_; + new (ptr) ::xrt::DeviceAssignment(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::DeviceAssignment::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeviceAssignment = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeviceAssignment}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment_ComputationDevice.base,}}; + +static void InitDefaultsXLAComputationConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_XLAComputationConfig_default_instance_; + new (ptr) ::xrt::XLAComputationConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::XLAComputationConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_XLAComputationConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsXLAComputationConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::scc_info_HostComputeMetadata.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_ProgramShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::scc_info_DebugOptions.base,}}; + +static void InitDefaultsXLAComputation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_XLAComputation_default_instance_; + new (ptr) ::xrt::XLAComputation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::XLAComputation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_XLAComputation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsXLAComputation}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLAComputationConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloSnapshot.base,}}; + +static void InitDefaultsXLAAllocation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_XLAAllocation_default_instance_; + new (ptr) ::xrt::XLAAllocation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::XLAAllocation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_XLAAllocation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsXLAAllocation}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::scc_info_LiteralProto.base,}}; + +static void InitDefaultsXLATupleNode() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_XLATupleNode_default_instance_; + new (ptr) ::xrt::XLATupleNode(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::XLATupleNode::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_XLATupleNode = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsXLATupleNode}, {}}; + +static void InitDefaultsXRTExecutionConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::xrt::_XRTExecutionConfig_default_instance_; + new (ptr) ::xrt::XRTExecutionConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::xrt::XRTExecutionConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_XRTExecutionConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsXRTExecutionConfig}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceAssignment_ComputationDevice.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceAssignment.base); + ::google::protobuf::internal::InitSCC(&scc_info_XLAComputationConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_XLAComputation.base); + ::google::protobuf::internal::InitSCC(&scc_info_XLAAllocation.base); + ::google::protobuf::internal::InitSCC(&scc_info_XLATupleNode.base); + ::google::protobuf::internal::InitSCC(&scc_info_XRTExecutionConfig.base); +} + +::google::protobuf::Metadata file_level_metadata[8]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::DeviceAssignment_ComputationDevice, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::DeviceAssignment_ComputationDevice, replica_devices_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::DeviceAssignment, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::DeviceAssignment, computation_devices_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, num_replicas_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, num_cores_per_replica_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, host_compute_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, program_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, per_core_program_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, device_assignment_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputationConfig, debug_options_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputation, config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAComputation, hlo_snapshot_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAAllocation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAAllocation, device_ordinal_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLAAllocation, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLATupleNode, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLATupleNode, input_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLATupleNode, release_input_handle_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XLATupleNode, tuples_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, device_ordinal_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, core_index_in_replica_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, execution_instance_key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, rng_seed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, release_input_handles_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, release_compilation_handle_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::xrt::XRTExecutionConfig, return_exploded_tuple_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates)}, + { 6, -1, sizeof(::xrt::DeviceAssignment_ComputationDevice)}, + { 12, -1, sizeof(::xrt::DeviceAssignment)}, + { 18, -1, sizeof(::xrt::XLAComputationConfig)}, + { 30, -1, sizeof(::xrt::XLAComputation)}, + { 37, -1, sizeof(::xrt::XLAAllocation)}, + { 44, -1, sizeof(::xrt::XLATupleNode)}, + { 52, -1, sizeof(::xrt::XRTExecutionConfig)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::xrt::_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates_default_instance_), + reinterpret_cast(&::xrt::_DeviceAssignment_ComputationDevice_default_instance_), + reinterpret_cast(&::xrt::_DeviceAssignment_default_instance_), + reinterpret_cast(&::xrt::_XLAComputationConfig_default_instance_), + reinterpret_cast(&::xrt::_XLAComputation_default_instance_), + reinterpret_cast(&::xrt::_XLAAllocation_default_instance_), + reinterpret_cast(&::xrt::_XLATupleNode_default_instance_), + reinterpret_cast(&::xrt::_XRTExecutionConfig_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/compiler/xrt/xrt.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 8); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n+diplomacy_tensorflow/compiler/xrt/xrt." + "proto\022\003xrt\032@diplomacy_tensorflow/compile" + "r/tf2xla/host_compute_metadata.proto\032+di" + "plomacy_tensorflow/compiler/xla/xla.prot" + "o\0320diplomacy_tensorflow/compiler/xla/xla" + "_data.proto\0323diplomacy_tensorflow/compil" + "er/xla/service/hlo.proto\"\356\001\n\020DeviceAssig" + "nment\022D\n\023computation_devices\030\001 \003(\0132\'.xrt" + ".DeviceAssignment.ComputationDevice\032\223\001\n\021" + "ComputationDevice\022V\n\017replica_devices\030\001 \003" + "(\0132=.xrt.DeviceAssignment.ComputationDev" + "ice.DeviceMeshCoordinates\032&\n\025DeviceMeshC" + "oordinates\022\r\n\005value\030\001 \003(\005\"\337\002\n\024XLAComputa" + "tionConfig\022\024\n\014num_replicas\030\001 \001(\005\022\035\n\025num_" + "cores_per_replica\030\002 \001(\005\022O\n\025host_compute_" + "metadata\030\003 \001(\01320.diplomacy.tensorflow.tf" + "2xla.HostComputeMetadata\022-\n\rprogram_shap" + "e\030\004 \001(\0132\026.xla.ProgramShapeProto\0226\n\026per_c" + "ore_program_shape\030\005 \003(\0132\026.xla.ProgramSha" + "peProto\0220\n\021device_assignment\030\006 \001(\0132\025.xrt" + ".DeviceAssignment\022(\n\rdebug_options\030\007 \001(\013" + "2\021.xla.DebugOptions\"c\n\016XLAComputation\022)\n" + "\006config\030\001 \001(\0132\031.xrt.XLAComputationConfig" + "\022&\n\014hlo_snapshot\030\002 \001(\0132\020.xla.HloSnapshot" + "\"I\n\rXLAAllocation\022\026\n\016device_ordinal\030\001 \001(" + "\005\022 \n\005value\030\002 \001(\0132\021.xla.LiteralProto\"d\n\014X" + "LATupleNode\022\023\n\013input_index\030\001 \001(\005\022\034\n\024rele" + "ase_input_handle\030\002 \001(\010\022!\n\006tuples\030\003 \003(\0132\021" + ".xrt.XLATupleNode\"\337\001\n\022XRTExecutionConfig" + "\022\026\n\016device_ordinal\030\001 \001(\005\022\035\n\025core_index_i" + "n_replica\030\002 \001(\005\022\036\n\026execution_instance_ke" + "y\030\003 \001(\t\022\020\n\010rng_seed\030\004 \001(\r\022\035\n\025release_inp" + "ut_handles\030\005 \001(\010\022\"\n\032release_compilation_" + "handle\030\006 \001(\010\022\035\n\025return_exploded_tuple\030\007 " + "\001(\010b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1371); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/compiler/xrt/xrt.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2ftf2xla_2fhost_5fcompute_5fmetadata_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fxla_5fdata_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto +namespace xrt { + +// =================================================================== + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) +} +DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates(const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::SharedCtor() { +} + +DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::~DeviceAssignment_ComputationDevice_DeviceMeshCoordinates() { + // @@protoc_insertion_point(destructor:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + SharedDtor(); +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::SharedDtor() { +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates.base); + return *internal_default_instance(); +} + + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + return false; +#undef DO_ +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 value = 1; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + } + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) +} + +::google::protobuf::uint8* DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 value = 1; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + return target; +} + +size_t DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 value = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->value_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + GOOGLE_DCHECK_NE(&from, this); + const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + MergeFrom(*source); + } +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::MergeFrom(const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::CopyFrom(const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::IsInitialized() const { + return true; +} + +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::Swap(DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* other) { + if (other == this) return; + InternalSwap(other); +} +void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::InternalSwap(DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceAssignment_ComputationDevice::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceAssignment_ComputationDevice::kReplicaDevicesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceAssignment_ComputationDevice::DeviceAssignment_ComputationDevice() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment_ComputationDevice.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.DeviceAssignment.ComputationDevice) +} +DeviceAssignment_ComputationDevice::DeviceAssignment_ComputationDevice(const DeviceAssignment_ComputationDevice& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + replica_devices_(from.replica_devices_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xrt.DeviceAssignment.ComputationDevice) +} + +void DeviceAssignment_ComputationDevice::SharedCtor() { +} + +DeviceAssignment_ComputationDevice::~DeviceAssignment_ComputationDevice() { + // @@protoc_insertion_point(destructor:xrt.DeviceAssignment.ComputationDevice) + SharedDtor(); +} + +void DeviceAssignment_ComputationDevice::SharedDtor() { +} + +void DeviceAssignment_ComputationDevice::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceAssignment_ComputationDevice::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceAssignment_ComputationDevice& DeviceAssignment_ComputationDevice::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment_ComputationDevice.base); + return *internal_default_instance(); +} + + +void DeviceAssignment_ComputationDevice::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.DeviceAssignment.ComputationDevice) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + replica_devices_.Clear(); + _internal_metadata_.Clear(); +} + +bool DeviceAssignment_ComputationDevice::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.DeviceAssignment.ComputationDevice) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates replica_devices = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_replica_devices())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.DeviceAssignment.ComputationDevice) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.DeviceAssignment.ComputationDevice) + return false; +#undef DO_ +} + +void DeviceAssignment_ComputationDevice::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.DeviceAssignment.ComputationDevice) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates replica_devices = 1; + for (unsigned int i = 0, + n = static_cast(this->replica_devices_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->replica_devices(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.DeviceAssignment.ComputationDevice) +} + +::google::protobuf::uint8* DeviceAssignment_ComputationDevice::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.DeviceAssignment.ComputationDevice) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates replica_devices = 1; + for (unsigned int i = 0, + n = static_cast(this->replica_devices_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->replica_devices(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.DeviceAssignment.ComputationDevice) + return target; +} + +size_t DeviceAssignment_ComputationDevice::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.DeviceAssignment.ComputationDevice) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates replica_devices = 1; + { + unsigned int count = static_cast(this->replica_devices_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->replica_devices(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceAssignment_ComputationDevice::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.DeviceAssignment.ComputationDevice) + GOOGLE_DCHECK_NE(&from, this); + const DeviceAssignment_ComputationDevice* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.DeviceAssignment.ComputationDevice) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.DeviceAssignment.ComputationDevice) + MergeFrom(*source); + } +} + +void DeviceAssignment_ComputationDevice::MergeFrom(const DeviceAssignment_ComputationDevice& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.DeviceAssignment.ComputationDevice) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + replica_devices_.MergeFrom(from.replica_devices_); +} + +void DeviceAssignment_ComputationDevice::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.DeviceAssignment.ComputationDevice) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceAssignment_ComputationDevice::CopyFrom(const DeviceAssignment_ComputationDevice& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.DeviceAssignment.ComputationDevice) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceAssignment_ComputationDevice::IsInitialized() const { + return true; +} + +void DeviceAssignment_ComputationDevice::Swap(DeviceAssignment_ComputationDevice* other) { + if (other == this) return; + InternalSwap(other); +} +void DeviceAssignment_ComputationDevice::InternalSwap(DeviceAssignment_ComputationDevice* other) { + using std::swap; + CastToBase(&replica_devices_)->InternalSwap(CastToBase(&other->replica_devices_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceAssignment_ComputationDevice::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceAssignment::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceAssignment::kComputationDevicesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceAssignment::DeviceAssignment() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.DeviceAssignment) +} +DeviceAssignment::DeviceAssignment(const DeviceAssignment& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + computation_devices_(from.computation_devices_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:xrt.DeviceAssignment) +} + +void DeviceAssignment::SharedCtor() { +} + +DeviceAssignment::~DeviceAssignment() { + // @@protoc_insertion_point(destructor:xrt.DeviceAssignment) + SharedDtor(); +} + +void DeviceAssignment::SharedDtor() { +} + +void DeviceAssignment::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceAssignment::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceAssignment& DeviceAssignment::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_DeviceAssignment.base); + return *internal_default_instance(); +} + + +void DeviceAssignment::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.DeviceAssignment) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + computation_devices_.Clear(); + _internal_metadata_.Clear(); +} + +bool DeviceAssignment::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.DeviceAssignment) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .xrt.DeviceAssignment.ComputationDevice computation_devices = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_computation_devices())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.DeviceAssignment) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.DeviceAssignment) + return false; +#undef DO_ +} + +void DeviceAssignment::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.DeviceAssignment) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xrt.DeviceAssignment.ComputationDevice computation_devices = 1; + for (unsigned int i = 0, + n = static_cast(this->computation_devices_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->computation_devices(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.DeviceAssignment) +} + +::google::protobuf::uint8* DeviceAssignment::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.DeviceAssignment) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .xrt.DeviceAssignment.ComputationDevice computation_devices = 1; + for (unsigned int i = 0, + n = static_cast(this->computation_devices_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->computation_devices(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.DeviceAssignment) + return target; +} + +size_t DeviceAssignment::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.DeviceAssignment) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xrt.DeviceAssignment.ComputationDevice computation_devices = 1; + { + unsigned int count = static_cast(this->computation_devices_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->computation_devices(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceAssignment::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.DeviceAssignment) + GOOGLE_DCHECK_NE(&from, this); + const DeviceAssignment* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.DeviceAssignment) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.DeviceAssignment) + MergeFrom(*source); + } +} + +void DeviceAssignment::MergeFrom(const DeviceAssignment& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.DeviceAssignment) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + computation_devices_.MergeFrom(from.computation_devices_); +} + +void DeviceAssignment::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.DeviceAssignment) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceAssignment::CopyFrom(const DeviceAssignment& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.DeviceAssignment) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceAssignment::IsInitialized() const { + return true; +} + +void DeviceAssignment::Swap(DeviceAssignment* other) { + if (other == this) return; + InternalSwap(other); +} +void DeviceAssignment::InternalSwap(DeviceAssignment* other) { + using std::swap; + CastToBase(&computation_devices_)->InternalSwap(CastToBase(&other->computation_devices_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceAssignment::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void XLAComputationConfig::InitAsDefaultInstance() { + ::xrt::_XLAComputationConfig_default_instance_._instance.get_mutable()->host_compute_metadata_ = const_cast< ::diplomacy::tensorflow::tf2xla::HostComputeMetadata*>( + ::diplomacy::tensorflow::tf2xla::HostComputeMetadata::internal_default_instance()); + ::xrt::_XLAComputationConfig_default_instance_._instance.get_mutable()->program_shape_ = const_cast< ::xla::ProgramShapeProto*>( + ::xla::ProgramShapeProto::internal_default_instance()); + ::xrt::_XLAComputationConfig_default_instance_._instance.get_mutable()->device_assignment_ = const_cast< ::xrt::DeviceAssignment*>( + ::xrt::DeviceAssignment::internal_default_instance()); + ::xrt::_XLAComputationConfig_default_instance_._instance.get_mutable()->debug_options_ = const_cast< ::xla::DebugOptions*>( + ::xla::DebugOptions::internal_default_instance()); +} +void XLAComputationConfig::clear_host_compute_metadata() { + if (GetArenaNoVirtual() == NULL && host_compute_metadata_ != NULL) { + delete host_compute_metadata_; + } + host_compute_metadata_ = NULL; +} +void XLAComputationConfig::clear_program_shape() { + if (GetArenaNoVirtual() == NULL && program_shape_ != NULL) { + delete program_shape_; + } + program_shape_ = NULL; +} +void XLAComputationConfig::clear_per_core_program_shape() { + per_core_program_shape_.Clear(); +} +void XLAComputationConfig::clear_debug_options() { + if (GetArenaNoVirtual() == NULL && debug_options_ != NULL) { + delete debug_options_; + } + debug_options_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int XLAComputationConfig::kNumReplicasFieldNumber; +const int XLAComputationConfig::kNumCoresPerReplicaFieldNumber; +const int XLAComputationConfig::kHostComputeMetadataFieldNumber; +const int XLAComputationConfig::kProgramShapeFieldNumber; +const int XLAComputationConfig::kPerCoreProgramShapeFieldNumber; +const int XLAComputationConfig::kDeviceAssignmentFieldNumber; +const int XLAComputationConfig::kDebugOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +XLAComputationConfig::XLAComputationConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLAComputationConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.XLAComputationConfig) +} +XLAComputationConfig::XLAComputationConfig(const XLAComputationConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + per_core_program_shape_(from.per_core_program_shape_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_host_compute_metadata()) { + host_compute_metadata_ = new ::diplomacy::tensorflow::tf2xla::HostComputeMetadata(*from.host_compute_metadata_); + } else { + host_compute_metadata_ = NULL; + } + if (from.has_program_shape()) { + program_shape_ = new ::xla::ProgramShapeProto(*from.program_shape_); + } else { + program_shape_ = NULL; + } + if (from.has_device_assignment()) { + device_assignment_ = new ::xrt::DeviceAssignment(*from.device_assignment_); + } else { + device_assignment_ = NULL; + } + if (from.has_debug_options()) { + debug_options_ = new ::xla::DebugOptions(*from.debug_options_); + } else { + debug_options_ = NULL; + } + ::memcpy(&num_replicas_, &from.num_replicas_, + static_cast(reinterpret_cast(&num_cores_per_replica_) - + reinterpret_cast(&num_replicas_)) + sizeof(num_cores_per_replica_)); + // @@protoc_insertion_point(copy_constructor:xrt.XLAComputationConfig) +} + +void XLAComputationConfig::SharedCtor() { + ::memset(&host_compute_metadata_, 0, static_cast( + reinterpret_cast(&num_cores_per_replica_) - + reinterpret_cast(&host_compute_metadata_)) + sizeof(num_cores_per_replica_)); +} + +XLAComputationConfig::~XLAComputationConfig() { + // @@protoc_insertion_point(destructor:xrt.XLAComputationConfig) + SharedDtor(); +} + +void XLAComputationConfig::SharedDtor() { + if (this != internal_default_instance()) delete host_compute_metadata_; + if (this != internal_default_instance()) delete program_shape_; + if (this != internal_default_instance()) delete device_assignment_; + if (this != internal_default_instance()) delete debug_options_; +} + +void XLAComputationConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* XLAComputationConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const XLAComputationConfig& XLAComputationConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLAComputationConfig.base); + return *internal_default_instance(); +} + + +void XLAComputationConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.XLAComputationConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + per_core_program_shape_.Clear(); + if (GetArenaNoVirtual() == NULL && host_compute_metadata_ != NULL) { + delete host_compute_metadata_; + } + host_compute_metadata_ = NULL; + if (GetArenaNoVirtual() == NULL && program_shape_ != NULL) { + delete program_shape_; + } + program_shape_ = NULL; + if (GetArenaNoVirtual() == NULL && device_assignment_ != NULL) { + delete device_assignment_; + } + device_assignment_ = NULL; + if (GetArenaNoVirtual() == NULL && debug_options_ != NULL) { + delete debug_options_; + } + debug_options_ = NULL; + ::memset(&num_replicas_, 0, static_cast( + reinterpret_cast(&num_cores_per_replica_) - + reinterpret_cast(&num_replicas_)) + sizeof(num_cores_per_replica_)); + _internal_metadata_.Clear(); +} + +bool XLAComputationConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.XLAComputationConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 num_replicas = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_replicas_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_cores_per_replica = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_cores_per_replica_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tf2xla.HostComputeMetadata host_compute_metadata = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_host_compute_metadata())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.ProgramShapeProto program_shape = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_program_shape())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.ProgramShapeProto per_core_program_shape = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_per_core_program_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .xrt.DeviceAssignment device_assignment = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_device_assignment())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.DebugOptions debug_options = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_debug_options())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.XLAComputationConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.XLAComputationConfig) + return false; +#undef DO_ +} + +void XLAComputationConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.XLAComputationConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_replicas = 1; + if (this->num_replicas() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->num_replicas(), output); + } + + // int32 num_cores_per_replica = 2; + if (this->num_cores_per_replica() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_cores_per_replica(), output); + } + + // .diplomacy.tensorflow.tf2xla.HostComputeMetadata host_compute_metadata = 3; + if (this->has_host_compute_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_host_compute_metadata(), output); + } + + // .xla.ProgramShapeProto program_shape = 4; + if (this->has_program_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_program_shape(), output); + } + + // repeated .xla.ProgramShapeProto per_core_program_shape = 5; + for (unsigned int i = 0, + n = static_cast(this->per_core_program_shape_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, + this->per_core_program_shape(static_cast(i)), + output); + } + + // .xrt.DeviceAssignment device_assignment = 6; + if (this->has_device_assignment()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_device_assignment(), output); + } + + // .xla.DebugOptions debug_options = 7; + if (this->has_debug_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->_internal_debug_options(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.XLAComputationConfig) +} + +::google::protobuf::uint8* XLAComputationConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.XLAComputationConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_replicas = 1; + if (this->num_replicas() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->num_replicas(), target); + } + + // int32 num_cores_per_replica = 2; + if (this->num_cores_per_replica() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_cores_per_replica(), target); + } + + // .diplomacy.tensorflow.tf2xla.HostComputeMetadata host_compute_metadata = 3; + if (this->has_host_compute_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_host_compute_metadata(), deterministic, target); + } + + // .xla.ProgramShapeProto program_shape = 4; + if (this->has_program_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_program_shape(), deterministic, target); + } + + // repeated .xla.ProgramShapeProto per_core_program_shape = 5; + for (unsigned int i = 0, + n = static_cast(this->per_core_program_shape_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->per_core_program_shape(static_cast(i)), deterministic, target); + } + + // .xrt.DeviceAssignment device_assignment = 6; + if (this->has_device_assignment()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_device_assignment(), deterministic, target); + } + + // .xla.DebugOptions debug_options = 7; + if (this->has_debug_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->_internal_debug_options(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.XLAComputationConfig) + return target; +} + +size_t XLAComputationConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.XLAComputationConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.ProgramShapeProto per_core_program_shape = 5; + { + unsigned int count = static_cast(this->per_core_program_shape_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->per_core_program_shape(static_cast(i))); + } + } + + // .diplomacy.tensorflow.tf2xla.HostComputeMetadata host_compute_metadata = 3; + if (this->has_host_compute_metadata()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *host_compute_metadata_); + } + + // .xla.ProgramShapeProto program_shape = 4; + if (this->has_program_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *program_shape_); + } + + // .xrt.DeviceAssignment device_assignment = 6; + if (this->has_device_assignment()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *device_assignment_); + } + + // .xla.DebugOptions debug_options = 7; + if (this->has_debug_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *debug_options_); + } + + // int32 num_replicas = 1; + if (this->num_replicas() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_replicas()); + } + + // int32 num_cores_per_replica = 2; + if (this->num_cores_per_replica() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_cores_per_replica()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void XLAComputationConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.XLAComputationConfig) + GOOGLE_DCHECK_NE(&from, this); + const XLAComputationConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.XLAComputationConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.XLAComputationConfig) + MergeFrom(*source); + } +} + +void XLAComputationConfig::MergeFrom(const XLAComputationConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.XLAComputationConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + per_core_program_shape_.MergeFrom(from.per_core_program_shape_); + if (from.has_host_compute_metadata()) { + mutable_host_compute_metadata()->::diplomacy::tensorflow::tf2xla::HostComputeMetadata::MergeFrom(from.host_compute_metadata()); + } + if (from.has_program_shape()) { + mutable_program_shape()->::xla::ProgramShapeProto::MergeFrom(from.program_shape()); + } + if (from.has_device_assignment()) { + mutable_device_assignment()->::xrt::DeviceAssignment::MergeFrom(from.device_assignment()); + } + if (from.has_debug_options()) { + mutable_debug_options()->::xla::DebugOptions::MergeFrom(from.debug_options()); + } + if (from.num_replicas() != 0) { + set_num_replicas(from.num_replicas()); + } + if (from.num_cores_per_replica() != 0) { + set_num_cores_per_replica(from.num_cores_per_replica()); + } +} + +void XLAComputationConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.XLAComputationConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void XLAComputationConfig::CopyFrom(const XLAComputationConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.XLAComputationConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool XLAComputationConfig::IsInitialized() const { + return true; +} + +void XLAComputationConfig::Swap(XLAComputationConfig* other) { + if (other == this) return; + InternalSwap(other); +} +void XLAComputationConfig::InternalSwap(XLAComputationConfig* other) { + using std::swap; + CastToBase(&per_core_program_shape_)->InternalSwap(CastToBase(&other->per_core_program_shape_)); + swap(host_compute_metadata_, other->host_compute_metadata_); + swap(program_shape_, other->program_shape_); + swap(device_assignment_, other->device_assignment_); + swap(debug_options_, other->debug_options_); + swap(num_replicas_, other->num_replicas_); + swap(num_cores_per_replica_, other->num_cores_per_replica_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata XLAComputationConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void XLAComputation::InitAsDefaultInstance() { + ::xrt::_XLAComputation_default_instance_._instance.get_mutable()->config_ = const_cast< ::xrt::XLAComputationConfig*>( + ::xrt::XLAComputationConfig::internal_default_instance()); + ::xrt::_XLAComputation_default_instance_._instance.get_mutable()->hlo_snapshot_ = const_cast< ::xla::HloSnapshot*>( + ::xla::HloSnapshot::internal_default_instance()); +} +void XLAComputation::clear_hlo_snapshot() { + if (GetArenaNoVirtual() == NULL && hlo_snapshot_ != NULL) { + delete hlo_snapshot_; + } + hlo_snapshot_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int XLAComputation::kConfigFieldNumber; +const int XLAComputation::kHloSnapshotFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +XLAComputation::XLAComputation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLAComputation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.XLAComputation) +} +XLAComputation::XLAComputation(const XLAComputation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_config()) { + config_ = new ::xrt::XLAComputationConfig(*from.config_); + } else { + config_ = NULL; + } + if (from.has_hlo_snapshot()) { + hlo_snapshot_ = new ::xla::HloSnapshot(*from.hlo_snapshot_); + } else { + hlo_snapshot_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:xrt.XLAComputation) +} + +void XLAComputation::SharedCtor() { + ::memset(&config_, 0, static_cast( + reinterpret_cast(&hlo_snapshot_) - + reinterpret_cast(&config_)) + sizeof(hlo_snapshot_)); +} + +XLAComputation::~XLAComputation() { + // @@protoc_insertion_point(destructor:xrt.XLAComputation) + SharedDtor(); +} + +void XLAComputation::SharedDtor() { + if (this != internal_default_instance()) delete config_; + if (this != internal_default_instance()) delete hlo_snapshot_; +} + +void XLAComputation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* XLAComputation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const XLAComputation& XLAComputation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLAComputation.base); + return *internal_default_instance(); +} + + +void XLAComputation::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.XLAComputation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && config_ != NULL) { + delete config_; + } + config_ = NULL; + if (GetArenaNoVirtual() == NULL && hlo_snapshot_ != NULL) { + delete hlo_snapshot_; + } + hlo_snapshot_ = NULL; + _internal_metadata_.Clear(); +} + +bool XLAComputation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.XLAComputation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .xrt.XLAComputationConfig config = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_config())); + } else { + goto handle_unusual; + } + break; + } + + // .xla.HloSnapshot hlo_snapshot = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_hlo_snapshot())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.XLAComputation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.XLAComputation) + return false; +#undef DO_ +} + +void XLAComputation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.XLAComputation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xrt.XLAComputationConfig config = 1; + if (this->has_config()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_config(), output); + } + + // .xla.HloSnapshot hlo_snapshot = 2; + if (this->has_hlo_snapshot()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_hlo_snapshot(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.XLAComputation) +} + +::google::protobuf::uint8* XLAComputation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.XLAComputation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .xrt.XLAComputationConfig config = 1; + if (this->has_config()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_config(), deterministic, target); + } + + // .xla.HloSnapshot hlo_snapshot = 2; + if (this->has_hlo_snapshot()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_hlo_snapshot(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.XLAComputation) + return target; +} + +size_t XLAComputation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.XLAComputation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xrt.XLAComputationConfig config = 1; + if (this->has_config()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *config_); + } + + // .xla.HloSnapshot hlo_snapshot = 2; + if (this->has_hlo_snapshot()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *hlo_snapshot_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void XLAComputation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.XLAComputation) + GOOGLE_DCHECK_NE(&from, this); + const XLAComputation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.XLAComputation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.XLAComputation) + MergeFrom(*source); + } +} + +void XLAComputation::MergeFrom(const XLAComputation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.XLAComputation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_config()) { + mutable_config()->::xrt::XLAComputationConfig::MergeFrom(from.config()); + } + if (from.has_hlo_snapshot()) { + mutable_hlo_snapshot()->::xla::HloSnapshot::MergeFrom(from.hlo_snapshot()); + } +} + +void XLAComputation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.XLAComputation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void XLAComputation::CopyFrom(const XLAComputation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.XLAComputation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool XLAComputation::IsInitialized() const { + return true; +} + +void XLAComputation::Swap(XLAComputation* other) { + if (other == this) return; + InternalSwap(other); +} +void XLAComputation::InternalSwap(XLAComputation* other) { + using std::swap; + swap(config_, other->config_); + swap(hlo_snapshot_, other->hlo_snapshot_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata XLAComputation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void XLAAllocation::InitAsDefaultInstance() { + ::xrt::_XLAAllocation_default_instance_._instance.get_mutable()->value_ = const_cast< ::xla::LiteralProto*>( + ::xla::LiteralProto::internal_default_instance()); +} +void XLAAllocation::clear_value() { + if (GetArenaNoVirtual() == NULL && value_ != NULL) { + delete value_; + } + value_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int XLAAllocation::kDeviceOrdinalFieldNumber; +const int XLAAllocation::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +XLAAllocation::XLAAllocation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLAAllocation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.XLAAllocation) +} +XLAAllocation::XLAAllocation(const XLAAllocation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_value()) { + value_ = new ::xla::LiteralProto(*from.value_); + } else { + value_ = NULL; + } + device_ordinal_ = from.device_ordinal_; + // @@protoc_insertion_point(copy_constructor:xrt.XLAAllocation) +} + +void XLAAllocation::SharedCtor() { + ::memset(&value_, 0, static_cast( + reinterpret_cast(&device_ordinal_) - + reinterpret_cast(&value_)) + sizeof(device_ordinal_)); +} + +XLAAllocation::~XLAAllocation() { + // @@protoc_insertion_point(destructor:xrt.XLAAllocation) + SharedDtor(); +} + +void XLAAllocation::SharedDtor() { + if (this != internal_default_instance()) delete value_; +} + +void XLAAllocation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* XLAAllocation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const XLAAllocation& XLAAllocation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLAAllocation.base); + return *internal_default_instance(); +} + + +void XLAAllocation::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.XLAAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && value_ != NULL) { + delete value_; + } + value_ = NULL; + device_ordinal_ = 0; + _internal_metadata_.Clear(); +} + +bool XLAAllocation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.XLAAllocation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 device_ordinal = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_ordinal_))); + } else { + goto handle_unusual; + } + break; + } + + // .xla.LiteralProto value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.XLAAllocation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.XLAAllocation) + return false; +#undef DO_ +} + +void XLAAllocation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.XLAAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 device_ordinal = 1; + if (this->device_ordinal() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->device_ordinal(), output); + } + + // .xla.LiteralProto value = 2; + if (this->has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_value(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.XLAAllocation) +} + +::google::protobuf::uint8* XLAAllocation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.XLAAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 device_ordinal = 1; + if (this->device_ordinal() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->device_ordinal(), target); + } + + // .xla.LiteralProto value = 2; + if (this->has_value()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_value(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.XLAAllocation) + return target; +} + +size_t XLAAllocation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.XLAAllocation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .xla.LiteralProto value = 2; + if (this->has_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_); + } + + // int32 device_ordinal = 1; + if (this->device_ordinal() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->device_ordinal()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void XLAAllocation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.XLAAllocation) + GOOGLE_DCHECK_NE(&from, this); + const XLAAllocation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.XLAAllocation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.XLAAllocation) + MergeFrom(*source); + } +} + +void XLAAllocation::MergeFrom(const XLAAllocation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.XLAAllocation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_value()) { + mutable_value()->::xla::LiteralProto::MergeFrom(from.value()); + } + if (from.device_ordinal() != 0) { + set_device_ordinal(from.device_ordinal()); + } +} + +void XLAAllocation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.XLAAllocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void XLAAllocation::CopyFrom(const XLAAllocation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.XLAAllocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool XLAAllocation::IsInitialized() const { + return true; +} + +void XLAAllocation::Swap(XLAAllocation* other) { + if (other == this) return; + InternalSwap(other); +} +void XLAAllocation::InternalSwap(XLAAllocation* other) { + using std::swap; + swap(value_, other->value_); + swap(device_ordinal_, other->device_ordinal_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata XLAAllocation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void XLATupleNode::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int XLATupleNode::kInputIndexFieldNumber; +const int XLATupleNode::kReleaseInputHandleFieldNumber; +const int XLATupleNode::kTuplesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +XLATupleNode::XLATupleNode() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLATupleNode.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.XLATupleNode) +} +XLATupleNode::XLATupleNode(const XLATupleNode& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + tuples_(from.tuples_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&input_index_, &from.input_index_, + static_cast(reinterpret_cast(&release_input_handle_) - + reinterpret_cast(&input_index_)) + sizeof(release_input_handle_)); + // @@protoc_insertion_point(copy_constructor:xrt.XLATupleNode) +} + +void XLATupleNode::SharedCtor() { + ::memset(&input_index_, 0, static_cast( + reinterpret_cast(&release_input_handle_) - + reinterpret_cast(&input_index_)) + sizeof(release_input_handle_)); +} + +XLATupleNode::~XLATupleNode() { + // @@protoc_insertion_point(destructor:xrt.XLATupleNode) + SharedDtor(); +} + +void XLATupleNode::SharedDtor() { +} + +void XLATupleNode::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* XLATupleNode::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const XLATupleNode& XLATupleNode::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XLATupleNode.base); + return *internal_default_instance(); +} + + +void XLATupleNode::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.XLATupleNode) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tuples_.Clear(); + ::memset(&input_index_, 0, static_cast( + reinterpret_cast(&release_input_handle_) - + reinterpret_cast(&input_index_)) + sizeof(release_input_handle_)); + _internal_metadata_.Clear(); +} + +bool XLATupleNode::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.XLATupleNode) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 input_index = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &input_index_))); + } else { + goto handle_unusual; + } + break; + } + + // bool release_input_handle = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &release_input_handle_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xrt.XLATupleNode tuples = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tuples())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.XLATupleNode) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.XLATupleNode) + return false; +#undef DO_ +} + +void XLATupleNode::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.XLATupleNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 input_index = 1; + if (this->input_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->input_index(), output); + } + + // bool release_input_handle = 2; + if (this->release_input_handle() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->release_input_handle(), output); + } + + // repeated .xrt.XLATupleNode tuples = 3; + for (unsigned int i = 0, + n = static_cast(this->tuples_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->tuples(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.XLATupleNode) +} + +::google::protobuf::uint8* XLATupleNode::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.XLATupleNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 input_index = 1; + if (this->input_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->input_index(), target); + } + + // bool release_input_handle = 2; + if (this->release_input_handle() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->release_input_handle(), target); + } + + // repeated .xrt.XLATupleNode tuples = 3; + for (unsigned int i = 0, + n = static_cast(this->tuples_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->tuples(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.XLATupleNode) + return target; +} + +size_t XLATupleNode::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.XLATupleNode) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xrt.XLATupleNode tuples = 3; + { + unsigned int count = static_cast(this->tuples_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tuples(static_cast(i))); + } + } + + // int32 input_index = 1; + if (this->input_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->input_index()); + } + + // bool release_input_handle = 2; + if (this->release_input_handle() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void XLATupleNode::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.XLATupleNode) + GOOGLE_DCHECK_NE(&from, this); + const XLATupleNode* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.XLATupleNode) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.XLATupleNode) + MergeFrom(*source); + } +} + +void XLATupleNode::MergeFrom(const XLATupleNode& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.XLATupleNode) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + tuples_.MergeFrom(from.tuples_); + if (from.input_index() != 0) { + set_input_index(from.input_index()); + } + if (from.release_input_handle() != 0) { + set_release_input_handle(from.release_input_handle()); + } +} + +void XLATupleNode::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.XLATupleNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void XLATupleNode::CopyFrom(const XLATupleNode& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.XLATupleNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool XLATupleNode::IsInitialized() const { + return true; +} + +void XLATupleNode::Swap(XLATupleNode* other) { + if (other == this) return; + InternalSwap(other); +} +void XLATupleNode::InternalSwap(XLATupleNode* other) { + using std::swap; + CastToBase(&tuples_)->InternalSwap(CastToBase(&other->tuples_)); + swap(input_index_, other->input_index_); + swap(release_input_handle_, other->release_input_handle_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata XLATupleNode::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void XRTExecutionConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int XRTExecutionConfig::kDeviceOrdinalFieldNumber; +const int XRTExecutionConfig::kCoreIndexInReplicaFieldNumber; +const int XRTExecutionConfig::kExecutionInstanceKeyFieldNumber; +const int XRTExecutionConfig::kRngSeedFieldNumber; +const int XRTExecutionConfig::kReleaseInputHandlesFieldNumber; +const int XRTExecutionConfig::kReleaseCompilationHandleFieldNumber; +const int XRTExecutionConfig::kReturnExplodedTupleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +XRTExecutionConfig::XRTExecutionConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XRTExecutionConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:xrt.XRTExecutionConfig) +} +XRTExecutionConfig::XRTExecutionConfig(const XRTExecutionConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + execution_instance_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.execution_instance_key().size() > 0) { + execution_instance_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.execution_instance_key_); + } + ::memcpy(&device_ordinal_, &from.device_ordinal_, + static_cast(reinterpret_cast(&return_exploded_tuple_) - + reinterpret_cast(&device_ordinal_)) + sizeof(return_exploded_tuple_)); + // @@protoc_insertion_point(copy_constructor:xrt.XRTExecutionConfig) +} + +void XRTExecutionConfig::SharedCtor() { + execution_instance_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&device_ordinal_, 0, static_cast( + reinterpret_cast(&return_exploded_tuple_) - + reinterpret_cast(&device_ordinal_)) + sizeof(return_exploded_tuple_)); +} + +XRTExecutionConfig::~XRTExecutionConfig() { + // @@protoc_insertion_point(destructor:xrt.XRTExecutionConfig) + SharedDtor(); +} + +void XRTExecutionConfig::SharedDtor() { + execution_instance_key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void XRTExecutionConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* XRTExecutionConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const XRTExecutionConfig& XRTExecutionConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::scc_info_XRTExecutionConfig.base); + return *internal_default_instance(); +} + + +void XRTExecutionConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:xrt.XRTExecutionConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + execution_instance_key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&device_ordinal_, 0, static_cast( + reinterpret_cast(&return_exploded_tuple_) - + reinterpret_cast(&device_ordinal_)) + sizeof(return_exploded_tuple_)); + _internal_metadata_.Clear(); +} + +bool XRTExecutionConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:xrt.XRTExecutionConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 device_ordinal = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_ordinal_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 core_index_in_replica = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &core_index_in_replica_))); + } else { + goto handle_unusual; + } + break; + } + + // string execution_instance_key = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_execution_instance_key())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->execution_instance_key().data(), static_cast(this->execution_instance_key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "xrt.XRTExecutionConfig.execution_instance_key")); + } else { + goto handle_unusual; + } + break; + } + + // uint32 rng_seed = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rng_seed_))); + } else { + goto handle_unusual; + } + break; + } + + // bool release_input_handles = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &release_input_handles_))); + } else { + goto handle_unusual; + } + break; + } + + // bool release_compilation_handle = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &release_compilation_handle_))); + } else { + goto handle_unusual; + } + break; + } + + // bool return_exploded_tuple = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &return_exploded_tuple_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:xrt.XRTExecutionConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:xrt.XRTExecutionConfig) + return false; +#undef DO_ +} + +void XRTExecutionConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:xrt.XRTExecutionConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 device_ordinal = 1; + if (this->device_ordinal() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->device_ordinal(), output); + } + + // int32 core_index_in_replica = 2; + if (this->core_index_in_replica() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->core_index_in_replica(), output); + } + + // string execution_instance_key = 3; + if (this->execution_instance_key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->execution_instance_key().data(), static_cast(this->execution_instance_key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xrt.XRTExecutionConfig.execution_instance_key"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->execution_instance_key(), output); + } + + // uint32 rng_seed = 4; + if (this->rng_seed() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->rng_seed(), output); + } + + // bool release_input_handles = 5; + if (this->release_input_handles() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->release_input_handles(), output); + } + + // bool release_compilation_handle = 6; + if (this->release_compilation_handle() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->release_compilation_handle(), output); + } + + // bool return_exploded_tuple = 7; + if (this->return_exploded_tuple() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->return_exploded_tuple(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:xrt.XRTExecutionConfig) +} + +::google::protobuf::uint8* XRTExecutionConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:xrt.XRTExecutionConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 device_ordinal = 1; + if (this->device_ordinal() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->device_ordinal(), target); + } + + // int32 core_index_in_replica = 2; + if (this->core_index_in_replica() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->core_index_in_replica(), target); + } + + // string execution_instance_key = 3; + if (this->execution_instance_key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->execution_instance_key().data(), static_cast(this->execution_instance_key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "xrt.XRTExecutionConfig.execution_instance_key"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->execution_instance_key(), target); + } + + // uint32 rng_seed = 4; + if (this->rng_seed() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->rng_seed(), target); + } + + // bool release_input_handles = 5; + if (this->release_input_handles() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->release_input_handles(), target); + } + + // bool release_compilation_handle = 6; + if (this->release_compilation_handle() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->release_compilation_handle(), target); + } + + // bool return_exploded_tuple = 7; + if (this->return_exploded_tuple() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->return_exploded_tuple(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:xrt.XRTExecutionConfig) + return target; +} + +size_t XRTExecutionConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:xrt.XRTExecutionConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string execution_instance_key = 3; + if (this->execution_instance_key().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->execution_instance_key()); + } + + // int32 device_ordinal = 1; + if (this->device_ordinal() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->device_ordinal()); + } + + // int32 core_index_in_replica = 2; + if (this->core_index_in_replica() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->core_index_in_replica()); + } + + // uint32 rng_seed = 4; + if (this->rng_seed() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->rng_seed()); + } + + // bool release_input_handles = 5; + if (this->release_input_handles() != 0) { + total_size += 1 + 1; + } + + // bool release_compilation_handle = 6; + if (this->release_compilation_handle() != 0) { + total_size += 1 + 1; + } + + // bool return_exploded_tuple = 7; + if (this->return_exploded_tuple() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void XRTExecutionConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:xrt.XRTExecutionConfig) + GOOGLE_DCHECK_NE(&from, this); + const XRTExecutionConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:xrt.XRTExecutionConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:xrt.XRTExecutionConfig) + MergeFrom(*source); + } +} + +void XRTExecutionConfig::MergeFrom(const XRTExecutionConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:xrt.XRTExecutionConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.execution_instance_key().size() > 0) { + + execution_instance_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.execution_instance_key_); + } + if (from.device_ordinal() != 0) { + set_device_ordinal(from.device_ordinal()); + } + if (from.core_index_in_replica() != 0) { + set_core_index_in_replica(from.core_index_in_replica()); + } + if (from.rng_seed() != 0) { + set_rng_seed(from.rng_seed()); + } + if (from.release_input_handles() != 0) { + set_release_input_handles(from.release_input_handles()); + } + if (from.release_compilation_handle() != 0) { + set_release_compilation_handle(from.release_compilation_handle()); + } + if (from.return_exploded_tuple() != 0) { + set_return_exploded_tuple(from.return_exploded_tuple()); + } +} + +void XRTExecutionConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:xrt.XRTExecutionConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void XRTExecutionConfig::CopyFrom(const XRTExecutionConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:xrt.XRTExecutionConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool XRTExecutionConfig::IsInitialized() const { + return true; +} + +void XRTExecutionConfig::Swap(XRTExecutionConfig* other) { + if (other == this) return; + InternalSwap(other); +} +void XRTExecutionConfig::InternalSwap(XRTExecutionConfig* other) { + using std::swap; + execution_instance_key_.Swap(&other->execution_instance_key_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(device_ordinal_, other->device_ordinal_); + swap(core_index_in_replica_, other->core_index_in_replica_); + swap(rng_seed_, other->rng_seed_); + swap(release_input_handles_, other->release_input_handles_); + swap(release_compilation_handle_, other->release_compilation_handle_); + swap(return_exploded_tuple_, other->return_exploded_tuple_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata XRTExecutionConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace xrt +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* Arena::CreateMaybeMessage< ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates >(Arena* arena) { + return Arena::CreateInternal< ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::DeviceAssignment_ComputationDevice* Arena::CreateMaybeMessage< ::xrt::DeviceAssignment_ComputationDevice >(Arena* arena) { + return Arena::CreateInternal< ::xrt::DeviceAssignment_ComputationDevice >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::DeviceAssignment* Arena::CreateMaybeMessage< ::xrt::DeviceAssignment >(Arena* arena) { + return Arena::CreateInternal< ::xrt::DeviceAssignment >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::XLAComputationConfig* Arena::CreateMaybeMessage< ::xrt::XLAComputationConfig >(Arena* arena) { + return Arena::CreateInternal< ::xrt::XLAComputationConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::XLAComputation* Arena::CreateMaybeMessage< ::xrt::XLAComputation >(Arena* arena) { + return Arena::CreateInternal< ::xrt::XLAComputation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::XLAAllocation* Arena::CreateMaybeMessage< ::xrt::XLAAllocation >(Arena* arena) { + return Arena::CreateInternal< ::xrt::XLAAllocation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::XLATupleNode* Arena::CreateMaybeMessage< ::xrt::XLATupleNode >(Arena* arena) { + return Arena::CreateInternal< ::xrt::XLATupleNode >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::xrt::XRTExecutionConfig* Arena::CreateMaybeMessage< ::xrt::XRTExecutionConfig >(Arena* arena) { + return Arena::CreateInternal< ::xrt::XRTExecutionConfig >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.pb.h new file mode 100644 index 0000000..5ea7d4e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.pb.h @@ -0,0 +1,1882 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/compiler/xrt/xrt.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.pb.h" +#include "diplomacy_tensorflow/compiler/xla/xla.pb.h" +#include "diplomacy_tensorflow/compiler/xla/xla_data.pb.h" +#include "diplomacy_tensorflow/compiler/xla/service/hlo.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[8]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto +namespace xrt { +class DeviceAssignment; +class DeviceAssignmentDefaultTypeInternal; +extern DeviceAssignmentDefaultTypeInternal _DeviceAssignment_default_instance_; +class DeviceAssignment_ComputationDevice; +class DeviceAssignment_ComputationDeviceDefaultTypeInternal; +extern DeviceAssignment_ComputationDeviceDefaultTypeInternal _DeviceAssignment_ComputationDevice_default_instance_; +class DeviceAssignment_ComputationDevice_DeviceMeshCoordinates; +class DeviceAssignment_ComputationDevice_DeviceMeshCoordinatesDefaultTypeInternal; +extern DeviceAssignment_ComputationDevice_DeviceMeshCoordinatesDefaultTypeInternal _DeviceAssignment_ComputationDevice_DeviceMeshCoordinates_default_instance_; +class XLAAllocation; +class XLAAllocationDefaultTypeInternal; +extern XLAAllocationDefaultTypeInternal _XLAAllocation_default_instance_; +class XLAComputation; +class XLAComputationDefaultTypeInternal; +extern XLAComputationDefaultTypeInternal _XLAComputation_default_instance_; +class XLAComputationConfig; +class XLAComputationConfigDefaultTypeInternal; +extern XLAComputationConfigDefaultTypeInternal _XLAComputationConfig_default_instance_; +class XLATupleNode; +class XLATupleNodeDefaultTypeInternal; +extern XLATupleNodeDefaultTypeInternal _XLATupleNode_default_instance_; +class XRTExecutionConfig; +class XRTExecutionConfigDefaultTypeInternal; +extern XRTExecutionConfigDefaultTypeInternal _XRTExecutionConfig_default_instance_; +} // namespace xrt +namespace google { +namespace protobuf { +template<> ::xrt::DeviceAssignment* Arena::CreateMaybeMessage<::xrt::DeviceAssignment>(Arena*); +template<> ::xrt::DeviceAssignment_ComputationDevice* Arena::CreateMaybeMessage<::xrt::DeviceAssignment_ComputationDevice>(Arena*); +template<> ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* Arena::CreateMaybeMessage<::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates>(Arena*); +template<> ::xrt::XLAAllocation* Arena::CreateMaybeMessage<::xrt::XLAAllocation>(Arena*); +template<> ::xrt::XLAComputation* Arena::CreateMaybeMessage<::xrt::XLAComputation>(Arena*); +template<> ::xrt::XLAComputationConfig* Arena::CreateMaybeMessage<::xrt::XLAComputationConfig>(Arena*); +template<> ::xrt::XLATupleNode* Arena::CreateMaybeMessage<::xrt::XLATupleNode>(Arena*); +template<> ::xrt::XRTExecutionConfig* Arena::CreateMaybeMessage<::xrt::XRTExecutionConfig>(Arena*); +} // namespace protobuf +} // namespace google +namespace xrt { + +// =================================================================== + +class DeviceAssignment_ComputationDevice_DeviceMeshCoordinates : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) */ { + public: + DeviceAssignment_ComputationDevice_DeviceMeshCoordinates(); + virtual ~DeviceAssignment_ComputationDevice_DeviceMeshCoordinates(); + + DeviceAssignment_ComputationDevice_DeviceMeshCoordinates(const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& from); + + inline DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& operator=(const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceAssignment_ComputationDevice_DeviceMeshCoordinates(DeviceAssignment_ComputationDevice_DeviceMeshCoordinates&& from) noexcept + : DeviceAssignment_ComputationDevice_DeviceMeshCoordinates() { + *this = ::std::move(from); + } + + inline DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& operator=(DeviceAssignment_ComputationDevice_DeviceMeshCoordinates&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* internal_default_instance() { + return reinterpret_cast( + &_DeviceAssignment_ComputationDevice_DeviceMeshCoordinates_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* other); + friend void swap(DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& a, DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& from); + void MergeFrom(const DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + ::google::protobuf::int32 value(int index) const; + void set_value(int index, ::google::protobuf::int32 value); + void add_value(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + value() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceAssignment_ComputationDevice : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.DeviceAssignment.ComputationDevice) */ { + public: + DeviceAssignment_ComputationDevice(); + virtual ~DeviceAssignment_ComputationDevice(); + + DeviceAssignment_ComputationDevice(const DeviceAssignment_ComputationDevice& from); + + inline DeviceAssignment_ComputationDevice& operator=(const DeviceAssignment_ComputationDevice& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceAssignment_ComputationDevice(DeviceAssignment_ComputationDevice&& from) noexcept + : DeviceAssignment_ComputationDevice() { + *this = ::std::move(from); + } + + inline DeviceAssignment_ComputationDevice& operator=(DeviceAssignment_ComputationDevice&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceAssignment_ComputationDevice& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceAssignment_ComputationDevice* internal_default_instance() { + return reinterpret_cast( + &_DeviceAssignment_ComputationDevice_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(DeviceAssignment_ComputationDevice* other); + friend void swap(DeviceAssignment_ComputationDevice& a, DeviceAssignment_ComputationDevice& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceAssignment_ComputationDevice* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceAssignment_ComputationDevice* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceAssignment_ComputationDevice& from); + void MergeFrom(const DeviceAssignment_ComputationDevice& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceAssignment_ComputationDevice* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef DeviceAssignment_ComputationDevice_DeviceMeshCoordinates DeviceMeshCoordinates; + + // accessors ------------------------------------------------------- + + // repeated .xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates replica_devices = 1; + int replica_devices_size() const; + void clear_replica_devices(); + static const int kReplicaDevicesFieldNumber = 1; + ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* mutable_replica_devices(int index); + ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates >* + mutable_replica_devices(); + const ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& replica_devices(int index) const; + ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* add_replica_devices(); + const ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates >& + replica_devices() const; + + // @@protoc_insertion_point(class_scope:xrt.DeviceAssignment.ComputationDevice) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates > replica_devices_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceAssignment : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.DeviceAssignment) */ { + public: + DeviceAssignment(); + virtual ~DeviceAssignment(); + + DeviceAssignment(const DeviceAssignment& from); + + inline DeviceAssignment& operator=(const DeviceAssignment& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceAssignment(DeviceAssignment&& from) noexcept + : DeviceAssignment() { + *this = ::std::move(from); + } + + inline DeviceAssignment& operator=(DeviceAssignment&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceAssignment& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceAssignment* internal_default_instance() { + return reinterpret_cast( + &_DeviceAssignment_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(DeviceAssignment* other); + friend void swap(DeviceAssignment& a, DeviceAssignment& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceAssignment* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceAssignment* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceAssignment& from); + void MergeFrom(const DeviceAssignment& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceAssignment* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef DeviceAssignment_ComputationDevice ComputationDevice; + + // accessors ------------------------------------------------------- + + // repeated .xrt.DeviceAssignment.ComputationDevice computation_devices = 1; + int computation_devices_size() const; + void clear_computation_devices(); + static const int kComputationDevicesFieldNumber = 1; + ::xrt::DeviceAssignment_ComputationDevice* mutable_computation_devices(int index); + ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice >* + mutable_computation_devices(); + const ::xrt::DeviceAssignment_ComputationDevice& computation_devices(int index) const; + ::xrt::DeviceAssignment_ComputationDevice* add_computation_devices(); + const ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice >& + computation_devices() const; + + // @@protoc_insertion_point(class_scope:xrt.DeviceAssignment) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice > computation_devices_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class XLAComputationConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.XLAComputationConfig) */ { + public: + XLAComputationConfig(); + virtual ~XLAComputationConfig(); + + XLAComputationConfig(const XLAComputationConfig& from); + + inline XLAComputationConfig& operator=(const XLAComputationConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + XLAComputationConfig(XLAComputationConfig&& from) noexcept + : XLAComputationConfig() { + *this = ::std::move(from); + } + + inline XLAComputationConfig& operator=(XLAComputationConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const XLAComputationConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const XLAComputationConfig* internal_default_instance() { + return reinterpret_cast( + &_XLAComputationConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(XLAComputationConfig* other); + friend void swap(XLAComputationConfig& a, XLAComputationConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline XLAComputationConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + XLAComputationConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const XLAComputationConfig& from); + void MergeFrom(const XLAComputationConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(XLAComputationConfig* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.ProgramShapeProto per_core_program_shape = 5; + int per_core_program_shape_size() const; + void clear_per_core_program_shape(); + static const int kPerCoreProgramShapeFieldNumber = 5; + ::xla::ProgramShapeProto* mutable_per_core_program_shape(int index); + ::google::protobuf::RepeatedPtrField< ::xla::ProgramShapeProto >* + mutable_per_core_program_shape(); + const ::xla::ProgramShapeProto& per_core_program_shape(int index) const; + ::xla::ProgramShapeProto* add_per_core_program_shape(); + const ::google::protobuf::RepeatedPtrField< ::xla::ProgramShapeProto >& + per_core_program_shape() const; + + // .diplomacy.tensorflow.tf2xla.HostComputeMetadata host_compute_metadata = 3; + bool has_host_compute_metadata() const; + void clear_host_compute_metadata(); + static const int kHostComputeMetadataFieldNumber = 3; + private: + const ::diplomacy::tensorflow::tf2xla::HostComputeMetadata& _internal_host_compute_metadata() const; + public: + const ::diplomacy::tensorflow::tf2xla::HostComputeMetadata& host_compute_metadata() const; + ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* release_host_compute_metadata(); + ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* mutable_host_compute_metadata(); + void set_allocated_host_compute_metadata(::diplomacy::tensorflow::tf2xla::HostComputeMetadata* host_compute_metadata); + + // .xla.ProgramShapeProto program_shape = 4; + bool has_program_shape() const; + void clear_program_shape(); + static const int kProgramShapeFieldNumber = 4; + private: + const ::xla::ProgramShapeProto& _internal_program_shape() const; + public: + const ::xla::ProgramShapeProto& program_shape() const; + ::xla::ProgramShapeProto* release_program_shape(); + ::xla::ProgramShapeProto* mutable_program_shape(); + void set_allocated_program_shape(::xla::ProgramShapeProto* program_shape); + + // .xrt.DeviceAssignment device_assignment = 6; + bool has_device_assignment() const; + void clear_device_assignment(); + static const int kDeviceAssignmentFieldNumber = 6; + private: + const ::xrt::DeviceAssignment& _internal_device_assignment() const; + public: + const ::xrt::DeviceAssignment& device_assignment() const; + ::xrt::DeviceAssignment* release_device_assignment(); + ::xrt::DeviceAssignment* mutable_device_assignment(); + void set_allocated_device_assignment(::xrt::DeviceAssignment* device_assignment); + + // .xla.DebugOptions debug_options = 7; + bool has_debug_options() const; + void clear_debug_options(); + static const int kDebugOptionsFieldNumber = 7; + private: + const ::xla::DebugOptions& _internal_debug_options() const; + public: + const ::xla::DebugOptions& debug_options() const; + ::xla::DebugOptions* release_debug_options(); + ::xla::DebugOptions* mutable_debug_options(); + void set_allocated_debug_options(::xla::DebugOptions* debug_options); + + // int32 num_replicas = 1; + void clear_num_replicas(); + static const int kNumReplicasFieldNumber = 1; + ::google::protobuf::int32 num_replicas() const; + void set_num_replicas(::google::protobuf::int32 value); + + // int32 num_cores_per_replica = 2; + void clear_num_cores_per_replica(); + static const int kNumCoresPerReplicaFieldNumber = 2; + ::google::protobuf::int32 num_cores_per_replica() const; + void set_num_cores_per_replica(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:xrt.XLAComputationConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xla::ProgramShapeProto > per_core_program_shape_; + ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* host_compute_metadata_; + ::xla::ProgramShapeProto* program_shape_; + ::xrt::DeviceAssignment* device_assignment_; + ::xla::DebugOptions* debug_options_; + ::google::protobuf::int32 num_replicas_; + ::google::protobuf::int32 num_cores_per_replica_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class XLAComputation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.XLAComputation) */ { + public: + XLAComputation(); + virtual ~XLAComputation(); + + XLAComputation(const XLAComputation& from); + + inline XLAComputation& operator=(const XLAComputation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + XLAComputation(XLAComputation&& from) noexcept + : XLAComputation() { + *this = ::std::move(from); + } + + inline XLAComputation& operator=(XLAComputation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const XLAComputation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const XLAComputation* internal_default_instance() { + return reinterpret_cast( + &_XLAComputation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(XLAComputation* other); + friend void swap(XLAComputation& a, XLAComputation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline XLAComputation* New() const final { + return CreateMaybeMessage(NULL); + } + + XLAComputation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const XLAComputation& from); + void MergeFrom(const XLAComputation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(XLAComputation* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xrt.XLAComputationConfig config = 1; + bool has_config() const; + void clear_config(); + static const int kConfigFieldNumber = 1; + private: + const ::xrt::XLAComputationConfig& _internal_config() const; + public: + const ::xrt::XLAComputationConfig& config() const; + ::xrt::XLAComputationConfig* release_config(); + ::xrt::XLAComputationConfig* mutable_config(); + void set_allocated_config(::xrt::XLAComputationConfig* config); + + // .xla.HloSnapshot hlo_snapshot = 2; + bool has_hlo_snapshot() const; + void clear_hlo_snapshot(); + static const int kHloSnapshotFieldNumber = 2; + private: + const ::xla::HloSnapshot& _internal_hlo_snapshot() const; + public: + const ::xla::HloSnapshot& hlo_snapshot() const; + ::xla::HloSnapshot* release_hlo_snapshot(); + ::xla::HloSnapshot* mutable_hlo_snapshot(); + void set_allocated_hlo_snapshot(::xla::HloSnapshot* hlo_snapshot); + + // @@protoc_insertion_point(class_scope:xrt.XLAComputation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xrt::XLAComputationConfig* config_; + ::xla::HloSnapshot* hlo_snapshot_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class XLAAllocation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.XLAAllocation) */ { + public: + XLAAllocation(); + virtual ~XLAAllocation(); + + XLAAllocation(const XLAAllocation& from); + + inline XLAAllocation& operator=(const XLAAllocation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + XLAAllocation(XLAAllocation&& from) noexcept + : XLAAllocation() { + *this = ::std::move(from); + } + + inline XLAAllocation& operator=(XLAAllocation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const XLAAllocation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const XLAAllocation* internal_default_instance() { + return reinterpret_cast( + &_XLAAllocation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(XLAAllocation* other); + friend void swap(XLAAllocation& a, XLAAllocation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline XLAAllocation* New() const final { + return CreateMaybeMessage(NULL); + } + + XLAAllocation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const XLAAllocation& from); + void MergeFrom(const XLAAllocation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(XLAAllocation* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .xla.LiteralProto value = 2; + bool has_value() const; + void clear_value(); + static const int kValueFieldNumber = 2; + private: + const ::xla::LiteralProto& _internal_value() const; + public: + const ::xla::LiteralProto& value() const; + ::xla::LiteralProto* release_value(); + ::xla::LiteralProto* mutable_value(); + void set_allocated_value(::xla::LiteralProto* value); + + // int32 device_ordinal = 1; + void clear_device_ordinal(); + static const int kDeviceOrdinalFieldNumber = 1; + ::google::protobuf::int32 device_ordinal() const; + void set_device_ordinal(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:xrt.XLAAllocation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::xla::LiteralProto* value_; + ::google::protobuf::int32 device_ordinal_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class XLATupleNode : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.XLATupleNode) */ { + public: + XLATupleNode(); + virtual ~XLATupleNode(); + + XLATupleNode(const XLATupleNode& from); + + inline XLATupleNode& operator=(const XLATupleNode& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + XLATupleNode(XLATupleNode&& from) noexcept + : XLATupleNode() { + *this = ::std::move(from); + } + + inline XLATupleNode& operator=(XLATupleNode&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const XLATupleNode& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const XLATupleNode* internal_default_instance() { + return reinterpret_cast( + &_XLATupleNode_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(XLATupleNode* other); + friend void swap(XLATupleNode& a, XLATupleNode& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline XLATupleNode* New() const final { + return CreateMaybeMessage(NULL); + } + + XLATupleNode* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const XLATupleNode& from); + void MergeFrom(const XLATupleNode& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(XLATupleNode* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xrt.XLATupleNode tuples = 3; + int tuples_size() const; + void clear_tuples(); + static const int kTuplesFieldNumber = 3; + ::xrt::XLATupleNode* mutable_tuples(int index); + ::google::protobuf::RepeatedPtrField< ::xrt::XLATupleNode >* + mutable_tuples(); + const ::xrt::XLATupleNode& tuples(int index) const; + ::xrt::XLATupleNode* add_tuples(); + const ::google::protobuf::RepeatedPtrField< ::xrt::XLATupleNode >& + tuples() const; + + // int32 input_index = 1; + void clear_input_index(); + static const int kInputIndexFieldNumber = 1; + ::google::protobuf::int32 input_index() const; + void set_input_index(::google::protobuf::int32 value); + + // bool release_input_handle = 2; + void clear_release_input_handle(); + static const int kReleaseInputHandleFieldNumber = 2; + bool release_input_handle() const; + void set_release_input_handle(bool value); + + // @@protoc_insertion_point(class_scope:xrt.XLATupleNode) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::xrt::XLATupleNode > tuples_; + ::google::protobuf::int32 input_index_; + bool release_input_handle_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class XRTExecutionConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xrt.XRTExecutionConfig) */ { + public: + XRTExecutionConfig(); + virtual ~XRTExecutionConfig(); + + XRTExecutionConfig(const XRTExecutionConfig& from); + + inline XRTExecutionConfig& operator=(const XRTExecutionConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + XRTExecutionConfig(XRTExecutionConfig&& from) noexcept + : XRTExecutionConfig() { + *this = ::std::move(from); + } + + inline XRTExecutionConfig& operator=(XRTExecutionConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const XRTExecutionConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const XRTExecutionConfig* internal_default_instance() { + return reinterpret_cast( + &_XRTExecutionConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void Swap(XRTExecutionConfig* other); + friend void swap(XRTExecutionConfig& a, XRTExecutionConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline XRTExecutionConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + XRTExecutionConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const XRTExecutionConfig& from); + void MergeFrom(const XRTExecutionConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(XRTExecutionConfig* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string execution_instance_key = 3; + void clear_execution_instance_key(); + static const int kExecutionInstanceKeyFieldNumber = 3; + const ::std::string& execution_instance_key() const; + void set_execution_instance_key(const ::std::string& value); + #if LANG_CXX11 + void set_execution_instance_key(::std::string&& value); + #endif + void set_execution_instance_key(const char* value); + void set_execution_instance_key(const char* value, size_t size); + ::std::string* mutable_execution_instance_key(); + ::std::string* release_execution_instance_key(); + void set_allocated_execution_instance_key(::std::string* execution_instance_key); + + // int32 device_ordinal = 1; + void clear_device_ordinal(); + static const int kDeviceOrdinalFieldNumber = 1; + ::google::protobuf::int32 device_ordinal() const; + void set_device_ordinal(::google::protobuf::int32 value); + + // int32 core_index_in_replica = 2; + void clear_core_index_in_replica(); + static const int kCoreIndexInReplicaFieldNumber = 2; + ::google::protobuf::int32 core_index_in_replica() const; + void set_core_index_in_replica(::google::protobuf::int32 value); + + // uint32 rng_seed = 4; + void clear_rng_seed(); + static const int kRngSeedFieldNumber = 4; + ::google::protobuf::uint32 rng_seed() const; + void set_rng_seed(::google::protobuf::uint32 value); + + // bool release_input_handles = 5; + void clear_release_input_handles(); + static const int kReleaseInputHandlesFieldNumber = 5; + bool release_input_handles() const; + void set_release_input_handles(bool value); + + // bool release_compilation_handle = 6; + void clear_release_compilation_handle(); + static const int kReleaseCompilationHandleFieldNumber = 6; + bool release_compilation_handle() const; + void set_release_compilation_handle(bool value); + + // bool return_exploded_tuple = 7; + void clear_return_exploded_tuple(); + static const int kReturnExplodedTupleFieldNumber = 7; + bool return_exploded_tuple() const; + void set_return_exploded_tuple(bool value); + + // @@protoc_insertion_point(class_scope:xrt.XRTExecutionConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr execution_instance_key_; + ::google::protobuf::int32 device_ordinal_; + ::google::protobuf::int32 core_index_in_replica_; + ::google::protobuf::uint32 rng_seed_; + bool release_input_handles_; + bool release_compilation_handle_; + bool return_exploded_tuple_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// DeviceAssignment_ComputationDevice_DeviceMeshCoordinates + +// repeated int32 value = 1; +inline int DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::value_size() const { + return value_.size(); +} +inline void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::clear_value() { + value_.Clear(); +} +inline ::google::protobuf::int32 DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::value(int index) const { + // @@protoc_insertion_point(field_get:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates.value) + return value_.Get(index); +} +inline void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::set_value(int index, ::google::protobuf::int32 value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates.value) +} +inline void DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::add_value(::google::protobuf::int32 value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates.value) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::value() const { + // @@protoc_insertion_point(field_list:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates.value) + return value_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +DeviceAssignment_ComputationDevice_DeviceMeshCoordinates::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// DeviceAssignment_ComputationDevice + +// repeated .xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates replica_devices = 1; +inline int DeviceAssignment_ComputationDevice::replica_devices_size() const { + return replica_devices_.size(); +} +inline void DeviceAssignment_ComputationDevice::clear_replica_devices() { + replica_devices_.Clear(); +} +inline ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* DeviceAssignment_ComputationDevice::mutable_replica_devices(int index) { + // @@protoc_insertion_point(field_mutable:xrt.DeviceAssignment.ComputationDevice.replica_devices) + return replica_devices_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates >* +DeviceAssignment_ComputationDevice::mutable_replica_devices() { + // @@protoc_insertion_point(field_mutable_list:xrt.DeviceAssignment.ComputationDevice.replica_devices) + return &replica_devices_; +} +inline const ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates& DeviceAssignment_ComputationDevice::replica_devices(int index) const { + // @@protoc_insertion_point(field_get:xrt.DeviceAssignment.ComputationDevice.replica_devices) + return replica_devices_.Get(index); +} +inline ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates* DeviceAssignment_ComputationDevice::add_replica_devices() { + // @@protoc_insertion_point(field_add:xrt.DeviceAssignment.ComputationDevice.replica_devices) + return replica_devices_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice_DeviceMeshCoordinates >& +DeviceAssignment_ComputationDevice::replica_devices() const { + // @@protoc_insertion_point(field_list:xrt.DeviceAssignment.ComputationDevice.replica_devices) + return replica_devices_; +} + +// ------------------------------------------------------------------- + +// DeviceAssignment + +// repeated .xrt.DeviceAssignment.ComputationDevice computation_devices = 1; +inline int DeviceAssignment::computation_devices_size() const { + return computation_devices_.size(); +} +inline void DeviceAssignment::clear_computation_devices() { + computation_devices_.Clear(); +} +inline ::xrt::DeviceAssignment_ComputationDevice* DeviceAssignment::mutable_computation_devices(int index) { + // @@protoc_insertion_point(field_mutable:xrt.DeviceAssignment.computation_devices) + return computation_devices_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice >* +DeviceAssignment::mutable_computation_devices() { + // @@protoc_insertion_point(field_mutable_list:xrt.DeviceAssignment.computation_devices) + return &computation_devices_; +} +inline const ::xrt::DeviceAssignment_ComputationDevice& DeviceAssignment::computation_devices(int index) const { + // @@protoc_insertion_point(field_get:xrt.DeviceAssignment.computation_devices) + return computation_devices_.Get(index); +} +inline ::xrt::DeviceAssignment_ComputationDevice* DeviceAssignment::add_computation_devices() { + // @@protoc_insertion_point(field_add:xrt.DeviceAssignment.computation_devices) + return computation_devices_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xrt::DeviceAssignment_ComputationDevice >& +DeviceAssignment::computation_devices() const { + // @@protoc_insertion_point(field_list:xrt.DeviceAssignment.computation_devices) + return computation_devices_; +} + +// ------------------------------------------------------------------- + +// XLAComputationConfig + +// int32 num_replicas = 1; +inline void XLAComputationConfig::clear_num_replicas() { + num_replicas_ = 0; +} +inline ::google::protobuf::int32 XLAComputationConfig::num_replicas() const { + // @@protoc_insertion_point(field_get:xrt.XLAComputationConfig.num_replicas) + return num_replicas_; +} +inline void XLAComputationConfig::set_num_replicas(::google::protobuf::int32 value) { + + num_replicas_ = value; + // @@protoc_insertion_point(field_set:xrt.XLAComputationConfig.num_replicas) +} + +// int32 num_cores_per_replica = 2; +inline void XLAComputationConfig::clear_num_cores_per_replica() { + num_cores_per_replica_ = 0; +} +inline ::google::protobuf::int32 XLAComputationConfig::num_cores_per_replica() const { + // @@protoc_insertion_point(field_get:xrt.XLAComputationConfig.num_cores_per_replica) + return num_cores_per_replica_; +} +inline void XLAComputationConfig::set_num_cores_per_replica(::google::protobuf::int32 value) { + + num_cores_per_replica_ = value; + // @@protoc_insertion_point(field_set:xrt.XLAComputationConfig.num_cores_per_replica) +} + +// .diplomacy.tensorflow.tf2xla.HostComputeMetadata host_compute_metadata = 3; +inline bool XLAComputationConfig::has_host_compute_metadata() const { + return this != internal_default_instance() && host_compute_metadata_ != NULL; +} +inline const ::diplomacy::tensorflow::tf2xla::HostComputeMetadata& XLAComputationConfig::_internal_host_compute_metadata() const { + return *host_compute_metadata_; +} +inline const ::diplomacy::tensorflow::tf2xla::HostComputeMetadata& XLAComputationConfig::host_compute_metadata() const { + const ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* p = host_compute_metadata_; + // @@protoc_insertion_point(field_get:xrt.XLAComputationConfig.host_compute_metadata) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tf2xla::_HostComputeMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* XLAComputationConfig::release_host_compute_metadata() { + // @@protoc_insertion_point(field_release:xrt.XLAComputationConfig.host_compute_metadata) + + ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* temp = host_compute_metadata_; + host_compute_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tf2xla::HostComputeMetadata* XLAComputationConfig::mutable_host_compute_metadata() { + + if (host_compute_metadata_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tf2xla::HostComputeMetadata>(GetArenaNoVirtual()); + host_compute_metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:xrt.XLAComputationConfig.host_compute_metadata) + return host_compute_metadata_; +} +inline void XLAComputationConfig::set_allocated_host_compute_metadata(::diplomacy::tensorflow::tf2xla::HostComputeMetadata* host_compute_metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(host_compute_metadata_); + } + if (host_compute_metadata) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(host_compute_metadata)->GetArena(); + if (message_arena != submessage_arena) { + host_compute_metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, host_compute_metadata, submessage_arena); + } + + } else { + + } + host_compute_metadata_ = host_compute_metadata; + // @@protoc_insertion_point(field_set_allocated:xrt.XLAComputationConfig.host_compute_metadata) +} + +// .xla.ProgramShapeProto program_shape = 4; +inline bool XLAComputationConfig::has_program_shape() const { + return this != internal_default_instance() && program_shape_ != NULL; +} +inline const ::xla::ProgramShapeProto& XLAComputationConfig::_internal_program_shape() const { + return *program_shape_; +} +inline const ::xla::ProgramShapeProto& XLAComputationConfig::program_shape() const { + const ::xla::ProgramShapeProto* p = program_shape_; + // @@protoc_insertion_point(field_get:xrt.XLAComputationConfig.program_shape) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_ProgramShapeProto_default_instance_); +} +inline ::xla::ProgramShapeProto* XLAComputationConfig::release_program_shape() { + // @@protoc_insertion_point(field_release:xrt.XLAComputationConfig.program_shape) + + ::xla::ProgramShapeProto* temp = program_shape_; + program_shape_ = NULL; + return temp; +} +inline ::xla::ProgramShapeProto* XLAComputationConfig::mutable_program_shape() { + + if (program_shape_ == NULL) { + auto* p = CreateMaybeMessage<::xla::ProgramShapeProto>(GetArenaNoVirtual()); + program_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:xrt.XLAComputationConfig.program_shape) + return program_shape_; +} +inline void XLAComputationConfig::set_allocated_program_shape(::xla::ProgramShapeProto* program_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(program_shape_); + } + if (program_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(program_shape)->GetArena(); + if (message_arena != submessage_arena) { + program_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, program_shape, submessage_arena); + } + + } else { + + } + program_shape_ = program_shape; + // @@protoc_insertion_point(field_set_allocated:xrt.XLAComputationConfig.program_shape) +} + +// repeated .xla.ProgramShapeProto per_core_program_shape = 5; +inline int XLAComputationConfig::per_core_program_shape_size() const { + return per_core_program_shape_.size(); +} +inline ::xla::ProgramShapeProto* XLAComputationConfig::mutable_per_core_program_shape(int index) { + // @@protoc_insertion_point(field_mutable:xrt.XLAComputationConfig.per_core_program_shape) + return per_core_program_shape_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::ProgramShapeProto >* +XLAComputationConfig::mutable_per_core_program_shape() { + // @@protoc_insertion_point(field_mutable_list:xrt.XLAComputationConfig.per_core_program_shape) + return &per_core_program_shape_; +} +inline const ::xla::ProgramShapeProto& XLAComputationConfig::per_core_program_shape(int index) const { + // @@protoc_insertion_point(field_get:xrt.XLAComputationConfig.per_core_program_shape) + return per_core_program_shape_.Get(index); +} +inline ::xla::ProgramShapeProto* XLAComputationConfig::add_per_core_program_shape() { + // @@protoc_insertion_point(field_add:xrt.XLAComputationConfig.per_core_program_shape) + return per_core_program_shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::ProgramShapeProto >& +XLAComputationConfig::per_core_program_shape() const { + // @@protoc_insertion_point(field_list:xrt.XLAComputationConfig.per_core_program_shape) + return per_core_program_shape_; +} + +// .xrt.DeviceAssignment device_assignment = 6; +inline bool XLAComputationConfig::has_device_assignment() const { + return this != internal_default_instance() && device_assignment_ != NULL; +} +inline void XLAComputationConfig::clear_device_assignment() { + if (GetArenaNoVirtual() == NULL && device_assignment_ != NULL) { + delete device_assignment_; + } + device_assignment_ = NULL; +} +inline const ::xrt::DeviceAssignment& XLAComputationConfig::_internal_device_assignment() const { + return *device_assignment_; +} +inline const ::xrt::DeviceAssignment& XLAComputationConfig::device_assignment() const { + const ::xrt::DeviceAssignment* p = device_assignment_; + // @@protoc_insertion_point(field_get:xrt.XLAComputationConfig.device_assignment) + return p != NULL ? *p : *reinterpret_cast( + &::xrt::_DeviceAssignment_default_instance_); +} +inline ::xrt::DeviceAssignment* XLAComputationConfig::release_device_assignment() { + // @@protoc_insertion_point(field_release:xrt.XLAComputationConfig.device_assignment) + + ::xrt::DeviceAssignment* temp = device_assignment_; + device_assignment_ = NULL; + return temp; +} +inline ::xrt::DeviceAssignment* XLAComputationConfig::mutable_device_assignment() { + + if (device_assignment_ == NULL) { + auto* p = CreateMaybeMessage<::xrt::DeviceAssignment>(GetArenaNoVirtual()); + device_assignment_ = p; + } + // @@protoc_insertion_point(field_mutable:xrt.XLAComputationConfig.device_assignment) + return device_assignment_; +} +inline void XLAComputationConfig::set_allocated_device_assignment(::xrt::DeviceAssignment* device_assignment) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete device_assignment_; + } + if (device_assignment) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + device_assignment = ::google::protobuf::internal::GetOwnedMessage( + message_arena, device_assignment, submessage_arena); + } + + } else { + + } + device_assignment_ = device_assignment; + // @@protoc_insertion_point(field_set_allocated:xrt.XLAComputationConfig.device_assignment) +} + +// .xla.DebugOptions debug_options = 7; +inline bool XLAComputationConfig::has_debug_options() const { + return this != internal_default_instance() && debug_options_ != NULL; +} +inline const ::xla::DebugOptions& XLAComputationConfig::_internal_debug_options() const { + return *debug_options_; +} +inline const ::xla::DebugOptions& XLAComputationConfig::debug_options() const { + const ::xla::DebugOptions* p = debug_options_; + // @@protoc_insertion_point(field_get:xrt.XLAComputationConfig.debug_options) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_DebugOptions_default_instance_); +} +inline ::xla::DebugOptions* XLAComputationConfig::release_debug_options() { + // @@protoc_insertion_point(field_release:xrt.XLAComputationConfig.debug_options) + + ::xla::DebugOptions* temp = debug_options_; + debug_options_ = NULL; + return temp; +} +inline ::xla::DebugOptions* XLAComputationConfig::mutable_debug_options() { + + if (debug_options_ == NULL) { + auto* p = CreateMaybeMessage<::xla::DebugOptions>(GetArenaNoVirtual()); + debug_options_ = p; + } + // @@protoc_insertion_point(field_mutable:xrt.XLAComputationConfig.debug_options) + return debug_options_; +} +inline void XLAComputationConfig::set_allocated_debug_options(::xla::DebugOptions* debug_options) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(debug_options_); + } + if (debug_options) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + debug_options = ::google::protobuf::internal::GetOwnedMessage( + message_arena, debug_options, submessage_arena); + } + + } else { + + } + debug_options_ = debug_options; + // @@protoc_insertion_point(field_set_allocated:xrt.XLAComputationConfig.debug_options) +} + +// ------------------------------------------------------------------- + +// XLAComputation + +// .xrt.XLAComputationConfig config = 1; +inline bool XLAComputation::has_config() const { + return this != internal_default_instance() && config_ != NULL; +} +inline void XLAComputation::clear_config() { + if (GetArenaNoVirtual() == NULL && config_ != NULL) { + delete config_; + } + config_ = NULL; +} +inline const ::xrt::XLAComputationConfig& XLAComputation::_internal_config() const { + return *config_; +} +inline const ::xrt::XLAComputationConfig& XLAComputation::config() const { + const ::xrt::XLAComputationConfig* p = config_; + // @@protoc_insertion_point(field_get:xrt.XLAComputation.config) + return p != NULL ? *p : *reinterpret_cast( + &::xrt::_XLAComputationConfig_default_instance_); +} +inline ::xrt::XLAComputationConfig* XLAComputation::release_config() { + // @@protoc_insertion_point(field_release:xrt.XLAComputation.config) + + ::xrt::XLAComputationConfig* temp = config_; + config_ = NULL; + return temp; +} +inline ::xrt::XLAComputationConfig* XLAComputation::mutable_config() { + + if (config_ == NULL) { + auto* p = CreateMaybeMessage<::xrt::XLAComputationConfig>(GetArenaNoVirtual()); + config_ = p; + } + // @@protoc_insertion_point(field_mutable:xrt.XLAComputation.config) + return config_; +} +inline void XLAComputation::set_allocated_config(::xrt::XLAComputationConfig* config) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete config_; + } + if (config) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + config = ::google::protobuf::internal::GetOwnedMessage( + message_arena, config, submessage_arena); + } + + } else { + + } + config_ = config; + // @@protoc_insertion_point(field_set_allocated:xrt.XLAComputation.config) +} + +// .xla.HloSnapshot hlo_snapshot = 2; +inline bool XLAComputation::has_hlo_snapshot() const { + return this != internal_default_instance() && hlo_snapshot_ != NULL; +} +inline const ::xla::HloSnapshot& XLAComputation::_internal_hlo_snapshot() const { + return *hlo_snapshot_; +} +inline const ::xla::HloSnapshot& XLAComputation::hlo_snapshot() const { + const ::xla::HloSnapshot* p = hlo_snapshot_; + // @@protoc_insertion_point(field_get:xrt.XLAComputation.hlo_snapshot) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_HloSnapshot_default_instance_); +} +inline ::xla::HloSnapshot* XLAComputation::release_hlo_snapshot() { + // @@protoc_insertion_point(field_release:xrt.XLAComputation.hlo_snapshot) + + ::xla::HloSnapshot* temp = hlo_snapshot_; + hlo_snapshot_ = NULL; + return temp; +} +inline ::xla::HloSnapshot* XLAComputation::mutable_hlo_snapshot() { + + if (hlo_snapshot_ == NULL) { + auto* p = CreateMaybeMessage<::xla::HloSnapshot>(GetArenaNoVirtual()); + hlo_snapshot_ = p; + } + // @@protoc_insertion_point(field_mutable:xrt.XLAComputation.hlo_snapshot) + return hlo_snapshot_; +} +inline void XLAComputation::set_allocated_hlo_snapshot(::xla::HloSnapshot* hlo_snapshot) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(hlo_snapshot_); + } + if (hlo_snapshot) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(hlo_snapshot)->GetArena(); + if (message_arena != submessage_arena) { + hlo_snapshot = ::google::protobuf::internal::GetOwnedMessage( + message_arena, hlo_snapshot, submessage_arena); + } + + } else { + + } + hlo_snapshot_ = hlo_snapshot; + // @@protoc_insertion_point(field_set_allocated:xrt.XLAComputation.hlo_snapshot) +} + +// ------------------------------------------------------------------- + +// XLAAllocation + +// int32 device_ordinal = 1; +inline void XLAAllocation::clear_device_ordinal() { + device_ordinal_ = 0; +} +inline ::google::protobuf::int32 XLAAllocation::device_ordinal() const { + // @@protoc_insertion_point(field_get:xrt.XLAAllocation.device_ordinal) + return device_ordinal_; +} +inline void XLAAllocation::set_device_ordinal(::google::protobuf::int32 value) { + + device_ordinal_ = value; + // @@protoc_insertion_point(field_set:xrt.XLAAllocation.device_ordinal) +} + +// .xla.LiteralProto value = 2; +inline bool XLAAllocation::has_value() const { + return this != internal_default_instance() && value_ != NULL; +} +inline const ::xla::LiteralProto& XLAAllocation::_internal_value() const { + return *value_; +} +inline const ::xla::LiteralProto& XLAAllocation::value() const { + const ::xla::LiteralProto* p = value_; + // @@protoc_insertion_point(field_get:xrt.XLAAllocation.value) + return p != NULL ? *p : *reinterpret_cast( + &::xla::_LiteralProto_default_instance_); +} +inline ::xla::LiteralProto* XLAAllocation::release_value() { + // @@protoc_insertion_point(field_release:xrt.XLAAllocation.value) + + ::xla::LiteralProto* temp = value_; + value_ = NULL; + return temp; +} +inline ::xla::LiteralProto* XLAAllocation::mutable_value() { + + if (value_ == NULL) { + auto* p = CreateMaybeMessage<::xla::LiteralProto>(GetArenaNoVirtual()); + value_ = p; + } + // @@protoc_insertion_point(field_mutable:xrt.XLAAllocation.value) + return value_; +} +inline void XLAAllocation::set_allocated_value(::xla::LiteralProto* value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(value_); + } + if (value) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, value, submessage_arena); + } + + } else { + + } + value_ = value; + // @@protoc_insertion_point(field_set_allocated:xrt.XLAAllocation.value) +} + +// ------------------------------------------------------------------- + +// XLATupleNode + +// int32 input_index = 1; +inline void XLATupleNode::clear_input_index() { + input_index_ = 0; +} +inline ::google::protobuf::int32 XLATupleNode::input_index() const { + // @@protoc_insertion_point(field_get:xrt.XLATupleNode.input_index) + return input_index_; +} +inline void XLATupleNode::set_input_index(::google::protobuf::int32 value) { + + input_index_ = value; + // @@protoc_insertion_point(field_set:xrt.XLATupleNode.input_index) +} + +// bool release_input_handle = 2; +inline void XLATupleNode::clear_release_input_handle() { + release_input_handle_ = false; +} +inline bool XLATupleNode::release_input_handle() const { + // @@protoc_insertion_point(field_get:xrt.XLATupleNode.release_input_handle) + return release_input_handle_; +} +inline void XLATupleNode::set_release_input_handle(bool value) { + + release_input_handle_ = value; + // @@protoc_insertion_point(field_set:xrt.XLATupleNode.release_input_handle) +} + +// repeated .xrt.XLATupleNode tuples = 3; +inline int XLATupleNode::tuples_size() const { + return tuples_.size(); +} +inline void XLATupleNode::clear_tuples() { + tuples_.Clear(); +} +inline ::xrt::XLATupleNode* XLATupleNode::mutable_tuples(int index) { + // @@protoc_insertion_point(field_mutable:xrt.XLATupleNode.tuples) + return tuples_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xrt::XLATupleNode >* +XLATupleNode::mutable_tuples() { + // @@protoc_insertion_point(field_mutable_list:xrt.XLATupleNode.tuples) + return &tuples_; +} +inline const ::xrt::XLATupleNode& XLATupleNode::tuples(int index) const { + // @@protoc_insertion_point(field_get:xrt.XLATupleNode.tuples) + return tuples_.Get(index); +} +inline ::xrt::XLATupleNode* XLATupleNode::add_tuples() { + // @@protoc_insertion_point(field_add:xrt.XLATupleNode.tuples) + return tuples_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xrt::XLATupleNode >& +XLATupleNode::tuples() const { + // @@protoc_insertion_point(field_list:xrt.XLATupleNode.tuples) + return tuples_; +} + +// ------------------------------------------------------------------- + +// XRTExecutionConfig + +// int32 device_ordinal = 1; +inline void XRTExecutionConfig::clear_device_ordinal() { + device_ordinal_ = 0; +} +inline ::google::protobuf::int32 XRTExecutionConfig::device_ordinal() const { + // @@protoc_insertion_point(field_get:xrt.XRTExecutionConfig.device_ordinal) + return device_ordinal_; +} +inline void XRTExecutionConfig::set_device_ordinal(::google::protobuf::int32 value) { + + device_ordinal_ = value; + // @@protoc_insertion_point(field_set:xrt.XRTExecutionConfig.device_ordinal) +} + +// int32 core_index_in_replica = 2; +inline void XRTExecutionConfig::clear_core_index_in_replica() { + core_index_in_replica_ = 0; +} +inline ::google::protobuf::int32 XRTExecutionConfig::core_index_in_replica() const { + // @@protoc_insertion_point(field_get:xrt.XRTExecutionConfig.core_index_in_replica) + return core_index_in_replica_; +} +inline void XRTExecutionConfig::set_core_index_in_replica(::google::protobuf::int32 value) { + + core_index_in_replica_ = value; + // @@protoc_insertion_point(field_set:xrt.XRTExecutionConfig.core_index_in_replica) +} + +// string execution_instance_key = 3; +inline void XRTExecutionConfig::clear_execution_instance_key() { + execution_instance_key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& XRTExecutionConfig::execution_instance_key() const { + // @@protoc_insertion_point(field_get:xrt.XRTExecutionConfig.execution_instance_key) + return execution_instance_key_.GetNoArena(); +} +inline void XRTExecutionConfig::set_execution_instance_key(const ::std::string& value) { + + execution_instance_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:xrt.XRTExecutionConfig.execution_instance_key) +} +#if LANG_CXX11 +inline void XRTExecutionConfig::set_execution_instance_key(::std::string&& value) { + + execution_instance_key_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:xrt.XRTExecutionConfig.execution_instance_key) +} +#endif +inline void XRTExecutionConfig::set_execution_instance_key(const char* value) { + GOOGLE_DCHECK(value != NULL); + + execution_instance_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:xrt.XRTExecutionConfig.execution_instance_key) +} +inline void XRTExecutionConfig::set_execution_instance_key(const char* value, size_t size) { + + execution_instance_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:xrt.XRTExecutionConfig.execution_instance_key) +} +inline ::std::string* XRTExecutionConfig::mutable_execution_instance_key() { + + // @@protoc_insertion_point(field_mutable:xrt.XRTExecutionConfig.execution_instance_key) + return execution_instance_key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* XRTExecutionConfig::release_execution_instance_key() { + // @@protoc_insertion_point(field_release:xrt.XRTExecutionConfig.execution_instance_key) + + return execution_instance_key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void XRTExecutionConfig::set_allocated_execution_instance_key(::std::string* execution_instance_key) { + if (execution_instance_key != NULL) { + + } else { + + } + execution_instance_key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), execution_instance_key); + // @@protoc_insertion_point(field_set_allocated:xrt.XRTExecutionConfig.execution_instance_key) +} + +// uint32 rng_seed = 4; +inline void XRTExecutionConfig::clear_rng_seed() { + rng_seed_ = 0u; +} +inline ::google::protobuf::uint32 XRTExecutionConfig::rng_seed() const { + // @@protoc_insertion_point(field_get:xrt.XRTExecutionConfig.rng_seed) + return rng_seed_; +} +inline void XRTExecutionConfig::set_rng_seed(::google::protobuf::uint32 value) { + + rng_seed_ = value; + // @@protoc_insertion_point(field_set:xrt.XRTExecutionConfig.rng_seed) +} + +// bool release_input_handles = 5; +inline void XRTExecutionConfig::clear_release_input_handles() { + release_input_handles_ = false; +} +inline bool XRTExecutionConfig::release_input_handles() const { + // @@protoc_insertion_point(field_get:xrt.XRTExecutionConfig.release_input_handles) + return release_input_handles_; +} +inline void XRTExecutionConfig::set_release_input_handles(bool value) { + + release_input_handles_ = value; + // @@protoc_insertion_point(field_set:xrt.XRTExecutionConfig.release_input_handles) +} + +// bool release_compilation_handle = 6; +inline void XRTExecutionConfig::clear_release_compilation_handle() { + release_compilation_handle_ = false; +} +inline bool XRTExecutionConfig::release_compilation_handle() const { + // @@protoc_insertion_point(field_get:xrt.XRTExecutionConfig.release_compilation_handle) + return release_compilation_handle_; +} +inline void XRTExecutionConfig::set_release_compilation_handle(bool value) { + + release_compilation_handle_ = value; + // @@protoc_insertion_point(field_set:xrt.XRTExecutionConfig.release_compilation_handle) +} + +// bool return_exploded_tuple = 7; +inline void XRTExecutionConfig::clear_return_exploded_tuple() { + return_exploded_tuple_ = false; +} +inline bool XRTExecutionConfig::return_exploded_tuple() const { + // @@protoc_insertion_point(field_get:xrt.XRTExecutionConfig.return_exploded_tuple) + return return_exploded_tuple_; +} +inline void XRTExecutionConfig::set_return_exploded_tuple(bool value) { + + return_exploded_tuple_ = value; + // @@protoc_insertion_point(field_set:xrt.XRTExecutionConfig.return_exploded_tuple) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace xrt + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcompiler_2fxrt_2fxrt_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.proto b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.proto new file mode 100644 index 0000000..c011ea5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt.proto @@ -0,0 +1,108 @@ +syntax = "proto3"; + +package xrt; + +import "diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto"; +import "diplomacy_tensorflow/compiler/xla/xla.proto"; +import "diplomacy_tensorflow/compiler/xla/xla_data.proto"; +import "diplomacy_tensorflow/compiler/xla/service/hlo.proto"; + +message DeviceAssignment { + message ComputationDevice { + message DeviceMeshCoordinates { + // The mesh coordinates for the device. Usually (X, Y, Core), in the order + // in which they are returned in the TopologyProto. + // X = value(0) + // Y = value(1) + // Core = value(2) + repeated int32 value = 1; + } + // As many replicas as there are in the replicated computation. + repeated DeviceMeshCoordinates replica_devices = 1; + } + // As many ComputationDevice as many there are computations (number + // of cores per replica). + repeated ComputationDevice computation_devices = 1; +} + +// Options for an XLA compilation. +message XLAComputationConfig { + // The number of replicas the computation will be run on. If this is + // default (0) it is interpreted as 1. + int32 num_replicas = 1; + // The number of "model-parallel" cores per replica. If this is + // default (0) it is interpreted as 1. + int32 num_cores_per_replica = 2; + // Optional metadata about host sends and recvs. + diplomacy.tensorflow.tf2xla.HostComputeMetadata host_compute_metadata = 3; + + // The arg/result shapes for the whole computation. + xla.ProgramShapeProto program_shape = 4; + // The arg/result shapes for each core of a model-parallel + // computation. per_core_args_and_result_shapes is optional for a + // single-core computation. + repeated xla.ProgramShapeProto per_core_program_shape = 5; + // Describes how replicated computation instances should be assigned to + // devices. There are num_cores_per_replica computations, and each one will be + // sent and executed to the set of replica device numbers described in the + // DeviceAssignment proto. + DeviceAssignment device_assignment = 6; + // The debugging options to be passed to the XLA compilation process. + xla.DebugOptions debug_options = 7; +} + +// Options and XLA computation for a compilation. +message XLAComputation { + XLAComputationConfig config = 1; + xla.HloSnapshot hlo_snapshot = 2; +} + +// Literal to allocate space for, and transfer to, device memory. +message XLAAllocation { + int32 device_ordinal = 1; + xla.LiteralProto value = 2; +} + +// Node in a tree describing a tuple constructed from input handles. A +// node is an internal node if tuples is non-empty, in which case +// input_index and release_input_handle are ignored. Otherwise a node +// is a leaf node. Each leaf XLATupleNode is the index of an input +// which corresponds to a handle that will be grafted onto the output +// tuple at that location. If release_input_handle is true that input +// handle will be released and become invalid. Inputs may be repeated +// in which case leaves of the output tuple will alias. If an input is +// repeated, release_input_handle must be false for every leaf where +// that input appears. +// +// For example, if input 0 has shape {} and input 1 has shape {2,3} +// then the XLATupleNode with structure {1,{0,1}} corresponds to a +// tuple with shape {{2,3},{{},{2,3}}}. +message XLATupleNode { + int32 input_index = 1; + bool release_input_handle = 2; + repeated XLATupleNode tuples = 3; +} + +// Options for an XLA execution. +message XRTExecutionConfig { + // Local device to run on. This is present because the execute Op + // may be placed on a device such as CPU or TPU_SYSTEM that + // logically manages multiple cores. + int32 device_ordinal = 1; + // Which model-parallel computation to run from the compiled bundle. + int32 core_index_in_replica = 2; + // Optional key to disambiguate between executions. This is only + // needed if multiple host send/recvs may be outstanding + // concurrently with executions. + string execution_instance_key = 3; + // If non-zero, rng_seed to reset the core with. + uint32 rng_seed = 4; + // If true, release allocation handles on the inputs after running. + bool release_input_handles = 5; + // If true, release the handle to the computation after running. + bool release_compilation_handle = 6; + // If set to true, and the result shape is a tuple, then instead of returning + // a single tuple allocation the execution will return a vector of + // allocations, one for each of the first-level elements of the result tuple. + bool return_exploded_tuple = 7; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt_pb2.py new file mode 100644 index 0000000..0eebe5b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/compiler/xrt/xrt_pb2.py @@ -0,0 +1,470 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/compiler/xrt/xrt.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.compiler.tf2xla import host_compute_metadata_pb2 as diplomacy__tensorflow_dot_compiler_dot_tf2xla_dot_host__compute__metadata__pb2 +from diplomacy_tensorflow.compiler.xla import xla_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2 +from diplomacy_tensorflow.compiler.xla import xla_data_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2 +from diplomacy_tensorflow.compiler.xla.service import hlo_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/compiler/xrt/xrt.proto', + package='xrt', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n+diplomacy_tensorflow/compiler/xrt/xrt.proto\x12\x03xrt\x1a@diplomacy_tensorflow/compiler/tf2xla/host_compute_metadata.proto\x1a+diplomacy_tensorflow/compiler/xla/xla.proto\x1a\x30\x64iplomacy_tensorflow/compiler/xla/xla_data.proto\x1a\x33\x64iplomacy_tensorflow/compiler/xla/service/hlo.proto\"\xee\x01\n\x10\x44\x65viceAssignment\x12\x44\n\x13\x63omputation_devices\x18\x01 \x03(\x0b\x32\'.xrt.DeviceAssignment.ComputationDevice\x1a\x93\x01\n\x11\x43omputationDevice\x12V\n\x0freplica_devices\x18\x01 \x03(\x0b\x32=.xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates\x1a&\n\x15\x44\x65viceMeshCoordinates\x12\r\n\x05value\x18\x01 \x03(\x05\"\xdf\x02\n\x14XLAComputationConfig\x12\x14\n\x0cnum_replicas\x18\x01 \x01(\x05\x12\x1d\n\x15num_cores_per_replica\x18\x02 \x01(\x05\x12O\n\x15host_compute_metadata\x18\x03 \x01(\x0b\x32\x30.diplomacy.tensorflow.tf2xla.HostComputeMetadata\x12-\n\rprogram_shape\x18\x04 \x01(\x0b\x32\x16.xla.ProgramShapeProto\x12\x36\n\x16per_core_program_shape\x18\x05 \x03(\x0b\x32\x16.xla.ProgramShapeProto\x12\x30\n\x11\x64\x65vice_assignment\x18\x06 \x01(\x0b\x32\x15.xrt.DeviceAssignment\x12(\n\rdebug_options\x18\x07 \x01(\x0b\x32\x11.xla.DebugOptions\"c\n\x0eXLAComputation\x12)\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x19.xrt.XLAComputationConfig\x12&\n\x0chlo_snapshot\x18\x02 \x01(\x0b\x32\x10.xla.HloSnapshot\"I\n\rXLAAllocation\x12\x16\n\x0e\x64\x65vice_ordinal\x18\x01 \x01(\x05\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.xla.LiteralProto\"d\n\x0cXLATupleNode\x12\x13\n\x0binput_index\x18\x01 \x01(\x05\x12\x1c\n\x14release_input_handle\x18\x02 \x01(\x08\x12!\n\x06tuples\x18\x03 \x03(\x0b\x32\x11.xrt.XLATupleNode\"\xdf\x01\n\x12XRTExecutionConfig\x12\x16\n\x0e\x64\x65vice_ordinal\x18\x01 \x01(\x05\x12\x1d\n\x15\x63ore_index_in_replica\x18\x02 \x01(\x05\x12\x1e\n\x16\x65xecution_instance_key\x18\x03 \x01(\t\x12\x10\n\x08rng_seed\x18\x04 \x01(\r\x12\x1d\n\x15release_input_handles\x18\x05 \x01(\x08\x12\"\n\x1arelease_compilation_handle\x18\x06 \x01(\x08\x12\x1d\n\x15return_exploded_tuple\x18\x07 \x01(\x08\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_compiler_dot_tf2xla_dot_host__compute__metadata__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2.DESCRIPTOR,]) + + + + +_DEVICEASSIGNMENT_COMPUTATIONDEVICE_DEVICEMESHCOORDINATES = _descriptor.Descriptor( + name='DeviceMeshCoordinates', + full_name='xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates.value', index=0, + number=1, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=467, + serialized_end=505, +) + +_DEVICEASSIGNMENT_COMPUTATIONDEVICE = _descriptor.Descriptor( + name='ComputationDevice', + full_name='xrt.DeviceAssignment.ComputationDevice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='replica_devices', full_name='xrt.DeviceAssignment.ComputationDevice.replica_devices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_DEVICEASSIGNMENT_COMPUTATIONDEVICE_DEVICEMESHCOORDINATES, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=358, + serialized_end=505, +) + +_DEVICEASSIGNMENT = _descriptor.Descriptor( + name='DeviceAssignment', + full_name='xrt.DeviceAssignment', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='computation_devices', full_name='xrt.DeviceAssignment.computation_devices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_DEVICEASSIGNMENT_COMPUTATIONDEVICE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=267, + serialized_end=505, +) + + +_XLACOMPUTATIONCONFIG = _descriptor.Descriptor( + name='XLAComputationConfig', + full_name='xrt.XLAComputationConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='num_replicas', full_name='xrt.XLAComputationConfig.num_replicas', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_cores_per_replica', full_name='xrt.XLAComputationConfig.num_cores_per_replica', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='host_compute_metadata', full_name='xrt.XLAComputationConfig.host_compute_metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='program_shape', full_name='xrt.XLAComputationConfig.program_shape', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='per_core_program_shape', full_name='xrt.XLAComputationConfig.per_core_program_shape', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_assignment', full_name='xrt.XLAComputationConfig.device_assignment', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='debug_options', full_name='xrt.XLAComputationConfig.debug_options', index=6, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=508, + serialized_end=859, +) + + +_XLACOMPUTATION = _descriptor.Descriptor( + name='XLAComputation', + full_name='xrt.XLAComputation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='config', full_name='xrt.XLAComputation.config', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='hlo_snapshot', full_name='xrt.XLAComputation.hlo_snapshot', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=861, + serialized_end=960, +) + + +_XLAALLOCATION = _descriptor.Descriptor( + name='XLAAllocation', + full_name='xrt.XLAAllocation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device_ordinal', full_name='xrt.XLAAllocation.device_ordinal', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='xrt.XLAAllocation.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=962, + serialized_end=1035, +) + + +_XLATUPLENODE = _descriptor.Descriptor( + name='XLATupleNode', + full_name='xrt.XLATupleNode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input_index', full_name='xrt.XLATupleNode.input_index', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='release_input_handle', full_name='xrt.XLATupleNode.release_input_handle', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tuples', full_name='xrt.XLATupleNode.tuples', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1037, + serialized_end=1137, +) + + +_XRTEXECUTIONCONFIG = _descriptor.Descriptor( + name='XRTExecutionConfig', + full_name='xrt.XRTExecutionConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device_ordinal', full_name='xrt.XRTExecutionConfig.device_ordinal', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='core_index_in_replica', full_name='xrt.XRTExecutionConfig.core_index_in_replica', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='execution_instance_key', full_name='xrt.XRTExecutionConfig.execution_instance_key', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rng_seed', full_name='xrt.XRTExecutionConfig.rng_seed', index=3, + number=4, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='release_input_handles', full_name='xrt.XRTExecutionConfig.release_input_handles', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='release_compilation_handle', full_name='xrt.XRTExecutionConfig.release_compilation_handle', index=5, + number=6, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='return_exploded_tuple', full_name='xrt.XRTExecutionConfig.return_exploded_tuple', index=6, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1140, + serialized_end=1363, +) + +_DEVICEASSIGNMENT_COMPUTATIONDEVICE_DEVICEMESHCOORDINATES.containing_type = _DEVICEASSIGNMENT_COMPUTATIONDEVICE +_DEVICEASSIGNMENT_COMPUTATIONDEVICE.fields_by_name['replica_devices'].message_type = _DEVICEASSIGNMENT_COMPUTATIONDEVICE_DEVICEMESHCOORDINATES +_DEVICEASSIGNMENT_COMPUTATIONDEVICE.containing_type = _DEVICEASSIGNMENT +_DEVICEASSIGNMENT.fields_by_name['computation_devices'].message_type = _DEVICEASSIGNMENT_COMPUTATIONDEVICE +_XLACOMPUTATIONCONFIG.fields_by_name['host_compute_metadata'].message_type = diplomacy__tensorflow_dot_compiler_dot_tf2xla_dot_host__compute__metadata__pb2._HOSTCOMPUTEMETADATA +_XLACOMPUTATIONCONFIG.fields_by_name['program_shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._PROGRAMSHAPEPROTO +_XLACOMPUTATIONCONFIG.fields_by_name['per_core_program_shape'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._PROGRAMSHAPEPROTO +_XLACOMPUTATIONCONFIG.fields_by_name['device_assignment'].message_type = _DEVICEASSIGNMENT +_XLACOMPUTATIONCONFIG.fields_by_name['debug_options'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__pb2._DEBUGOPTIONS +_XLACOMPUTATION.fields_by_name['config'].message_type = _XLACOMPUTATIONCONFIG +_XLACOMPUTATION.fields_by_name['hlo_snapshot'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2._HLOSNAPSHOT +_XLAALLOCATION.fields_by_name['value'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_xla__data__pb2._LITERALPROTO +_XLATUPLENODE.fields_by_name['tuples'].message_type = _XLATUPLENODE +DESCRIPTOR.message_types_by_name['DeviceAssignment'] = _DEVICEASSIGNMENT +DESCRIPTOR.message_types_by_name['XLAComputationConfig'] = _XLACOMPUTATIONCONFIG +DESCRIPTOR.message_types_by_name['XLAComputation'] = _XLACOMPUTATION +DESCRIPTOR.message_types_by_name['XLAAllocation'] = _XLAALLOCATION +DESCRIPTOR.message_types_by_name['XLATupleNode'] = _XLATUPLENODE +DESCRIPTOR.message_types_by_name['XRTExecutionConfig'] = _XRTEXECUTIONCONFIG +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +DeviceAssignment = _reflection.GeneratedProtocolMessageType('DeviceAssignment', (_message.Message,), dict( + + ComputationDevice = _reflection.GeneratedProtocolMessageType('ComputationDevice', (_message.Message,), dict( + + DeviceMeshCoordinates = _reflection.GeneratedProtocolMessageType('DeviceMeshCoordinates', (_message.Message,), dict( + DESCRIPTOR = _DEVICEASSIGNMENT_COMPUTATIONDEVICE_DEVICEMESHCOORDINATES, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + )) + , + DESCRIPTOR = _DEVICEASSIGNMENT_COMPUTATIONDEVICE, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.DeviceAssignment.ComputationDevice) + )) + , + DESCRIPTOR = _DEVICEASSIGNMENT, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.DeviceAssignment) + )) +_sym_db.RegisterMessage(DeviceAssignment) +_sym_db.RegisterMessage(DeviceAssignment.ComputationDevice) +_sym_db.RegisterMessage(DeviceAssignment.ComputationDevice.DeviceMeshCoordinates) + +XLAComputationConfig = _reflection.GeneratedProtocolMessageType('XLAComputationConfig', (_message.Message,), dict( + DESCRIPTOR = _XLACOMPUTATIONCONFIG, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.XLAComputationConfig) + )) +_sym_db.RegisterMessage(XLAComputationConfig) + +XLAComputation = _reflection.GeneratedProtocolMessageType('XLAComputation', (_message.Message,), dict( + DESCRIPTOR = _XLACOMPUTATION, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.XLAComputation) + )) +_sym_db.RegisterMessage(XLAComputation) + +XLAAllocation = _reflection.GeneratedProtocolMessageType('XLAAllocation', (_message.Message,), dict( + DESCRIPTOR = _XLAALLOCATION, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.XLAAllocation) + )) +_sym_db.RegisterMessage(XLAAllocation) + +XLATupleNode = _reflection.GeneratedProtocolMessageType('XLATupleNode', (_message.Message,), dict( + DESCRIPTOR = _XLATUPLENODE, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.XLATupleNode) + )) +_sym_db.RegisterMessage(XLATupleNode) + +XRTExecutionConfig = _reflection.GeneratedProtocolMessageType('XRTExecutionConfig', (_message.Message,), dict( + DESCRIPTOR = _XRTEXECUTIONCONFIG, + __module__ = 'diplomacy_tensorflow.compiler.xrt.xrt_pb2' + # @@protoc_insertion_point(class_scope:xrt.XRTExecutionConfig) + )) +_sym_db.RegisterMessage(XRTExecutionConfig) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.pb.cc new file mode 100644 index 0000000..41d66e6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.pb.cc @@ -0,0 +1,3621 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto + +#include "diplomacy_tensorflow/contrib/boosted_trees/proto/learner.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_AveragingConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_LearningRateDropoutDrivenConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_LearningRateFixedConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_LearningRateLineSearchConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TreeConstraintsConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TreeRegularizationConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_LearningRateConfig; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { +class TreeRegularizationConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TreeRegularizationConfig_default_instance_; +class TreeConstraintsConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TreeConstraintsConfig_default_instance_; +class LearningRateConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* fixed_; + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* dropout_; + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* line_search_; +} _LearningRateConfig_default_instance_; +class LearningRateFixedConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LearningRateFixedConfig_default_instance_; +class LearningRateLineSearchConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LearningRateLineSearchConfig_default_instance_; +class AveragingConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + float average_last_n_trees_; + float average_last_percent_trees_; +} _AveragingConfig_default_instance_; +class LearningRateDropoutDrivenConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LearningRateDropoutDrivenConfig_default_instance_; +class LearnerConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + float feature_fraction_per_tree_; + float feature_fraction_per_level_; +} _LearnerConfig_default_instance_; +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto { +static void InitDefaultsTreeRegularizationConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_TreeRegularizationConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TreeRegularizationConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTreeRegularizationConfig}, {}}; + +static void InitDefaultsTreeConstraintsConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_TreeConstraintsConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TreeConstraintsConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTreeConstraintsConfig}, {}}; + +static void InitDefaultsLearningRateConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_LearningRateConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_LearningRateConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsLearningRateConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateFixedConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateDropoutDrivenConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateLineSearchConfig.base,}}; + +static void InitDefaultsLearningRateFixedConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_LearningRateFixedConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_LearningRateFixedConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLearningRateFixedConfig}, {}}; + +static void InitDefaultsLearningRateLineSearchConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_LearningRateLineSearchConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_LearningRateLineSearchConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLearningRateLineSearchConfig}, {}}; + +static void InitDefaultsAveragingConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_AveragingConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_AveragingConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAveragingConfig}, {}}; + +static void InitDefaultsLearningRateDropoutDrivenConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_LearningRateDropoutDrivenConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_LearningRateDropoutDrivenConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLearningRateDropoutDrivenConfig}, {}}; + +static void InitDefaultsLearnerConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_LearnerConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsLearnerConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeRegularizationConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeConstraintsConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_AveragingConfig.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TreeRegularizationConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_TreeConstraintsConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_LearningRateConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_LearningRateFixedConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_LearningRateLineSearchConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_AveragingConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_LearningRateDropoutDrivenConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_LearnerConfig.base); +} + +::google::protobuf::Metadata file_level_metadata[8]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig, l1_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig, l2_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig, tree_complexity_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig, max_tree_depth_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig, min_node_weight_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig, max_number_of_unique_feature_columns_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfigDefaultTypeInternal, fixed_), + offsetof(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfigDefaultTypeInternal, dropout_), + offsetof(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfigDefaultTypeInternal, line_search_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig, tuner_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig, learning_rate_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig, max_learning_rate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig, num_steps_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfigDefaultTypeInternal, average_last_n_trees_), + offsetof(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfigDefaultTypeInternal, average_last_percent_trees_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig, config_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig, dropout_probability_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig, probability_of_skipping_dropout_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig, learning_rate_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, num_classes_), + offsetof(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfigDefaultTypeInternal, feature_fraction_per_tree_), + offsetof(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfigDefaultTypeInternal, feature_fraction_per_level_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, regularization_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, constraints_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, pruning_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, growing_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, learning_rate_tuner_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, multi_class_strategy_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, averaging_config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, weak_learner_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig, feature_fraction_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig)}, + { 8, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig)}, + { 16, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig)}, + { 25, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig)}, + { 31, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig)}, + { 38, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig)}, + { 46, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig)}, + { 54, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_TreeRegularizationConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_TreeConstraintsConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_LearningRateConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_LearningRateFixedConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_LearningRateLineSearchConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_AveragingConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_LearningRateDropoutDrivenConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 8); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n>diplomacy_tensorflow/contrib/boosted_t" + "rees/proto/learner.proto\022*diplomacy.tens" + "orflow.boosted_trees.learner\"K\n\030TreeRegu" + "larizationConfig\022\n\n\002l1\030\001 \001(\002\022\n\n\002l2\030\002 \001(\002" + "\022\027\n\017tree_complexity\030\003 \001(\002\"v\n\025TreeConstra" + "intsConfig\022\026\n\016max_tree_depth\030\001 \001(\r\022\027\n\017mi" + "n_node_weight\030\002 \001(\002\022,\n$max_number_of_uni" + "que_feature_columns\030\003 \001(\003\"\264\002\n\022LearningRa" + "teConfig\022T\n\005fixed\030\001 \001(\0132C.diplomacy.tens" + "orflow.boosted_trees.learner.LearningRat" + "eFixedConfigH\000\022^\n\007dropout\030\002 \001(\0132K.diplom" + "acy.tensorflow.boosted_trees.learner.Lea" + "rningRateDropoutDrivenConfigH\000\022_\n\013line_s" + "earch\030\003 \001(\0132H.diplomacy.tensorflow.boost" + "ed_trees.learner.LearningRateLineSearchC" + "onfigH\000B\007\n\005tuner\"0\n\027LearningRateFixedCon" + "fig\022\025\n\rlearning_rate\030\001 \001(\002\"L\n\034LearningRa" + "teLineSearchConfig\022\031\n\021max_learning_rate\030" + "\001 \001(\002\022\021\n\tnum_steps\030\002 \001(\005\"a\n\017AveragingCon" + "fig\022\036\n\024average_last_n_trees\030\001 \001(\002H\000\022$\n\032a" + "verage_last_percent_trees\030\002 \001(\002H\000B\010\n\006con" + "fig\"~\n\037LearningRateDropoutDrivenConfig\022\033" + "\n\023dropout_probability\030\001 \001(\002\022\'\n\037probabili" + "ty_of_skipping_dropout\030\002 \001(\002\022\025\n\rlearning" + "_rate\030\003 \001(\002\"\330\t\n\rLearnerConfig\022\023\n\013num_cla" + "sses\030\001 \001(\r\022#\n\031feature_fraction_per_tree\030" + "\002 \001(\002H\000\022$\n\032feature_fraction_per_level\030\003 " + "\001(\002H\000\022\\\n\016regularization\030\004 \001(\0132D.diplomac" + "y.tensorflow.boosted_trees.learner.TreeR" + "egularizationConfig\022V\n\013constraints\030\005 \001(\013" + "2A.diplomacy.tensorflow.boosted_trees.le" + "arner.TreeConstraintsConfig\022[\n\014pruning_m" + "ode\030\010 \001(\0162E.diplomacy.tensorflow.boosted" + "_trees.learner.LearnerConfig.PruningMode" + "\022[\n\014growing_mode\030\t \001(\0162E.diplomacy.tenso" + "rflow.boosted_trees.learner.LearnerConfi" + "g.GrowingMode\022[\n\023learning_rate_tuner\030\006 \001" + "(\0132>.diplomacy.tensorflow.boosted_trees." + "learner.LearningRateConfig\022j\n\024multi_clas" + "s_strategy\030\n \001(\0162L.diplomacy.tensorflow." + "boosted_trees.learner.LearnerConfig.Mult" + "iClassStrategy\022U\n\020averaging_config\030\013 \001(\013" + "2;.diplomacy.tensorflow.boosted_trees.le" + "arner.AveragingConfig\022d\n\021weak_learner_ty" + "pe\030\014 \001(\0162I.diplomacy.tensorflow.boosted_" + "trees.learner.LearnerConfig.WeakLearnerT" + "ype\"J\n\013PruningMode\022\034\n\030PRUNING_MODE_UNSPE" + "CIFIED\020\000\022\r\n\tPRE_PRUNE\020\001\022\016\n\nPOST_PRUNE\020\002\"" + "O\n\013GrowingMode\022\034\n\030GROWING_MODE_UNSPECIFI" + "ED\020\000\022\016\n\nWHOLE_TREE\020\001\022\022\n\016LAYER_BY_LAYER\020\002" + "\"v\n\022MultiClassStrategy\022$\n MULTI_CLASS_ST" + "RATEGY_UNSPECIFIED\020\000\022\022\n\016TREE_PER_CLASS\020\001" + "\022\020\n\014FULL_HESSIAN\020\002\022\024\n\020DIAGONAL_HESSIAN\020\003" + "\"H\n\017WeakLearnerType\022\030\n\024NORMAL_DECISION_T" + "REE\020\000\022\033\n\027OBLIVIOUS_DECISION_TREE\020\001B\022\n\020fe" + "ature_fractionB\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 2227); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { +const ::google::protobuf::EnumDescriptor* LearnerConfig_PruningMode_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_enum_descriptors[0]; +} +bool LearnerConfig_PruningMode_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const LearnerConfig_PruningMode LearnerConfig::PRUNING_MODE_UNSPECIFIED; +const LearnerConfig_PruningMode LearnerConfig::PRE_PRUNE; +const LearnerConfig_PruningMode LearnerConfig::POST_PRUNE; +const LearnerConfig_PruningMode LearnerConfig::PruningMode_MIN; +const LearnerConfig_PruningMode LearnerConfig::PruningMode_MAX; +const int LearnerConfig::PruningMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* LearnerConfig_GrowingMode_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_enum_descriptors[1]; +} +bool LearnerConfig_GrowingMode_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const LearnerConfig_GrowingMode LearnerConfig::GROWING_MODE_UNSPECIFIED; +const LearnerConfig_GrowingMode LearnerConfig::WHOLE_TREE; +const LearnerConfig_GrowingMode LearnerConfig::LAYER_BY_LAYER; +const LearnerConfig_GrowingMode LearnerConfig::GrowingMode_MIN; +const LearnerConfig_GrowingMode LearnerConfig::GrowingMode_MAX; +const int LearnerConfig::GrowingMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* LearnerConfig_MultiClassStrategy_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_enum_descriptors[2]; +} +bool LearnerConfig_MultiClassStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const LearnerConfig_MultiClassStrategy LearnerConfig::MULTI_CLASS_STRATEGY_UNSPECIFIED; +const LearnerConfig_MultiClassStrategy LearnerConfig::TREE_PER_CLASS; +const LearnerConfig_MultiClassStrategy LearnerConfig::FULL_HESSIAN; +const LearnerConfig_MultiClassStrategy LearnerConfig::DIAGONAL_HESSIAN; +const LearnerConfig_MultiClassStrategy LearnerConfig::MultiClassStrategy_MIN; +const LearnerConfig_MultiClassStrategy LearnerConfig::MultiClassStrategy_MAX; +const int LearnerConfig::MultiClassStrategy_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* LearnerConfig_WeakLearnerType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_enum_descriptors[3]; +} +bool LearnerConfig_WeakLearnerType_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const LearnerConfig_WeakLearnerType LearnerConfig::NORMAL_DECISION_TREE; +const LearnerConfig_WeakLearnerType LearnerConfig::OBLIVIOUS_DECISION_TREE; +const LearnerConfig_WeakLearnerType LearnerConfig::WeakLearnerType_MIN; +const LearnerConfig_WeakLearnerType LearnerConfig::WeakLearnerType_MAX; +const int LearnerConfig::WeakLearnerType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void TreeRegularizationConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeRegularizationConfig::kL1FieldNumber; +const int TreeRegularizationConfig::kL2FieldNumber; +const int TreeRegularizationConfig::kTreeComplexityFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeRegularizationConfig::TreeRegularizationConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeRegularizationConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) +} +TreeRegularizationConfig::TreeRegularizationConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeRegularizationConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) +} +TreeRegularizationConfig::TreeRegularizationConfig(const TreeRegularizationConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&l1_, &from.l1_, + static_cast(reinterpret_cast(&tree_complexity_) - + reinterpret_cast(&l1_)) + sizeof(tree_complexity_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) +} + +void TreeRegularizationConfig::SharedCtor() { + ::memset(&l1_, 0, static_cast( + reinterpret_cast(&tree_complexity_) - + reinterpret_cast(&l1_)) + sizeof(tree_complexity_)); +} + +TreeRegularizationConfig::~TreeRegularizationConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + SharedDtor(); +} + +void TreeRegularizationConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TreeRegularizationConfig::ArenaDtor(void* object) { + TreeRegularizationConfig* _this = reinterpret_cast< TreeRegularizationConfig* >(object); + (void)_this; +} +void TreeRegularizationConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeRegularizationConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeRegularizationConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeRegularizationConfig& TreeRegularizationConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeRegularizationConfig.base); + return *internal_default_instance(); +} + + +void TreeRegularizationConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&l1_, 0, static_cast( + reinterpret_cast(&tree_complexity_) - + reinterpret_cast(&l1_)) + sizeof(tree_complexity_)); + _internal_metadata_.Clear(); +} + +bool TreeRegularizationConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float l1 = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &l1_))); + } else { + goto handle_unusual; + } + break; + } + + // float l2 = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &l2_))); + } else { + goto handle_unusual; + } + break; + } + + // float tree_complexity = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &tree_complexity_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + return false; +#undef DO_ +} + +void TreeRegularizationConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l1 = 1; + if (this->l1() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->l1(), output); + } + + // float l2 = 2; + if (this->l2() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->l2(), output); + } + + // float tree_complexity = 3; + if (this->tree_complexity() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->tree_complexity(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) +} + +::google::protobuf::uint8* TreeRegularizationConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l1 = 1; + if (this->l1() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->l1(), target); + } + + // float l2 = 2; + if (this->l2() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->l2(), target); + } + + // float tree_complexity = 3; + if (this->tree_complexity() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->tree_complexity(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + return target; +} + +size_t TreeRegularizationConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float l1 = 1; + if (this->l1() != 0) { + total_size += 1 + 4; + } + + // float l2 = 2; + if (this->l2() != 0) { + total_size += 1 + 4; + } + + // float tree_complexity = 3; + if (this->tree_complexity() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeRegularizationConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + GOOGLE_DCHECK_NE(&from, this); + const TreeRegularizationConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + MergeFrom(*source); + } +} + +void TreeRegularizationConfig::MergeFrom(const TreeRegularizationConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.l1() != 0) { + set_l1(from.l1()); + } + if (from.l2() != 0) { + set_l2(from.l2()); + } + if (from.tree_complexity() != 0) { + set_tree_complexity(from.tree_complexity()); + } +} + +void TreeRegularizationConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeRegularizationConfig::CopyFrom(const TreeRegularizationConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeRegularizationConfig::IsInitialized() const { + return true; +} + +void TreeRegularizationConfig::Swap(TreeRegularizationConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeRegularizationConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeRegularizationConfig::UnsafeArenaSwap(TreeRegularizationConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeRegularizationConfig::InternalSwap(TreeRegularizationConfig* other) { + using std::swap; + swap(l1_, other->l1_); + swap(l2_, other->l2_); + swap(tree_complexity_, other->tree_complexity_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeRegularizationConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TreeConstraintsConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeConstraintsConfig::kMaxTreeDepthFieldNumber; +const int TreeConstraintsConfig::kMinNodeWeightFieldNumber; +const int TreeConstraintsConfig::kMaxNumberOfUniqueFeatureColumnsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeConstraintsConfig::TreeConstraintsConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeConstraintsConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) +} +TreeConstraintsConfig::TreeConstraintsConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeConstraintsConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) +} +TreeConstraintsConfig::TreeConstraintsConfig(const TreeConstraintsConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&max_tree_depth_, &from.max_tree_depth_, + static_cast(reinterpret_cast(&max_number_of_unique_feature_columns_) - + reinterpret_cast(&max_tree_depth_)) + sizeof(max_number_of_unique_feature_columns_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) +} + +void TreeConstraintsConfig::SharedCtor() { + ::memset(&max_tree_depth_, 0, static_cast( + reinterpret_cast(&max_number_of_unique_feature_columns_) - + reinterpret_cast(&max_tree_depth_)) + sizeof(max_number_of_unique_feature_columns_)); +} + +TreeConstraintsConfig::~TreeConstraintsConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + SharedDtor(); +} + +void TreeConstraintsConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TreeConstraintsConfig::ArenaDtor(void* object) { + TreeConstraintsConfig* _this = reinterpret_cast< TreeConstraintsConfig* >(object); + (void)_this; +} +void TreeConstraintsConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeConstraintsConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeConstraintsConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeConstraintsConfig& TreeConstraintsConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_TreeConstraintsConfig.base); + return *internal_default_instance(); +} + + +void TreeConstraintsConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&max_tree_depth_, 0, static_cast( + reinterpret_cast(&max_number_of_unique_feature_columns_) - + reinterpret_cast(&max_tree_depth_)) + sizeof(max_number_of_unique_feature_columns_)); + _internal_metadata_.Clear(); +} + +bool TreeConstraintsConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // uint32 max_tree_depth = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &max_tree_depth_))); + } else { + goto handle_unusual; + } + break; + } + + // float min_node_weight = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_node_weight_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 max_number_of_unique_feature_columns = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &max_number_of_unique_feature_columns_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + return false; +#undef DO_ +} + +void TreeConstraintsConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 max_tree_depth = 1; + if (this->max_tree_depth() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->max_tree_depth(), output); + } + + // float min_node_weight = 2; + if (this->min_node_weight() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->min_node_weight(), output); + } + + // int64 max_number_of_unique_feature_columns = 3; + if (this->max_number_of_unique_feature_columns() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->max_number_of_unique_feature_columns(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) +} + +::google::protobuf::uint8* TreeConstraintsConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 max_tree_depth = 1; + if (this->max_tree_depth() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->max_tree_depth(), target); + } + + // float min_node_weight = 2; + if (this->min_node_weight() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->min_node_weight(), target); + } + + // int64 max_number_of_unique_feature_columns = 3; + if (this->max_number_of_unique_feature_columns() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->max_number_of_unique_feature_columns(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + return target; +} + +size_t TreeConstraintsConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // uint32 max_tree_depth = 1; + if (this->max_tree_depth() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->max_tree_depth()); + } + + // float min_node_weight = 2; + if (this->min_node_weight() != 0) { + total_size += 1 + 4; + } + + // int64 max_number_of_unique_feature_columns = 3; + if (this->max_number_of_unique_feature_columns() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->max_number_of_unique_feature_columns()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeConstraintsConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + GOOGLE_DCHECK_NE(&from, this); + const TreeConstraintsConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + MergeFrom(*source); + } +} + +void TreeConstraintsConfig::MergeFrom(const TreeConstraintsConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.max_tree_depth() != 0) { + set_max_tree_depth(from.max_tree_depth()); + } + if (from.min_node_weight() != 0) { + set_min_node_weight(from.min_node_weight()); + } + if (from.max_number_of_unique_feature_columns() != 0) { + set_max_number_of_unique_feature_columns(from.max_number_of_unique_feature_columns()); + } +} + +void TreeConstraintsConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeConstraintsConfig::CopyFrom(const TreeConstraintsConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeConstraintsConfig::IsInitialized() const { + return true; +} + +void TreeConstraintsConfig::Swap(TreeConstraintsConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeConstraintsConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeConstraintsConfig::UnsafeArenaSwap(TreeConstraintsConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeConstraintsConfig::InternalSwap(TreeConstraintsConfig* other) { + using std::swap; + swap(max_tree_depth_, other->max_tree_depth_); + swap(min_node_weight_, other->min_node_weight_); + swap(max_number_of_unique_feature_columns_, other->max_number_of_unique_feature_columns_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeConstraintsConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LearningRateConfig::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::learner::_LearningRateConfig_default_instance_.fixed_ = const_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig*>( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::learner::_LearningRateConfig_default_instance_.dropout_ = const_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig*>( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::learner::_LearningRateConfig_default_instance_.line_search_ = const_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig*>( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig::internal_default_instance()); +} +void LearningRateConfig::set_allocated_fixed(::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* fixed) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_tuner(); + if (fixed) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(fixed); + if (message_arena != submessage_arena) { + fixed = ::google::protobuf::internal::GetOwnedMessage( + message_arena, fixed, submessage_arena); + } + set_has_fixed(); + tuner_.fixed_ = fixed; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.fixed) +} +void LearningRateConfig::set_allocated_dropout(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* dropout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_tuner(); + if (dropout) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(dropout); + if (message_arena != submessage_arena) { + dropout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dropout, submessage_arena); + } + set_has_dropout(); + tuner_.dropout_ = dropout; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.dropout) +} +void LearningRateConfig::set_allocated_line_search(::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* line_search) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_tuner(); + if (line_search) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(line_search); + if (message_arena != submessage_arena) { + line_search = ::google::protobuf::internal::GetOwnedMessage( + message_arena, line_search, submessage_arena); + } + set_has_line_search(); + tuner_.line_search_ = line_search; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.line_search) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LearningRateConfig::kFixedFieldNumber; +const int LearningRateConfig::kDropoutFieldNumber; +const int LearningRateConfig::kLineSearchFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LearningRateConfig::LearningRateConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) +} +LearningRateConfig::LearningRateConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) +} +LearningRateConfig::LearningRateConfig(const LearningRateConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_tuner(); + switch (from.tuner_case()) { + case kFixed: { + mutable_fixed()->::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig::MergeFrom(from.fixed()); + break; + } + case kDropout: { + mutable_dropout()->::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig::MergeFrom(from.dropout()); + break; + } + case kLineSearch: { + mutable_line_search()->::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig::MergeFrom(from.line_search()); + break; + } + case TUNER_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) +} + +void LearningRateConfig::SharedCtor() { + clear_has_tuner(); +} + +LearningRateConfig::~LearningRateConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + SharedDtor(); +} + +void LearningRateConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_tuner()) { + clear_tuner(); + } +} + +void LearningRateConfig::ArenaDtor(void* object) { + LearningRateConfig* _this = reinterpret_cast< LearningRateConfig* >(object); + (void)_this; +} +void LearningRateConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LearningRateConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LearningRateConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LearningRateConfig& LearningRateConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateConfig.base); + return *internal_default_instance(); +} + + +void LearningRateConfig::clear_tuner() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + switch (tuner_case()) { + case kFixed: { + if (GetArenaNoVirtual() == NULL) { + delete tuner_.fixed_; + } + break; + } + case kDropout: { + if (GetArenaNoVirtual() == NULL) { + delete tuner_.dropout_; + } + break; + } + case kLineSearch: { + if (GetArenaNoVirtual() == NULL) { + delete tuner_.line_search_; + } + break; + } + case TUNER_NOT_SET: { + break; + } + } + _oneof_case_[0] = TUNER_NOT_SET; +} + + +void LearningRateConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_tuner(); + _internal_metadata_.Clear(); +} + +bool LearningRateConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig fixed = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_fixed())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig dropout = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dropout())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig line_search = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_line_search())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + return false; +#undef DO_ +} + +void LearningRateConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig fixed = 1; + if (has_fixed()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_fixed(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig dropout = 2; + if (has_dropout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_dropout(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig line_search = 3; + if (has_line_search()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_line_search(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) +} + +::google::protobuf::uint8* LearningRateConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig fixed = 1; + if (has_fixed()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_fixed(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig dropout = 2; + if (has_dropout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_dropout(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig line_search = 3; + if (has_line_search()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_line_search(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + return target; +} + +size_t LearningRateConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (tuner_case()) { + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig fixed = 1; + case kFixed: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tuner_.fixed_); + break; + } + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig dropout = 2; + case kDropout: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tuner_.dropout_); + break; + } + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig line_search = 3; + case kLineSearch: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tuner_.line_search_); + break; + } + case TUNER_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LearningRateConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + GOOGLE_DCHECK_NE(&from, this); + const LearningRateConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + MergeFrom(*source); + } +} + +void LearningRateConfig::MergeFrom(const LearningRateConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.tuner_case()) { + case kFixed: { + mutable_fixed()->::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig::MergeFrom(from.fixed()); + break; + } + case kDropout: { + mutable_dropout()->::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig::MergeFrom(from.dropout()); + break; + } + case kLineSearch: { + mutable_line_search()->::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig::MergeFrom(from.line_search()); + break; + } + case TUNER_NOT_SET: { + break; + } + } +} + +void LearningRateConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LearningRateConfig::CopyFrom(const LearningRateConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LearningRateConfig::IsInitialized() const { + return true; +} + +void LearningRateConfig::Swap(LearningRateConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LearningRateConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LearningRateConfig::UnsafeArenaSwap(LearningRateConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LearningRateConfig::InternalSwap(LearningRateConfig* other) { + using std::swap; + swap(tuner_, other->tuner_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LearningRateConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LearningRateFixedConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LearningRateFixedConfig::kLearningRateFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LearningRateFixedConfig::LearningRateFixedConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateFixedConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) +} +LearningRateFixedConfig::LearningRateFixedConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateFixedConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) +} +LearningRateFixedConfig::LearningRateFixedConfig(const LearningRateFixedConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + learning_rate_ = from.learning_rate_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) +} + +void LearningRateFixedConfig::SharedCtor() { + learning_rate_ = 0; +} + +LearningRateFixedConfig::~LearningRateFixedConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + SharedDtor(); +} + +void LearningRateFixedConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void LearningRateFixedConfig::ArenaDtor(void* object) { + LearningRateFixedConfig* _this = reinterpret_cast< LearningRateFixedConfig* >(object); + (void)_this; +} +void LearningRateFixedConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LearningRateFixedConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LearningRateFixedConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LearningRateFixedConfig& LearningRateFixedConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateFixedConfig.base); + return *internal_default_instance(); +} + + +void LearningRateFixedConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + learning_rate_ = 0; + _internal_metadata_.Clear(); +} + +bool LearningRateFixedConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float learning_rate = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &learning_rate_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + return false; +#undef DO_ +} + +void LearningRateFixedConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float learning_rate = 1; + if (this->learning_rate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->learning_rate(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) +} + +::google::protobuf::uint8* LearningRateFixedConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float learning_rate = 1; + if (this->learning_rate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->learning_rate(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + return target; +} + +size_t LearningRateFixedConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float learning_rate = 1; + if (this->learning_rate() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LearningRateFixedConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + GOOGLE_DCHECK_NE(&from, this); + const LearningRateFixedConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + MergeFrom(*source); + } +} + +void LearningRateFixedConfig::MergeFrom(const LearningRateFixedConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.learning_rate() != 0) { + set_learning_rate(from.learning_rate()); + } +} + +void LearningRateFixedConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LearningRateFixedConfig::CopyFrom(const LearningRateFixedConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LearningRateFixedConfig::IsInitialized() const { + return true; +} + +void LearningRateFixedConfig::Swap(LearningRateFixedConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LearningRateFixedConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LearningRateFixedConfig::UnsafeArenaSwap(LearningRateFixedConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LearningRateFixedConfig::InternalSwap(LearningRateFixedConfig* other) { + using std::swap; + swap(learning_rate_, other->learning_rate_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LearningRateFixedConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LearningRateLineSearchConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LearningRateLineSearchConfig::kMaxLearningRateFieldNumber; +const int LearningRateLineSearchConfig::kNumStepsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LearningRateLineSearchConfig::LearningRateLineSearchConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateLineSearchConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) +} +LearningRateLineSearchConfig::LearningRateLineSearchConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateLineSearchConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) +} +LearningRateLineSearchConfig::LearningRateLineSearchConfig(const LearningRateLineSearchConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&max_learning_rate_, &from.max_learning_rate_, + static_cast(reinterpret_cast(&num_steps_) - + reinterpret_cast(&max_learning_rate_)) + sizeof(num_steps_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) +} + +void LearningRateLineSearchConfig::SharedCtor() { + ::memset(&max_learning_rate_, 0, static_cast( + reinterpret_cast(&num_steps_) - + reinterpret_cast(&max_learning_rate_)) + sizeof(num_steps_)); +} + +LearningRateLineSearchConfig::~LearningRateLineSearchConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + SharedDtor(); +} + +void LearningRateLineSearchConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void LearningRateLineSearchConfig::ArenaDtor(void* object) { + LearningRateLineSearchConfig* _this = reinterpret_cast< LearningRateLineSearchConfig* >(object); + (void)_this; +} +void LearningRateLineSearchConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LearningRateLineSearchConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LearningRateLineSearchConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LearningRateLineSearchConfig& LearningRateLineSearchConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateLineSearchConfig.base); + return *internal_default_instance(); +} + + +void LearningRateLineSearchConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&max_learning_rate_, 0, static_cast( + reinterpret_cast(&num_steps_) - + reinterpret_cast(&max_learning_rate_)) + sizeof(num_steps_)); + _internal_metadata_.Clear(); +} + +bool LearningRateLineSearchConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float max_learning_rate = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_learning_rate_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_steps = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_steps_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + return false; +#undef DO_ +} + +void LearningRateLineSearchConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float max_learning_rate = 1; + if (this->max_learning_rate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->max_learning_rate(), output); + } + + // int32 num_steps = 2; + if (this->num_steps() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_steps(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) +} + +::google::protobuf::uint8* LearningRateLineSearchConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float max_learning_rate = 1; + if (this->max_learning_rate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->max_learning_rate(), target); + } + + // int32 num_steps = 2; + if (this->num_steps() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_steps(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + return target; +} + +size_t LearningRateLineSearchConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float max_learning_rate = 1; + if (this->max_learning_rate() != 0) { + total_size += 1 + 4; + } + + // int32 num_steps = 2; + if (this->num_steps() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_steps()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LearningRateLineSearchConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + GOOGLE_DCHECK_NE(&from, this); + const LearningRateLineSearchConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + MergeFrom(*source); + } +} + +void LearningRateLineSearchConfig::MergeFrom(const LearningRateLineSearchConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.max_learning_rate() != 0) { + set_max_learning_rate(from.max_learning_rate()); + } + if (from.num_steps() != 0) { + set_num_steps(from.num_steps()); + } +} + +void LearningRateLineSearchConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LearningRateLineSearchConfig::CopyFrom(const LearningRateLineSearchConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LearningRateLineSearchConfig::IsInitialized() const { + return true; +} + +void LearningRateLineSearchConfig::Swap(LearningRateLineSearchConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LearningRateLineSearchConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LearningRateLineSearchConfig::UnsafeArenaSwap(LearningRateLineSearchConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LearningRateLineSearchConfig::InternalSwap(LearningRateLineSearchConfig* other) { + using std::swap; + swap(max_learning_rate_, other->max_learning_rate_); + swap(num_steps_, other->num_steps_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LearningRateLineSearchConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void AveragingConfig::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::learner::_AveragingConfig_default_instance_.average_last_n_trees_ = 0; + ::diplomacy::tensorflow::boosted_trees::learner::_AveragingConfig_default_instance_.average_last_percent_trees_ = 0; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AveragingConfig::kAverageLastNTreesFieldNumber; +const int AveragingConfig::kAverageLastPercentTreesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AveragingConfig::AveragingConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_AveragingConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) +} +AveragingConfig::AveragingConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_AveragingConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) +} +AveragingConfig::AveragingConfig(const AveragingConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_config(); + switch (from.config_case()) { + case kAverageLastNTrees: { + set_average_last_n_trees(from.average_last_n_trees()); + break; + } + case kAverageLastPercentTrees: { + set_average_last_percent_trees(from.average_last_percent_trees()); + break; + } + case CONFIG_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) +} + +void AveragingConfig::SharedCtor() { + clear_has_config(); +} + +AveragingConfig::~AveragingConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + SharedDtor(); +} + +void AveragingConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_config()) { + clear_config(); + } +} + +void AveragingConfig::ArenaDtor(void* object) { + AveragingConfig* _this = reinterpret_cast< AveragingConfig* >(object); + (void)_this; +} +void AveragingConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AveragingConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AveragingConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AveragingConfig& AveragingConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_AveragingConfig.base); + return *internal_default_instance(); +} + + +void AveragingConfig::clear_config() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + switch (config_case()) { + case kAverageLastNTrees: { + // No need to clear + break; + } + case kAverageLastPercentTrees: { + // No need to clear + break; + } + case CONFIG_NOT_SET: { + break; + } + } + _oneof_case_[0] = CONFIG_NOT_SET; +} + + +void AveragingConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_config(); + _internal_metadata_.Clear(); +} + +bool AveragingConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float average_last_n_trees = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + clear_config(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &config_.average_last_n_trees_))); + set_has_average_last_n_trees(); + } else { + goto handle_unusual; + } + break; + } + + // float average_last_percent_trees = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + clear_config(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &config_.average_last_percent_trees_))); + set_has_average_last_percent_trees(); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + return false; +#undef DO_ +} + +void AveragingConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float average_last_n_trees = 1; + if (has_average_last_n_trees()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->average_last_n_trees(), output); + } + + // float average_last_percent_trees = 2; + if (has_average_last_percent_trees()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->average_last_percent_trees(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) +} + +::google::protobuf::uint8* AveragingConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float average_last_n_trees = 1; + if (has_average_last_n_trees()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->average_last_n_trees(), target); + } + + // float average_last_percent_trees = 2; + if (has_average_last_percent_trees()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->average_last_percent_trees(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + return target; +} + +size_t AveragingConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (config_case()) { + // float average_last_n_trees = 1; + case kAverageLastNTrees: { + total_size += 1 + 4; + break; + } + // float average_last_percent_trees = 2; + case kAverageLastPercentTrees: { + total_size += 1 + 4; + break; + } + case CONFIG_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AveragingConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + GOOGLE_DCHECK_NE(&from, this); + const AveragingConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + MergeFrom(*source); + } +} + +void AveragingConfig::MergeFrom(const AveragingConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.config_case()) { + case kAverageLastNTrees: { + set_average_last_n_trees(from.average_last_n_trees()); + break; + } + case kAverageLastPercentTrees: { + set_average_last_percent_trees(from.average_last_percent_trees()); + break; + } + case CONFIG_NOT_SET: { + break; + } + } +} + +void AveragingConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AveragingConfig::CopyFrom(const AveragingConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AveragingConfig::IsInitialized() const { + return true; +} + +void AveragingConfig::Swap(AveragingConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AveragingConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void AveragingConfig::UnsafeArenaSwap(AveragingConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AveragingConfig::InternalSwap(AveragingConfig* other) { + using std::swap; + swap(config_, other->config_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AveragingConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LearningRateDropoutDrivenConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LearningRateDropoutDrivenConfig::kDropoutProbabilityFieldNumber; +const int LearningRateDropoutDrivenConfig::kProbabilityOfSkippingDropoutFieldNumber; +const int LearningRateDropoutDrivenConfig::kLearningRateFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LearningRateDropoutDrivenConfig::LearningRateDropoutDrivenConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateDropoutDrivenConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) +} +LearningRateDropoutDrivenConfig::LearningRateDropoutDrivenConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateDropoutDrivenConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) +} +LearningRateDropoutDrivenConfig::LearningRateDropoutDrivenConfig(const LearningRateDropoutDrivenConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&dropout_probability_, &from.dropout_probability_, + static_cast(reinterpret_cast(&learning_rate_) - + reinterpret_cast(&dropout_probability_)) + sizeof(learning_rate_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) +} + +void LearningRateDropoutDrivenConfig::SharedCtor() { + ::memset(&dropout_probability_, 0, static_cast( + reinterpret_cast(&learning_rate_) - + reinterpret_cast(&dropout_probability_)) + sizeof(learning_rate_)); +} + +LearningRateDropoutDrivenConfig::~LearningRateDropoutDrivenConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + SharedDtor(); +} + +void LearningRateDropoutDrivenConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void LearningRateDropoutDrivenConfig::ArenaDtor(void* object) { + LearningRateDropoutDrivenConfig* _this = reinterpret_cast< LearningRateDropoutDrivenConfig* >(object); + (void)_this; +} +void LearningRateDropoutDrivenConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LearningRateDropoutDrivenConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LearningRateDropoutDrivenConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LearningRateDropoutDrivenConfig& LearningRateDropoutDrivenConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearningRateDropoutDrivenConfig.base); + return *internal_default_instance(); +} + + +void LearningRateDropoutDrivenConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&dropout_probability_, 0, static_cast( + reinterpret_cast(&learning_rate_) - + reinterpret_cast(&dropout_probability_)) + sizeof(learning_rate_)); + _internal_metadata_.Clear(); +} + +bool LearningRateDropoutDrivenConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float dropout_probability = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_probability_))); + } else { + goto handle_unusual; + } + break; + } + + // float probability_of_skipping_dropout = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &probability_of_skipping_dropout_))); + } else { + goto handle_unusual; + } + break; + } + + // float learning_rate = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &learning_rate_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + return false; +#undef DO_ +} + +void LearningRateDropoutDrivenConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float dropout_probability = 1; + if (this->dropout_probability() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->dropout_probability(), output); + } + + // float probability_of_skipping_dropout = 2; + if (this->probability_of_skipping_dropout() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->probability_of_skipping_dropout(), output); + } + + // float learning_rate = 3; + if (this->learning_rate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->learning_rate(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) +} + +::google::protobuf::uint8* LearningRateDropoutDrivenConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float dropout_probability = 1; + if (this->dropout_probability() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->dropout_probability(), target); + } + + // float probability_of_skipping_dropout = 2; + if (this->probability_of_skipping_dropout() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->probability_of_skipping_dropout(), target); + } + + // float learning_rate = 3; + if (this->learning_rate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->learning_rate(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + return target; +} + +size_t LearningRateDropoutDrivenConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float dropout_probability = 1; + if (this->dropout_probability() != 0) { + total_size += 1 + 4; + } + + // float probability_of_skipping_dropout = 2; + if (this->probability_of_skipping_dropout() != 0) { + total_size += 1 + 4; + } + + // float learning_rate = 3; + if (this->learning_rate() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LearningRateDropoutDrivenConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + GOOGLE_DCHECK_NE(&from, this); + const LearningRateDropoutDrivenConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + MergeFrom(*source); + } +} + +void LearningRateDropoutDrivenConfig::MergeFrom(const LearningRateDropoutDrivenConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.dropout_probability() != 0) { + set_dropout_probability(from.dropout_probability()); + } + if (from.probability_of_skipping_dropout() != 0) { + set_probability_of_skipping_dropout(from.probability_of_skipping_dropout()); + } + if (from.learning_rate() != 0) { + set_learning_rate(from.learning_rate()); + } +} + +void LearningRateDropoutDrivenConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LearningRateDropoutDrivenConfig::CopyFrom(const LearningRateDropoutDrivenConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LearningRateDropoutDrivenConfig::IsInitialized() const { + return true; +} + +void LearningRateDropoutDrivenConfig::Swap(LearningRateDropoutDrivenConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LearningRateDropoutDrivenConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LearningRateDropoutDrivenConfig::UnsafeArenaSwap(LearningRateDropoutDrivenConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LearningRateDropoutDrivenConfig::InternalSwap(LearningRateDropoutDrivenConfig* other) { + using std::swap; + swap(dropout_probability_, other->dropout_probability_); + swap(probability_of_skipping_dropout_, other->probability_of_skipping_dropout_); + swap(learning_rate_, other->learning_rate_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LearningRateDropoutDrivenConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LearnerConfig::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_.feature_fraction_per_tree_ = 0; + ::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_.feature_fraction_per_level_ = 0; + ::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_._instance.get_mutable()->regularization_ = const_cast< ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig*>( + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_._instance.get_mutable()->constraints_ = const_cast< ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig*>( + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_._instance.get_mutable()->learning_rate_tuner_ = const_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig*>( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::learner::_LearnerConfig_default_instance_._instance.get_mutable()->averaging_config_ = const_cast< ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig*>( + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig::internal_default_instance()); +} +void LearnerConfig::unsafe_arena_set_allocated_regularization( + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* regularization) { + if (GetArenaNoVirtual() == NULL) { + delete regularization_; + } + regularization_ = regularization; + if (regularization) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.regularization) +} +void LearnerConfig::unsafe_arena_set_allocated_constraints( + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* constraints) { + if (GetArenaNoVirtual() == NULL) { + delete constraints_; + } + constraints_ = constraints; + if (constraints) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.constraints) +} +void LearnerConfig::unsafe_arena_set_allocated_learning_rate_tuner( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* learning_rate_tuner) { + if (GetArenaNoVirtual() == NULL) { + delete learning_rate_tuner_; + } + learning_rate_tuner_ = learning_rate_tuner; + if (learning_rate_tuner) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.learning_rate_tuner) +} +void LearnerConfig::unsafe_arena_set_allocated_averaging_config( + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* averaging_config) { + if (GetArenaNoVirtual() == NULL) { + delete averaging_config_; + } + averaging_config_ = averaging_config; + if (averaging_config) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.averaging_config) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LearnerConfig::kNumClassesFieldNumber; +const int LearnerConfig::kFeatureFractionPerTreeFieldNumber; +const int LearnerConfig::kFeatureFractionPerLevelFieldNumber; +const int LearnerConfig::kRegularizationFieldNumber; +const int LearnerConfig::kConstraintsFieldNumber; +const int LearnerConfig::kPruningModeFieldNumber; +const int LearnerConfig::kGrowingModeFieldNumber; +const int LearnerConfig::kLearningRateTunerFieldNumber; +const int LearnerConfig::kMultiClassStrategyFieldNumber; +const int LearnerConfig::kAveragingConfigFieldNumber; +const int LearnerConfig::kWeakLearnerTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LearnerConfig::LearnerConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearnerConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) +} +LearnerConfig::LearnerConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearnerConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) +} +LearnerConfig::LearnerConfig(const LearnerConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_regularization()) { + regularization_ = new ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig(*from.regularization_); + } else { + regularization_ = NULL; + } + if (from.has_constraints()) { + constraints_ = new ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig(*from.constraints_); + } else { + constraints_ = NULL; + } + if (from.has_learning_rate_tuner()) { + learning_rate_tuner_ = new ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig(*from.learning_rate_tuner_); + } else { + learning_rate_tuner_ = NULL; + } + if (from.has_averaging_config()) { + averaging_config_ = new ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig(*from.averaging_config_); + } else { + averaging_config_ = NULL; + } + ::memcpy(&num_classes_, &from.num_classes_, + static_cast(reinterpret_cast(&weak_learner_type_) - + reinterpret_cast(&num_classes_)) + sizeof(weak_learner_type_)); + clear_has_feature_fraction(); + switch (from.feature_fraction_case()) { + case kFeatureFractionPerTree: { + set_feature_fraction_per_tree(from.feature_fraction_per_tree()); + break; + } + case kFeatureFractionPerLevel: { + set_feature_fraction_per_level(from.feature_fraction_per_level()); + break; + } + case FEATURE_FRACTION_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) +} + +void LearnerConfig::SharedCtor() { + ::memset(®ularization_, 0, static_cast( + reinterpret_cast(&weak_learner_type_) - + reinterpret_cast(®ularization_)) + sizeof(weak_learner_type_)); + clear_has_feature_fraction(); +} + +LearnerConfig::~LearnerConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + SharedDtor(); +} + +void LearnerConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete regularization_; + if (this != internal_default_instance()) delete constraints_; + if (this != internal_default_instance()) delete learning_rate_tuner_; + if (this != internal_default_instance()) delete averaging_config_; + if (has_feature_fraction()) { + clear_feature_fraction(); + } +} + +void LearnerConfig::ArenaDtor(void* object) { + LearnerConfig* _this = reinterpret_cast< LearnerConfig* >(object); + (void)_this; +} +void LearnerConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LearnerConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LearnerConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LearnerConfig& LearnerConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::scc_info_LearnerConfig.base); + return *internal_default_instance(); +} + + +void LearnerConfig::clear_feature_fraction() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + switch (feature_fraction_case()) { + case kFeatureFractionPerTree: { + // No need to clear + break; + } + case kFeatureFractionPerLevel: { + // No need to clear + break; + } + case FEATURE_FRACTION_NOT_SET: { + break; + } + } + _oneof_case_[0] = FEATURE_FRACTION_NOT_SET; +} + + +void LearnerConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && regularization_ != NULL) { + delete regularization_; + } + regularization_ = NULL; + if (GetArenaNoVirtual() == NULL && constraints_ != NULL) { + delete constraints_; + } + constraints_ = NULL; + if (GetArenaNoVirtual() == NULL && learning_rate_tuner_ != NULL) { + delete learning_rate_tuner_; + } + learning_rate_tuner_ = NULL; + if (GetArenaNoVirtual() == NULL && averaging_config_ != NULL) { + delete averaging_config_; + } + averaging_config_ = NULL; + ::memset(&num_classes_, 0, static_cast( + reinterpret_cast(&weak_learner_type_) - + reinterpret_cast(&num_classes_)) + sizeof(weak_learner_type_)); + clear_feature_fraction(); + _internal_metadata_.Clear(); +} + +bool LearnerConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // uint32 num_classes = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_classes_))); + } else { + goto handle_unusual; + } + break; + } + + // float feature_fraction_per_tree = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + clear_feature_fraction(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &feature_fraction_.feature_fraction_per_tree_))); + set_has_feature_fraction_per_tree(); + } else { + goto handle_unusual; + } + break; + } + + // float feature_fraction_per_level = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + clear_feature_fraction(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &feature_fraction_.feature_fraction_per_level_))); + set_has_feature_fraction_per_level(); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig regularization = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_regularization())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig constraints = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_constraints())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig learning_rate_tuner = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_learning_rate_tuner())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode pruning_mode = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_pruning_mode(static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode growing_mode = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_growing_mode(static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy multi_class_strategy = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_multi_class_strategy(static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.AveragingConfig averaging_config = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_averaging_config())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType weak_learner_type = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_weak_learner_type(static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + return false; +#undef DO_ +} + +void LearnerConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 num_classes = 1; + if (this->num_classes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_classes(), output); + } + + // float feature_fraction_per_tree = 2; + if (has_feature_fraction_per_tree()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->feature_fraction_per_tree(), output); + } + + // float feature_fraction_per_level = 3; + if (has_feature_fraction_per_level()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->feature_fraction_per_level(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig regularization = 4; + if (this->has_regularization()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_regularization(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig constraints = 5; + if (this->has_constraints()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_constraints(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig learning_rate_tuner = 6; + if (this->has_learning_rate_tuner()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_learning_rate_tuner(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode pruning_mode = 8; + if (this->pruning_mode() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->pruning_mode(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode growing_mode = 9; + if (this->growing_mode() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 9, this->growing_mode(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy multi_class_strategy = 10; + if (this->multi_class_strategy() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 10, this->multi_class_strategy(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.AveragingConfig averaging_config = 11; + if (this->has_averaging_config()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->_internal_averaging_config(), output); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType weak_learner_type = 12; + if (this->weak_learner_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 12, this->weak_learner_type(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) +} + +::google::protobuf::uint8* LearnerConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 num_classes = 1; + if (this->num_classes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_classes(), target); + } + + // float feature_fraction_per_tree = 2; + if (has_feature_fraction_per_tree()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->feature_fraction_per_tree(), target); + } + + // float feature_fraction_per_level = 3; + if (has_feature_fraction_per_level()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->feature_fraction_per_level(), target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig regularization = 4; + if (this->has_regularization()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_regularization(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig constraints = 5; + if (this->has_constraints()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_constraints(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig learning_rate_tuner = 6; + if (this->has_learning_rate_tuner()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_learning_rate_tuner(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode pruning_mode = 8; + if (this->pruning_mode() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 8, this->pruning_mode(), target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode growing_mode = 9; + if (this->growing_mode() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 9, this->growing_mode(), target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy multi_class_strategy = 10; + if (this->multi_class_strategy() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 10, this->multi_class_strategy(), target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.AveragingConfig averaging_config = 11; + if (this->has_averaging_config()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 11, this->_internal_averaging_config(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType weak_learner_type = 12; + if (this->weak_learner_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 12, this->weak_learner_type(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + return target; +} + +size_t LearnerConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig regularization = 4; + if (this->has_regularization()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *regularization_); + } + + // .diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig constraints = 5; + if (this->has_constraints()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *constraints_); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig learning_rate_tuner = 6; + if (this->has_learning_rate_tuner()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *learning_rate_tuner_); + } + + // .diplomacy.tensorflow.boosted_trees.learner.AveragingConfig averaging_config = 11; + if (this->has_averaging_config()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *averaging_config_); + } + + // uint32 num_classes = 1; + if (this->num_classes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_classes()); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode pruning_mode = 8; + if (this->pruning_mode() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pruning_mode()); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode growing_mode = 9; + if (this->growing_mode() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->growing_mode()); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy multi_class_strategy = 10; + if (this->multi_class_strategy() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->multi_class_strategy()); + } + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType weak_learner_type = 12; + if (this->weak_learner_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->weak_learner_type()); + } + + switch (feature_fraction_case()) { + // float feature_fraction_per_tree = 2; + case kFeatureFractionPerTree: { + total_size += 1 + 4; + break; + } + // float feature_fraction_per_level = 3; + case kFeatureFractionPerLevel: { + total_size += 1 + 4; + break; + } + case FEATURE_FRACTION_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LearnerConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + GOOGLE_DCHECK_NE(&from, this); + const LearnerConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + MergeFrom(*source); + } +} + +void LearnerConfig::MergeFrom(const LearnerConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_regularization()) { + mutable_regularization()->::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig::MergeFrom(from.regularization()); + } + if (from.has_constraints()) { + mutable_constraints()->::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig::MergeFrom(from.constraints()); + } + if (from.has_learning_rate_tuner()) { + mutable_learning_rate_tuner()->::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig::MergeFrom(from.learning_rate_tuner()); + } + if (from.has_averaging_config()) { + mutable_averaging_config()->::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig::MergeFrom(from.averaging_config()); + } + if (from.num_classes() != 0) { + set_num_classes(from.num_classes()); + } + if (from.pruning_mode() != 0) { + set_pruning_mode(from.pruning_mode()); + } + if (from.growing_mode() != 0) { + set_growing_mode(from.growing_mode()); + } + if (from.multi_class_strategy() != 0) { + set_multi_class_strategy(from.multi_class_strategy()); + } + if (from.weak_learner_type() != 0) { + set_weak_learner_type(from.weak_learner_type()); + } + switch (from.feature_fraction_case()) { + case kFeatureFractionPerTree: { + set_feature_fraction_per_tree(from.feature_fraction_per_tree()); + break; + } + case kFeatureFractionPerLevel: { + set_feature_fraction_per_level(from.feature_fraction_per_level()); + break; + } + case FEATURE_FRACTION_NOT_SET: { + break; + } + } +} + +void LearnerConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LearnerConfig::CopyFrom(const LearnerConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LearnerConfig::IsInitialized() const { + return true; +} + +void LearnerConfig::Swap(LearnerConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LearnerConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LearnerConfig::UnsafeArenaSwap(LearnerConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LearnerConfig::InternalSwap(LearnerConfig* other) { + using std::swap; + swap(regularization_, other->regularization_); + swap(constraints_, other->constraints_); + swap(learning_rate_tuner_, other->learning_rate_tuner_); + swap(averaging_config_, other->averaging_config_); + swap(num_classes_, other->num_classes_); + swap(pruning_mode_, other->pruning_mode_); + swap(growing_mode_, other->growing_mode_); + swap(multi_class_strategy_, other->multi_class_strategy_); + swap(weak_learner_type_, other->weak_learner_type_); + swap(feature_fraction_, other->feature_fraction_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LearnerConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.pb.h new file mode 100644 index 0000000..0c2248e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.pb.h @@ -0,0 +1,2451 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[8]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { +class AveragingConfig; +class AveragingConfigDefaultTypeInternal; +extern AveragingConfigDefaultTypeInternal _AveragingConfig_default_instance_; +class LearnerConfig; +class LearnerConfigDefaultTypeInternal; +extern LearnerConfigDefaultTypeInternal _LearnerConfig_default_instance_; +class LearningRateConfig; +class LearningRateConfigDefaultTypeInternal; +extern LearningRateConfigDefaultTypeInternal _LearningRateConfig_default_instance_; +class LearningRateDropoutDrivenConfig; +class LearningRateDropoutDrivenConfigDefaultTypeInternal; +extern LearningRateDropoutDrivenConfigDefaultTypeInternal _LearningRateDropoutDrivenConfig_default_instance_; +class LearningRateFixedConfig; +class LearningRateFixedConfigDefaultTypeInternal; +extern LearningRateFixedConfigDefaultTypeInternal _LearningRateFixedConfig_default_instance_; +class LearningRateLineSearchConfig; +class LearningRateLineSearchConfigDefaultTypeInternal; +extern LearningRateLineSearchConfigDefaultTypeInternal _LearningRateLineSearchConfig_default_instance_; +class TreeConstraintsConfig; +class TreeConstraintsConfigDefaultTypeInternal; +extern TreeConstraintsConfigDefaultTypeInternal _TreeConstraintsConfig_default_instance_; +class TreeRegularizationConfig; +class TreeRegularizationConfigDefaultTypeInternal; +extern TreeRegularizationConfigDefaultTypeInternal _TreeRegularizationConfig_default_instance_; +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { + +enum LearnerConfig_PruningMode { + LearnerConfig_PruningMode_PRUNING_MODE_UNSPECIFIED = 0, + LearnerConfig_PruningMode_PRE_PRUNE = 1, + LearnerConfig_PruningMode_POST_PRUNE = 2, + LearnerConfig_PruningMode_LearnerConfig_PruningMode_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + LearnerConfig_PruningMode_LearnerConfig_PruningMode_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool LearnerConfig_PruningMode_IsValid(int value); +const LearnerConfig_PruningMode LearnerConfig_PruningMode_PruningMode_MIN = LearnerConfig_PruningMode_PRUNING_MODE_UNSPECIFIED; +const LearnerConfig_PruningMode LearnerConfig_PruningMode_PruningMode_MAX = LearnerConfig_PruningMode_POST_PRUNE; +const int LearnerConfig_PruningMode_PruningMode_ARRAYSIZE = LearnerConfig_PruningMode_PruningMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LearnerConfig_PruningMode_descriptor(); +inline const ::std::string& LearnerConfig_PruningMode_Name(LearnerConfig_PruningMode value) { + return ::google::protobuf::internal::NameOfEnum( + LearnerConfig_PruningMode_descriptor(), value); +} +inline bool LearnerConfig_PruningMode_Parse( + const ::std::string& name, LearnerConfig_PruningMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LearnerConfig_PruningMode_descriptor(), name, value); +} +enum LearnerConfig_GrowingMode { + LearnerConfig_GrowingMode_GROWING_MODE_UNSPECIFIED = 0, + LearnerConfig_GrowingMode_WHOLE_TREE = 1, + LearnerConfig_GrowingMode_LAYER_BY_LAYER = 2, + LearnerConfig_GrowingMode_LearnerConfig_GrowingMode_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + LearnerConfig_GrowingMode_LearnerConfig_GrowingMode_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool LearnerConfig_GrowingMode_IsValid(int value); +const LearnerConfig_GrowingMode LearnerConfig_GrowingMode_GrowingMode_MIN = LearnerConfig_GrowingMode_GROWING_MODE_UNSPECIFIED; +const LearnerConfig_GrowingMode LearnerConfig_GrowingMode_GrowingMode_MAX = LearnerConfig_GrowingMode_LAYER_BY_LAYER; +const int LearnerConfig_GrowingMode_GrowingMode_ARRAYSIZE = LearnerConfig_GrowingMode_GrowingMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LearnerConfig_GrowingMode_descriptor(); +inline const ::std::string& LearnerConfig_GrowingMode_Name(LearnerConfig_GrowingMode value) { + return ::google::protobuf::internal::NameOfEnum( + LearnerConfig_GrowingMode_descriptor(), value); +} +inline bool LearnerConfig_GrowingMode_Parse( + const ::std::string& name, LearnerConfig_GrowingMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LearnerConfig_GrowingMode_descriptor(), name, value); +} +enum LearnerConfig_MultiClassStrategy { + LearnerConfig_MultiClassStrategy_MULTI_CLASS_STRATEGY_UNSPECIFIED = 0, + LearnerConfig_MultiClassStrategy_TREE_PER_CLASS = 1, + LearnerConfig_MultiClassStrategy_FULL_HESSIAN = 2, + LearnerConfig_MultiClassStrategy_DIAGONAL_HESSIAN = 3, + LearnerConfig_MultiClassStrategy_LearnerConfig_MultiClassStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + LearnerConfig_MultiClassStrategy_LearnerConfig_MultiClassStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool LearnerConfig_MultiClassStrategy_IsValid(int value); +const LearnerConfig_MultiClassStrategy LearnerConfig_MultiClassStrategy_MultiClassStrategy_MIN = LearnerConfig_MultiClassStrategy_MULTI_CLASS_STRATEGY_UNSPECIFIED; +const LearnerConfig_MultiClassStrategy LearnerConfig_MultiClassStrategy_MultiClassStrategy_MAX = LearnerConfig_MultiClassStrategy_DIAGONAL_HESSIAN; +const int LearnerConfig_MultiClassStrategy_MultiClassStrategy_ARRAYSIZE = LearnerConfig_MultiClassStrategy_MultiClassStrategy_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LearnerConfig_MultiClassStrategy_descriptor(); +inline const ::std::string& LearnerConfig_MultiClassStrategy_Name(LearnerConfig_MultiClassStrategy value) { + return ::google::protobuf::internal::NameOfEnum( + LearnerConfig_MultiClassStrategy_descriptor(), value); +} +inline bool LearnerConfig_MultiClassStrategy_Parse( + const ::std::string& name, LearnerConfig_MultiClassStrategy* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LearnerConfig_MultiClassStrategy_descriptor(), name, value); +} +enum LearnerConfig_WeakLearnerType { + LearnerConfig_WeakLearnerType_NORMAL_DECISION_TREE = 0, + LearnerConfig_WeakLearnerType_OBLIVIOUS_DECISION_TREE = 1, + LearnerConfig_WeakLearnerType_LearnerConfig_WeakLearnerType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + LearnerConfig_WeakLearnerType_LearnerConfig_WeakLearnerType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool LearnerConfig_WeakLearnerType_IsValid(int value); +const LearnerConfig_WeakLearnerType LearnerConfig_WeakLearnerType_WeakLearnerType_MIN = LearnerConfig_WeakLearnerType_NORMAL_DECISION_TREE; +const LearnerConfig_WeakLearnerType LearnerConfig_WeakLearnerType_WeakLearnerType_MAX = LearnerConfig_WeakLearnerType_OBLIVIOUS_DECISION_TREE; +const int LearnerConfig_WeakLearnerType_WeakLearnerType_ARRAYSIZE = LearnerConfig_WeakLearnerType_WeakLearnerType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LearnerConfig_WeakLearnerType_descriptor(); +inline const ::std::string& LearnerConfig_WeakLearnerType_Name(LearnerConfig_WeakLearnerType value) { + return ::google::protobuf::internal::NameOfEnum( + LearnerConfig_WeakLearnerType_descriptor(), value); +} +inline bool LearnerConfig_WeakLearnerType_Parse( + const ::std::string& name, LearnerConfig_WeakLearnerType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LearnerConfig_WeakLearnerType_descriptor(), name, value); +} +// =================================================================== + +class TreeRegularizationConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) */ { + public: + TreeRegularizationConfig(); + virtual ~TreeRegularizationConfig(); + + TreeRegularizationConfig(const TreeRegularizationConfig& from); + + inline TreeRegularizationConfig& operator=(const TreeRegularizationConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeRegularizationConfig(TreeRegularizationConfig&& from) noexcept + : TreeRegularizationConfig() { + *this = ::std::move(from); + } + + inline TreeRegularizationConfig& operator=(TreeRegularizationConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeRegularizationConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeRegularizationConfig* internal_default_instance() { + return reinterpret_cast( + &_TreeRegularizationConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TreeRegularizationConfig* other); + void Swap(TreeRegularizationConfig* other); + friend void swap(TreeRegularizationConfig& a, TreeRegularizationConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeRegularizationConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeRegularizationConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeRegularizationConfig& from); + void MergeFrom(const TreeRegularizationConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeRegularizationConfig* other); + protected: + explicit TreeRegularizationConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float l1 = 1; + void clear_l1(); + static const int kL1FieldNumber = 1; + float l1() const; + void set_l1(float value); + + // float l2 = 2; + void clear_l2(); + static const int kL2FieldNumber = 2; + float l2() const; + void set_l2(float value); + + // float tree_complexity = 3; + void clear_tree_complexity(); + static const int kTreeComplexityFieldNumber = 3; + float tree_complexity() const; + void set_tree_complexity(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float l1_; + float l2_; + float tree_complexity_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TreeConstraintsConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) */ { + public: + TreeConstraintsConfig(); + virtual ~TreeConstraintsConfig(); + + TreeConstraintsConfig(const TreeConstraintsConfig& from); + + inline TreeConstraintsConfig& operator=(const TreeConstraintsConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeConstraintsConfig(TreeConstraintsConfig&& from) noexcept + : TreeConstraintsConfig() { + *this = ::std::move(from); + } + + inline TreeConstraintsConfig& operator=(TreeConstraintsConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeConstraintsConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeConstraintsConfig* internal_default_instance() { + return reinterpret_cast( + &_TreeConstraintsConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(TreeConstraintsConfig* other); + void Swap(TreeConstraintsConfig* other); + friend void swap(TreeConstraintsConfig& a, TreeConstraintsConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeConstraintsConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeConstraintsConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeConstraintsConfig& from); + void MergeFrom(const TreeConstraintsConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeConstraintsConfig* other); + protected: + explicit TreeConstraintsConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // uint32 max_tree_depth = 1; + void clear_max_tree_depth(); + static const int kMaxTreeDepthFieldNumber = 1; + ::google::protobuf::uint32 max_tree_depth() const; + void set_max_tree_depth(::google::protobuf::uint32 value); + + // float min_node_weight = 2; + void clear_min_node_weight(); + static const int kMinNodeWeightFieldNumber = 2; + float min_node_weight() const; + void set_min_node_weight(float value); + + // int64 max_number_of_unique_feature_columns = 3; + void clear_max_number_of_unique_feature_columns(); + static const int kMaxNumberOfUniqueFeatureColumnsFieldNumber = 3; + ::google::protobuf::int64 max_number_of_unique_feature_columns() const; + void set_max_number_of_unique_feature_columns(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::uint32 max_tree_depth_; + float min_node_weight_; + ::google::protobuf::int64 max_number_of_unique_feature_columns_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LearningRateConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) */ { + public: + LearningRateConfig(); + virtual ~LearningRateConfig(); + + LearningRateConfig(const LearningRateConfig& from); + + inline LearningRateConfig& operator=(const LearningRateConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LearningRateConfig(LearningRateConfig&& from) noexcept + : LearningRateConfig() { + *this = ::std::move(from); + } + + inline LearningRateConfig& operator=(LearningRateConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LearningRateConfig& default_instance(); + + enum TunerCase { + kFixed = 1, + kDropout = 2, + kLineSearch = 3, + TUNER_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LearningRateConfig* internal_default_instance() { + return reinterpret_cast( + &_LearningRateConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(LearningRateConfig* other); + void Swap(LearningRateConfig* other); + friend void swap(LearningRateConfig& a, LearningRateConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LearningRateConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + LearningRateConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LearningRateConfig& from); + void MergeFrom(const LearningRateConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LearningRateConfig* other); + protected: + explicit LearningRateConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig fixed = 1; + bool has_fixed() const; + void clear_fixed(); + static const int kFixedFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig& _internal_fixed() const; + public: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig& fixed() const; + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* release_fixed(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* mutable_fixed(); + void set_allocated_fixed(::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* fixed); + void unsafe_arena_set_allocated_fixed( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* fixed); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* unsafe_arena_release_fixed(); + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig dropout = 2; + bool has_dropout() const; + void clear_dropout(); + static const int kDropoutFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig& _internal_dropout() const; + public: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig& dropout() const; + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* release_dropout(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* mutable_dropout(); + void set_allocated_dropout(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* dropout); + void unsafe_arena_set_allocated_dropout( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* dropout); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* unsafe_arena_release_dropout(); + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig line_search = 3; + bool has_line_search() const; + void clear_line_search(); + static const int kLineSearchFieldNumber = 3; + private: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig& _internal_line_search() const; + public: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig& line_search() const; + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* release_line_search(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* mutable_line_search(); + void set_allocated_line_search(::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* line_search); + void unsafe_arena_set_allocated_line_search( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* line_search); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* unsafe_arena_release_line_search(); + + void clear_tuner(); + TunerCase tuner_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + private: + void set_has_fixed(); + void set_has_dropout(); + void set_has_line_search(); + + inline bool has_tuner() const; + inline void clear_has_tuner(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union TunerUnion { + TunerUnion() {} + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* fixed_; + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* dropout_; + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* line_search_; + } tuner_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LearningRateFixedConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) */ { + public: + LearningRateFixedConfig(); + virtual ~LearningRateFixedConfig(); + + LearningRateFixedConfig(const LearningRateFixedConfig& from); + + inline LearningRateFixedConfig& operator=(const LearningRateFixedConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LearningRateFixedConfig(LearningRateFixedConfig&& from) noexcept + : LearningRateFixedConfig() { + *this = ::std::move(from); + } + + inline LearningRateFixedConfig& operator=(LearningRateFixedConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LearningRateFixedConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LearningRateFixedConfig* internal_default_instance() { + return reinterpret_cast( + &_LearningRateFixedConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(LearningRateFixedConfig* other); + void Swap(LearningRateFixedConfig* other); + friend void swap(LearningRateFixedConfig& a, LearningRateFixedConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LearningRateFixedConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + LearningRateFixedConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LearningRateFixedConfig& from); + void MergeFrom(const LearningRateFixedConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LearningRateFixedConfig* other); + protected: + explicit LearningRateFixedConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float learning_rate = 1; + void clear_learning_rate(); + static const int kLearningRateFieldNumber = 1; + float learning_rate() const; + void set_learning_rate(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float learning_rate_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LearningRateLineSearchConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) */ { + public: + LearningRateLineSearchConfig(); + virtual ~LearningRateLineSearchConfig(); + + LearningRateLineSearchConfig(const LearningRateLineSearchConfig& from); + + inline LearningRateLineSearchConfig& operator=(const LearningRateLineSearchConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LearningRateLineSearchConfig(LearningRateLineSearchConfig&& from) noexcept + : LearningRateLineSearchConfig() { + *this = ::std::move(from); + } + + inline LearningRateLineSearchConfig& operator=(LearningRateLineSearchConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LearningRateLineSearchConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LearningRateLineSearchConfig* internal_default_instance() { + return reinterpret_cast( + &_LearningRateLineSearchConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(LearningRateLineSearchConfig* other); + void Swap(LearningRateLineSearchConfig* other); + friend void swap(LearningRateLineSearchConfig& a, LearningRateLineSearchConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LearningRateLineSearchConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + LearningRateLineSearchConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LearningRateLineSearchConfig& from); + void MergeFrom(const LearningRateLineSearchConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LearningRateLineSearchConfig* other); + protected: + explicit LearningRateLineSearchConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float max_learning_rate = 1; + void clear_max_learning_rate(); + static const int kMaxLearningRateFieldNumber = 1; + float max_learning_rate() const; + void set_max_learning_rate(float value); + + // int32 num_steps = 2; + void clear_num_steps(); + static const int kNumStepsFieldNumber = 2; + ::google::protobuf::int32 num_steps() const; + void set_num_steps(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float max_learning_rate_; + ::google::protobuf::int32 num_steps_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class AveragingConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) */ { + public: + AveragingConfig(); + virtual ~AveragingConfig(); + + AveragingConfig(const AveragingConfig& from); + + inline AveragingConfig& operator=(const AveragingConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AveragingConfig(AveragingConfig&& from) noexcept + : AveragingConfig() { + *this = ::std::move(from); + } + + inline AveragingConfig& operator=(AveragingConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AveragingConfig& default_instance(); + + enum ConfigCase { + kAverageLastNTrees = 1, + kAverageLastPercentTrees = 2, + CONFIG_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AveragingConfig* internal_default_instance() { + return reinterpret_cast( + &_AveragingConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(AveragingConfig* other); + void Swap(AveragingConfig* other); + friend void swap(AveragingConfig& a, AveragingConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AveragingConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + AveragingConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AveragingConfig& from); + void MergeFrom(const AveragingConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AveragingConfig* other); + protected: + explicit AveragingConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float average_last_n_trees = 1; + private: + bool has_average_last_n_trees() const; + public: + void clear_average_last_n_trees(); + static const int kAverageLastNTreesFieldNumber = 1; + float average_last_n_trees() const; + void set_average_last_n_trees(float value); + + // float average_last_percent_trees = 2; + private: + bool has_average_last_percent_trees() const; + public: + void clear_average_last_percent_trees(); + static const int kAverageLastPercentTreesFieldNumber = 2; + float average_last_percent_trees() const; + void set_average_last_percent_trees(float value); + + void clear_config(); + ConfigCase config_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + private: + void set_has_average_last_n_trees(); + void set_has_average_last_percent_trees(); + + inline bool has_config() const; + inline void clear_has_config(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union ConfigUnion { + ConfigUnion() {} + float average_last_n_trees_; + float average_last_percent_trees_; + } config_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LearningRateDropoutDrivenConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) */ { + public: + LearningRateDropoutDrivenConfig(); + virtual ~LearningRateDropoutDrivenConfig(); + + LearningRateDropoutDrivenConfig(const LearningRateDropoutDrivenConfig& from); + + inline LearningRateDropoutDrivenConfig& operator=(const LearningRateDropoutDrivenConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LearningRateDropoutDrivenConfig(LearningRateDropoutDrivenConfig&& from) noexcept + : LearningRateDropoutDrivenConfig() { + *this = ::std::move(from); + } + + inline LearningRateDropoutDrivenConfig& operator=(LearningRateDropoutDrivenConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LearningRateDropoutDrivenConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LearningRateDropoutDrivenConfig* internal_default_instance() { + return reinterpret_cast( + &_LearningRateDropoutDrivenConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(LearningRateDropoutDrivenConfig* other); + void Swap(LearningRateDropoutDrivenConfig* other); + friend void swap(LearningRateDropoutDrivenConfig& a, LearningRateDropoutDrivenConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LearningRateDropoutDrivenConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + LearningRateDropoutDrivenConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LearningRateDropoutDrivenConfig& from); + void MergeFrom(const LearningRateDropoutDrivenConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LearningRateDropoutDrivenConfig* other); + protected: + explicit LearningRateDropoutDrivenConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float dropout_probability = 1; + void clear_dropout_probability(); + static const int kDropoutProbabilityFieldNumber = 1; + float dropout_probability() const; + void set_dropout_probability(float value); + + // float probability_of_skipping_dropout = 2; + void clear_probability_of_skipping_dropout(); + static const int kProbabilityOfSkippingDropoutFieldNumber = 2; + float probability_of_skipping_dropout() const; + void set_probability_of_skipping_dropout(float value); + + // float learning_rate = 3; + void clear_learning_rate(); + static const int kLearningRateFieldNumber = 3; + float learning_rate() const; + void set_learning_rate(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float dropout_probability_; + float probability_of_skipping_dropout_; + float learning_rate_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LearnerConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) */ { + public: + LearnerConfig(); + virtual ~LearnerConfig(); + + LearnerConfig(const LearnerConfig& from); + + inline LearnerConfig& operator=(const LearnerConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LearnerConfig(LearnerConfig&& from) noexcept + : LearnerConfig() { + *this = ::std::move(from); + } + + inline LearnerConfig& operator=(LearnerConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LearnerConfig& default_instance(); + + enum FeatureFractionCase { + kFeatureFractionPerTree = 2, + kFeatureFractionPerLevel = 3, + FEATURE_FRACTION_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LearnerConfig* internal_default_instance() { + return reinterpret_cast( + &_LearnerConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(LearnerConfig* other); + void Swap(LearnerConfig* other); + friend void swap(LearnerConfig& a, LearnerConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LearnerConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + LearnerConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LearnerConfig& from); + void MergeFrom(const LearnerConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LearnerConfig* other); + protected: + explicit LearnerConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef LearnerConfig_PruningMode PruningMode; + static const PruningMode PRUNING_MODE_UNSPECIFIED = + LearnerConfig_PruningMode_PRUNING_MODE_UNSPECIFIED; + static const PruningMode PRE_PRUNE = + LearnerConfig_PruningMode_PRE_PRUNE; + static const PruningMode POST_PRUNE = + LearnerConfig_PruningMode_POST_PRUNE; + static inline bool PruningMode_IsValid(int value) { + return LearnerConfig_PruningMode_IsValid(value); + } + static const PruningMode PruningMode_MIN = + LearnerConfig_PruningMode_PruningMode_MIN; + static const PruningMode PruningMode_MAX = + LearnerConfig_PruningMode_PruningMode_MAX; + static const int PruningMode_ARRAYSIZE = + LearnerConfig_PruningMode_PruningMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + PruningMode_descriptor() { + return LearnerConfig_PruningMode_descriptor(); + } + static inline const ::std::string& PruningMode_Name(PruningMode value) { + return LearnerConfig_PruningMode_Name(value); + } + static inline bool PruningMode_Parse(const ::std::string& name, + PruningMode* value) { + return LearnerConfig_PruningMode_Parse(name, value); + } + + typedef LearnerConfig_GrowingMode GrowingMode; + static const GrowingMode GROWING_MODE_UNSPECIFIED = + LearnerConfig_GrowingMode_GROWING_MODE_UNSPECIFIED; + static const GrowingMode WHOLE_TREE = + LearnerConfig_GrowingMode_WHOLE_TREE; + static const GrowingMode LAYER_BY_LAYER = + LearnerConfig_GrowingMode_LAYER_BY_LAYER; + static inline bool GrowingMode_IsValid(int value) { + return LearnerConfig_GrowingMode_IsValid(value); + } + static const GrowingMode GrowingMode_MIN = + LearnerConfig_GrowingMode_GrowingMode_MIN; + static const GrowingMode GrowingMode_MAX = + LearnerConfig_GrowingMode_GrowingMode_MAX; + static const int GrowingMode_ARRAYSIZE = + LearnerConfig_GrowingMode_GrowingMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + GrowingMode_descriptor() { + return LearnerConfig_GrowingMode_descriptor(); + } + static inline const ::std::string& GrowingMode_Name(GrowingMode value) { + return LearnerConfig_GrowingMode_Name(value); + } + static inline bool GrowingMode_Parse(const ::std::string& name, + GrowingMode* value) { + return LearnerConfig_GrowingMode_Parse(name, value); + } + + typedef LearnerConfig_MultiClassStrategy MultiClassStrategy; + static const MultiClassStrategy MULTI_CLASS_STRATEGY_UNSPECIFIED = + LearnerConfig_MultiClassStrategy_MULTI_CLASS_STRATEGY_UNSPECIFIED; + static const MultiClassStrategy TREE_PER_CLASS = + LearnerConfig_MultiClassStrategy_TREE_PER_CLASS; + static const MultiClassStrategy FULL_HESSIAN = + LearnerConfig_MultiClassStrategy_FULL_HESSIAN; + static const MultiClassStrategy DIAGONAL_HESSIAN = + LearnerConfig_MultiClassStrategy_DIAGONAL_HESSIAN; + static inline bool MultiClassStrategy_IsValid(int value) { + return LearnerConfig_MultiClassStrategy_IsValid(value); + } + static const MultiClassStrategy MultiClassStrategy_MIN = + LearnerConfig_MultiClassStrategy_MultiClassStrategy_MIN; + static const MultiClassStrategy MultiClassStrategy_MAX = + LearnerConfig_MultiClassStrategy_MultiClassStrategy_MAX; + static const int MultiClassStrategy_ARRAYSIZE = + LearnerConfig_MultiClassStrategy_MultiClassStrategy_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + MultiClassStrategy_descriptor() { + return LearnerConfig_MultiClassStrategy_descriptor(); + } + static inline const ::std::string& MultiClassStrategy_Name(MultiClassStrategy value) { + return LearnerConfig_MultiClassStrategy_Name(value); + } + static inline bool MultiClassStrategy_Parse(const ::std::string& name, + MultiClassStrategy* value) { + return LearnerConfig_MultiClassStrategy_Parse(name, value); + } + + typedef LearnerConfig_WeakLearnerType WeakLearnerType; + static const WeakLearnerType NORMAL_DECISION_TREE = + LearnerConfig_WeakLearnerType_NORMAL_DECISION_TREE; + static const WeakLearnerType OBLIVIOUS_DECISION_TREE = + LearnerConfig_WeakLearnerType_OBLIVIOUS_DECISION_TREE; + static inline bool WeakLearnerType_IsValid(int value) { + return LearnerConfig_WeakLearnerType_IsValid(value); + } + static const WeakLearnerType WeakLearnerType_MIN = + LearnerConfig_WeakLearnerType_WeakLearnerType_MIN; + static const WeakLearnerType WeakLearnerType_MAX = + LearnerConfig_WeakLearnerType_WeakLearnerType_MAX; + static const int WeakLearnerType_ARRAYSIZE = + LearnerConfig_WeakLearnerType_WeakLearnerType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + WeakLearnerType_descriptor() { + return LearnerConfig_WeakLearnerType_descriptor(); + } + static inline const ::std::string& WeakLearnerType_Name(WeakLearnerType value) { + return LearnerConfig_WeakLearnerType_Name(value); + } + static inline bool WeakLearnerType_Parse(const ::std::string& name, + WeakLearnerType* value) { + return LearnerConfig_WeakLearnerType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig regularization = 4; + bool has_regularization() const; + void clear_regularization(); + static const int kRegularizationFieldNumber = 4; + private: + const ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig& _internal_regularization() const; + public: + const ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig& regularization() const; + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* release_regularization(); + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* mutable_regularization(); + void set_allocated_regularization(::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* regularization); + void unsafe_arena_set_allocated_regularization( + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* regularization); + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* unsafe_arena_release_regularization(); + + // .diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig constraints = 5; + bool has_constraints() const; + void clear_constraints(); + static const int kConstraintsFieldNumber = 5; + private: + const ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig& _internal_constraints() const; + public: + const ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig& constraints() const; + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* release_constraints(); + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* mutable_constraints(); + void set_allocated_constraints(::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* constraints); + void unsafe_arena_set_allocated_constraints( + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* constraints); + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* unsafe_arena_release_constraints(); + + // .diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig learning_rate_tuner = 6; + bool has_learning_rate_tuner() const; + void clear_learning_rate_tuner(); + static const int kLearningRateTunerFieldNumber = 6; + private: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig& _internal_learning_rate_tuner() const; + public: + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig& learning_rate_tuner() const; + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* release_learning_rate_tuner(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* mutable_learning_rate_tuner(); + void set_allocated_learning_rate_tuner(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* learning_rate_tuner); + void unsafe_arena_set_allocated_learning_rate_tuner( + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* learning_rate_tuner); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* unsafe_arena_release_learning_rate_tuner(); + + // .diplomacy.tensorflow.boosted_trees.learner.AveragingConfig averaging_config = 11; + bool has_averaging_config() const; + void clear_averaging_config(); + static const int kAveragingConfigFieldNumber = 11; + private: + const ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig& _internal_averaging_config() const; + public: + const ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig& averaging_config() const; + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* release_averaging_config(); + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* mutable_averaging_config(); + void set_allocated_averaging_config(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* averaging_config); + void unsafe_arena_set_allocated_averaging_config( + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* averaging_config); + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* unsafe_arena_release_averaging_config(); + + // uint32 num_classes = 1; + void clear_num_classes(); + static const int kNumClassesFieldNumber = 1; + ::google::protobuf::uint32 num_classes() const; + void set_num_classes(::google::protobuf::uint32 value); + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode pruning_mode = 8; + void clear_pruning_mode(); + static const int kPruningModeFieldNumber = 8; + ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode pruning_mode() const; + void set_pruning_mode(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode value); + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode growing_mode = 9; + void clear_growing_mode(); + static const int kGrowingModeFieldNumber = 9; + ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode growing_mode() const; + void set_growing_mode(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode value); + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy multi_class_strategy = 10; + void clear_multi_class_strategy(); + static const int kMultiClassStrategyFieldNumber = 10; + ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy multi_class_strategy() const; + void set_multi_class_strategy(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy value); + + // .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType weak_learner_type = 12; + void clear_weak_learner_type(); + static const int kWeakLearnerTypeFieldNumber = 12; + ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType weak_learner_type() const; + void set_weak_learner_type(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType value); + + // float feature_fraction_per_tree = 2; + private: + bool has_feature_fraction_per_tree() const; + public: + void clear_feature_fraction_per_tree(); + static const int kFeatureFractionPerTreeFieldNumber = 2; + float feature_fraction_per_tree() const; + void set_feature_fraction_per_tree(float value); + + // float feature_fraction_per_level = 3; + private: + bool has_feature_fraction_per_level() const; + public: + void clear_feature_fraction_per_level(); + static const int kFeatureFractionPerLevelFieldNumber = 3; + float feature_fraction_per_level() const; + void set_feature_fraction_per_level(float value); + + void clear_feature_fraction(); + FeatureFractionCase feature_fraction_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + private: + void set_has_feature_fraction_per_tree(); + void set_has_feature_fraction_per_level(); + + inline bool has_feature_fraction() const; + inline void clear_has_feature_fraction(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* regularization_; + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* constraints_; + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* learning_rate_tuner_; + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* averaging_config_; + ::google::protobuf::uint32 num_classes_; + int pruning_mode_; + int growing_mode_; + int multi_class_strategy_; + int weak_learner_type_; + union FeatureFractionUnion { + FeatureFractionUnion() {} + float feature_fraction_per_tree_; + float feature_fraction_per_level_; + } feature_fraction_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TreeRegularizationConfig + +// float l1 = 1; +inline void TreeRegularizationConfig::clear_l1() { + l1_ = 0; +} +inline float TreeRegularizationConfig::l1() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.l1) + return l1_; +} +inline void TreeRegularizationConfig::set_l1(float value) { + + l1_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.l1) +} + +// float l2 = 2; +inline void TreeRegularizationConfig::clear_l2() { + l2_ = 0; +} +inline float TreeRegularizationConfig::l2() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.l2) + return l2_; +} +inline void TreeRegularizationConfig::set_l2(float value) { + + l2_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.l2) +} + +// float tree_complexity = 3; +inline void TreeRegularizationConfig::clear_tree_complexity() { + tree_complexity_ = 0; +} +inline float TreeRegularizationConfig::tree_complexity() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.tree_complexity) + return tree_complexity_; +} +inline void TreeRegularizationConfig::set_tree_complexity(float value) { + + tree_complexity_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.tree_complexity) +} + +// ------------------------------------------------------------------- + +// TreeConstraintsConfig + +// uint32 max_tree_depth = 1; +inline void TreeConstraintsConfig::clear_max_tree_depth() { + max_tree_depth_ = 0u; +} +inline ::google::protobuf::uint32 TreeConstraintsConfig::max_tree_depth() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.max_tree_depth) + return max_tree_depth_; +} +inline void TreeConstraintsConfig::set_max_tree_depth(::google::protobuf::uint32 value) { + + max_tree_depth_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.max_tree_depth) +} + +// float min_node_weight = 2; +inline void TreeConstraintsConfig::clear_min_node_weight() { + min_node_weight_ = 0; +} +inline float TreeConstraintsConfig::min_node_weight() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.min_node_weight) + return min_node_weight_; +} +inline void TreeConstraintsConfig::set_min_node_weight(float value) { + + min_node_weight_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.min_node_weight) +} + +// int64 max_number_of_unique_feature_columns = 3; +inline void TreeConstraintsConfig::clear_max_number_of_unique_feature_columns() { + max_number_of_unique_feature_columns_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 TreeConstraintsConfig::max_number_of_unique_feature_columns() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.max_number_of_unique_feature_columns) + return max_number_of_unique_feature_columns_; +} +inline void TreeConstraintsConfig::set_max_number_of_unique_feature_columns(::google::protobuf::int64 value) { + + max_number_of_unique_feature_columns_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.max_number_of_unique_feature_columns) +} + +// ------------------------------------------------------------------- + +// LearningRateConfig + +// .diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig fixed = 1; +inline bool LearningRateConfig::has_fixed() const { + return tuner_case() == kFixed; +} +inline void LearningRateConfig::set_has_fixed() { + _oneof_case_[0] = kFixed; +} +inline void LearningRateConfig::clear_fixed() { + if (has_fixed()) { + if (GetArenaNoVirtual() == NULL) { + delete tuner_.fixed_; + } + clear_has_tuner(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig& LearningRateConfig::_internal_fixed() const { + return *tuner_.fixed_; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* LearningRateConfig::release_fixed() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.fixed) + if (has_fixed()) { + clear_has_tuner(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* temp = tuner_.fixed_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tuner_.fixed_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig& LearningRateConfig::fixed() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.fixed) + return has_fixed() + ? *tuner_.fixed_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig*>(&::diplomacy::tensorflow::boosted_trees::learner::_LearningRateFixedConfig_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* LearningRateConfig::unsafe_arena_release_fixed() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.fixed) + if (has_fixed()) { + clear_has_tuner(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* temp = tuner_.fixed_; + tuner_.fixed_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void LearningRateConfig::unsafe_arena_set_allocated_fixed(::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* fixed) { + clear_tuner(); + if (fixed) { + set_has_fixed(); + tuner_.fixed_ = fixed; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.fixed) +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig* LearningRateConfig::mutable_fixed() { + if (!has_fixed()) { + clear_tuner(); + set_has_fixed(); + tuner_.fixed_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateFixedConfig >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.fixed) + return tuner_.fixed_; +} + +// .diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig dropout = 2; +inline bool LearningRateConfig::has_dropout() const { + return tuner_case() == kDropout; +} +inline void LearningRateConfig::set_has_dropout() { + _oneof_case_[0] = kDropout; +} +inline void LearningRateConfig::clear_dropout() { + if (has_dropout()) { + if (GetArenaNoVirtual() == NULL) { + delete tuner_.dropout_; + } + clear_has_tuner(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig& LearningRateConfig::_internal_dropout() const { + return *tuner_.dropout_; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* LearningRateConfig::release_dropout() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.dropout) + if (has_dropout()) { + clear_has_tuner(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* temp = tuner_.dropout_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tuner_.dropout_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig& LearningRateConfig::dropout() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.dropout) + return has_dropout() + ? *tuner_.dropout_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig*>(&::diplomacy::tensorflow::boosted_trees::learner::_LearningRateDropoutDrivenConfig_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* LearningRateConfig::unsafe_arena_release_dropout() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.dropout) + if (has_dropout()) { + clear_has_tuner(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* temp = tuner_.dropout_; + tuner_.dropout_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void LearningRateConfig::unsafe_arena_set_allocated_dropout(::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* dropout) { + clear_tuner(); + if (dropout) { + set_has_dropout(); + tuner_.dropout_ = dropout; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.dropout) +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig* LearningRateConfig::mutable_dropout() { + if (!has_dropout()) { + clear_tuner(); + set_has_dropout(); + tuner_.dropout_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateDropoutDrivenConfig >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.dropout) + return tuner_.dropout_; +} + +// .diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig line_search = 3; +inline bool LearningRateConfig::has_line_search() const { + return tuner_case() == kLineSearch; +} +inline void LearningRateConfig::set_has_line_search() { + _oneof_case_[0] = kLineSearch; +} +inline void LearningRateConfig::clear_line_search() { + if (has_line_search()) { + if (GetArenaNoVirtual() == NULL) { + delete tuner_.line_search_; + } + clear_has_tuner(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig& LearningRateConfig::_internal_line_search() const { + return *tuner_.line_search_; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* LearningRateConfig::release_line_search() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.line_search) + if (has_line_search()) { + clear_has_tuner(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* temp = tuner_.line_search_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tuner_.line_search_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig& LearningRateConfig::line_search() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.line_search) + return has_line_search() + ? *tuner_.line_search_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig*>(&::diplomacy::tensorflow::boosted_trees::learner::_LearningRateLineSearchConfig_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* LearningRateConfig::unsafe_arena_release_line_search() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.line_search) + if (has_line_search()) { + clear_has_tuner(); + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* temp = tuner_.line_search_; + tuner_.line_search_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void LearningRateConfig::unsafe_arena_set_allocated_line_search(::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* line_search) { + clear_tuner(); + if (line_search) { + set_has_line_search(); + tuner_.line_search_ = line_search; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.line_search) +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig* LearningRateConfig::mutable_line_search() { + if (!has_line_search()) { + clear_tuner(); + set_has_line_search(); + tuner_.line_search_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::LearningRateLineSearchConfig >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.line_search) + return tuner_.line_search_; +} + +inline bool LearningRateConfig::has_tuner() const { + return tuner_case() != TUNER_NOT_SET; +} +inline void LearningRateConfig::clear_has_tuner() { + _oneof_case_[0] = TUNER_NOT_SET; +} +inline LearningRateConfig::TunerCase LearningRateConfig::tuner_case() const { + return LearningRateConfig::TunerCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// LearningRateFixedConfig + +// float learning_rate = 1; +inline void LearningRateFixedConfig::clear_learning_rate() { + learning_rate_ = 0; +} +inline float LearningRateFixedConfig::learning_rate() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig.learning_rate) + return learning_rate_; +} +inline void LearningRateFixedConfig::set_learning_rate(float value) { + + learning_rate_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig.learning_rate) +} + +// ------------------------------------------------------------------- + +// LearningRateLineSearchConfig + +// float max_learning_rate = 1; +inline void LearningRateLineSearchConfig::clear_max_learning_rate() { + max_learning_rate_ = 0; +} +inline float LearningRateLineSearchConfig::max_learning_rate() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig.max_learning_rate) + return max_learning_rate_; +} +inline void LearningRateLineSearchConfig::set_max_learning_rate(float value) { + + max_learning_rate_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig.max_learning_rate) +} + +// int32 num_steps = 2; +inline void LearningRateLineSearchConfig::clear_num_steps() { + num_steps_ = 0; +} +inline ::google::protobuf::int32 LearningRateLineSearchConfig::num_steps() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig.num_steps) + return num_steps_; +} +inline void LearningRateLineSearchConfig::set_num_steps(::google::protobuf::int32 value) { + + num_steps_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig.num_steps) +} + +// ------------------------------------------------------------------- + +// AveragingConfig + +// float average_last_n_trees = 1; +inline bool AveragingConfig::has_average_last_n_trees() const { + return config_case() == kAverageLastNTrees; +} +inline void AveragingConfig::set_has_average_last_n_trees() { + _oneof_case_[0] = kAverageLastNTrees; +} +inline void AveragingConfig::clear_average_last_n_trees() { + if (has_average_last_n_trees()) { + config_.average_last_n_trees_ = 0; + clear_has_config(); + } +} +inline float AveragingConfig::average_last_n_trees() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig.average_last_n_trees) + if (has_average_last_n_trees()) { + return config_.average_last_n_trees_; + } + return 0; +} +inline void AveragingConfig::set_average_last_n_trees(float value) { + if (!has_average_last_n_trees()) { + clear_config(); + set_has_average_last_n_trees(); + } + config_.average_last_n_trees_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig.average_last_n_trees) +} + +// float average_last_percent_trees = 2; +inline bool AveragingConfig::has_average_last_percent_trees() const { + return config_case() == kAverageLastPercentTrees; +} +inline void AveragingConfig::set_has_average_last_percent_trees() { + _oneof_case_[0] = kAverageLastPercentTrees; +} +inline void AveragingConfig::clear_average_last_percent_trees() { + if (has_average_last_percent_trees()) { + config_.average_last_percent_trees_ = 0; + clear_has_config(); + } +} +inline float AveragingConfig::average_last_percent_trees() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig.average_last_percent_trees) + if (has_average_last_percent_trees()) { + return config_.average_last_percent_trees_; + } + return 0; +} +inline void AveragingConfig::set_average_last_percent_trees(float value) { + if (!has_average_last_percent_trees()) { + clear_config(); + set_has_average_last_percent_trees(); + } + config_.average_last_percent_trees_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig.average_last_percent_trees) +} + +inline bool AveragingConfig::has_config() const { + return config_case() != CONFIG_NOT_SET; +} +inline void AveragingConfig::clear_has_config() { + _oneof_case_[0] = CONFIG_NOT_SET; +} +inline AveragingConfig::ConfigCase AveragingConfig::config_case() const { + return AveragingConfig::ConfigCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// LearningRateDropoutDrivenConfig + +// float dropout_probability = 1; +inline void LearningRateDropoutDrivenConfig::clear_dropout_probability() { + dropout_probability_ = 0; +} +inline float LearningRateDropoutDrivenConfig::dropout_probability() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.dropout_probability) + return dropout_probability_; +} +inline void LearningRateDropoutDrivenConfig::set_dropout_probability(float value) { + + dropout_probability_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.dropout_probability) +} + +// float probability_of_skipping_dropout = 2; +inline void LearningRateDropoutDrivenConfig::clear_probability_of_skipping_dropout() { + probability_of_skipping_dropout_ = 0; +} +inline float LearningRateDropoutDrivenConfig::probability_of_skipping_dropout() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.probability_of_skipping_dropout) + return probability_of_skipping_dropout_; +} +inline void LearningRateDropoutDrivenConfig::set_probability_of_skipping_dropout(float value) { + + probability_of_skipping_dropout_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.probability_of_skipping_dropout) +} + +// float learning_rate = 3; +inline void LearningRateDropoutDrivenConfig::clear_learning_rate() { + learning_rate_ = 0; +} +inline float LearningRateDropoutDrivenConfig::learning_rate() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.learning_rate) + return learning_rate_; +} +inline void LearningRateDropoutDrivenConfig::set_learning_rate(float value) { + + learning_rate_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.learning_rate) +} + +// ------------------------------------------------------------------- + +// LearnerConfig + +// uint32 num_classes = 1; +inline void LearnerConfig::clear_num_classes() { + num_classes_ = 0u; +} +inline ::google::protobuf::uint32 LearnerConfig::num_classes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.num_classes) + return num_classes_; +} +inline void LearnerConfig::set_num_classes(::google::protobuf::uint32 value) { + + num_classes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.num_classes) +} + +// float feature_fraction_per_tree = 2; +inline bool LearnerConfig::has_feature_fraction_per_tree() const { + return feature_fraction_case() == kFeatureFractionPerTree; +} +inline void LearnerConfig::set_has_feature_fraction_per_tree() { + _oneof_case_[0] = kFeatureFractionPerTree; +} +inline void LearnerConfig::clear_feature_fraction_per_tree() { + if (has_feature_fraction_per_tree()) { + feature_fraction_.feature_fraction_per_tree_ = 0; + clear_has_feature_fraction(); + } +} +inline float LearnerConfig::feature_fraction_per_tree() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.feature_fraction_per_tree) + if (has_feature_fraction_per_tree()) { + return feature_fraction_.feature_fraction_per_tree_; + } + return 0; +} +inline void LearnerConfig::set_feature_fraction_per_tree(float value) { + if (!has_feature_fraction_per_tree()) { + clear_feature_fraction(); + set_has_feature_fraction_per_tree(); + } + feature_fraction_.feature_fraction_per_tree_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.feature_fraction_per_tree) +} + +// float feature_fraction_per_level = 3; +inline bool LearnerConfig::has_feature_fraction_per_level() const { + return feature_fraction_case() == kFeatureFractionPerLevel; +} +inline void LearnerConfig::set_has_feature_fraction_per_level() { + _oneof_case_[0] = kFeatureFractionPerLevel; +} +inline void LearnerConfig::clear_feature_fraction_per_level() { + if (has_feature_fraction_per_level()) { + feature_fraction_.feature_fraction_per_level_ = 0; + clear_has_feature_fraction(); + } +} +inline float LearnerConfig::feature_fraction_per_level() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.feature_fraction_per_level) + if (has_feature_fraction_per_level()) { + return feature_fraction_.feature_fraction_per_level_; + } + return 0; +} +inline void LearnerConfig::set_feature_fraction_per_level(float value) { + if (!has_feature_fraction_per_level()) { + clear_feature_fraction(); + set_has_feature_fraction_per_level(); + } + feature_fraction_.feature_fraction_per_level_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.feature_fraction_per_level) +} + +// .diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig regularization = 4; +inline bool LearnerConfig::has_regularization() const { + return this != internal_default_instance() && regularization_ != NULL; +} +inline void LearnerConfig::clear_regularization() { + if (GetArenaNoVirtual() == NULL && regularization_ != NULL) { + delete regularization_; + } + regularization_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig& LearnerConfig::_internal_regularization() const { + return *regularization_; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig& LearnerConfig::regularization() const { + const ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* p = regularization_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.regularization) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::learner::_TreeRegularizationConfig_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* LearnerConfig::release_regularization() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.regularization) + + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* temp = regularization_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + regularization_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* LearnerConfig::unsafe_arena_release_regularization() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.regularization) + + ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* temp = regularization_; + regularization_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* LearnerConfig::mutable_regularization() { + + if (regularization_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig>(GetArenaNoVirtual()); + regularization_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.regularization) + return regularization_; +} +inline void LearnerConfig::set_allocated_regularization(::diplomacy::tensorflow::boosted_trees::learner::TreeRegularizationConfig* regularization) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete regularization_; + } + if (regularization) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(regularization); + if (message_arena != submessage_arena) { + regularization = ::google::protobuf::internal::GetOwnedMessage( + message_arena, regularization, submessage_arena); + } + + } else { + + } + regularization_ = regularization; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.regularization) +} + +// .diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig constraints = 5; +inline bool LearnerConfig::has_constraints() const { + return this != internal_default_instance() && constraints_ != NULL; +} +inline void LearnerConfig::clear_constraints() { + if (GetArenaNoVirtual() == NULL && constraints_ != NULL) { + delete constraints_; + } + constraints_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig& LearnerConfig::_internal_constraints() const { + return *constraints_; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig& LearnerConfig::constraints() const { + const ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* p = constraints_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.constraints) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::learner::_TreeConstraintsConfig_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* LearnerConfig::release_constraints() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.constraints) + + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* temp = constraints_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + constraints_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* LearnerConfig::unsafe_arena_release_constraints() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.constraints) + + ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* temp = constraints_; + constraints_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* LearnerConfig::mutable_constraints() { + + if (constraints_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig>(GetArenaNoVirtual()); + constraints_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.constraints) + return constraints_; +} +inline void LearnerConfig::set_allocated_constraints(::diplomacy::tensorflow::boosted_trees::learner::TreeConstraintsConfig* constraints) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete constraints_; + } + if (constraints) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(constraints); + if (message_arena != submessage_arena) { + constraints = ::google::protobuf::internal::GetOwnedMessage( + message_arena, constraints, submessage_arena); + } + + } else { + + } + constraints_ = constraints; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.constraints) +} + +// .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode pruning_mode = 8; +inline void LearnerConfig::clear_pruning_mode() { + pruning_mode_ = 0; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode LearnerConfig::pruning_mode() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.pruning_mode) + return static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode >(pruning_mode_); +} +inline void LearnerConfig::set_pruning_mode(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode value) { + + pruning_mode_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.pruning_mode) +} + +// .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode growing_mode = 9; +inline void LearnerConfig::clear_growing_mode() { + growing_mode_ = 0; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode LearnerConfig::growing_mode() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.growing_mode) + return static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode >(growing_mode_); +} +inline void LearnerConfig::set_growing_mode(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode value) { + + growing_mode_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.growing_mode) +} + +// .diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig learning_rate_tuner = 6; +inline bool LearnerConfig::has_learning_rate_tuner() const { + return this != internal_default_instance() && learning_rate_tuner_ != NULL; +} +inline void LearnerConfig::clear_learning_rate_tuner() { + if (GetArenaNoVirtual() == NULL && learning_rate_tuner_ != NULL) { + delete learning_rate_tuner_; + } + learning_rate_tuner_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig& LearnerConfig::_internal_learning_rate_tuner() const { + return *learning_rate_tuner_; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig& LearnerConfig::learning_rate_tuner() const { + const ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* p = learning_rate_tuner_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.learning_rate_tuner) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::learner::_LearningRateConfig_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* LearnerConfig::release_learning_rate_tuner() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.learning_rate_tuner) + + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* temp = learning_rate_tuner_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + learning_rate_tuner_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* LearnerConfig::unsafe_arena_release_learning_rate_tuner() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.learning_rate_tuner) + + ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* temp = learning_rate_tuner_; + learning_rate_tuner_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* LearnerConfig::mutable_learning_rate_tuner() { + + if (learning_rate_tuner_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig>(GetArenaNoVirtual()); + learning_rate_tuner_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.learning_rate_tuner) + return learning_rate_tuner_; +} +inline void LearnerConfig::set_allocated_learning_rate_tuner(::diplomacy::tensorflow::boosted_trees::learner::LearningRateConfig* learning_rate_tuner) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete learning_rate_tuner_; + } + if (learning_rate_tuner) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(learning_rate_tuner); + if (message_arena != submessage_arena) { + learning_rate_tuner = ::google::protobuf::internal::GetOwnedMessage( + message_arena, learning_rate_tuner, submessage_arena); + } + + } else { + + } + learning_rate_tuner_ = learning_rate_tuner; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.learning_rate_tuner) +} + +// .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy multi_class_strategy = 10; +inline void LearnerConfig::clear_multi_class_strategy() { + multi_class_strategy_ = 0; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy LearnerConfig::multi_class_strategy() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.multi_class_strategy) + return static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy >(multi_class_strategy_); +} +inline void LearnerConfig::set_multi_class_strategy(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy value) { + + multi_class_strategy_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.multi_class_strategy) +} + +// .diplomacy.tensorflow.boosted_trees.learner.AveragingConfig averaging_config = 11; +inline bool LearnerConfig::has_averaging_config() const { + return this != internal_default_instance() && averaging_config_ != NULL; +} +inline void LearnerConfig::clear_averaging_config() { + if (GetArenaNoVirtual() == NULL && averaging_config_ != NULL) { + delete averaging_config_; + } + averaging_config_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig& LearnerConfig::_internal_averaging_config() const { + return *averaging_config_; +} +inline const ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig& LearnerConfig::averaging_config() const { + const ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* p = averaging_config_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.averaging_config) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::learner::_AveragingConfig_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* LearnerConfig::release_averaging_config() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.averaging_config) + + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* temp = averaging_config_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + averaging_config_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* LearnerConfig::unsafe_arena_release_averaging_config() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.averaging_config) + + ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* temp = averaging_config_; + averaging_config_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* LearnerConfig::mutable_averaging_config() { + + if (averaging_config_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig>(GetArenaNoVirtual()); + averaging_config_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.averaging_config) + return averaging_config_; +} +inline void LearnerConfig::set_allocated_averaging_config(::diplomacy::tensorflow::boosted_trees::learner::AveragingConfig* averaging_config) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete averaging_config_; + } + if (averaging_config) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(averaging_config); + if (message_arena != submessage_arena) { + averaging_config = ::google::protobuf::internal::GetOwnedMessage( + message_arena, averaging_config, submessage_arena); + } + + } else { + + } + averaging_config_ = averaging_config; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.averaging_config) +} + +// .diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType weak_learner_type = 12; +inline void LearnerConfig::clear_weak_learner_type() { + weak_learner_type_ = 0; +} +inline ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType LearnerConfig::weak_learner_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.weak_learner_type) + return static_cast< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType >(weak_learner_type_); +} +inline void LearnerConfig::set_weak_learner_type(::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType value) { + + weak_learner_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.weak_learner_type) +} + +inline bool LearnerConfig::has_feature_fraction() const { + return feature_fraction_case() != FEATURE_FRACTION_NOT_SET; +} +inline void LearnerConfig::clear_has_feature_fraction() { + _oneof_case_[0] = FEATURE_FRACTION_NOT_SET; +} +inline LearnerConfig::FeatureFractionCase LearnerConfig::feature_fraction_case() const { + return LearnerConfig::FeatureFractionCase(_oneof_case_[0]); +} +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode>() { + return ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_PruningMode_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode>() { + return ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_GrowingMode_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy>() { + return ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_MultiClassStrategy_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType>() { + return ::diplomacy::tensorflow::boosted_trees::learner::LearnerConfig_WeakLearnerType_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2flearner_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto new file mode 100644 index 0000000..44446e6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; + +option cc_enable_arenas = true; + +package diplomacy.tensorflow.boosted_trees.learner; + +// Tree regularization config. +message TreeRegularizationConfig { + // Classic L1/L2. + float l1 = 1; + float l2 = 2; + + // Tree complexity penalizes overall model complexity effectively + // limiting how deep the tree can grow in regions with small gain. + float tree_complexity = 3; +} + +// Tree constraints config. +message TreeConstraintsConfig { + // Maximum depth of the trees. The default value is 6 if not specified. + uint32 max_tree_depth = 1; + + // Min hessian weight per node. + float min_node_weight = 2; + + // Maximum number of unique features used in the tree. Zero means there is no + // limit. + int64 max_number_of_unique_feature_columns = 3; +} + +// LearningRateConfig describes all supported learning rate tuners. +message LearningRateConfig { + oneof tuner { + LearningRateFixedConfig fixed = 1; + LearningRateDropoutDrivenConfig dropout = 2; + LearningRateLineSearchConfig line_search = 3; + } +} + +// Config for a fixed learning rate. +message LearningRateFixedConfig { + float learning_rate = 1; +} + +// Config for a tuned learning rate. +message LearningRateLineSearchConfig { + // Max learning rate. Must be strictly positive. + float max_learning_rate = 1; + + // Number of learning rate values to consider between [0, max_learning_rate). + int32 num_steps = 2; +} + +// When we have a sequence of trees 1, 2, 3 ... n, these essentially represent +// weights updates in functional space, and thus we can use averaging of weight +// updates to achieve better performance. For example, we can say that our final +// ensemble will be an average of ensembles of tree 1, and ensemble of tree 1 +// and tree 2 etc .. ensemble of all trees. +// Note that this averaging will apply ONLY DURING PREDICTION. The training +// stays the same. +message AveragingConfig { + oneof config { + float average_last_n_trees = 1; + // Between 0 and 1. If set to 1.0, we are averaging ensembles of tree 1, + // ensemble of tree 1 and tree 2, etc ensemble of all trees. If set to 0.5, + // last half of the trees are averaged etc. + float average_last_percent_trees = 2; + } +} + +message LearningRateDropoutDrivenConfig { + // Probability of dropping each tree in an existing so far ensemble. + float dropout_probability = 1; + + // When trees are built after dropout happen, they don't "advance" to the + // optimal solution, they just rearrange the path. However you can still + // choose to skip dropout periodically, to allow a new tree that "advances" + // to be added. + // For example, if running for 200 steps with probability of dropout 1/100, + // you would expect the dropout to start happening for sure for all iterations + // after 100. However you can add probability_of_skipping_dropout of 0.1, this + // way iterations 100-200 will include approx 90 iterations of dropout and 10 + // iterations of normal steps.Set it to 0 if you want just keep building + // the refinement trees after dropout kicks in. + float probability_of_skipping_dropout = 2; + + // Between 0 and 1. + float learning_rate = 3; +} + +message LearnerConfig { + enum PruningMode { + PRUNING_MODE_UNSPECIFIED = 0; + PRE_PRUNE = 1; + POST_PRUNE = 2; + } + + enum GrowingMode { + GROWING_MODE_UNSPECIFIED = 0; + WHOLE_TREE = 1; + LAYER_BY_LAYER = 2; + } + + enum MultiClassStrategy { + MULTI_CLASS_STRATEGY_UNSPECIFIED = 0; + TREE_PER_CLASS = 1; + FULL_HESSIAN = 2; + DIAGONAL_HESSIAN = 3; + } + + enum WeakLearnerType { + NORMAL_DECISION_TREE = 0; + OBLIVIOUS_DECISION_TREE = 1; + } + + // Number of classes. + uint32 num_classes = 1; + + // Fraction of features to consider in each tree sampled randomly + // from all available features. + oneof feature_fraction { + float feature_fraction_per_tree = 2; + float feature_fraction_per_level = 3; + }; + + // Regularization. + TreeRegularizationConfig regularization = 4; + + // Constraints. + TreeConstraintsConfig constraints = 5; + + // Pruning. POST_PRUNE is the default pruning mode. + PruningMode pruning_mode = 8; + + // Growing Mode. LAYER_BY_LAYER is the default growing mode. + GrowingMode growing_mode = 9; + + // Learning rate. By default we use fixed learning rate of 0.1. + LearningRateConfig learning_rate_tuner = 6; + + // Multi-class strategy. By default we use TREE_PER_CLASS for binary + // classification and linear regression. For other cases, we use + // DIAGONAL_HESSIAN as the default. + MultiClassStrategy multi_class_strategy = 10; + + // If you want to average the ensembles (for regularization), provide the + // config below. + AveragingConfig averaging_config = 11; + + // By default we use NORMAL_DECISION_TREE as weak learner. + WeakLearnerType weak_learner_type = 12; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner_pb2.py new file mode 100644 index 0000000..a0c4036 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/learner_pb2.py @@ -0,0 +1,636 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto', + package='diplomacy.tensorflow.boosted_trees.learner', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n>diplomacy_tensorflow/contrib/boosted_trees/proto/learner.proto\x12*diplomacy.tensorflow.boosted_trees.learner\"K\n\x18TreeRegularizationConfig\x12\n\n\x02l1\x18\x01 \x01(\x02\x12\n\n\x02l2\x18\x02 \x01(\x02\x12\x17\n\x0ftree_complexity\x18\x03 \x01(\x02\"v\n\x15TreeConstraintsConfig\x12\x16\n\x0emax_tree_depth\x18\x01 \x01(\r\x12\x17\n\x0fmin_node_weight\x18\x02 \x01(\x02\x12,\n$max_number_of_unique_feature_columns\x18\x03 \x01(\x03\"\xb4\x02\n\x12LearningRateConfig\x12T\n\x05\x66ixed\x18\x01 \x01(\x0b\x32\x43.diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfigH\x00\x12^\n\x07\x64ropout\x18\x02 \x01(\x0b\x32K.diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfigH\x00\x12_\n\x0bline_search\x18\x03 \x01(\x0b\x32H.diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfigH\x00\x42\x07\n\x05tuner\"0\n\x17LearningRateFixedConfig\x12\x15\n\rlearning_rate\x18\x01 \x01(\x02\"L\n\x1cLearningRateLineSearchConfig\x12\x19\n\x11max_learning_rate\x18\x01 \x01(\x02\x12\x11\n\tnum_steps\x18\x02 \x01(\x05\"a\n\x0f\x41veragingConfig\x12\x1e\n\x14\x61verage_last_n_trees\x18\x01 \x01(\x02H\x00\x12$\n\x1a\x61verage_last_percent_trees\x18\x02 \x01(\x02H\x00\x42\x08\n\x06\x63onfig\"~\n\x1fLearningRateDropoutDrivenConfig\x12\x1b\n\x13\x64ropout_probability\x18\x01 \x01(\x02\x12\'\n\x1fprobability_of_skipping_dropout\x18\x02 \x01(\x02\x12\x15\n\rlearning_rate\x18\x03 \x01(\x02\"\xd8\t\n\rLearnerConfig\x12\x13\n\x0bnum_classes\x18\x01 \x01(\r\x12#\n\x19\x66\x65\x61ture_fraction_per_tree\x18\x02 \x01(\x02H\x00\x12$\n\x1a\x66\x65\x61ture_fraction_per_level\x18\x03 \x01(\x02H\x00\x12\\\n\x0eregularization\x18\x04 \x01(\x0b\x32\x44.diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig\x12V\n\x0b\x63onstraints\x18\x05 \x01(\x0b\x32\x41.diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig\x12[\n\x0cpruning_mode\x18\x08 \x01(\x0e\x32\x45.diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode\x12[\n\x0cgrowing_mode\x18\t \x01(\x0e\x32\x45.diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode\x12[\n\x13learning_rate_tuner\x18\x06 \x01(\x0b\x32>.diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig\x12j\n\x14multi_class_strategy\x18\n \x01(\x0e\x32L.diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy\x12U\n\x10\x61veraging_config\x18\x0b \x01(\x0b\x32;.diplomacy.tensorflow.boosted_trees.learner.AveragingConfig\x12\x64\n\x11weak_learner_type\x18\x0c \x01(\x0e\x32I.diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType\"J\n\x0bPruningMode\x12\x1c\n\x18PRUNING_MODE_UNSPECIFIED\x10\x00\x12\r\n\tPRE_PRUNE\x10\x01\x12\x0e\n\nPOST_PRUNE\x10\x02\"O\n\x0bGrowingMode\x12\x1c\n\x18GROWING_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nWHOLE_TREE\x10\x01\x12\x12\n\x0eLAYER_BY_LAYER\x10\x02\"v\n\x12MultiClassStrategy\x12$\n MULTI_CLASS_STRATEGY_UNSPECIFIED\x10\x00\x12\x12\n\x0eTREE_PER_CLASS\x10\x01\x12\x10\n\x0c\x46ULL_HESSIAN\x10\x02\x12\x14\n\x10\x44IAGONAL_HESSIAN\x10\x03\"H\n\x0fWeakLearnerType\x12\x18\n\x14NORMAL_DECISION_TREE\x10\x00\x12\x1b\n\x17OBLIVIOUS_DECISION_TREE\x10\x01\x42\x12\n\x10\x66\x65\x61ture_fractionB\x03\xf8\x01\x01\x62\x06proto3') +) + + + +_LEARNERCONFIG_PRUNINGMODE = _descriptor.EnumDescriptor( + name='PruningMode', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.PruningMode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='PRUNING_MODE_UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='PRE_PRUNE', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='POST_PRUNE', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1845, + serialized_end=1919, +) +_sym_db.RegisterEnumDescriptor(_LEARNERCONFIG_PRUNINGMODE) + +_LEARNERCONFIG_GROWINGMODE = _descriptor.EnumDescriptor( + name='GrowingMode', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.GrowingMode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='GROWING_MODE_UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='WHOLE_TREE', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LAYER_BY_LAYER', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1921, + serialized_end=2000, +) +_sym_db.RegisterEnumDescriptor(_LEARNERCONFIG_GROWINGMODE) + +_LEARNERCONFIG_MULTICLASSSTRATEGY = _descriptor.EnumDescriptor( + name='MultiClassStrategy', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.MultiClassStrategy', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='MULTI_CLASS_STRATEGY_UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TREE_PER_CLASS', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FULL_HESSIAN', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DIAGONAL_HESSIAN', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2002, + serialized_end=2120, +) +_sym_db.RegisterEnumDescriptor(_LEARNERCONFIG_MULTICLASSSTRATEGY) + +_LEARNERCONFIG_WEAKLEARNERTYPE = _descriptor.EnumDescriptor( + name='WeakLearnerType', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.WeakLearnerType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='NORMAL_DECISION_TREE', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OBLIVIOUS_DECISION_TREE', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2122, + serialized_end=2194, +) +_sym_db.RegisterEnumDescriptor(_LEARNERCONFIG_WEAKLEARNERTYPE) + + +_TREEREGULARIZATIONCONFIG = _descriptor.Descriptor( + name='TreeRegularizationConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='l1', full_name='diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.l1', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='l2', full_name='diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.l2', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tree_complexity', full_name='diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig.tree_complexity', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=110, + serialized_end=185, +) + + +_TREECONSTRAINTSCONFIG = _descriptor.Descriptor( + name='TreeConstraintsConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_tree_depth', full_name='diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.max_tree_depth', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_node_weight', full_name='diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.min_node_weight', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_number_of_unique_feature_columns', full_name='diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig.max_number_of_unique_feature_columns', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=187, + serialized_end=305, +) + + +_LEARNINGRATECONFIG = _descriptor.Descriptor( + name='LearningRateConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='fixed', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.fixed', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dropout', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.dropout', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='line_search', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.line_search', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='tuner', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig.tuner', + index=0, containing_type=None, fields=[]), + ], + serialized_start=308, + serialized_end=616, +) + + +_LEARNINGRATEFIXEDCONFIG = _descriptor.Descriptor( + name='LearningRateFixedConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='learning_rate', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig.learning_rate', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=618, + serialized_end=666, +) + + +_LEARNINGRATELINESEARCHCONFIG = _descriptor.Descriptor( + name='LearningRateLineSearchConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_learning_rate', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig.max_learning_rate', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_steps', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig.num_steps', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=668, + serialized_end=744, +) + + +_AVERAGINGCONFIG = _descriptor.Descriptor( + name='AveragingConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.AveragingConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='average_last_n_trees', full_name='diplomacy.tensorflow.boosted_trees.learner.AveragingConfig.average_last_n_trees', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='average_last_percent_trees', full_name='diplomacy.tensorflow.boosted_trees.learner.AveragingConfig.average_last_percent_trees', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='config', full_name='diplomacy.tensorflow.boosted_trees.learner.AveragingConfig.config', + index=0, containing_type=None, fields=[]), + ], + serialized_start=746, + serialized_end=843, +) + + +_LEARNINGRATEDROPOUTDRIVENCONFIG = _descriptor.Descriptor( + name='LearningRateDropoutDrivenConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dropout_probability', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.dropout_probability', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='probability_of_skipping_dropout', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.probability_of_skipping_dropout', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='learning_rate', full_name='diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig.learning_rate', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=845, + serialized_end=971, +) + + +_LEARNERCONFIG = _descriptor.Descriptor( + name='LearnerConfig', + full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='num_classes', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.num_classes', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_fraction_per_tree', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.feature_fraction_per_tree', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_fraction_per_level', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.feature_fraction_per_level', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='regularization', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.regularization', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='constraints', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.constraints', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='pruning_mode', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.pruning_mode', index=5, + number=8, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='growing_mode', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.growing_mode', index=6, + number=9, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='learning_rate_tuner', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.learning_rate_tuner', index=7, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='multi_class_strategy', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.multi_class_strategy', index=8, + number=10, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='averaging_config', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.averaging_config', index=9, + number=11, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='weak_learner_type', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.weak_learner_type', index=10, + number=12, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _LEARNERCONFIG_PRUNINGMODE, + _LEARNERCONFIG_GROWINGMODE, + _LEARNERCONFIG_MULTICLASSSTRATEGY, + _LEARNERCONFIG_WEAKLEARNERTYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='feature_fraction', full_name='diplomacy.tensorflow.boosted_trees.learner.LearnerConfig.feature_fraction', + index=0, containing_type=None, fields=[]), + ], + serialized_start=974, + serialized_end=2214, +) + +_LEARNINGRATECONFIG.fields_by_name['fixed'].message_type = _LEARNINGRATEFIXEDCONFIG +_LEARNINGRATECONFIG.fields_by_name['dropout'].message_type = _LEARNINGRATEDROPOUTDRIVENCONFIG +_LEARNINGRATECONFIG.fields_by_name['line_search'].message_type = _LEARNINGRATELINESEARCHCONFIG +_LEARNINGRATECONFIG.oneofs_by_name['tuner'].fields.append( + _LEARNINGRATECONFIG.fields_by_name['fixed']) +_LEARNINGRATECONFIG.fields_by_name['fixed'].containing_oneof = _LEARNINGRATECONFIG.oneofs_by_name['tuner'] +_LEARNINGRATECONFIG.oneofs_by_name['tuner'].fields.append( + _LEARNINGRATECONFIG.fields_by_name['dropout']) +_LEARNINGRATECONFIG.fields_by_name['dropout'].containing_oneof = _LEARNINGRATECONFIG.oneofs_by_name['tuner'] +_LEARNINGRATECONFIG.oneofs_by_name['tuner'].fields.append( + _LEARNINGRATECONFIG.fields_by_name['line_search']) +_LEARNINGRATECONFIG.fields_by_name['line_search'].containing_oneof = _LEARNINGRATECONFIG.oneofs_by_name['tuner'] +_AVERAGINGCONFIG.oneofs_by_name['config'].fields.append( + _AVERAGINGCONFIG.fields_by_name['average_last_n_trees']) +_AVERAGINGCONFIG.fields_by_name['average_last_n_trees'].containing_oneof = _AVERAGINGCONFIG.oneofs_by_name['config'] +_AVERAGINGCONFIG.oneofs_by_name['config'].fields.append( + _AVERAGINGCONFIG.fields_by_name['average_last_percent_trees']) +_AVERAGINGCONFIG.fields_by_name['average_last_percent_trees'].containing_oneof = _AVERAGINGCONFIG.oneofs_by_name['config'] +_LEARNERCONFIG.fields_by_name['regularization'].message_type = _TREEREGULARIZATIONCONFIG +_LEARNERCONFIG.fields_by_name['constraints'].message_type = _TREECONSTRAINTSCONFIG +_LEARNERCONFIG.fields_by_name['pruning_mode'].enum_type = _LEARNERCONFIG_PRUNINGMODE +_LEARNERCONFIG.fields_by_name['growing_mode'].enum_type = _LEARNERCONFIG_GROWINGMODE +_LEARNERCONFIG.fields_by_name['learning_rate_tuner'].message_type = _LEARNINGRATECONFIG +_LEARNERCONFIG.fields_by_name['multi_class_strategy'].enum_type = _LEARNERCONFIG_MULTICLASSSTRATEGY +_LEARNERCONFIG.fields_by_name['averaging_config'].message_type = _AVERAGINGCONFIG +_LEARNERCONFIG.fields_by_name['weak_learner_type'].enum_type = _LEARNERCONFIG_WEAKLEARNERTYPE +_LEARNERCONFIG_PRUNINGMODE.containing_type = _LEARNERCONFIG +_LEARNERCONFIG_GROWINGMODE.containing_type = _LEARNERCONFIG +_LEARNERCONFIG_MULTICLASSSTRATEGY.containing_type = _LEARNERCONFIG +_LEARNERCONFIG_WEAKLEARNERTYPE.containing_type = _LEARNERCONFIG +_LEARNERCONFIG.oneofs_by_name['feature_fraction'].fields.append( + _LEARNERCONFIG.fields_by_name['feature_fraction_per_tree']) +_LEARNERCONFIG.fields_by_name['feature_fraction_per_tree'].containing_oneof = _LEARNERCONFIG.oneofs_by_name['feature_fraction'] +_LEARNERCONFIG.oneofs_by_name['feature_fraction'].fields.append( + _LEARNERCONFIG.fields_by_name['feature_fraction_per_level']) +_LEARNERCONFIG.fields_by_name['feature_fraction_per_level'].containing_oneof = _LEARNERCONFIG.oneofs_by_name['feature_fraction'] +DESCRIPTOR.message_types_by_name['TreeRegularizationConfig'] = _TREEREGULARIZATIONCONFIG +DESCRIPTOR.message_types_by_name['TreeConstraintsConfig'] = _TREECONSTRAINTSCONFIG +DESCRIPTOR.message_types_by_name['LearningRateConfig'] = _LEARNINGRATECONFIG +DESCRIPTOR.message_types_by_name['LearningRateFixedConfig'] = _LEARNINGRATEFIXEDCONFIG +DESCRIPTOR.message_types_by_name['LearningRateLineSearchConfig'] = _LEARNINGRATELINESEARCHCONFIG +DESCRIPTOR.message_types_by_name['AveragingConfig'] = _AVERAGINGCONFIG +DESCRIPTOR.message_types_by_name['LearningRateDropoutDrivenConfig'] = _LEARNINGRATEDROPOUTDRIVENCONFIG +DESCRIPTOR.message_types_by_name['LearnerConfig'] = _LEARNERCONFIG +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TreeRegularizationConfig = _reflection.GeneratedProtocolMessageType('TreeRegularizationConfig', (_message.Message,), dict( + DESCRIPTOR = _TREEREGULARIZATIONCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.TreeRegularizationConfig) + )) +_sym_db.RegisterMessage(TreeRegularizationConfig) + +TreeConstraintsConfig = _reflection.GeneratedProtocolMessageType('TreeConstraintsConfig', (_message.Message,), dict( + DESCRIPTOR = _TREECONSTRAINTSCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.TreeConstraintsConfig) + )) +_sym_db.RegisterMessage(TreeConstraintsConfig) + +LearningRateConfig = _reflection.GeneratedProtocolMessageType('LearningRateConfig', (_message.Message,), dict( + DESCRIPTOR = _LEARNINGRATECONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateConfig) + )) +_sym_db.RegisterMessage(LearningRateConfig) + +LearningRateFixedConfig = _reflection.GeneratedProtocolMessageType('LearningRateFixedConfig', (_message.Message,), dict( + DESCRIPTOR = _LEARNINGRATEFIXEDCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateFixedConfig) + )) +_sym_db.RegisterMessage(LearningRateFixedConfig) + +LearningRateLineSearchConfig = _reflection.GeneratedProtocolMessageType('LearningRateLineSearchConfig', (_message.Message,), dict( + DESCRIPTOR = _LEARNINGRATELINESEARCHCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateLineSearchConfig) + )) +_sym_db.RegisterMessage(LearningRateLineSearchConfig) + +AveragingConfig = _reflection.GeneratedProtocolMessageType('AveragingConfig', (_message.Message,), dict( + DESCRIPTOR = _AVERAGINGCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.AveragingConfig) + )) +_sym_db.RegisterMessage(AveragingConfig) + +LearningRateDropoutDrivenConfig = _reflection.GeneratedProtocolMessageType('LearningRateDropoutDrivenConfig', (_message.Message,), dict( + DESCRIPTOR = _LEARNINGRATEDROPOUTDRIVENCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearningRateDropoutDrivenConfig) + )) +_sym_db.RegisterMessage(LearningRateDropoutDrivenConfig) + +LearnerConfig = _reflection.GeneratedProtocolMessageType('LearnerConfig', (_message.Message,), dict( + DESCRIPTOR = _LEARNERCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.learner_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.LearnerConfig) + )) +_sym_db.RegisterMessage(LearnerConfig) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.pb.cc new file mode 100644 index 0000000..a24e930 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.pb.cc @@ -0,0 +1,1402 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto + +#include "diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_QuantileEntry; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_QuantileSummaryState; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto +namespace boosted_trees { +class QuantileConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _QuantileConfig_default_instance_; +class QuantileEntryDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _QuantileEntry_default_instance_; +class QuantileSummaryStateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _QuantileSummaryState_default_instance_; +class QuantileStreamStateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _QuantileStreamState_default_instance_; +} // namespace boosted_trees +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto { +static void InitDefaultsQuantileConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::boosted_trees::_QuantileConfig_default_instance_; + new (ptr) ::boosted_trees::QuantileConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::boosted_trees::QuantileConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_QuantileConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsQuantileConfig}, {}}; + +static void InitDefaultsQuantileEntry() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::boosted_trees::_QuantileEntry_default_instance_; + new (ptr) ::boosted_trees::QuantileEntry(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::boosted_trees::QuantileEntry::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_QuantileEntry = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsQuantileEntry}, {}}; + +static void InitDefaultsQuantileSummaryState() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::boosted_trees::_QuantileSummaryState_default_instance_; + new (ptr) ::boosted_trees::QuantileSummaryState(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::boosted_trees::QuantileSummaryState::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_QuantileSummaryState = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsQuantileSummaryState}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileEntry.base,}}; + +static void InitDefaultsQuantileStreamState() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::boosted_trees::_QuantileStreamState_default_instance_; + new (ptr) ::boosted_trees::QuantileStreamState(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::boosted_trees::QuantileStreamState::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_QuantileStreamState = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsQuantileStreamState}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileSummaryState.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_QuantileConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_QuantileEntry.base); + ::google::protobuf::internal::InitSCC(&scc_info_QuantileSummaryState.base); + ::google::protobuf::internal::InitSCC(&scc_info_QuantileStreamState.base); +} + +::google::protobuf::Metadata file_level_metadata[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileConfig, eps_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileConfig, num_quantiles_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileEntry, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileEntry, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileEntry, weight_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileEntry, min_rank_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileEntry, max_rank_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileSummaryState, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileSummaryState, entries_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileStreamState, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::boosted_trees::QuantileStreamState, summaries_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::boosted_trees::QuantileConfig)}, + { 7, -1, sizeof(::boosted_trees::QuantileEntry)}, + { 16, -1, sizeof(::boosted_trees::QuantileSummaryState)}, + { 22, -1, sizeof(::boosted_trees::QuantileStreamState)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::boosted_trees::_QuantileConfig_default_instance_), + reinterpret_cast(&::boosted_trees::_QuantileEntry_default_instance_), + reinterpret_cast(&::boosted_trees::_QuantileSummaryState_default_instance_), + reinterpret_cast(&::boosted_trees::_QuantileStreamState_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n@diplomacy_tensorflow/contrib/boosted_t" + "rees/proto/quantiles.proto\022\rboosted_tree" + "s\"4\n\016QuantileConfig\022\013\n\003eps\030\001 \001(\001\022\025\n\rnum_" + "quantiles\030\002 \001(\003\"R\n\rQuantileEntry\022\r\n\005valu" + "e\030\001 \001(\002\022\016\n\006weight\030\002 \001(\002\022\020\n\010min_rank\030\003 \001(" + "\002\022\020\n\010max_rank\030\004 \001(\002\"E\n\024QuantileSummarySt" + "ate\022-\n\007entries\030\001 \003(\0132\034.boosted_trees.Qua" + "ntileEntry\"M\n\023QuantileStreamState\0226\n\tsum" + "maries\030\001 \003(\0132#.boosted_trees.QuantileSum" + "maryStateB\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 382); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto +namespace boosted_trees { + +// =================================================================== + +void QuantileConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int QuantileConfig::kEpsFieldNumber; +const int QuantileConfig::kNumQuantilesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +QuantileConfig::QuantileConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:boosted_trees.QuantileConfig) +} +QuantileConfig::QuantileConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:boosted_trees.QuantileConfig) +} +QuantileConfig::QuantileConfig(const QuantileConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&eps_, &from.eps_, + static_cast(reinterpret_cast(&num_quantiles_) - + reinterpret_cast(&eps_)) + sizeof(num_quantiles_)); + // @@protoc_insertion_point(copy_constructor:boosted_trees.QuantileConfig) +} + +void QuantileConfig::SharedCtor() { + ::memset(&eps_, 0, static_cast( + reinterpret_cast(&num_quantiles_) - + reinterpret_cast(&eps_)) + sizeof(num_quantiles_)); +} + +QuantileConfig::~QuantileConfig() { + // @@protoc_insertion_point(destructor:boosted_trees.QuantileConfig) + SharedDtor(); +} + +void QuantileConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void QuantileConfig::ArenaDtor(void* object) { + QuantileConfig* _this = reinterpret_cast< QuantileConfig* >(object); + (void)_this; +} +void QuantileConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void QuantileConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* QuantileConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const QuantileConfig& QuantileConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileConfig.base); + return *internal_default_instance(); +} + + +void QuantileConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:boosted_trees.QuantileConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&eps_, 0, static_cast( + reinterpret_cast(&num_quantiles_) - + reinterpret_cast(&eps_)) + sizeof(num_quantiles_)); + _internal_metadata_.Clear(); +} + +bool QuantileConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:boosted_trees.QuantileConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // double eps = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &eps_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 num_quantiles = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_quantiles_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:boosted_trees.QuantileConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:boosted_trees.QuantileConfig) + return false; +#undef DO_ +} + +void QuantileConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:boosted_trees.QuantileConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double eps = 1; + if (this->eps() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->eps(), output); + } + + // int64 num_quantiles = 2; + if (this->num_quantiles() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->num_quantiles(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:boosted_trees.QuantileConfig) +} + +::google::protobuf::uint8* QuantileConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:boosted_trees.QuantileConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double eps = 1; + if (this->eps() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->eps(), target); + } + + // int64 num_quantiles = 2; + if (this->num_quantiles() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->num_quantiles(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:boosted_trees.QuantileConfig) + return target; +} + +size_t QuantileConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:boosted_trees.QuantileConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // double eps = 1; + if (this->eps() != 0) { + total_size += 1 + 8; + } + + // int64 num_quantiles = 2; + if (this->num_quantiles() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_quantiles()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void QuantileConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:boosted_trees.QuantileConfig) + GOOGLE_DCHECK_NE(&from, this); + const QuantileConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:boosted_trees.QuantileConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:boosted_trees.QuantileConfig) + MergeFrom(*source); + } +} + +void QuantileConfig::MergeFrom(const QuantileConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:boosted_trees.QuantileConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.eps() != 0) { + set_eps(from.eps()); + } + if (from.num_quantiles() != 0) { + set_num_quantiles(from.num_quantiles()); + } +} + +void QuantileConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:boosted_trees.QuantileConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void QuantileConfig::CopyFrom(const QuantileConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:boosted_trees.QuantileConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool QuantileConfig::IsInitialized() const { + return true; +} + +void QuantileConfig::Swap(QuantileConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + QuantileConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void QuantileConfig::UnsafeArenaSwap(QuantileConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void QuantileConfig::InternalSwap(QuantileConfig* other) { + using std::swap; + swap(eps_, other->eps_); + swap(num_quantiles_, other->num_quantiles_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata QuantileConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void QuantileEntry::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int QuantileEntry::kValueFieldNumber; +const int QuantileEntry::kWeightFieldNumber; +const int QuantileEntry::kMinRankFieldNumber; +const int QuantileEntry::kMaxRankFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +QuantileEntry::QuantileEntry() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileEntry.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:boosted_trees.QuantileEntry) +} +QuantileEntry::QuantileEntry(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileEntry.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:boosted_trees.QuantileEntry) +} +QuantileEntry::QuantileEntry(const QuantileEntry& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&value_, &from.value_, + static_cast(reinterpret_cast(&max_rank_) - + reinterpret_cast(&value_)) + sizeof(max_rank_)); + // @@protoc_insertion_point(copy_constructor:boosted_trees.QuantileEntry) +} + +void QuantileEntry::SharedCtor() { + ::memset(&value_, 0, static_cast( + reinterpret_cast(&max_rank_) - + reinterpret_cast(&value_)) + sizeof(max_rank_)); +} + +QuantileEntry::~QuantileEntry() { + // @@protoc_insertion_point(destructor:boosted_trees.QuantileEntry) + SharedDtor(); +} + +void QuantileEntry::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void QuantileEntry::ArenaDtor(void* object) { + QuantileEntry* _this = reinterpret_cast< QuantileEntry* >(object); + (void)_this; +} +void QuantileEntry::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void QuantileEntry::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* QuantileEntry::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const QuantileEntry& QuantileEntry::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileEntry.base); + return *internal_default_instance(); +} + + +void QuantileEntry::Clear() { +// @@protoc_insertion_point(message_clear_start:boosted_trees.QuantileEntry) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&value_, 0, static_cast( + reinterpret_cast(&max_rank_) - + reinterpret_cast(&value_)) + sizeof(max_rank_)); + _internal_metadata_.Clear(); +} + +bool QuantileEntry::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:boosted_trees.QuantileEntry) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_))); + } else { + goto handle_unusual; + } + break; + } + + // float weight = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_))); + } else { + goto handle_unusual; + } + break; + } + + // float min_rank = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_rank_))); + } else { + goto handle_unusual; + } + break; + } + + // float max_rank = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_rank_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:boosted_trees.QuantileEntry) + return true; +failure: + // @@protoc_insertion_point(parse_failure:boosted_trees.QuantileEntry) + return false; +#undef DO_ +} + +void QuantileEntry::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:boosted_trees.QuantileEntry) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float value = 1; + if (this->value() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->value(), output); + } + + // float weight = 2; + if (this->weight() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->weight(), output); + } + + // float min_rank = 3; + if (this->min_rank() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->min_rank(), output); + } + + // float max_rank = 4; + if (this->max_rank() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->max_rank(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:boosted_trees.QuantileEntry) +} + +::google::protobuf::uint8* QuantileEntry::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:boosted_trees.QuantileEntry) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float value = 1; + if (this->value() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->value(), target); + } + + // float weight = 2; + if (this->weight() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->weight(), target); + } + + // float min_rank = 3; + if (this->min_rank() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->min_rank(), target); + } + + // float max_rank = 4; + if (this->max_rank() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->max_rank(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:boosted_trees.QuantileEntry) + return target; +} + +size_t QuantileEntry::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:boosted_trees.QuantileEntry) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float value = 1; + if (this->value() != 0) { + total_size += 1 + 4; + } + + // float weight = 2; + if (this->weight() != 0) { + total_size += 1 + 4; + } + + // float min_rank = 3; + if (this->min_rank() != 0) { + total_size += 1 + 4; + } + + // float max_rank = 4; + if (this->max_rank() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void QuantileEntry::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:boosted_trees.QuantileEntry) + GOOGLE_DCHECK_NE(&from, this); + const QuantileEntry* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:boosted_trees.QuantileEntry) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:boosted_trees.QuantileEntry) + MergeFrom(*source); + } +} + +void QuantileEntry::MergeFrom(const QuantileEntry& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:boosted_trees.QuantileEntry) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.value() != 0) { + set_value(from.value()); + } + if (from.weight() != 0) { + set_weight(from.weight()); + } + if (from.min_rank() != 0) { + set_min_rank(from.min_rank()); + } + if (from.max_rank() != 0) { + set_max_rank(from.max_rank()); + } +} + +void QuantileEntry::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:boosted_trees.QuantileEntry) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void QuantileEntry::CopyFrom(const QuantileEntry& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:boosted_trees.QuantileEntry) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool QuantileEntry::IsInitialized() const { + return true; +} + +void QuantileEntry::Swap(QuantileEntry* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + QuantileEntry* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void QuantileEntry::UnsafeArenaSwap(QuantileEntry* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void QuantileEntry::InternalSwap(QuantileEntry* other) { + using std::swap; + swap(value_, other->value_); + swap(weight_, other->weight_); + swap(min_rank_, other->min_rank_); + swap(max_rank_, other->max_rank_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata QuantileEntry::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void QuantileSummaryState::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int QuantileSummaryState::kEntriesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +QuantileSummaryState::QuantileSummaryState() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileSummaryState.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:boosted_trees.QuantileSummaryState) +} +QuantileSummaryState::QuantileSummaryState(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + entries_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileSummaryState.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:boosted_trees.QuantileSummaryState) +} +QuantileSummaryState::QuantileSummaryState(const QuantileSummaryState& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + entries_(from.entries_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:boosted_trees.QuantileSummaryState) +} + +void QuantileSummaryState::SharedCtor() { +} + +QuantileSummaryState::~QuantileSummaryState() { + // @@protoc_insertion_point(destructor:boosted_trees.QuantileSummaryState) + SharedDtor(); +} + +void QuantileSummaryState::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void QuantileSummaryState::ArenaDtor(void* object) { + QuantileSummaryState* _this = reinterpret_cast< QuantileSummaryState* >(object); + (void)_this; +} +void QuantileSummaryState::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void QuantileSummaryState::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* QuantileSummaryState::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const QuantileSummaryState& QuantileSummaryState::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileSummaryState.base); + return *internal_default_instance(); +} + + +void QuantileSummaryState::Clear() { +// @@protoc_insertion_point(message_clear_start:boosted_trees.QuantileSummaryState) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + entries_.Clear(); + _internal_metadata_.Clear(); +} + +bool QuantileSummaryState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:boosted_trees.QuantileSummaryState) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .boosted_trees.QuantileEntry entries = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_entries())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:boosted_trees.QuantileSummaryState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:boosted_trees.QuantileSummaryState) + return false; +#undef DO_ +} + +void QuantileSummaryState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:boosted_trees.QuantileSummaryState) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .boosted_trees.QuantileEntry entries = 1; + for (unsigned int i = 0, + n = static_cast(this->entries_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->entries(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:boosted_trees.QuantileSummaryState) +} + +::google::protobuf::uint8* QuantileSummaryState::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:boosted_trees.QuantileSummaryState) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .boosted_trees.QuantileEntry entries = 1; + for (unsigned int i = 0, + n = static_cast(this->entries_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->entries(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:boosted_trees.QuantileSummaryState) + return target; +} + +size_t QuantileSummaryState::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:boosted_trees.QuantileSummaryState) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .boosted_trees.QuantileEntry entries = 1; + { + unsigned int count = static_cast(this->entries_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->entries(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void QuantileSummaryState::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:boosted_trees.QuantileSummaryState) + GOOGLE_DCHECK_NE(&from, this); + const QuantileSummaryState* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:boosted_trees.QuantileSummaryState) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:boosted_trees.QuantileSummaryState) + MergeFrom(*source); + } +} + +void QuantileSummaryState::MergeFrom(const QuantileSummaryState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:boosted_trees.QuantileSummaryState) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + entries_.MergeFrom(from.entries_); +} + +void QuantileSummaryState::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:boosted_trees.QuantileSummaryState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void QuantileSummaryState::CopyFrom(const QuantileSummaryState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:boosted_trees.QuantileSummaryState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool QuantileSummaryState::IsInitialized() const { + return true; +} + +void QuantileSummaryState::Swap(QuantileSummaryState* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + QuantileSummaryState* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void QuantileSummaryState::UnsafeArenaSwap(QuantileSummaryState* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void QuantileSummaryState::InternalSwap(QuantileSummaryState* other) { + using std::swap; + CastToBase(&entries_)->InternalSwap(CastToBase(&other->entries_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata QuantileSummaryState::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void QuantileStreamState::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int QuantileStreamState::kSummariesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +QuantileStreamState::QuantileStreamState() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileStreamState.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:boosted_trees.QuantileStreamState) +} +QuantileStreamState::QuantileStreamState(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + summaries_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileStreamState.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:boosted_trees.QuantileStreamState) +} +QuantileStreamState::QuantileStreamState(const QuantileStreamState& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + summaries_(from.summaries_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:boosted_trees.QuantileStreamState) +} + +void QuantileStreamState::SharedCtor() { +} + +QuantileStreamState::~QuantileStreamState() { + // @@protoc_insertion_point(destructor:boosted_trees.QuantileStreamState) + SharedDtor(); +} + +void QuantileStreamState::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void QuantileStreamState::ArenaDtor(void* object) { + QuantileStreamState* _this = reinterpret_cast< QuantileStreamState* >(object); + (void)_this; +} +void QuantileStreamState::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void QuantileStreamState::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* QuantileStreamState::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const QuantileStreamState& QuantileStreamState::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::scc_info_QuantileStreamState.base); + return *internal_default_instance(); +} + + +void QuantileStreamState::Clear() { +// @@protoc_insertion_point(message_clear_start:boosted_trees.QuantileStreamState) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + summaries_.Clear(); + _internal_metadata_.Clear(); +} + +bool QuantileStreamState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:boosted_trees.QuantileStreamState) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .boosted_trees.QuantileSummaryState summaries = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_summaries())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:boosted_trees.QuantileStreamState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:boosted_trees.QuantileStreamState) + return false; +#undef DO_ +} + +void QuantileStreamState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:boosted_trees.QuantileStreamState) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .boosted_trees.QuantileSummaryState summaries = 1; + for (unsigned int i = 0, + n = static_cast(this->summaries_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->summaries(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:boosted_trees.QuantileStreamState) +} + +::google::protobuf::uint8* QuantileStreamState::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:boosted_trees.QuantileStreamState) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .boosted_trees.QuantileSummaryState summaries = 1; + for (unsigned int i = 0, + n = static_cast(this->summaries_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->summaries(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:boosted_trees.QuantileStreamState) + return target; +} + +size_t QuantileStreamState::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:boosted_trees.QuantileStreamState) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .boosted_trees.QuantileSummaryState summaries = 1; + { + unsigned int count = static_cast(this->summaries_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->summaries(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void QuantileStreamState::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:boosted_trees.QuantileStreamState) + GOOGLE_DCHECK_NE(&from, this); + const QuantileStreamState* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:boosted_trees.QuantileStreamState) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:boosted_trees.QuantileStreamState) + MergeFrom(*source); + } +} + +void QuantileStreamState::MergeFrom(const QuantileStreamState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:boosted_trees.QuantileStreamState) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + summaries_.MergeFrom(from.summaries_); +} + +void QuantileStreamState::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:boosted_trees.QuantileStreamState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void QuantileStreamState::CopyFrom(const QuantileStreamState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:boosted_trees.QuantileStreamState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool QuantileStreamState::IsInitialized() const { + return true; +} + +void QuantileStreamState::Swap(QuantileStreamState* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + QuantileStreamState* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void QuantileStreamState::UnsafeArenaSwap(QuantileStreamState* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void QuantileStreamState::InternalSwap(QuantileStreamState* other) { + using std::swap; + CastToBase(&summaries_)->InternalSwap(CastToBase(&other->summaries_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata QuantileStreamState::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace boosted_trees +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::boosted_trees::QuantileConfig* Arena::CreateMaybeMessage< ::boosted_trees::QuantileConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::boosted_trees::QuantileConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::boosted_trees::QuantileEntry* Arena::CreateMaybeMessage< ::boosted_trees::QuantileEntry >(Arena* arena) { + return Arena::CreateMessageInternal< ::boosted_trees::QuantileEntry >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::boosted_trees::QuantileSummaryState* Arena::CreateMaybeMessage< ::boosted_trees::QuantileSummaryState >(Arena* arena) { + return Arena::CreateMessageInternal< ::boosted_trees::QuantileSummaryState >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::boosted_trees::QuantileStreamState* Arena::CreateMaybeMessage< ::boosted_trees::QuantileStreamState >(Arena* arena) { + return Arena::CreateMessageInternal< ::boosted_trees::QuantileStreamState >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.pb.h new file mode 100644 index 0000000..8630783 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.pb.h @@ -0,0 +1,767 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto +namespace boosted_trees { +class QuantileConfig; +class QuantileConfigDefaultTypeInternal; +extern QuantileConfigDefaultTypeInternal _QuantileConfig_default_instance_; +class QuantileEntry; +class QuantileEntryDefaultTypeInternal; +extern QuantileEntryDefaultTypeInternal _QuantileEntry_default_instance_; +class QuantileStreamState; +class QuantileStreamStateDefaultTypeInternal; +extern QuantileStreamStateDefaultTypeInternal _QuantileStreamState_default_instance_; +class QuantileSummaryState; +class QuantileSummaryStateDefaultTypeInternal; +extern QuantileSummaryStateDefaultTypeInternal _QuantileSummaryState_default_instance_; +} // namespace boosted_trees +namespace google { +namespace protobuf { +template<> ::boosted_trees::QuantileConfig* Arena::CreateMaybeMessage<::boosted_trees::QuantileConfig>(Arena*); +template<> ::boosted_trees::QuantileEntry* Arena::CreateMaybeMessage<::boosted_trees::QuantileEntry>(Arena*); +template<> ::boosted_trees::QuantileStreamState* Arena::CreateMaybeMessage<::boosted_trees::QuantileStreamState>(Arena*); +template<> ::boosted_trees::QuantileSummaryState* Arena::CreateMaybeMessage<::boosted_trees::QuantileSummaryState>(Arena*); +} // namespace protobuf +} // namespace google +namespace boosted_trees { + +// =================================================================== + +class QuantileConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:boosted_trees.QuantileConfig) */ { + public: + QuantileConfig(); + virtual ~QuantileConfig(); + + QuantileConfig(const QuantileConfig& from); + + inline QuantileConfig& operator=(const QuantileConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + QuantileConfig(QuantileConfig&& from) noexcept + : QuantileConfig() { + *this = ::std::move(from); + } + + inline QuantileConfig& operator=(QuantileConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const QuantileConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const QuantileConfig* internal_default_instance() { + return reinterpret_cast( + &_QuantileConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(QuantileConfig* other); + void Swap(QuantileConfig* other); + friend void swap(QuantileConfig& a, QuantileConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline QuantileConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + QuantileConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const QuantileConfig& from); + void MergeFrom(const QuantileConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(QuantileConfig* other); + protected: + explicit QuantileConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // double eps = 1; + void clear_eps(); + static const int kEpsFieldNumber = 1; + double eps() const; + void set_eps(double value); + + // int64 num_quantiles = 2; + void clear_num_quantiles(); + static const int kNumQuantilesFieldNumber = 2; + ::google::protobuf::int64 num_quantiles() const; + void set_num_quantiles(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:boosted_trees.QuantileConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + double eps_; + ::google::protobuf::int64 num_quantiles_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class QuantileEntry : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:boosted_trees.QuantileEntry) */ { + public: + QuantileEntry(); + virtual ~QuantileEntry(); + + QuantileEntry(const QuantileEntry& from); + + inline QuantileEntry& operator=(const QuantileEntry& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + QuantileEntry(QuantileEntry&& from) noexcept + : QuantileEntry() { + *this = ::std::move(from); + } + + inline QuantileEntry& operator=(QuantileEntry&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const QuantileEntry& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const QuantileEntry* internal_default_instance() { + return reinterpret_cast( + &_QuantileEntry_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(QuantileEntry* other); + void Swap(QuantileEntry* other); + friend void swap(QuantileEntry& a, QuantileEntry& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline QuantileEntry* New() const final { + return CreateMaybeMessage(NULL); + } + + QuantileEntry* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const QuantileEntry& from); + void MergeFrom(const QuantileEntry& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(QuantileEntry* other); + protected: + explicit QuantileEntry(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float value = 1; + void clear_value(); + static const int kValueFieldNumber = 1; + float value() const; + void set_value(float value); + + // float weight = 2; + void clear_weight(); + static const int kWeightFieldNumber = 2; + float weight() const; + void set_weight(float value); + + // float min_rank = 3; + void clear_min_rank(); + static const int kMinRankFieldNumber = 3; + float min_rank() const; + void set_min_rank(float value); + + // float max_rank = 4; + void clear_max_rank(); + static const int kMaxRankFieldNumber = 4; + float max_rank() const; + void set_max_rank(float value); + + // @@protoc_insertion_point(class_scope:boosted_trees.QuantileEntry) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float value_; + float weight_; + float min_rank_; + float max_rank_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class QuantileSummaryState : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:boosted_trees.QuantileSummaryState) */ { + public: + QuantileSummaryState(); + virtual ~QuantileSummaryState(); + + QuantileSummaryState(const QuantileSummaryState& from); + + inline QuantileSummaryState& operator=(const QuantileSummaryState& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + QuantileSummaryState(QuantileSummaryState&& from) noexcept + : QuantileSummaryState() { + *this = ::std::move(from); + } + + inline QuantileSummaryState& operator=(QuantileSummaryState&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const QuantileSummaryState& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const QuantileSummaryState* internal_default_instance() { + return reinterpret_cast( + &_QuantileSummaryState_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(QuantileSummaryState* other); + void Swap(QuantileSummaryState* other); + friend void swap(QuantileSummaryState& a, QuantileSummaryState& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline QuantileSummaryState* New() const final { + return CreateMaybeMessage(NULL); + } + + QuantileSummaryState* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const QuantileSummaryState& from); + void MergeFrom(const QuantileSummaryState& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(QuantileSummaryState* other); + protected: + explicit QuantileSummaryState(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .boosted_trees.QuantileEntry entries = 1; + int entries_size() const; + void clear_entries(); + static const int kEntriesFieldNumber = 1; + ::boosted_trees::QuantileEntry* mutable_entries(int index); + ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileEntry >* + mutable_entries(); + const ::boosted_trees::QuantileEntry& entries(int index) const; + ::boosted_trees::QuantileEntry* add_entries(); + const ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileEntry >& + entries() const; + + // @@protoc_insertion_point(class_scope:boosted_trees.QuantileSummaryState) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileEntry > entries_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class QuantileStreamState : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:boosted_trees.QuantileStreamState) */ { + public: + QuantileStreamState(); + virtual ~QuantileStreamState(); + + QuantileStreamState(const QuantileStreamState& from); + + inline QuantileStreamState& operator=(const QuantileStreamState& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + QuantileStreamState(QuantileStreamState&& from) noexcept + : QuantileStreamState() { + *this = ::std::move(from); + } + + inline QuantileStreamState& operator=(QuantileStreamState&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const QuantileStreamState& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const QuantileStreamState* internal_default_instance() { + return reinterpret_cast( + &_QuantileStreamState_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(QuantileStreamState* other); + void Swap(QuantileStreamState* other); + friend void swap(QuantileStreamState& a, QuantileStreamState& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline QuantileStreamState* New() const final { + return CreateMaybeMessage(NULL); + } + + QuantileStreamState* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const QuantileStreamState& from); + void MergeFrom(const QuantileStreamState& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(QuantileStreamState* other); + protected: + explicit QuantileStreamState(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .boosted_trees.QuantileSummaryState summaries = 1; + int summaries_size() const; + void clear_summaries(); + static const int kSummariesFieldNumber = 1; + ::boosted_trees::QuantileSummaryState* mutable_summaries(int index); + ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileSummaryState >* + mutable_summaries(); + const ::boosted_trees::QuantileSummaryState& summaries(int index) const; + ::boosted_trees::QuantileSummaryState* add_summaries(); + const ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileSummaryState >& + summaries() const; + + // @@protoc_insertion_point(class_scope:boosted_trees.QuantileStreamState) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileSummaryState > summaries_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// QuantileConfig + +// double eps = 1; +inline void QuantileConfig::clear_eps() { + eps_ = 0; +} +inline double QuantileConfig::eps() const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileConfig.eps) + return eps_; +} +inline void QuantileConfig::set_eps(double value) { + + eps_ = value; + // @@protoc_insertion_point(field_set:boosted_trees.QuantileConfig.eps) +} + +// int64 num_quantiles = 2; +inline void QuantileConfig::clear_num_quantiles() { + num_quantiles_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 QuantileConfig::num_quantiles() const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileConfig.num_quantiles) + return num_quantiles_; +} +inline void QuantileConfig::set_num_quantiles(::google::protobuf::int64 value) { + + num_quantiles_ = value; + // @@protoc_insertion_point(field_set:boosted_trees.QuantileConfig.num_quantiles) +} + +// ------------------------------------------------------------------- + +// QuantileEntry + +// float value = 1; +inline void QuantileEntry::clear_value() { + value_ = 0; +} +inline float QuantileEntry::value() const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileEntry.value) + return value_; +} +inline void QuantileEntry::set_value(float value) { + + value_ = value; + // @@protoc_insertion_point(field_set:boosted_trees.QuantileEntry.value) +} + +// float weight = 2; +inline void QuantileEntry::clear_weight() { + weight_ = 0; +} +inline float QuantileEntry::weight() const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileEntry.weight) + return weight_; +} +inline void QuantileEntry::set_weight(float value) { + + weight_ = value; + // @@protoc_insertion_point(field_set:boosted_trees.QuantileEntry.weight) +} + +// float min_rank = 3; +inline void QuantileEntry::clear_min_rank() { + min_rank_ = 0; +} +inline float QuantileEntry::min_rank() const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileEntry.min_rank) + return min_rank_; +} +inline void QuantileEntry::set_min_rank(float value) { + + min_rank_ = value; + // @@protoc_insertion_point(field_set:boosted_trees.QuantileEntry.min_rank) +} + +// float max_rank = 4; +inline void QuantileEntry::clear_max_rank() { + max_rank_ = 0; +} +inline float QuantileEntry::max_rank() const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileEntry.max_rank) + return max_rank_; +} +inline void QuantileEntry::set_max_rank(float value) { + + max_rank_ = value; + // @@protoc_insertion_point(field_set:boosted_trees.QuantileEntry.max_rank) +} + +// ------------------------------------------------------------------- + +// QuantileSummaryState + +// repeated .boosted_trees.QuantileEntry entries = 1; +inline int QuantileSummaryState::entries_size() const { + return entries_.size(); +} +inline void QuantileSummaryState::clear_entries() { + entries_.Clear(); +} +inline ::boosted_trees::QuantileEntry* QuantileSummaryState::mutable_entries(int index) { + // @@protoc_insertion_point(field_mutable:boosted_trees.QuantileSummaryState.entries) + return entries_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileEntry >* +QuantileSummaryState::mutable_entries() { + // @@protoc_insertion_point(field_mutable_list:boosted_trees.QuantileSummaryState.entries) + return &entries_; +} +inline const ::boosted_trees::QuantileEntry& QuantileSummaryState::entries(int index) const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileSummaryState.entries) + return entries_.Get(index); +} +inline ::boosted_trees::QuantileEntry* QuantileSummaryState::add_entries() { + // @@protoc_insertion_point(field_add:boosted_trees.QuantileSummaryState.entries) + return entries_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileEntry >& +QuantileSummaryState::entries() const { + // @@protoc_insertion_point(field_list:boosted_trees.QuantileSummaryState.entries) + return entries_; +} + +// ------------------------------------------------------------------- + +// QuantileStreamState + +// repeated .boosted_trees.QuantileSummaryState summaries = 1; +inline int QuantileStreamState::summaries_size() const { + return summaries_.size(); +} +inline void QuantileStreamState::clear_summaries() { + summaries_.Clear(); +} +inline ::boosted_trees::QuantileSummaryState* QuantileStreamState::mutable_summaries(int index) { + // @@protoc_insertion_point(field_mutable:boosted_trees.QuantileStreamState.summaries) + return summaries_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileSummaryState >* +QuantileStreamState::mutable_summaries() { + // @@protoc_insertion_point(field_mutable_list:boosted_trees.QuantileStreamState.summaries) + return &summaries_; +} +inline const ::boosted_trees::QuantileSummaryState& QuantileStreamState::summaries(int index) const { + // @@protoc_insertion_point(field_get:boosted_trees.QuantileStreamState.summaries) + return summaries_.Get(index); +} +inline ::boosted_trees::QuantileSummaryState* QuantileStreamState::add_summaries() { + // @@protoc_insertion_point(field_add:boosted_trees.QuantileStreamState.summaries) + return summaries_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::boosted_trees::QuantileSummaryState >& +QuantileStreamState::summaries() const { + // @@protoc_insertion_point(field_list:boosted_trees.QuantileStreamState.summaries) + return summaries_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace boosted_trees + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fquantiles_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto new file mode 100644 index 0000000..7f872d2 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +option cc_enable_arenas = true; + +package boosted_trees; + +message QuantileConfig { + // Maximum eps error when computing quantile summaries. + double eps = 1; + // Number of quantiles to generate. + int64 num_quantiles = 2; +} + +message QuantileEntry { + // Value for the entry. + float value = 1; + // Weight for the entry. + float weight = 2; + // We need the minimum and maximum rank possible for this entry. + // Rank is 0.0 for the absolute minimum and sum of the weights for the maximum + // value in the input. + float min_rank = 3; + float max_rank = 4; +} + +message QuantileSummaryState { + repeated QuantileEntry entries = 1; +} + +message QuantileStreamState { + repeated QuantileSummaryState summaries = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles_pb2.py new file mode 100644 index 0000000..61d4625 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles_pb2.py @@ -0,0 +1,217 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto', + package='boosted_trees', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n@diplomacy_tensorflow/contrib/boosted_trees/proto/quantiles.proto\x12\rboosted_trees\"4\n\x0eQuantileConfig\x12\x0b\n\x03\x65ps\x18\x01 \x01(\x01\x12\x15\n\rnum_quantiles\x18\x02 \x01(\x03\"R\n\rQuantileEntry\x12\r\n\x05value\x18\x01 \x01(\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x02\x12\x10\n\x08min_rank\x18\x03 \x01(\x02\x12\x10\n\x08max_rank\x18\x04 \x01(\x02\"E\n\x14QuantileSummaryState\x12-\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1c.boosted_trees.QuantileEntry\"M\n\x13QuantileStreamState\x12\x36\n\tsummaries\x18\x01 \x03(\x0b\x32#.boosted_trees.QuantileSummaryStateB\x03\xf8\x01\x01\x62\x06proto3') +) + + + + +_QUANTILECONFIG = _descriptor.Descriptor( + name='QuantileConfig', + full_name='boosted_trees.QuantileConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='eps', full_name='boosted_trees.QuantileConfig.eps', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_quantiles', full_name='boosted_trees.QuantileConfig.num_quantiles', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=83, + serialized_end=135, +) + + +_QUANTILEENTRY = _descriptor.Descriptor( + name='QuantileEntry', + full_name='boosted_trees.QuantileEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='boosted_trees.QuantileEntry.value', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='weight', full_name='boosted_trees.QuantileEntry.weight', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_rank', full_name='boosted_trees.QuantileEntry.min_rank', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_rank', full_name='boosted_trees.QuantileEntry.max_rank', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=137, + serialized_end=219, +) + + +_QUANTILESUMMARYSTATE = _descriptor.Descriptor( + name='QuantileSummaryState', + full_name='boosted_trees.QuantileSummaryState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entries', full_name='boosted_trees.QuantileSummaryState.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=221, + serialized_end=290, +) + + +_QUANTILESTREAMSTATE = _descriptor.Descriptor( + name='QuantileStreamState', + full_name='boosted_trees.QuantileStreamState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='summaries', full_name='boosted_trees.QuantileStreamState.summaries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=292, + serialized_end=369, +) + +_QUANTILESUMMARYSTATE.fields_by_name['entries'].message_type = _QUANTILEENTRY +_QUANTILESTREAMSTATE.fields_by_name['summaries'].message_type = _QUANTILESUMMARYSTATE +DESCRIPTOR.message_types_by_name['QuantileConfig'] = _QUANTILECONFIG +DESCRIPTOR.message_types_by_name['QuantileEntry'] = _QUANTILEENTRY +DESCRIPTOR.message_types_by_name['QuantileSummaryState'] = _QUANTILESUMMARYSTATE +DESCRIPTOR.message_types_by_name['QuantileStreamState'] = _QUANTILESTREAMSTATE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +QuantileConfig = _reflection.GeneratedProtocolMessageType('QuantileConfig', (_message.Message,), dict( + DESCRIPTOR = _QUANTILECONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.quantiles_pb2' + # @@protoc_insertion_point(class_scope:boosted_trees.QuantileConfig) + )) +_sym_db.RegisterMessage(QuantileConfig) + +QuantileEntry = _reflection.GeneratedProtocolMessageType('QuantileEntry', (_message.Message,), dict( + DESCRIPTOR = _QUANTILEENTRY, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.quantiles_pb2' + # @@protoc_insertion_point(class_scope:boosted_trees.QuantileEntry) + )) +_sym_db.RegisterMessage(QuantileEntry) + +QuantileSummaryState = _reflection.GeneratedProtocolMessageType('QuantileSummaryState', (_message.Message,), dict( + DESCRIPTOR = _QUANTILESUMMARYSTATE, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.quantiles_pb2' + # @@protoc_insertion_point(class_scope:boosted_trees.QuantileSummaryState) + )) +_sym_db.RegisterMessage(QuantileSummaryState) + +QuantileStreamState = _reflection.GeneratedProtocolMessageType('QuantileStreamState', (_message.Message,), dict( + DESCRIPTOR = _QUANTILESTREAMSTATE, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.quantiles_pb2' + # @@protoc_insertion_point(class_scope:boosted_trees.QuantileStreamState) + )) +_sym_db.RegisterMessage(QuantileStreamState) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.pb.cc new file mode 100644 index 0000000..0831ec6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.pb.cc @@ -0,0 +1,1007 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto + +#include "diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Leaf; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<9> scc_info_TreeNode; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { +class SplitInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SplitInfo_default_instance_; +class ObliviousSplitInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ObliviousSplitInfo_default_instance_; +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto { +static void InitDefaultsSplitInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_SplitInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::SplitInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::SplitInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_SplitInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsSplitInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNode.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Leaf.base,}}; + +static void InitDefaultsObliviousSplitInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::learner::_ObliviousSplitInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_ObliviousSplitInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsObliviousSplitInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNode.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Leaf.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_SplitInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_ObliviousSplitInfo.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::SplitInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::SplitInfo, split_node_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::SplitInfo, left_child_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::SplitInfo, right_child_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo, split_node_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo, children_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo, children_parent_id_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::SplitInfo)}, + { 8, -1, sizeof(::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_SplitInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::learner::_ObliviousSplitInfo_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nAdiplomacy_tensorflow/contrib/boosted_t" + "rees/proto/split_info.proto\022*diplomacy.t" + "ensorflow.boosted_trees.learner\032Bdiploma" + "cy_tensorflow/contrib/boosted_trees/prot" + "o/tree_config.proto\"\334\001\n\tSplitInfo\022F\n\nspl" + "it_node\030\001 \001(\01322.diplomacy.tensorflow.boo" + "sted_trees.trees.TreeNode\022B\n\nleft_child\030" + "\002 \001(\0132..diplomacy.tensorflow.boosted_tre" + "es.trees.Leaf\022C\n\013right_child\030\003 \001(\0132..dip" + "lomacy.tensorflow.boosted_trees.trees.Le" + "af\"\272\001\n\022ObliviousSplitInfo\022F\n\nsplit_node\030" + "\001 \001(\01322.diplomacy.tensorflow.boosted_tre" + "es.trees.TreeNode\022@\n\010children\030\002 \003(\0132..di" + "plomacy.tensorflow.boosted_trees.trees.L" + "eaf\022\032\n\022children_parent_id\030\003 \003(\005B\003\370\001\001b\006pr" + "oto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 604); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { + +// =================================================================== + +void SplitInfo::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::learner::_SplitInfo_default_instance_._instance.get_mutable()->split_node_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode*>( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::learner::_SplitInfo_default_instance_._instance.get_mutable()->left_child_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::Leaf*>( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::learner::_SplitInfo_default_instance_._instance.get_mutable()->right_child_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::Leaf*>( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf::internal_default_instance()); +} +void SplitInfo::unsafe_arena_set_allocated_split_node( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node) { + if (GetArenaNoVirtual() == NULL) { + delete split_node_; + } + split_node_ = split_node; + if (split_node) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.split_node) +} +void SplitInfo::clear_split_node() { + if (GetArenaNoVirtual() == NULL && split_node_ != NULL) { + delete split_node_; + } + split_node_ = NULL; +} +void SplitInfo::unsafe_arena_set_allocated_left_child( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* left_child) { + if (GetArenaNoVirtual() == NULL) { + delete left_child_; + } + left_child_ = left_child; + if (left_child) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.left_child) +} +void SplitInfo::clear_left_child() { + if (GetArenaNoVirtual() == NULL && left_child_ != NULL) { + delete left_child_; + } + left_child_ = NULL; +} +void SplitInfo::unsafe_arena_set_allocated_right_child( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* right_child) { + if (GetArenaNoVirtual() == NULL) { + delete right_child_; + } + right_child_ = right_child; + if (right_child) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.right_child) +} +void SplitInfo::clear_right_child() { + if (GetArenaNoVirtual() == NULL && right_child_ != NULL) { + delete right_child_; + } + right_child_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SplitInfo::kSplitNodeFieldNumber; +const int SplitInfo::kLeftChildFieldNumber; +const int SplitInfo::kRightChildFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SplitInfo::SplitInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::scc_info_SplitInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) +} +SplitInfo::SplitInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::scc_info_SplitInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) +} +SplitInfo::SplitInfo(const SplitInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_split_node()) { + split_node_ = new ::diplomacy::tensorflow::boosted_trees::trees::TreeNode(*from.split_node_); + } else { + split_node_ = NULL; + } + if (from.has_left_child()) { + left_child_ = new ::diplomacy::tensorflow::boosted_trees::trees::Leaf(*from.left_child_); + } else { + left_child_ = NULL; + } + if (from.has_right_child()) { + right_child_ = new ::diplomacy::tensorflow::boosted_trees::trees::Leaf(*from.right_child_); + } else { + right_child_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) +} + +void SplitInfo::SharedCtor() { + ::memset(&split_node_, 0, static_cast( + reinterpret_cast(&right_child_) - + reinterpret_cast(&split_node_)) + sizeof(right_child_)); +} + +SplitInfo::~SplitInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + SharedDtor(); +} + +void SplitInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete split_node_; + if (this != internal_default_instance()) delete left_child_; + if (this != internal_default_instance()) delete right_child_; +} + +void SplitInfo::ArenaDtor(void* object) { + SplitInfo* _this = reinterpret_cast< SplitInfo* >(object); + (void)_this; +} +void SplitInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SplitInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SplitInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SplitInfo& SplitInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::scc_info_SplitInfo.base); + return *internal_default_instance(); +} + + +void SplitInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && split_node_ != NULL) { + delete split_node_; + } + split_node_ = NULL; + if (GetArenaNoVirtual() == NULL && left_child_ != NULL) { + delete left_child_; + } + left_child_ = NULL; + if (GetArenaNoVirtual() == NULL && right_child_ != NULL) { + delete right_child_; + } + right_child_ = NULL; + _internal_metadata_.Clear(); +} + +bool SplitInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_split_node())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf left_child = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_left_child())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf right_child = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_right_child())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + return false; +#undef DO_ +} + +void SplitInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + if (this->has_split_node()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_split_node(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf left_child = 2; + if (this->has_left_child()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_left_child(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf right_child = 3; + if (this->has_right_child()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_right_child(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) +} + +::google::protobuf::uint8* SplitInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + if (this->has_split_node()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_split_node(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf left_child = 2; + if (this->has_left_child()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_left_child(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf right_child = 3; + if (this->has_right_child()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_right_child(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + return target; +} + +size_t SplitInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + if (this->has_split_node()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *split_node_); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf left_child = 2; + if (this->has_left_child()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *left_child_); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf right_child = 3; + if (this->has_right_child()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *right_child_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SplitInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + GOOGLE_DCHECK_NE(&from, this); + const SplitInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + MergeFrom(*source); + } +} + +void SplitInfo::MergeFrom(const SplitInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_split_node()) { + mutable_split_node()->::diplomacy::tensorflow::boosted_trees::trees::TreeNode::MergeFrom(from.split_node()); + } + if (from.has_left_child()) { + mutable_left_child()->::diplomacy::tensorflow::boosted_trees::trees::Leaf::MergeFrom(from.left_child()); + } + if (from.has_right_child()) { + mutable_right_child()->::diplomacy::tensorflow::boosted_trees::trees::Leaf::MergeFrom(from.right_child()); + } +} + +void SplitInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SplitInfo::CopyFrom(const SplitInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SplitInfo::IsInitialized() const { + return true; +} + +void SplitInfo::Swap(SplitInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SplitInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SplitInfo::UnsafeArenaSwap(SplitInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SplitInfo::InternalSwap(SplitInfo* other) { + using std::swap; + swap(split_node_, other->split_node_); + swap(left_child_, other->left_child_); + swap(right_child_, other->right_child_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SplitInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ObliviousSplitInfo::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::learner::_ObliviousSplitInfo_default_instance_._instance.get_mutable()->split_node_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode*>( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode::internal_default_instance()); +} +void ObliviousSplitInfo::unsafe_arena_set_allocated_split_node( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node) { + if (GetArenaNoVirtual() == NULL) { + delete split_node_; + } + split_node_ = split_node; + if (split_node) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.split_node) +} +void ObliviousSplitInfo::clear_split_node() { + if (GetArenaNoVirtual() == NULL && split_node_ != NULL) { + delete split_node_; + } + split_node_ = NULL; +} +void ObliviousSplitInfo::clear_children() { + children_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ObliviousSplitInfo::kSplitNodeFieldNumber; +const int ObliviousSplitInfo::kChildrenFieldNumber; +const int ObliviousSplitInfo::kChildrenParentIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ObliviousSplitInfo::ObliviousSplitInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::scc_info_ObliviousSplitInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) +} +ObliviousSplitInfo::ObliviousSplitInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + children_(arena), + children_parent_id_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::scc_info_ObliviousSplitInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) +} +ObliviousSplitInfo::ObliviousSplitInfo(const ObliviousSplitInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + children_(from.children_), + children_parent_id_(from.children_parent_id_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_split_node()) { + split_node_ = new ::diplomacy::tensorflow::boosted_trees::trees::TreeNode(*from.split_node_); + } else { + split_node_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) +} + +void ObliviousSplitInfo::SharedCtor() { + split_node_ = NULL; +} + +ObliviousSplitInfo::~ObliviousSplitInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + SharedDtor(); +} + +void ObliviousSplitInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete split_node_; +} + +void ObliviousSplitInfo::ArenaDtor(void* object) { + ObliviousSplitInfo* _this = reinterpret_cast< ObliviousSplitInfo* >(object); + (void)_this; +} +void ObliviousSplitInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ObliviousSplitInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ObliviousSplitInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ObliviousSplitInfo& ObliviousSplitInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::scc_info_ObliviousSplitInfo.base); + return *internal_default_instance(); +} + + +void ObliviousSplitInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + children_.Clear(); + children_parent_id_.Clear(); + if (GetArenaNoVirtual() == NULL && split_node_ != NULL) { + delete split_node_; + } + split_node_ = NULL; + _internal_metadata_.Clear(); +} + +bool ObliviousSplitInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_split_node())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf children = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_children())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 children_parent_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_children_parent_id()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 26u, input, this->mutable_children_parent_id()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + return false; +#undef DO_ +} + +void ObliviousSplitInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + if (this->has_split_node()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_split_node(), output); + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf children = 2; + for (unsigned int i = 0, + n = static_cast(this->children_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->children(static_cast(i)), + output); + } + + // repeated int32 children_parent_id = 3; + if (this->children_parent_id_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _children_parent_id_cached_byte_size_)); + } + for (int i = 0, n = this->children_parent_id_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->children_parent_id(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) +} + +::google::protobuf::uint8* ObliviousSplitInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + if (this->has_split_node()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_split_node(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf children = 2; + for (unsigned int i = 0, + n = static_cast(this->children_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->children(static_cast(i)), deterministic, target); + } + + // repeated int32 children_parent_id = 3; + if (this->children_parent_id_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _children_parent_id_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->children_parent_id_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + return target; +} + +size_t ObliviousSplitInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf children = 2; + { + unsigned int count = static_cast(this->children_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->children(static_cast(i))); + } + } + + // repeated int32 children_parent_id = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->children_parent_id_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _children_parent_id_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + if (this->has_split_node()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *split_node_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ObliviousSplitInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + GOOGLE_DCHECK_NE(&from, this); + const ObliviousSplitInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + MergeFrom(*source); + } +} + +void ObliviousSplitInfo::MergeFrom(const ObliviousSplitInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + children_.MergeFrom(from.children_); + children_parent_id_.MergeFrom(from.children_parent_id_); + if (from.has_split_node()) { + mutable_split_node()->::diplomacy::tensorflow::boosted_trees::trees::TreeNode::MergeFrom(from.split_node()); + } +} + +void ObliviousSplitInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ObliviousSplitInfo::CopyFrom(const ObliviousSplitInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ObliviousSplitInfo::IsInitialized() const { + return true; +} + +void ObliviousSplitInfo::Swap(ObliviousSplitInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ObliviousSplitInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ObliviousSplitInfo::UnsafeArenaSwap(ObliviousSplitInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ObliviousSplitInfo::InternalSwap(ObliviousSplitInfo* other) { + using std::swap; + CastToBase(&children_)->InternalSwap(CastToBase(&other->children_)); + children_parent_id_.InternalSwap(&other->children_parent_id_); + swap(split_node_, other->split_node_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ObliviousSplitInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::SplitInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::SplitInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::SplitInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.pb.h new file mode 100644 index 0000000..01ceb06 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.pb.h @@ -0,0 +1,710 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { +class ObliviousSplitInfo; +class ObliviousSplitInfoDefaultTypeInternal; +extern ObliviousSplitInfoDefaultTypeInternal _ObliviousSplitInfo_default_instance_; +class SplitInfo; +class SplitInfoDefaultTypeInternal; +extern SplitInfoDefaultTypeInternal _SplitInfo_default_instance_; +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::ObliviousSplitInfo>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::learner::SplitInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::learner::SplitInfo>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace learner { + +// =================================================================== + +class SplitInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) */ { + public: + SplitInfo(); + virtual ~SplitInfo(); + + SplitInfo(const SplitInfo& from); + + inline SplitInfo& operator=(const SplitInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SplitInfo(SplitInfo&& from) noexcept + : SplitInfo() { + *this = ::std::move(from); + } + + inline SplitInfo& operator=(SplitInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SplitInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SplitInfo* internal_default_instance() { + return reinterpret_cast( + &_SplitInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(SplitInfo* other); + void Swap(SplitInfo* other); + friend void swap(SplitInfo& a, SplitInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SplitInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + SplitInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SplitInfo& from); + void MergeFrom(const SplitInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SplitInfo* other); + protected: + explicit SplitInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + bool has_split_node() const; + void clear_split_node(); + static const int kSplitNodeFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& _internal_split_node() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& split_node() const; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* release_split_node(); + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* mutable_split_node(); + void set_allocated_split_node(::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node); + void unsafe_arena_set_allocated_split_node( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node); + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* unsafe_arena_release_split_node(); + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf left_child = 2; + bool has_left_child() const; + void clear_left_child(); + static const int kLeftChildFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& _internal_left_child() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& left_child() const; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* release_left_child(); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* mutable_left_child(); + void set_allocated_left_child(::diplomacy::tensorflow::boosted_trees::trees::Leaf* left_child); + void unsafe_arena_set_allocated_left_child( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* left_child); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* unsafe_arena_release_left_child(); + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf right_child = 3; + bool has_right_child() const; + void clear_right_child(); + static const int kRightChildFieldNumber = 3; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& _internal_right_child() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& right_child() const; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* release_right_child(); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* mutable_right_child(); + void set_allocated_right_child(::diplomacy::tensorflow::boosted_trees::trees::Leaf* right_child); + void unsafe_arena_set_allocated_right_child( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* right_child); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* unsafe_arena_release_right_child(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node_; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* left_child_; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* right_child_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ObliviousSplitInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) */ { + public: + ObliviousSplitInfo(); + virtual ~ObliviousSplitInfo(); + + ObliviousSplitInfo(const ObliviousSplitInfo& from); + + inline ObliviousSplitInfo& operator=(const ObliviousSplitInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ObliviousSplitInfo(ObliviousSplitInfo&& from) noexcept + : ObliviousSplitInfo() { + *this = ::std::move(from); + } + + inline ObliviousSplitInfo& operator=(ObliviousSplitInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ObliviousSplitInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ObliviousSplitInfo* internal_default_instance() { + return reinterpret_cast( + &_ObliviousSplitInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(ObliviousSplitInfo* other); + void Swap(ObliviousSplitInfo* other); + friend void swap(ObliviousSplitInfo& a, ObliviousSplitInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ObliviousSplitInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + ObliviousSplitInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ObliviousSplitInfo& from); + void MergeFrom(const ObliviousSplitInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ObliviousSplitInfo* other); + protected: + explicit ObliviousSplitInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf children = 2; + int children_size() const; + void clear_children(); + static const int kChildrenFieldNumber = 2; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* mutable_children(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >* + mutable_children(); + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& children(int index) const; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* add_children(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >& + children() const; + + // repeated int32 children_parent_id = 3; + int children_parent_id_size() const; + void clear_children_parent_id(); + static const int kChildrenParentIdFieldNumber = 3; + ::google::protobuf::int32 children_parent_id(int index) const; + void set_children_parent_id(int index, ::google::protobuf::int32 value); + void add_children_parent_id(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + children_parent_id() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_children_parent_id(); + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; + bool has_split_node() const; + void clear_split_node(); + static const int kSplitNodeFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& _internal_split_node() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& split_node() const; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* release_split_node(); + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* mutable_split_node(); + void set_allocated_split_node(::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node); + void unsafe_arena_set_allocated_split_node( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node); + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* unsafe_arena_release_split_node(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf > children_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > children_parent_id_; + mutable int _children_parent_id_cached_byte_size_; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// SplitInfo + +// .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; +inline bool SplitInfo::has_split_node() const { + return this != internal_default_instance() && split_node_ != NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& SplitInfo::_internal_split_node() const { + return *split_node_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& SplitInfo::split_node() const { + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* p = split_node_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.split_node) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* SplitInfo::release_split_node() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.split_node) + + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* temp = split_node_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + split_node_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* SplitInfo::unsafe_arena_release_split_node() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.split_node) + + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* temp = split_node_; + split_node_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* SplitInfo::mutable_split_node() { + + if (split_node_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::TreeNode>(GetArenaNoVirtual()); + split_node_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.split_node) + return split_node_; +} +inline void SplitInfo::set_allocated_split_node(::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(split_node_); + } + if (split_node) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(split_node)->GetArena(); + if (message_arena != submessage_arena) { + split_node = ::google::protobuf::internal::GetOwnedMessage( + message_arena, split_node, submessage_arena); + } + + } else { + + } + split_node_ = split_node; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.split_node) +} + +// .diplomacy.tensorflow.boosted_trees.trees.Leaf left_child = 2; +inline bool SplitInfo::has_left_child() const { + return this != internal_default_instance() && left_child_ != NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& SplitInfo::_internal_left_child() const { + return *left_child_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& SplitInfo::left_child() const { + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf* p = left_child_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.left_child) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* SplitInfo::release_left_child() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.left_child) + + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = left_child_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + left_child_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* SplitInfo::unsafe_arena_release_left_child() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.left_child) + + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = left_child_; + left_child_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* SplitInfo::mutable_left_child() { + + if (left_child_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::Leaf>(GetArenaNoVirtual()); + left_child_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.left_child) + return left_child_; +} +inline void SplitInfo::set_allocated_left_child(::diplomacy::tensorflow::boosted_trees::trees::Leaf* left_child) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(left_child_); + } + if (left_child) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(left_child)->GetArena(); + if (message_arena != submessage_arena) { + left_child = ::google::protobuf::internal::GetOwnedMessage( + message_arena, left_child, submessage_arena); + } + + } else { + + } + left_child_ = left_child; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.left_child) +} + +// .diplomacy.tensorflow.boosted_trees.trees.Leaf right_child = 3; +inline bool SplitInfo::has_right_child() const { + return this != internal_default_instance() && right_child_ != NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& SplitInfo::_internal_right_child() const { + return *right_child_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& SplitInfo::right_child() const { + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf* p = right_child_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.right_child) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* SplitInfo::release_right_child() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.right_child) + + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = right_child_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + right_child_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* SplitInfo::unsafe_arena_release_right_child() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.right_child) + + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = right_child_; + right_child_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* SplitInfo::mutable_right_child() { + + if (right_child_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::Leaf>(GetArenaNoVirtual()); + right_child_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.right_child) + return right_child_; +} +inline void SplitInfo::set_allocated_right_child(::diplomacy::tensorflow::boosted_trees::trees::Leaf* right_child) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(right_child_); + } + if (right_child) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(right_child)->GetArena(); + if (message_arena != submessage_arena) { + right_child = ::google::protobuf::internal::GetOwnedMessage( + message_arena, right_child, submessage_arena); + } + + } else { + + } + right_child_ = right_child; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.SplitInfo.right_child) +} + +// ------------------------------------------------------------------- + +// ObliviousSplitInfo + +// .diplomacy.tensorflow.boosted_trees.trees.TreeNode split_node = 1; +inline bool ObliviousSplitInfo::has_split_node() const { + return this != internal_default_instance() && split_node_ != NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& ObliviousSplitInfo::_internal_split_node() const { + return *split_node_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& ObliviousSplitInfo::split_node() const { + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* p = split_node_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.split_node) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* ObliviousSplitInfo::release_split_node() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.split_node) + + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* temp = split_node_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + split_node_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* ObliviousSplitInfo::unsafe_arena_release_split_node() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.split_node) + + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* temp = split_node_; + split_node_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* ObliviousSplitInfo::mutable_split_node() { + + if (split_node_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::TreeNode>(GetArenaNoVirtual()); + split_node_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.split_node) + return split_node_; +} +inline void ObliviousSplitInfo::set_allocated_split_node(::diplomacy::tensorflow::boosted_trees::trees::TreeNode* split_node) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(split_node_); + } + if (split_node) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(split_node)->GetArena(); + if (message_arena != submessage_arena) { + split_node = ::google::protobuf::internal::GetOwnedMessage( + message_arena, split_node, submessage_arena); + } + + } else { + + } + split_node_ = split_node; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.split_node) +} + +// repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf children = 2; +inline int ObliviousSplitInfo::children_size() const { + return children_.size(); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* ObliviousSplitInfo::mutable_children(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children) + return children_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >* +ObliviousSplitInfo::mutable_children() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children) + return &children_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& ObliviousSplitInfo::children(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children) + return children_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* ObliviousSplitInfo::add_children() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children) + return children_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >& +ObliviousSplitInfo::children() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children) + return children_; +} + +// repeated int32 children_parent_id = 3; +inline int ObliviousSplitInfo::children_parent_id_size() const { + return children_parent_id_.size(); +} +inline void ObliviousSplitInfo::clear_children_parent_id() { + children_parent_id_.Clear(); +} +inline ::google::protobuf::int32 ObliviousSplitInfo::children_parent_id(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children_parent_id) + return children_parent_id_.Get(index); +} +inline void ObliviousSplitInfo::set_children_parent_id(int index, ::google::protobuf::int32 value) { + children_parent_id_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children_parent_id) +} +inline void ObliviousSplitInfo::add_children_parent_id(::google::protobuf::int32 value) { + children_parent_id_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children_parent_id) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +ObliviousSplitInfo::children_parent_id() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children_parent_id) + return children_parent_id_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +ObliviousSplitInfo::mutable_children_parent_id() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children_parent_id) + return &children_parent_id_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace learner +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2fsplit_5finfo_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto new file mode 100644 index 0000000..53c5df5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +option cc_enable_arenas = true; + +package diplomacy.tensorflow.boosted_trees.learner; + +import "diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto"; + +// Gathered information for a split node. +message SplitInfo { + // The split node without the child nodes attached. + tensorflow.boosted_trees.trees.TreeNode split_node = 1; + + // Left Leaf node. + tensorflow.boosted_trees.trees.Leaf left_child = 2; + + // Right Leaf node. + tensorflow.boosted_trees.trees.Leaf right_child = 3; +} + +message ObliviousSplitInfo { + tensorflow.boosted_trees.trees.TreeNode split_node = 1; + repeated tensorflow.boosted_trees.trees.Leaf children = 2; + // For each child, children_parent_id stores the node_id of its parent when it + // was a leaf. For the idx-th child it corresponds the idx/2-th + // children_parent_id. + repeated int32 children_parent_id = 3; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info_pb2.py new file mode 100644 index 0000000..92b01ca --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/split_info_pb2.py @@ -0,0 +1,144 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.contrib.boosted_trees.proto import tree_config_pb2 as diplomacy__tensorflow_dot_contrib_dot_boosted__trees_dot_proto_dot_tree__config__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto', + package='diplomacy.tensorflow.boosted_trees.learner', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\nAdiplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto\x12*diplomacy.tensorflow.boosted_trees.learner\x1a\x42\x64iplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto\"\xdc\x01\n\tSplitInfo\x12\x46\n\nsplit_node\x18\x01 \x01(\x0b\x32\x32.diplomacy.tensorflow.boosted_trees.trees.TreeNode\x12\x42\n\nleft_child\x18\x02 \x01(\x0b\x32..diplomacy.tensorflow.boosted_trees.trees.Leaf\x12\x43\n\x0bright_child\x18\x03 \x01(\x0b\x32..diplomacy.tensorflow.boosted_trees.trees.Leaf\"\xba\x01\n\x12ObliviousSplitInfo\x12\x46\n\nsplit_node\x18\x01 \x01(\x0b\x32\x32.diplomacy.tensorflow.boosted_trees.trees.TreeNode\x12@\n\x08\x63hildren\x18\x02 \x03(\x0b\x32..diplomacy.tensorflow.boosted_trees.trees.Leaf\x12\x1a\n\x12\x63hildren_parent_id\x18\x03 \x03(\x05\x42\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_contrib_dot_boosted__trees_dot_proto_dot_tree__config__pb2.DESCRIPTOR,]) + + + + +_SPLITINFO = _descriptor.Descriptor( + name='SplitInfo', + full_name='diplomacy.tensorflow.boosted_trees.learner.SplitInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='split_node', full_name='diplomacy.tensorflow.boosted_trees.learner.SplitInfo.split_node', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_child', full_name='diplomacy.tensorflow.boosted_trees.learner.SplitInfo.left_child', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_child', full_name='diplomacy.tensorflow.boosted_trees.learner.SplitInfo.right_child', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=182, + serialized_end=402, +) + + +_OBLIVIOUSSPLITINFO = _descriptor.Descriptor( + name='ObliviousSplitInfo', + full_name='diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='split_node', full_name='diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.split_node', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='children', full_name='diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='children_parent_id', full_name='diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo.children_parent_id', index=2, + number=3, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=405, + serialized_end=591, +) + +_SPLITINFO.fields_by_name['split_node'].message_type = diplomacy__tensorflow_dot_contrib_dot_boosted__trees_dot_proto_dot_tree__config__pb2._TREENODE +_SPLITINFO.fields_by_name['left_child'].message_type = diplomacy__tensorflow_dot_contrib_dot_boosted__trees_dot_proto_dot_tree__config__pb2._LEAF +_SPLITINFO.fields_by_name['right_child'].message_type = diplomacy__tensorflow_dot_contrib_dot_boosted__trees_dot_proto_dot_tree__config__pb2._LEAF +_OBLIVIOUSSPLITINFO.fields_by_name['split_node'].message_type = diplomacy__tensorflow_dot_contrib_dot_boosted__trees_dot_proto_dot_tree__config__pb2._TREENODE +_OBLIVIOUSSPLITINFO.fields_by_name['children'].message_type = diplomacy__tensorflow_dot_contrib_dot_boosted__trees_dot_proto_dot_tree__config__pb2._LEAF +DESCRIPTOR.message_types_by_name['SplitInfo'] = _SPLITINFO +DESCRIPTOR.message_types_by_name['ObliviousSplitInfo'] = _OBLIVIOUSSPLITINFO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +SplitInfo = _reflection.GeneratedProtocolMessageType('SplitInfo', (_message.Message,), dict( + DESCRIPTOR = _SPLITINFO, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.split_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.SplitInfo) + )) +_sym_db.RegisterMessage(SplitInfo) + +ObliviousSplitInfo = _reflection.GeneratedProtocolMessageType('ObliviousSplitInfo', (_message.Message,), dict( + DESCRIPTOR = _OBLIVIOUSSPLITINFO, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.split_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.learner.ObliviousSplitInfo) + )) +_sym_db.RegisterMessage(ObliviousSplitInfo) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.cc new file mode 100644 index 0000000..0134b9d --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.cc @@ -0,0 +1,6611 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto + +#include "diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_CategoricalIdBinarySplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_CategoricalIdSetMembershipBinarySplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DecisionTreeMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DenseFloatBinarySplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GrowingMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ObliviousCategoricalIdBinarySplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ObliviousDenseFloatBinarySplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SparseVector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Vector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DecisionTreeConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SparseFloatBinarySplitDefaultLeft; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SparseFloatBinarySplitDefaultRight; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TreeNodeMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Leaf; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<9> scc_info_TreeNode; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace trees { +class TreeNodeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf* leaf_; + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* dense_float_binary_split_; + const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* sparse_float_binary_split_default_left_; + const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* sparse_float_binary_split_default_right_; + const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* categorical_id_binary_split_; + const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* categorical_id_set_membership_binary_split_; + const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* oblivious_dense_float_binary_split_; + const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* oblivious_categorical_id_binary_split_; +} _TreeNode_default_instance_; +class TreeNodeMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TreeNodeMetadata_default_instance_; +class LeafDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::boosted_trees::trees::Vector* vector_; + const ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* sparse_vector_; +} _Leaf_default_instance_; +class VectorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Vector_default_instance_; +class SparseVectorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SparseVector_default_instance_; +class DenseFloatBinarySplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DenseFloatBinarySplit_default_instance_; +class SparseFloatBinarySplitDefaultLeftDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SparseFloatBinarySplitDefaultLeft_default_instance_; +class SparseFloatBinarySplitDefaultRightDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SparseFloatBinarySplitDefaultRight_default_instance_; +class CategoricalIdBinarySplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CategoricalIdBinarySplit_default_instance_; +class CategoricalIdSetMembershipBinarySplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CategoricalIdSetMembershipBinarySplit_default_instance_; +class ObliviousDenseFloatBinarySplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ObliviousDenseFloatBinarySplit_default_instance_; +class ObliviousCategoricalIdBinarySplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ObliviousCategoricalIdBinarySplit_default_instance_; +class DecisionTreeConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DecisionTreeConfig_default_instance_; +class DecisionTreeMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DecisionTreeMetadata_default_instance_; +class GrowingMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GrowingMetadata_default_instance_; +class DecisionTreeEnsembleConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DecisionTreeEnsembleConfig_default_instance_; +} // namespace trees +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto { +static void InitDefaultsTreeNode() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::TreeNode(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<9> scc_info_TreeNode = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 9, InitDefaultsTreeNode}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Leaf.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DenseFloatBinarySplit.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultLeft.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultRight.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdBinarySplit.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdSetMembershipBinarySplit.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousDenseFloatBinarySplit.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousCategoricalIdBinarySplit.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNodeMetadata.base,}}; + +static void InitDefaultsTreeNodeMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_TreeNodeMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TreeNodeMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTreeNodeMetadata}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Leaf.base,}}; + +static void InitDefaultsLeaf() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::Leaf(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::Leaf::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_Leaf = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsLeaf}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Vector.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseVector.base,}}; + +static void InitDefaultsVector() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_Vector_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::Vector(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::Vector::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Vector = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsVector}, {}}; + +static void InitDefaultsSparseVector() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_SparseVector_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::SparseVector(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SparseVector = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSparseVector}, {}}; + +static void InitDefaultsDenseFloatBinarySplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_DenseFloatBinarySplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DenseFloatBinarySplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDenseFloatBinarySplit}, {}}; + +static void InitDefaultsSparseFloatBinarySplitDefaultLeft() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultLeft_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SparseFloatBinarySplitDefaultLeft = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSparseFloatBinarySplitDefaultLeft}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DenseFloatBinarySplit.base,}}; + +static void InitDefaultsSparseFloatBinarySplitDefaultRight() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultRight_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SparseFloatBinarySplitDefaultRight = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSparseFloatBinarySplitDefaultRight}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DenseFloatBinarySplit.base,}}; + +static void InitDefaultsCategoricalIdBinarySplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_CategoricalIdBinarySplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CategoricalIdBinarySplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCategoricalIdBinarySplit}, {}}; + +static void InitDefaultsCategoricalIdSetMembershipBinarySplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_CategoricalIdSetMembershipBinarySplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CategoricalIdSetMembershipBinarySplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCategoricalIdSetMembershipBinarySplit}, {}}; + +static void InitDefaultsObliviousDenseFloatBinarySplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_ObliviousDenseFloatBinarySplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ObliviousDenseFloatBinarySplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsObliviousDenseFloatBinarySplit}, {}}; + +static void InitDefaultsObliviousCategoricalIdBinarySplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_ObliviousCategoricalIdBinarySplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ObliviousCategoricalIdBinarySplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsObliviousCategoricalIdBinarySplit}, {}}; + +static void InitDefaultsDecisionTreeConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_DecisionTreeConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DecisionTreeConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDecisionTreeConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNode.base,}}; + +static void InitDefaultsDecisionTreeMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_DecisionTreeMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DecisionTreeMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDecisionTreeMetadata}, {}}; + +static void InitDefaultsGrowingMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_GrowingMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GrowingMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGrowingMetadata}, {}}; + +static void InitDefaultsDecisionTreeEnsembleConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::trees::_DecisionTreeEnsembleConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_DecisionTreeEnsembleConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsDecisionTreeEnsembleConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeMetadata.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_GrowingMetadata.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TreeNode.base); + ::google::protobuf::internal::InitSCC(&scc_info_TreeNodeMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_Leaf.base); + ::google::protobuf::internal::InitSCC(&scc_info_Vector.base); + ::google::protobuf::internal::InitSCC(&scc_info_SparseVector.base); + ::google::protobuf::internal::InitSCC(&scc_info_DenseFloatBinarySplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_SparseFloatBinarySplitDefaultLeft.base); + ::google::protobuf::internal::InitSCC(&scc_info_SparseFloatBinarySplitDefaultRight.base); + ::google::protobuf::internal::InitSCC(&scc_info_CategoricalIdBinarySplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_CategoricalIdSetMembershipBinarySplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_ObliviousDenseFloatBinarySplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_ObliviousCategoricalIdBinarySplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_DecisionTreeConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_DecisionTreeMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_GrowingMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_DecisionTreeEnsembleConfig.base); +} + +::google::protobuf::Metadata file_level_metadata[16]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNode, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNode, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, leaf_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, dense_float_binary_split_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, sparse_float_binary_split_default_left_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, sparse_float_binary_split_default_right_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, categorical_id_binary_split_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, categorical_id_set_membership_binary_split_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, oblivious_dense_float_binary_split_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeDefaultTypeInternal, oblivious_categorical_id_binary_split_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNode, node_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNode, node_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata, gain_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata, original_leaf_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata, original_oblivious_leaves_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::Leaf, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::Leaf, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::boosted_trees::trees::LeafDefaultTypeInternal, vector_), + offsetof(::diplomacy::tensorflow::boosted_trees::trees::LeafDefaultTypeInternal, sparse_vector_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::Leaf, leaf_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::Vector, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::Vector, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::SparseVector, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::SparseVector, index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::SparseVector, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit, feature_column_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit, dimension_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit, threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit, left_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit, right_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft, split_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight, split_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit, feature_column_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit, feature_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit, left_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit, right_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit, feature_column_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit, feature_ids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit, left_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit, right_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit, feature_column_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit, threshold_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit, feature_column_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit, feature_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig, nodes_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata, num_tree_weight_updates_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata, num_layers_grown_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata, is_finalized_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata, num_trees_attempted_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata, num_layers_attempted_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata, used_handler_ids_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig, trees_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig, tree_weights_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig, tree_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig, growing_metadata_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::TreeNode)}, + { 15, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata)}, + { 23, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::Leaf)}, + { 31, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::Vector)}, + { 37, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::SparseVector)}, + { 44, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit)}, + { 54, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft)}, + { 60, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight)}, + { 66, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit)}, + { 75, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit)}, + { 84, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit)}, + { 91, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit)}, + { 98, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig)}, + { 104, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata)}, + { 112, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata)}, + { 120, -1, sizeof(::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_TreeNodeMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_Vector_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_SparseVector_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_DenseFloatBinarySplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultLeft_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultRight_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_CategoricalIdBinarySplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_CategoricalIdSetMembershipBinarySplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_ObliviousDenseFloatBinarySplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_ObliviousCategoricalIdBinarySplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_DecisionTreeConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_DecisionTreeMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_GrowingMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::trees::_DecisionTreeEnsembleConfig_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 16); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nBdiplomacy_tensorflow/contrib/boosted_t" + "rees/proto/tree_config.proto\022(diplomacy." + "tensorflow.boosted_trees.trees\"\364\007\n\010TreeN" + "ode\022>\n\004leaf\030\001 \001(\0132..diplomacy.tensorflow" + ".boosted_trees.trees.LeafH\000\022c\n\030dense_flo" + "at_binary_split\030\002 \001(\0132\?.diplomacy.tensor" + "flow.boosted_trees.trees.DenseFloatBinar" + "ySplitH\000\022}\n&sparse_float_binary_split_de" + "fault_left\030\003 \001(\0132K.diplomacy.tensorflow." + "boosted_trees.trees.SparseFloatBinarySpl" + "itDefaultLeftH\000\022\177\n\'sparse_float_binary_s" + "plit_default_right\030\004 \001(\0132L.diplomacy.ten" + "sorflow.boosted_trees.trees.SparseFloatB" + "inarySplitDefaultRightH\000\022i\n\033categorical_" + "id_binary_split\030\005 \001(\0132B.diplomacy.tensor" + "flow.boosted_trees.trees.CategoricalIdBi" + "narySplitH\000\022\205\001\n*categorical_id_set_membe" + "rship_binary_split\030\006 \001(\0132O.diplomacy.ten" + "sorflow.boosted_trees.trees.CategoricalI" + "dSetMembershipBinarySplitH\000\022v\n\"oblivious" + "_dense_float_binary_split\030\007 \001(\0132H.diplom" + "acy.tensorflow.boosted_trees.trees.Obliv" + "iousDenseFloatBinarySplitH\000\022|\n%oblivious" + "_categorical_id_binary_split\030\010 \001(\0132K.dip" + "lomacy.tensorflow.boosted_trees.trees.Ob" + "liviousCategoricalIdBinarySplitH\000\022R\n\rnod" + "e_metadata\030\211\006 \001(\0132:.diplomacy.tensorflow" + ".boosted_trees.trees.TreeNodeMetadataB\006\n" + "\004node\"\272\001\n\020TreeNodeMetadata\022\014\n\004gain\030\001 \001(\002" + "\022E\n\roriginal_leaf\030\002 \001(\0132..diplomacy.tens" + "orflow.boosted_trees.trees.Leaf\022Q\n\031origi" + "nal_oblivious_leaves\030\003 \003(\0132..diplomacy.t" + "ensorflow.boosted_trees.trees.Leaf\"\243\001\n\004L" + "eaf\022B\n\006vector\030\001 \001(\01320.diplomacy.tensorfl" + "ow.boosted_trees.trees.VectorH\000\022O\n\rspars" + "e_vector\030\002 \001(\01326.diplomacy.tensorflow.bo" + "osted_trees.trees.SparseVectorH\000B\006\n\004leaf" + "\"\027\n\006Vector\022\r\n\005value\030\001 \003(\002\",\n\014SparseVecto" + "r\022\r\n\005index\030\001 \003(\005\022\r\n\005value\030\002 \003(\002\"{\n\025Dense" + "FloatBinarySplit\022\026\n\016feature_column\030\001 \001(\005" + "\022\024\n\014dimension_id\030\005 \001(\005\022\021\n\tthreshold\030\002 \001(" + "\002\022\017\n\007left_id\030\003 \001(\005\022\020\n\010right_id\030\004 \001(\005\"s\n!" + "SparseFloatBinarySplitDefaultLeft\022N\n\005spl" + "it\030\001 \001(\0132\?.diplomacy.tensorflow.boosted_" + "trees.trees.DenseFloatBinarySplit\"t\n\"Spa" + "rseFloatBinarySplitDefaultRight\022N\n\005split" + "\030\001 \001(\0132\?.diplomacy.tensorflow.boosted_tr" + "ees.trees.DenseFloatBinarySplit\"i\n\030Categ" + "oricalIdBinarySplit\022\026\n\016feature_column\030\001 " + "\001(\005\022\022\n\nfeature_id\030\002 \001(\003\022\017\n\007left_id\030\003 \001(\005" + "\022\020\n\010right_id\030\004 \001(\005\"w\n%CategoricalIdSetMe" + "mbershipBinarySplit\022\026\n\016feature_column\030\001 " + "\001(\005\022\023\n\013feature_ids\030\002 \003(\003\022\017\n\007left_id\030\003 \001(" + "\005\022\020\n\010right_id\030\004 \001(\005\"K\n\036ObliviousDenseFlo" + "atBinarySplit\022\026\n\016feature_column\030\001 \001(\005\022\021\n" + "\tthreshold\030\002 \001(\002\"O\n!ObliviousCategorical" + "IdBinarySplit\022\026\n\016feature_column\030\001 \001(\005\022\022\n" + "\nfeature_id\030\002 \001(\003\"W\n\022DecisionTreeConfig\022" + "A\n\005nodes\030\001 \003(\01322.diplomacy.tensorflow.bo" + "osted_trees.trees.TreeNode\"g\n\024DecisionTr" + "eeMetadata\022\037\n\027num_tree_weight_updates\030\001 " + "\001(\005\022\030\n\020num_layers_grown\030\002 \001(\005\022\024\n\014is_fina" + "lized\030\003 \001(\010\"f\n\017GrowingMetadata\022\033\n\023num_tr" + "ees_attempted\030\001 \001(\003\022\034\n\024num_layers_attemp" + "ted\030\002 \001(\003\022\030\n\020used_handler_ids\030\003 \003(\003\"\253\002\n\032" + "DecisionTreeEnsembleConfig\022K\n\005trees\030\001 \003(" + "\0132<.diplomacy.tensorflow.boosted_trees.t" + "rees.DecisionTreeConfig\022\024\n\014tree_weights\030" + "\002 \003(\002\022U\n\rtree_metadata\030\003 \003(\0132>.diplomacy" + ".tensorflow.boosted_trees.trees.Decision" + "TreeMetadata\022S\n\020growing_metadata\030\004 \001(\01329" + ".diplomacy.tensorflow.boosted_trees.tree" + "s.GrowingMetadataB\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 2910); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace trees { + +// =================================================================== + +void TreeNode::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.leaf_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::Leaf*>( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.dense_float_binary_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit*>( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.sparse_float_binary_split_default_left_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft*>( + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.sparse_float_binary_split_default_right_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight*>( + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.categorical_id_binary_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit*>( + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.categorical_id_set_membership_binary_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit*>( + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.oblivious_dense_float_binary_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit*>( + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_.oblivious_categorical_id_binary_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit*>( + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNode_default_instance_._instance.get_mutable()->node_metadata_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata*>( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata::internal_default_instance()); +} +void TreeNode::set_allocated_leaf(::diplomacy::tensorflow::boosted_trees::trees::Leaf* leaf) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (leaf) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(leaf); + if (message_arena != submessage_arena) { + leaf = ::google::protobuf::internal::GetOwnedMessage( + message_arena, leaf, submessage_arena); + } + set_has_leaf(); + node_.leaf_ = leaf; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.leaf) +} +void TreeNode::set_allocated_dense_float_binary_split(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* dense_float_binary_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (dense_float_binary_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(dense_float_binary_split); + if (message_arena != submessage_arena) { + dense_float_binary_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dense_float_binary_split, submessage_arena); + } + set_has_dense_float_binary_split(); + node_.dense_float_binary_split_ = dense_float_binary_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.dense_float_binary_split) +} +void TreeNode::set_allocated_sparse_float_binary_split_default_left(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* sparse_float_binary_split_default_left) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (sparse_float_binary_split_default_left) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(sparse_float_binary_split_default_left); + if (message_arena != submessage_arena) { + sparse_float_binary_split_default_left = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sparse_float_binary_split_default_left, submessage_arena); + } + set_has_sparse_float_binary_split_default_left(); + node_.sparse_float_binary_split_default_left_ = sparse_float_binary_split_default_left; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_left) +} +void TreeNode::set_allocated_sparse_float_binary_split_default_right(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* sparse_float_binary_split_default_right) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (sparse_float_binary_split_default_right) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(sparse_float_binary_split_default_right); + if (message_arena != submessage_arena) { + sparse_float_binary_split_default_right = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sparse_float_binary_split_default_right, submessage_arena); + } + set_has_sparse_float_binary_split_default_right(); + node_.sparse_float_binary_split_default_right_ = sparse_float_binary_split_default_right; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_right) +} +void TreeNode::set_allocated_categorical_id_binary_split(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* categorical_id_binary_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (categorical_id_binary_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(categorical_id_binary_split); + if (message_arena != submessage_arena) { + categorical_id_binary_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, categorical_id_binary_split, submessage_arena); + } + set_has_categorical_id_binary_split(); + node_.categorical_id_binary_split_ = categorical_id_binary_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_binary_split) +} +void TreeNode::set_allocated_categorical_id_set_membership_binary_split(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* categorical_id_set_membership_binary_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (categorical_id_set_membership_binary_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(categorical_id_set_membership_binary_split); + if (message_arena != submessage_arena) { + categorical_id_set_membership_binary_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, categorical_id_set_membership_binary_split, submessage_arena); + } + set_has_categorical_id_set_membership_binary_split(); + node_.categorical_id_set_membership_binary_split_ = categorical_id_set_membership_binary_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_set_membership_binary_split) +} +void TreeNode::set_allocated_oblivious_dense_float_binary_split(::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* oblivious_dense_float_binary_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (oblivious_dense_float_binary_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(oblivious_dense_float_binary_split); + if (message_arena != submessage_arena) { + oblivious_dense_float_binary_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, oblivious_dense_float_binary_split, submessage_arena); + } + set_has_oblivious_dense_float_binary_split(); + node_.oblivious_dense_float_binary_split_ = oblivious_dense_float_binary_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_dense_float_binary_split) +} +void TreeNode::set_allocated_oblivious_categorical_id_binary_split(::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* oblivious_categorical_id_binary_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (oblivious_categorical_id_binary_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(oblivious_categorical_id_binary_split); + if (message_arena != submessage_arena) { + oblivious_categorical_id_binary_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, oblivious_categorical_id_binary_split, submessage_arena); + } + set_has_oblivious_categorical_id_binary_split(); + node_.oblivious_categorical_id_binary_split_ = oblivious_categorical_id_binary_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_categorical_id_binary_split) +} +void TreeNode::unsafe_arena_set_allocated_node_metadata( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* node_metadata) { + if (GetArenaNoVirtual() == NULL) { + delete node_metadata_; + } + node_metadata_ = node_metadata; + if (node_metadata) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.node_metadata) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeNode::kLeafFieldNumber; +const int TreeNode::kDenseFloatBinarySplitFieldNumber; +const int TreeNode::kSparseFloatBinarySplitDefaultLeftFieldNumber; +const int TreeNode::kSparseFloatBinarySplitDefaultRightFieldNumber; +const int TreeNode::kCategoricalIdBinarySplitFieldNumber; +const int TreeNode::kCategoricalIdSetMembershipBinarySplitFieldNumber; +const int TreeNode::kObliviousDenseFloatBinarySplitFieldNumber; +const int TreeNode::kObliviousCategoricalIdBinarySplitFieldNumber; +const int TreeNode::kNodeMetadataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeNode::TreeNode() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNode.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.TreeNode) +} +TreeNode::TreeNode(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNode.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.TreeNode) +} +TreeNode::TreeNode(const TreeNode& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_node_metadata()) { + node_metadata_ = new ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata(*from.node_metadata_); + } else { + node_metadata_ = NULL; + } + clear_has_node(); + switch (from.node_case()) { + case kLeaf: { + mutable_leaf()->::diplomacy::tensorflow::boosted_trees::trees::Leaf::MergeFrom(from.leaf()); + break; + } + case kDenseFloatBinarySplit: { + mutable_dense_float_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::MergeFrom(from.dense_float_binary_split()); + break; + } + case kSparseFloatBinarySplitDefaultLeft: { + mutable_sparse_float_binary_split_default_left()->::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft::MergeFrom(from.sparse_float_binary_split_default_left()); + break; + } + case kSparseFloatBinarySplitDefaultRight: { + mutable_sparse_float_binary_split_default_right()->::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight::MergeFrom(from.sparse_float_binary_split_default_right()); + break; + } + case kCategoricalIdBinarySplit: { + mutable_categorical_id_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit::MergeFrom(from.categorical_id_binary_split()); + break; + } + case kCategoricalIdSetMembershipBinarySplit: { + mutable_categorical_id_set_membership_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit::MergeFrom(from.categorical_id_set_membership_binary_split()); + break; + } + case kObliviousDenseFloatBinarySplit: { + mutable_oblivious_dense_float_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit::MergeFrom(from.oblivious_dense_float_binary_split()); + break; + } + case kObliviousCategoricalIdBinarySplit: { + mutable_oblivious_categorical_id_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit::MergeFrom(from.oblivious_categorical_id_binary_split()); + break; + } + case NODE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.TreeNode) +} + +void TreeNode::SharedCtor() { + node_metadata_ = NULL; + clear_has_node(); +} + +TreeNode::~TreeNode() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + SharedDtor(); +} + +void TreeNode::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete node_metadata_; + if (has_node()) { + clear_node(); + } +} + +void TreeNode::ArenaDtor(void* object) { + TreeNode* _this = reinterpret_cast< TreeNode* >(object); + (void)_this; +} +void TreeNode::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeNode::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeNode::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeNode& TreeNode::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNode.base); + return *internal_default_instance(); +} + + +void TreeNode::clear_node() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + switch (node_case()) { + case kLeaf: { + if (GetArenaNoVirtual() == NULL) { + delete node_.leaf_; + } + break; + } + case kDenseFloatBinarySplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.dense_float_binary_split_; + } + break; + } + case kSparseFloatBinarySplitDefaultLeft: { + if (GetArenaNoVirtual() == NULL) { + delete node_.sparse_float_binary_split_default_left_; + } + break; + } + case kSparseFloatBinarySplitDefaultRight: { + if (GetArenaNoVirtual() == NULL) { + delete node_.sparse_float_binary_split_default_right_; + } + break; + } + case kCategoricalIdBinarySplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.categorical_id_binary_split_; + } + break; + } + case kCategoricalIdSetMembershipBinarySplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.categorical_id_set_membership_binary_split_; + } + break; + } + case kObliviousDenseFloatBinarySplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.oblivious_dense_float_binary_split_; + } + break; + } + case kObliviousCategoricalIdBinarySplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.oblivious_categorical_id_binary_split_; + } + break; + } + case NODE_NOT_SET: { + break; + } + } + _oneof_case_[0] = NODE_NOT_SET; +} + + +void TreeNode::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && node_metadata_ != NULL) { + delete node_metadata_; + } + node_metadata_ = NULL; + clear_node(); + _internal_metadata_.Clear(); +} + +bool TreeNode::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.trees.Leaf leaf = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_leaf())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit dense_float_binary_split = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dense_float_binary_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft sparse_float_binary_split_default_left = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sparse_float_binary_split_default_left())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight sparse_float_binary_split_default_right = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sparse_float_binary_split_default_right())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit categorical_id_binary_split = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_categorical_id_binary_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit categorical_id_set_membership_binary_split = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_categorical_id_set_membership_binary_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit oblivious_dense_float_binary_split = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_oblivious_dense_float_binary_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit oblivious_categorical_id_binary_split = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_oblivious_categorical_id_binary_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata node_metadata = 777; + case 777: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 6218 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_node_metadata())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + return false; +#undef DO_ +} + +void TreeNode::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf leaf = 1; + if (has_leaf()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_leaf(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit dense_float_binary_split = 2; + if (has_dense_float_binary_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_dense_float_binary_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft sparse_float_binary_split_default_left = 3; + if (has_sparse_float_binary_split_default_left()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_sparse_float_binary_split_default_left(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight sparse_float_binary_split_default_right = 4; + if (has_sparse_float_binary_split_default_right()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_sparse_float_binary_split_default_right(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit categorical_id_binary_split = 5; + if (has_categorical_id_binary_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_categorical_id_binary_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit categorical_id_set_membership_binary_split = 6; + if (has_categorical_id_set_membership_binary_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_categorical_id_set_membership_binary_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit oblivious_dense_float_binary_split = 7; + if (has_oblivious_dense_float_binary_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->_internal_oblivious_dense_float_binary_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit oblivious_categorical_id_binary_split = 8; + if (has_oblivious_categorical_id_binary_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_oblivious_categorical_id_binary_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata node_metadata = 777; + if (this->has_node_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 777, this->_internal_node_metadata(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.TreeNode) +} + +::google::protobuf::uint8* TreeNode::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf leaf = 1; + if (has_leaf()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_leaf(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit dense_float_binary_split = 2; + if (has_dense_float_binary_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_dense_float_binary_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft sparse_float_binary_split_default_left = 3; + if (has_sparse_float_binary_split_default_left()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_sparse_float_binary_split_default_left(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight sparse_float_binary_split_default_right = 4; + if (has_sparse_float_binary_split_default_right()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_sparse_float_binary_split_default_right(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit categorical_id_binary_split = 5; + if (has_categorical_id_binary_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_categorical_id_binary_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit categorical_id_set_membership_binary_split = 6; + if (has_categorical_id_set_membership_binary_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_categorical_id_set_membership_binary_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit oblivious_dense_float_binary_split = 7; + if (has_oblivious_dense_float_binary_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->_internal_oblivious_dense_float_binary_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit oblivious_categorical_id_binary_split = 8; + if (has_oblivious_categorical_id_binary_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_oblivious_categorical_id_binary_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata node_metadata = 777; + if (this->has_node_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 777, this->_internal_node_metadata(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + return target; +} + +size_t TreeNode::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata node_metadata = 777; + if (this->has_node_metadata()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_metadata_); + } + + switch (node_case()) { + // .diplomacy.tensorflow.boosted_trees.trees.Leaf leaf = 1; + case kLeaf: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.leaf_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit dense_float_binary_split = 2; + case kDenseFloatBinarySplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.dense_float_binary_split_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft sparse_float_binary_split_default_left = 3; + case kSparseFloatBinarySplitDefaultLeft: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.sparse_float_binary_split_default_left_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight sparse_float_binary_split_default_right = 4; + case kSparseFloatBinarySplitDefaultRight: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.sparse_float_binary_split_default_right_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit categorical_id_binary_split = 5; + case kCategoricalIdBinarySplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.categorical_id_binary_split_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit categorical_id_set_membership_binary_split = 6; + case kCategoricalIdSetMembershipBinarySplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.categorical_id_set_membership_binary_split_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit oblivious_dense_float_binary_split = 7; + case kObliviousDenseFloatBinarySplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.oblivious_dense_float_binary_split_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit oblivious_categorical_id_binary_split = 8; + case kObliviousCategoricalIdBinarySplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.oblivious_categorical_id_binary_split_); + break; + } + case NODE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeNode::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + GOOGLE_DCHECK_NE(&from, this); + const TreeNode* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + MergeFrom(*source); + } +} + +void TreeNode::MergeFrom(const TreeNode& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_node_metadata()) { + mutable_node_metadata()->::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata::MergeFrom(from.node_metadata()); + } + switch (from.node_case()) { + case kLeaf: { + mutable_leaf()->::diplomacy::tensorflow::boosted_trees::trees::Leaf::MergeFrom(from.leaf()); + break; + } + case kDenseFloatBinarySplit: { + mutable_dense_float_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::MergeFrom(from.dense_float_binary_split()); + break; + } + case kSparseFloatBinarySplitDefaultLeft: { + mutable_sparse_float_binary_split_default_left()->::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft::MergeFrom(from.sparse_float_binary_split_default_left()); + break; + } + case kSparseFloatBinarySplitDefaultRight: { + mutable_sparse_float_binary_split_default_right()->::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight::MergeFrom(from.sparse_float_binary_split_default_right()); + break; + } + case kCategoricalIdBinarySplit: { + mutable_categorical_id_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit::MergeFrom(from.categorical_id_binary_split()); + break; + } + case kCategoricalIdSetMembershipBinarySplit: { + mutable_categorical_id_set_membership_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit::MergeFrom(from.categorical_id_set_membership_binary_split()); + break; + } + case kObliviousDenseFloatBinarySplit: { + mutable_oblivious_dense_float_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit::MergeFrom(from.oblivious_dense_float_binary_split()); + break; + } + case kObliviousCategoricalIdBinarySplit: { + mutable_oblivious_categorical_id_binary_split()->::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit::MergeFrom(from.oblivious_categorical_id_binary_split()); + break; + } + case NODE_NOT_SET: { + break; + } + } +} + +void TreeNode::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeNode::CopyFrom(const TreeNode& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeNode::IsInitialized() const { + return true; +} + +void TreeNode::Swap(TreeNode* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeNode* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeNode::UnsafeArenaSwap(TreeNode* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeNode::InternalSwap(TreeNode* other) { + using std::swap; + swap(node_metadata_, other->node_metadata_); + swap(node_, other->node_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeNode::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TreeNodeMetadata::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::trees::_TreeNodeMetadata_default_instance_._instance.get_mutable()->original_leaf_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::Leaf*>( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf::internal_default_instance()); +} +void TreeNodeMetadata::unsafe_arena_set_allocated_original_leaf( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* original_leaf) { + if (GetArenaNoVirtual() == NULL) { + delete original_leaf_; + } + original_leaf_ = original_leaf; + if (original_leaf) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_leaf) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeNodeMetadata::kGainFieldNumber; +const int TreeNodeMetadata::kOriginalLeafFieldNumber; +const int TreeNodeMetadata::kOriginalObliviousLeavesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeNodeMetadata::TreeNodeMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNodeMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) +} +TreeNodeMetadata::TreeNodeMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + original_oblivious_leaves_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNodeMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) +} +TreeNodeMetadata::TreeNodeMetadata(const TreeNodeMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + original_oblivious_leaves_(from.original_oblivious_leaves_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_original_leaf()) { + original_leaf_ = new ::diplomacy::tensorflow::boosted_trees::trees::Leaf(*from.original_leaf_); + } else { + original_leaf_ = NULL; + } + gain_ = from.gain_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) +} + +void TreeNodeMetadata::SharedCtor() { + ::memset(&original_leaf_, 0, static_cast( + reinterpret_cast(&gain_) - + reinterpret_cast(&original_leaf_)) + sizeof(gain_)); +} + +TreeNodeMetadata::~TreeNodeMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + SharedDtor(); +} + +void TreeNodeMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete original_leaf_; +} + +void TreeNodeMetadata::ArenaDtor(void* object) { + TreeNodeMetadata* _this = reinterpret_cast< TreeNodeMetadata* >(object); + (void)_this; +} +void TreeNodeMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeNodeMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeNodeMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeNodeMetadata& TreeNodeMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_TreeNodeMetadata.base); + return *internal_default_instance(); +} + + +void TreeNodeMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + original_oblivious_leaves_.Clear(); + if (GetArenaNoVirtual() == NULL && original_leaf_ != NULL) { + delete original_leaf_; + } + original_leaf_ = NULL; + gain_ = 0; + _internal_metadata_.Clear(); +} + +bool TreeNodeMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float gain = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &gain_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf original_leaf = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_original_leaf())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf original_oblivious_leaves = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_original_oblivious_leaves())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + return false; +#undef DO_ +} + +void TreeNodeMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float gain = 1; + if (this->gain() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->gain(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf original_leaf = 2; + if (this->has_original_leaf()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_original_leaf(), output); + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf original_oblivious_leaves = 3; + for (unsigned int i = 0, + n = static_cast(this->original_oblivious_leaves_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->original_oblivious_leaves(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) +} + +::google::protobuf::uint8* TreeNodeMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float gain = 1; + if (this->gain() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->gain(), target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf original_leaf = 2; + if (this->has_original_leaf()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_original_leaf(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf original_oblivious_leaves = 3; + for (unsigned int i = 0, + n = static_cast(this->original_oblivious_leaves_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->original_oblivious_leaves(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + return target; +} + +size_t TreeNodeMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf original_oblivious_leaves = 3; + { + unsigned int count = static_cast(this->original_oblivious_leaves_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->original_oblivious_leaves(static_cast(i))); + } + } + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf original_leaf = 2; + if (this->has_original_leaf()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *original_leaf_); + } + + // float gain = 1; + if (this->gain() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeNodeMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + GOOGLE_DCHECK_NE(&from, this); + const TreeNodeMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + MergeFrom(*source); + } +} + +void TreeNodeMetadata::MergeFrom(const TreeNodeMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + original_oblivious_leaves_.MergeFrom(from.original_oblivious_leaves_); + if (from.has_original_leaf()) { + mutable_original_leaf()->::diplomacy::tensorflow::boosted_trees::trees::Leaf::MergeFrom(from.original_leaf()); + } + if (from.gain() != 0) { + set_gain(from.gain()); + } +} + +void TreeNodeMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeNodeMetadata::CopyFrom(const TreeNodeMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeNodeMetadata::IsInitialized() const { + return true; +} + +void TreeNodeMetadata::Swap(TreeNodeMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeNodeMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeNodeMetadata::UnsafeArenaSwap(TreeNodeMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeNodeMetadata::InternalSwap(TreeNodeMetadata* other) { + using std::swap; + CastToBase(&original_oblivious_leaves_)->InternalSwap(CastToBase(&other->original_oblivious_leaves_)); + swap(original_leaf_, other->original_leaf_); + swap(gain_, other->gain_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeNodeMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Leaf::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_.vector_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::Vector*>( + ::diplomacy::tensorflow::boosted_trees::trees::Vector::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_.sparse_vector_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::SparseVector*>( + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector::internal_default_instance()); +} +void Leaf::set_allocated_vector(::diplomacy::tensorflow::boosted_trees::trees::Vector* vector) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf(); + if (vector) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(vector); + if (message_arena != submessage_arena) { + vector = ::google::protobuf::internal::GetOwnedMessage( + message_arena, vector, submessage_arena); + } + set_has_vector(); + leaf_.vector_ = vector; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.Leaf.vector) +} +void Leaf::set_allocated_sparse_vector(::diplomacy::tensorflow::boosted_trees::trees::SparseVector* sparse_vector) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf(); + if (sparse_vector) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(sparse_vector); + if (message_arena != submessage_arena) { + sparse_vector = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sparse_vector, submessage_arena); + } + set_has_sparse_vector(); + leaf_.sparse_vector_ = sparse_vector; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.Leaf.sparse_vector) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Leaf::kVectorFieldNumber; +const int Leaf::kSparseVectorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Leaf::Leaf() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Leaf.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.Leaf) +} +Leaf::Leaf(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Leaf.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.Leaf) +} +Leaf::Leaf(const Leaf& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_leaf(); + switch (from.leaf_case()) { + case kVector: { + mutable_vector()->::diplomacy::tensorflow::boosted_trees::trees::Vector::MergeFrom(from.vector()); + break; + } + case kSparseVector: { + mutable_sparse_vector()->::diplomacy::tensorflow::boosted_trees::trees::SparseVector::MergeFrom(from.sparse_vector()); + break; + } + case LEAF_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.Leaf) +} + +void Leaf::SharedCtor() { + clear_has_leaf(); +} + +Leaf::~Leaf() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.Leaf) + SharedDtor(); +} + +void Leaf::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_leaf()) { + clear_leaf(); + } +} + +void Leaf::ArenaDtor(void* object) { + Leaf* _this = reinterpret_cast< Leaf* >(object); + (void)_this; +} +void Leaf::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Leaf::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Leaf::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Leaf& Leaf::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Leaf.base); + return *internal_default_instance(); +} + + +void Leaf::clear_leaf() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + switch (leaf_case()) { + case kVector: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.vector_; + } + break; + } + case kSparseVector: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.sparse_vector_; + } + break; + } + case LEAF_NOT_SET: { + break; + } + } + _oneof_case_[0] = LEAF_NOT_SET; +} + + +void Leaf::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_leaf(); + _internal_metadata_.Clear(); +} + +bool Leaf::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.trees.Vector vector = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_vector())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseVector sparse_vector = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sparse_vector())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.Leaf) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.Leaf) + return false; +#undef DO_ +} + +void Leaf::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.Vector vector = 1; + if (has_vector()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_vector(), output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseVector sparse_vector = 2; + if (has_sparse_vector()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_sparse_vector(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.Leaf) +} + +::google::protobuf::uint8* Leaf::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.Vector vector = 1; + if (has_vector()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_vector(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.SparseVector sparse_vector = 2; + if (has_sparse_vector()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_sparse_vector(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.Leaf) + return target; +} + +size_t Leaf::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (leaf_case()) { + // .diplomacy.tensorflow.boosted_trees.trees.Vector vector = 1; + case kVector: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_.vector_); + break; + } + // .diplomacy.tensorflow.boosted_trees.trees.SparseVector sparse_vector = 2; + case kSparseVector: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_.sparse_vector_); + break; + } + case LEAF_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Leaf::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + GOOGLE_DCHECK_NE(&from, this); + const Leaf* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.Leaf) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.Leaf) + MergeFrom(*source); + } +} + +void Leaf::MergeFrom(const Leaf& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.leaf_case()) { + case kVector: { + mutable_vector()->::diplomacy::tensorflow::boosted_trees::trees::Vector::MergeFrom(from.vector()); + break; + } + case kSparseVector: { + mutable_sparse_vector()->::diplomacy::tensorflow::boosted_trees::trees::SparseVector::MergeFrom(from.sparse_vector()); + break; + } + case LEAF_NOT_SET: { + break; + } + } +} + +void Leaf::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Leaf::CopyFrom(const Leaf& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.Leaf) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Leaf::IsInitialized() const { + return true; +} + +void Leaf::Swap(Leaf* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Leaf* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Leaf::UnsafeArenaSwap(Leaf* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Leaf::InternalSwap(Leaf* other) { + using std::swap; + swap(leaf_, other->leaf_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Leaf::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Vector::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Vector::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Vector::Vector() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Vector.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.Vector) +} +Vector::Vector(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Vector.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.Vector) +} +Vector::Vector(const Vector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.Vector) +} + +void Vector::SharedCtor() { +} + +Vector::~Vector() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.Vector) + SharedDtor(); +} + +void Vector::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Vector::ArenaDtor(void* object) { + Vector* _this = reinterpret_cast< Vector* >(object); + (void)_this; +} +void Vector::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Vector::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Vector::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Vector& Vector::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_Vector.base); + return *internal_default_instance(); +} + + +void Vector::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool Vector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated float value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.Vector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.Vector) + return false; +#undef DO_ +} + +void Vector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.Vector) +} + +::google::protobuf::uint8* Vector::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.Vector) + return target; +} + +size_t Vector::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated float value = 1; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Vector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + GOOGLE_DCHECK_NE(&from, this); + const Vector* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.Vector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.Vector) + MergeFrom(*source); + } +} + +void Vector::MergeFrom(const Vector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void Vector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Vector::CopyFrom(const Vector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.Vector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Vector::IsInitialized() const { + return true; +} + +void Vector::Swap(Vector* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Vector* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Vector::UnsafeArenaSwap(Vector* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Vector::InternalSwap(Vector* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Vector::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SparseVector::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SparseVector::kIndexFieldNumber; +const int SparseVector::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SparseVector::SparseVector() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseVector.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.SparseVector) +} +SparseVector::SparseVector(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + index_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseVector.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.SparseVector) +} +SparseVector::SparseVector(const SparseVector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + index_(from.index_), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.SparseVector) +} + +void SparseVector::SharedCtor() { +} + +SparseVector::~SparseVector() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + SharedDtor(); +} + +void SparseVector::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void SparseVector::ArenaDtor(void* object) { + SparseVector* _this = reinterpret_cast< SparseVector* >(object); + (void)_this; +} +void SparseVector::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SparseVector::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SparseVector::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SparseVector& SparseVector::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseVector.base); + return *internal_default_instance(); +} + + +void SparseVector::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + index_.Clear(); + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool SparseVector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 index = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10u, input, this->mutable_index()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated float value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 18u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + return false; +#undef DO_ +} + +void SparseVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 index = 1; + if (this->index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _index_cached_byte_size_)); + } + for (int i = 0, n = this->index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->index(i), output); + } + + // repeated float value = 2; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.SparseVector) +} + +::google::protobuf::uint8* SparseVector::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 index = 1; + if (this->index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->index_, target); + } + + // repeated float value = 2; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + return target; +} + +size_t SparseVector::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 index = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float value = 2; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SparseVector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + GOOGLE_DCHECK_NE(&from, this); + const SparseVector* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + MergeFrom(*source); + } +} + +void SparseVector::MergeFrom(const SparseVector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + index_.MergeFrom(from.index_); + value_.MergeFrom(from.value_); +} + +void SparseVector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SparseVector::CopyFrom(const SparseVector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SparseVector::IsInitialized() const { + return true; +} + +void SparseVector::Swap(SparseVector* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SparseVector* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SparseVector::UnsafeArenaSwap(SparseVector* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SparseVector::InternalSwap(SparseVector* other) { + using std::swap; + index_.InternalSwap(&other->index_); + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SparseVector::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DenseFloatBinarySplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DenseFloatBinarySplit::kFeatureColumnFieldNumber; +const int DenseFloatBinarySplit::kDimensionIdFieldNumber; +const int DenseFloatBinarySplit::kThresholdFieldNumber; +const int DenseFloatBinarySplit::kLeftIdFieldNumber; +const int DenseFloatBinarySplit::kRightIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DenseFloatBinarySplit::DenseFloatBinarySplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DenseFloatBinarySplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) +} +DenseFloatBinarySplit::DenseFloatBinarySplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DenseFloatBinarySplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) +} +DenseFloatBinarySplit::DenseFloatBinarySplit(const DenseFloatBinarySplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_column_, &from.feature_column_, + static_cast(reinterpret_cast(&dimension_id_) - + reinterpret_cast(&feature_column_)) + sizeof(dimension_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) +} + +void DenseFloatBinarySplit::SharedCtor() { + ::memset(&feature_column_, 0, static_cast( + reinterpret_cast(&dimension_id_) - + reinterpret_cast(&feature_column_)) + sizeof(dimension_id_)); +} + +DenseFloatBinarySplit::~DenseFloatBinarySplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + SharedDtor(); +} + +void DenseFloatBinarySplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DenseFloatBinarySplit::ArenaDtor(void* object) { + DenseFloatBinarySplit* _this = reinterpret_cast< DenseFloatBinarySplit* >(object); + (void)_this; +} +void DenseFloatBinarySplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DenseFloatBinarySplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DenseFloatBinarySplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DenseFloatBinarySplit& DenseFloatBinarySplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DenseFloatBinarySplit.base); + return *internal_default_instance(); +} + + +void DenseFloatBinarySplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&feature_column_, 0, static_cast( + reinterpret_cast(&dimension_id_) - + reinterpret_cast(&feature_column_)) + sizeof(dimension_id_)); + _internal_metadata_.Clear(); +} + +bool DenseFloatBinarySplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_column = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_column_))); + } else { + goto handle_unusual; + } + break; + } + + // float threshold = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 left_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &left_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 right_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &right_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 dimension_id = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dimension_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + return false; +#undef DO_ +} + +void DenseFloatBinarySplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_column(), output); + } + + // float threshold = 2; + if (this->threshold() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->threshold(), output); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->left_id(), output); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->right_id(), output); + } + + // int32 dimension_id = 5; + if (this->dimension_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->dimension_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) +} + +::google::protobuf::uint8* DenseFloatBinarySplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_column(), target); + } + + // float threshold = 2; + if (this->threshold() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->threshold(), target); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->left_id(), target); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->right_id(), target); + } + + // int32 dimension_id = 5; + if (this->dimension_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->dimension_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + return target; +} + +size_t DenseFloatBinarySplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 feature_column = 1; + if (this->feature_column() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_column()); + } + + // float threshold = 2; + if (this->threshold() != 0) { + total_size += 1 + 4; + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->left_id()); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->right_id()); + } + + // int32 dimension_id = 5; + if (this->dimension_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dimension_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DenseFloatBinarySplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + const DenseFloatBinarySplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + MergeFrom(*source); + } +} + +void DenseFloatBinarySplit::MergeFrom(const DenseFloatBinarySplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.feature_column() != 0) { + set_feature_column(from.feature_column()); + } + if (from.threshold() != 0) { + set_threshold(from.threshold()); + } + if (from.left_id() != 0) { + set_left_id(from.left_id()); + } + if (from.right_id() != 0) { + set_right_id(from.right_id()); + } + if (from.dimension_id() != 0) { + set_dimension_id(from.dimension_id()); + } +} + +void DenseFloatBinarySplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DenseFloatBinarySplit::CopyFrom(const DenseFloatBinarySplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DenseFloatBinarySplit::IsInitialized() const { + return true; +} + +void DenseFloatBinarySplit::Swap(DenseFloatBinarySplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DenseFloatBinarySplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DenseFloatBinarySplit::UnsafeArenaSwap(DenseFloatBinarySplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DenseFloatBinarySplit::InternalSwap(DenseFloatBinarySplit* other) { + using std::swap; + swap(feature_column_, other->feature_column_); + swap(threshold_, other->threshold_); + swap(left_id_, other->left_id_); + swap(right_id_, other->right_id_); + swap(dimension_id_, other->dimension_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DenseFloatBinarySplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SparseFloatBinarySplitDefaultLeft::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultLeft_default_instance_._instance.get_mutable()->split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit*>( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::internal_default_instance()); +} +void SparseFloatBinarySplitDefaultLeft::unsafe_arena_set_allocated_split( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split) { + if (GetArenaNoVirtual() == NULL) { + delete split_; + } + split_ = split; + if (split) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft.split) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SparseFloatBinarySplitDefaultLeft::kSplitFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SparseFloatBinarySplitDefaultLeft::SparseFloatBinarySplitDefaultLeft() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultLeft.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) +} +SparseFloatBinarySplitDefaultLeft::SparseFloatBinarySplitDefaultLeft(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultLeft.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) +} +SparseFloatBinarySplitDefaultLeft::SparseFloatBinarySplitDefaultLeft(const SparseFloatBinarySplitDefaultLeft& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_split()) { + split_ = new ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit(*from.split_); + } else { + split_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) +} + +void SparseFloatBinarySplitDefaultLeft::SharedCtor() { + split_ = NULL; +} + +SparseFloatBinarySplitDefaultLeft::~SparseFloatBinarySplitDefaultLeft() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + SharedDtor(); +} + +void SparseFloatBinarySplitDefaultLeft::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete split_; +} + +void SparseFloatBinarySplitDefaultLeft::ArenaDtor(void* object) { + SparseFloatBinarySplitDefaultLeft* _this = reinterpret_cast< SparseFloatBinarySplitDefaultLeft* >(object); + (void)_this; +} +void SparseFloatBinarySplitDefaultLeft::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SparseFloatBinarySplitDefaultLeft::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SparseFloatBinarySplitDefaultLeft::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SparseFloatBinarySplitDefaultLeft& SparseFloatBinarySplitDefaultLeft::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultLeft.base); + return *internal_default_instance(); +} + + +void SparseFloatBinarySplitDefaultLeft::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && split_ != NULL) { + delete split_; + } + split_ = NULL; + _internal_metadata_.Clear(); +} + +bool SparseFloatBinarySplitDefaultLeft::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_split())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + return false; +#undef DO_ +} + +void SparseFloatBinarySplitDefaultLeft::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + if (this->has_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_split(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) +} + +::google::protobuf::uint8* SparseFloatBinarySplitDefaultLeft::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + if (this->has_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_split(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + return target; +} + +size_t SparseFloatBinarySplitDefaultLeft::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + if (this->has_split()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *split_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SparseFloatBinarySplitDefaultLeft::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + GOOGLE_DCHECK_NE(&from, this); + const SparseFloatBinarySplitDefaultLeft* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + MergeFrom(*source); + } +} + +void SparseFloatBinarySplitDefaultLeft::MergeFrom(const SparseFloatBinarySplitDefaultLeft& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_split()) { + mutable_split()->::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::MergeFrom(from.split()); + } +} + +void SparseFloatBinarySplitDefaultLeft::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SparseFloatBinarySplitDefaultLeft::CopyFrom(const SparseFloatBinarySplitDefaultLeft& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SparseFloatBinarySplitDefaultLeft::IsInitialized() const { + return true; +} + +void SparseFloatBinarySplitDefaultLeft::Swap(SparseFloatBinarySplitDefaultLeft* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SparseFloatBinarySplitDefaultLeft* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SparseFloatBinarySplitDefaultLeft::UnsafeArenaSwap(SparseFloatBinarySplitDefaultLeft* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SparseFloatBinarySplitDefaultLeft::InternalSwap(SparseFloatBinarySplitDefaultLeft* other) { + using std::swap; + swap(split_, other->split_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SparseFloatBinarySplitDefaultLeft::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SparseFloatBinarySplitDefaultRight::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultRight_default_instance_._instance.get_mutable()->split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit*>( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::internal_default_instance()); +} +void SparseFloatBinarySplitDefaultRight::unsafe_arena_set_allocated_split( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split) { + if (GetArenaNoVirtual() == NULL) { + delete split_; + } + split_ = split; + if (split) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight.split) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SparseFloatBinarySplitDefaultRight::kSplitFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SparseFloatBinarySplitDefaultRight::SparseFloatBinarySplitDefaultRight() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultRight.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) +} +SparseFloatBinarySplitDefaultRight::SparseFloatBinarySplitDefaultRight(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultRight.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) +} +SparseFloatBinarySplitDefaultRight::SparseFloatBinarySplitDefaultRight(const SparseFloatBinarySplitDefaultRight& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_split()) { + split_ = new ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit(*from.split_); + } else { + split_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) +} + +void SparseFloatBinarySplitDefaultRight::SharedCtor() { + split_ = NULL; +} + +SparseFloatBinarySplitDefaultRight::~SparseFloatBinarySplitDefaultRight() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + SharedDtor(); +} + +void SparseFloatBinarySplitDefaultRight::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete split_; +} + +void SparseFloatBinarySplitDefaultRight::ArenaDtor(void* object) { + SparseFloatBinarySplitDefaultRight* _this = reinterpret_cast< SparseFloatBinarySplitDefaultRight* >(object); + (void)_this; +} +void SparseFloatBinarySplitDefaultRight::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SparseFloatBinarySplitDefaultRight::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SparseFloatBinarySplitDefaultRight::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SparseFloatBinarySplitDefaultRight& SparseFloatBinarySplitDefaultRight::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_SparseFloatBinarySplitDefaultRight.base); + return *internal_default_instance(); +} + + +void SparseFloatBinarySplitDefaultRight::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && split_ != NULL) { + delete split_; + } + split_ = NULL; + _internal_metadata_.Clear(); +} + +bool SparseFloatBinarySplitDefaultRight::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_split())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + return false; +#undef DO_ +} + +void SparseFloatBinarySplitDefaultRight::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + if (this->has_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_split(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) +} + +::google::protobuf::uint8* SparseFloatBinarySplitDefaultRight::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + if (this->has_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_split(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + return target; +} + +size_t SparseFloatBinarySplitDefaultRight::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + if (this->has_split()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *split_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SparseFloatBinarySplitDefaultRight::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + GOOGLE_DCHECK_NE(&from, this); + const SparseFloatBinarySplitDefaultRight* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + MergeFrom(*source); + } +} + +void SparseFloatBinarySplitDefaultRight::MergeFrom(const SparseFloatBinarySplitDefaultRight& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_split()) { + mutable_split()->::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit::MergeFrom(from.split()); + } +} + +void SparseFloatBinarySplitDefaultRight::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SparseFloatBinarySplitDefaultRight::CopyFrom(const SparseFloatBinarySplitDefaultRight& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SparseFloatBinarySplitDefaultRight::IsInitialized() const { + return true; +} + +void SparseFloatBinarySplitDefaultRight::Swap(SparseFloatBinarySplitDefaultRight* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SparseFloatBinarySplitDefaultRight* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SparseFloatBinarySplitDefaultRight::UnsafeArenaSwap(SparseFloatBinarySplitDefaultRight* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SparseFloatBinarySplitDefaultRight::InternalSwap(SparseFloatBinarySplitDefaultRight* other) { + using std::swap; + swap(split_, other->split_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SparseFloatBinarySplitDefaultRight::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CategoricalIdBinarySplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CategoricalIdBinarySplit::kFeatureColumnFieldNumber; +const int CategoricalIdBinarySplit::kFeatureIdFieldNumber; +const int CategoricalIdBinarySplit::kLeftIdFieldNumber; +const int CategoricalIdBinarySplit::kRightIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CategoricalIdBinarySplit::CategoricalIdBinarySplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdBinarySplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) +} +CategoricalIdBinarySplit::CategoricalIdBinarySplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdBinarySplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) +} +CategoricalIdBinarySplit::CategoricalIdBinarySplit(const CategoricalIdBinarySplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_id_, &from.feature_id_, + static_cast(reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) +} + +void CategoricalIdBinarySplit::SharedCtor() { + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); +} + +CategoricalIdBinarySplit::~CategoricalIdBinarySplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + SharedDtor(); +} + +void CategoricalIdBinarySplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void CategoricalIdBinarySplit::ArenaDtor(void* object) { + CategoricalIdBinarySplit* _this = reinterpret_cast< CategoricalIdBinarySplit* >(object); + (void)_this; +} +void CategoricalIdBinarySplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CategoricalIdBinarySplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CategoricalIdBinarySplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CategoricalIdBinarySplit& CategoricalIdBinarySplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdBinarySplit.base); + return *internal_default_instance(); +} + + +void CategoricalIdBinarySplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + _internal_metadata_.Clear(); +} + +bool CategoricalIdBinarySplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_column = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_column_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 feature_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &feature_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 left_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &left_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 right_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &right_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + return false; +#undef DO_ +} + +void CategoricalIdBinarySplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_column(), output); + } + + // int64 feature_id = 2; + if (this->feature_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->feature_id(), output); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->left_id(), output); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->right_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) +} + +::google::protobuf::uint8* CategoricalIdBinarySplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_column(), target); + } + + // int64 feature_id = 2; + if (this->feature_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->feature_id(), target); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->left_id(), target); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->right_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + return target; +} + +size_t CategoricalIdBinarySplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 feature_id = 2; + if (this->feature_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->feature_id()); + } + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_column()); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->left_id()); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->right_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CategoricalIdBinarySplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + const CategoricalIdBinarySplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + MergeFrom(*source); + } +} + +void CategoricalIdBinarySplit::MergeFrom(const CategoricalIdBinarySplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.feature_id() != 0) { + set_feature_id(from.feature_id()); + } + if (from.feature_column() != 0) { + set_feature_column(from.feature_column()); + } + if (from.left_id() != 0) { + set_left_id(from.left_id()); + } + if (from.right_id() != 0) { + set_right_id(from.right_id()); + } +} + +void CategoricalIdBinarySplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CategoricalIdBinarySplit::CopyFrom(const CategoricalIdBinarySplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CategoricalIdBinarySplit::IsInitialized() const { + return true; +} + +void CategoricalIdBinarySplit::Swap(CategoricalIdBinarySplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CategoricalIdBinarySplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CategoricalIdBinarySplit::UnsafeArenaSwap(CategoricalIdBinarySplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CategoricalIdBinarySplit::InternalSwap(CategoricalIdBinarySplit* other) { + using std::swap; + swap(feature_id_, other->feature_id_); + swap(feature_column_, other->feature_column_); + swap(left_id_, other->left_id_); + swap(right_id_, other->right_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CategoricalIdBinarySplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CategoricalIdSetMembershipBinarySplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CategoricalIdSetMembershipBinarySplit::kFeatureColumnFieldNumber; +const int CategoricalIdSetMembershipBinarySplit::kFeatureIdsFieldNumber; +const int CategoricalIdSetMembershipBinarySplit::kLeftIdFieldNumber; +const int CategoricalIdSetMembershipBinarySplit::kRightIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CategoricalIdSetMembershipBinarySplit::CategoricalIdSetMembershipBinarySplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdSetMembershipBinarySplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) +} +CategoricalIdSetMembershipBinarySplit::CategoricalIdSetMembershipBinarySplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + feature_ids_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdSetMembershipBinarySplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) +} +CategoricalIdSetMembershipBinarySplit::CategoricalIdSetMembershipBinarySplit(const CategoricalIdSetMembershipBinarySplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + feature_ids_(from.feature_ids_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_column_, &from.feature_column_, + static_cast(reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_column_)) + sizeof(right_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) +} + +void CategoricalIdSetMembershipBinarySplit::SharedCtor() { + ::memset(&feature_column_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_column_)) + sizeof(right_id_)); +} + +CategoricalIdSetMembershipBinarySplit::~CategoricalIdSetMembershipBinarySplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + SharedDtor(); +} + +void CategoricalIdSetMembershipBinarySplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void CategoricalIdSetMembershipBinarySplit::ArenaDtor(void* object) { + CategoricalIdSetMembershipBinarySplit* _this = reinterpret_cast< CategoricalIdSetMembershipBinarySplit* >(object); + (void)_this; +} +void CategoricalIdSetMembershipBinarySplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CategoricalIdSetMembershipBinarySplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CategoricalIdSetMembershipBinarySplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CategoricalIdSetMembershipBinarySplit& CategoricalIdSetMembershipBinarySplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_CategoricalIdSetMembershipBinarySplit.base); + return *internal_default_instance(); +} + + +void CategoricalIdSetMembershipBinarySplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feature_ids_.Clear(); + ::memset(&feature_column_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_column_)) + sizeof(right_id_)); + _internal_metadata_.Clear(); +} + +bool CategoricalIdSetMembershipBinarySplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_column = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_column_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 feature_ids = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_feature_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_feature_ids()))); + } else { + goto handle_unusual; + } + break; + } + + // int32 left_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &left_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 right_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &right_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + return false; +#undef DO_ +} + +void CategoricalIdSetMembershipBinarySplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_column(), output); + } + + // repeated int64 feature_ids = 2; + if (this->feature_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _feature_ids_cached_byte_size_)); + } + for (int i = 0, n = this->feature_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->feature_ids(i), output); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->left_id(), output); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->right_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) +} + +::google::protobuf::uint8* CategoricalIdSetMembershipBinarySplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_column(), target); + } + + // repeated int64 feature_ids = 2; + if (this->feature_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _feature_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->feature_ids_, target); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->left_id(), target); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->right_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + return target; +} + +size_t CategoricalIdSetMembershipBinarySplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 feature_ids = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->feature_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _feature_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_column()); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->left_id()); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->right_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CategoricalIdSetMembershipBinarySplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + const CategoricalIdSetMembershipBinarySplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + MergeFrom(*source); + } +} + +void CategoricalIdSetMembershipBinarySplit::MergeFrom(const CategoricalIdSetMembershipBinarySplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feature_ids_.MergeFrom(from.feature_ids_); + if (from.feature_column() != 0) { + set_feature_column(from.feature_column()); + } + if (from.left_id() != 0) { + set_left_id(from.left_id()); + } + if (from.right_id() != 0) { + set_right_id(from.right_id()); + } +} + +void CategoricalIdSetMembershipBinarySplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CategoricalIdSetMembershipBinarySplit::CopyFrom(const CategoricalIdSetMembershipBinarySplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CategoricalIdSetMembershipBinarySplit::IsInitialized() const { + return true; +} + +void CategoricalIdSetMembershipBinarySplit::Swap(CategoricalIdSetMembershipBinarySplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CategoricalIdSetMembershipBinarySplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CategoricalIdSetMembershipBinarySplit::UnsafeArenaSwap(CategoricalIdSetMembershipBinarySplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CategoricalIdSetMembershipBinarySplit::InternalSwap(CategoricalIdSetMembershipBinarySplit* other) { + using std::swap; + feature_ids_.InternalSwap(&other->feature_ids_); + swap(feature_column_, other->feature_column_); + swap(left_id_, other->left_id_); + swap(right_id_, other->right_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CategoricalIdSetMembershipBinarySplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ObliviousDenseFloatBinarySplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ObliviousDenseFloatBinarySplit::kFeatureColumnFieldNumber; +const int ObliviousDenseFloatBinarySplit::kThresholdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ObliviousDenseFloatBinarySplit::ObliviousDenseFloatBinarySplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousDenseFloatBinarySplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) +} +ObliviousDenseFloatBinarySplit::ObliviousDenseFloatBinarySplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousDenseFloatBinarySplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) +} +ObliviousDenseFloatBinarySplit::ObliviousDenseFloatBinarySplit(const ObliviousDenseFloatBinarySplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_column_, &from.feature_column_, + static_cast(reinterpret_cast(&threshold_) - + reinterpret_cast(&feature_column_)) + sizeof(threshold_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) +} + +void ObliviousDenseFloatBinarySplit::SharedCtor() { + ::memset(&feature_column_, 0, static_cast( + reinterpret_cast(&threshold_) - + reinterpret_cast(&feature_column_)) + sizeof(threshold_)); +} + +ObliviousDenseFloatBinarySplit::~ObliviousDenseFloatBinarySplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + SharedDtor(); +} + +void ObliviousDenseFloatBinarySplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ObliviousDenseFloatBinarySplit::ArenaDtor(void* object) { + ObliviousDenseFloatBinarySplit* _this = reinterpret_cast< ObliviousDenseFloatBinarySplit* >(object); + (void)_this; +} +void ObliviousDenseFloatBinarySplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ObliviousDenseFloatBinarySplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ObliviousDenseFloatBinarySplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ObliviousDenseFloatBinarySplit& ObliviousDenseFloatBinarySplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousDenseFloatBinarySplit.base); + return *internal_default_instance(); +} + + +void ObliviousDenseFloatBinarySplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&feature_column_, 0, static_cast( + reinterpret_cast(&threshold_) - + reinterpret_cast(&feature_column_)) + sizeof(threshold_)); + _internal_metadata_.Clear(); +} + +bool ObliviousDenseFloatBinarySplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_column = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_column_))); + } else { + goto handle_unusual; + } + break; + } + + // float threshold = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + return false; +#undef DO_ +} + +void ObliviousDenseFloatBinarySplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_column(), output); + } + + // float threshold = 2; + if (this->threshold() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->threshold(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) +} + +::google::protobuf::uint8* ObliviousDenseFloatBinarySplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_column(), target); + } + + // float threshold = 2; + if (this->threshold() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->threshold(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + return target; +} + +size_t ObliviousDenseFloatBinarySplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 feature_column = 1; + if (this->feature_column() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_column()); + } + + // float threshold = 2; + if (this->threshold() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ObliviousDenseFloatBinarySplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + const ObliviousDenseFloatBinarySplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + MergeFrom(*source); + } +} + +void ObliviousDenseFloatBinarySplit::MergeFrom(const ObliviousDenseFloatBinarySplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.feature_column() != 0) { + set_feature_column(from.feature_column()); + } + if (from.threshold() != 0) { + set_threshold(from.threshold()); + } +} + +void ObliviousDenseFloatBinarySplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ObliviousDenseFloatBinarySplit::CopyFrom(const ObliviousDenseFloatBinarySplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ObliviousDenseFloatBinarySplit::IsInitialized() const { + return true; +} + +void ObliviousDenseFloatBinarySplit::Swap(ObliviousDenseFloatBinarySplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ObliviousDenseFloatBinarySplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ObliviousDenseFloatBinarySplit::UnsafeArenaSwap(ObliviousDenseFloatBinarySplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ObliviousDenseFloatBinarySplit::InternalSwap(ObliviousDenseFloatBinarySplit* other) { + using std::swap; + swap(feature_column_, other->feature_column_); + swap(threshold_, other->threshold_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ObliviousDenseFloatBinarySplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ObliviousCategoricalIdBinarySplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ObliviousCategoricalIdBinarySplit::kFeatureColumnFieldNumber; +const int ObliviousCategoricalIdBinarySplit::kFeatureIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ObliviousCategoricalIdBinarySplit::ObliviousCategoricalIdBinarySplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousCategoricalIdBinarySplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) +} +ObliviousCategoricalIdBinarySplit::ObliviousCategoricalIdBinarySplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousCategoricalIdBinarySplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) +} +ObliviousCategoricalIdBinarySplit::ObliviousCategoricalIdBinarySplit(const ObliviousCategoricalIdBinarySplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_id_, &from.feature_id_, + static_cast(reinterpret_cast(&feature_column_) - + reinterpret_cast(&feature_id_)) + sizeof(feature_column_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) +} + +void ObliviousCategoricalIdBinarySplit::SharedCtor() { + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&feature_column_) - + reinterpret_cast(&feature_id_)) + sizeof(feature_column_)); +} + +ObliviousCategoricalIdBinarySplit::~ObliviousCategoricalIdBinarySplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + SharedDtor(); +} + +void ObliviousCategoricalIdBinarySplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ObliviousCategoricalIdBinarySplit::ArenaDtor(void* object) { + ObliviousCategoricalIdBinarySplit* _this = reinterpret_cast< ObliviousCategoricalIdBinarySplit* >(object); + (void)_this; +} +void ObliviousCategoricalIdBinarySplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ObliviousCategoricalIdBinarySplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ObliviousCategoricalIdBinarySplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ObliviousCategoricalIdBinarySplit& ObliviousCategoricalIdBinarySplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_ObliviousCategoricalIdBinarySplit.base); + return *internal_default_instance(); +} + + +void ObliviousCategoricalIdBinarySplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&feature_column_) - + reinterpret_cast(&feature_id_)) + sizeof(feature_column_)); + _internal_metadata_.Clear(); +} + +bool ObliviousCategoricalIdBinarySplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_column = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_column_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 feature_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &feature_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + return false; +#undef DO_ +} + +void ObliviousCategoricalIdBinarySplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_column(), output); + } + + // int64 feature_id = 2; + if (this->feature_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->feature_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) +} + +::google::protobuf::uint8* ObliviousCategoricalIdBinarySplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_column(), target); + } + + // int64 feature_id = 2; + if (this->feature_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->feature_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + return target; +} + +size_t ObliviousCategoricalIdBinarySplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 feature_id = 2; + if (this->feature_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->feature_id()); + } + + // int32 feature_column = 1; + if (this->feature_column() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_column()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ObliviousCategoricalIdBinarySplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + const ObliviousCategoricalIdBinarySplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + MergeFrom(*source); + } +} + +void ObliviousCategoricalIdBinarySplit::MergeFrom(const ObliviousCategoricalIdBinarySplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.feature_id() != 0) { + set_feature_id(from.feature_id()); + } + if (from.feature_column() != 0) { + set_feature_column(from.feature_column()); + } +} + +void ObliviousCategoricalIdBinarySplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ObliviousCategoricalIdBinarySplit::CopyFrom(const ObliviousCategoricalIdBinarySplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ObliviousCategoricalIdBinarySplit::IsInitialized() const { + return true; +} + +void ObliviousCategoricalIdBinarySplit::Swap(ObliviousCategoricalIdBinarySplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ObliviousCategoricalIdBinarySplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ObliviousCategoricalIdBinarySplit::UnsafeArenaSwap(ObliviousCategoricalIdBinarySplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ObliviousCategoricalIdBinarySplit::InternalSwap(ObliviousCategoricalIdBinarySplit* other) { + using std::swap; + swap(feature_id_, other->feature_id_); + swap(feature_column_, other->feature_column_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ObliviousCategoricalIdBinarySplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DecisionTreeConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DecisionTreeConfig::kNodesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DecisionTreeConfig::DecisionTreeConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) +} +DecisionTreeConfig::DecisionTreeConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + nodes_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) +} +DecisionTreeConfig::DecisionTreeConfig(const DecisionTreeConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + nodes_(from.nodes_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) +} + +void DecisionTreeConfig::SharedCtor() { +} + +DecisionTreeConfig::~DecisionTreeConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + SharedDtor(); +} + +void DecisionTreeConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DecisionTreeConfig::ArenaDtor(void* object) { + DecisionTreeConfig* _this = reinterpret_cast< DecisionTreeConfig* >(object); + (void)_this; +} +void DecisionTreeConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DecisionTreeConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DecisionTreeConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DecisionTreeConfig& DecisionTreeConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeConfig.base); + return *internal_default_instance(); +} + + +void DecisionTreeConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + nodes_.Clear(); + _internal_metadata_.Clear(); +} + +bool DecisionTreeConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.boosted_trees.trees.TreeNode nodes = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_nodes())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + return false; +#undef DO_ +} + +void DecisionTreeConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.trees.TreeNode nodes = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->nodes(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) +} + +::google::protobuf::uint8* DecisionTreeConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.trees.TreeNode nodes = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->nodes(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + return target; +} + +size_t DecisionTreeConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.boosted_trees.trees.TreeNode nodes = 1; + { + unsigned int count = static_cast(this->nodes_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->nodes(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DecisionTreeConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + GOOGLE_DCHECK_NE(&from, this); + const DecisionTreeConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + MergeFrom(*source); + } +} + +void DecisionTreeConfig::MergeFrom(const DecisionTreeConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + nodes_.MergeFrom(from.nodes_); +} + +void DecisionTreeConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DecisionTreeConfig::CopyFrom(const DecisionTreeConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DecisionTreeConfig::IsInitialized() const { + return true; +} + +void DecisionTreeConfig::Swap(DecisionTreeConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DecisionTreeConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DecisionTreeConfig::UnsafeArenaSwap(DecisionTreeConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DecisionTreeConfig::InternalSwap(DecisionTreeConfig* other) { + using std::swap; + CastToBase(&nodes_)->InternalSwap(CastToBase(&other->nodes_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DecisionTreeConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DecisionTreeMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DecisionTreeMetadata::kNumTreeWeightUpdatesFieldNumber; +const int DecisionTreeMetadata::kNumLayersGrownFieldNumber; +const int DecisionTreeMetadata::kIsFinalizedFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DecisionTreeMetadata::DecisionTreeMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) +} +DecisionTreeMetadata::DecisionTreeMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) +} +DecisionTreeMetadata::DecisionTreeMetadata(const DecisionTreeMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&num_tree_weight_updates_, &from.num_tree_weight_updates_, + static_cast(reinterpret_cast(&is_finalized_) - + reinterpret_cast(&num_tree_weight_updates_)) + sizeof(is_finalized_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) +} + +void DecisionTreeMetadata::SharedCtor() { + ::memset(&num_tree_weight_updates_, 0, static_cast( + reinterpret_cast(&is_finalized_) - + reinterpret_cast(&num_tree_weight_updates_)) + sizeof(is_finalized_)); +} + +DecisionTreeMetadata::~DecisionTreeMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + SharedDtor(); +} + +void DecisionTreeMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DecisionTreeMetadata::ArenaDtor(void* object) { + DecisionTreeMetadata* _this = reinterpret_cast< DecisionTreeMetadata* >(object); + (void)_this; +} +void DecisionTreeMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DecisionTreeMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DecisionTreeMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DecisionTreeMetadata& DecisionTreeMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeMetadata.base); + return *internal_default_instance(); +} + + +void DecisionTreeMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&num_tree_weight_updates_, 0, static_cast( + reinterpret_cast(&is_finalized_) - + reinterpret_cast(&num_tree_weight_updates_)) + sizeof(is_finalized_)); + _internal_metadata_.Clear(); +} + +bool DecisionTreeMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 num_tree_weight_updates = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_tree_weight_updates_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_layers_grown = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_layers_grown_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_finalized = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_finalized_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + return false; +#undef DO_ +} + +void DecisionTreeMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_tree_weight_updates = 1; + if (this->num_tree_weight_updates() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->num_tree_weight_updates(), output); + } + + // int32 num_layers_grown = 2; + if (this->num_layers_grown() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_layers_grown(), output); + } + + // bool is_finalized = 3; + if (this->is_finalized() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->is_finalized(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) +} + +::google::protobuf::uint8* DecisionTreeMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_tree_weight_updates = 1; + if (this->num_tree_weight_updates() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->num_tree_weight_updates(), target); + } + + // int32 num_layers_grown = 2; + if (this->num_layers_grown() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_layers_grown(), target); + } + + // bool is_finalized = 3; + if (this->is_finalized() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->is_finalized(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + return target; +} + +size_t DecisionTreeMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 num_tree_weight_updates = 1; + if (this->num_tree_weight_updates() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_tree_weight_updates()); + } + + // int32 num_layers_grown = 2; + if (this->num_layers_grown() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_layers_grown()); + } + + // bool is_finalized = 3; + if (this->is_finalized() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DecisionTreeMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + GOOGLE_DCHECK_NE(&from, this); + const DecisionTreeMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + MergeFrom(*source); + } +} + +void DecisionTreeMetadata::MergeFrom(const DecisionTreeMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.num_tree_weight_updates() != 0) { + set_num_tree_weight_updates(from.num_tree_weight_updates()); + } + if (from.num_layers_grown() != 0) { + set_num_layers_grown(from.num_layers_grown()); + } + if (from.is_finalized() != 0) { + set_is_finalized(from.is_finalized()); + } +} + +void DecisionTreeMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DecisionTreeMetadata::CopyFrom(const DecisionTreeMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DecisionTreeMetadata::IsInitialized() const { + return true; +} + +void DecisionTreeMetadata::Swap(DecisionTreeMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DecisionTreeMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DecisionTreeMetadata::UnsafeArenaSwap(DecisionTreeMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DecisionTreeMetadata::InternalSwap(DecisionTreeMetadata* other) { + using std::swap; + swap(num_tree_weight_updates_, other->num_tree_weight_updates_); + swap(num_layers_grown_, other->num_layers_grown_); + swap(is_finalized_, other->is_finalized_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DecisionTreeMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GrowingMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GrowingMetadata::kNumTreesAttemptedFieldNumber; +const int GrowingMetadata::kNumLayersAttemptedFieldNumber; +const int GrowingMetadata::kUsedHandlerIdsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GrowingMetadata::GrowingMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_GrowingMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) +} +GrowingMetadata::GrowingMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + used_handler_ids_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_GrowingMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) +} +GrowingMetadata::GrowingMetadata(const GrowingMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + used_handler_ids_(from.used_handler_ids_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&num_trees_attempted_, &from.num_trees_attempted_, + static_cast(reinterpret_cast(&num_layers_attempted_) - + reinterpret_cast(&num_trees_attempted_)) + sizeof(num_layers_attempted_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) +} + +void GrowingMetadata::SharedCtor() { + ::memset(&num_trees_attempted_, 0, static_cast( + reinterpret_cast(&num_layers_attempted_) - + reinterpret_cast(&num_trees_attempted_)) + sizeof(num_layers_attempted_)); +} + +GrowingMetadata::~GrowingMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + SharedDtor(); +} + +void GrowingMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GrowingMetadata::ArenaDtor(void* object) { + GrowingMetadata* _this = reinterpret_cast< GrowingMetadata* >(object); + (void)_this; +} +void GrowingMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GrowingMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GrowingMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GrowingMetadata& GrowingMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_GrowingMetadata.base); + return *internal_default_instance(); +} + + +void GrowingMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + used_handler_ids_.Clear(); + ::memset(&num_trees_attempted_, 0, static_cast( + reinterpret_cast(&num_layers_attempted_) - + reinterpret_cast(&num_trees_attempted_)) + sizeof(num_layers_attempted_)); + _internal_metadata_.Clear(); +} + +bool GrowingMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 num_trees_attempted = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_trees_attempted_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 num_layers_attempted = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_layers_attempted_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 used_handler_ids = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_used_handler_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_used_handler_ids()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + return false; +#undef DO_ +} + +void GrowingMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 num_trees_attempted = 1; + if (this->num_trees_attempted() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->num_trees_attempted(), output); + } + + // int64 num_layers_attempted = 2; + if (this->num_layers_attempted() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->num_layers_attempted(), output); + } + + // repeated int64 used_handler_ids = 3; + if (this->used_handler_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _used_handler_ids_cached_byte_size_)); + } + for (int i = 0, n = this->used_handler_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->used_handler_ids(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) +} + +::google::protobuf::uint8* GrowingMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 num_trees_attempted = 1; + if (this->num_trees_attempted() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->num_trees_attempted(), target); + } + + // int64 num_layers_attempted = 2; + if (this->num_layers_attempted() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->num_layers_attempted(), target); + } + + // repeated int64 used_handler_ids = 3; + if (this->used_handler_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _used_handler_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->used_handler_ids_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + return target; +} + +size_t GrowingMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 used_handler_ids = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->used_handler_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _used_handler_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 num_trees_attempted = 1; + if (this->num_trees_attempted() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_trees_attempted()); + } + + // int64 num_layers_attempted = 2; + if (this->num_layers_attempted() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_layers_attempted()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GrowingMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + GOOGLE_DCHECK_NE(&from, this); + const GrowingMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + MergeFrom(*source); + } +} + +void GrowingMetadata::MergeFrom(const GrowingMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + used_handler_ids_.MergeFrom(from.used_handler_ids_); + if (from.num_trees_attempted() != 0) { + set_num_trees_attempted(from.num_trees_attempted()); + } + if (from.num_layers_attempted() != 0) { + set_num_layers_attempted(from.num_layers_attempted()); + } +} + +void GrowingMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GrowingMetadata::CopyFrom(const GrowingMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GrowingMetadata::IsInitialized() const { + return true; +} + +void GrowingMetadata::Swap(GrowingMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GrowingMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GrowingMetadata::UnsafeArenaSwap(GrowingMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GrowingMetadata::InternalSwap(GrowingMetadata* other) { + using std::swap; + used_handler_ids_.InternalSwap(&other->used_handler_ids_); + swap(num_trees_attempted_, other->num_trees_attempted_); + swap(num_layers_attempted_, other->num_layers_attempted_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GrowingMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DecisionTreeEnsembleConfig::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::trees::_DecisionTreeEnsembleConfig_default_instance_._instance.get_mutable()->growing_metadata_ = const_cast< ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata*>( + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata::internal_default_instance()); +} +void DecisionTreeEnsembleConfig::unsafe_arena_set_allocated_growing_metadata( + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* growing_metadata) { + if (GetArenaNoVirtual() == NULL) { + delete growing_metadata_; + } + growing_metadata_ = growing_metadata; + if (growing_metadata) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.growing_metadata) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DecisionTreeEnsembleConfig::kTreesFieldNumber; +const int DecisionTreeEnsembleConfig::kTreeWeightsFieldNumber; +const int DecisionTreeEnsembleConfig::kTreeMetadataFieldNumber; +const int DecisionTreeEnsembleConfig::kGrowingMetadataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DecisionTreeEnsembleConfig::DecisionTreeEnsembleConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeEnsembleConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) +} +DecisionTreeEnsembleConfig::DecisionTreeEnsembleConfig(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + trees_(arena), + tree_weights_(arena), + tree_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeEnsembleConfig.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) +} +DecisionTreeEnsembleConfig::DecisionTreeEnsembleConfig(const DecisionTreeEnsembleConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + trees_(from.trees_), + tree_weights_(from.tree_weights_), + tree_metadata_(from.tree_metadata_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_growing_metadata()) { + growing_metadata_ = new ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata(*from.growing_metadata_); + } else { + growing_metadata_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) +} + +void DecisionTreeEnsembleConfig::SharedCtor() { + growing_metadata_ = NULL; +} + +DecisionTreeEnsembleConfig::~DecisionTreeEnsembleConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + SharedDtor(); +} + +void DecisionTreeEnsembleConfig::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete growing_metadata_; +} + +void DecisionTreeEnsembleConfig::ArenaDtor(void* object) { + DecisionTreeEnsembleConfig* _this = reinterpret_cast< DecisionTreeEnsembleConfig* >(object); + (void)_this; +} +void DecisionTreeEnsembleConfig::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DecisionTreeEnsembleConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DecisionTreeEnsembleConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DecisionTreeEnsembleConfig& DecisionTreeEnsembleConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::scc_info_DecisionTreeEnsembleConfig.base); + return *internal_default_instance(); +} + + +void DecisionTreeEnsembleConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + trees_.Clear(); + tree_weights_.Clear(); + tree_metadata_.Clear(); + if (GetArenaNoVirtual() == NULL && growing_metadata_ != NULL) { + delete growing_metadata_; + } + growing_metadata_ = NULL; + _internal_metadata_.Clear(); +} + +bool DecisionTreeEnsembleConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig trees = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_trees())); + } else { + goto handle_unusual; + } + break; + } + + // repeated float tree_weights = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_tree_weights()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 18u, input, this->mutable_tree_weights()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata tree_metadata = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tree_metadata())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata growing_metadata = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_growing_metadata())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + return false; +#undef DO_ +} + +void DecisionTreeEnsembleConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig trees = 1; + for (unsigned int i = 0, + n = static_cast(this->trees_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->trees(static_cast(i)), + output); + } + + // repeated float tree_weights = 2; + if (this->tree_weights_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _tree_weights_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->tree_weights().data(), this->tree_weights_size(), output); + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata tree_metadata = 3; + for (unsigned int i = 0, + n = static_cast(this->tree_metadata_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->tree_metadata(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata growing_metadata = 4; + if (this->has_growing_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_growing_metadata(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) +} + +::google::protobuf::uint8* DecisionTreeEnsembleConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig trees = 1; + for (unsigned int i = 0, + n = static_cast(this->trees_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->trees(static_cast(i)), deterministic, target); + } + + // repeated float tree_weights = 2; + if (this->tree_weights_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _tree_weights_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->tree_weights_, target); + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata tree_metadata = 3; + for (unsigned int i = 0, + n = static_cast(this->tree_metadata_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->tree_metadata(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata growing_metadata = 4; + if (this->has_growing_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_growing_metadata(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + return target; +} + +size_t DecisionTreeEnsembleConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig trees = 1; + { + unsigned int count = static_cast(this->trees_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->trees(static_cast(i))); + } + } + + // repeated float tree_weights = 2; + { + unsigned int count = static_cast(this->tree_weights_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _tree_weights_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata tree_metadata = 3; + { + unsigned int count = static_cast(this->tree_metadata_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tree_metadata(static_cast(i))); + } + } + + // .diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata growing_metadata = 4; + if (this->has_growing_metadata()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *growing_metadata_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DecisionTreeEnsembleConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + GOOGLE_DCHECK_NE(&from, this); + const DecisionTreeEnsembleConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + MergeFrom(*source); + } +} + +void DecisionTreeEnsembleConfig::MergeFrom(const DecisionTreeEnsembleConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + trees_.MergeFrom(from.trees_); + tree_weights_.MergeFrom(from.tree_weights_); + tree_metadata_.MergeFrom(from.tree_metadata_); + if (from.has_growing_metadata()) { + mutable_growing_metadata()->::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata::MergeFrom(from.growing_metadata()); + } +} + +void DecisionTreeEnsembleConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DecisionTreeEnsembleConfig::CopyFrom(const DecisionTreeEnsembleConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DecisionTreeEnsembleConfig::IsInitialized() const { + return true; +} + +void DecisionTreeEnsembleConfig::Swap(DecisionTreeEnsembleConfig* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DecisionTreeEnsembleConfig* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DecisionTreeEnsembleConfig::UnsafeArenaSwap(DecisionTreeEnsembleConfig* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DecisionTreeEnsembleConfig::InternalSwap(DecisionTreeEnsembleConfig* other) { + using std::swap; + CastToBase(&trees_)->InternalSwap(CastToBase(&other->trees_)); + tree_weights_.InternalSwap(&other->tree_weights_); + CastToBase(&tree_metadata_)->InternalSwap(CastToBase(&other->tree_metadata_)); + swap(growing_metadata_, other->growing_metadata_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DecisionTreeEnsembleConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace trees +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::Leaf* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::Vector* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::Vector >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::Vector >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::SparseVector >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::SparseVector >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.h new file mode 100644 index 0000000..c75884b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.pb.h @@ -0,0 +1,4228 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[16]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace trees { +class CategoricalIdBinarySplit; +class CategoricalIdBinarySplitDefaultTypeInternal; +extern CategoricalIdBinarySplitDefaultTypeInternal _CategoricalIdBinarySplit_default_instance_; +class CategoricalIdSetMembershipBinarySplit; +class CategoricalIdSetMembershipBinarySplitDefaultTypeInternal; +extern CategoricalIdSetMembershipBinarySplitDefaultTypeInternal _CategoricalIdSetMembershipBinarySplit_default_instance_; +class DecisionTreeConfig; +class DecisionTreeConfigDefaultTypeInternal; +extern DecisionTreeConfigDefaultTypeInternal _DecisionTreeConfig_default_instance_; +class DecisionTreeEnsembleConfig; +class DecisionTreeEnsembleConfigDefaultTypeInternal; +extern DecisionTreeEnsembleConfigDefaultTypeInternal _DecisionTreeEnsembleConfig_default_instance_; +class DecisionTreeMetadata; +class DecisionTreeMetadataDefaultTypeInternal; +extern DecisionTreeMetadataDefaultTypeInternal _DecisionTreeMetadata_default_instance_; +class DenseFloatBinarySplit; +class DenseFloatBinarySplitDefaultTypeInternal; +extern DenseFloatBinarySplitDefaultTypeInternal _DenseFloatBinarySplit_default_instance_; +class GrowingMetadata; +class GrowingMetadataDefaultTypeInternal; +extern GrowingMetadataDefaultTypeInternal _GrowingMetadata_default_instance_; +class Leaf; +class LeafDefaultTypeInternal; +extern LeafDefaultTypeInternal _Leaf_default_instance_; +class ObliviousCategoricalIdBinarySplit; +class ObliviousCategoricalIdBinarySplitDefaultTypeInternal; +extern ObliviousCategoricalIdBinarySplitDefaultTypeInternal _ObliviousCategoricalIdBinarySplit_default_instance_; +class ObliviousDenseFloatBinarySplit; +class ObliviousDenseFloatBinarySplitDefaultTypeInternal; +extern ObliviousDenseFloatBinarySplitDefaultTypeInternal _ObliviousDenseFloatBinarySplit_default_instance_; +class SparseFloatBinarySplitDefaultLeft; +class SparseFloatBinarySplitDefaultLeftDefaultTypeInternal; +extern SparseFloatBinarySplitDefaultLeftDefaultTypeInternal _SparseFloatBinarySplitDefaultLeft_default_instance_; +class SparseFloatBinarySplitDefaultRight; +class SparseFloatBinarySplitDefaultRightDefaultTypeInternal; +extern SparseFloatBinarySplitDefaultRightDefaultTypeInternal _SparseFloatBinarySplitDefaultRight_default_instance_; +class SparseVector; +class SparseVectorDefaultTypeInternal; +extern SparseVectorDefaultTypeInternal _SparseVector_default_instance_; +class TreeNode; +class TreeNodeDefaultTypeInternal; +extern TreeNodeDefaultTypeInternal _TreeNode_default_instance_; +class TreeNodeMetadata; +class TreeNodeMetadataDefaultTypeInternal; +extern TreeNodeMetadataDefaultTypeInternal _TreeNodeMetadata_default_instance_; +class Vector; +class VectorDefaultTypeInternal; +extern VectorDefaultTypeInternal _Vector_default_instance_; +} // namespace trees +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeEnsembleConfig>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::Leaf* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::Leaf>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::SparseVector>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::TreeNode>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::trees::Vector* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::Vector>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +namespace trees { + +// =================================================================== + +class TreeNode : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.TreeNode) */ { + public: + TreeNode(); + virtual ~TreeNode(); + + TreeNode(const TreeNode& from); + + inline TreeNode& operator=(const TreeNode& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeNode(TreeNode&& from) noexcept + : TreeNode() { + *this = ::std::move(from); + } + + inline TreeNode& operator=(TreeNode&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeNode& default_instance(); + + enum NodeCase { + kLeaf = 1, + kDenseFloatBinarySplit = 2, + kSparseFloatBinarySplitDefaultLeft = 3, + kSparseFloatBinarySplitDefaultRight = 4, + kCategoricalIdBinarySplit = 5, + kCategoricalIdSetMembershipBinarySplit = 6, + kObliviousDenseFloatBinarySplit = 7, + kObliviousCategoricalIdBinarySplit = 8, + NODE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeNode* internal_default_instance() { + return reinterpret_cast( + &_TreeNode_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TreeNode* other); + void Swap(TreeNode* other); + friend void swap(TreeNode& a, TreeNode& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeNode* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeNode* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeNode& from); + void MergeFrom(const TreeNode& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeNode* other); + protected: + explicit TreeNode(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata node_metadata = 777; + bool has_node_metadata() const; + void clear_node_metadata(); + static const int kNodeMetadataFieldNumber = 777; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata& _internal_node_metadata() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata& node_metadata() const; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* release_node_metadata(); + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* mutable_node_metadata(); + void set_allocated_node_metadata(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* node_metadata); + void unsafe_arena_set_allocated_node_metadata( + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* node_metadata); + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* unsafe_arena_release_node_metadata(); + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf leaf = 1; + bool has_leaf() const; + void clear_leaf(); + static const int kLeafFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& _internal_leaf() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& leaf() const; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* release_leaf(); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* mutable_leaf(); + void set_allocated_leaf(::diplomacy::tensorflow::boosted_trees::trees::Leaf* leaf); + void unsafe_arena_set_allocated_leaf( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* leaf); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* unsafe_arena_release_leaf(); + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit dense_float_binary_split = 2; + bool has_dense_float_binary_split() const; + void clear_dense_float_binary_split(); + static const int kDenseFloatBinarySplitFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& _internal_dense_float_binary_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& dense_float_binary_split() const; + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* release_dense_float_binary_split(); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* mutable_dense_float_binary_split(); + void set_allocated_dense_float_binary_split(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* dense_float_binary_split); + void unsafe_arena_set_allocated_dense_float_binary_split( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* dense_float_binary_split); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* unsafe_arena_release_dense_float_binary_split(); + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft sparse_float_binary_split_default_left = 3; + bool has_sparse_float_binary_split_default_left() const; + void clear_sparse_float_binary_split_default_left(); + static const int kSparseFloatBinarySplitDefaultLeftFieldNumber = 3; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft& _internal_sparse_float_binary_split_default_left() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft& sparse_float_binary_split_default_left() const; + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* release_sparse_float_binary_split_default_left(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* mutable_sparse_float_binary_split_default_left(); + void set_allocated_sparse_float_binary_split_default_left(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* sparse_float_binary_split_default_left); + void unsafe_arena_set_allocated_sparse_float_binary_split_default_left( + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* sparse_float_binary_split_default_left); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* unsafe_arena_release_sparse_float_binary_split_default_left(); + + // .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight sparse_float_binary_split_default_right = 4; + bool has_sparse_float_binary_split_default_right() const; + void clear_sparse_float_binary_split_default_right(); + static const int kSparseFloatBinarySplitDefaultRightFieldNumber = 4; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight& _internal_sparse_float_binary_split_default_right() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight& sparse_float_binary_split_default_right() const; + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* release_sparse_float_binary_split_default_right(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* mutable_sparse_float_binary_split_default_right(); + void set_allocated_sparse_float_binary_split_default_right(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* sparse_float_binary_split_default_right); + void unsafe_arena_set_allocated_sparse_float_binary_split_default_right( + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* sparse_float_binary_split_default_right); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* unsafe_arena_release_sparse_float_binary_split_default_right(); + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit categorical_id_binary_split = 5; + bool has_categorical_id_binary_split() const; + void clear_categorical_id_binary_split(); + static const int kCategoricalIdBinarySplitFieldNumber = 5; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit& _internal_categorical_id_binary_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit& categorical_id_binary_split() const; + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* release_categorical_id_binary_split(); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* mutable_categorical_id_binary_split(); + void set_allocated_categorical_id_binary_split(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* categorical_id_binary_split); + void unsafe_arena_set_allocated_categorical_id_binary_split( + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* categorical_id_binary_split); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* unsafe_arena_release_categorical_id_binary_split(); + + // .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit categorical_id_set_membership_binary_split = 6; + bool has_categorical_id_set_membership_binary_split() const; + void clear_categorical_id_set_membership_binary_split(); + static const int kCategoricalIdSetMembershipBinarySplitFieldNumber = 6; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit& _internal_categorical_id_set_membership_binary_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit& categorical_id_set_membership_binary_split() const; + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* release_categorical_id_set_membership_binary_split(); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* mutable_categorical_id_set_membership_binary_split(); + void set_allocated_categorical_id_set_membership_binary_split(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* categorical_id_set_membership_binary_split); + void unsafe_arena_set_allocated_categorical_id_set_membership_binary_split( + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* categorical_id_set_membership_binary_split); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* unsafe_arena_release_categorical_id_set_membership_binary_split(); + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit oblivious_dense_float_binary_split = 7; + bool has_oblivious_dense_float_binary_split() const; + void clear_oblivious_dense_float_binary_split(); + static const int kObliviousDenseFloatBinarySplitFieldNumber = 7; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit& _internal_oblivious_dense_float_binary_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit& oblivious_dense_float_binary_split() const; + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* release_oblivious_dense_float_binary_split(); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* mutable_oblivious_dense_float_binary_split(); + void set_allocated_oblivious_dense_float_binary_split(::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* oblivious_dense_float_binary_split); + void unsafe_arena_set_allocated_oblivious_dense_float_binary_split( + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* oblivious_dense_float_binary_split); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* unsafe_arena_release_oblivious_dense_float_binary_split(); + + // .diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit oblivious_categorical_id_binary_split = 8; + bool has_oblivious_categorical_id_binary_split() const; + void clear_oblivious_categorical_id_binary_split(); + static const int kObliviousCategoricalIdBinarySplitFieldNumber = 8; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit& _internal_oblivious_categorical_id_binary_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit& oblivious_categorical_id_binary_split() const; + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* release_oblivious_categorical_id_binary_split(); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* mutable_oblivious_categorical_id_binary_split(); + void set_allocated_oblivious_categorical_id_binary_split(::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* oblivious_categorical_id_binary_split); + void unsafe_arena_set_allocated_oblivious_categorical_id_binary_split( + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* oblivious_categorical_id_binary_split); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* unsafe_arena_release_oblivious_categorical_id_binary_split(); + + void clear_node(); + NodeCase node_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + private: + void set_has_leaf(); + void set_has_dense_float_binary_split(); + void set_has_sparse_float_binary_split_default_left(); + void set_has_sparse_float_binary_split_default_right(); + void set_has_categorical_id_binary_split(); + void set_has_categorical_id_set_membership_binary_split(); + void set_has_oblivious_dense_float_binary_split(); + void set_has_oblivious_categorical_id_binary_split(); + + inline bool has_node() const; + inline void clear_has_node(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* node_metadata_; + union NodeUnion { + NodeUnion() {} + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* leaf_; + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* dense_float_binary_split_; + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* sparse_float_binary_split_default_left_; + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* sparse_float_binary_split_default_right_; + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* categorical_id_binary_split_; + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* categorical_id_set_membership_binary_split_; + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* oblivious_dense_float_binary_split_; + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* oblivious_categorical_id_binary_split_; + } node_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TreeNodeMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) */ { + public: + TreeNodeMetadata(); + virtual ~TreeNodeMetadata(); + + TreeNodeMetadata(const TreeNodeMetadata& from); + + inline TreeNodeMetadata& operator=(const TreeNodeMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeNodeMetadata(TreeNodeMetadata&& from) noexcept + : TreeNodeMetadata() { + *this = ::std::move(from); + } + + inline TreeNodeMetadata& operator=(TreeNodeMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeNodeMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeNodeMetadata* internal_default_instance() { + return reinterpret_cast( + &_TreeNodeMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(TreeNodeMetadata* other); + void Swap(TreeNodeMetadata* other); + friend void swap(TreeNodeMetadata& a, TreeNodeMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeNodeMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeNodeMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeNodeMetadata& from); + void MergeFrom(const TreeNodeMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeNodeMetadata* other); + protected: + explicit TreeNodeMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf original_oblivious_leaves = 3; + int original_oblivious_leaves_size() const; + void clear_original_oblivious_leaves(); + static const int kOriginalObliviousLeavesFieldNumber = 3; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* mutable_original_oblivious_leaves(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >* + mutable_original_oblivious_leaves(); + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& original_oblivious_leaves(int index) const; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* add_original_oblivious_leaves(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >& + original_oblivious_leaves() const; + + // .diplomacy.tensorflow.boosted_trees.trees.Leaf original_leaf = 2; + bool has_original_leaf() const; + void clear_original_leaf(); + static const int kOriginalLeafFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& _internal_original_leaf() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& original_leaf() const; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* release_original_leaf(); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* mutable_original_leaf(); + void set_allocated_original_leaf(::diplomacy::tensorflow::boosted_trees::trees::Leaf* original_leaf); + void unsafe_arena_set_allocated_original_leaf( + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* original_leaf); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* unsafe_arena_release_original_leaf(); + + // float gain = 1; + void clear_gain(); + static const int kGainFieldNumber = 1; + float gain() const; + void set_gain(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf > original_oblivious_leaves_; + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* original_leaf_; + float gain_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Leaf : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.Leaf) */ { + public: + Leaf(); + virtual ~Leaf(); + + Leaf(const Leaf& from); + + inline Leaf& operator=(const Leaf& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Leaf(Leaf&& from) noexcept + : Leaf() { + *this = ::std::move(from); + } + + inline Leaf& operator=(Leaf&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Leaf& default_instance(); + + enum LeafCase { + kVector = 1, + kSparseVector = 2, + LEAF_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Leaf* internal_default_instance() { + return reinterpret_cast( + &_Leaf_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(Leaf* other); + void Swap(Leaf* other); + friend void swap(Leaf& a, Leaf& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Leaf* New() const final { + return CreateMaybeMessage(NULL); + } + + Leaf* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Leaf& from); + void MergeFrom(const Leaf& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Leaf* other); + protected: + explicit Leaf(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.trees.Vector vector = 1; + bool has_vector() const; + void clear_vector(); + static const int kVectorFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::Vector& _internal_vector() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::Vector& vector() const; + ::diplomacy::tensorflow::boosted_trees::trees::Vector* release_vector(); + ::diplomacy::tensorflow::boosted_trees::trees::Vector* mutable_vector(); + void set_allocated_vector(::diplomacy::tensorflow::boosted_trees::trees::Vector* vector); + void unsafe_arena_set_allocated_vector( + ::diplomacy::tensorflow::boosted_trees::trees::Vector* vector); + ::diplomacy::tensorflow::boosted_trees::trees::Vector* unsafe_arena_release_vector(); + + // .diplomacy.tensorflow.boosted_trees.trees.SparseVector sparse_vector = 2; + bool has_sparse_vector() const; + void clear_sparse_vector(); + static const int kSparseVectorFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::SparseVector& _internal_sparse_vector() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::SparseVector& sparse_vector() const; + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* release_sparse_vector(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* mutable_sparse_vector(); + void set_allocated_sparse_vector(::diplomacy::tensorflow::boosted_trees::trees::SparseVector* sparse_vector); + void unsafe_arena_set_allocated_sparse_vector( + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* sparse_vector); + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* unsafe_arena_release_sparse_vector(); + + void clear_leaf(); + LeafCase leaf_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.Leaf) + private: + void set_has_vector(); + void set_has_sparse_vector(); + + inline bool has_leaf() const; + inline void clear_has_leaf(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union LeafUnion { + LeafUnion() {} + ::diplomacy::tensorflow::boosted_trees::trees::Vector* vector_; + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* sparse_vector_; + } leaf_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Vector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.Vector) */ { + public: + Vector(); + virtual ~Vector(); + + Vector(const Vector& from); + + inline Vector& operator=(const Vector& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Vector(Vector&& from) noexcept + : Vector() { + *this = ::std::move(from); + } + + inline Vector& operator=(Vector&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Vector& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Vector* internal_default_instance() { + return reinterpret_cast( + &_Vector_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(Vector* other); + void Swap(Vector* other); + friend void swap(Vector& a, Vector& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Vector* New() const final { + return CreateMaybeMessage(NULL); + } + + Vector* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Vector& from); + void MergeFrom(const Vector& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Vector* other); + protected: + explicit Vector(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated float value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + float value(int index) const; + void set_value(int index, float value); + void add_value(float value); + const ::google::protobuf::RepeatedField< float >& + value() const; + ::google::protobuf::RepeatedField< float >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.Vector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< float > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SparseVector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.SparseVector) */ { + public: + SparseVector(); + virtual ~SparseVector(); + + SparseVector(const SparseVector& from); + + inline SparseVector& operator=(const SparseVector& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SparseVector(SparseVector&& from) noexcept + : SparseVector() { + *this = ::std::move(from); + } + + inline SparseVector& operator=(SparseVector&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SparseVector& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SparseVector* internal_default_instance() { + return reinterpret_cast( + &_SparseVector_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(SparseVector* other); + void Swap(SparseVector* other); + friend void swap(SparseVector& a, SparseVector& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SparseVector* New() const final { + return CreateMaybeMessage(NULL); + } + + SparseVector* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SparseVector& from); + void MergeFrom(const SparseVector& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SparseVector* other); + protected: + explicit SparseVector(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 index = 1; + int index_size() const; + void clear_index(); + static const int kIndexFieldNumber = 1; + ::google::protobuf::int32 index(int index) const; + void set_index(int index, ::google::protobuf::int32 value); + void add_index(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_index(); + + // repeated float value = 2; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 2; + float value(int index) const; + void set_value(int index, float value); + void add_value(float value); + const ::google::protobuf::RepeatedField< float >& + value() const; + ::google::protobuf::RepeatedField< float >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > index_; + mutable int _index_cached_byte_size_; + ::google::protobuf::RepeatedField< float > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DenseFloatBinarySplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) */ { + public: + DenseFloatBinarySplit(); + virtual ~DenseFloatBinarySplit(); + + DenseFloatBinarySplit(const DenseFloatBinarySplit& from); + + inline DenseFloatBinarySplit& operator=(const DenseFloatBinarySplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DenseFloatBinarySplit(DenseFloatBinarySplit&& from) noexcept + : DenseFloatBinarySplit() { + *this = ::std::move(from); + } + + inline DenseFloatBinarySplit& operator=(DenseFloatBinarySplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DenseFloatBinarySplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DenseFloatBinarySplit* internal_default_instance() { + return reinterpret_cast( + &_DenseFloatBinarySplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(DenseFloatBinarySplit* other); + void Swap(DenseFloatBinarySplit* other); + friend void swap(DenseFloatBinarySplit& a, DenseFloatBinarySplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DenseFloatBinarySplit* New() const final { + return CreateMaybeMessage(NULL); + } + + DenseFloatBinarySplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DenseFloatBinarySplit& from); + void MergeFrom(const DenseFloatBinarySplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DenseFloatBinarySplit* other); + protected: + explicit DenseFloatBinarySplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 feature_column = 1; + void clear_feature_column(); + static const int kFeatureColumnFieldNumber = 1; + ::google::protobuf::int32 feature_column() const; + void set_feature_column(::google::protobuf::int32 value); + + // float threshold = 2; + void clear_threshold(); + static const int kThresholdFieldNumber = 2; + float threshold() const; + void set_threshold(float value); + + // int32 left_id = 3; + void clear_left_id(); + static const int kLeftIdFieldNumber = 3; + ::google::protobuf::int32 left_id() const; + void set_left_id(::google::protobuf::int32 value); + + // int32 right_id = 4; + void clear_right_id(); + static const int kRightIdFieldNumber = 4; + ::google::protobuf::int32 right_id() const; + void set_right_id(::google::protobuf::int32 value); + + // int32 dimension_id = 5; + void clear_dimension_id(); + static const int kDimensionIdFieldNumber = 5; + ::google::protobuf::int32 dimension_id() const; + void set_dimension_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 feature_column_; + float threshold_; + ::google::protobuf::int32 left_id_; + ::google::protobuf::int32 right_id_; + ::google::protobuf::int32 dimension_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SparseFloatBinarySplitDefaultLeft : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) */ { + public: + SparseFloatBinarySplitDefaultLeft(); + virtual ~SparseFloatBinarySplitDefaultLeft(); + + SparseFloatBinarySplitDefaultLeft(const SparseFloatBinarySplitDefaultLeft& from); + + inline SparseFloatBinarySplitDefaultLeft& operator=(const SparseFloatBinarySplitDefaultLeft& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SparseFloatBinarySplitDefaultLeft(SparseFloatBinarySplitDefaultLeft&& from) noexcept + : SparseFloatBinarySplitDefaultLeft() { + *this = ::std::move(from); + } + + inline SparseFloatBinarySplitDefaultLeft& operator=(SparseFloatBinarySplitDefaultLeft&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SparseFloatBinarySplitDefaultLeft& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SparseFloatBinarySplitDefaultLeft* internal_default_instance() { + return reinterpret_cast( + &_SparseFloatBinarySplitDefaultLeft_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(SparseFloatBinarySplitDefaultLeft* other); + void Swap(SparseFloatBinarySplitDefaultLeft* other); + friend void swap(SparseFloatBinarySplitDefaultLeft& a, SparseFloatBinarySplitDefaultLeft& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SparseFloatBinarySplitDefaultLeft* New() const final { + return CreateMaybeMessage(NULL); + } + + SparseFloatBinarySplitDefaultLeft* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SparseFloatBinarySplitDefaultLeft& from); + void MergeFrom(const SparseFloatBinarySplitDefaultLeft& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SparseFloatBinarySplitDefaultLeft* other); + protected: + explicit SparseFloatBinarySplitDefaultLeft(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + bool has_split() const; + void clear_split(); + static const int kSplitFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& _internal_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& split() const; + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* release_split(); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* mutable_split(); + void set_allocated_split(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split); + void unsafe_arena_set_allocated_split( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* unsafe_arena_release_split(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SparseFloatBinarySplitDefaultRight : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) */ { + public: + SparseFloatBinarySplitDefaultRight(); + virtual ~SparseFloatBinarySplitDefaultRight(); + + SparseFloatBinarySplitDefaultRight(const SparseFloatBinarySplitDefaultRight& from); + + inline SparseFloatBinarySplitDefaultRight& operator=(const SparseFloatBinarySplitDefaultRight& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SparseFloatBinarySplitDefaultRight(SparseFloatBinarySplitDefaultRight&& from) noexcept + : SparseFloatBinarySplitDefaultRight() { + *this = ::std::move(from); + } + + inline SparseFloatBinarySplitDefaultRight& operator=(SparseFloatBinarySplitDefaultRight&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SparseFloatBinarySplitDefaultRight& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SparseFloatBinarySplitDefaultRight* internal_default_instance() { + return reinterpret_cast( + &_SparseFloatBinarySplitDefaultRight_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(SparseFloatBinarySplitDefaultRight* other); + void Swap(SparseFloatBinarySplitDefaultRight* other); + friend void swap(SparseFloatBinarySplitDefaultRight& a, SparseFloatBinarySplitDefaultRight& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SparseFloatBinarySplitDefaultRight* New() const final { + return CreateMaybeMessage(NULL); + } + + SparseFloatBinarySplitDefaultRight* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SparseFloatBinarySplitDefaultRight& from); + void MergeFrom(const SparseFloatBinarySplitDefaultRight& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SparseFloatBinarySplitDefaultRight* other); + protected: + explicit SparseFloatBinarySplitDefaultRight(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; + bool has_split() const; + void clear_split(); + static const int kSplitFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& _internal_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& split() const; + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* release_split(); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* mutable_split(); + void set_allocated_split(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split); + void unsafe_arena_set_allocated_split( + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* unsafe_arena_release_split(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CategoricalIdBinarySplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) */ { + public: + CategoricalIdBinarySplit(); + virtual ~CategoricalIdBinarySplit(); + + CategoricalIdBinarySplit(const CategoricalIdBinarySplit& from); + + inline CategoricalIdBinarySplit& operator=(const CategoricalIdBinarySplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CategoricalIdBinarySplit(CategoricalIdBinarySplit&& from) noexcept + : CategoricalIdBinarySplit() { + *this = ::std::move(from); + } + + inline CategoricalIdBinarySplit& operator=(CategoricalIdBinarySplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CategoricalIdBinarySplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CategoricalIdBinarySplit* internal_default_instance() { + return reinterpret_cast( + &_CategoricalIdBinarySplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(CategoricalIdBinarySplit* other); + void Swap(CategoricalIdBinarySplit* other); + friend void swap(CategoricalIdBinarySplit& a, CategoricalIdBinarySplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CategoricalIdBinarySplit* New() const final { + return CreateMaybeMessage(NULL); + } + + CategoricalIdBinarySplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CategoricalIdBinarySplit& from); + void MergeFrom(const CategoricalIdBinarySplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CategoricalIdBinarySplit* other); + protected: + explicit CategoricalIdBinarySplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 feature_id = 2; + void clear_feature_id(); + static const int kFeatureIdFieldNumber = 2; + ::google::protobuf::int64 feature_id() const; + void set_feature_id(::google::protobuf::int64 value); + + // int32 feature_column = 1; + void clear_feature_column(); + static const int kFeatureColumnFieldNumber = 1; + ::google::protobuf::int32 feature_column() const; + void set_feature_column(::google::protobuf::int32 value); + + // int32 left_id = 3; + void clear_left_id(); + static const int kLeftIdFieldNumber = 3; + ::google::protobuf::int32 left_id() const; + void set_left_id(::google::protobuf::int32 value); + + // int32 right_id = 4; + void clear_right_id(); + static const int kRightIdFieldNumber = 4; + ::google::protobuf::int32 right_id() const; + void set_right_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 feature_id_; + ::google::protobuf::int32 feature_column_; + ::google::protobuf::int32 left_id_; + ::google::protobuf::int32 right_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CategoricalIdSetMembershipBinarySplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) */ { + public: + CategoricalIdSetMembershipBinarySplit(); + virtual ~CategoricalIdSetMembershipBinarySplit(); + + CategoricalIdSetMembershipBinarySplit(const CategoricalIdSetMembershipBinarySplit& from); + + inline CategoricalIdSetMembershipBinarySplit& operator=(const CategoricalIdSetMembershipBinarySplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CategoricalIdSetMembershipBinarySplit(CategoricalIdSetMembershipBinarySplit&& from) noexcept + : CategoricalIdSetMembershipBinarySplit() { + *this = ::std::move(from); + } + + inline CategoricalIdSetMembershipBinarySplit& operator=(CategoricalIdSetMembershipBinarySplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CategoricalIdSetMembershipBinarySplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CategoricalIdSetMembershipBinarySplit* internal_default_instance() { + return reinterpret_cast( + &_CategoricalIdSetMembershipBinarySplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void UnsafeArenaSwap(CategoricalIdSetMembershipBinarySplit* other); + void Swap(CategoricalIdSetMembershipBinarySplit* other); + friend void swap(CategoricalIdSetMembershipBinarySplit& a, CategoricalIdSetMembershipBinarySplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CategoricalIdSetMembershipBinarySplit* New() const final { + return CreateMaybeMessage(NULL); + } + + CategoricalIdSetMembershipBinarySplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CategoricalIdSetMembershipBinarySplit& from); + void MergeFrom(const CategoricalIdSetMembershipBinarySplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CategoricalIdSetMembershipBinarySplit* other); + protected: + explicit CategoricalIdSetMembershipBinarySplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 feature_ids = 2; + int feature_ids_size() const; + void clear_feature_ids(); + static const int kFeatureIdsFieldNumber = 2; + ::google::protobuf::int64 feature_ids(int index) const; + void set_feature_ids(int index, ::google::protobuf::int64 value); + void add_feature_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + feature_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_feature_ids(); + + // int32 feature_column = 1; + void clear_feature_column(); + static const int kFeatureColumnFieldNumber = 1; + ::google::protobuf::int32 feature_column() const; + void set_feature_column(::google::protobuf::int32 value); + + // int32 left_id = 3; + void clear_left_id(); + static const int kLeftIdFieldNumber = 3; + ::google::protobuf::int32 left_id() const; + void set_left_id(::google::protobuf::int32 value); + + // int32 right_id = 4; + void clear_right_id(); + static const int kRightIdFieldNumber = 4; + ::google::protobuf::int32 right_id() const; + void set_right_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > feature_ids_; + mutable int _feature_ids_cached_byte_size_; + ::google::protobuf::int32 feature_column_; + ::google::protobuf::int32 left_id_; + ::google::protobuf::int32 right_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ObliviousDenseFloatBinarySplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) */ { + public: + ObliviousDenseFloatBinarySplit(); + virtual ~ObliviousDenseFloatBinarySplit(); + + ObliviousDenseFloatBinarySplit(const ObliviousDenseFloatBinarySplit& from); + + inline ObliviousDenseFloatBinarySplit& operator=(const ObliviousDenseFloatBinarySplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ObliviousDenseFloatBinarySplit(ObliviousDenseFloatBinarySplit&& from) noexcept + : ObliviousDenseFloatBinarySplit() { + *this = ::std::move(from); + } + + inline ObliviousDenseFloatBinarySplit& operator=(ObliviousDenseFloatBinarySplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ObliviousDenseFloatBinarySplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ObliviousDenseFloatBinarySplit* internal_default_instance() { + return reinterpret_cast( + &_ObliviousDenseFloatBinarySplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void UnsafeArenaSwap(ObliviousDenseFloatBinarySplit* other); + void Swap(ObliviousDenseFloatBinarySplit* other); + friend void swap(ObliviousDenseFloatBinarySplit& a, ObliviousDenseFloatBinarySplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ObliviousDenseFloatBinarySplit* New() const final { + return CreateMaybeMessage(NULL); + } + + ObliviousDenseFloatBinarySplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ObliviousDenseFloatBinarySplit& from); + void MergeFrom(const ObliviousDenseFloatBinarySplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ObliviousDenseFloatBinarySplit* other); + protected: + explicit ObliviousDenseFloatBinarySplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 feature_column = 1; + void clear_feature_column(); + static const int kFeatureColumnFieldNumber = 1; + ::google::protobuf::int32 feature_column() const; + void set_feature_column(::google::protobuf::int32 value); + + // float threshold = 2; + void clear_threshold(); + static const int kThresholdFieldNumber = 2; + float threshold() const; + void set_threshold(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 feature_column_; + float threshold_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ObliviousCategoricalIdBinarySplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) */ { + public: + ObliviousCategoricalIdBinarySplit(); + virtual ~ObliviousCategoricalIdBinarySplit(); + + ObliviousCategoricalIdBinarySplit(const ObliviousCategoricalIdBinarySplit& from); + + inline ObliviousCategoricalIdBinarySplit& operator=(const ObliviousCategoricalIdBinarySplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ObliviousCategoricalIdBinarySplit(ObliviousCategoricalIdBinarySplit&& from) noexcept + : ObliviousCategoricalIdBinarySplit() { + *this = ::std::move(from); + } + + inline ObliviousCategoricalIdBinarySplit& operator=(ObliviousCategoricalIdBinarySplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ObliviousCategoricalIdBinarySplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ObliviousCategoricalIdBinarySplit* internal_default_instance() { + return reinterpret_cast( + &_ObliviousCategoricalIdBinarySplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void UnsafeArenaSwap(ObliviousCategoricalIdBinarySplit* other); + void Swap(ObliviousCategoricalIdBinarySplit* other); + friend void swap(ObliviousCategoricalIdBinarySplit& a, ObliviousCategoricalIdBinarySplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ObliviousCategoricalIdBinarySplit* New() const final { + return CreateMaybeMessage(NULL); + } + + ObliviousCategoricalIdBinarySplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ObliviousCategoricalIdBinarySplit& from); + void MergeFrom(const ObliviousCategoricalIdBinarySplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ObliviousCategoricalIdBinarySplit* other); + protected: + explicit ObliviousCategoricalIdBinarySplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 feature_id = 2; + void clear_feature_id(); + static const int kFeatureIdFieldNumber = 2; + ::google::protobuf::int64 feature_id() const; + void set_feature_id(::google::protobuf::int64 value); + + // int32 feature_column = 1; + void clear_feature_column(); + static const int kFeatureColumnFieldNumber = 1; + ::google::protobuf::int32 feature_column() const; + void set_feature_column(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 feature_id_; + ::google::protobuf::int32 feature_column_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DecisionTreeConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) */ { + public: + DecisionTreeConfig(); + virtual ~DecisionTreeConfig(); + + DecisionTreeConfig(const DecisionTreeConfig& from); + + inline DecisionTreeConfig& operator=(const DecisionTreeConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DecisionTreeConfig(DecisionTreeConfig&& from) noexcept + : DecisionTreeConfig() { + *this = ::std::move(from); + } + + inline DecisionTreeConfig& operator=(DecisionTreeConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DecisionTreeConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DecisionTreeConfig* internal_default_instance() { + return reinterpret_cast( + &_DecisionTreeConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void UnsafeArenaSwap(DecisionTreeConfig* other); + void Swap(DecisionTreeConfig* other); + friend void swap(DecisionTreeConfig& a, DecisionTreeConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DecisionTreeConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + DecisionTreeConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DecisionTreeConfig& from); + void MergeFrom(const DecisionTreeConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DecisionTreeConfig* other); + protected: + explicit DecisionTreeConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.boosted_trees.trees.TreeNode nodes = 1; + int nodes_size() const; + void clear_nodes(); + static const int kNodesFieldNumber = 1; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* mutable_nodes(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode >* + mutable_nodes(); + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& nodes(int index) const; + ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* add_nodes(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode >& + nodes() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode > nodes_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DecisionTreeMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) */ { + public: + DecisionTreeMetadata(); + virtual ~DecisionTreeMetadata(); + + DecisionTreeMetadata(const DecisionTreeMetadata& from); + + inline DecisionTreeMetadata& operator=(const DecisionTreeMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DecisionTreeMetadata(DecisionTreeMetadata&& from) noexcept + : DecisionTreeMetadata() { + *this = ::std::move(from); + } + + inline DecisionTreeMetadata& operator=(DecisionTreeMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DecisionTreeMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DecisionTreeMetadata* internal_default_instance() { + return reinterpret_cast( + &_DecisionTreeMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void UnsafeArenaSwap(DecisionTreeMetadata* other); + void Swap(DecisionTreeMetadata* other); + friend void swap(DecisionTreeMetadata& a, DecisionTreeMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DecisionTreeMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + DecisionTreeMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DecisionTreeMetadata& from); + void MergeFrom(const DecisionTreeMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DecisionTreeMetadata* other); + protected: + explicit DecisionTreeMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 num_tree_weight_updates = 1; + void clear_num_tree_weight_updates(); + static const int kNumTreeWeightUpdatesFieldNumber = 1; + ::google::protobuf::int32 num_tree_weight_updates() const; + void set_num_tree_weight_updates(::google::protobuf::int32 value); + + // int32 num_layers_grown = 2; + void clear_num_layers_grown(); + static const int kNumLayersGrownFieldNumber = 2; + ::google::protobuf::int32 num_layers_grown() const; + void set_num_layers_grown(::google::protobuf::int32 value); + + // bool is_finalized = 3; + void clear_is_finalized(); + static const int kIsFinalizedFieldNumber = 3; + bool is_finalized() const; + void set_is_finalized(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 num_tree_weight_updates_; + ::google::protobuf::int32 num_layers_grown_; + bool is_finalized_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GrowingMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) */ { + public: + GrowingMetadata(); + virtual ~GrowingMetadata(); + + GrowingMetadata(const GrowingMetadata& from); + + inline GrowingMetadata& operator=(const GrowingMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GrowingMetadata(GrowingMetadata&& from) noexcept + : GrowingMetadata() { + *this = ::std::move(from); + } + + inline GrowingMetadata& operator=(GrowingMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GrowingMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GrowingMetadata* internal_default_instance() { + return reinterpret_cast( + &_GrowingMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + void UnsafeArenaSwap(GrowingMetadata* other); + void Swap(GrowingMetadata* other); + friend void swap(GrowingMetadata& a, GrowingMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GrowingMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + GrowingMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GrowingMetadata& from); + void MergeFrom(const GrowingMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GrowingMetadata* other); + protected: + explicit GrowingMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 used_handler_ids = 3; + int used_handler_ids_size() const; + void clear_used_handler_ids(); + static const int kUsedHandlerIdsFieldNumber = 3; + ::google::protobuf::int64 used_handler_ids(int index) const; + void set_used_handler_ids(int index, ::google::protobuf::int64 value); + void add_used_handler_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + used_handler_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_used_handler_ids(); + + // int64 num_trees_attempted = 1; + void clear_num_trees_attempted(); + static const int kNumTreesAttemptedFieldNumber = 1; + ::google::protobuf::int64 num_trees_attempted() const; + void set_num_trees_attempted(::google::protobuf::int64 value); + + // int64 num_layers_attempted = 2; + void clear_num_layers_attempted(); + static const int kNumLayersAttemptedFieldNumber = 2; + ::google::protobuf::int64 num_layers_attempted() const; + void set_num_layers_attempted(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > used_handler_ids_; + mutable int _used_handler_ids_cached_byte_size_; + ::google::protobuf::int64 num_trees_attempted_; + ::google::protobuf::int64 num_layers_attempted_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DecisionTreeEnsembleConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) */ { + public: + DecisionTreeEnsembleConfig(); + virtual ~DecisionTreeEnsembleConfig(); + + DecisionTreeEnsembleConfig(const DecisionTreeEnsembleConfig& from); + + inline DecisionTreeEnsembleConfig& operator=(const DecisionTreeEnsembleConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DecisionTreeEnsembleConfig(DecisionTreeEnsembleConfig&& from) noexcept + : DecisionTreeEnsembleConfig() { + *this = ::std::move(from); + } + + inline DecisionTreeEnsembleConfig& operator=(DecisionTreeEnsembleConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DecisionTreeEnsembleConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DecisionTreeEnsembleConfig* internal_default_instance() { + return reinterpret_cast( + &_DecisionTreeEnsembleConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void UnsafeArenaSwap(DecisionTreeEnsembleConfig* other); + void Swap(DecisionTreeEnsembleConfig* other); + friend void swap(DecisionTreeEnsembleConfig& a, DecisionTreeEnsembleConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DecisionTreeEnsembleConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + DecisionTreeEnsembleConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DecisionTreeEnsembleConfig& from); + void MergeFrom(const DecisionTreeEnsembleConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DecisionTreeEnsembleConfig* other); + protected: + explicit DecisionTreeEnsembleConfig(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig trees = 1; + int trees_size() const; + void clear_trees(); + static const int kTreesFieldNumber = 1; + ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig* mutable_trees(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig >* + mutable_trees(); + const ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig& trees(int index) const; + ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig* add_trees(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig >& + trees() const; + + // repeated float tree_weights = 2; + int tree_weights_size() const; + void clear_tree_weights(); + static const int kTreeWeightsFieldNumber = 2; + float tree_weights(int index) const; + void set_tree_weights(int index, float value); + void add_tree_weights(float value); + const ::google::protobuf::RepeatedField< float >& + tree_weights() const; + ::google::protobuf::RepeatedField< float >* + mutable_tree_weights(); + + // repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata tree_metadata = 3; + int tree_metadata_size() const; + void clear_tree_metadata(); + static const int kTreeMetadataFieldNumber = 3; + ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata* mutable_tree_metadata(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata >* + mutable_tree_metadata(); + const ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata& tree_metadata(int index) const; + ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata* add_tree_metadata(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata >& + tree_metadata() const; + + // .diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata growing_metadata = 4; + bool has_growing_metadata() const; + void clear_growing_metadata(); + static const int kGrowingMetadataFieldNumber = 4; + private: + const ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata& _internal_growing_metadata() const; + public: + const ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata& growing_metadata() const; + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* release_growing_metadata(); + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* mutable_growing_metadata(); + void set_allocated_growing_metadata(::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* growing_metadata); + void unsafe_arena_set_allocated_growing_metadata( + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* growing_metadata); + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* unsafe_arena_release_growing_metadata(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig > trees_; + ::google::protobuf::RepeatedField< float > tree_weights_; + mutable int _tree_weights_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata > tree_metadata_; + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* growing_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TreeNode + +// .diplomacy.tensorflow.boosted_trees.trees.Leaf leaf = 1; +inline bool TreeNode::has_leaf() const { + return node_case() == kLeaf; +} +inline void TreeNode::set_has_leaf() { + _oneof_case_[0] = kLeaf; +} +inline void TreeNode::clear_leaf() { + if (has_leaf()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.leaf_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& TreeNode::_internal_leaf() const { + return *node_.leaf_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNode::release_leaf() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.leaf) + if (has_leaf()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = node_.leaf_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.leaf_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& TreeNode::leaf() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.leaf) + return has_leaf() + ? *node_.leaf_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::Leaf*>(&::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNode::unsafe_arena_release_leaf() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.leaf) + if (has_leaf()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = node_.leaf_; + node_.leaf_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_leaf(::diplomacy::tensorflow::boosted_trees::trees::Leaf* leaf) { + clear_node(); + if (leaf) { + set_has_leaf(); + node_.leaf_ = leaf; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.leaf) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNode::mutable_leaf() { + if (!has_leaf()) { + clear_node(); + set_has_leaf(); + node_.leaf_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.leaf) + return node_.leaf_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit dense_float_binary_split = 2; +inline bool TreeNode::has_dense_float_binary_split() const { + return node_case() == kDenseFloatBinarySplit; +} +inline void TreeNode::set_has_dense_float_binary_split() { + _oneof_case_[0] = kDenseFloatBinarySplit; +} +inline void TreeNode::clear_dense_float_binary_split() { + if (has_dense_float_binary_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.dense_float_binary_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& TreeNode::_internal_dense_float_binary_split() const { + return *node_.dense_float_binary_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* TreeNode::release_dense_float_binary_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.dense_float_binary_split) + if (has_dense_float_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* temp = node_.dense_float_binary_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.dense_float_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& TreeNode::dense_float_binary_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.dense_float_binary_split) + return has_dense_float_binary_split() + ? *node_.dense_float_binary_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit*>(&::diplomacy::tensorflow::boosted_trees::trees::_DenseFloatBinarySplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* TreeNode::unsafe_arena_release_dense_float_binary_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.dense_float_binary_split) + if (has_dense_float_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* temp = node_.dense_float_binary_split_; + node_.dense_float_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_dense_float_binary_split(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* dense_float_binary_split) { + clear_node(); + if (dense_float_binary_split) { + set_has_dense_float_binary_split(); + node_.dense_float_binary_split_ = dense_float_binary_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.dense_float_binary_split) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* TreeNode::mutable_dense_float_binary_split() { + if (!has_dense_float_binary_split()) { + clear_node(); + set_has_dense_float_binary_split(); + node_.dense_float_binary_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.dense_float_binary_split) + return node_.dense_float_binary_split_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft sparse_float_binary_split_default_left = 3; +inline bool TreeNode::has_sparse_float_binary_split_default_left() const { + return node_case() == kSparseFloatBinarySplitDefaultLeft; +} +inline void TreeNode::set_has_sparse_float_binary_split_default_left() { + _oneof_case_[0] = kSparseFloatBinarySplitDefaultLeft; +} +inline void TreeNode::clear_sparse_float_binary_split_default_left() { + if (has_sparse_float_binary_split_default_left()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.sparse_float_binary_split_default_left_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft& TreeNode::_internal_sparse_float_binary_split_default_left() const { + return *node_.sparse_float_binary_split_default_left_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* TreeNode::release_sparse_float_binary_split_default_left() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_left) + if (has_sparse_float_binary_split_default_left()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* temp = node_.sparse_float_binary_split_default_left_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.sparse_float_binary_split_default_left_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft& TreeNode::sparse_float_binary_split_default_left() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_left) + return has_sparse_float_binary_split_default_left() + ? *node_.sparse_float_binary_split_default_left_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft*>(&::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultLeft_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* TreeNode::unsafe_arena_release_sparse_float_binary_split_default_left() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_left) + if (has_sparse_float_binary_split_default_left()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* temp = node_.sparse_float_binary_split_default_left_; + node_.sparse_float_binary_split_default_left_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_sparse_float_binary_split_default_left(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* sparse_float_binary_split_default_left) { + clear_node(); + if (sparse_float_binary_split_default_left) { + set_has_sparse_float_binary_split_default_left(); + node_.sparse_float_binary_split_default_left_ = sparse_float_binary_split_default_left; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_left) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft* TreeNode::mutable_sparse_float_binary_split_default_left() { + if (!has_sparse_float_binary_split_default_left()) { + clear_node(); + set_has_sparse_float_binary_split_default_left(); + node_.sparse_float_binary_split_default_left_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultLeft >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_left) + return node_.sparse_float_binary_split_default_left_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight sparse_float_binary_split_default_right = 4; +inline bool TreeNode::has_sparse_float_binary_split_default_right() const { + return node_case() == kSparseFloatBinarySplitDefaultRight; +} +inline void TreeNode::set_has_sparse_float_binary_split_default_right() { + _oneof_case_[0] = kSparseFloatBinarySplitDefaultRight; +} +inline void TreeNode::clear_sparse_float_binary_split_default_right() { + if (has_sparse_float_binary_split_default_right()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.sparse_float_binary_split_default_right_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight& TreeNode::_internal_sparse_float_binary_split_default_right() const { + return *node_.sparse_float_binary_split_default_right_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* TreeNode::release_sparse_float_binary_split_default_right() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_right) + if (has_sparse_float_binary_split_default_right()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* temp = node_.sparse_float_binary_split_default_right_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.sparse_float_binary_split_default_right_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight& TreeNode::sparse_float_binary_split_default_right() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_right) + return has_sparse_float_binary_split_default_right() + ? *node_.sparse_float_binary_split_default_right_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight*>(&::diplomacy::tensorflow::boosted_trees::trees::_SparseFloatBinarySplitDefaultRight_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* TreeNode::unsafe_arena_release_sparse_float_binary_split_default_right() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_right) + if (has_sparse_float_binary_split_default_right()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* temp = node_.sparse_float_binary_split_default_right_; + node_.sparse_float_binary_split_default_right_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_sparse_float_binary_split_default_right(::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* sparse_float_binary_split_default_right) { + clear_node(); + if (sparse_float_binary_split_default_right) { + set_has_sparse_float_binary_split_default_right(); + node_.sparse_float_binary_split_default_right_ = sparse_float_binary_split_default_right; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_right) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight* TreeNode::mutable_sparse_float_binary_split_default_right() { + if (!has_sparse_float_binary_split_default_right()) { + clear_node(); + set_has_sparse_float_binary_split_default_right(); + node_.sparse_float_binary_split_default_right_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::SparseFloatBinarySplitDefaultRight >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_right) + return node_.sparse_float_binary_split_default_right_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit categorical_id_binary_split = 5; +inline bool TreeNode::has_categorical_id_binary_split() const { + return node_case() == kCategoricalIdBinarySplit; +} +inline void TreeNode::set_has_categorical_id_binary_split() { + _oneof_case_[0] = kCategoricalIdBinarySplit; +} +inline void TreeNode::clear_categorical_id_binary_split() { + if (has_categorical_id_binary_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.categorical_id_binary_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit& TreeNode::_internal_categorical_id_binary_split() const { + return *node_.categorical_id_binary_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* TreeNode::release_categorical_id_binary_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_binary_split) + if (has_categorical_id_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* temp = node_.categorical_id_binary_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.categorical_id_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit& TreeNode::categorical_id_binary_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_binary_split) + return has_categorical_id_binary_split() + ? *node_.categorical_id_binary_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit*>(&::diplomacy::tensorflow::boosted_trees::trees::_CategoricalIdBinarySplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* TreeNode::unsafe_arena_release_categorical_id_binary_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_binary_split) + if (has_categorical_id_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* temp = node_.categorical_id_binary_split_; + node_.categorical_id_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_categorical_id_binary_split(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* categorical_id_binary_split) { + clear_node(); + if (categorical_id_binary_split) { + set_has_categorical_id_binary_split(); + node_.categorical_id_binary_split_ = categorical_id_binary_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_binary_split) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit* TreeNode::mutable_categorical_id_binary_split() { + if (!has_categorical_id_binary_split()) { + clear_node(); + set_has_categorical_id_binary_split(); + node_.categorical_id_binary_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdBinarySplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_binary_split) + return node_.categorical_id_binary_split_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit categorical_id_set_membership_binary_split = 6; +inline bool TreeNode::has_categorical_id_set_membership_binary_split() const { + return node_case() == kCategoricalIdSetMembershipBinarySplit; +} +inline void TreeNode::set_has_categorical_id_set_membership_binary_split() { + _oneof_case_[0] = kCategoricalIdSetMembershipBinarySplit; +} +inline void TreeNode::clear_categorical_id_set_membership_binary_split() { + if (has_categorical_id_set_membership_binary_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.categorical_id_set_membership_binary_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit& TreeNode::_internal_categorical_id_set_membership_binary_split() const { + return *node_.categorical_id_set_membership_binary_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* TreeNode::release_categorical_id_set_membership_binary_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_set_membership_binary_split) + if (has_categorical_id_set_membership_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* temp = node_.categorical_id_set_membership_binary_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.categorical_id_set_membership_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit& TreeNode::categorical_id_set_membership_binary_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_set_membership_binary_split) + return has_categorical_id_set_membership_binary_split() + ? *node_.categorical_id_set_membership_binary_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit*>(&::diplomacy::tensorflow::boosted_trees::trees::_CategoricalIdSetMembershipBinarySplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* TreeNode::unsafe_arena_release_categorical_id_set_membership_binary_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_set_membership_binary_split) + if (has_categorical_id_set_membership_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* temp = node_.categorical_id_set_membership_binary_split_; + node_.categorical_id_set_membership_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_categorical_id_set_membership_binary_split(::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* categorical_id_set_membership_binary_split) { + clear_node(); + if (categorical_id_set_membership_binary_split) { + set_has_categorical_id_set_membership_binary_split(); + node_.categorical_id_set_membership_binary_split_ = categorical_id_set_membership_binary_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_set_membership_binary_split) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit* TreeNode::mutable_categorical_id_set_membership_binary_split() { + if (!has_categorical_id_set_membership_binary_split()) { + clear_node(); + set_has_categorical_id_set_membership_binary_split(); + node_.categorical_id_set_membership_binary_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::CategoricalIdSetMembershipBinarySplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_set_membership_binary_split) + return node_.categorical_id_set_membership_binary_split_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit oblivious_dense_float_binary_split = 7; +inline bool TreeNode::has_oblivious_dense_float_binary_split() const { + return node_case() == kObliviousDenseFloatBinarySplit; +} +inline void TreeNode::set_has_oblivious_dense_float_binary_split() { + _oneof_case_[0] = kObliviousDenseFloatBinarySplit; +} +inline void TreeNode::clear_oblivious_dense_float_binary_split() { + if (has_oblivious_dense_float_binary_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.oblivious_dense_float_binary_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit& TreeNode::_internal_oblivious_dense_float_binary_split() const { + return *node_.oblivious_dense_float_binary_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* TreeNode::release_oblivious_dense_float_binary_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_dense_float_binary_split) + if (has_oblivious_dense_float_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* temp = node_.oblivious_dense_float_binary_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.oblivious_dense_float_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit& TreeNode::oblivious_dense_float_binary_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_dense_float_binary_split) + return has_oblivious_dense_float_binary_split() + ? *node_.oblivious_dense_float_binary_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit*>(&::diplomacy::tensorflow::boosted_trees::trees::_ObliviousDenseFloatBinarySplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* TreeNode::unsafe_arena_release_oblivious_dense_float_binary_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_dense_float_binary_split) + if (has_oblivious_dense_float_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* temp = node_.oblivious_dense_float_binary_split_; + node_.oblivious_dense_float_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_oblivious_dense_float_binary_split(::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* oblivious_dense_float_binary_split) { + clear_node(); + if (oblivious_dense_float_binary_split) { + set_has_oblivious_dense_float_binary_split(); + node_.oblivious_dense_float_binary_split_ = oblivious_dense_float_binary_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_dense_float_binary_split) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit* TreeNode::mutable_oblivious_dense_float_binary_split() { + if (!has_oblivious_dense_float_binary_split()) { + clear_node(); + set_has_oblivious_dense_float_binary_split(); + node_.oblivious_dense_float_binary_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousDenseFloatBinarySplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_dense_float_binary_split) + return node_.oblivious_dense_float_binary_split_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit oblivious_categorical_id_binary_split = 8; +inline bool TreeNode::has_oblivious_categorical_id_binary_split() const { + return node_case() == kObliviousCategoricalIdBinarySplit; +} +inline void TreeNode::set_has_oblivious_categorical_id_binary_split() { + _oneof_case_[0] = kObliviousCategoricalIdBinarySplit; +} +inline void TreeNode::clear_oblivious_categorical_id_binary_split() { + if (has_oblivious_categorical_id_binary_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.oblivious_categorical_id_binary_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit& TreeNode::_internal_oblivious_categorical_id_binary_split() const { + return *node_.oblivious_categorical_id_binary_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* TreeNode::release_oblivious_categorical_id_binary_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_categorical_id_binary_split) + if (has_oblivious_categorical_id_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* temp = node_.oblivious_categorical_id_binary_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.oblivious_categorical_id_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit& TreeNode::oblivious_categorical_id_binary_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_categorical_id_binary_split) + return has_oblivious_categorical_id_binary_split() + ? *node_.oblivious_categorical_id_binary_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit*>(&::diplomacy::tensorflow::boosted_trees::trees::_ObliviousCategoricalIdBinarySplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* TreeNode::unsafe_arena_release_oblivious_categorical_id_binary_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_categorical_id_binary_split) + if (has_oblivious_categorical_id_binary_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* temp = node_.oblivious_categorical_id_binary_split_; + node_.oblivious_categorical_id_binary_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_oblivious_categorical_id_binary_split(::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* oblivious_categorical_id_binary_split) { + clear_node(); + if (oblivious_categorical_id_binary_split) { + set_has_oblivious_categorical_id_binary_split(); + node_.oblivious_categorical_id_binary_split_ = oblivious_categorical_id_binary_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_categorical_id_binary_split) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit* TreeNode::mutable_oblivious_categorical_id_binary_split() { + if (!has_oblivious_categorical_id_binary_split()) { + clear_node(); + set_has_oblivious_categorical_id_binary_split(); + node_.oblivious_categorical_id_binary_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::ObliviousCategoricalIdBinarySplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_categorical_id_binary_split) + return node_.oblivious_categorical_id_binary_split_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata node_metadata = 777; +inline bool TreeNode::has_node_metadata() const { + return this != internal_default_instance() && node_metadata_ != NULL; +} +inline void TreeNode::clear_node_metadata() { + if (GetArenaNoVirtual() == NULL && node_metadata_ != NULL) { + delete node_metadata_; + } + node_metadata_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata& TreeNode::_internal_node_metadata() const { + return *node_metadata_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata& TreeNode::node_metadata() const { + const ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* p = node_metadata_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNode.node_metadata) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_TreeNodeMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* TreeNode::release_node_metadata() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.node_metadata) + + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* temp = node_metadata_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* TreeNode::unsafe_arena_release_node_metadata() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNode.node_metadata) + + ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* temp = node_metadata_; + node_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* TreeNode::mutable_node_metadata() { + + if (node_metadata_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata>(GetArenaNoVirtual()); + node_metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNode.node_metadata) + return node_metadata_; +} +inline void TreeNode::set_allocated_node_metadata(::diplomacy::tensorflow::boosted_trees::trees::TreeNodeMetadata* node_metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete node_metadata_; + } + if (node_metadata) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(node_metadata); + if (message_arena != submessage_arena) { + node_metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, node_metadata, submessage_arena); + } + + } else { + + } + node_metadata_ = node_metadata; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNode.node_metadata) +} + +inline bool TreeNode::has_node() const { + return node_case() != NODE_NOT_SET; +} +inline void TreeNode::clear_has_node() { + _oneof_case_[0] = NODE_NOT_SET; +} +inline TreeNode::NodeCase TreeNode::node_case() const { + return TreeNode::NodeCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// TreeNodeMetadata + +// float gain = 1; +inline void TreeNodeMetadata::clear_gain() { + gain_ = 0; +} +inline float TreeNodeMetadata::gain() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.gain) + return gain_; +} +inline void TreeNodeMetadata::set_gain(float value) { + + gain_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.gain) +} + +// .diplomacy.tensorflow.boosted_trees.trees.Leaf original_leaf = 2; +inline bool TreeNodeMetadata::has_original_leaf() const { + return this != internal_default_instance() && original_leaf_ != NULL; +} +inline void TreeNodeMetadata::clear_original_leaf() { + if (GetArenaNoVirtual() == NULL && original_leaf_ != NULL) { + delete original_leaf_; + } + original_leaf_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& TreeNodeMetadata::_internal_original_leaf() const { + return *original_leaf_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& TreeNodeMetadata::original_leaf() const { + const ::diplomacy::tensorflow::boosted_trees::trees::Leaf* p = original_leaf_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_leaf) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_Leaf_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNodeMetadata::release_original_leaf() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_leaf) + + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = original_leaf_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + original_leaf_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNodeMetadata::unsafe_arena_release_original_leaf() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_leaf) + + ::diplomacy::tensorflow::boosted_trees::trees::Leaf* temp = original_leaf_; + original_leaf_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNodeMetadata::mutable_original_leaf() { + + if (original_leaf_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::Leaf>(GetArenaNoVirtual()); + original_leaf_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_leaf) + return original_leaf_; +} +inline void TreeNodeMetadata::set_allocated_original_leaf(::diplomacy::tensorflow::boosted_trees::trees::Leaf* original_leaf) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete original_leaf_; + } + if (original_leaf) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(original_leaf); + if (message_arena != submessage_arena) { + original_leaf = ::google::protobuf::internal::GetOwnedMessage( + message_arena, original_leaf, submessage_arena); + } + + } else { + + } + original_leaf_ = original_leaf; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_leaf) +} + +// repeated .diplomacy.tensorflow.boosted_trees.trees.Leaf original_oblivious_leaves = 3; +inline int TreeNodeMetadata::original_oblivious_leaves_size() const { + return original_oblivious_leaves_.size(); +} +inline void TreeNodeMetadata::clear_original_oblivious_leaves() { + original_oblivious_leaves_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNodeMetadata::mutable_original_oblivious_leaves(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_oblivious_leaves) + return original_oblivious_leaves_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >* +TreeNodeMetadata::mutable_original_oblivious_leaves() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_oblivious_leaves) + return &original_oblivious_leaves_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Leaf& TreeNodeMetadata::original_oblivious_leaves(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_oblivious_leaves) + return original_oblivious_leaves_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Leaf* TreeNodeMetadata::add_original_oblivious_leaves() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_oblivious_leaves) + return original_oblivious_leaves_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::Leaf >& +TreeNodeMetadata::original_oblivious_leaves() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_oblivious_leaves) + return original_oblivious_leaves_; +} + +// ------------------------------------------------------------------- + +// Leaf + +// .diplomacy.tensorflow.boosted_trees.trees.Vector vector = 1; +inline bool Leaf::has_vector() const { + return leaf_case() == kVector; +} +inline void Leaf::set_has_vector() { + _oneof_case_[0] = kVector; +} +inline void Leaf::clear_vector() { + if (has_vector()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.vector_; + } + clear_has_leaf(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Vector& Leaf::_internal_vector() const { + return *leaf_.vector_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Vector* Leaf::release_vector() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.Leaf.vector) + if (has_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::trees::Vector* temp = leaf_.vector_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_.vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::Vector& Leaf::vector() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.Leaf.vector) + return has_vector() + ? *leaf_.vector_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::Vector*>(&::diplomacy::tensorflow::boosted_trees::trees::_Vector_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Vector* Leaf::unsafe_arena_release_vector() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.Leaf.vector) + if (has_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::trees::Vector* temp = leaf_.vector_; + leaf_.vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Leaf::unsafe_arena_set_allocated_vector(::diplomacy::tensorflow::boosted_trees::trees::Vector* vector) { + clear_leaf(); + if (vector) { + set_has_vector(); + leaf_.vector_ = vector; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.Leaf.vector) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::Vector* Leaf::mutable_vector() { + if (!has_vector()) { + clear_leaf(); + set_has_vector(); + leaf_.vector_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::Vector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.Leaf.vector) + return leaf_.vector_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.SparseVector sparse_vector = 2; +inline bool Leaf::has_sparse_vector() const { + return leaf_case() == kSparseVector; +} +inline void Leaf::set_has_sparse_vector() { + _oneof_case_[0] = kSparseVector; +} +inline void Leaf::clear_sparse_vector() { + if (has_sparse_vector()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.sparse_vector_; + } + clear_has_leaf(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::SparseVector& Leaf::_internal_sparse_vector() const { + return *leaf_.sparse_vector_; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* Leaf::release_sparse_vector() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.Leaf.sparse_vector) + if (has_sparse_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* temp = leaf_.sparse_vector_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_.sparse_vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::SparseVector& Leaf::sparse_vector() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.Leaf.sparse_vector) + return has_sparse_vector() + ? *leaf_.sparse_vector_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::trees::SparseVector*>(&::diplomacy::tensorflow::boosted_trees::trees::_SparseVector_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* Leaf::unsafe_arena_release_sparse_vector() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.Leaf.sparse_vector) + if (has_sparse_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* temp = leaf_.sparse_vector_; + leaf_.sparse_vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Leaf::unsafe_arena_set_allocated_sparse_vector(::diplomacy::tensorflow::boosted_trees::trees::SparseVector* sparse_vector) { + clear_leaf(); + if (sparse_vector) { + set_has_sparse_vector(); + leaf_.sparse_vector_ = sparse_vector; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.trees.Leaf.sparse_vector) +} +inline ::diplomacy::tensorflow::boosted_trees::trees::SparseVector* Leaf::mutable_sparse_vector() { + if (!has_sparse_vector()) { + clear_leaf(); + set_has_sparse_vector(); + leaf_.sparse_vector_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::trees::SparseVector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.Leaf.sparse_vector) + return leaf_.sparse_vector_; +} + +inline bool Leaf::has_leaf() const { + return leaf_case() != LEAF_NOT_SET; +} +inline void Leaf::clear_has_leaf() { + _oneof_case_[0] = LEAF_NOT_SET; +} +inline Leaf::LeafCase Leaf::leaf_case() const { + return Leaf::LeafCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Vector + +// repeated float value = 1; +inline int Vector::value_size() const { + return value_.size(); +} +inline void Vector::clear_value() { + value_.Clear(); +} +inline float Vector::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.Vector.value) + return value_.Get(index); +} +inline void Vector::set_value(int index, float value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.Vector.value) +} +inline void Vector::add_value(float value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.Vector.value) +} +inline const ::google::protobuf::RepeatedField< float >& +Vector::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.Vector.value) + return value_; +} +inline ::google::protobuf::RepeatedField< float >* +Vector::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.Vector.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// SparseVector + +// repeated int32 index = 1; +inline int SparseVector::index_size() const { + return index_.size(); +} +inline void SparseVector::clear_index() { + index_.Clear(); +} +inline ::google::protobuf::int32 SparseVector::index(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.SparseVector.index) + return index_.Get(index); +} +inline void SparseVector::set_index(int index, ::google::protobuf::int32 value) { + index_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.SparseVector.index) +} +inline void SparseVector::add_index(::google::protobuf::int32 value) { + index_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.SparseVector.index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SparseVector::index() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.SparseVector.index) + return index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SparseVector::mutable_index() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.SparseVector.index) + return &index_; +} + +// repeated float value = 2; +inline int SparseVector::value_size() const { + return value_.size(); +} +inline void SparseVector::clear_value() { + value_.Clear(); +} +inline float SparseVector::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.SparseVector.value) + return value_.Get(index); +} +inline void SparseVector::set_value(int index, float value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.SparseVector.value) +} +inline void SparseVector::add_value(float value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.SparseVector.value) +} +inline const ::google::protobuf::RepeatedField< float >& +SparseVector::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.SparseVector.value) + return value_; +} +inline ::google::protobuf::RepeatedField< float >* +SparseVector::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.SparseVector.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// DenseFloatBinarySplit + +// int32 feature_column = 1; +inline void DenseFloatBinarySplit::clear_feature_column() { + feature_column_ = 0; +} +inline ::google::protobuf::int32 DenseFloatBinarySplit::feature_column() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.feature_column) + return feature_column_; +} +inline void DenseFloatBinarySplit::set_feature_column(::google::protobuf::int32 value) { + + feature_column_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.feature_column) +} + +// int32 dimension_id = 5; +inline void DenseFloatBinarySplit::clear_dimension_id() { + dimension_id_ = 0; +} +inline ::google::protobuf::int32 DenseFloatBinarySplit::dimension_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.dimension_id) + return dimension_id_; +} +inline void DenseFloatBinarySplit::set_dimension_id(::google::protobuf::int32 value) { + + dimension_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.dimension_id) +} + +// float threshold = 2; +inline void DenseFloatBinarySplit::clear_threshold() { + threshold_ = 0; +} +inline float DenseFloatBinarySplit::threshold() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.threshold) + return threshold_; +} +inline void DenseFloatBinarySplit::set_threshold(float value) { + + threshold_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.threshold) +} + +// int32 left_id = 3; +inline void DenseFloatBinarySplit::clear_left_id() { + left_id_ = 0; +} +inline ::google::protobuf::int32 DenseFloatBinarySplit::left_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.left_id) + return left_id_; +} +inline void DenseFloatBinarySplit::set_left_id(::google::protobuf::int32 value) { + + left_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.left_id) +} + +// int32 right_id = 4; +inline void DenseFloatBinarySplit::clear_right_id() { + right_id_ = 0; +} +inline ::google::protobuf::int32 DenseFloatBinarySplit::right_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.right_id) + return right_id_; +} +inline void DenseFloatBinarySplit::set_right_id(::google::protobuf::int32 value) { + + right_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.right_id) +} + +// ------------------------------------------------------------------- + +// SparseFloatBinarySplitDefaultLeft + +// .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; +inline bool SparseFloatBinarySplitDefaultLeft::has_split() const { + return this != internal_default_instance() && split_ != NULL; +} +inline void SparseFloatBinarySplitDefaultLeft::clear_split() { + if (GetArenaNoVirtual() == NULL && split_ != NULL) { + delete split_; + } + split_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& SparseFloatBinarySplitDefaultLeft::_internal_split() const { + return *split_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& SparseFloatBinarySplitDefaultLeft::split() const { + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* p = split_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft.split) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_DenseFloatBinarySplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* SparseFloatBinarySplitDefaultLeft::release_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft.split) + + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* temp = split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + split_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* SparseFloatBinarySplitDefaultLeft::unsafe_arena_release_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft.split) + + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* temp = split_; + split_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* SparseFloatBinarySplitDefaultLeft::mutable_split() { + + if (split_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit>(GetArenaNoVirtual()); + split_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft.split) + return split_; +} +inline void SparseFloatBinarySplitDefaultLeft::set_allocated_split(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete split_; + } + if (split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(split); + if (message_arena != submessage_arena) { + split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, split, submessage_arena); + } + + } else { + + } + split_ = split; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft.split) +} + +// ------------------------------------------------------------------- + +// SparseFloatBinarySplitDefaultRight + +// .diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit split = 1; +inline bool SparseFloatBinarySplitDefaultRight::has_split() const { + return this != internal_default_instance() && split_ != NULL; +} +inline void SparseFloatBinarySplitDefaultRight::clear_split() { + if (GetArenaNoVirtual() == NULL && split_ != NULL) { + delete split_; + } + split_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& SparseFloatBinarySplitDefaultRight::_internal_split() const { + return *split_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit& SparseFloatBinarySplitDefaultRight::split() const { + const ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* p = split_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight.split) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_DenseFloatBinarySplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* SparseFloatBinarySplitDefaultRight::release_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight.split) + + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* temp = split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + split_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* SparseFloatBinarySplitDefaultRight::unsafe_arena_release_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight.split) + + ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* temp = split_; + split_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* SparseFloatBinarySplitDefaultRight::mutable_split() { + + if (split_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit>(GetArenaNoVirtual()); + split_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight.split) + return split_; +} +inline void SparseFloatBinarySplitDefaultRight::set_allocated_split(::diplomacy::tensorflow::boosted_trees::trees::DenseFloatBinarySplit* split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete split_; + } + if (split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(split); + if (message_arena != submessage_arena) { + split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, split, submessage_arena); + } + + } else { + + } + split_ = split; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight.split) +} + +// ------------------------------------------------------------------- + +// CategoricalIdBinarySplit + +// int32 feature_column = 1; +inline void CategoricalIdBinarySplit::clear_feature_column() { + feature_column_ = 0; +} +inline ::google::protobuf::int32 CategoricalIdBinarySplit::feature_column() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.feature_column) + return feature_column_; +} +inline void CategoricalIdBinarySplit::set_feature_column(::google::protobuf::int32 value) { + + feature_column_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.feature_column) +} + +// int64 feature_id = 2; +inline void CategoricalIdBinarySplit::clear_feature_id() { + feature_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CategoricalIdBinarySplit::feature_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.feature_id) + return feature_id_; +} +inline void CategoricalIdBinarySplit::set_feature_id(::google::protobuf::int64 value) { + + feature_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.feature_id) +} + +// int32 left_id = 3; +inline void CategoricalIdBinarySplit::clear_left_id() { + left_id_ = 0; +} +inline ::google::protobuf::int32 CategoricalIdBinarySplit::left_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.left_id) + return left_id_; +} +inline void CategoricalIdBinarySplit::set_left_id(::google::protobuf::int32 value) { + + left_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.left_id) +} + +// int32 right_id = 4; +inline void CategoricalIdBinarySplit::clear_right_id() { + right_id_ = 0; +} +inline ::google::protobuf::int32 CategoricalIdBinarySplit::right_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.right_id) + return right_id_; +} +inline void CategoricalIdBinarySplit::set_right_id(::google::protobuf::int32 value) { + + right_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.right_id) +} + +// ------------------------------------------------------------------- + +// CategoricalIdSetMembershipBinarySplit + +// int32 feature_column = 1; +inline void CategoricalIdSetMembershipBinarySplit::clear_feature_column() { + feature_column_ = 0; +} +inline ::google::protobuf::int32 CategoricalIdSetMembershipBinarySplit::feature_column() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_column) + return feature_column_; +} +inline void CategoricalIdSetMembershipBinarySplit::set_feature_column(::google::protobuf::int32 value) { + + feature_column_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_column) +} + +// repeated int64 feature_ids = 2; +inline int CategoricalIdSetMembershipBinarySplit::feature_ids_size() const { + return feature_ids_.size(); +} +inline void CategoricalIdSetMembershipBinarySplit::clear_feature_ids() { + feature_ids_.Clear(); +} +inline ::google::protobuf::int64 CategoricalIdSetMembershipBinarySplit::feature_ids(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_ids) + return feature_ids_.Get(index); +} +inline void CategoricalIdSetMembershipBinarySplit::set_feature_ids(int index, ::google::protobuf::int64 value) { + feature_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_ids) +} +inline void CategoricalIdSetMembershipBinarySplit::add_feature_ids(::google::protobuf::int64 value) { + feature_ids_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +CategoricalIdSetMembershipBinarySplit::feature_ids() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_ids) + return feature_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +CategoricalIdSetMembershipBinarySplit::mutable_feature_ids() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_ids) + return &feature_ids_; +} + +// int32 left_id = 3; +inline void CategoricalIdSetMembershipBinarySplit::clear_left_id() { + left_id_ = 0; +} +inline ::google::protobuf::int32 CategoricalIdSetMembershipBinarySplit::left_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.left_id) + return left_id_; +} +inline void CategoricalIdSetMembershipBinarySplit::set_left_id(::google::protobuf::int32 value) { + + left_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.left_id) +} + +// int32 right_id = 4; +inline void CategoricalIdSetMembershipBinarySplit::clear_right_id() { + right_id_ = 0; +} +inline ::google::protobuf::int32 CategoricalIdSetMembershipBinarySplit::right_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.right_id) + return right_id_; +} +inline void CategoricalIdSetMembershipBinarySplit::set_right_id(::google::protobuf::int32 value) { + + right_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.right_id) +} + +// ------------------------------------------------------------------- + +// ObliviousDenseFloatBinarySplit + +// int32 feature_column = 1; +inline void ObliviousDenseFloatBinarySplit::clear_feature_column() { + feature_column_ = 0; +} +inline ::google::protobuf::int32 ObliviousDenseFloatBinarySplit::feature_column() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit.feature_column) + return feature_column_; +} +inline void ObliviousDenseFloatBinarySplit::set_feature_column(::google::protobuf::int32 value) { + + feature_column_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit.feature_column) +} + +// float threshold = 2; +inline void ObliviousDenseFloatBinarySplit::clear_threshold() { + threshold_ = 0; +} +inline float ObliviousDenseFloatBinarySplit::threshold() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit.threshold) + return threshold_; +} +inline void ObliviousDenseFloatBinarySplit::set_threshold(float value) { + + threshold_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit.threshold) +} + +// ------------------------------------------------------------------- + +// ObliviousCategoricalIdBinarySplit + +// int32 feature_column = 1; +inline void ObliviousCategoricalIdBinarySplit::clear_feature_column() { + feature_column_ = 0; +} +inline ::google::protobuf::int32 ObliviousCategoricalIdBinarySplit::feature_column() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit.feature_column) + return feature_column_; +} +inline void ObliviousCategoricalIdBinarySplit::set_feature_column(::google::protobuf::int32 value) { + + feature_column_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit.feature_column) +} + +// int64 feature_id = 2; +inline void ObliviousCategoricalIdBinarySplit::clear_feature_id() { + feature_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ObliviousCategoricalIdBinarySplit::feature_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit.feature_id) + return feature_id_; +} +inline void ObliviousCategoricalIdBinarySplit::set_feature_id(::google::protobuf::int64 value) { + + feature_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit.feature_id) +} + +// ------------------------------------------------------------------- + +// DecisionTreeConfig + +// repeated .diplomacy.tensorflow.boosted_trees.trees.TreeNode nodes = 1; +inline int DecisionTreeConfig::nodes_size() const { + return nodes_.size(); +} +inline void DecisionTreeConfig::clear_nodes() { + nodes_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* DecisionTreeConfig::mutable_nodes(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig.nodes) + return nodes_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode >* +DecisionTreeConfig::mutable_nodes() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig.nodes) + return &nodes_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::TreeNode& DecisionTreeConfig::nodes(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig.nodes) + return nodes_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::TreeNode* DecisionTreeConfig::add_nodes() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig.nodes) + return nodes_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::TreeNode >& +DecisionTreeConfig::nodes() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig.nodes) + return nodes_; +} + +// ------------------------------------------------------------------- + +// DecisionTreeMetadata + +// int32 num_tree_weight_updates = 1; +inline void DecisionTreeMetadata::clear_num_tree_weight_updates() { + num_tree_weight_updates_ = 0; +} +inline ::google::protobuf::int32 DecisionTreeMetadata::num_tree_weight_updates() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.num_tree_weight_updates) + return num_tree_weight_updates_; +} +inline void DecisionTreeMetadata::set_num_tree_weight_updates(::google::protobuf::int32 value) { + + num_tree_weight_updates_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.num_tree_weight_updates) +} + +// int32 num_layers_grown = 2; +inline void DecisionTreeMetadata::clear_num_layers_grown() { + num_layers_grown_ = 0; +} +inline ::google::protobuf::int32 DecisionTreeMetadata::num_layers_grown() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.num_layers_grown) + return num_layers_grown_; +} +inline void DecisionTreeMetadata::set_num_layers_grown(::google::protobuf::int32 value) { + + num_layers_grown_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.num_layers_grown) +} + +// bool is_finalized = 3; +inline void DecisionTreeMetadata::clear_is_finalized() { + is_finalized_ = false; +} +inline bool DecisionTreeMetadata::is_finalized() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.is_finalized) + return is_finalized_; +} +inline void DecisionTreeMetadata::set_is_finalized(bool value) { + + is_finalized_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.is_finalized) +} + +// ------------------------------------------------------------------- + +// GrowingMetadata + +// int64 num_trees_attempted = 1; +inline void GrowingMetadata::clear_num_trees_attempted() { + num_trees_attempted_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 GrowingMetadata::num_trees_attempted() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.num_trees_attempted) + return num_trees_attempted_; +} +inline void GrowingMetadata::set_num_trees_attempted(::google::protobuf::int64 value) { + + num_trees_attempted_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.num_trees_attempted) +} + +// int64 num_layers_attempted = 2; +inline void GrowingMetadata::clear_num_layers_attempted() { + num_layers_attempted_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 GrowingMetadata::num_layers_attempted() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.num_layers_attempted) + return num_layers_attempted_; +} +inline void GrowingMetadata::set_num_layers_attempted(::google::protobuf::int64 value) { + + num_layers_attempted_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.num_layers_attempted) +} + +// repeated int64 used_handler_ids = 3; +inline int GrowingMetadata::used_handler_ids_size() const { + return used_handler_ids_.size(); +} +inline void GrowingMetadata::clear_used_handler_ids() { + used_handler_ids_.Clear(); +} +inline ::google::protobuf::int64 GrowingMetadata::used_handler_ids(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.used_handler_ids) + return used_handler_ids_.Get(index); +} +inline void GrowingMetadata::set_used_handler_ids(int index, ::google::protobuf::int64 value) { + used_handler_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.used_handler_ids) +} +inline void GrowingMetadata::add_used_handler_ids(::google::protobuf::int64 value) { + used_handler_ids_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.used_handler_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +GrowingMetadata::used_handler_ids() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.used_handler_ids) + return used_handler_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +GrowingMetadata::mutable_used_handler_ids() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.used_handler_ids) + return &used_handler_ids_; +} + +// ------------------------------------------------------------------- + +// DecisionTreeEnsembleConfig + +// repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig trees = 1; +inline int DecisionTreeEnsembleConfig::trees_size() const { + return trees_.size(); +} +inline void DecisionTreeEnsembleConfig::clear_trees() { + trees_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig* DecisionTreeEnsembleConfig::mutable_trees(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.trees) + return trees_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig >* +DecisionTreeEnsembleConfig::mutable_trees() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.trees) + return &trees_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig& DecisionTreeEnsembleConfig::trees(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.trees) + return trees_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig* DecisionTreeEnsembleConfig::add_trees() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.trees) + return trees_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeConfig >& +DecisionTreeEnsembleConfig::trees() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.trees) + return trees_; +} + +// repeated float tree_weights = 2; +inline int DecisionTreeEnsembleConfig::tree_weights_size() const { + return tree_weights_.size(); +} +inline void DecisionTreeEnsembleConfig::clear_tree_weights() { + tree_weights_.Clear(); +} +inline float DecisionTreeEnsembleConfig::tree_weights(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_weights) + return tree_weights_.Get(index); +} +inline void DecisionTreeEnsembleConfig::set_tree_weights(int index, float value) { + tree_weights_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_weights) +} +inline void DecisionTreeEnsembleConfig::add_tree_weights(float value) { + tree_weights_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_weights) +} +inline const ::google::protobuf::RepeatedField< float >& +DecisionTreeEnsembleConfig::tree_weights() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_weights) + return tree_weights_; +} +inline ::google::protobuf::RepeatedField< float >* +DecisionTreeEnsembleConfig::mutable_tree_weights() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_weights) + return &tree_weights_; +} + +// repeated .diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata tree_metadata = 3; +inline int DecisionTreeEnsembleConfig::tree_metadata_size() const { + return tree_metadata_.size(); +} +inline void DecisionTreeEnsembleConfig::clear_tree_metadata() { + tree_metadata_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata* DecisionTreeEnsembleConfig::mutable_tree_metadata(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_metadata) + return tree_metadata_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata >* +DecisionTreeEnsembleConfig::mutable_tree_metadata() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_metadata) + return &tree_metadata_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata& DecisionTreeEnsembleConfig::tree_metadata(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_metadata) + return tree_metadata_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata* DecisionTreeEnsembleConfig::add_tree_metadata() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_metadata) + return tree_metadata_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::trees::DecisionTreeMetadata >& +DecisionTreeEnsembleConfig::tree_metadata() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_metadata) + return tree_metadata_; +} + +// .diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata growing_metadata = 4; +inline bool DecisionTreeEnsembleConfig::has_growing_metadata() const { + return this != internal_default_instance() && growing_metadata_ != NULL; +} +inline void DecisionTreeEnsembleConfig::clear_growing_metadata() { + if (GetArenaNoVirtual() == NULL && growing_metadata_ != NULL) { + delete growing_metadata_; + } + growing_metadata_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata& DecisionTreeEnsembleConfig::_internal_growing_metadata() const { + return *growing_metadata_; +} +inline const ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata& DecisionTreeEnsembleConfig::growing_metadata() const { + const ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* p = growing_metadata_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.growing_metadata) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::trees::_GrowingMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* DecisionTreeEnsembleConfig::release_growing_metadata() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.growing_metadata) + + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* temp = growing_metadata_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + growing_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* DecisionTreeEnsembleConfig::unsafe_arena_release_growing_metadata() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.growing_metadata) + + ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* temp = growing_metadata_; + growing_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* DecisionTreeEnsembleConfig::mutable_growing_metadata() { + + if (growing_metadata_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata>(GetArenaNoVirtual()); + growing_metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.growing_metadata) + return growing_metadata_; +} +inline void DecisionTreeEnsembleConfig::set_allocated_growing_metadata(::diplomacy::tensorflow::boosted_trees::trees::GrowingMetadata* growing_metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete growing_metadata_; + } + if (growing_metadata) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(growing_metadata); + if (message_arena != submessage_arena) { + growing_metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, growing_metadata, submessage_arena); + } + + } else { + + } + growing_metadata_ = growing_metadata; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.growing_metadata) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace trees +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fboosted_5ftrees_2fproto_2ftree_5fconfig_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto new file mode 100644 index 0000000..81b1b5c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto @@ -0,0 +1,172 @@ +syntax = "proto3"; +option cc_enable_arenas = true; + +package diplomacy.tensorflow.boosted_trees.trees; + +// TreeNode describes a node in a tree. +message TreeNode { + oneof node { + Leaf leaf = 1; + DenseFloatBinarySplit dense_float_binary_split = 2; + SparseFloatBinarySplitDefaultLeft sparse_float_binary_split_default_left = + 3; + SparseFloatBinarySplitDefaultRight sparse_float_binary_split_default_right = + 4; + CategoricalIdBinarySplit categorical_id_binary_split = 5; + CategoricalIdSetMembershipBinarySplit + categorical_id_set_membership_binary_split = 6; + ObliviousDenseFloatBinarySplit oblivious_dense_float_binary_split = 7; + ObliviousCategoricalIdBinarySplit oblivious_categorical_id_binary_split = 8; + } + TreeNodeMetadata node_metadata = 777; +} + +// TreeNodeMetadata encodes metadata associated with each node in a tree. +message TreeNodeMetadata { + // The gain associated with this node. + float gain = 1; + + // The original leaf node before this node was split. + Leaf original_leaf = 2; + + // The original layer of leaves before that layer was converted to a split. + repeated Leaf original_oblivious_leaves = 3; +} + +// Leaves can either hold dense or sparse information. +message Leaf { + oneof leaf { + // See third_party/tensorflow/contrib/decision_trees/ + // proto/generic_tree_model.proto + // for a description of how vector and sparse_vector might be used. + Vector vector = 1; + SparseVector sparse_vector = 2; + } +} + +message Vector { + repeated float value = 1; +} + +message SparseVector { + repeated int32 index = 1; + repeated float value = 2; +} + +// Split rule for dense float features. +message DenseFloatBinarySplit { + // Float feature column and split threshold describing + // the rule feature <= threshold. + int32 feature_column = 1; + // If feature column is multivalent, this holds the index of the dimension + // for the split. Defaults to 0. + int32 dimension_id = 5; + float threshold = 2; + + // Node children indexing into a contiguous + // vector of nodes starting from the root. + int32 left_id = 3; + int32 right_id = 4; +} + +// Split rule for sparse float features defaulting left for missing features. +message SparseFloatBinarySplitDefaultLeft { + DenseFloatBinarySplit split = 1; +} + +// Split rule for sparse float features defaulting right for missing features. +message SparseFloatBinarySplitDefaultRight { + DenseFloatBinarySplit split = 1; +} + +// Split rule for categorical features with a single feature Id. +message CategoricalIdBinarySplit { + // Categorical feature column and Id describing + // the rule feature == Id. + int32 feature_column = 1; + int64 feature_id = 2; + + // Node children indexing into a contiguous + // vector of nodes starting from the root. + int32 left_id = 3; + int32 right_id = 4; +} + +// Split rule for categorical features with a set of feature Ids. +message CategoricalIdSetMembershipBinarySplit { + // Categorical feature column and Id describing + // the rule feature ∈ feature_ids. + int32 feature_column = 1; + // Sorted list of Ids in the set. + repeated int64 feature_ids = 2; + + // Node children indexing into a contiguous + // vector of nodes starting from the root. + int32 left_id = 3; + int32 right_id = 4; +} + +// Split rule for dense float features in the oblivious case. +message ObliviousDenseFloatBinarySplit { + // Float feature column and split threshold describing + // the rule feature <= threshold. + int32 feature_column = 1; + float threshold = 2; + // We don't store children ids, because either the next node represents the + // whole next layer of the tree or starting with the next node we only have + // leaves. +} + +// Split rule for categorical features with a single feature Id in the oblivious +// case. +message ObliviousCategoricalIdBinarySplit { + // Categorical feature column and Id describing the rule feature == Id. + int32 feature_column = 1; + int64 feature_id = 2; + // We don't store children ids, because either the next node represents the + // whole next layer of the tree or starting with the next node we only have + // leaves. +} + +// DecisionTreeConfig describes a list of connected nodes. +// Node 0 must be the root and can carry any payload including a leaf +// in the case of representing the bias. +// Note that each node id is implicitly its index in the list of nodes. +message DecisionTreeConfig { + repeated TreeNode nodes = 1; +} + +message DecisionTreeMetadata { + // How many times tree weight was updated (due to reweighting of the final + // ensemble, dropout, shrinkage etc). + int32 num_tree_weight_updates = 1; + + // Number of layers grown for this tree. + int32 num_layers_grown = 2; + + // Whether the tree is finalized in that no more layers can be grown. + bool is_finalized = 3; +} + +message GrowingMetadata { + // Number of trees that we have attempted to build. After pruning, these + // trees might have been removed. + int64 num_trees_attempted = 1; + // Number of layers that we have attempted to build. After pruning, these + // layers might have been removed. + int64 num_layers_attempted = 2; + + // Sorted list of column handlers that have been used in at least one split + // so far. + repeated int64 used_handler_ids = 3; +} + +// DecisionTreeEnsembleConfig describes an ensemble of decision trees. +message DecisionTreeEnsembleConfig { + repeated DecisionTreeConfig trees = 1; + repeated float tree_weights = 2; + repeated DecisionTreeMetadata tree_metadata = 3; + + // Metadata that is used during the training. + GrowingMetadata growing_metadata = 4; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config_pb2.py new file mode 100644 index 0000000..c6202fb --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config_pb2.py @@ -0,0 +1,927 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto', + package='diplomacy.tensorflow.boosted_trees.trees', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\nBdiplomacy_tensorflow/contrib/boosted_trees/proto/tree_config.proto\x12(diplomacy.tensorflow.boosted_trees.trees\"\xf4\x07\n\x08TreeNode\x12>\n\x04leaf\x18\x01 \x01(\x0b\x32..diplomacy.tensorflow.boosted_trees.trees.LeafH\x00\x12\x63\n\x18\x64\x65nse_float_binary_split\x18\x02 \x01(\x0b\x32?.diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplitH\x00\x12}\n&sparse_float_binary_split_default_left\x18\x03 \x01(\x0b\x32K.diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeftH\x00\x12\x7f\n\'sparse_float_binary_split_default_right\x18\x04 \x01(\x0b\x32L.diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRightH\x00\x12i\n\x1b\x63\x61tegorical_id_binary_split\x18\x05 \x01(\x0b\x32\x42.diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplitH\x00\x12\x85\x01\n*categorical_id_set_membership_binary_split\x18\x06 \x01(\x0b\x32O.diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplitH\x00\x12v\n\"oblivious_dense_float_binary_split\x18\x07 \x01(\x0b\x32H.diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplitH\x00\x12|\n%oblivious_categorical_id_binary_split\x18\x08 \x01(\x0b\x32K.diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplitH\x00\x12R\n\rnode_metadata\x18\x89\x06 \x01(\x0b\x32:.diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadataB\x06\n\x04node\"\xba\x01\n\x10TreeNodeMetadata\x12\x0c\n\x04gain\x18\x01 \x01(\x02\x12\x45\n\roriginal_leaf\x18\x02 \x01(\x0b\x32..diplomacy.tensorflow.boosted_trees.trees.Leaf\x12Q\n\x19original_oblivious_leaves\x18\x03 \x03(\x0b\x32..diplomacy.tensorflow.boosted_trees.trees.Leaf\"\xa3\x01\n\x04Leaf\x12\x42\n\x06vector\x18\x01 \x01(\x0b\x32\x30.diplomacy.tensorflow.boosted_trees.trees.VectorH\x00\x12O\n\rsparse_vector\x18\x02 \x01(\x0b\x32\x36.diplomacy.tensorflow.boosted_trees.trees.SparseVectorH\x00\x42\x06\n\x04leaf\"\x17\n\x06Vector\x12\r\n\x05value\x18\x01 \x03(\x02\",\n\x0cSparseVector\x12\r\n\x05index\x18\x01 \x03(\x05\x12\r\n\x05value\x18\x02 \x03(\x02\"{\n\x15\x44\x65nseFloatBinarySplit\x12\x16\n\x0e\x66\x65\x61ture_column\x18\x01 \x01(\x05\x12\x14\n\x0c\x64imension_id\x18\x05 \x01(\x05\x12\x11\n\tthreshold\x18\x02 \x01(\x02\x12\x0f\n\x07left_id\x18\x03 \x01(\x05\x12\x10\n\x08right_id\x18\x04 \x01(\x05\"s\n!SparseFloatBinarySplitDefaultLeft\x12N\n\x05split\x18\x01 \x01(\x0b\x32?.diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit\"t\n\"SparseFloatBinarySplitDefaultRight\x12N\n\x05split\x18\x01 \x01(\x0b\x32?.diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit\"i\n\x18\x43\x61tegoricalIdBinarySplit\x12\x16\n\x0e\x66\x65\x61ture_column\x18\x01 \x01(\x05\x12\x12\n\nfeature_id\x18\x02 \x01(\x03\x12\x0f\n\x07left_id\x18\x03 \x01(\x05\x12\x10\n\x08right_id\x18\x04 \x01(\x05\"w\n%CategoricalIdSetMembershipBinarySplit\x12\x16\n\x0e\x66\x65\x61ture_column\x18\x01 \x01(\x05\x12\x13\n\x0b\x66\x65\x61ture_ids\x18\x02 \x03(\x03\x12\x0f\n\x07left_id\x18\x03 \x01(\x05\x12\x10\n\x08right_id\x18\x04 \x01(\x05\"K\n\x1eObliviousDenseFloatBinarySplit\x12\x16\n\x0e\x66\x65\x61ture_column\x18\x01 \x01(\x05\x12\x11\n\tthreshold\x18\x02 \x01(\x02\"O\n!ObliviousCategoricalIdBinarySplit\x12\x16\n\x0e\x66\x65\x61ture_column\x18\x01 \x01(\x05\x12\x12\n\nfeature_id\x18\x02 \x01(\x03\"W\n\x12\x44\x65\x63isionTreeConfig\x12\x41\n\x05nodes\x18\x01 \x03(\x0b\x32\x32.diplomacy.tensorflow.boosted_trees.trees.TreeNode\"g\n\x14\x44\x65\x63isionTreeMetadata\x12\x1f\n\x17num_tree_weight_updates\x18\x01 \x01(\x05\x12\x18\n\x10num_layers_grown\x18\x02 \x01(\x05\x12\x14\n\x0cis_finalized\x18\x03 \x01(\x08\"f\n\x0fGrowingMetadata\x12\x1b\n\x13num_trees_attempted\x18\x01 \x01(\x03\x12\x1c\n\x14num_layers_attempted\x18\x02 \x01(\x03\x12\x18\n\x10used_handler_ids\x18\x03 \x03(\x03\"\xab\x02\n\x1a\x44\x65\x63isionTreeEnsembleConfig\x12K\n\x05trees\x18\x01 \x03(\x0b\x32<.diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig\x12\x14\n\x0ctree_weights\x18\x02 \x03(\x02\x12U\n\rtree_metadata\x18\x03 \x03(\x0b\x32>.diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata\x12S\n\x10growing_metadata\x18\x04 \x01(\x0b\x32\x39.diplomacy.tensorflow.boosted_trees.trees.GrowingMetadataB\x03\xf8\x01\x01\x62\x06proto3') +) + + + + +_TREENODE = _descriptor.Descriptor( + name='TreeNode', + full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='leaf', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.leaf', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dense_float_binary_split', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.dense_float_binary_split', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sparse_float_binary_split_default_left', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_left', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sparse_float_binary_split_default_right', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.sparse_float_binary_split_default_right', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='categorical_id_binary_split', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_binary_split', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='categorical_id_set_membership_binary_split', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.categorical_id_set_membership_binary_split', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='oblivious_dense_float_binary_split', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_dense_float_binary_split', index=6, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='oblivious_categorical_id_binary_split', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.oblivious_categorical_id_binary_split', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_metadata', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.node_metadata', index=8, + number=777, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='node', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNode.node', + index=0, containing_type=None, fields=[]), + ], + serialized_start=113, + serialized_end=1125, +) + + +_TREENODEMETADATA = _descriptor.Descriptor( + name='TreeNodeMetadata', + full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='gain', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.gain', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='original_leaf', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_leaf', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='original_oblivious_leaves', full_name='diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata.original_oblivious_leaves', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1128, + serialized_end=1314, +) + + +_LEAF = _descriptor.Descriptor( + name='Leaf', + full_name='diplomacy.tensorflow.boosted_trees.trees.Leaf', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='vector', full_name='diplomacy.tensorflow.boosted_trees.trees.Leaf.vector', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sparse_vector', full_name='diplomacy.tensorflow.boosted_trees.trees.Leaf.sparse_vector', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='leaf', full_name='diplomacy.tensorflow.boosted_trees.trees.Leaf.leaf', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1317, + serialized_end=1480, +) + + +_VECTOR = _descriptor.Descriptor( + name='Vector', + full_name='diplomacy.tensorflow.boosted_trees.trees.Vector', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.boosted_trees.trees.Vector.value', index=0, + number=1, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1482, + serialized_end=1505, +) + + +_SPARSEVECTOR = _descriptor.Descriptor( + name='SparseVector', + full_name='diplomacy.tensorflow.boosted_trees.trees.SparseVector', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='diplomacy.tensorflow.boosted_trees.trees.SparseVector.index', index=0, + number=1, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.boosted_trees.trees.SparseVector.value', index=1, + number=2, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1507, + serialized_end=1551, +) + + +_DENSEFLOATBINARYSPLIT = _descriptor.Descriptor( + name='DenseFloatBinarySplit', + full_name='diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_column', full_name='diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.feature_column', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dimension_id', full_name='diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.dimension_id', index=1, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='threshold', full_name='diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.threshold', index=2, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_id', full_name='diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.left_id', index=3, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_id', full_name='diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit.right_id', index=4, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1553, + serialized_end=1676, +) + + +_SPARSEFLOATBINARYSPLITDEFAULTLEFT = _descriptor.Descriptor( + name='SparseFloatBinarySplitDefaultLeft', + full_name='diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='split', full_name='diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft.split', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1678, + serialized_end=1793, +) + + +_SPARSEFLOATBINARYSPLITDEFAULTRIGHT = _descriptor.Descriptor( + name='SparseFloatBinarySplitDefaultRight', + full_name='diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='split', full_name='diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight.split', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1795, + serialized_end=1911, +) + + +_CATEGORICALIDBINARYSPLIT = _descriptor.Descriptor( + name='CategoricalIdBinarySplit', + full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_column', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.feature_column', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.feature_id', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_id', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.left_id', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_id', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit.right_id', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1913, + serialized_end=2018, +) + + +_CATEGORICALIDSETMEMBERSHIPBINARYSPLIT = _descriptor.Descriptor( + name='CategoricalIdSetMembershipBinarySplit', + full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_column', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_column', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_ids', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.feature_ids', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_id', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.left_id', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_id', full_name='diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit.right_id', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2020, + serialized_end=2139, +) + + +_OBLIVIOUSDENSEFLOATBINARYSPLIT = _descriptor.Descriptor( + name='ObliviousDenseFloatBinarySplit', + full_name='diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_column', full_name='diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit.feature_column', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='threshold', full_name='diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit.threshold', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2141, + serialized_end=2216, +) + + +_OBLIVIOUSCATEGORICALIDBINARYSPLIT = _descriptor.Descriptor( + name='ObliviousCategoricalIdBinarySplit', + full_name='diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_column', full_name='diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit.feature_column', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit.feature_id', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2218, + serialized_end=2297, +) + + +_DECISIONTREECONFIG = _descriptor.Descriptor( + name='DecisionTreeConfig', + full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nodes', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig.nodes', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2299, + serialized_end=2386, +) + + +_DECISIONTREEMETADATA = _descriptor.Descriptor( + name='DecisionTreeMetadata', + full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='num_tree_weight_updates', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.num_tree_weight_updates', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_layers_grown', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.num_layers_grown', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_finalized', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata.is_finalized', index=2, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2388, + serialized_end=2491, +) + + +_GROWINGMETADATA = _descriptor.Descriptor( + name='GrowingMetadata', + full_name='diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='num_trees_attempted', full_name='diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.num_trees_attempted', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_layers_attempted', full_name='diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.num_layers_attempted', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='used_handler_ids', full_name='diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata.used_handler_ids', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2493, + serialized_end=2595, +) + + +_DECISIONTREEENSEMBLECONFIG = _descriptor.Descriptor( + name='DecisionTreeEnsembleConfig', + full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='trees', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.trees', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tree_weights', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_weights', index=1, + number=2, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tree_metadata', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.tree_metadata', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='growing_metadata', full_name='diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig.growing_metadata', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2598, + serialized_end=2897, +) + +_TREENODE.fields_by_name['leaf'].message_type = _LEAF +_TREENODE.fields_by_name['dense_float_binary_split'].message_type = _DENSEFLOATBINARYSPLIT +_TREENODE.fields_by_name['sparse_float_binary_split_default_left'].message_type = _SPARSEFLOATBINARYSPLITDEFAULTLEFT +_TREENODE.fields_by_name['sparse_float_binary_split_default_right'].message_type = _SPARSEFLOATBINARYSPLITDEFAULTRIGHT +_TREENODE.fields_by_name['categorical_id_binary_split'].message_type = _CATEGORICALIDBINARYSPLIT +_TREENODE.fields_by_name['categorical_id_set_membership_binary_split'].message_type = _CATEGORICALIDSETMEMBERSHIPBINARYSPLIT +_TREENODE.fields_by_name['oblivious_dense_float_binary_split'].message_type = _OBLIVIOUSDENSEFLOATBINARYSPLIT +_TREENODE.fields_by_name['oblivious_categorical_id_binary_split'].message_type = _OBLIVIOUSCATEGORICALIDBINARYSPLIT +_TREENODE.fields_by_name['node_metadata'].message_type = _TREENODEMETADATA +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['leaf']) +_TREENODE.fields_by_name['leaf'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['dense_float_binary_split']) +_TREENODE.fields_by_name['dense_float_binary_split'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['sparse_float_binary_split_default_left']) +_TREENODE.fields_by_name['sparse_float_binary_split_default_left'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['sparse_float_binary_split_default_right']) +_TREENODE.fields_by_name['sparse_float_binary_split_default_right'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['categorical_id_binary_split']) +_TREENODE.fields_by_name['categorical_id_binary_split'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['categorical_id_set_membership_binary_split']) +_TREENODE.fields_by_name['categorical_id_set_membership_binary_split'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['oblivious_dense_float_binary_split']) +_TREENODE.fields_by_name['oblivious_dense_float_binary_split'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODE.oneofs_by_name['node'].fields.append( + _TREENODE.fields_by_name['oblivious_categorical_id_binary_split']) +_TREENODE.fields_by_name['oblivious_categorical_id_binary_split'].containing_oneof = _TREENODE.oneofs_by_name['node'] +_TREENODEMETADATA.fields_by_name['original_leaf'].message_type = _LEAF +_TREENODEMETADATA.fields_by_name['original_oblivious_leaves'].message_type = _LEAF +_LEAF.fields_by_name['vector'].message_type = _VECTOR +_LEAF.fields_by_name['sparse_vector'].message_type = _SPARSEVECTOR +_LEAF.oneofs_by_name['leaf'].fields.append( + _LEAF.fields_by_name['vector']) +_LEAF.fields_by_name['vector'].containing_oneof = _LEAF.oneofs_by_name['leaf'] +_LEAF.oneofs_by_name['leaf'].fields.append( + _LEAF.fields_by_name['sparse_vector']) +_LEAF.fields_by_name['sparse_vector'].containing_oneof = _LEAF.oneofs_by_name['leaf'] +_SPARSEFLOATBINARYSPLITDEFAULTLEFT.fields_by_name['split'].message_type = _DENSEFLOATBINARYSPLIT +_SPARSEFLOATBINARYSPLITDEFAULTRIGHT.fields_by_name['split'].message_type = _DENSEFLOATBINARYSPLIT +_DECISIONTREECONFIG.fields_by_name['nodes'].message_type = _TREENODE +_DECISIONTREEENSEMBLECONFIG.fields_by_name['trees'].message_type = _DECISIONTREECONFIG +_DECISIONTREEENSEMBLECONFIG.fields_by_name['tree_metadata'].message_type = _DECISIONTREEMETADATA +_DECISIONTREEENSEMBLECONFIG.fields_by_name['growing_metadata'].message_type = _GROWINGMETADATA +DESCRIPTOR.message_types_by_name['TreeNode'] = _TREENODE +DESCRIPTOR.message_types_by_name['TreeNodeMetadata'] = _TREENODEMETADATA +DESCRIPTOR.message_types_by_name['Leaf'] = _LEAF +DESCRIPTOR.message_types_by_name['Vector'] = _VECTOR +DESCRIPTOR.message_types_by_name['SparseVector'] = _SPARSEVECTOR +DESCRIPTOR.message_types_by_name['DenseFloatBinarySplit'] = _DENSEFLOATBINARYSPLIT +DESCRIPTOR.message_types_by_name['SparseFloatBinarySplitDefaultLeft'] = _SPARSEFLOATBINARYSPLITDEFAULTLEFT +DESCRIPTOR.message_types_by_name['SparseFloatBinarySplitDefaultRight'] = _SPARSEFLOATBINARYSPLITDEFAULTRIGHT +DESCRIPTOR.message_types_by_name['CategoricalIdBinarySplit'] = _CATEGORICALIDBINARYSPLIT +DESCRIPTOR.message_types_by_name['CategoricalIdSetMembershipBinarySplit'] = _CATEGORICALIDSETMEMBERSHIPBINARYSPLIT +DESCRIPTOR.message_types_by_name['ObliviousDenseFloatBinarySplit'] = _OBLIVIOUSDENSEFLOATBINARYSPLIT +DESCRIPTOR.message_types_by_name['ObliviousCategoricalIdBinarySplit'] = _OBLIVIOUSCATEGORICALIDBINARYSPLIT +DESCRIPTOR.message_types_by_name['DecisionTreeConfig'] = _DECISIONTREECONFIG +DESCRIPTOR.message_types_by_name['DecisionTreeMetadata'] = _DECISIONTREEMETADATA +DESCRIPTOR.message_types_by_name['GrowingMetadata'] = _GROWINGMETADATA +DESCRIPTOR.message_types_by_name['DecisionTreeEnsembleConfig'] = _DECISIONTREEENSEMBLECONFIG +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TreeNode = _reflection.GeneratedProtocolMessageType('TreeNode', (_message.Message,), dict( + DESCRIPTOR = _TREENODE, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.TreeNode) + )) +_sym_db.RegisterMessage(TreeNode) + +TreeNodeMetadata = _reflection.GeneratedProtocolMessageType('TreeNodeMetadata', (_message.Message,), dict( + DESCRIPTOR = _TREENODEMETADATA, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.TreeNodeMetadata) + )) +_sym_db.RegisterMessage(TreeNodeMetadata) + +Leaf = _reflection.GeneratedProtocolMessageType('Leaf', (_message.Message,), dict( + DESCRIPTOR = _LEAF, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.Leaf) + )) +_sym_db.RegisterMessage(Leaf) + +Vector = _reflection.GeneratedProtocolMessageType('Vector', (_message.Message,), dict( + DESCRIPTOR = _VECTOR, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.Vector) + )) +_sym_db.RegisterMessage(Vector) + +SparseVector = _reflection.GeneratedProtocolMessageType('SparseVector', (_message.Message,), dict( + DESCRIPTOR = _SPARSEVECTOR, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.SparseVector) + )) +_sym_db.RegisterMessage(SparseVector) + +DenseFloatBinarySplit = _reflection.GeneratedProtocolMessageType('DenseFloatBinarySplit', (_message.Message,), dict( + DESCRIPTOR = _DENSEFLOATBINARYSPLIT, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DenseFloatBinarySplit) + )) +_sym_db.RegisterMessage(DenseFloatBinarySplit) + +SparseFloatBinarySplitDefaultLeft = _reflection.GeneratedProtocolMessageType('SparseFloatBinarySplitDefaultLeft', (_message.Message,), dict( + DESCRIPTOR = _SPARSEFLOATBINARYSPLITDEFAULTLEFT, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultLeft) + )) +_sym_db.RegisterMessage(SparseFloatBinarySplitDefaultLeft) + +SparseFloatBinarySplitDefaultRight = _reflection.GeneratedProtocolMessageType('SparseFloatBinarySplitDefaultRight', (_message.Message,), dict( + DESCRIPTOR = _SPARSEFLOATBINARYSPLITDEFAULTRIGHT, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.SparseFloatBinarySplitDefaultRight) + )) +_sym_db.RegisterMessage(SparseFloatBinarySplitDefaultRight) + +CategoricalIdBinarySplit = _reflection.GeneratedProtocolMessageType('CategoricalIdBinarySplit', (_message.Message,), dict( + DESCRIPTOR = _CATEGORICALIDBINARYSPLIT, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdBinarySplit) + )) +_sym_db.RegisterMessage(CategoricalIdBinarySplit) + +CategoricalIdSetMembershipBinarySplit = _reflection.GeneratedProtocolMessageType('CategoricalIdSetMembershipBinarySplit', (_message.Message,), dict( + DESCRIPTOR = _CATEGORICALIDSETMEMBERSHIPBINARYSPLIT, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.CategoricalIdSetMembershipBinarySplit) + )) +_sym_db.RegisterMessage(CategoricalIdSetMembershipBinarySplit) + +ObliviousDenseFloatBinarySplit = _reflection.GeneratedProtocolMessageType('ObliviousDenseFloatBinarySplit', (_message.Message,), dict( + DESCRIPTOR = _OBLIVIOUSDENSEFLOATBINARYSPLIT, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.ObliviousDenseFloatBinarySplit) + )) +_sym_db.RegisterMessage(ObliviousDenseFloatBinarySplit) + +ObliviousCategoricalIdBinarySplit = _reflection.GeneratedProtocolMessageType('ObliviousCategoricalIdBinarySplit', (_message.Message,), dict( + DESCRIPTOR = _OBLIVIOUSCATEGORICALIDBINARYSPLIT, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.ObliviousCategoricalIdBinarySplit) + )) +_sym_db.RegisterMessage(ObliviousCategoricalIdBinarySplit) + +DecisionTreeConfig = _reflection.GeneratedProtocolMessageType('DecisionTreeConfig', (_message.Message,), dict( + DESCRIPTOR = _DECISIONTREECONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeConfig) + )) +_sym_db.RegisterMessage(DecisionTreeConfig) + +DecisionTreeMetadata = _reflection.GeneratedProtocolMessageType('DecisionTreeMetadata', (_message.Message,), dict( + DESCRIPTOR = _DECISIONTREEMETADATA, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeMetadata) + )) +_sym_db.RegisterMessage(DecisionTreeMetadata) + +GrowingMetadata = _reflection.GeneratedProtocolMessageType('GrowingMetadata', (_message.Message,), dict( + DESCRIPTOR = _GROWINGMETADATA, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.GrowingMetadata) + )) +_sym_db.RegisterMessage(GrowingMetadata) + +DecisionTreeEnsembleConfig = _reflection.GeneratedProtocolMessageType('DecisionTreeEnsembleConfig', (_message.Message,), dict( + DESCRIPTOR = _DECISIONTREEENSEMBLECONFIG, + __module__ = 'diplomacy_tensorflow.contrib.boosted_trees.proto.tree_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.trees.DecisionTreeEnsembleConfig) + )) +_sym_db.RegisterMessage(DecisionTreeEnsembleConfig) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.pb.cc new file mode 100644 index 0000000..2c374bb --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.pb.cc @@ -0,0 +1,392 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto + +#include "diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +class BigQueryTablePartitionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BigQueryTablePartition_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto { +static void InitDefaultsBigQueryTablePartition() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_BigQueryTablePartition_default_instance_; + new (ptr) ::diplomacy::tensorflow::BigQueryTablePartition(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::BigQueryTablePartition::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_BigQueryTablePartition = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsBigQueryTablePartition}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_BigQueryTablePartition.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::BigQueryTablePartition, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::BigQueryTablePartition, start_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::BigQueryTablePartition, end_index_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::BigQueryTablePartition)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_BigQueryTablePartition_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nIdiplomacy_tensorflow/contrib/cloud/ker" + "nels/bigquery_table_partition.proto\022\024dip" + "lomacy.tensorflow\"@\n\026BigQueryTablePartit" + "ion\022\023\n\013start_index\030\001 \001(\003\022\021\n\tend_index\030\002 " + "\001(\003b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 171); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void BigQueryTablePartition::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BigQueryTablePartition::kStartIndexFieldNumber; +const int BigQueryTablePartition::kEndIndexFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BigQueryTablePartition::BigQueryTablePartition() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto::scc_info_BigQueryTablePartition.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.BigQueryTablePartition) +} +BigQueryTablePartition::BigQueryTablePartition(const BigQueryTablePartition& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&start_index_, &from.start_index_, + static_cast(reinterpret_cast(&end_index_) - + reinterpret_cast(&start_index_)) + sizeof(end_index_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.BigQueryTablePartition) +} + +void BigQueryTablePartition::SharedCtor() { + ::memset(&start_index_, 0, static_cast( + reinterpret_cast(&end_index_) - + reinterpret_cast(&start_index_)) + sizeof(end_index_)); +} + +BigQueryTablePartition::~BigQueryTablePartition() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.BigQueryTablePartition) + SharedDtor(); +} + +void BigQueryTablePartition::SharedDtor() { +} + +void BigQueryTablePartition::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BigQueryTablePartition::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BigQueryTablePartition& BigQueryTablePartition::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto::scc_info_BigQueryTablePartition.base); + return *internal_default_instance(); +} + + +void BigQueryTablePartition::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.BigQueryTablePartition) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&start_index_, 0, static_cast( + reinterpret_cast(&end_index_) - + reinterpret_cast(&start_index_)) + sizeof(end_index_)); + _internal_metadata_.Clear(); +} + +bool BigQueryTablePartition::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.BigQueryTablePartition) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 start_index = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &start_index_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 end_index = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &end_index_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.BigQueryTablePartition) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.BigQueryTablePartition) + return false; +#undef DO_ +} + +void BigQueryTablePartition::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.BigQueryTablePartition) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 start_index = 1; + if (this->start_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->start_index(), output); + } + + // int64 end_index = 2; + if (this->end_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->end_index(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.BigQueryTablePartition) +} + +::google::protobuf::uint8* BigQueryTablePartition::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.BigQueryTablePartition) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 start_index = 1; + if (this->start_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->start_index(), target); + } + + // int64 end_index = 2; + if (this->end_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->end_index(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.BigQueryTablePartition) + return target; +} + +size_t BigQueryTablePartition::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.BigQueryTablePartition) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 start_index = 1; + if (this->start_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->start_index()); + } + + // int64 end_index = 2; + if (this->end_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->end_index()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BigQueryTablePartition::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.BigQueryTablePartition) + GOOGLE_DCHECK_NE(&from, this); + const BigQueryTablePartition* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.BigQueryTablePartition) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.BigQueryTablePartition) + MergeFrom(*source); + } +} + +void BigQueryTablePartition::MergeFrom(const BigQueryTablePartition& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.BigQueryTablePartition) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.start_index() != 0) { + set_start_index(from.start_index()); + } + if (from.end_index() != 0) { + set_end_index(from.end_index()); + } +} + +void BigQueryTablePartition::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.BigQueryTablePartition) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BigQueryTablePartition::CopyFrom(const BigQueryTablePartition& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.BigQueryTablePartition) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BigQueryTablePartition::IsInitialized() const { + return true; +} + +void BigQueryTablePartition::Swap(BigQueryTablePartition* other) { + if (other == this) return; + InternalSwap(other); +} +void BigQueryTablePartition::InternalSwap(BigQueryTablePartition* other) { + using std::swap; + swap(start_index_, other->start_index_); + swap(end_index_, other->end_index_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BigQueryTablePartition::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::BigQueryTablePartition* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::BigQueryTablePartition >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::BigQueryTablePartition >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.pb.h new file mode 100644 index 0000000..df6fd4e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.pb.h @@ -0,0 +1,223 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto +namespace diplomacy { +namespace tensorflow { +class BigQueryTablePartition; +class BigQueryTablePartitionDefaultTypeInternal; +extern BigQueryTablePartitionDefaultTypeInternal _BigQueryTablePartition_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::BigQueryTablePartition* Arena::CreateMaybeMessage<::diplomacy::tensorflow::BigQueryTablePartition>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class BigQueryTablePartition : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.BigQueryTablePartition) */ { + public: + BigQueryTablePartition(); + virtual ~BigQueryTablePartition(); + + BigQueryTablePartition(const BigQueryTablePartition& from); + + inline BigQueryTablePartition& operator=(const BigQueryTablePartition& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BigQueryTablePartition(BigQueryTablePartition&& from) noexcept + : BigQueryTablePartition() { + *this = ::std::move(from); + } + + inline BigQueryTablePartition& operator=(BigQueryTablePartition&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const BigQueryTablePartition& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BigQueryTablePartition* internal_default_instance() { + return reinterpret_cast( + &_BigQueryTablePartition_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(BigQueryTablePartition* other); + friend void swap(BigQueryTablePartition& a, BigQueryTablePartition& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BigQueryTablePartition* New() const final { + return CreateMaybeMessage(NULL); + } + + BigQueryTablePartition* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BigQueryTablePartition& from); + void MergeFrom(const BigQueryTablePartition& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BigQueryTablePartition* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 start_index = 1; + void clear_start_index(); + static const int kStartIndexFieldNumber = 1; + ::google::protobuf::int64 start_index() const; + void set_start_index(::google::protobuf::int64 value); + + // int64 end_index = 2; + void clear_end_index(); + static const int kEndIndexFieldNumber = 2; + ::google::protobuf::int64 end_index() const; + void set_end_index(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.BigQueryTablePartition) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int64 start_index_; + ::google::protobuf::int64 end_index_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// BigQueryTablePartition + +// int64 start_index = 1; +inline void BigQueryTablePartition::clear_start_index() { + start_index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BigQueryTablePartition::start_index() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.BigQueryTablePartition.start_index) + return start_index_; +} +inline void BigQueryTablePartition::set_start_index(::google::protobuf::int64 value) { + + start_index_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.BigQueryTablePartition.start_index) +} + +// int64 end_index = 2; +inline void BigQueryTablePartition::clear_end_index() { + end_index_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 BigQueryTablePartition::end_index() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.BigQueryTablePartition.end_index) + return end_index_; +} +inline void BigQueryTablePartition::set_end_index(::google::protobuf::int64 value) { + + end_index_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.BigQueryTablePartition.end_index) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fcloud_2fkernels_2fbigquery_5ftable_5fpartition_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto new file mode 100644 index 0000000..18b3919 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; + +// This proto specifies a table partition in BigQuery. +message BigQueryTablePartition { + // [start_index, end_index] specify the boundaries of a partition. + // If end_index is -1, every row starting from start_index is part of the + // partition. + int64 start_index = 1; + int64 end_index = 2; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition_pb2.py new file mode 100644 index 0000000..d7ad59c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition_pb2.py @@ -0,0 +1,76 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nIdiplomacy_tensorflow/contrib/cloud/kernels/bigquery_table_partition.proto\x12\x14\x64iplomacy.tensorflow\"@\n\x16\x42igQueryTablePartition\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x62\x06proto3') +) + + + + +_BIGQUERYTABLEPARTITION = _descriptor.Descriptor( + name='BigQueryTablePartition', + full_name='diplomacy.tensorflow.BigQueryTablePartition', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='start_index', full_name='diplomacy.tensorflow.BigQueryTablePartition.start_index', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='end_index', full_name='diplomacy.tensorflow.BigQueryTablePartition.end_index', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=99, + serialized_end=163, +) + +DESCRIPTOR.message_types_by_name['BigQueryTablePartition'] = _BIGQUERYTABLEPARTITION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +BigQueryTablePartition = _reflection.GeneratedProtocolMessageType('BigQueryTablePartition', (_message.Message,), dict( + DESCRIPTOR = _BIGQUERYTABLEPARTITION, + __module__ = 'diplomacy_tensorflow.contrib.cloud.kernels.bigquery_table_partition_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.BigQueryTablePartition) + )) +_sym_db.RegisterMessage(BigQueryTablePartition) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.cc new file mode 100644 index 0000000..7a3d6db --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.cc @@ -0,0 +1,7989 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto + +#include "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Averaging; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ModelAndFeatures_FeaturesEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ObliqueFeatures; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SparseVector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SparseVector_SparseValueEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Summation; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Value; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Vector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_DecisionTree; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_FeatureId; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_ModelAndFeatures_Feature; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_BinaryNode; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_InequalityTest; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Leaf; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_TreeNode; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<5> scc_info_Ensemble; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto +namespace protobuf_google_2fprotobuf_2fany_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fany_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Any; +} // namespace protobuf_google_2fprotobuf_2fany_2eproto +namespace protobuf_google_2fprotobuf_2fwrappers_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fwrappers_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Int32Value; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fwrappers_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_StringValue; +} // namespace protobuf_google_2fprotobuf_2fwrappers_2eproto +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { +class ModelDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::decision_trees::DecisionTree* decision_tree_; + const ::diplomacy::tensorflow::decision_trees::Ensemble* ensemble_; + const ::google::protobuf::Any* custom_model_; +} _Model_default_instance_; +class ModelAndFeatures_FeatureDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ModelAndFeatures_Feature_default_instance_; +class ModelAndFeatures_FeaturesEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ModelAndFeatures_FeaturesEntry_DoNotUse_default_instance_; +class ModelAndFeaturesDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ModelAndFeatures_default_instance_; +class Ensemble_MemberDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Ensemble_Member_default_instance_; +class EnsembleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::decision_trees::Summation* summation_combination_technique_; + const ::diplomacy::tensorflow::decision_trees::Averaging* averaging_combination_technique_; + const ::google::protobuf::Any* custom_combination_technique_; +} _Ensemble_default_instance_; +class SummationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Summation_default_instance_; +class AveragingDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Averaging_default_instance_; +class DecisionTreeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DecisionTree_default_instance_; +class TreeNodeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::decision_trees::BinaryNode* binary_node_; + const ::diplomacy::tensorflow::decision_trees::Leaf* leaf_; + const ::google::protobuf::Any* custom_node_type_; +} _TreeNode_default_instance_; +class BinaryNodeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::decision_trees::InequalityTest* inequality_left_child_test_; + const ::google::protobuf::Any* custom_left_child_test_; +} _BinaryNode_default_instance_; +class SparseVector_SparseValueEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SparseVector_SparseValueEntry_DoNotUse_default_instance_; +class SparseVectorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SparseVector_default_instance_; +class VectorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Vector_default_instance_; +class LeafDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::decision_trees::Vector* vector_; + const ::diplomacy::tensorflow::decision_trees::SparseVector* sparse_vector_; +} _Leaf_default_instance_; +class FeatureIdDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FeatureId_default_instance_; +class ObliqueFeaturesDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ObliqueFeatures_default_instance_; +class InequalityTestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::decision_trees::FeatureId* feature_id_; + const ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* oblique_; +} _InequalityTest_default_instance_; +class ValueDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + float float_value_; + double double_value_; + ::google::protobuf::int32 int32_value_; + ::google::protobuf::int64 int64_value_; + const ::google::protobuf::Any* custom_value_; +} _Value_default_instance_; +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto { +static void InitDefaultsModelAndFeatures_Feature() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_Feature_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_ModelAndFeatures_Feature = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsModelAndFeatures_Feature}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_FeatureId.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsModelAndFeatures_FeaturesEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_FeaturesEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse(); + } + ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ModelAndFeatures_FeaturesEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsModelAndFeatures_FeaturesEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures_Feature.base,}}; + +static void InitDefaultsModelAndFeatures() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::ModelAndFeatures(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::ModelAndFeatures::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_ModelAndFeatures = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsModelAndFeatures}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures_FeaturesEntry_DoNotUse.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsEnsemble() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Model_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Model(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Ensemble_Member_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Ensemble_Member(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Ensemble_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Ensemble(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::Model::InitAsDefaultInstance(); + ::diplomacy::tensorflow::decision_trees::Ensemble_Member::InitAsDefaultInstance(); + ::diplomacy::tensorflow::decision_trees::Ensemble::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<5> scc_info_Ensemble = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 5, InitDefaultsEnsemble}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Summation.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Averaging.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base, + &protobuf_google_2fprotobuf_2fwrappers_2eproto::scc_info_Int32Value.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_DecisionTree.base,}}; + +static void InitDefaultsSummation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Summation_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Summation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::Summation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Summation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSummation}, { + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsAveraging() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Averaging_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Averaging(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::Averaging::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Averaging = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsAveraging}, { + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsDecisionTree() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_DecisionTree_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::DecisionTree(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::DecisionTree::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_DecisionTree = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsDecisionTree}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_TreeNode.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsTreeNode() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::TreeNode(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::TreeNode::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_TreeNode = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsTreeNode}, { + &protobuf_google_2fprotobuf_2fwrappers_2eproto::scc_info_Int32Value.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_BinaryNode.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Leaf.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsBinaryNode() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::BinaryNode(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::BinaryNode::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_BinaryNode = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsBinaryNode}, { + &protobuf_google_2fprotobuf_2fwrappers_2eproto::scc_info_Int32Value.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_InequalityTest.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsSparseVector_SparseValueEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_SparseVector_SparseValueEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse(); + } + ::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SparseVector_SparseValueEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSparseVector_SparseValueEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Value.base,}}; + +static void InitDefaultsSparseVector() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_SparseVector_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::SparseVector(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::SparseVector::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SparseVector = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSparseVector}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_SparseVector_SparseValueEntry_DoNotUse.base,}}; + +static void InitDefaultsVector() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Vector_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Vector(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::Vector::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Vector = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsVector}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Value.base,}}; + +static void InitDefaultsLeaf() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Leaf_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Leaf(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::Leaf::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_Leaf = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsLeaf}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Vector.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_SparseVector.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsFeatureId() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_FeatureId_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::FeatureId(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::FeatureId::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_FeatureId = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFeatureId}, { + &protobuf_google_2fprotobuf_2fwrappers_2eproto::scc_info_StringValue.base, + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +static void InitDefaultsObliqueFeatures() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_ObliqueFeatures_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::ObliqueFeatures(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ObliqueFeatures = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsObliqueFeatures}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_FeatureId.base,}}; + +static void InitDefaultsInequalityTest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_InequalityTest_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::InequalityTest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::InequalityTest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_InequalityTest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsInequalityTest}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_FeatureId.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ObliqueFeatures.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Value.base,}}; + +static void InitDefaultsValue() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_Value_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::Value(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::Value::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Value = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsValue}, { + &protobuf_google_2fprotobuf_2fany_2eproto::scc_info_Any.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_ModelAndFeatures_Feature.base); + ::google::protobuf::internal::InitSCC(&scc_info_ModelAndFeatures_FeaturesEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ModelAndFeatures.base); + ::google::protobuf::internal::InitSCC(&scc_info_Ensemble.base); + ::google::protobuf::internal::InitSCC(&scc_info_Summation.base); + ::google::protobuf::internal::InitSCC(&scc_info_Averaging.base); + ::google::protobuf::internal::InitSCC(&scc_info_DecisionTree.base); + ::google::protobuf::internal::InitSCC(&scc_info_TreeNode.base); + ::google::protobuf::internal::InitSCC(&scc_info_BinaryNode.base); + ::google::protobuf::internal::InitSCC(&scc_info_SparseVector_SparseValueEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_SparseVector.base); + ::google::protobuf::internal::InitSCC(&scc_info_Vector.base); + ::google::protobuf::internal::InitSCC(&scc_info_Leaf.base); + ::google::protobuf::internal::InitSCC(&scc_info_FeatureId.base); + ::google::protobuf::internal::InitSCC(&scc_info_ObliqueFeatures.base); + ::google::protobuf::internal::InitSCC(&scc_info_InequalityTest.base); + ::google::protobuf::internal::InitSCC(&scc_info_Value.base); +} + +::google::protobuf::Metadata file_level_metadata[19]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Model, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Model, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::decision_trees::ModelDefaultTypeInternal, decision_tree_), + offsetof(::diplomacy::tensorflow::decision_trees::ModelDefaultTypeInternal, ensemble_), + offsetof(::diplomacy::tensorflow::decision_trees::ModelDefaultTypeInternal, custom_model_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Model, additional_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Model, model_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature, feature_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature, additional_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures, features_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures, model_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ModelAndFeatures, additional_data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble_Member, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble_Member, submodel_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble_Member, submodel_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble_Member, additional_data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble, members_), + offsetof(::diplomacy::tensorflow::decision_trees::EnsembleDefaultTypeInternal, summation_combination_technique_), + offsetof(::diplomacy::tensorflow::decision_trees::EnsembleDefaultTypeInternal, averaging_combination_technique_), + offsetof(::diplomacy::tensorflow::decision_trees::EnsembleDefaultTypeInternal, custom_combination_technique_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble, additional_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Ensemble, combination_technique_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Summation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Summation, additional_data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Averaging, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Averaging, additional_data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::DecisionTree, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::DecisionTree, nodes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::DecisionTree, additional_data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::TreeNode, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::TreeNode, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::TreeNode, node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::TreeNode, depth_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::TreeNode, subtree_size_), + offsetof(::diplomacy::tensorflow::decision_trees::TreeNodeDefaultTypeInternal, binary_node_), + offsetof(::diplomacy::tensorflow::decision_trees::TreeNodeDefaultTypeInternal, leaf_), + offsetof(::diplomacy::tensorflow::decision_trees::TreeNodeDefaultTypeInternal, custom_node_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::TreeNode, additional_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::TreeNode, node_type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::BinaryNode, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::BinaryNode, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::BinaryNode, left_child_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::BinaryNode, right_child_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::BinaryNode, default_direction_), + offsetof(::diplomacy::tensorflow::decision_trees::BinaryNodeDefaultTypeInternal, inequality_left_child_test_), + offsetof(::diplomacy::tensorflow::decision_trees::BinaryNodeDefaultTypeInternal, custom_left_child_test_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::BinaryNode, left_child_test_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::SparseVector, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::SparseVector, sparse_value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Vector, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Vector, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Leaf, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Leaf, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::decision_trees::LeafDefaultTypeInternal, vector_), + offsetof(::diplomacy::tensorflow::decision_trees::LeafDefaultTypeInternal, sparse_vector_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Leaf, additional_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Leaf, leaf_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::FeatureId, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::FeatureId, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::FeatureId, additional_data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ObliqueFeatures, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ObliqueFeatures, features_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::ObliqueFeatures, weights_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::InequalityTest, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::InequalityTest, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::decision_trees::InequalityTestDefaultTypeInternal, feature_id_), + offsetof(::diplomacy::tensorflow::decision_trees::InequalityTestDefaultTypeInternal, oblique_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::InequalityTest, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::InequalityTest, threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::InequalityTest, FeatureSum_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Value, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Value, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::decision_trees::ValueDefaultTypeInternal, float_value_), + offsetof(::diplomacy::tensorflow::decision_trees::ValueDefaultTypeInternal, double_value_), + offsetof(::diplomacy::tensorflow::decision_trees::ValueDefaultTypeInternal, int32_value_), + offsetof(::diplomacy::tensorflow::decision_trees::ValueDefaultTypeInternal, int64_value_), + offsetof(::diplomacy::tensorflow::decision_trees::ValueDefaultTypeInternal, custom_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::Value, value_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::decision_trees::Model)}, + { 10, -1, sizeof(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature)}, + { 17, 24, sizeof(::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse)}, + { 26, -1, sizeof(::diplomacy::tensorflow::decision_trees::ModelAndFeatures)}, + { 34, -1, sizeof(::diplomacy::tensorflow::decision_trees::Ensemble_Member)}, + { 42, -1, sizeof(::diplomacy::tensorflow::decision_trees::Ensemble)}, + { 53, -1, sizeof(::diplomacy::tensorflow::decision_trees::Summation)}, + { 59, -1, sizeof(::diplomacy::tensorflow::decision_trees::Averaging)}, + { 65, -1, sizeof(::diplomacy::tensorflow::decision_trees::DecisionTree)}, + { 72, -1, sizeof(::diplomacy::tensorflow::decision_trees::TreeNode)}, + { 85, -1, sizeof(::diplomacy::tensorflow::decision_trees::BinaryNode)}, + { 96, 103, sizeof(::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse)}, + { 105, -1, sizeof(::diplomacy::tensorflow::decision_trees::SparseVector)}, + { 111, -1, sizeof(::diplomacy::tensorflow::decision_trees::Vector)}, + { 117, -1, sizeof(::diplomacy::tensorflow::decision_trees::Leaf)}, + { 126, -1, sizeof(::diplomacy::tensorflow::decision_trees::FeatureId)}, + { 133, -1, sizeof(::diplomacy::tensorflow::decision_trees::ObliqueFeatures)}, + { 140, -1, sizeof(::diplomacy::tensorflow::decision_trees::InequalityTest)}, + { 150, -1, sizeof(::diplomacy::tensorflow::decision_trees::Value)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Model_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_Feature_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_FeaturesEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Ensemble_Member_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Ensemble_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Summation_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Averaging_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_DecisionTree_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_SparseVector_SparseValueEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_SparseVector_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Vector_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Leaf_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_FeatureId_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_ObliqueFeatures_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_InequalityTest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_Value_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 19); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nJdiplomacy_tensorflow/contrib/decision_" + "trees/proto/generic_tree_model.proto\022#di" + "plomacy.tensorflow.decision_trees\032\031googl" + "e/protobuf/any.proto\032\036google/protobuf/wr" + "appers.proto\"\374\001\n\005Model\022J\n\rdecision_tree\030" + "\001 \001(\01321.diplomacy.tensorflow.decision_tr" + "ees.DecisionTreeH\000\022A\n\010ensemble\030\002 \001(\0132-.d" + "iplomacy.tensorflow.decision_trees.Ensem" + "bleH\000\022,\n\014custom_model\030\003 \001(\0132\024.google.pro" + "tobuf.AnyH\000\022-\n\017additional_data\030\004 \003(\0132\024.g" + "oogle.protobuf.AnyB\007\n\005model\"\306\003\n\020ModelAnd" + "Features\022U\n\010features\030\001 \003(\0132C.diplomacy.t" + "ensorflow.decision_trees.ModelAndFeature" + "s.FeaturesEntry\0229\n\005model\030\002 \001(\0132*.diploma" + "cy.tensorflow.decision_trees.Model\022-\n\017ad" + "ditional_data\030\003 \003(\0132\024.google.protobuf.An" + "y\032\200\001\n\007Feature\022F\n\nfeature_id\030\001 \001(\0132..dipl" + "omacy.tensorflow.decision_trees.FeatureI" + "dB\002\030\001\022-\n\017additional_data\030\002 \003(\0132\024.google." + "protobuf.Any\032n\n\rFeaturesEntry\022\013\n\003key\030\001 \001" + "(\t\022L\n\005value\030\002 \001(\0132=.diplomacy.tensorflow" + ".decision_trees.ModelAndFeatures.Feature" + ":\0028\001\"\267\004\n\010Ensemble\022E\n\007members\030d \003(\01324.dip" + "lomacy.tensorflow.decision_trees.Ensembl" + "e.Member\022Y\n\037summation_combination_techni" + "que\030\001 \001(\0132..diplomacy.tensorflow.decisio" + "n_trees.SummationH\000\022Y\n\037averaging_combina" + "tion_technique\030\002 \001(\0132..diplomacy.tensorf" + "low.decision_trees.AveragingH\000\022<\n\034custom" + "_combination_technique\030\003 \001(\0132\024.google.pr" + "otobuf.AnyH\000\022-\n\017additional_data\030\004 \003(\0132\024." + "google.protobuf.Any\032\247\001\n\006Member\022<\n\010submod" + "el\030\001 \001(\0132*.diplomacy.tensorflow.decision" + "_trees.Model\0220\n\013submodel_id\030\002 \001(\0132\033.goog" + "le.protobuf.Int32Value\022-\n\017additional_dat" + "a\030\003 \003(\0132\024.google.protobuf.AnyB\027\n\025combina" + "tion_technique\":\n\tSummation\022-\n\017additiona" + "l_data\030\001 \003(\0132\024.google.protobuf.Any\":\n\tAv" + "eraging\022-\n\017additional_data\030\001 \003(\0132\024.googl" + "e.protobuf.Any\"{\n\014DecisionTree\022<\n\005nodes\030" + "\001 \003(\0132-.diplomacy.tensorflow.decision_tr" + "ees.TreeNode\022-\n\017additional_data\030\002 \003(\0132\024." + "google.protobuf.Any\"\210\003\n\010TreeNode\022,\n\007node" + "_id\030\001 \001(\0132\033.google.protobuf.Int32Value\022*" + "\n\005depth\030\002 \001(\0132\033.google.protobuf.Int32Val" + "ue\0221\n\014subtree_size\030\003 \001(\0132\033.google.protob" + "uf.Int32Value\022F\n\013binary_node\030\004 \001(\0132/.dip" + "lomacy.tensorflow.decision_trees.BinaryN" + "odeH\000\0229\n\004leaf\030\005 \001(\0132).diplomacy.tensorfl" + "ow.decision_trees.LeafH\000\0220\n\020custom_node_" + "type\030\006 \001(\0132\024.google.protobuf.AnyH\000\022-\n\017ad" + "ditional_data\030\007 \003(\0132\024.google.protobuf.An" + "yB\013\n\tnode_type\"\223\003\n\nBinaryNode\0222\n\rleft_ch" + "ild_id\030\001 \001(\0132\033.google.protobuf.Int32Valu" + "e\0223\n\016right_child_id\030\002 \001(\0132\033.google.proto" + "buf.Int32Value\022T\n\021default_direction\030\003 \001(" + "\01629.diplomacy.tensorflow.decision_trees." + "BinaryNode.Direction\022Y\n\032inequality_left_" + "child_test\030\004 \001(\01323.diplomacy.tensorflow." + "decision_trees.InequalityTestH\000\0226\n\026custo" + "m_left_child_test\030\005 \001(\0132\024.google.protobu" + "f.AnyH\000\" \n\tDirection\022\010\n\004LEFT\020\000\022\t\n\005RIGHT\020" + "\001B\021\n\017left_child_test\"\310\001\n\014SparseVector\022X\n" + "\014sparse_value\030\001 \003(\0132B.diplomacy.tensorfl" + "ow.decision_trees.SparseVector.SparseVal" + "ueEntry\032^\n\020SparseValueEntry\022\013\n\003key\030\001 \001(\003" + "\0229\n\005value\030\002 \001(\0132*.diplomacy.tensorflow.d" + "ecision_trees.Value:\0028\001\"C\n\006Vector\0229\n\005val" + "ue\030\001 \003(\0132*.diplomacy.tensorflow.decision" + "_trees.Value\"\310\001\n\004Leaf\022=\n\006vector\030\001 \001(\0132+." + "diplomacy.tensorflow.decision_trees.Vect" + "orH\000\022J\n\rsparse_vector\030\002 \001(\01321.diplomacy." + "tensorflow.decision_trees.SparseVectorH\000" + "\022-\n\017additional_data\030\003 \003(\0132\024.google.proto" + "buf.AnyB\006\n\004leaf\"d\n\tFeatureId\022(\n\002id\030\001 \001(\013" + "2\034.google.protobuf.StringValue\022-\n\017additi" + "onal_data\030\002 \003(\0132\024.google.protobuf.Any\"d\n" + "\017ObliqueFeatures\022@\n\010features\030\001 \003(\0132..dip" + "lomacy.tensorflow.decision_trees.Feature" + "Id\022\017\n\007weights\030\002 \003(\002\"\206\003\n\016InequalityTest\022D" + "\n\nfeature_id\030\001 \001(\0132..diplomacy.tensorflo" + "w.decision_trees.FeatureIdH\000\022G\n\007oblique\030" + "\004 \001(\01324.diplomacy.tensorflow.decision_tr" + "ees.ObliqueFeaturesH\000\022F\n\004type\030\002 \001(\01628.di" + "plomacy.tensorflow.decision_trees.Inequa" + "lityTest.Type\022=\n\tthreshold\030\003 \001(\0132*.diplo" + "macy.tensorflow.decision_trees.Value\"P\n\004" + "Type\022\021\n\rLESS_OR_EQUAL\020\000\022\r\n\tLESS_THAN\020\001\022\024" + "\n\020GREATER_OR_EQUAL\020\002\022\020\n\014GREATER_THAN\020\003B\014" + "\n\nFeatureSum\"\233\001\n\005Value\022\025\n\013float_value\030\001 " + "\001(\002H\000\022\026\n\014double_value\030\002 \001(\001H\000\022\025\n\013int32_v" + "alue\030\003 \001(\005H\000\022\025\n\013int64_value\030\004 \001(\003H\000\022,\n\014c" + "ustom_value\030\005 \001(\0132\024.google.protobuf.AnyH" + "\000B\007\n\005valueB\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 3743); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto", &protobuf_RegisterTypes); + ::protobuf_google_2fprotobuf_2fany_2eproto::AddDescriptors(); + ::protobuf_google_2fprotobuf_2fwrappers_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { +const ::google::protobuf::EnumDescriptor* BinaryNode_Direction_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_enum_descriptors[0]; +} +bool BinaryNode_Direction_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const BinaryNode_Direction BinaryNode::LEFT; +const BinaryNode_Direction BinaryNode::RIGHT; +const BinaryNode_Direction BinaryNode::Direction_MIN; +const BinaryNode_Direction BinaryNode::Direction_MAX; +const int BinaryNode::Direction_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* InequalityTest_Type_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_enum_descriptors[1]; +} +bool InequalityTest_Type_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const InequalityTest_Type InequalityTest::LESS_OR_EQUAL; +const InequalityTest_Type InequalityTest::LESS_THAN; +const InequalityTest_Type InequalityTest::GREATER_OR_EQUAL; +const InequalityTest_Type InequalityTest::GREATER_THAN; +const InequalityTest_Type InequalityTest::Type_MIN; +const InequalityTest_Type InequalityTest::Type_MAX; +const int InequalityTest::Type_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void Model::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_Model_default_instance_.decision_tree_ = const_cast< ::diplomacy::tensorflow::decision_trees::DecisionTree*>( + ::diplomacy::tensorflow::decision_trees::DecisionTree::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_Model_default_instance_.ensemble_ = const_cast< ::diplomacy::tensorflow::decision_trees::Ensemble*>( + ::diplomacy::tensorflow::decision_trees::Ensemble::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_Model_default_instance_.custom_model_ = const_cast< ::google::protobuf::Any*>( + ::google::protobuf::Any::internal_default_instance()); +} +void Model::set_allocated_decision_tree(::diplomacy::tensorflow::decision_trees::DecisionTree* decision_tree) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_model(); + if (decision_tree) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(decision_tree); + if (message_arena != submessage_arena) { + decision_tree = ::google::protobuf::internal::GetOwnedMessage( + message_arena, decision_tree, submessage_arena); + } + set_has_decision_tree(); + model_.decision_tree_ = decision_tree; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Model.decision_tree) +} +void Model::set_allocated_ensemble(::diplomacy::tensorflow::decision_trees::Ensemble* ensemble) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_model(); + if (ensemble) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(ensemble); + if (message_arena != submessage_arena) { + ensemble = ::google::protobuf::internal::GetOwnedMessage( + message_arena, ensemble, submessage_arena); + } + set_has_ensemble(); + model_.ensemble_ = ensemble; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Model.ensemble) +} +void Model::set_allocated_custom_model(::google::protobuf::Any* custom_model) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_model(); + if (custom_model) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + custom_model = ::google::protobuf::internal::GetOwnedMessage( + message_arena, custom_model, submessage_arena); + } + set_has_custom_model(); + model_.custom_model_ = custom_model; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Model.custom_model) +} +void Model::clear_custom_model() { + if (has_custom_model()) { + if (GetArenaNoVirtual() == NULL) { + delete model_.custom_model_; + } + clear_has_model(); + } +} +void Model::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Model::kDecisionTreeFieldNumber; +const int Model::kEnsembleFieldNumber; +const int Model::kCustomModelFieldNumber; +const int Model::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Model::Model() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Model) +} +Model::Model(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Model) +} +Model::Model(const Model& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_model(); + switch (from.model_case()) { + case kDecisionTree: { + mutable_decision_tree()->::diplomacy::tensorflow::decision_trees::DecisionTree::MergeFrom(from.decision_tree()); + break; + } + case kEnsemble: { + mutable_ensemble()->::diplomacy::tensorflow::decision_trees::Ensemble::MergeFrom(from.ensemble()); + break; + } + case kCustomModel: { + mutable_custom_model()->::google::protobuf::Any::MergeFrom(from.custom_model()); + break; + } + case MODEL_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Model) +} + +void Model::SharedCtor() { + clear_has_model(); +} + +Model::~Model() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Model) + SharedDtor(); +} + +void Model::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_model()) { + clear_model(); + } +} + +void Model::ArenaDtor(void* object) { + Model* _this = reinterpret_cast< Model* >(object); + (void)_this; +} +void Model::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Model::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Model::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Model& Model::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + return *internal_default_instance(); +} + + +void Model::clear_model() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.decision_trees.Model) + switch (model_case()) { + case kDecisionTree: { + if (GetArenaNoVirtual() == NULL) { + delete model_.decision_tree_; + } + break; + } + case kEnsemble: { + if (GetArenaNoVirtual() == NULL) { + delete model_.ensemble_; + } + break; + } + case kCustomModel: { + if (GetArenaNoVirtual() == NULL) { + delete model_.custom_model_; + } + break; + } + case MODEL_NOT_SET: { + break; + } + } + _oneof_case_[0] = MODEL_NOT_SET; +} + + +void Model::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Model) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + clear_model(); + _internal_metadata_.Clear(); +} + +bool Model::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Model) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.DecisionTree decision_tree = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_decision_tree())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.Ensemble ensemble = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_ensemble())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Any custom_model = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_custom_model())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Model) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Model) + return false; +#undef DO_ +} + +void Model::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Model) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.DecisionTree decision_tree = 1; + if (has_decision_tree()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_decision_tree(), output); + } + + // .diplomacy.tensorflow.decision_trees.Ensemble ensemble = 2; + if (has_ensemble()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_ensemble(), output); + } + + // .google.protobuf.Any custom_model = 3; + if (has_custom_model()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_custom_model(), output); + } + + // repeated .google.protobuf.Any additional_data = 4; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Model) +} + +::google::protobuf::uint8* Model::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Model) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.DecisionTree decision_tree = 1; + if (has_decision_tree()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_decision_tree(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.Ensemble ensemble = 2; + if (has_ensemble()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_ensemble(), deterministic, target); + } + + // .google.protobuf.Any custom_model = 3; + if (has_custom_model()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_custom_model(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 4; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Model) + return target; +} + +size_t Model::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Model) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 4; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + switch (model_case()) { + // .diplomacy.tensorflow.decision_trees.DecisionTree decision_tree = 1; + case kDecisionTree: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *model_.decision_tree_); + break; + } + // .diplomacy.tensorflow.decision_trees.Ensemble ensemble = 2; + case kEnsemble: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *model_.ensemble_); + break; + } + // .google.protobuf.Any custom_model = 3; + case kCustomModel: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *model_.custom_model_); + break; + } + case MODEL_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Model::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Model) + GOOGLE_DCHECK_NE(&from, this); + const Model* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Model) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Model) + MergeFrom(*source); + } +} + +void Model::MergeFrom(const Model& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Model) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); + switch (from.model_case()) { + case kDecisionTree: { + mutable_decision_tree()->::diplomacy::tensorflow::decision_trees::DecisionTree::MergeFrom(from.decision_tree()); + break; + } + case kEnsemble: { + mutable_ensemble()->::diplomacy::tensorflow::decision_trees::Ensemble::MergeFrom(from.ensemble()); + break; + } + case kCustomModel: { + mutable_custom_model()->::google::protobuf::Any::MergeFrom(from.custom_model()); + break; + } + case MODEL_NOT_SET: { + break; + } + } +} + +void Model::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Model) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Model::CopyFrom(const Model& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Model) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Model::IsInitialized() const { + return true; +} + +void Model::Swap(Model* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Model* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Model::UnsafeArenaSwap(Model* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Model::InternalSwap(Model* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + swap(model_, other->model_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Model::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ModelAndFeatures_Feature::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_Feature_default_instance_._instance.get_mutable()->feature_id_ = const_cast< ::diplomacy::tensorflow::decision_trees::FeatureId*>( + ::diplomacy::tensorflow::decision_trees::FeatureId::internal_default_instance()); +} +void ModelAndFeatures_Feature::unsafe_arena_set_allocated_feature_id( + ::diplomacy::tensorflow::decision_trees::FeatureId* feature_id) { + if (GetArenaNoVirtual() == NULL) { + delete feature_id_; + } + feature_id_ = feature_id; + if (feature_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.feature_id) +} +void ModelAndFeatures_Feature::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ModelAndFeatures_Feature::kFeatureIdFieldNumber; +const int ModelAndFeatures_Feature::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ModelAndFeatures_Feature::ModelAndFeatures_Feature() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures_Feature.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) +} +ModelAndFeatures_Feature::ModelAndFeatures_Feature(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures_Feature.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) +} +ModelAndFeatures_Feature::ModelAndFeatures_Feature(const ModelAndFeatures_Feature& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_feature_id()) { + feature_id_ = new ::diplomacy::tensorflow::decision_trees::FeatureId(*from.feature_id_); + } else { + feature_id_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) +} + +void ModelAndFeatures_Feature::SharedCtor() { + feature_id_ = NULL; +} + +ModelAndFeatures_Feature::~ModelAndFeatures_Feature() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + SharedDtor(); +} + +void ModelAndFeatures_Feature::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete feature_id_; +} + +void ModelAndFeatures_Feature::ArenaDtor(void* object) { + ModelAndFeatures_Feature* _this = reinterpret_cast< ModelAndFeatures_Feature* >(object); + (void)_this; +} +void ModelAndFeatures_Feature::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ModelAndFeatures_Feature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ModelAndFeatures_Feature::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ModelAndFeatures_Feature& ModelAndFeatures_Feature::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures_Feature.base); + return *internal_default_instance(); +} + + +void ModelAndFeatures_Feature::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + if (GetArenaNoVirtual() == NULL && feature_id_ != NULL) { + delete feature_id_; + } + feature_id_ = NULL; + _internal_metadata_.Clear(); +} + +bool ModelAndFeatures_Feature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1 [deprecated = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_feature_id())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + return false; +#undef DO_ +} + +void ModelAndFeatures_Feature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1 [deprecated = true]; + if (this->has_feature_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_feature_id(), output); + } + + // repeated .google.protobuf.Any additional_data = 2; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) +} + +::google::protobuf::uint8* ModelAndFeatures_Feature::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1 [deprecated = true]; + if (this->has_feature_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_feature_id(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 2; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + return target; +} + +size_t ModelAndFeatures_Feature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 2; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1 [deprecated = true]; + if (this->has_feature_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *feature_id_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ModelAndFeatures_Feature::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + GOOGLE_DCHECK_NE(&from, this); + const ModelAndFeatures_Feature* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + MergeFrom(*source); + } +} + +void ModelAndFeatures_Feature::MergeFrom(const ModelAndFeatures_Feature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); + if (from.has_feature_id()) { + mutable_feature_id()->::diplomacy::tensorflow::decision_trees::FeatureId::MergeFrom(from.feature_id()); + } +} + +void ModelAndFeatures_Feature::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ModelAndFeatures_Feature::CopyFrom(const ModelAndFeatures_Feature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ModelAndFeatures_Feature::IsInitialized() const { + return true; +} + +void ModelAndFeatures_Feature::Swap(ModelAndFeatures_Feature* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ModelAndFeatures_Feature* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ModelAndFeatures_Feature::UnsafeArenaSwap(ModelAndFeatures_Feature* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ModelAndFeatures_Feature::InternalSwap(ModelAndFeatures_Feature* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + swap(feature_id_, other->feature_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ModelAndFeatures_Feature::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +ModelAndFeatures_FeaturesEntry_DoNotUse::ModelAndFeatures_FeaturesEntry_DoNotUse() {} +ModelAndFeatures_FeaturesEntry_DoNotUse::ModelAndFeatures_FeaturesEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void ModelAndFeatures_FeaturesEntry_DoNotUse::MergeFrom(const ModelAndFeatures_FeaturesEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata ModelAndFeatures_FeaturesEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[2]; +} +void ModelAndFeatures_FeaturesEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void ModelAndFeatures::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_ModelAndFeatures_default_instance_._instance.get_mutable()->model_ = const_cast< ::diplomacy::tensorflow::decision_trees::Model*>( + ::diplomacy::tensorflow::decision_trees::Model::internal_default_instance()); +} +void ModelAndFeatures::unsafe_arena_set_allocated_model( + ::diplomacy::tensorflow::decision_trees::Model* model) { + if (GetArenaNoVirtual() == NULL) { + delete model_; + } + model_ = model; + if (model) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.ModelAndFeatures.model) +} +void ModelAndFeatures::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ModelAndFeatures::kFeaturesFieldNumber; +const int ModelAndFeatures::kModelFieldNumber; +const int ModelAndFeatures::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ModelAndFeatures::ModelAndFeatures() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures) +} +ModelAndFeatures::ModelAndFeatures(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + features_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures) +} +ModelAndFeatures::ModelAndFeatures(const ModelAndFeatures& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + features_.MergeFrom(from.features_); + if (from.has_model()) { + model_ = new ::diplomacy::tensorflow::decision_trees::Model(*from.model_); + } else { + model_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures) +} + +void ModelAndFeatures::SharedCtor() { + model_ = NULL; +} + +ModelAndFeatures::~ModelAndFeatures() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + SharedDtor(); +} + +void ModelAndFeatures::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete model_; +} + +void ModelAndFeatures::ArenaDtor(void* object) { + ModelAndFeatures* _this = reinterpret_cast< ModelAndFeatures* >(object); + (void)_this; +} +void ModelAndFeatures::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ModelAndFeatures::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ModelAndFeatures::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ModelAndFeatures& ModelAndFeatures::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ModelAndFeatures.base); + return *internal_default_instance(); +} + + +void ModelAndFeatures::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + features_.Clear(); + additional_data_.Clear(); + if (GetArenaNoVirtual() == NULL && model_ != NULL) { + delete model_; + } + model_ = NULL; + _internal_metadata_.Clear(); +} + +bool ModelAndFeatures::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map features = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + ModelAndFeatures_FeaturesEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + ModelAndFeatures_FeaturesEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature > > parser(&features_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.Model model = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_model())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + return false; +#undef DO_ +} + +void ModelAndFeatures::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map features = 1; + if (!this->features().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->features().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->features().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::const_iterator + it = this->features().begin(); + it != this->features().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(features_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::const_iterator + it = this->features().begin(); + it != this->features().end(); ++it) { + entry.reset(features_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // .diplomacy.tensorflow.decision_trees.Model model = 2; + if (this->has_model()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_model(), output); + } + + // repeated .google.protobuf.Any additional_data = 3; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.ModelAndFeatures) +} + +::google::protobuf::uint8* ModelAndFeatures::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map features = 1; + if (!this->features().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry.key"); + } + }; + + if (deterministic && + this->features().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->features().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::const_iterator + it = this->features().begin(); + it != this->features().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(features_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::const_iterator + it = this->features().begin(); + it != this->features().end(); ++it) { + entry.reset(features_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // .diplomacy.tensorflow.decision_trees.Model model = 2; + if (this->has_model()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_model(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 3; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + return target; +} + +size_t ModelAndFeatures::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map features = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->features_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >::const_iterator + it = this->features().begin(); + it != this->features().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(features_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // repeated .google.protobuf.Any additional_data = 3; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + // .diplomacy.tensorflow.decision_trees.Model model = 2; + if (this->has_model()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *model_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ModelAndFeatures::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + GOOGLE_DCHECK_NE(&from, this); + const ModelAndFeatures* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + MergeFrom(*source); + } +} + +void ModelAndFeatures::MergeFrom(const ModelAndFeatures& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + features_.MergeFrom(from.features_); + additional_data_.MergeFrom(from.additional_data_); + if (from.has_model()) { + mutable_model()->::diplomacy::tensorflow::decision_trees::Model::MergeFrom(from.model()); + } +} + +void ModelAndFeatures::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ModelAndFeatures::CopyFrom(const ModelAndFeatures& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ModelAndFeatures::IsInitialized() const { + return true; +} + +void ModelAndFeatures::Swap(ModelAndFeatures* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ModelAndFeatures* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ModelAndFeatures::UnsafeArenaSwap(ModelAndFeatures* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ModelAndFeatures::InternalSwap(ModelAndFeatures* other) { + using std::swap; + features_.Swap(&other->features_); + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + swap(model_, other->model_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ModelAndFeatures::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Ensemble_Member::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_Ensemble_Member_default_instance_._instance.get_mutable()->submodel_ = const_cast< ::diplomacy::tensorflow::decision_trees::Model*>( + ::diplomacy::tensorflow::decision_trees::Model::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_Ensemble_Member_default_instance_._instance.get_mutable()->submodel_id_ = const_cast< ::google::protobuf::Int32Value*>( + ::google::protobuf::Int32Value::internal_default_instance()); +} +void Ensemble_Member::unsafe_arena_set_allocated_submodel( + ::diplomacy::tensorflow::decision_trees::Model* submodel) { + if (GetArenaNoVirtual() == NULL) { + delete submodel_; + } + submodel_ = submodel; + if (submodel) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel) +} +void Ensemble_Member::unsafe_arena_set_allocated_submodel_id( + ::google::protobuf::Int32Value* submodel_id) { + if (GetArenaNoVirtual() == NULL) { + delete submodel_id_; + } + submodel_id_ = submodel_id; + if (submodel_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel_id) +} +void Ensemble_Member::clear_submodel_id() { + if (GetArenaNoVirtual() == NULL && submodel_id_ != NULL) { + delete submodel_id_; + } + submodel_id_ = NULL; +} +void Ensemble_Member::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Ensemble_Member::kSubmodelFieldNumber; +const int Ensemble_Member::kSubmodelIdFieldNumber; +const int Ensemble_Member::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Ensemble_Member::Ensemble_Member() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Ensemble.Member) +} +Ensemble_Member::Ensemble_Member(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Ensemble.Member) +} +Ensemble_Member::Ensemble_Member(const Ensemble_Member& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_submodel()) { + submodel_ = new ::diplomacy::tensorflow::decision_trees::Model(*from.submodel_); + } else { + submodel_ = NULL; + } + if (from.has_submodel_id()) { + submodel_id_ = new ::google::protobuf::Int32Value(*from.submodel_id_); + } else { + submodel_id_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Ensemble.Member) +} + +void Ensemble_Member::SharedCtor() { + ::memset(&submodel_, 0, static_cast( + reinterpret_cast(&submodel_id_) - + reinterpret_cast(&submodel_)) + sizeof(submodel_id_)); +} + +Ensemble_Member::~Ensemble_Member() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Ensemble.Member) + SharedDtor(); +} + +void Ensemble_Member::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete submodel_; + if (this != internal_default_instance()) delete submodel_id_; +} + +void Ensemble_Member::ArenaDtor(void* object) { + Ensemble_Member* _this = reinterpret_cast< Ensemble_Member* >(object); + (void)_this; +} +void Ensemble_Member::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Ensemble_Member::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Ensemble_Member::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Ensemble_Member& Ensemble_Member::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + return *internal_default_instance(); +} + + +void Ensemble_Member::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + if (GetArenaNoVirtual() == NULL && submodel_ != NULL) { + delete submodel_; + } + submodel_ = NULL; + if (GetArenaNoVirtual() == NULL && submodel_id_ != NULL) { + delete submodel_id_; + } + submodel_id_ = NULL; + _internal_metadata_.Clear(); +} + +bool Ensemble_Member::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.Model submodel = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_submodel())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Int32Value submodel_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_submodel_id())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Ensemble.Member) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Ensemble.Member) + return false; +#undef DO_ +} + +void Ensemble_Member::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Model submodel = 1; + if (this->has_submodel()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_submodel(), output); + } + + // .google.protobuf.Int32Value submodel_id = 2; + if (this->has_submodel_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_submodel_id(), output); + } + + // repeated .google.protobuf.Any additional_data = 3; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Ensemble.Member) +} + +::google::protobuf::uint8* Ensemble_Member::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Model submodel = 1; + if (this->has_submodel()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_submodel(), deterministic, target); + } + + // .google.protobuf.Int32Value submodel_id = 2; + if (this->has_submodel_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_submodel_id(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 3; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Ensemble.Member) + return target; +} + +size_t Ensemble_Member::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 3; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + // .diplomacy.tensorflow.decision_trees.Model submodel = 1; + if (this->has_submodel()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *submodel_); + } + + // .google.protobuf.Int32Value submodel_id = 2; + if (this->has_submodel_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *submodel_id_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Ensemble_Member::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + GOOGLE_DCHECK_NE(&from, this); + const Ensemble_Member* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Ensemble.Member) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Ensemble.Member) + MergeFrom(*source); + } +} + +void Ensemble_Member::MergeFrom(const Ensemble_Member& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); + if (from.has_submodel()) { + mutable_submodel()->::diplomacy::tensorflow::decision_trees::Model::MergeFrom(from.submodel()); + } + if (from.has_submodel_id()) { + mutable_submodel_id()->::google::protobuf::Int32Value::MergeFrom(from.submodel_id()); + } +} + +void Ensemble_Member::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Ensemble_Member::CopyFrom(const Ensemble_Member& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Ensemble.Member) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Ensemble_Member::IsInitialized() const { + return true; +} + +void Ensemble_Member::Swap(Ensemble_Member* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Ensemble_Member* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Ensemble_Member::UnsafeArenaSwap(Ensemble_Member* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Ensemble_Member::InternalSwap(Ensemble_Member* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + swap(submodel_, other->submodel_); + swap(submodel_id_, other->submodel_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Ensemble_Member::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Ensemble::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_Ensemble_default_instance_.summation_combination_technique_ = const_cast< ::diplomacy::tensorflow::decision_trees::Summation*>( + ::diplomacy::tensorflow::decision_trees::Summation::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_Ensemble_default_instance_.averaging_combination_technique_ = const_cast< ::diplomacy::tensorflow::decision_trees::Averaging*>( + ::diplomacy::tensorflow::decision_trees::Averaging::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_Ensemble_default_instance_.custom_combination_technique_ = const_cast< ::google::protobuf::Any*>( + ::google::protobuf::Any::internal_default_instance()); +} +void Ensemble::set_allocated_summation_combination_technique(::diplomacy::tensorflow::decision_trees::Summation* summation_combination_technique) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_combination_technique(); + if (summation_combination_technique) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(summation_combination_technique); + if (message_arena != submessage_arena) { + summation_combination_technique = ::google::protobuf::internal::GetOwnedMessage( + message_arena, summation_combination_technique, submessage_arena); + } + set_has_summation_combination_technique(); + combination_technique_.summation_combination_technique_ = summation_combination_technique; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.summation_combination_technique) +} +void Ensemble::set_allocated_averaging_combination_technique(::diplomacy::tensorflow::decision_trees::Averaging* averaging_combination_technique) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_combination_technique(); + if (averaging_combination_technique) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(averaging_combination_technique); + if (message_arena != submessage_arena) { + averaging_combination_technique = ::google::protobuf::internal::GetOwnedMessage( + message_arena, averaging_combination_technique, submessage_arena); + } + set_has_averaging_combination_technique(); + combination_technique_.averaging_combination_technique_ = averaging_combination_technique; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.averaging_combination_technique) +} +void Ensemble::set_allocated_custom_combination_technique(::google::protobuf::Any* custom_combination_technique) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_combination_technique(); + if (custom_combination_technique) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + custom_combination_technique = ::google::protobuf::internal::GetOwnedMessage( + message_arena, custom_combination_technique, submessage_arena); + } + set_has_custom_combination_technique(); + combination_technique_.custom_combination_technique_ = custom_combination_technique; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.custom_combination_technique) +} +void Ensemble::clear_custom_combination_technique() { + if (has_custom_combination_technique()) { + if (GetArenaNoVirtual() == NULL) { + delete combination_technique_.custom_combination_technique_; + } + clear_has_combination_technique(); + } +} +void Ensemble::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Ensemble::kMembersFieldNumber; +const int Ensemble::kSummationCombinationTechniqueFieldNumber; +const int Ensemble::kAveragingCombinationTechniqueFieldNumber; +const int Ensemble::kCustomCombinationTechniqueFieldNumber; +const int Ensemble::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Ensemble::Ensemble() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Ensemble) +} +Ensemble::Ensemble(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena), + members_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Ensemble) +} +Ensemble::Ensemble(const Ensemble& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_), + members_(from.members_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_combination_technique(); + switch (from.combination_technique_case()) { + case kSummationCombinationTechnique: { + mutable_summation_combination_technique()->::diplomacy::tensorflow::decision_trees::Summation::MergeFrom(from.summation_combination_technique()); + break; + } + case kAveragingCombinationTechnique: { + mutable_averaging_combination_technique()->::diplomacy::tensorflow::decision_trees::Averaging::MergeFrom(from.averaging_combination_technique()); + break; + } + case kCustomCombinationTechnique: { + mutable_custom_combination_technique()->::google::protobuf::Any::MergeFrom(from.custom_combination_technique()); + break; + } + case COMBINATION_TECHNIQUE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Ensemble) +} + +void Ensemble::SharedCtor() { + clear_has_combination_technique(); +} + +Ensemble::~Ensemble() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Ensemble) + SharedDtor(); +} + +void Ensemble::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_combination_technique()) { + clear_combination_technique(); + } +} + +void Ensemble::ArenaDtor(void* object) { + Ensemble* _this = reinterpret_cast< Ensemble* >(object); + (void)_this; +} +void Ensemble::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Ensemble::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Ensemble::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Ensemble& Ensemble::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Ensemble.base); + return *internal_default_instance(); +} + + +void Ensemble::clear_combination_technique() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.decision_trees.Ensemble) + switch (combination_technique_case()) { + case kSummationCombinationTechnique: { + if (GetArenaNoVirtual() == NULL) { + delete combination_technique_.summation_combination_technique_; + } + break; + } + case kAveragingCombinationTechnique: { + if (GetArenaNoVirtual() == NULL) { + delete combination_technique_.averaging_combination_technique_; + } + break; + } + case kCustomCombinationTechnique: { + if (GetArenaNoVirtual() == NULL) { + delete combination_technique_.custom_combination_technique_; + } + break; + } + case COMBINATION_TECHNIQUE_NOT_SET: { + break; + } + } + _oneof_case_[0] = COMBINATION_TECHNIQUE_NOT_SET; +} + + +void Ensemble::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Ensemble) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + members_.Clear(); + clear_combination_technique(); + _internal_metadata_.Clear(); +} + +bool Ensemble::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Ensemble) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.Summation summation_combination_technique = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_summation_combination_technique())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.Averaging averaging_combination_technique = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_averaging_combination_technique())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Any custom_combination_technique = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_custom_combination_technique())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.decision_trees.Ensemble.Member members = 100; + case 100: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 802 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_members())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Ensemble) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Ensemble) + return false; +#undef DO_ +} + +void Ensemble::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Ensemble) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Summation summation_combination_technique = 1; + if (has_summation_combination_technique()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_summation_combination_technique(), output); + } + + // .diplomacy.tensorflow.decision_trees.Averaging averaging_combination_technique = 2; + if (has_averaging_combination_technique()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_averaging_combination_technique(), output); + } + + // .google.protobuf.Any custom_combination_technique = 3; + if (has_custom_combination_technique()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_custom_combination_technique(), output); + } + + // repeated .google.protobuf.Any additional_data = 4; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->additional_data(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.decision_trees.Ensemble.Member members = 100; + for (unsigned int i = 0, + n = static_cast(this->members_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 100, + this->members(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Ensemble) +} + +::google::protobuf::uint8* Ensemble::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Ensemble) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Summation summation_combination_technique = 1; + if (has_summation_combination_technique()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_summation_combination_technique(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.Averaging averaging_combination_technique = 2; + if (has_averaging_combination_technique()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_averaging_combination_technique(), deterministic, target); + } + + // .google.protobuf.Any custom_combination_technique = 3; + if (has_custom_combination_technique()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_custom_combination_technique(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 4; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->additional_data(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.decision_trees.Ensemble.Member members = 100; + for (unsigned int i = 0, + n = static_cast(this->members_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 100, this->members(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Ensemble) + return target; +} + +size_t Ensemble::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Ensemble) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 4; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.decision_trees.Ensemble.Member members = 100; + { + unsigned int count = static_cast(this->members_size()); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->members(static_cast(i))); + } + } + + switch (combination_technique_case()) { + // .diplomacy.tensorflow.decision_trees.Summation summation_combination_technique = 1; + case kSummationCombinationTechnique: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *combination_technique_.summation_combination_technique_); + break; + } + // .diplomacy.tensorflow.decision_trees.Averaging averaging_combination_technique = 2; + case kAveragingCombinationTechnique: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *combination_technique_.averaging_combination_technique_); + break; + } + // .google.protobuf.Any custom_combination_technique = 3; + case kCustomCombinationTechnique: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *combination_technique_.custom_combination_technique_); + break; + } + case COMBINATION_TECHNIQUE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Ensemble::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Ensemble) + GOOGLE_DCHECK_NE(&from, this); + const Ensemble* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Ensemble) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Ensemble) + MergeFrom(*source); + } +} + +void Ensemble::MergeFrom(const Ensemble& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Ensemble) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); + members_.MergeFrom(from.members_); + switch (from.combination_technique_case()) { + case kSummationCombinationTechnique: { + mutable_summation_combination_technique()->::diplomacy::tensorflow::decision_trees::Summation::MergeFrom(from.summation_combination_technique()); + break; + } + case kAveragingCombinationTechnique: { + mutable_averaging_combination_technique()->::diplomacy::tensorflow::decision_trees::Averaging::MergeFrom(from.averaging_combination_technique()); + break; + } + case kCustomCombinationTechnique: { + mutable_custom_combination_technique()->::google::protobuf::Any::MergeFrom(from.custom_combination_technique()); + break; + } + case COMBINATION_TECHNIQUE_NOT_SET: { + break; + } + } +} + +void Ensemble::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Ensemble) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Ensemble::CopyFrom(const Ensemble& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Ensemble) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Ensemble::IsInitialized() const { + return true; +} + +void Ensemble::Swap(Ensemble* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Ensemble* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Ensemble::UnsafeArenaSwap(Ensemble* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Ensemble::InternalSwap(Ensemble* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + CastToBase(&members_)->InternalSwap(CastToBase(&other->members_)); + swap(combination_technique_, other->combination_technique_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Ensemble::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Summation::InitAsDefaultInstance() { +} +void Summation::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Summation::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Summation::Summation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Summation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Summation) +} +Summation::Summation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Summation.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Summation) +} +Summation::Summation(const Summation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Summation) +} + +void Summation::SharedCtor() { +} + +Summation::~Summation() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Summation) + SharedDtor(); +} + +void Summation::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Summation::ArenaDtor(void* object) { + Summation* _this = reinterpret_cast< Summation* >(object); + (void)_this; +} +void Summation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Summation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Summation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Summation& Summation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Summation.base); + return *internal_default_instance(); +} + + +void Summation::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Summation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + _internal_metadata_.Clear(); +} + +bool Summation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Summation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .google.protobuf.Any additional_data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Summation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Summation) + return false; +#undef DO_ +} + +void Summation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Summation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .google.protobuf.Any additional_data = 1; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Summation) +} + +::google::protobuf::uint8* Summation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Summation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .google.protobuf.Any additional_data = 1; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Summation) + return target; +} + +size_t Summation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Summation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 1; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Summation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Summation) + GOOGLE_DCHECK_NE(&from, this); + const Summation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Summation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Summation) + MergeFrom(*source); + } +} + +void Summation::MergeFrom(const Summation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Summation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); +} + +void Summation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Summation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Summation::CopyFrom(const Summation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Summation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Summation::IsInitialized() const { + return true; +} + +void Summation::Swap(Summation* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Summation* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Summation::UnsafeArenaSwap(Summation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Summation::InternalSwap(Summation* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Summation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Averaging::InitAsDefaultInstance() { +} +void Averaging::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Averaging::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Averaging::Averaging() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Averaging.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Averaging) +} +Averaging::Averaging(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Averaging.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Averaging) +} +Averaging::Averaging(const Averaging& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Averaging) +} + +void Averaging::SharedCtor() { +} + +Averaging::~Averaging() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Averaging) + SharedDtor(); +} + +void Averaging::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Averaging::ArenaDtor(void* object) { + Averaging* _this = reinterpret_cast< Averaging* >(object); + (void)_this; +} +void Averaging::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Averaging::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Averaging::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Averaging& Averaging::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Averaging.base); + return *internal_default_instance(); +} + + +void Averaging::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Averaging) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + _internal_metadata_.Clear(); +} + +bool Averaging::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Averaging) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .google.protobuf.Any additional_data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Averaging) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Averaging) + return false; +#undef DO_ +} + +void Averaging::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Averaging) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .google.protobuf.Any additional_data = 1; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Averaging) +} + +::google::protobuf::uint8* Averaging::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Averaging) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .google.protobuf.Any additional_data = 1; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Averaging) + return target; +} + +size_t Averaging::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Averaging) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 1; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Averaging::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Averaging) + GOOGLE_DCHECK_NE(&from, this); + const Averaging* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Averaging) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Averaging) + MergeFrom(*source); + } +} + +void Averaging::MergeFrom(const Averaging& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Averaging) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); +} + +void Averaging::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Averaging) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Averaging::CopyFrom(const Averaging& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Averaging) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Averaging::IsInitialized() const { + return true; +} + +void Averaging::Swap(Averaging* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Averaging* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Averaging::UnsafeArenaSwap(Averaging* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Averaging::InternalSwap(Averaging* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Averaging::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DecisionTree::InitAsDefaultInstance() { +} +void DecisionTree::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DecisionTree::kNodesFieldNumber; +const int DecisionTree::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DecisionTree::DecisionTree() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_DecisionTree.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.DecisionTree) +} +DecisionTree::DecisionTree(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + nodes_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_DecisionTree.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.DecisionTree) +} +DecisionTree::DecisionTree(const DecisionTree& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + nodes_(from.nodes_), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.DecisionTree) +} + +void DecisionTree::SharedCtor() { +} + +DecisionTree::~DecisionTree() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.DecisionTree) + SharedDtor(); +} + +void DecisionTree::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DecisionTree::ArenaDtor(void* object) { + DecisionTree* _this = reinterpret_cast< DecisionTree* >(object); + (void)_this; +} +void DecisionTree::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DecisionTree::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DecisionTree::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DecisionTree& DecisionTree::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_DecisionTree.base); + return *internal_default_instance(); +} + + +void DecisionTree::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.DecisionTree) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + nodes_.Clear(); + additional_data_.Clear(); + _internal_metadata_.Clear(); +} + +bool DecisionTree::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.DecisionTree) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_nodes())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.DecisionTree) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.DecisionTree) + return false; +#undef DO_ +} + +void DecisionTree::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.DecisionTree) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->nodes(static_cast(i)), + output); + } + + // repeated .google.protobuf.Any additional_data = 2; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.DecisionTree) +} + +::google::protobuf::uint8* DecisionTree::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.DecisionTree) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->nodes(static_cast(i)), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 2; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.DecisionTree) + return target; +} + +size_t DecisionTree::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.DecisionTree) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes = 1; + { + unsigned int count = static_cast(this->nodes_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->nodes(static_cast(i))); + } + } + + // repeated .google.protobuf.Any additional_data = 2; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DecisionTree::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.DecisionTree) + GOOGLE_DCHECK_NE(&from, this); + const DecisionTree* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.DecisionTree) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.DecisionTree) + MergeFrom(*source); + } +} + +void DecisionTree::MergeFrom(const DecisionTree& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.DecisionTree) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + nodes_.MergeFrom(from.nodes_); + additional_data_.MergeFrom(from.additional_data_); +} + +void DecisionTree::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.DecisionTree) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DecisionTree::CopyFrom(const DecisionTree& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.DecisionTree) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DecisionTree::IsInitialized() const { + return true; +} + +void DecisionTree::Swap(DecisionTree* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DecisionTree* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DecisionTree::UnsafeArenaSwap(DecisionTree* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DecisionTree::InternalSwap(DecisionTree* other) { + using std::swap; + CastToBase(&nodes_)->InternalSwap(CastToBase(&other->nodes_)); + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DecisionTree::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TreeNode::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_._instance.get_mutable()->node_id_ = const_cast< ::google::protobuf::Int32Value*>( + ::google::protobuf::Int32Value::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_._instance.get_mutable()->depth_ = const_cast< ::google::protobuf::Int32Value*>( + ::google::protobuf::Int32Value::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_._instance.get_mutable()->subtree_size_ = const_cast< ::google::protobuf::Int32Value*>( + ::google::protobuf::Int32Value::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_.binary_node_ = const_cast< ::diplomacy::tensorflow::decision_trees::BinaryNode*>( + ::diplomacy::tensorflow::decision_trees::BinaryNode::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_.leaf_ = const_cast< ::diplomacy::tensorflow::decision_trees::Leaf*>( + ::diplomacy::tensorflow::decision_trees::Leaf::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_TreeNode_default_instance_.custom_node_type_ = const_cast< ::google::protobuf::Any*>( + ::google::protobuf::Any::internal_default_instance()); +} +void TreeNode::unsafe_arena_set_allocated_node_id( + ::google::protobuf::Int32Value* node_id) { + if (GetArenaNoVirtual() == NULL) { + delete node_id_; + } + node_id_ = node_id; + if (node_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.node_id) +} +void TreeNode::clear_node_id() { + if (GetArenaNoVirtual() == NULL && node_id_ != NULL) { + delete node_id_; + } + node_id_ = NULL; +} +void TreeNode::unsafe_arena_set_allocated_depth( + ::google::protobuf::Int32Value* depth) { + if (GetArenaNoVirtual() == NULL) { + delete depth_; + } + depth_ = depth; + if (depth) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.depth) +} +void TreeNode::clear_depth() { + if (GetArenaNoVirtual() == NULL && depth_ != NULL) { + delete depth_; + } + depth_ = NULL; +} +void TreeNode::unsafe_arena_set_allocated_subtree_size( + ::google::protobuf::Int32Value* subtree_size) { + if (GetArenaNoVirtual() == NULL) { + delete subtree_size_; + } + subtree_size_ = subtree_size; + if (subtree_size) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.subtree_size) +} +void TreeNode::clear_subtree_size() { + if (GetArenaNoVirtual() == NULL && subtree_size_ != NULL) { + delete subtree_size_; + } + subtree_size_ = NULL; +} +void TreeNode::set_allocated_binary_node(::diplomacy::tensorflow::decision_trees::BinaryNode* binary_node) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node_type(); + if (binary_node) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(binary_node); + if (message_arena != submessage_arena) { + binary_node = ::google::protobuf::internal::GetOwnedMessage( + message_arena, binary_node, submessage_arena); + } + set_has_binary_node(); + node_type_.binary_node_ = binary_node; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.binary_node) +} +void TreeNode::set_allocated_leaf(::diplomacy::tensorflow::decision_trees::Leaf* leaf) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node_type(); + if (leaf) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(leaf); + if (message_arena != submessage_arena) { + leaf = ::google::protobuf::internal::GetOwnedMessage( + message_arena, leaf, submessage_arena); + } + set_has_leaf(); + node_type_.leaf_ = leaf; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.leaf) +} +void TreeNode::set_allocated_custom_node_type(::google::protobuf::Any* custom_node_type) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node_type(); + if (custom_node_type) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + custom_node_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, custom_node_type, submessage_arena); + } + set_has_custom_node_type(); + node_type_.custom_node_type_ = custom_node_type; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.custom_node_type) +} +void TreeNode::clear_custom_node_type() { + if (has_custom_node_type()) { + if (GetArenaNoVirtual() == NULL) { + delete node_type_.custom_node_type_; + } + clear_has_node_type(); + } +} +void TreeNode::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeNode::kNodeIdFieldNumber; +const int TreeNode::kDepthFieldNumber; +const int TreeNode::kSubtreeSizeFieldNumber; +const int TreeNode::kBinaryNodeFieldNumber; +const int TreeNode::kLeafFieldNumber; +const int TreeNode::kCustomNodeTypeFieldNumber; +const int TreeNode::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeNode::TreeNode() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_TreeNode.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.TreeNode) +} +TreeNode::TreeNode(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_TreeNode.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.TreeNode) +} +TreeNode::TreeNode(const TreeNode& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_node_id()) { + node_id_ = new ::google::protobuf::Int32Value(*from.node_id_); + } else { + node_id_ = NULL; + } + if (from.has_depth()) { + depth_ = new ::google::protobuf::Int32Value(*from.depth_); + } else { + depth_ = NULL; + } + if (from.has_subtree_size()) { + subtree_size_ = new ::google::protobuf::Int32Value(*from.subtree_size_); + } else { + subtree_size_ = NULL; + } + clear_has_node_type(); + switch (from.node_type_case()) { + case kBinaryNode: { + mutable_binary_node()->::diplomacy::tensorflow::decision_trees::BinaryNode::MergeFrom(from.binary_node()); + break; + } + case kLeaf: { + mutable_leaf()->::diplomacy::tensorflow::decision_trees::Leaf::MergeFrom(from.leaf()); + break; + } + case kCustomNodeType: { + mutable_custom_node_type()->::google::protobuf::Any::MergeFrom(from.custom_node_type()); + break; + } + case NODE_TYPE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.TreeNode) +} + +void TreeNode::SharedCtor() { + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&subtree_size_) - + reinterpret_cast(&node_id_)) + sizeof(subtree_size_)); + clear_has_node_type(); +} + +TreeNode::~TreeNode() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.TreeNode) + SharedDtor(); +} + +void TreeNode::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete node_id_; + if (this != internal_default_instance()) delete depth_; + if (this != internal_default_instance()) delete subtree_size_; + if (has_node_type()) { + clear_node_type(); + } +} + +void TreeNode::ArenaDtor(void* object) { + TreeNode* _this = reinterpret_cast< TreeNode* >(object); + (void)_this; +} +void TreeNode::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeNode::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeNode::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeNode& TreeNode::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_TreeNode.base); + return *internal_default_instance(); +} + + +void TreeNode::clear_node_type() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.decision_trees.TreeNode) + switch (node_type_case()) { + case kBinaryNode: { + if (GetArenaNoVirtual() == NULL) { + delete node_type_.binary_node_; + } + break; + } + case kLeaf: { + if (GetArenaNoVirtual() == NULL) { + delete node_type_.leaf_; + } + break; + } + case kCustomNodeType: { + if (GetArenaNoVirtual() == NULL) { + delete node_type_.custom_node_type_; + } + break; + } + case NODE_TYPE_NOT_SET: { + break; + } + } + _oneof_case_[0] = NODE_TYPE_NOT_SET; +} + + +void TreeNode::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.TreeNode) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + if (GetArenaNoVirtual() == NULL && node_id_ != NULL) { + delete node_id_; + } + node_id_ = NULL; + if (GetArenaNoVirtual() == NULL && depth_ != NULL) { + delete depth_; + } + depth_ = NULL; + if (GetArenaNoVirtual() == NULL && subtree_size_ != NULL) { + delete subtree_size_; + } + subtree_size_ = NULL; + clear_node_type(); + _internal_metadata_.Clear(); +} + +bool TreeNode::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.TreeNode) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .google.protobuf.Int32Value node_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_node_id())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Int32Value depth = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_depth())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Int32Value subtree_size = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_subtree_size())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode binary_node = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_binary_node())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.Leaf leaf = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_leaf())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Any custom_node_type = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_custom_node_type())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.TreeNode) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.TreeNode) + return false; +#undef DO_ +} + +void TreeNode::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.TreeNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.Int32Value node_id = 1; + if (this->has_node_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_node_id(), output); + } + + // .google.protobuf.Int32Value depth = 2; + if (this->has_depth()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_depth(), output); + } + + // .google.protobuf.Int32Value subtree_size = 3; + if (this->has_subtree_size()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_subtree_size(), output); + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode binary_node = 4; + if (has_binary_node()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_binary_node(), output); + } + + // .diplomacy.tensorflow.decision_trees.Leaf leaf = 5; + if (has_leaf()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_leaf(), output); + } + + // .google.protobuf.Any custom_node_type = 6; + if (has_custom_node_type()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_custom_node_type(), output); + } + + // repeated .google.protobuf.Any additional_data = 7; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.TreeNode) +} + +::google::protobuf::uint8* TreeNode::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.TreeNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.Int32Value node_id = 1; + if (this->has_node_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_node_id(), deterministic, target); + } + + // .google.protobuf.Int32Value depth = 2; + if (this->has_depth()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_depth(), deterministic, target); + } + + // .google.protobuf.Int32Value subtree_size = 3; + if (this->has_subtree_size()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_subtree_size(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode binary_node = 4; + if (has_binary_node()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_binary_node(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.Leaf leaf = 5; + if (has_leaf()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_leaf(), deterministic, target); + } + + // .google.protobuf.Any custom_node_type = 6; + if (has_custom_node_type()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_custom_node_type(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 7; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.TreeNode) + return target; +} + +size_t TreeNode::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.TreeNode) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 7; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + // .google.protobuf.Int32Value node_id = 1; + if (this->has_node_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_id_); + } + + // .google.protobuf.Int32Value depth = 2; + if (this->has_depth()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *depth_); + } + + // .google.protobuf.Int32Value subtree_size = 3; + if (this->has_subtree_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *subtree_size_); + } + + switch (node_type_case()) { + // .diplomacy.tensorflow.decision_trees.BinaryNode binary_node = 4; + case kBinaryNode: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_type_.binary_node_); + break; + } + // .diplomacy.tensorflow.decision_trees.Leaf leaf = 5; + case kLeaf: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_type_.leaf_); + break; + } + // .google.protobuf.Any custom_node_type = 6; + case kCustomNodeType: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_type_.custom_node_type_); + break; + } + case NODE_TYPE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeNode::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.TreeNode) + GOOGLE_DCHECK_NE(&from, this); + const TreeNode* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.TreeNode) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.TreeNode) + MergeFrom(*source); + } +} + +void TreeNode::MergeFrom(const TreeNode& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.TreeNode) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); + if (from.has_node_id()) { + mutable_node_id()->::google::protobuf::Int32Value::MergeFrom(from.node_id()); + } + if (from.has_depth()) { + mutable_depth()->::google::protobuf::Int32Value::MergeFrom(from.depth()); + } + if (from.has_subtree_size()) { + mutable_subtree_size()->::google::protobuf::Int32Value::MergeFrom(from.subtree_size()); + } + switch (from.node_type_case()) { + case kBinaryNode: { + mutable_binary_node()->::diplomacy::tensorflow::decision_trees::BinaryNode::MergeFrom(from.binary_node()); + break; + } + case kLeaf: { + mutable_leaf()->::diplomacy::tensorflow::decision_trees::Leaf::MergeFrom(from.leaf()); + break; + } + case kCustomNodeType: { + mutable_custom_node_type()->::google::protobuf::Any::MergeFrom(from.custom_node_type()); + break; + } + case NODE_TYPE_NOT_SET: { + break; + } + } +} + +void TreeNode::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.TreeNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeNode::CopyFrom(const TreeNode& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.TreeNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeNode::IsInitialized() const { + return true; +} + +void TreeNode::Swap(TreeNode* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeNode* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeNode::UnsafeArenaSwap(TreeNode* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeNode::InternalSwap(TreeNode* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + swap(node_id_, other->node_id_); + swap(depth_, other->depth_); + swap(subtree_size_, other->subtree_size_); + swap(node_type_, other->node_type_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeNode::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void BinaryNode::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_._instance.get_mutable()->left_child_id_ = const_cast< ::google::protobuf::Int32Value*>( + ::google::protobuf::Int32Value::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_._instance.get_mutable()->right_child_id_ = const_cast< ::google::protobuf::Int32Value*>( + ::google::protobuf::Int32Value::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_.inequality_left_child_test_ = const_cast< ::diplomacy::tensorflow::decision_trees::InequalityTest*>( + ::diplomacy::tensorflow::decision_trees::InequalityTest::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_.custom_left_child_test_ = const_cast< ::google::protobuf::Any*>( + ::google::protobuf::Any::internal_default_instance()); +} +void BinaryNode::unsafe_arena_set_allocated_left_child_id( + ::google::protobuf::Int32Value* left_child_id) { + if (GetArenaNoVirtual() == NULL) { + delete left_child_id_; + } + left_child_id_ = left_child_id; + if (left_child_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.left_child_id) +} +void BinaryNode::clear_left_child_id() { + if (GetArenaNoVirtual() == NULL && left_child_id_ != NULL) { + delete left_child_id_; + } + left_child_id_ = NULL; +} +void BinaryNode::unsafe_arena_set_allocated_right_child_id( + ::google::protobuf::Int32Value* right_child_id) { + if (GetArenaNoVirtual() == NULL) { + delete right_child_id_; + } + right_child_id_ = right_child_id; + if (right_child_id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.right_child_id) +} +void BinaryNode::clear_right_child_id() { + if (GetArenaNoVirtual() == NULL && right_child_id_ != NULL) { + delete right_child_id_; + } + right_child_id_ = NULL; +} +void BinaryNode::set_allocated_inequality_left_child_test(::diplomacy::tensorflow::decision_trees::InequalityTest* inequality_left_child_test) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_left_child_test(); + if (inequality_left_child_test) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(inequality_left_child_test); + if (message_arena != submessage_arena) { + inequality_left_child_test = ::google::protobuf::internal::GetOwnedMessage( + message_arena, inequality_left_child_test, submessage_arena); + } + set_has_inequality_left_child_test(); + left_child_test_.inequality_left_child_test_ = inequality_left_child_test; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.inequality_left_child_test) +} +void BinaryNode::set_allocated_custom_left_child_test(::google::protobuf::Any* custom_left_child_test) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_left_child_test(); + if (custom_left_child_test) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + custom_left_child_test = ::google::protobuf::internal::GetOwnedMessage( + message_arena, custom_left_child_test, submessage_arena); + } + set_has_custom_left_child_test(); + left_child_test_.custom_left_child_test_ = custom_left_child_test; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.custom_left_child_test) +} +void BinaryNode::clear_custom_left_child_test() { + if (has_custom_left_child_test()) { + if (GetArenaNoVirtual() == NULL) { + delete left_child_test_.custom_left_child_test_; + } + clear_has_left_child_test(); + } +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BinaryNode::kLeftChildIdFieldNumber; +const int BinaryNode::kRightChildIdFieldNumber; +const int BinaryNode::kDefaultDirectionFieldNumber; +const int BinaryNode::kInequalityLeftChildTestFieldNumber; +const int BinaryNode::kCustomLeftChildTestFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BinaryNode::BinaryNode() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_BinaryNode.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.BinaryNode) +} +BinaryNode::BinaryNode(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_BinaryNode.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.BinaryNode) +} +BinaryNode::BinaryNode(const BinaryNode& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_left_child_id()) { + left_child_id_ = new ::google::protobuf::Int32Value(*from.left_child_id_); + } else { + left_child_id_ = NULL; + } + if (from.has_right_child_id()) { + right_child_id_ = new ::google::protobuf::Int32Value(*from.right_child_id_); + } else { + right_child_id_ = NULL; + } + default_direction_ = from.default_direction_; + clear_has_left_child_test(); + switch (from.left_child_test_case()) { + case kInequalityLeftChildTest: { + mutable_inequality_left_child_test()->::diplomacy::tensorflow::decision_trees::InequalityTest::MergeFrom(from.inequality_left_child_test()); + break; + } + case kCustomLeftChildTest: { + mutable_custom_left_child_test()->::google::protobuf::Any::MergeFrom(from.custom_left_child_test()); + break; + } + case LEFT_CHILD_TEST_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.BinaryNode) +} + +void BinaryNode::SharedCtor() { + ::memset(&left_child_id_, 0, static_cast( + reinterpret_cast(&default_direction_) - + reinterpret_cast(&left_child_id_)) + sizeof(default_direction_)); + clear_has_left_child_test(); +} + +BinaryNode::~BinaryNode() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.BinaryNode) + SharedDtor(); +} + +void BinaryNode::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete left_child_id_; + if (this != internal_default_instance()) delete right_child_id_; + if (has_left_child_test()) { + clear_left_child_test(); + } +} + +void BinaryNode::ArenaDtor(void* object) { + BinaryNode* _this = reinterpret_cast< BinaryNode* >(object); + (void)_this; +} +void BinaryNode::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BinaryNode::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BinaryNode::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BinaryNode& BinaryNode::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_BinaryNode.base); + return *internal_default_instance(); +} + + +void BinaryNode::clear_left_child_test() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.decision_trees.BinaryNode) + switch (left_child_test_case()) { + case kInequalityLeftChildTest: { + if (GetArenaNoVirtual() == NULL) { + delete left_child_test_.inequality_left_child_test_; + } + break; + } + case kCustomLeftChildTest: { + if (GetArenaNoVirtual() == NULL) { + delete left_child_test_.custom_left_child_test_; + } + break; + } + case LEFT_CHILD_TEST_NOT_SET: { + break; + } + } + _oneof_case_[0] = LEFT_CHILD_TEST_NOT_SET; +} + + +void BinaryNode::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.BinaryNode) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && left_child_id_ != NULL) { + delete left_child_id_; + } + left_child_id_ = NULL; + if (GetArenaNoVirtual() == NULL && right_child_id_ != NULL) { + delete right_child_id_; + } + right_child_id_ = NULL; + default_direction_ = 0; + clear_left_child_test(); + _internal_metadata_.Clear(); +} + +bool BinaryNode::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.BinaryNode) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .google.protobuf.Int32Value left_child_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_left_child_id())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Int32Value right_child_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_right_child_id())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode.Direction default_direction = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_default_direction(static_cast< ::diplomacy::tensorflow::decision_trees::BinaryNode_Direction >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest inequality_left_child_test = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_inequality_left_child_test())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Any custom_left_child_test = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_custom_left_child_test())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.BinaryNode) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.BinaryNode) + return false; +#undef DO_ +} + +void BinaryNode::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.BinaryNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.Int32Value left_child_id = 1; + if (this->has_left_child_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_left_child_id(), output); + } + + // .google.protobuf.Int32Value right_child_id = 2; + if (this->has_right_child_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_right_child_id(), output); + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode.Direction default_direction = 3; + if (this->default_direction() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->default_direction(), output); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest inequality_left_child_test = 4; + if (has_inequality_left_child_test()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_inequality_left_child_test(), output); + } + + // .google.protobuf.Any custom_left_child_test = 5; + if (has_custom_left_child_test()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_custom_left_child_test(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.BinaryNode) +} + +::google::protobuf::uint8* BinaryNode::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.BinaryNode) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.Int32Value left_child_id = 1; + if (this->has_left_child_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_left_child_id(), deterministic, target); + } + + // .google.protobuf.Int32Value right_child_id = 2; + if (this->has_right_child_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_right_child_id(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode.Direction default_direction = 3; + if (this->default_direction() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->default_direction(), target); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest inequality_left_child_test = 4; + if (has_inequality_left_child_test()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_inequality_left_child_test(), deterministic, target); + } + + // .google.protobuf.Any custom_left_child_test = 5; + if (has_custom_left_child_test()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_custom_left_child_test(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.BinaryNode) + return target; +} + +size_t BinaryNode::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.BinaryNode) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .google.protobuf.Int32Value left_child_id = 1; + if (this->has_left_child_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *left_child_id_); + } + + // .google.protobuf.Int32Value right_child_id = 2; + if (this->has_right_child_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *right_child_id_); + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode.Direction default_direction = 3; + if (this->default_direction() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->default_direction()); + } + + switch (left_child_test_case()) { + // .diplomacy.tensorflow.decision_trees.InequalityTest inequality_left_child_test = 4; + case kInequalityLeftChildTest: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *left_child_test_.inequality_left_child_test_); + break; + } + // .google.protobuf.Any custom_left_child_test = 5; + case kCustomLeftChildTest: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *left_child_test_.custom_left_child_test_); + break; + } + case LEFT_CHILD_TEST_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BinaryNode::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.BinaryNode) + GOOGLE_DCHECK_NE(&from, this); + const BinaryNode* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.BinaryNode) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.BinaryNode) + MergeFrom(*source); + } +} + +void BinaryNode::MergeFrom(const BinaryNode& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.BinaryNode) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_left_child_id()) { + mutable_left_child_id()->::google::protobuf::Int32Value::MergeFrom(from.left_child_id()); + } + if (from.has_right_child_id()) { + mutable_right_child_id()->::google::protobuf::Int32Value::MergeFrom(from.right_child_id()); + } + if (from.default_direction() != 0) { + set_default_direction(from.default_direction()); + } + switch (from.left_child_test_case()) { + case kInequalityLeftChildTest: { + mutable_inequality_left_child_test()->::diplomacy::tensorflow::decision_trees::InequalityTest::MergeFrom(from.inequality_left_child_test()); + break; + } + case kCustomLeftChildTest: { + mutable_custom_left_child_test()->::google::protobuf::Any::MergeFrom(from.custom_left_child_test()); + break; + } + case LEFT_CHILD_TEST_NOT_SET: { + break; + } + } +} + +void BinaryNode::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.BinaryNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BinaryNode::CopyFrom(const BinaryNode& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.BinaryNode) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BinaryNode::IsInitialized() const { + return true; +} + +void BinaryNode::Swap(BinaryNode* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BinaryNode* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BinaryNode::UnsafeArenaSwap(BinaryNode* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BinaryNode::InternalSwap(BinaryNode* other) { + using std::swap; + swap(left_child_id_, other->left_child_id_); + swap(right_child_id_, other->right_child_id_); + swap(default_direction_, other->default_direction_); + swap(left_child_test_, other->left_child_test_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BinaryNode::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +SparseVector_SparseValueEntry_DoNotUse::SparseVector_SparseValueEntry_DoNotUse() {} +SparseVector_SparseValueEntry_DoNotUse::SparseVector_SparseValueEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void SparseVector_SparseValueEntry_DoNotUse::MergeFrom(const SparseVector_SparseValueEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata SparseVector_SparseValueEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[11]; +} +void SparseVector_SparseValueEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void SparseVector::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SparseVector::kSparseValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SparseVector::SparseVector() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_SparseVector.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.SparseVector) +} +SparseVector::SparseVector(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + sparse_value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_SparseVector.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.SparseVector) +} +SparseVector::SparseVector(const SparseVector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + sparse_value_.MergeFrom(from.sparse_value_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.SparseVector) +} + +void SparseVector::SharedCtor() { +} + +SparseVector::~SparseVector() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.SparseVector) + SharedDtor(); +} + +void SparseVector::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void SparseVector::ArenaDtor(void* object) { + SparseVector* _this = reinterpret_cast< SparseVector* >(object); + (void)_this; +} +void SparseVector::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SparseVector::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SparseVector::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SparseVector& SparseVector::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_SparseVector.base); + return *internal_default_instance(); +} + + +void SparseVector::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + sparse_value_.Clear(); + _internal_metadata_.Clear(); +} + +bool SparseVector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.SparseVector) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map sparse_value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + SparseVector_SparseValueEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + SparseVector_SparseValueEntry_DoNotUse, + ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value > > parser(&sparse_value_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.SparseVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.SparseVector) + return false; +#undef DO_ +} + +void SparseVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map sparse_value = 1; + if (!this->sparse_value().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::int64, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (output->IsSerializationDeterministic() && + this->sparse_value().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->sparse_value().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::const_iterator + it = this->sparse_value().begin(); + it != this->sparse_value().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(sparse_value_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::const_iterator + it = this->sparse_value().begin(); + it != this->sparse_value().end(); ++it) { + entry.reset(sparse_value_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.SparseVector) +} + +::google::protobuf::uint8* SparseVector::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map sparse_value = 1; + if (!this->sparse_value().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::int64, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (deterministic && + this->sparse_value().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->sparse_value().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::const_iterator + it = this->sparse_value().begin(); + it != this->sparse_value().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(sparse_value_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::const_iterator + it = this->sparse_value().begin(); + it != this->sparse_value().end(); ++it) { + entry.reset(sparse_value_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.SparseVector) + return target; +} + +size_t SparseVector::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.SparseVector) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map sparse_value = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->sparse_value_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >::const_iterator + it = this->sparse_value().begin(); + it != this->sparse_value().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(sparse_value_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SparseVector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.SparseVector) + GOOGLE_DCHECK_NE(&from, this); + const SparseVector* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.SparseVector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.SparseVector) + MergeFrom(*source); + } +} + +void SparseVector::MergeFrom(const SparseVector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.SparseVector) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + sparse_value_.MergeFrom(from.sparse_value_); +} + +void SparseVector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.SparseVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SparseVector::CopyFrom(const SparseVector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.SparseVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SparseVector::IsInitialized() const { + return true; +} + +void SparseVector::Swap(SparseVector* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SparseVector* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SparseVector::UnsafeArenaSwap(SparseVector* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SparseVector::InternalSwap(SparseVector* other) { + using std::swap; + sparse_value_.Swap(&other->sparse_value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SparseVector::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Vector::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Vector::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Vector::Vector() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Vector.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Vector) +} +Vector::Vector(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Vector.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Vector) +} +Vector::Vector(const Vector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Vector) +} + +void Vector::SharedCtor() { +} + +Vector::~Vector() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Vector) + SharedDtor(); +} + +void Vector::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Vector::ArenaDtor(void* object) { + Vector* _this = reinterpret_cast< Vector* >(object); + (void)_this; +} +void Vector::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Vector::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Vector::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Vector& Vector::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Vector.base); + return *internal_default_instance(); +} + + +void Vector::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool Vector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Vector) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.decision_trees.Value value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Vector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Vector) + return false; +#undef DO_ +} + +void Vector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.Value value = 1; + for (unsigned int i = 0, + n = static_cast(this->value_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->value(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Vector) +} + +::google::protobuf::uint8* Vector::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.Value value = 1; + for (unsigned int i = 0, + n = static_cast(this->value_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->value(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Vector) + return target; +} + +size_t Vector::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Vector) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.decision_trees.Value value = 1; + { + unsigned int count = static_cast(this->value_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->value(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Vector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Vector) + GOOGLE_DCHECK_NE(&from, this); + const Vector* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Vector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Vector) + MergeFrom(*source); + } +} + +void Vector::MergeFrom(const Vector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Vector) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void Vector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Vector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Vector::CopyFrom(const Vector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Vector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Vector::IsInitialized() const { + return true; +} + +void Vector::Swap(Vector* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Vector* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Vector::UnsafeArenaSwap(Vector* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Vector::InternalSwap(Vector* other) { + using std::swap; + CastToBase(&value_)->InternalSwap(CastToBase(&other->value_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Vector::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Leaf::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_Leaf_default_instance_.vector_ = const_cast< ::diplomacy::tensorflow::decision_trees::Vector*>( + ::diplomacy::tensorflow::decision_trees::Vector::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_Leaf_default_instance_.sparse_vector_ = const_cast< ::diplomacy::tensorflow::decision_trees::SparseVector*>( + ::diplomacy::tensorflow::decision_trees::SparseVector::internal_default_instance()); +} +void Leaf::set_allocated_vector(::diplomacy::tensorflow::decision_trees::Vector* vector) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf(); + if (vector) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(vector); + if (message_arena != submessage_arena) { + vector = ::google::protobuf::internal::GetOwnedMessage( + message_arena, vector, submessage_arena); + } + set_has_vector(); + leaf_.vector_ = vector; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Leaf.vector) +} +void Leaf::set_allocated_sparse_vector(::diplomacy::tensorflow::decision_trees::SparseVector* sparse_vector) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf(); + if (sparse_vector) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(sparse_vector); + if (message_arena != submessage_arena) { + sparse_vector = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sparse_vector, submessage_arena); + } + set_has_sparse_vector(); + leaf_.sparse_vector_ = sparse_vector; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Leaf.sparse_vector) +} +void Leaf::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Leaf::kVectorFieldNumber; +const int Leaf::kSparseVectorFieldNumber; +const int Leaf::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Leaf::Leaf() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Leaf.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Leaf) +} +Leaf::Leaf(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Leaf.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Leaf) +} +Leaf::Leaf(const Leaf& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_leaf(); + switch (from.leaf_case()) { + case kVector: { + mutable_vector()->::diplomacy::tensorflow::decision_trees::Vector::MergeFrom(from.vector()); + break; + } + case kSparseVector: { + mutable_sparse_vector()->::diplomacy::tensorflow::decision_trees::SparseVector::MergeFrom(from.sparse_vector()); + break; + } + case LEAF_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Leaf) +} + +void Leaf::SharedCtor() { + clear_has_leaf(); +} + +Leaf::~Leaf() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Leaf) + SharedDtor(); +} + +void Leaf::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_leaf()) { + clear_leaf(); + } +} + +void Leaf::ArenaDtor(void* object) { + Leaf* _this = reinterpret_cast< Leaf* >(object); + (void)_this; +} +void Leaf::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Leaf::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Leaf::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Leaf& Leaf::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Leaf.base); + return *internal_default_instance(); +} + + +void Leaf::clear_leaf() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.decision_trees.Leaf) + switch (leaf_case()) { + case kVector: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.vector_; + } + break; + } + case kSparseVector: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.sparse_vector_; + } + break; + } + case LEAF_NOT_SET: { + break; + } + } + _oneof_case_[0] = LEAF_NOT_SET; +} + + +void Leaf::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + clear_leaf(); + _internal_metadata_.Clear(); +} + +bool Leaf::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Leaf) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.Vector vector = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_vector())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_vector = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sparse_vector())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Leaf) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Leaf) + return false; +#undef DO_ +} + +void Leaf::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Vector vector = 1; + if (has_vector()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_vector(), output); + } + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_vector = 2; + if (has_sparse_vector()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_sparse_vector(), output); + } + + // repeated .google.protobuf.Any additional_data = 3; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Leaf) +} + +::google::protobuf::uint8* Leaf::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Vector vector = 1; + if (has_vector()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_vector(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_vector = 2; + if (has_sparse_vector()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_sparse_vector(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 3; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Leaf) + return target; +} + +size_t Leaf::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Leaf) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 3; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + switch (leaf_case()) { + // .diplomacy.tensorflow.decision_trees.Vector vector = 1; + case kVector: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_.vector_); + break; + } + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_vector = 2; + case kSparseVector: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_.sparse_vector_); + break; + } + case LEAF_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Leaf::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Leaf) + GOOGLE_DCHECK_NE(&from, this); + const Leaf* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Leaf) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Leaf) + MergeFrom(*source); + } +} + +void Leaf::MergeFrom(const Leaf& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Leaf) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); + switch (from.leaf_case()) { + case kVector: { + mutable_vector()->::diplomacy::tensorflow::decision_trees::Vector::MergeFrom(from.vector()); + break; + } + case kSparseVector: { + mutable_sparse_vector()->::diplomacy::tensorflow::decision_trees::SparseVector::MergeFrom(from.sparse_vector()); + break; + } + case LEAF_NOT_SET: { + break; + } + } +} + +void Leaf::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Leaf) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Leaf::CopyFrom(const Leaf& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Leaf) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Leaf::IsInitialized() const { + return true; +} + +void Leaf::Swap(Leaf* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Leaf* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Leaf::UnsafeArenaSwap(Leaf* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Leaf::InternalSwap(Leaf* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + swap(leaf_, other->leaf_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Leaf::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FeatureId::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_FeatureId_default_instance_._instance.get_mutable()->id_ = const_cast< ::google::protobuf::StringValue*>( + ::google::protobuf::StringValue::internal_default_instance()); +} +void FeatureId::unsafe_arena_set_allocated_id( + ::google::protobuf::StringValue* id) { + if (GetArenaNoVirtual() == NULL) { + delete id_; + } + id_ = id; + if (id) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.FeatureId.id) +} +void FeatureId::clear_id() { + if (GetArenaNoVirtual() == NULL && id_ != NULL) { + delete id_; + } + id_ = NULL; +} +void FeatureId::clear_additional_data() { + additional_data_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FeatureId::kIdFieldNumber; +const int FeatureId::kAdditionalDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FeatureId::FeatureId() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_FeatureId.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.FeatureId) +} +FeatureId::FeatureId(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + additional_data_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_FeatureId.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.FeatureId) +} +FeatureId::FeatureId(const FeatureId& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + additional_data_(from.additional_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_id()) { + id_ = new ::google::protobuf::StringValue(*from.id_); + } else { + id_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.FeatureId) +} + +void FeatureId::SharedCtor() { + id_ = NULL; +} + +FeatureId::~FeatureId() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.FeatureId) + SharedDtor(); +} + +void FeatureId::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete id_; +} + +void FeatureId::ArenaDtor(void* object) { + FeatureId* _this = reinterpret_cast< FeatureId* >(object); + (void)_this; +} +void FeatureId::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FeatureId::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FeatureId::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FeatureId& FeatureId::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_FeatureId.base); + return *internal_default_instance(); +} + + +void FeatureId::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.FeatureId) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + additional_data_.Clear(); + if (GetArenaNoVirtual() == NULL && id_ != NULL) { + delete id_; + } + id_ = NULL; + _internal_metadata_.Clear(); +} + +bool FeatureId::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.FeatureId) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .google.protobuf.StringValue id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_id())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .google.protobuf.Any additional_data = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_additional_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.FeatureId) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.FeatureId) + return false; +#undef DO_ +} + +void FeatureId::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.FeatureId) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.StringValue id = 1; + if (this->has_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_id(), output); + } + + // repeated .google.protobuf.Any additional_data = 2; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->additional_data(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.FeatureId) +} + +::google::protobuf::uint8* FeatureId::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.FeatureId) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.StringValue id = 1; + if (this->has_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_id(), deterministic, target); + } + + // repeated .google.protobuf.Any additional_data = 2; + for (unsigned int i = 0, + n = static_cast(this->additional_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->additional_data(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.FeatureId) + return target; +} + +size_t FeatureId::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.FeatureId) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .google.protobuf.Any additional_data = 2; + { + unsigned int count = static_cast(this->additional_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->additional_data(static_cast(i))); + } + } + + // .google.protobuf.StringValue id = 1; + if (this->has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *id_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FeatureId::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.FeatureId) + GOOGLE_DCHECK_NE(&from, this); + const FeatureId* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.FeatureId) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.FeatureId) + MergeFrom(*source); + } +} + +void FeatureId::MergeFrom(const FeatureId& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.FeatureId) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + additional_data_.MergeFrom(from.additional_data_); + if (from.has_id()) { + mutable_id()->::google::protobuf::StringValue::MergeFrom(from.id()); + } +} + +void FeatureId::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.FeatureId) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FeatureId::CopyFrom(const FeatureId& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.FeatureId) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FeatureId::IsInitialized() const { + return true; +} + +void FeatureId::Swap(FeatureId* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FeatureId* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FeatureId::UnsafeArenaSwap(FeatureId* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FeatureId::InternalSwap(FeatureId* other) { + using std::swap; + CastToBase(&additional_data_)->InternalSwap(CastToBase(&other->additional_data_)); + swap(id_, other->id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FeatureId::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ObliqueFeatures::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ObliqueFeatures::kFeaturesFieldNumber; +const int ObliqueFeatures::kWeightsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ObliqueFeatures::ObliqueFeatures() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ObliqueFeatures.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.ObliqueFeatures) +} +ObliqueFeatures::ObliqueFeatures(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + features_(arena), + weights_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ObliqueFeatures.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.ObliqueFeatures) +} +ObliqueFeatures::ObliqueFeatures(const ObliqueFeatures& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + features_(from.features_), + weights_(from.weights_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.ObliqueFeatures) +} + +void ObliqueFeatures::SharedCtor() { +} + +ObliqueFeatures::~ObliqueFeatures() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + SharedDtor(); +} + +void ObliqueFeatures::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ObliqueFeatures::ArenaDtor(void* object) { + ObliqueFeatures* _this = reinterpret_cast< ObliqueFeatures* >(object); + (void)_this; +} +void ObliqueFeatures::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ObliqueFeatures::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ObliqueFeatures::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ObliqueFeatures& ObliqueFeatures::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_ObliqueFeatures.base); + return *internal_default_instance(); +} + + +void ObliqueFeatures::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + features_.Clear(); + weights_.Clear(); + _internal_metadata_.Clear(); +} + +bool ObliqueFeatures::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.decision_trees.FeatureId features = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_features())); + } else { + goto handle_unusual; + } + break; + } + + // repeated float weights = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_weights()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 18u, input, this->mutable_weights()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + return false; +#undef DO_ +} + +void ObliqueFeatures::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.FeatureId features = 1; + for (unsigned int i = 0, + n = static_cast(this->features_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->features(static_cast(i)), + output); + } + + // repeated float weights = 2; + if (this->weights_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _weights_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->weights().data(), this->weights_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.ObliqueFeatures) +} + +::google::protobuf::uint8* ObliqueFeatures::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.FeatureId features = 1; + for (unsigned int i = 0, + n = static_cast(this->features_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->features(static_cast(i)), deterministic, target); + } + + // repeated float weights = 2; + if (this->weights_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _weights_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->weights_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + return target; +} + +size_t ObliqueFeatures::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.decision_trees.FeatureId features = 1; + { + unsigned int count = static_cast(this->features_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->features(static_cast(i))); + } + } + + // repeated float weights = 2; + { + unsigned int count = static_cast(this->weights_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _weights_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ObliqueFeatures::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + GOOGLE_DCHECK_NE(&from, this); + const ObliqueFeatures* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + MergeFrom(*source); + } +} + +void ObliqueFeatures::MergeFrom(const ObliqueFeatures& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + features_.MergeFrom(from.features_); + weights_.MergeFrom(from.weights_); +} + +void ObliqueFeatures::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ObliqueFeatures::CopyFrom(const ObliqueFeatures& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ObliqueFeatures::IsInitialized() const { + return true; +} + +void ObliqueFeatures::Swap(ObliqueFeatures* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ObliqueFeatures* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ObliqueFeatures::UnsafeArenaSwap(ObliqueFeatures* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ObliqueFeatures::InternalSwap(ObliqueFeatures* other) { + using std::swap; + CastToBase(&features_)->InternalSwap(CastToBase(&other->features_)); + weights_.InternalSwap(&other->weights_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ObliqueFeatures::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void InequalityTest::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_InequalityTest_default_instance_.feature_id_ = const_cast< ::diplomacy::tensorflow::decision_trees::FeatureId*>( + ::diplomacy::tensorflow::decision_trees::FeatureId::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_InequalityTest_default_instance_.oblique_ = const_cast< ::diplomacy::tensorflow::decision_trees::ObliqueFeatures*>( + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures::internal_default_instance()); + ::diplomacy::tensorflow::decision_trees::_InequalityTest_default_instance_._instance.get_mutable()->threshold_ = const_cast< ::diplomacy::tensorflow::decision_trees::Value*>( + ::diplomacy::tensorflow::decision_trees::Value::internal_default_instance()); +} +void InequalityTest::set_allocated_feature_id(::diplomacy::tensorflow::decision_trees::FeatureId* feature_id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_FeatureSum(); + if (feature_id) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(feature_id); + if (message_arena != submessage_arena) { + feature_id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, feature_id, submessage_arena); + } + set_has_feature_id(); + FeatureSum_.feature_id_ = feature_id; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.InequalityTest.feature_id) +} +void InequalityTest::set_allocated_oblique(::diplomacy::tensorflow::decision_trees::ObliqueFeatures* oblique) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_FeatureSum(); + if (oblique) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(oblique); + if (message_arena != submessage_arena) { + oblique = ::google::protobuf::internal::GetOwnedMessage( + message_arena, oblique, submessage_arena); + } + set_has_oblique(); + FeatureSum_.oblique_ = oblique; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.InequalityTest.oblique) +} +void InequalityTest::unsafe_arena_set_allocated_threshold( + ::diplomacy::tensorflow::decision_trees::Value* threshold) { + if (GetArenaNoVirtual() == NULL) { + delete threshold_; + } + threshold_ = threshold; + if (threshold) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.InequalityTest.threshold) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InequalityTest::kFeatureIdFieldNumber; +const int InequalityTest::kObliqueFieldNumber; +const int InequalityTest::kTypeFieldNumber; +const int InequalityTest::kThresholdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InequalityTest::InequalityTest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_InequalityTest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.InequalityTest) +} +InequalityTest::InequalityTest(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_InequalityTest.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.InequalityTest) +} +InequalityTest::InequalityTest(const InequalityTest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_threshold()) { + threshold_ = new ::diplomacy::tensorflow::decision_trees::Value(*from.threshold_); + } else { + threshold_ = NULL; + } + type_ = from.type_; + clear_has_FeatureSum(); + switch (from.FeatureSum_case()) { + case kFeatureId: { + mutable_feature_id()->::diplomacy::tensorflow::decision_trees::FeatureId::MergeFrom(from.feature_id()); + break; + } + case kOblique: { + mutable_oblique()->::diplomacy::tensorflow::decision_trees::ObliqueFeatures::MergeFrom(from.oblique()); + break; + } + case FEATURESUM_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.InequalityTest) +} + +void InequalityTest::SharedCtor() { + ::memset(&threshold_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&threshold_)) + sizeof(type_)); + clear_has_FeatureSum(); +} + +InequalityTest::~InequalityTest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.InequalityTest) + SharedDtor(); +} + +void InequalityTest::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete threshold_; + if (has_FeatureSum()) { + clear_FeatureSum(); + } +} + +void InequalityTest::ArenaDtor(void* object) { + InequalityTest* _this = reinterpret_cast< InequalityTest* >(object); + (void)_this; +} +void InequalityTest::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void InequalityTest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* InequalityTest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const InequalityTest& InequalityTest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_InequalityTest.base); + return *internal_default_instance(); +} + + +void InequalityTest::clear_FeatureSum() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.decision_trees.InequalityTest) + switch (FeatureSum_case()) { + case kFeatureId: { + if (GetArenaNoVirtual() == NULL) { + delete FeatureSum_.feature_id_; + } + break; + } + case kOblique: { + if (GetArenaNoVirtual() == NULL) { + delete FeatureSum_.oblique_; + } + break; + } + case FEATURESUM_NOT_SET: { + break; + } + } + _oneof_case_[0] = FEATURESUM_NOT_SET; +} + + +void InequalityTest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.InequalityTest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && threshold_ != NULL) { + delete threshold_; + } + threshold_ = NULL; + type_ = 0; + clear_FeatureSum(); + _internal_metadata_.Clear(); +} + +bool InequalityTest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.InequalityTest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_feature_id())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::diplomacy::tensorflow::decision_trees::InequalityTest_Type >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.Value threshold = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_threshold())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.ObliqueFeatures oblique = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_oblique())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.InequalityTest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.InequalityTest) + return false; +#undef DO_ +} + +void InequalityTest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.InequalityTest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + if (has_feature_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_feature_id(), output); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type type = 2; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + // .diplomacy.tensorflow.decision_trees.Value threshold = 3; + if (this->has_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_threshold(), output); + } + + // .diplomacy.tensorflow.decision_trees.ObliqueFeatures oblique = 4; + if (has_oblique()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_oblique(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.InequalityTest) +} + +::google::protobuf::uint8* InequalityTest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.InequalityTest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + if (has_feature_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_feature_id(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type type = 2; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->type(), target); + } + + // .diplomacy.tensorflow.decision_trees.Value threshold = 3; + if (this->has_threshold()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_threshold(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.ObliqueFeatures oblique = 4; + if (has_oblique()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_oblique(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.InequalityTest) + return target; +} + +size_t InequalityTest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.InequalityTest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.decision_trees.Value threshold = 3; + if (this->has_threshold()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *threshold_); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type type = 2; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + switch (FeatureSum_case()) { + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + case kFeatureId: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *FeatureSum_.feature_id_); + break; + } + // .diplomacy.tensorflow.decision_trees.ObliqueFeatures oblique = 4; + case kOblique: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *FeatureSum_.oblique_); + break; + } + case FEATURESUM_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void InequalityTest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.InequalityTest) + GOOGLE_DCHECK_NE(&from, this); + const InequalityTest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.InequalityTest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.InequalityTest) + MergeFrom(*source); + } +} + +void InequalityTest::MergeFrom(const InequalityTest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.InequalityTest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_threshold()) { + mutable_threshold()->::diplomacy::tensorflow::decision_trees::Value::MergeFrom(from.threshold()); + } + if (from.type() != 0) { + set_type(from.type()); + } + switch (from.FeatureSum_case()) { + case kFeatureId: { + mutable_feature_id()->::diplomacy::tensorflow::decision_trees::FeatureId::MergeFrom(from.feature_id()); + break; + } + case kOblique: { + mutable_oblique()->::diplomacy::tensorflow::decision_trees::ObliqueFeatures::MergeFrom(from.oblique()); + break; + } + case FEATURESUM_NOT_SET: { + break; + } + } +} + +void InequalityTest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.InequalityTest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InequalityTest::CopyFrom(const InequalityTest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.InequalityTest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InequalityTest::IsInitialized() const { + return true; +} + +void InequalityTest::Swap(InequalityTest* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + InequalityTest* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void InequalityTest::UnsafeArenaSwap(InequalityTest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void InequalityTest::InternalSwap(InequalityTest* other) { + using std::swap; + swap(threshold_, other->threshold_); + swap(type_, other->type_); + swap(FeatureSum_, other->FeatureSum_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata InequalityTest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Value::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_Value_default_instance_.float_value_ = 0; + ::diplomacy::tensorflow::decision_trees::_Value_default_instance_.double_value_ = 0; + ::diplomacy::tensorflow::decision_trees::_Value_default_instance_.int32_value_ = 0; + ::diplomacy::tensorflow::decision_trees::_Value_default_instance_.int64_value_ = GOOGLE_LONGLONG(0); + ::diplomacy::tensorflow::decision_trees::_Value_default_instance_.custom_value_ = const_cast< ::google::protobuf::Any*>( + ::google::protobuf::Any::internal_default_instance()); +} +void Value::set_allocated_custom_value(::google::protobuf::Any* custom_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (custom_value) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + custom_value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, custom_value, submessage_arena); + } + set_has_custom_value(); + value_.custom_value_ = custom_value; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Value.custom_value) +} +void Value::clear_custom_value() { + if (has_custom_value()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.custom_value_; + } + clear_has_value(); + } +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Value::kFloatValueFieldNumber; +const int Value::kDoubleValueFieldNumber; +const int Value::kInt32ValueFieldNumber; +const int Value::kInt64ValueFieldNumber; +const int Value::kCustomValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Value::Value() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Value.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.Value) +} +Value::Value(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Value.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.decision_trees.Value) +} +Value::Value(const Value& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_value(); + switch (from.value_case()) { + case kFloatValue: { + set_float_value(from.float_value()); + break; + } + case kDoubleValue: { + set_double_value(from.double_value()); + break; + } + case kInt32Value: { + set_int32_value(from.int32_value()); + break; + } + case kInt64Value: { + set_int64_value(from.int64_value()); + break; + } + case kCustomValue: { + mutable_custom_value()->::google::protobuf::Any::MergeFrom(from.custom_value()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.Value) +} + +void Value::SharedCtor() { + clear_has_value(); +} + +Value::~Value() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.Value) + SharedDtor(); +} + +void Value::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_value()) { + clear_value(); + } +} + +void Value::ArenaDtor(void* object) { + Value* _this = reinterpret_cast< Value* >(object); + (void)_this; +} +void Value::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Value::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Value::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Value& Value::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Value.base); + return *internal_default_instance(); +} + + +void Value::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.decision_trees.Value) + switch (value_case()) { + case kFloatValue: { + // No need to clear + break; + } + case kDoubleValue: { + // No need to clear + break; + } + case kInt32Value: { + // No need to clear + break; + } + case kInt64Value: { + // No need to clear + break; + } + case kCustomValue: { + if (GetArenaNoVirtual() == NULL) { + delete value_.custom_value_; + } + break; + } + case VALUE_NOT_SET: { + break; + } + } + _oneof_case_[0] = VALUE_NOT_SET; +} + + +void Value::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.Value) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_value(); + _internal_metadata_.Clear(); +} + +bool Value::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.Value) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float float_value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_.float_value_))); + set_has_float_value(); + } else { + goto handle_unusual; + } + break; + } + + // double double_value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &value_.double_value_))); + set_has_double_value(); + } else { + goto handle_unusual; + } + break; + } + + // int32 int32_value = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &value_.int32_value_))); + set_has_int32_value(); + } else { + goto handle_unusual; + } + break; + } + + // int64 int64_value = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &value_.int64_value_))); + set_has_int64_value(); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.Any custom_value = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_custom_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.Value) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.Value) + return false; +#undef DO_ +} + +void Value::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.Value) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float float_value = 1; + if (has_float_value()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->float_value(), output); + } + + // double double_value = 2; + if (has_double_value()) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->double_value(), output); + } + + // int32 int32_value = 3; + if (has_int32_value()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->int32_value(), output); + } + + // int64 int64_value = 4; + if (has_int64_value()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->int64_value(), output); + } + + // .google.protobuf.Any custom_value = 5; + if (has_custom_value()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_custom_value(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.Value) +} + +::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.Value) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float float_value = 1; + if (has_float_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->float_value(), target); + } + + // double double_value = 2; + if (has_double_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->double_value(), target); + } + + // int32 int32_value = 3; + if (has_int32_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->int32_value(), target); + } + + // int64 int64_value = 4; + if (has_int64_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->int64_value(), target); + } + + // .google.protobuf.Any custom_value = 5; + if (has_custom_value()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_custom_value(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.Value) + return target; +} + +size_t Value::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.Value) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (value_case()) { + // float float_value = 1; + case kFloatValue: { + total_size += 1 + 4; + break; + } + // double double_value = 2; + case kDoubleValue: { + total_size += 1 + 8; + break; + } + // int32 int32_value = 3; + case kInt32Value: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->int32_value()); + break; + } + // int64 int64_value = 4; + case kInt64Value: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->int64_value()); + break; + } + // .google.protobuf.Any custom_value = 5; + case kCustomValue: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.custom_value_); + break; + } + case VALUE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Value::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.Value) + GOOGLE_DCHECK_NE(&from, this); + const Value* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.Value) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.Value) + MergeFrom(*source); + } +} + +void Value::MergeFrom(const Value& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.Value) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.value_case()) { + case kFloatValue: { + set_float_value(from.float_value()); + break; + } + case kDoubleValue: { + set_double_value(from.double_value()); + break; + } + case kInt32Value: { + set_int32_value(from.int32_value()); + break; + } + case kInt64Value: { + set_int64_value(from.int64_value()); + break; + } + case kCustomValue: { + mutable_custom_value()->::google::protobuf::Any::MergeFrom(from.custom_value()); + break; + } + case VALUE_NOT_SET: { + break; + } + } +} + +void Value::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.Value) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Value::CopyFrom(const Value& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.Value) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Value::IsInitialized() const { + return true; +} + +void Value::Swap(Value* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Value* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Value::UnsafeArenaSwap(Value* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Value::InternalSwap(Value* other) { + using std::swap; + swap(value_, other->value_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Value::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Model* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Model >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Model >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::ModelAndFeatures* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::ModelAndFeatures >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::ModelAndFeatures >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Ensemble_Member* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Ensemble_Member >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Ensemble_Member >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Ensemble* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Ensemble >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Ensemble >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Summation* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Summation >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Summation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Averaging* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Averaging >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Averaging >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::DecisionTree* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::DecisionTree >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::DecisionTree >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::TreeNode* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::TreeNode >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::TreeNode >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::BinaryNode* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::BinaryNode >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::BinaryNode >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::SparseVector* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::SparseVector >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::SparseVector >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Vector* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Vector >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Vector >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Leaf* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Leaf >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Leaf >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::FeatureId* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::FeatureId >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::FeatureId >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::ObliqueFeatures >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::ObliqueFeatures >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::InequalityTest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::InequalityTest >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::InequalityTest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::Value* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Value >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::decision_trees::Value >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h new file mode 100644 index 0000000..053991b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h @@ -0,0 +1,5596 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[19]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { +class Averaging; +class AveragingDefaultTypeInternal; +extern AveragingDefaultTypeInternal _Averaging_default_instance_; +class BinaryNode; +class BinaryNodeDefaultTypeInternal; +extern BinaryNodeDefaultTypeInternal _BinaryNode_default_instance_; +class DecisionTree; +class DecisionTreeDefaultTypeInternal; +extern DecisionTreeDefaultTypeInternal _DecisionTree_default_instance_; +class Ensemble; +class EnsembleDefaultTypeInternal; +extern EnsembleDefaultTypeInternal _Ensemble_default_instance_; +class Ensemble_Member; +class Ensemble_MemberDefaultTypeInternal; +extern Ensemble_MemberDefaultTypeInternal _Ensemble_Member_default_instance_; +class FeatureId; +class FeatureIdDefaultTypeInternal; +extern FeatureIdDefaultTypeInternal _FeatureId_default_instance_; +class InequalityTest; +class InequalityTestDefaultTypeInternal; +extern InequalityTestDefaultTypeInternal _InequalityTest_default_instance_; +class Leaf; +class LeafDefaultTypeInternal; +extern LeafDefaultTypeInternal _Leaf_default_instance_; +class Model; +class ModelDefaultTypeInternal; +extern ModelDefaultTypeInternal _Model_default_instance_; +class ModelAndFeatures; +class ModelAndFeaturesDefaultTypeInternal; +extern ModelAndFeaturesDefaultTypeInternal _ModelAndFeatures_default_instance_; +class ModelAndFeatures_Feature; +class ModelAndFeatures_FeatureDefaultTypeInternal; +extern ModelAndFeatures_FeatureDefaultTypeInternal _ModelAndFeatures_Feature_default_instance_; +class ModelAndFeatures_FeaturesEntry_DoNotUse; +class ModelAndFeatures_FeaturesEntry_DoNotUseDefaultTypeInternal; +extern ModelAndFeatures_FeaturesEntry_DoNotUseDefaultTypeInternal _ModelAndFeatures_FeaturesEntry_DoNotUse_default_instance_; +class ObliqueFeatures; +class ObliqueFeaturesDefaultTypeInternal; +extern ObliqueFeaturesDefaultTypeInternal _ObliqueFeatures_default_instance_; +class SparseVector; +class SparseVectorDefaultTypeInternal; +extern SparseVectorDefaultTypeInternal _SparseVector_default_instance_; +class SparseVector_SparseValueEntry_DoNotUse; +class SparseVector_SparseValueEntry_DoNotUseDefaultTypeInternal; +extern SparseVector_SparseValueEntry_DoNotUseDefaultTypeInternal _SparseVector_SparseValueEntry_DoNotUse_default_instance_; +class Summation; +class SummationDefaultTypeInternal; +extern SummationDefaultTypeInternal _Summation_default_instance_; +class TreeNode; +class TreeNodeDefaultTypeInternal; +extern TreeNodeDefaultTypeInternal _TreeNode_default_instance_; +class Value; +class ValueDefaultTypeInternal; +extern ValueDefaultTypeInternal _Value_default_instance_; +class Vector; +class VectorDefaultTypeInternal; +extern VectorDefaultTypeInternal _Vector_default_instance_; +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::decision_trees::Averaging* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Averaging>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::BinaryNode* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::BinaryNode>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::DecisionTree* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::DecisionTree>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::Ensemble* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Ensemble>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::Ensemble_Member* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Ensemble_Member>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::FeatureId* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::FeatureId>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::InequalityTest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::InequalityTest>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::Leaf* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Leaf>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::Model* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Model>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::ModelAndFeatures* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::ModelAndFeatures>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::ModelAndFeatures_FeaturesEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::ObliqueFeatures>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::SparseVector* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::SparseVector>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::SparseVector_SparseValueEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::Summation* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Summation>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::TreeNode* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::TreeNode>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::Value* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Value>(Arena*); +template<> ::diplomacy::tensorflow::decision_trees::Vector* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Vector>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { + +enum BinaryNode_Direction { + BinaryNode_Direction_LEFT = 0, + BinaryNode_Direction_RIGHT = 1, + BinaryNode_Direction_BinaryNode_Direction_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + BinaryNode_Direction_BinaryNode_Direction_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool BinaryNode_Direction_IsValid(int value); +const BinaryNode_Direction BinaryNode_Direction_Direction_MIN = BinaryNode_Direction_LEFT; +const BinaryNode_Direction BinaryNode_Direction_Direction_MAX = BinaryNode_Direction_RIGHT; +const int BinaryNode_Direction_Direction_ARRAYSIZE = BinaryNode_Direction_Direction_MAX + 1; + +const ::google::protobuf::EnumDescriptor* BinaryNode_Direction_descriptor(); +inline const ::std::string& BinaryNode_Direction_Name(BinaryNode_Direction value) { + return ::google::protobuf::internal::NameOfEnum( + BinaryNode_Direction_descriptor(), value); +} +inline bool BinaryNode_Direction_Parse( + const ::std::string& name, BinaryNode_Direction* value) { + return ::google::protobuf::internal::ParseNamedEnum( + BinaryNode_Direction_descriptor(), name, value); +} +enum InequalityTest_Type { + InequalityTest_Type_LESS_OR_EQUAL = 0, + InequalityTest_Type_LESS_THAN = 1, + InequalityTest_Type_GREATER_OR_EQUAL = 2, + InequalityTest_Type_GREATER_THAN = 3, + InequalityTest_Type_InequalityTest_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + InequalityTest_Type_InequalityTest_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool InequalityTest_Type_IsValid(int value); +const InequalityTest_Type InequalityTest_Type_Type_MIN = InequalityTest_Type_LESS_OR_EQUAL; +const InequalityTest_Type InequalityTest_Type_Type_MAX = InequalityTest_Type_GREATER_THAN; +const int InequalityTest_Type_Type_ARRAYSIZE = InequalityTest_Type_Type_MAX + 1; + +const ::google::protobuf::EnumDescriptor* InequalityTest_Type_descriptor(); +inline const ::std::string& InequalityTest_Type_Name(InequalityTest_Type value) { + return ::google::protobuf::internal::NameOfEnum( + InequalityTest_Type_descriptor(), value); +} +inline bool InequalityTest_Type_Parse( + const ::std::string& name, InequalityTest_Type* value) { + return ::google::protobuf::internal::ParseNamedEnum( + InequalityTest_Type_descriptor(), name, value); +} +// =================================================================== + +class Model : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Model) */ { + public: + Model(); + virtual ~Model(); + + Model(const Model& from); + + inline Model& operator=(const Model& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Model(Model&& from) noexcept + : Model() { + *this = ::std::move(from); + } + + inline Model& operator=(Model&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Model& default_instance(); + + enum ModelCase { + kDecisionTree = 1, + kEnsemble = 2, + kCustomModel = 3, + MODEL_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Model* internal_default_instance() { + return reinterpret_cast( + &_Model_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(Model* other); + void Swap(Model* other); + friend void swap(Model& a, Model& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Model* New() const final { + return CreateMaybeMessage(NULL); + } + + Model* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Model& from); + void MergeFrom(const Model& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Model* other); + protected: + explicit Model(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 4; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 4; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // .diplomacy.tensorflow.decision_trees.DecisionTree decision_tree = 1; + bool has_decision_tree() const; + void clear_decision_tree(); + static const int kDecisionTreeFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::DecisionTree& _internal_decision_tree() const; + public: + const ::diplomacy::tensorflow::decision_trees::DecisionTree& decision_tree() const; + ::diplomacy::tensorflow::decision_trees::DecisionTree* release_decision_tree(); + ::diplomacy::tensorflow::decision_trees::DecisionTree* mutable_decision_tree(); + void set_allocated_decision_tree(::diplomacy::tensorflow::decision_trees::DecisionTree* decision_tree); + void unsafe_arena_set_allocated_decision_tree( + ::diplomacy::tensorflow::decision_trees::DecisionTree* decision_tree); + ::diplomacy::tensorflow::decision_trees::DecisionTree* unsafe_arena_release_decision_tree(); + + // .diplomacy.tensorflow.decision_trees.Ensemble ensemble = 2; + bool has_ensemble() const; + void clear_ensemble(); + static const int kEnsembleFieldNumber = 2; + private: + const ::diplomacy::tensorflow::decision_trees::Ensemble& _internal_ensemble() const; + public: + const ::diplomacy::tensorflow::decision_trees::Ensemble& ensemble() const; + ::diplomacy::tensorflow::decision_trees::Ensemble* release_ensemble(); + ::diplomacy::tensorflow::decision_trees::Ensemble* mutable_ensemble(); + void set_allocated_ensemble(::diplomacy::tensorflow::decision_trees::Ensemble* ensemble); + void unsafe_arena_set_allocated_ensemble( + ::diplomacy::tensorflow::decision_trees::Ensemble* ensemble); + ::diplomacy::tensorflow::decision_trees::Ensemble* unsafe_arena_release_ensemble(); + + // .google.protobuf.Any custom_model = 3; + bool has_custom_model() const; + void clear_custom_model(); + static const int kCustomModelFieldNumber = 3; + private: + const ::google::protobuf::Any& _internal_custom_model() const; + public: + const ::google::protobuf::Any& custom_model() const; + ::google::protobuf::Any* release_custom_model(); + ::google::protobuf::Any* mutable_custom_model(); + void set_allocated_custom_model(::google::protobuf::Any* custom_model); + void unsafe_arena_set_allocated_custom_model( + ::google::protobuf::Any* custom_model); + ::google::protobuf::Any* unsafe_arena_release_custom_model(); + + void clear_model(); + ModelCase model_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Model) + private: + void set_has_decision_tree(); + void set_has_ensemble(); + void set_has_custom_model(); + + inline bool has_model() const; + inline void clear_has_model(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + union ModelUnion { + ModelUnion() {} + ::diplomacy::tensorflow::decision_trees::DecisionTree* decision_tree_; + ::diplomacy::tensorflow::decision_trees::Ensemble* ensemble_; + ::google::protobuf::Any* custom_model_; + } model_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ModelAndFeatures_Feature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) */ { + public: + ModelAndFeatures_Feature(); + virtual ~ModelAndFeatures_Feature(); + + ModelAndFeatures_Feature(const ModelAndFeatures_Feature& from); + + inline ModelAndFeatures_Feature& operator=(const ModelAndFeatures_Feature& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ModelAndFeatures_Feature(ModelAndFeatures_Feature&& from) noexcept + : ModelAndFeatures_Feature() { + *this = ::std::move(from); + } + + inline ModelAndFeatures_Feature& operator=(ModelAndFeatures_Feature&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ModelAndFeatures_Feature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ModelAndFeatures_Feature* internal_default_instance() { + return reinterpret_cast( + &_ModelAndFeatures_Feature_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(ModelAndFeatures_Feature* other); + void Swap(ModelAndFeatures_Feature* other); + friend void swap(ModelAndFeatures_Feature& a, ModelAndFeatures_Feature& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ModelAndFeatures_Feature* New() const final { + return CreateMaybeMessage(NULL); + } + + ModelAndFeatures_Feature* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ModelAndFeatures_Feature& from); + void MergeFrom(const ModelAndFeatures_Feature& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ModelAndFeatures_Feature* other); + protected: + explicit ModelAndFeatures_Feature(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 2; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 2; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR bool has_feature_id() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_feature_id(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kFeatureIdFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::FeatureId& _internal_feature_id() const; + public: + GOOGLE_PROTOBUF_DEPRECATED_ATTR const ::diplomacy::tensorflow::decision_trees::FeatureId& feature_id() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::diplomacy::tensorflow::decision_trees::FeatureId* release_feature_id(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::diplomacy::tensorflow::decision_trees::FeatureId* mutable_feature_id(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_allocated_feature_id(::diplomacy::tensorflow::decision_trees::FeatureId* feature_id); + GOOGLE_PROTOBUF_DEPRECATED_ATTR void unsafe_arena_set_allocated_feature_id( + ::diplomacy::tensorflow::decision_trees::FeatureId* feature_id); + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::diplomacy::tensorflow::decision_trees::FeatureId* unsafe_arena_release_feature_id(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + ::diplomacy::tensorflow::decision_trees::FeatureId* feature_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ModelAndFeatures_FeaturesEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + ModelAndFeatures_FeaturesEntry_DoNotUse(); + ModelAndFeatures_FeaturesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const ModelAndFeatures_FeaturesEntry_DoNotUse& other); + static const ModelAndFeatures_FeaturesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_ModelAndFeatures_FeaturesEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class ModelAndFeatures : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.ModelAndFeatures) */ { + public: + ModelAndFeatures(); + virtual ~ModelAndFeatures(); + + ModelAndFeatures(const ModelAndFeatures& from); + + inline ModelAndFeatures& operator=(const ModelAndFeatures& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ModelAndFeatures(ModelAndFeatures&& from) noexcept + : ModelAndFeatures() { + *this = ::std::move(from); + } + + inline ModelAndFeatures& operator=(ModelAndFeatures&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ModelAndFeatures& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ModelAndFeatures* internal_default_instance() { + return reinterpret_cast( + &_ModelAndFeatures_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(ModelAndFeatures* other); + void Swap(ModelAndFeatures* other); + friend void swap(ModelAndFeatures& a, ModelAndFeatures& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ModelAndFeatures* New() const final { + return CreateMaybeMessage(NULL); + } + + ModelAndFeatures* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ModelAndFeatures& from); + void MergeFrom(const ModelAndFeatures& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ModelAndFeatures* other); + protected: + explicit ModelAndFeatures(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef ModelAndFeatures_Feature Feature; + + // accessors ------------------------------------------------------- + + // map features = 1; + int features_size() const; + void clear_features(); + static const int kFeaturesFieldNumber = 1; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >& + features() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >* + mutable_features(); + + // repeated .google.protobuf.Any additional_data = 3; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 3; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // .diplomacy.tensorflow.decision_trees.Model model = 2; + bool has_model() const; + void clear_model(); + static const int kModelFieldNumber = 2; + private: + const ::diplomacy::tensorflow::decision_trees::Model& _internal_model() const; + public: + const ::diplomacy::tensorflow::decision_trees::Model& model() const; + ::diplomacy::tensorflow::decision_trees::Model* release_model(); + ::diplomacy::tensorflow::decision_trees::Model* mutable_model(); + void set_allocated_model(::diplomacy::tensorflow::decision_trees::Model* model); + void unsafe_arena_set_allocated_model( + ::diplomacy::tensorflow::decision_trees::Model* model); + ::diplomacy::tensorflow::decision_trees::Model* unsafe_arena_release_model(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + ModelAndFeatures_FeaturesEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > features_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + ::diplomacy::tensorflow::decision_trees::Model* model_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Ensemble_Member : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Ensemble.Member) */ { + public: + Ensemble_Member(); + virtual ~Ensemble_Member(); + + Ensemble_Member(const Ensemble_Member& from); + + inline Ensemble_Member& operator=(const Ensemble_Member& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Ensemble_Member(Ensemble_Member&& from) noexcept + : Ensemble_Member() { + *this = ::std::move(from); + } + + inline Ensemble_Member& operator=(Ensemble_Member&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Ensemble_Member& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Ensemble_Member* internal_default_instance() { + return reinterpret_cast( + &_Ensemble_Member_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(Ensemble_Member* other); + void Swap(Ensemble_Member* other); + friend void swap(Ensemble_Member& a, Ensemble_Member& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Ensemble_Member* New() const final { + return CreateMaybeMessage(NULL); + } + + Ensemble_Member* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Ensemble_Member& from); + void MergeFrom(const Ensemble_Member& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Ensemble_Member* other); + protected: + explicit Ensemble_Member(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 3; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 3; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // .diplomacy.tensorflow.decision_trees.Model submodel = 1; + bool has_submodel() const; + void clear_submodel(); + static const int kSubmodelFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::Model& _internal_submodel() const; + public: + const ::diplomacy::tensorflow::decision_trees::Model& submodel() const; + ::diplomacy::tensorflow::decision_trees::Model* release_submodel(); + ::diplomacy::tensorflow::decision_trees::Model* mutable_submodel(); + void set_allocated_submodel(::diplomacy::tensorflow::decision_trees::Model* submodel); + void unsafe_arena_set_allocated_submodel( + ::diplomacy::tensorflow::decision_trees::Model* submodel); + ::diplomacy::tensorflow::decision_trees::Model* unsafe_arena_release_submodel(); + + // .google.protobuf.Int32Value submodel_id = 2; + bool has_submodel_id() const; + void clear_submodel_id(); + static const int kSubmodelIdFieldNumber = 2; + private: + const ::google::protobuf::Int32Value& _internal_submodel_id() const; + public: + const ::google::protobuf::Int32Value& submodel_id() const; + ::google::protobuf::Int32Value* release_submodel_id(); + ::google::protobuf::Int32Value* mutable_submodel_id(); + void set_allocated_submodel_id(::google::protobuf::Int32Value* submodel_id); + void unsafe_arena_set_allocated_submodel_id( + ::google::protobuf::Int32Value* submodel_id); + ::google::protobuf::Int32Value* unsafe_arena_release_submodel_id(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Ensemble.Member) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + ::diplomacy::tensorflow::decision_trees::Model* submodel_; + ::google::protobuf::Int32Value* submodel_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Ensemble : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Ensemble) */ { + public: + Ensemble(); + virtual ~Ensemble(); + + Ensemble(const Ensemble& from); + + inline Ensemble& operator=(const Ensemble& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Ensemble(Ensemble&& from) noexcept + : Ensemble() { + *this = ::std::move(from); + } + + inline Ensemble& operator=(Ensemble&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Ensemble& default_instance(); + + enum CombinationTechniqueCase { + kSummationCombinationTechnique = 1, + kAveragingCombinationTechnique = 2, + kCustomCombinationTechnique = 3, + COMBINATION_TECHNIQUE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Ensemble* internal_default_instance() { + return reinterpret_cast( + &_Ensemble_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(Ensemble* other); + void Swap(Ensemble* other); + friend void swap(Ensemble& a, Ensemble& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Ensemble* New() const final { + return CreateMaybeMessage(NULL); + } + + Ensemble* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Ensemble& from); + void MergeFrom(const Ensemble& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Ensemble* other); + protected: + explicit Ensemble(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Ensemble_Member Member; + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 4; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 4; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // repeated .diplomacy.tensorflow.decision_trees.Ensemble.Member members = 100; + int members_size() const; + void clear_members(); + static const int kMembersFieldNumber = 100; + ::diplomacy::tensorflow::decision_trees::Ensemble_Member* mutable_members(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Ensemble_Member >* + mutable_members(); + const ::diplomacy::tensorflow::decision_trees::Ensemble_Member& members(int index) const; + ::diplomacy::tensorflow::decision_trees::Ensemble_Member* add_members(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Ensemble_Member >& + members() const; + + // .diplomacy.tensorflow.decision_trees.Summation summation_combination_technique = 1; + bool has_summation_combination_technique() const; + void clear_summation_combination_technique(); + static const int kSummationCombinationTechniqueFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::Summation& _internal_summation_combination_technique() const; + public: + const ::diplomacy::tensorflow::decision_trees::Summation& summation_combination_technique() const; + ::diplomacy::tensorflow::decision_trees::Summation* release_summation_combination_technique(); + ::diplomacy::tensorflow::decision_trees::Summation* mutable_summation_combination_technique(); + void set_allocated_summation_combination_technique(::diplomacy::tensorflow::decision_trees::Summation* summation_combination_technique); + void unsafe_arena_set_allocated_summation_combination_technique( + ::diplomacy::tensorflow::decision_trees::Summation* summation_combination_technique); + ::diplomacy::tensorflow::decision_trees::Summation* unsafe_arena_release_summation_combination_technique(); + + // .diplomacy.tensorflow.decision_trees.Averaging averaging_combination_technique = 2; + bool has_averaging_combination_technique() const; + void clear_averaging_combination_technique(); + static const int kAveragingCombinationTechniqueFieldNumber = 2; + private: + const ::diplomacy::tensorflow::decision_trees::Averaging& _internal_averaging_combination_technique() const; + public: + const ::diplomacy::tensorflow::decision_trees::Averaging& averaging_combination_technique() const; + ::diplomacy::tensorflow::decision_trees::Averaging* release_averaging_combination_technique(); + ::diplomacy::tensorflow::decision_trees::Averaging* mutable_averaging_combination_technique(); + void set_allocated_averaging_combination_technique(::diplomacy::tensorflow::decision_trees::Averaging* averaging_combination_technique); + void unsafe_arena_set_allocated_averaging_combination_technique( + ::diplomacy::tensorflow::decision_trees::Averaging* averaging_combination_technique); + ::diplomacy::tensorflow::decision_trees::Averaging* unsafe_arena_release_averaging_combination_technique(); + + // .google.protobuf.Any custom_combination_technique = 3; + bool has_custom_combination_technique() const; + void clear_custom_combination_technique(); + static const int kCustomCombinationTechniqueFieldNumber = 3; + private: + const ::google::protobuf::Any& _internal_custom_combination_technique() const; + public: + const ::google::protobuf::Any& custom_combination_technique() const; + ::google::protobuf::Any* release_custom_combination_technique(); + ::google::protobuf::Any* mutable_custom_combination_technique(); + void set_allocated_custom_combination_technique(::google::protobuf::Any* custom_combination_technique); + void unsafe_arena_set_allocated_custom_combination_technique( + ::google::protobuf::Any* custom_combination_technique); + ::google::protobuf::Any* unsafe_arena_release_custom_combination_technique(); + + void clear_combination_technique(); + CombinationTechniqueCase combination_technique_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Ensemble) + private: + void set_has_summation_combination_technique(); + void set_has_averaging_combination_technique(); + void set_has_custom_combination_technique(); + + inline bool has_combination_technique() const; + inline void clear_has_combination_technique(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Ensemble_Member > members_; + union CombinationTechniqueUnion { + CombinationTechniqueUnion() {} + ::diplomacy::tensorflow::decision_trees::Summation* summation_combination_technique_; + ::diplomacy::tensorflow::decision_trees::Averaging* averaging_combination_technique_; + ::google::protobuf::Any* custom_combination_technique_; + } combination_technique_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Summation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Summation) */ { + public: + Summation(); + virtual ~Summation(); + + Summation(const Summation& from); + + inline Summation& operator=(const Summation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Summation(Summation&& from) noexcept + : Summation() { + *this = ::std::move(from); + } + + inline Summation& operator=(Summation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Summation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Summation* internal_default_instance() { + return reinterpret_cast( + &_Summation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(Summation* other); + void Swap(Summation* other); + friend void swap(Summation& a, Summation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Summation* New() const final { + return CreateMaybeMessage(NULL); + } + + Summation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Summation& from); + void MergeFrom(const Summation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Summation* other); + protected: + explicit Summation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 1; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 1; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Summation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Averaging : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Averaging) */ { + public: + Averaging(); + virtual ~Averaging(); + + Averaging(const Averaging& from); + + inline Averaging& operator=(const Averaging& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Averaging(Averaging&& from) noexcept + : Averaging() { + *this = ::std::move(from); + } + + inline Averaging& operator=(Averaging&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Averaging& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Averaging* internal_default_instance() { + return reinterpret_cast( + &_Averaging_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(Averaging* other); + void Swap(Averaging* other); + friend void swap(Averaging& a, Averaging& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Averaging* New() const final { + return CreateMaybeMessage(NULL); + } + + Averaging* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Averaging& from); + void MergeFrom(const Averaging& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Averaging* other); + protected: + explicit Averaging(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 1; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 1; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Averaging) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DecisionTree : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.DecisionTree) */ { + public: + DecisionTree(); + virtual ~DecisionTree(); + + DecisionTree(const DecisionTree& from); + + inline DecisionTree& operator=(const DecisionTree& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DecisionTree(DecisionTree&& from) noexcept + : DecisionTree() { + *this = ::std::move(from); + } + + inline DecisionTree& operator=(DecisionTree&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DecisionTree& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DecisionTree* internal_default_instance() { + return reinterpret_cast( + &_DecisionTree_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(DecisionTree* other); + void Swap(DecisionTree* other); + friend void swap(DecisionTree& a, DecisionTree& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DecisionTree* New() const final { + return CreateMaybeMessage(NULL); + } + + DecisionTree* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DecisionTree& from); + void MergeFrom(const DecisionTree& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DecisionTree* other); + protected: + explicit DecisionTree(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes = 1; + int nodes_size() const; + void clear_nodes(); + static const int kNodesFieldNumber = 1; + ::diplomacy::tensorflow::decision_trees::TreeNode* mutable_nodes(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >* + mutable_nodes(); + const ::diplomacy::tensorflow::decision_trees::TreeNode& nodes(int index) const; + ::diplomacy::tensorflow::decision_trees::TreeNode* add_nodes(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >& + nodes() const; + + // repeated .google.protobuf.Any additional_data = 2; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 2; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.DecisionTree) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode > nodes_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TreeNode : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.TreeNode) */ { + public: + TreeNode(); + virtual ~TreeNode(); + + TreeNode(const TreeNode& from); + + inline TreeNode& operator=(const TreeNode& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeNode(TreeNode&& from) noexcept + : TreeNode() { + *this = ::std::move(from); + } + + inline TreeNode& operator=(TreeNode&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeNode& default_instance(); + + enum NodeTypeCase { + kBinaryNode = 4, + kLeaf = 5, + kCustomNodeType = 6, + NODE_TYPE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeNode* internal_default_instance() { + return reinterpret_cast( + &_TreeNode_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void UnsafeArenaSwap(TreeNode* other); + void Swap(TreeNode* other); + friend void swap(TreeNode& a, TreeNode& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeNode* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeNode* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeNode& from); + void MergeFrom(const TreeNode& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeNode* other); + protected: + explicit TreeNode(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 7; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 7; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // .google.protobuf.Int32Value node_id = 1; + bool has_node_id() const; + void clear_node_id(); + static const int kNodeIdFieldNumber = 1; + private: + const ::google::protobuf::Int32Value& _internal_node_id() const; + public: + const ::google::protobuf::Int32Value& node_id() const; + ::google::protobuf::Int32Value* release_node_id(); + ::google::protobuf::Int32Value* mutable_node_id(); + void set_allocated_node_id(::google::protobuf::Int32Value* node_id); + void unsafe_arena_set_allocated_node_id( + ::google::protobuf::Int32Value* node_id); + ::google::protobuf::Int32Value* unsafe_arena_release_node_id(); + + // .google.protobuf.Int32Value depth = 2; + bool has_depth() const; + void clear_depth(); + static const int kDepthFieldNumber = 2; + private: + const ::google::protobuf::Int32Value& _internal_depth() const; + public: + const ::google::protobuf::Int32Value& depth() const; + ::google::protobuf::Int32Value* release_depth(); + ::google::protobuf::Int32Value* mutable_depth(); + void set_allocated_depth(::google::protobuf::Int32Value* depth); + void unsafe_arena_set_allocated_depth( + ::google::protobuf::Int32Value* depth); + ::google::protobuf::Int32Value* unsafe_arena_release_depth(); + + // .google.protobuf.Int32Value subtree_size = 3; + bool has_subtree_size() const; + void clear_subtree_size(); + static const int kSubtreeSizeFieldNumber = 3; + private: + const ::google::protobuf::Int32Value& _internal_subtree_size() const; + public: + const ::google::protobuf::Int32Value& subtree_size() const; + ::google::protobuf::Int32Value* release_subtree_size(); + ::google::protobuf::Int32Value* mutable_subtree_size(); + void set_allocated_subtree_size(::google::protobuf::Int32Value* subtree_size); + void unsafe_arena_set_allocated_subtree_size( + ::google::protobuf::Int32Value* subtree_size); + ::google::protobuf::Int32Value* unsafe_arena_release_subtree_size(); + + // .diplomacy.tensorflow.decision_trees.BinaryNode binary_node = 4; + bool has_binary_node() const; + void clear_binary_node(); + static const int kBinaryNodeFieldNumber = 4; + private: + const ::diplomacy::tensorflow::decision_trees::BinaryNode& _internal_binary_node() const; + public: + const ::diplomacy::tensorflow::decision_trees::BinaryNode& binary_node() const; + ::diplomacy::tensorflow::decision_trees::BinaryNode* release_binary_node(); + ::diplomacy::tensorflow::decision_trees::BinaryNode* mutable_binary_node(); + void set_allocated_binary_node(::diplomacy::tensorflow::decision_trees::BinaryNode* binary_node); + void unsafe_arena_set_allocated_binary_node( + ::diplomacy::tensorflow::decision_trees::BinaryNode* binary_node); + ::diplomacy::tensorflow::decision_trees::BinaryNode* unsafe_arena_release_binary_node(); + + // .diplomacy.tensorflow.decision_trees.Leaf leaf = 5; + bool has_leaf() const; + void clear_leaf(); + static const int kLeafFieldNumber = 5; + private: + const ::diplomacy::tensorflow::decision_trees::Leaf& _internal_leaf() const; + public: + const ::diplomacy::tensorflow::decision_trees::Leaf& leaf() const; + ::diplomacy::tensorflow::decision_trees::Leaf* release_leaf(); + ::diplomacy::tensorflow::decision_trees::Leaf* mutable_leaf(); + void set_allocated_leaf(::diplomacy::tensorflow::decision_trees::Leaf* leaf); + void unsafe_arena_set_allocated_leaf( + ::diplomacy::tensorflow::decision_trees::Leaf* leaf); + ::diplomacy::tensorflow::decision_trees::Leaf* unsafe_arena_release_leaf(); + + // .google.protobuf.Any custom_node_type = 6; + bool has_custom_node_type() const; + void clear_custom_node_type(); + static const int kCustomNodeTypeFieldNumber = 6; + private: + const ::google::protobuf::Any& _internal_custom_node_type() const; + public: + const ::google::protobuf::Any& custom_node_type() const; + ::google::protobuf::Any* release_custom_node_type(); + ::google::protobuf::Any* mutable_custom_node_type(); + void set_allocated_custom_node_type(::google::protobuf::Any* custom_node_type); + void unsafe_arena_set_allocated_custom_node_type( + ::google::protobuf::Any* custom_node_type); + ::google::protobuf::Any* unsafe_arena_release_custom_node_type(); + + void clear_node_type(); + NodeTypeCase node_type_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.TreeNode) + private: + void set_has_binary_node(); + void set_has_leaf(); + void set_has_custom_node_type(); + + inline bool has_node_type() const; + inline void clear_has_node_type(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + ::google::protobuf::Int32Value* node_id_; + ::google::protobuf::Int32Value* depth_; + ::google::protobuf::Int32Value* subtree_size_; + union NodeTypeUnion { + NodeTypeUnion() {} + ::diplomacy::tensorflow::decision_trees::BinaryNode* binary_node_; + ::diplomacy::tensorflow::decision_trees::Leaf* leaf_; + ::google::protobuf::Any* custom_node_type_; + } node_type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class BinaryNode : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.BinaryNode) */ { + public: + BinaryNode(); + virtual ~BinaryNode(); + + BinaryNode(const BinaryNode& from); + + inline BinaryNode& operator=(const BinaryNode& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BinaryNode(BinaryNode&& from) noexcept + : BinaryNode() { + *this = ::std::move(from); + } + + inline BinaryNode& operator=(BinaryNode&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BinaryNode& default_instance(); + + enum LeftChildTestCase { + kInequalityLeftChildTest = 4, + kCustomLeftChildTest = 5, + LEFT_CHILD_TEST_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BinaryNode* internal_default_instance() { + return reinterpret_cast( + &_BinaryNode_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void UnsafeArenaSwap(BinaryNode* other); + void Swap(BinaryNode* other); + friend void swap(BinaryNode& a, BinaryNode& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BinaryNode* New() const final { + return CreateMaybeMessage(NULL); + } + + BinaryNode* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BinaryNode& from); + void MergeFrom(const BinaryNode& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BinaryNode* other); + protected: + explicit BinaryNode(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef BinaryNode_Direction Direction; + static const Direction LEFT = + BinaryNode_Direction_LEFT; + static const Direction RIGHT = + BinaryNode_Direction_RIGHT; + static inline bool Direction_IsValid(int value) { + return BinaryNode_Direction_IsValid(value); + } + static const Direction Direction_MIN = + BinaryNode_Direction_Direction_MIN; + static const Direction Direction_MAX = + BinaryNode_Direction_Direction_MAX; + static const int Direction_ARRAYSIZE = + BinaryNode_Direction_Direction_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Direction_descriptor() { + return BinaryNode_Direction_descriptor(); + } + static inline const ::std::string& Direction_Name(Direction value) { + return BinaryNode_Direction_Name(value); + } + static inline bool Direction_Parse(const ::std::string& name, + Direction* value) { + return BinaryNode_Direction_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // .google.protobuf.Int32Value left_child_id = 1; + bool has_left_child_id() const; + void clear_left_child_id(); + static const int kLeftChildIdFieldNumber = 1; + private: + const ::google::protobuf::Int32Value& _internal_left_child_id() const; + public: + const ::google::protobuf::Int32Value& left_child_id() const; + ::google::protobuf::Int32Value* release_left_child_id(); + ::google::protobuf::Int32Value* mutable_left_child_id(); + void set_allocated_left_child_id(::google::protobuf::Int32Value* left_child_id); + void unsafe_arena_set_allocated_left_child_id( + ::google::protobuf::Int32Value* left_child_id); + ::google::protobuf::Int32Value* unsafe_arena_release_left_child_id(); + + // .google.protobuf.Int32Value right_child_id = 2; + bool has_right_child_id() const; + void clear_right_child_id(); + static const int kRightChildIdFieldNumber = 2; + private: + const ::google::protobuf::Int32Value& _internal_right_child_id() const; + public: + const ::google::protobuf::Int32Value& right_child_id() const; + ::google::protobuf::Int32Value* release_right_child_id(); + ::google::protobuf::Int32Value* mutable_right_child_id(); + void set_allocated_right_child_id(::google::protobuf::Int32Value* right_child_id); + void unsafe_arena_set_allocated_right_child_id( + ::google::protobuf::Int32Value* right_child_id); + ::google::protobuf::Int32Value* unsafe_arena_release_right_child_id(); + + // .diplomacy.tensorflow.decision_trees.BinaryNode.Direction default_direction = 3; + void clear_default_direction(); + static const int kDefaultDirectionFieldNumber = 3; + ::diplomacy::tensorflow::decision_trees::BinaryNode_Direction default_direction() const; + void set_default_direction(::diplomacy::tensorflow::decision_trees::BinaryNode_Direction value); + + // .diplomacy.tensorflow.decision_trees.InequalityTest inequality_left_child_test = 4; + bool has_inequality_left_child_test() const; + void clear_inequality_left_child_test(); + static const int kInequalityLeftChildTestFieldNumber = 4; + private: + const ::diplomacy::tensorflow::decision_trees::InequalityTest& _internal_inequality_left_child_test() const; + public: + const ::diplomacy::tensorflow::decision_trees::InequalityTest& inequality_left_child_test() const; + ::diplomacy::tensorflow::decision_trees::InequalityTest* release_inequality_left_child_test(); + ::diplomacy::tensorflow::decision_trees::InequalityTest* mutable_inequality_left_child_test(); + void set_allocated_inequality_left_child_test(::diplomacy::tensorflow::decision_trees::InequalityTest* inequality_left_child_test); + void unsafe_arena_set_allocated_inequality_left_child_test( + ::diplomacy::tensorflow::decision_trees::InequalityTest* inequality_left_child_test); + ::diplomacy::tensorflow::decision_trees::InequalityTest* unsafe_arena_release_inequality_left_child_test(); + + // .google.protobuf.Any custom_left_child_test = 5; + bool has_custom_left_child_test() const; + void clear_custom_left_child_test(); + static const int kCustomLeftChildTestFieldNumber = 5; + private: + const ::google::protobuf::Any& _internal_custom_left_child_test() const; + public: + const ::google::protobuf::Any& custom_left_child_test() const; + ::google::protobuf::Any* release_custom_left_child_test(); + ::google::protobuf::Any* mutable_custom_left_child_test(); + void set_allocated_custom_left_child_test(::google::protobuf::Any* custom_left_child_test); + void unsafe_arena_set_allocated_custom_left_child_test( + ::google::protobuf::Any* custom_left_child_test); + ::google::protobuf::Any* unsafe_arena_release_custom_left_child_test(); + + void clear_left_child_test(); + LeftChildTestCase left_child_test_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.BinaryNode) + private: + void set_has_inequality_left_child_test(); + void set_has_custom_left_child_test(); + + inline bool has_left_child_test() const; + inline void clear_has_left_child_test(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::Int32Value* left_child_id_; + ::google::protobuf::Int32Value* right_child_id_; + int default_direction_; + union LeftChildTestUnion { + LeftChildTestUnion() {} + ::diplomacy::tensorflow::decision_trees::InequalityTest* inequality_left_child_test_; + ::google::protobuf::Any* custom_left_child_test_; + } left_child_test_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SparseVector_SparseValueEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + SparseVector_SparseValueEntry_DoNotUse(); + SparseVector_SparseValueEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const SparseVector_SparseValueEntry_DoNotUse& other); + static const SparseVector_SparseValueEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_SparseVector_SparseValueEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class SparseVector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.SparseVector) */ { + public: + SparseVector(); + virtual ~SparseVector(); + + SparseVector(const SparseVector& from); + + inline SparseVector& operator=(const SparseVector& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SparseVector(SparseVector&& from) noexcept + : SparseVector() { + *this = ::std::move(from); + } + + inline SparseVector& operator=(SparseVector&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SparseVector& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SparseVector* internal_default_instance() { + return reinterpret_cast( + &_SparseVector_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void UnsafeArenaSwap(SparseVector* other); + void Swap(SparseVector* other); + friend void swap(SparseVector& a, SparseVector& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SparseVector* New() const final { + return CreateMaybeMessage(NULL); + } + + SparseVector* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SparseVector& from); + void MergeFrom(const SparseVector& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SparseVector* other); + protected: + explicit SparseVector(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map sparse_value = 1; + int sparse_value_size() const; + void clear_sparse_value(); + static const int kSparseValueFieldNumber = 1; + const ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >& + sparse_value() const; + ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >* + mutable_sparse_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.SparseVector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + SparseVector_SparseValueEntry_DoNotUse, + ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > sparse_value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Vector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Vector) */ { + public: + Vector(); + virtual ~Vector(); + + Vector(const Vector& from); + + inline Vector& operator=(const Vector& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Vector(Vector&& from) noexcept + : Vector() { + *this = ::std::move(from); + } + + inline Vector& operator=(Vector&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Vector& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Vector* internal_default_instance() { + return reinterpret_cast( + &_Vector_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void UnsafeArenaSwap(Vector* other); + void Swap(Vector* other); + friend void swap(Vector& a, Vector& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Vector* New() const final { + return CreateMaybeMessage(NULL); + } + + Vector* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Vector& from); + void MergeFrom(const Vector& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Vector* other); + protected: + explicit Vector(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.decision_trees.Value value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + ::diplomacy::tensorflow::decision_trees::Value* mutable_value(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >* + mutable_value(); + const ::diplomacy::tensorflow::decision_trees::Value& value(int index) const; + ::diplomacy::tensorflow::decision_trees::Value* add_value(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >& + value() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Vector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value > value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Leaf : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Leaf) */ { + public: + Leaf(); + virtual ~Leaf(); + + Leaf(const Leaf& from); + + inline Leaf& operator=(const Leaf& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Leaf(Leaf&& from) noexcept + : Leaf() { + *this = ::std::move(from); + } + + inline Leaf& operator=(Leaf&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Leaf& default_instance(); + + enum LeafCase { + kVector = 1, + kSparseVector = 2, + LEAF_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Leaf* internal_default_instance() { + return reinterpret_cast( + &_Leaf_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + void UnsafeArenaSwap(Leaf* other); + void Swap(Leaf* other); + friend void swap(Leaf& a, Leaf& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Leaf* New() const final { + return CreateMaybeMessage(NULL); + } + + Leaf* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Leaf& from); + void MergeFrom(const Leaf& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Leaf* other); + protected: + explicit Leaf(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 3; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 3; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // .diplomacy.tensorflow.decision_trees.Vector vector = 1; + bool has_vector() const; + void clear_vector(); + static const int kVectorFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::Vector& _internal_vector() const; + public: + const ::diplomacy::tensorflow::decision_trees::Vector& vector() const; + ::diplomacy::tensorflow::decision_trees::Vector* release_vector(); + ::diplomacy::tensorflow::decision_trees::Vector* mutable_vector(); + void set_allocated_vector(::diplomacy::tensorflow::decision_trees::Vector* vector); + void unsafe_arena_set_allocated_vector( + ::diplomacy::tensorflow::decision_trees::Vector* vector); + ::diplomacy::tensorflow::decision_trees::Vector* unsafe_arena_release_vector(); + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_vector = 2; + bool has_sparse_vector() const; + void clear_sparse_vector(); + static const int kSparseVectorFieldNumber = 2; + private: + const ::diplomacy::tensorflow::decision_trees::SparseVector& _internal_sparse_vector() const; + public: + const ::diplomacy::tensorflow::decision_trees::SparseVector& sparse_vector() const; + ::diplomacy::tensorflow::decision_trees::SparseVector* release_sparse_vector(); + ::diplomacy::tensorflow::decision_trees::SparseVector* mutable_sparse_vector(); + void set_allocated_sparse_vector(::diplomacy::tensorflow::decision_trees::SparseVector* sparse_vector); + void unsafe_arena_set_allocated_sparse_vector( + ::diplomacy::tensorflow::decision_trees::SparseVector* sparse_vector); + ::diplomacy::tensorflow::decision_trees::SparseVector* unsafe_arena_release_sparse_vector(); + + void clear_leaf(); + LeafCase leaf_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Leaf) + private: + void set_has_vector(); + void set_has_sparse_vector(); + + inline bool has_leaf() const; + inline void clear_has_leaf(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + union LeafUnion { + LeafUnion() {} + ::diplomacy::tensorflow::decision_trees::Vector* vector_; + ::diplomacy::tensorflow::decision_trees::SparseVector* sparse_vector_; + } leaf_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FeatureId : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.FeatureId) */ { + public: + FeatureId(); + virtual ~FeatureId(); + + FeatureId(const FeatureId& from); + + inline FeatureId& operator=(const FeatureId& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FeatureId(FeatureId&& from) noexcept + : FeatureId() { + *this = ::std::move(from); + } + + inline FeatureId& operator=(FeatureId&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FeatureId& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FeatureId* internal_default_instance() { + return reinterpret_cast( + &_FeatureId_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void UnsafeArenaSwap(FeatureId* other); + void Swap(FeatureId* other); + friend void swap(FeatureId& a, FeatureId& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FeatureId* New() const final { + return CreateMaybeMessage(NULL); + } + + FeatureId* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FeatureId& from); + void MergeFrom(const FeatureId& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FeatureId* other); + protected: + explicit FeatureId(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.Any additional_data = 2; + int additional_data_size() const; + void clear_additional_data(); + static const int kAdditionalDataFieldNumber = 2; + ::google::protobuf::Any* mutable_additional_data(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* + mutable_additional_data(); + const ::google::protobuf::Any& additional_data(int index) const; + ::google::protobuf::Any* add_additional_data(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& + additional_data() const; + + // .google.protobuf.StringValue id = 1; + bool has_id() const; + void clear_id(); + static const int kIdFieldNumber = 1; + private: + const ::google::protobuf::StringValue& _internal_id() const; + public: + const ::google::protobuf::StringValue& id() const; + ::google::protobuf::StringValue* release_id(); + ::google::protobuf::StringValue* mutable_id(); + void set_allocated_id(::google::protobuf::StringValue* id); + void unsafe_arena_set_allocated_id( + ::google::protobuf::StringValue* id); + ::google::protobuf::StringValue* unsafe_arena_release_id(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.FeatureId) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any > additional_data_; + ::google::protobuf::StringValue* id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ObliqueFeatures : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.ObliqueFeatures) */ { + public: + ObliqueFeatures(); + virtual ~ObliqueFeatures(); + + ObliqueFeatures(const ObliqueFeatures& from); + + inline ObliqueFeatures& operator=(const ObliqueFeatures& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ObliqueFeatures(ObliqueFeatures&& from) noexcept + : ObliqueFeatures() { + *this = ::std::move(from); + } + + inline ObliqueFeatures& operator=(ObliqueFeatures&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ObliqueFeatures& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ObliqueFeatures* internal_default_instance() { + return reinterpret_cast( + &_ObliqueFeatures_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + void UnsafeArenaSwap(ObliqueFeatures* other); + void Swap(ObliqueFeatures* other); + friend void swap(ObliqueFeatures& a, ObliqueFeatures& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ObliqueFeatures* New() const final { + return CreateMaybeMessage(NULL); + } + + ObliqueFeatures* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ObliqueFeatures& from); + void MergeFrom(const ObliqueFeatures& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ObliqueFeatures* other); + protected: + explicit ObliqueFeatures(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.decision_trees.FeatureId features = 1; + int features_size() const; + void clear_features(); + static const int kFeaturesFieldNumber = 1; + ::diplomacy::tensorflow::decision_trees::FeatureId* mutable_features(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::FeatureId >* + mutable_features(); + const ::diplomacy::tensorflow::decision_trees::FeatureId& features(int index) const; + ::diplomacy::tensorflow::decision_trees::FeatureId* add_features(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::FeatureId >& + features() const; + + // repeated float weights = 2; + int weights_size() const; + void clear_weights(); + static const int kWeightsFieldNumber = 2; + float weights(int index) const; + void set_weights(int index, float value); + void add_weights(float value); + const ::google::protobuf::RepeatedField< float >& + weights() const; + ::google::protobuf::RepeatedField< float >* + mutable_weights(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::FeatureId > features_; + ::google::protobuf::RepeatedField< float > weights_; + mutable int _weights_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class InequalityTest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.InequalityTest) */ { + public: + InequalityTest(); + virtual ~InequalityTest(); + + InequalityTest(const InequalityTest& from); + + inline InequalityTest& operator=(const InequalityTest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + InequalityTest(InequalityTest&& from) noexcept + : InequalityTest() { + *this = ::std::move(from); + } + + inline InequalityTest& operator=(InequalityTest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const InequalityTest& default_instance(); + + enum FeatureSumCase { + kFeatureId = 1, + kOblique = 4, + FEATURESUM_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const InequalityTest* internal_default_instance() { + return reinterpret_cast( + &_InequalityTest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 17; + + void UnsafeArenaSwap(InequalityTest* other); + void Swap(InequalityTest* other); + friend void swap(InequalityTest& a, InequalityTest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline InequalityTest* New() const final { + return CreateMaybeMessage(NULL); + } + + InequalityTest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const InequalityTest& from); + void MergeFrom(const InequalityTest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(InequalityTest* other); + protected: + explicit InequalityTest(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef InequalityTest_Type Type; + static const Type LESS_OR_EQUAL = + InequalityTest_Type_LESS_OR_EQUAL; + static const Type LESS_THAN = + InequalityTest_Type_LESS_THAN; + static const Type GREATER_OR_EQUAL = + InequalityTest_Type_GREATER_OR_EQUAL; + static const Type GREATER_THAN = + InequalityTest_Type_GREATER_THAN; + static inline bool Type_IsValid(int value) { + return InequalityTest_Type_IsValid(value); + } + static const Type Type_MIN = + InequalityTest_Type_Type_MIN; + static const Type Type_MAX = + InequalityTest_Type_Type_MAX; + static const int Type_ARRAYSIZE = + InequalityTest_Type_Type_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Type_descriptor() { + return InequalityTest_Type_descriptor(); + } + static inline const ::std::string& Type_Name(Type value) { + return InequalityTest_Type_Name(value); + } + static inline bool Type_Parse(const ::std::string& name, + Type* value) { + return InequalityTest_Type_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.decision_trees.Value threshold = 3; + bool has_threshold() const; + void clear_threshold(); + static const int kThresholdFieldNumber = 3; + private: + const ::diplomacy::tensorflow::decision_trees::Value& _internal_threshold() const; + public: + const ::diplomacy::tensorflow::decision_trees::Value& threshold() const; + ::diplomacy::tensorflow::decision_trees::Value* release_threshold(); + ::diplomacy::tensorflow::decision_trees::Value* mutable_threshold(); + void set_allocated_threshold(::diplomacy::tensorflow::decision_trees::Value* threshold); + void unsafe_arena_set_allocated_threshold( + ::diplomacy::tensorflow::decision_trees::Value* threshold); + ::diplomacy::tensorflow::decision_trees::Value* unsafe_arena_release_threshold(); + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type type = 2; + void clear_type(); + static const int kTypeFieldNumber = 2; + ::diplomacy::tensorflow::decision_trees::InequalityTest_Type type() const; + void set_type(::diplomacy::tensorflow::decision_trees::InequalityTest_Type value); + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + bool has_feature_id() const; + void clear_feature_id(); + static const int kFeatureIdFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::FeatureId& _internal_feature_id() const; + public: + const ::diplomacy::tensorflow::decision_trees::FeatureId& feature_id() const; + ::diplomacy::tensorflow::decision_trees::FeatureId* release_feature_id(); + ::diplomacy::tensorflow::decision_trees::FeatureId* mutable_feature_id(); + void set_allocated_feature_id(::diplomacy::tensorflow::decision_trees::FeatureId* feature_id); + void unsafe_arena_set_allocated_feature_id( + ::diplomacy::tensorflow::decision_trees::FeatureId* feature_id); + ::diplomacy::tensorflow::decision_trees::FeatureId* unsafe_arena_release_feature_id(); + + // .diplomacy.tensorflow.decision_trees.ObliqueFeatures oblique = 4; + bool has_oblique() const; + void clear_oblique(); + static const int kObliqueFieldNumber = 4; + private: + const ::diplomacy::tensorflow::decision_trees::ObliqueFeatures& _internal_oblique() const; + public: + const ::diplomacy::tensorflow::decision_trees::ObliqueFeatures& oblique() const; + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* release_oblique(); + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* mutable_oblique(); + void set_allocated_oblique(::diplomacy::tensorflow::decision_trees::ObliqueFeatures* oblique); + void unsafe_arena_set_allocated_oblique( + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* oblique); + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* unsafe_arena_release_oblique(); + + void clear_FeatureSum(); + FeatureSumCase FeatureSum_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.InequalityTest) + private: + void set_has_feature_id(); + void set_has_oblique(); + + inline bool has_FeatureSum() const; + inline void clear_has_FeatureSum(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::decision_trees::Value* threshold_; + int type_; + union FeatureSumUnion { + FeatureSumUnion() {} + ::diplomacy::tensorflow::decision_trees::FeatureId* feature_id_; + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* oblique_; + } FeatureSum_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.Value) */ { + public: + Value(); + virtual ~Value(); + + Value(const Value& from); + + inline Value& operator=(const Value& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Value(Value&& from) noexcept + : Value() { + *this = ::std::move(from); + } + + inline Value& operator=(Value&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Value& default_instance(); + + enum ValueCase { + kFloatValue = 1, + kDoubleValue = 2, + kInt32Value = 3, + kInt64Value = 4, + kCustomValue = 5, + VALUE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Value* internal_default_instance() { + return reinterpret_cast( + &_Value_default_instance_); + } + static constexpr int kIndexInFileMessages = + 18; + + void UnsafeArenaSwap(Value* other); + void Swap(Value* other); + friend void swap(Value& a, Value& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Value* New() const final { + return CreateMaybeMessage(NULL); + } + + Value* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Value& from); + void MergeFrom(const Value& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Value* other); + protected: + explicit Value(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float float_value = 1; + private: + bool has_float_value() const; + public: + void clear_float_value(); + static const int kFloatValueFieldNumber = 1; + float float_value() const; + void set_float_value(float value); + + // double double_value = 2; + private: + bool has_double_value() const; + public: + void clear_double_value(); + static const int kDoubleValueFieldNumber = 2; + double double_value() const; + void set_double_value(double value); + + // int32 int32_value = 3; + private: + bool has_int32_value() const; + public: + void clear_int32_value(); + static const int kInt32ValueFieldNumber = 3; + ::google::protobuf::int32 int32_value() const; + void set_int32_value(::google::protobuf::int32 value); + + // int64 int64_value = 4; + private: + bool has_int64_value() const; + public: + void clear_int64_value(); + static const int kInt64ValueFieldNumber = 4; + ::google::protobuf::int64 int64_value() const; + void set_int64_value(::google::protobuf::int64 value); + + // .google.protobuf.Any custom_value = 5; + bool has_custom_value() const; + void clear_custom_value(); + static const int kCustomValueFieldNumber = 5; + private: + const ::google::protobuf::Any& _internal_custom_value() const; + public: + const ::google::protobuf::Any& custom_value() const; + ::google::protobuf::Any* release_custom_value(); + ::google::protobuf::Any* mutable_custom_value(); + void set_allocated_custom_value(::google::protobuf::Any* custom_value); + void unsafe_arena_set_allocated_custom_value( + ::google::protobuf::Any* custom_value); + ::google::protobuf::Any* unsafe_arena_release_custom_value(); + + void clear_value(); + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Value) + private: + void set_has_float_value(); + void set_has_double_value(); + void set_has_int32_value(); + void set_has_int64_value(); + void set_has_custom_value(); + + inline bool has_value() const; + inline void clear_has_value(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union ValueUnion { + ValueUnion() {} + float float_value_; + double double_value_; + ::google::protobuf::int32 int32_value_; + ::google::protobuf::int64 int64_value_; + ::google::protobuf::Any* custom_value_; + } value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Model + +// .diplomacy.tensorflow.decision_trees.DecisionTree decision_tree = 1; +inline bool Model::has_decision_tree() const { + return model_case() == kDecisionTree; +} +inline void Model::set_has_decision_tree() { + _oneof_case_[0] = kDecisionTree; +} +inline void Model::clear_decision_tree() { + if (has_decision_tree()) { + if (GetArenaNoVirtual() == NULL) { + delete model_.decision_tree_; + } + clear_has_model(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::DecisionTree& Model::_internal_decision_tree() const { + return *model_.decision_tree_; +} +inline ::diplomacy::tensorflow::decision_trees::DecisionTree* Model::release_decision_tree() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Model.decision_tree) + if (has_decision_tree()) { + clear_has_model(); + ::diplomacy::tensorflow::decision_trees::DecisionTree* temp = model_.decision_tree_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + model_.decision_tree_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::DecisionTree& Model::decision_tree() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Model.decision_tree) + return has_decision_tree() + ? *model_.decision_tree_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::DecisionTree*>(&::diplomacy::tensorflow::decision_trees::_DecisionTree_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::DecisionTree* Model::unsafe_arena_release_decision_tree() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Model.decision_tree) + if (has_decision_tree()) { + clear_has_model(); + ::diplomacy::tensorflow::decision_trees::DecisionTree* temp = model_.decision_tree_; + model_.decision_tree_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Model::unsafe_arena_set_allocated_decision_tree(::diplomacy::tensorflow::decision_trees::DecisionTree* decision_tree) { + clear_model(); + if (decision_tree) { + set_has_decision_tree(); + model_.decision_tree_ = decision_tree; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Model.decision_tree) +} +inline ::diplomacy::tensorflow::decision_trees::DecisionTree* Model::mutable_decision_tree() { + if (!has_decision_tree()) { + clear_model(); + set_has_decision_tree(); + model_.decision_tree_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::DecisionTree >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Model.decision_tree) + return model_.decision_tree_; +} + +// .diplomacy.tensorflow.decision_trees.Ensemble ensemble = 2; +inline bool Model::has_ensemble() const { + return model_case() == kEnsemble; +} +inline void Model::set_has_ensemble() { + _oneof_case_[0] = kEnsemble; +} +inline void Model::clear_ensemble() { + if (has_ensemble()) { + if (GetArenaNoVirtual() == NULL) { + delete model_.ensemble_; + } + clear_has_model(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::Ensemble& Model::_internal_ensemble() const { + return *model_.ensemble_; +} +inline ::diplomacy::tensorflow::decision_trees::Ensemble* Model::release_ensemble() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Model.ensemble) + if (has_ensemble()) { + clear_has_model(); + ::diplomacy::tensorflow::decision_trees::Ensemble* temp = model_.ensemble_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + model_.ensemble_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::Ensemble& Model::ensemble() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Model.ensemble) + return has_ensemble() + ? *model_.ensemble_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::Ensemble*>(&::diplomacy::tensorflow::decision_trees::_Ensemble_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Ensemble* Model::unsafe_arena_release_ensemble() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Model.ensemble) + if (has_ensemble()) { + clear_has_model(); + ::diplomacy::tensorflow::decision_trees::Ensemble* temp = model_.ensemble_; + model_.ensemble_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Model::unsafe_arena_set_allocated_ensemble(::diplomacy::tensorflow::decision_trees::Ensemble* ensemble) { + clear_model(); + if (ensemble) { + set_has_ensemble(); + model_.ensemble_ = ensemble; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Model.ensemble) +} +inline ::diplomacy::tensorflow::decision_trees::Ensemble* Model::mutable_ensemble() { + if (!has_ensemble()) { + clear_model(); + set_has_ensemble(); + model_.ensemble_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Ensemble >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Model.ensemble) + return model_.ensemble_; +} + +// .google.protobuf.Any custom_model = 3; +inline bool Model::has_custom_model() const { + return model_case() == kCustomModel; +} +inline void Model::set_has_custom_model() { + _oneof_case_[0] = kCustomModel; +} +inline const ::google::protobuf::Any& Model::_internal_custom_model() const { + return *model_.custom_model_; +} +inline ::google::protobuf::Any* Model::release_custom_model() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Model.custom_model) + if (has_custom_model()) { + clear_has_model(); + ::google::protobuf::Any* temp = model_.custom_model_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + model_.custom_model_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::google::protobuf::Any& Model::custom_model() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Model.custom_model) + return has_custom_model() + ? *model_.custom_model_ + : *reinterpret_cast< ::google::protobuf::Any*>(&::google::protobuf::_Any_default_instance_); +} +inline ::google::protobuf::Any* Model::unsafe_arena_release_custom_model() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Model.custom_model) + if (has_custom_model()) { + clear_has_model(); + ::google::protobuf::Any* temp = model_.custom_model_; + model_.custom_model_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Model::unsafe_arena_set_allocated_custom_model(::google::protobuf::Any* custom_model) { + clear_model(); + if (custom_model) { + set_has_custom_model(); + model_.custom_model_ = custom_model; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Model.custom_model) +} +inline ::google::protobuf::Any* Model::mutable_custom_model() { + if (!has_custom_model()) { + clear_model(); + set_has_custom_model(); + model_.custom_model_ = CreateMaybeMessage< ::google::protobuf::Any >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Model.custom_model) + return model_.custom_model_; +} + +// repeated .google.protobuf.Any additional_data = 4; +inline int Model::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* Model::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Model.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +Model::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Model.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& Model::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Model.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* Model::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Model.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +Model::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Model.additional_data) + return additional_data_; +} + +inline bool Model::has_model() const { + return model_case() != MODEL_NOT_SET; +} +inline void Model::clear_has_model() { + _oneof_case_[0] = MODEL_NOT_SET; +} +inline Model::ModelCase Model::model_case() const { + return Model::ModelCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ModelAndFeatures_Feature + +// .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1 [deprecated = true]; +inline bool ModelAndFeatures_Feature::has_feature_id() const { + return this != internal_default_instance() && feature_id_ != NULL; +} +inline void ModelAndFeatures_Feature::clear_feature_id() { + if (GetArenaNoVirtual() == NULL && feature_id_ != NULL) { + delete feature_id_; + } + feature_id_ = NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::FeatureId& ModelAndFeatures_Feature::_internal_feature_id() const { + return *feature_id_; +} +inline const ::diplomacy::tensorflow::decision_trees::FeatureId& ModelAndFeatures_Feature::feature_id() const { + const ::diplomacy::tensorflow::decision_trees::FeatureId* p = feature_id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.feature_id) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_FeatureId_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* ModelAndFeatures_Feature::release_feature_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.feature_id) + + ::diplomacy::tensorflow::decision_trees::FeatureId* temp = feature_id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + feature_id_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* ModelAndFeatures_Feature::unsafe_arena_release_feature_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.feature_id) + + ::diplomacy::tensorflow::decision_trees::FeatureId* temp = feature_id_; + feature_id_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* ModelAndFeatures_Feature::mutable_feature_id() { + + if (feature_id_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::FeatureId>(GetArenaNoVirtual()); + feature_id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.feature_id) + return feature_id_; +} +inline void ModelAndFeatures_Feature::set_allocated_feature_id(::diplomacy::tensorflow::decision_trees::FeatureId* feature_id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete feature_id_; + } + if (feature_id) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(feature_id); + if (message_arena != submessage_arena) { + feature_id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, feature_id, submessage_arena); + } + + } else { + + } + feature_id_ = feature_id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.feature_id) +} + +// repeated .google.protobuf.Any additional_data = 2; +inline int ModelAndFeatures_Feature::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* ModelAndFeatures_Feature::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +ModelAndFeatures_Feature::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& ModelAndFeatures_Feature::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* ModelAndFeatures_Feature::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +ModelAndFeatures_Feature::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.additional_data) + return additional_data_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ModelAndFeatures + +// map features = 1; +inline int ModelAndFeatures::features_size() const { + return features_.size(); +} +inline void ModelAndFeatures::clear_features() { + features_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >& +ModelAndFeatures::features() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.decision_trees.ModelAndFeatures.features) + return features_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::decision_trees::ModelAndFeatures_Feature >* +ModelAndFeatures::mutable_features() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.decision_trees.ModelAndFeatures.features) + return features_.MutableMap(); +} + +// .diplomacy.tensorflow.decision_trees.Model model = 2; +inline bool ModelAndFeatures::has_model() const { + return this != internal_default_instance() && model_ != NULL; +} +inline void ModelAndFeatures::clear_model() { + if (GetArenaNoVirtual() == NULL && model_ != NULL) { + delete model_; + } + model_ = NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::Model& ModelAndFeatures::_internal_model() const { + return *model_; +} +inline const ::diplomacy::tensorflow::decision_trees::Model& ModelAndFeatures::model() const { + const ::diplomacy::tensorflow::decision_trees::Model* p = model_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.ModelAndFeatures.model) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_Model_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Model* ModelAndFeatures::release_model() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.ModelAndFeatures.model) + + ::diplomacy::tensorflow::decision_trees::Model* temp = model_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + model_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Model* ModelAndFeatures::unsafe_arena_release_model() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.ModelAndFeatures.model) + + ::diplomacy::tensorflow::decision_trees::Model* temp = model_; + model_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Model* ModelAndFeatures::mutable_model() { + + if (model_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Model>(GetArenaNoVirtual()); + model_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.ModelAndFeatures.model) + return model_; +} +inline void ModelAndFeatures::set_allocated_model(::diplomacy::tensorflow::decision_trees::Model* model) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete model_; + } + if (model) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(model); + if (message_arena != submessage_arena) { + model = ::google::protobuf::internal::GetOwnedMessage( + message_arena, model, submessage_arena); + } + + } else { + + } + model_ = model; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.ModelAndFeatures.model) +} + +// repeated .google.protobuf.Any additional_data = 3; +inline int ModelAndFeatures::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* ModelAndFeatures::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.ModelAndFeatures.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +ModelAndFeatures::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.ModelAndFeatures.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& ModelAndFeatures::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.ModelAndFeatures.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* ModelAndFeatures::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.ModelAndFeatures.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +ModelAndFeatures::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.ModelAndFeatures.additional_data) + return additional_data_; +} + +// ------------------------------------------------------------------- + +// Ensemble_Member + +// .diplomacy.tensorflow.decision_trees.Model submodel = 1; +inline bool Ensemble_Member::has_submodel() const { + return this != internal_default_instance() && submodel_ != NULL; +} +inline void Ensemble_Member::clear_submodel() { + if (GetArenaNoVirtual() == NULL && submodel_ != NULL) { + delete submodel_; + } + submodel_ = NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::Model& Ensemble_Member::_internal_submodel() const { + return *submodel_; +} +inline const ::diplomacy::tensorflow::decision_trees::Model& Ensemble_Member::submodel() const { + const ::diplomacy::tensorflow::decision_trees::Model* p = submodel_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_Model_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Model* Ensemble_Member::release_submodel() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel) + + ::diplomacy::tensorflow::decision_trees::Model* temp = submodel_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + submodel_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Model* Ensemble_Member::unsafe_arena_release_submodel() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel) + + ::diplomacy::tensorflow::decision_trees::Model* temp = submodel_; + submodel_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Model* Ensemble_Member::mutable_submodel() { + + if (submodel_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Model>(GetArenaNoVirtual()); + submodel_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel) + return submodel_; +} +inline void Ensemble_Member::set_allocated_submodel(::diplomacy::tensorflow::decision_trees::Model* submodel) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete submodel_; + } + if (submodel) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(submodel); + if (message_arena != submessage_arena) { + submodel = ::google::protobuf::internal::GetOwnedMessage( + message_arena, submodel, submessage_arena); + } + + } else { + + } + submodel_ = submodel; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel) +} + +// .google.protobuf.Int32Value submodel_id = 2; +inline bool Ensemble_Member::has_submodel_id() const { + return this != internal_default_instance() && submodel_id_ != NULL; +} +inline const ::google::protobuf::Int32Value& Ensemble_Member::_internal_submodel_id() const { + return *submodel_id_; +} +inline const ::google::protobuf::Int32Value& Ensemble_Member::submodel_id() const { + const ::google::protobuf::Int32Value* p = submodel_id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel_id) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_Int32Value_default_instance_); +} +inline ::google::protobuf::Int32Value* Ensemble_Member::release_submodel_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel_id) + + ::google::protobuf::Int32Value* temp = submodel_id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + submodel_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* Ensemble_Member::unsafe_arena_release_submodel_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel_id) + + ::google::protobuf::Int32Value* temp = submodel_id_; + submodel_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* Ensemble_Member::mutable_submodel_id() { + + if (submodel_id_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::Int32Value>(GetArenaNoVirtual()); + submodel_id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel_id) + return submodel_id_; +} +inline void Ensemble_Member::set_allocated_submodel_id(::google::protobuf::Int32Value* submodel_id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(submodel_id_); + } + if (submodel_id) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(submodel_id)->GetArena(); + if (message_arena != submessage_arena) { + submodel_id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, submodel_id, submessage_arena); + } + + } else { + + } + submodel_id_ = submodel_id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel_id) +} + +// repeated .google.protobuf.Any additional_data = 3; +inline int Ensemble_Member::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* Ensemble_Member::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.Member.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +Ensemble_Member::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Ensemble.Member.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& Ensemble_Member::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.Member.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* Ensemble_Member::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Ensemble.Member.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +Ensemble_Member::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Ensemble.Member.additional_data) + return additional_data_; +} + +// ------------------------------------------------------------------- + +// Ensemble + +// repeated .diplomacy.tensorflow.decision_trees.Ensemble.Member members = 100; +inline int Ensemble::members_size() const { + return members_.size(); +} +inline void Ensemble::clear_members() { + members_.Clear(); +} +inline ::diplomacy::tensorflow::decision_trees::Ensemble_Member* Ensemble::mutable_members(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.members) + return members_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Ensemble_Member >* +Ensemble::mutable_members() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Ensemble.members) + return &members_; +} +inline const ::diplomacy::tensorflow::decision_trees::Ensemble_Member& Ensemble::members(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.members) + return members_.Get(index); +} +inline ::diplomacy::tensorflow::decision_trees::Ensemble_Member* Ensemble::add_members() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Ensemble.members) + return members_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Ensemble_Member >& +Ensemble::members() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Ensemble.members) + return members_; +} + +// .diplomacy.tensorflow.decision_trees.Summation summation_combination_technique = 1; +inline bool Ensemble::has_summation_combination_technique() const { + return combination_technique_case() == kSummationCombinationTechnique; +} +inline void Ensemble::set_has_summation_combination_technique() { + _oneof_case_[0] = kSummationCombinationTechnique; +} +inline void Ensemble::clear_summation_combination_technique() { + if (has_summation_combination_technique()) { + if (GetArenaNoVirtual() == NULL) { + delete combination_technique_.summation_combination_technique_; + } + clear_has_combination_technique(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::Summation& Ensemble::_internal_summation_combination_technique() const { + return *combination_technique_.summation_combination_technique_; +} +inline ::diplomacy::tensorflow::decision_trees::Summation* Ensemble::release_summation_combination_technique() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Ensemble.summation_combination_technique) + if (has_summation_combination_technique()) { + clear_has_combination_technique(); + ::diplomacy::tensorflow::decision_trees::Summation* temp = combination_technique_.summation_combination_technique_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + combination_technique_.summation_combination_technique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::Summation& Ensemble::summation_combination_technique() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.summation_combination_technique) + return has_summation_combination_technique() + ? *combination_technique_.summation_combination_technique_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::Summation*>(&::diplomacy::tensorflow::decision_trees::_Summation_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Summation* Ensemble::unsafe_arena_release_summation_combination_technique() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Ensemble.summation_combination_technique) + if (has_summation_combination_technique()) { + clear_has_combination_technique(); + ::diplomacy::tensorflow::decision_trees::Summation* temp = combination_technique_.summation_combination_technique_; + combination_technique_.summation_combination_technique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Ensemble::unsafe_arena_set_allocated_summation_combination_technique(::diplomacy::tensorflow::decision_trees::Summation* summation_combination_technique) { + clear_combination_technique(); + if (summation_combination_technique) { + set_has_summation_combination_technique(); + combination_technique_.summation_combination_technique_ = summation_combination_technique; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.summation_combination_technique) +} +inline ::diplomacy::tensorflow::decision_trees::Summation* Ensemble::mutable_summation_combination_technique() { + if (!has_summation_combination_technique()) { + clear_combination_technique(); + set_has_summation_combination_technique(); + combination_technique_.summation_combination_technique_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Summation >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.summation_combination_technique) + return combination_technique_.summation_combination_technique_; +} + +// .diplomacy.tensorflow.decision_trees.Averaging averaging_combination_technique = 2; +inline bool Ensemble::has_averaging_combination_technique() const { + return combination_technique_case() == kAveragingCombinationTechnique; +} +inline void Ensemble::set_has_averaging_combination_technique() { + _oneof_case_[0] = kAveragingCombinationTechnique; +} +inline void Ensemble::clear_averaging_combination_technique() { + if (has_averaging_combination_technique()) { + if (GetArenaNoVirtual() == NULL) { + delete combination_technique_.averaging_combination_technique_; + } + clear_has_combination_technique(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::Averaging& Ensemble::_internal_averaging_combination_technique() const { + return *combination_technique_.averaging_combination_technique_; +} +inline ::diplomacy::tensorflow::decision_trees::Averaging* Ensemble::release_averaging_combination_technique() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Ensemble.averaging_combination_technique) + if (has_averaging_combination_technique()) { + clear_has_combination_technique(); + ::diplomacy::tensorflow::decision_trees::Averaging* temp = combination_technique_.averaging_combination_technique_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + combination_technique_.averaging_combination_technique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::Averaging& Ensemble::averaging_combination_technique() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.averaging_combination_technique) + return has_averaging_combination_technique() + ? *combination_technique_.averaging_combination_technique_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::Averaging*>(&::diplomacy::tensorflow::decision_trees::_Averaging_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Averaging* Ensemble::unsafe_arena_release_averaging_combination_technique() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Ensemble.averaging_combination_technique) + if (has_averaging_combination_technique()) { + clear_has_combination_technique(); + ::diplomacy::tensorflow::decision_trees::Averaging* temp = combination_technique_.averaging_combination_technique_; + combination_technique_.averaging_combination_technique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Ensemble::unsafe_arena_set_allocated_averaging_combination_technique(::diplomacy::tensorflow::decision_trees::Averaging* averaging_combination_technique) { + clear_combination_technique(); + if (averaging_combination_technique) { + set_has_averaging_combination_technique(); + combination_technique_.averaging_combination_technique_ = averaging_combination_technique; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.averaging_combination_technique) +} +inline ::diplomacy::tensorflow::decision_trees::Averaging* Ensemble::mutable_averaging_combination_technique() { + if (!has_averaging_combination_technique()) { + clear_combination_technique(); + set_has_averaging_combination_technique(); + combination_technique_.averaging_combination_technique_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Averaging >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.averaging_combination_technique) + return combination_technique_.averaging_combination_technique_; +} + +// .google.protobuf.Any custom_combination_technique = 3; +inline bool Ensemble::has_custom_combination_technique() const { + return combination_technique_case() == kCustomCombinationTechnique; +} +inline void Ensemble::set_has_custom_combination_technique() { + _oneof_case_[0] = kCustomCombinationTechnique; +} +inline const ::google::protobuf::Any& Ensemble::_internal_custom_combination_technique() const { + return *combination_technique_.custom_combination_technique_; +} +inline ::google::protobuf::Any* Ensemble::release_custom_combination_technique() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Ensemble.custom_combination_technique) + if (has_custom_combination_technique()) { + clear_has_combination_technique(); + ::google::protobuf::Any* temp = combination_technique_.custom_combination_technique_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + combination_technique_.custom_combination_technique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::google::protobuf::Any& Ensemble::custom_combination_technique() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.custom_combination_technique) + return has_custom_combination_technique() + ? *combination_technique_.custom_combination_technique_ + : *reinterpret_cast< ::google::protobuf::Any*>(&::google::protobuf::_Any_default_instance_); +} +inline ::google::protobuf::Any* Ensemble::unsafe_arena_release_custom_combination_technique() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Ensemble.custom_combination_technique) + if (has_custom_combination_technique()) { + clear_has_combination_technique(); + ::google::protobuf::Any* temp = combination_technique_.custom_combination_technique_; + combination_technique_.custom_combination_technique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Ensemble::unsafe_arena_set_allocated_custom_combination_technique(::google::protobuf::Any* custom_combination_technique) { + clear_combination_technique(); + if (custom_combination_technique) { + set_has_custom_combination_technique(); + combination_technique_.custom_combination_technique_ = custom_combination_technique; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Ensemble.custom_combination_technique) +} +inline ::google::protobuf::Any* Ensemble::mutable_custom_combination_technique() { + if (!has_custom_combination_technique()) { + clear_combination_technique(); + set_has_custom_combination_technique(); + combination_technique_.custom_combination_technique_ = CreateMaybeMessage< ::google::protobuf::Any >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.custom_combination_technique) + return combination_technique_.custom_combination_technique_; +} + +// repeated .google.protobuf.Any additional_data = 4; +inline int Ensemble::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* Ensemble::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Ensemble.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +Ensemble::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Ensemble.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& Ensemble::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Ensemble.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* Ensemble::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Ensemble.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +Ensemble::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Ensemble.additional_data) + return additional_data_; +} + +inline bool Ensemble::has_combination_technique() const { + return combination_technique_case() != COMBINATION_TECHNIQUE_NOT_SET; +} +inline void Ensemble::clear_has_combination_technique() { + _oneof_case_[0] = COMBINATION_TECHNIQUE_NOT_SET; +} +inline Ensemble::CombinationTechniqueCase Ensemble::combination_technique_case() const { + return Ensemble::CombinationTechniqueCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Summation + +// repeated .google.protobuf.Any additional_data = 1; +inline int Summation::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* Summation::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Summation.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +Summation::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Summation.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& Summation::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Summation.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* Summation::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Summation.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +Summation::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Summation.additional_data) + return additional_data_; +} + +// ------------------------------------------------------------------- + +// Averaging + +// repeated .google.protobuf.Any additional_data = 1; +inline int Averaging::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* Averaging::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Averaging.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +Averaging::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Averaging.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& Averaging::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Averaging.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* Averaging::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Averaging.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +Averaging::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Averaging.additional_data) + return additional_data_; +} + +// ------------------------------------------------------------------- + +// DecisionTree + +// repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes = 1; +inline int DecisionTree::nodes_size() const { + return nodes_.size(); +} +inline void DecisionTree::clear_nodes() { + nodes_.Clear(); +} +inline ::diplomacy::tensorflow::decision_trees::TreeNode* DecisionTree::mutable_nodes(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.DecisionTree.nodes) + return nodes_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >* +DecisionTree::mutable_nodes() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.DecisionTree.nodes) + return &nodes_; +} +inline const ::diplomacy::tensorflow::decision_trees::TreeNode& DecisionTree::nodes(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.DecisionTree.nodes) + return nodes_.Get(index); +} +inline ::diplomacy::tensorflow::decision_trees::TreeNode* DecisionTree::add_nodes() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.DecisionTree.nodes) + return nodes_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >& +DecisionTree::nodes() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.DecisionTree.nodes) + return nodes_; +} + +// repeated .google.protobuf.Any additional_data = 2; +inline int DecisionTree::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* DecisionTree::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.DecisionTree.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +DecisionTree::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.DecisionTree.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& DecisionTree::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.DecisionTree.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* DecisionTree::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.DecisionTree.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +DecisionTree::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.DecisionTree.additional_data) + return additional_data_; +} + +// ------------------------------------------------------------------- + +// TreeNode + +// .google.protobuf.Int32Value node_id = 1; +inline bool TreeNode::has_node_id() const { + return this != internal_default_instance() && node_id_ != NULL; +} +inline const ::google::protobuf::Int32Value& TreeNode::_internal_node_id() const { + return *node_id_; +} +inline const ::google::protobuf::Int32Value& TreeNode::node_id() const { + const ::google::protobuf::Int32Value* p = node_id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.TreeNode.node_id) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_Int32Value_default_instance_); +} +inline ::google::protobuf::Int32Value* TreeNode::release_node_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.TreeNode.node_id) + + ::google::protobuf::Int32Value* temp = node_id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* TreeNode::unsafe_arena_release_node_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.TreeNode.node_id) + + ::google::protobuf::Int32Value* temp = node_id_; + node_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* TreeNode::mutable_node_id() { + + if (node_id_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::Int32Value>(GetArenaNoVirtual()); + node_id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.TreeNode.node_id) + return node_id_; +} +inline void TreeNode::set_allocated_node_id(::google::protobuf::Int32Value* node_id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(node_id_); + } + if (node_id) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(node_id)->GetArena(); + if (message_arena != submessage_arena) { + node_id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, node_id, submessage_arena); + } + + } else { + + } + node_id_ = node_id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.node_id) +} + +// .google.protobuf.Int32Value depth = 2; +inline bool TreeNode::has_depth() const { + return this != internal_default_instance() && depth_ != NULL; +} +inline const ::google::protobuf::Int32Value& TreeNode::_internal_depth() const { + return *depth_; +} +inline const ::google::protobuf::Int32Value& TreeNode::depth() const { + const ::google::protobuf::Int32Value* p = depth_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.TreeNode.depth) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_Int32Value_default_instance_); +} +inline ::google::protobuf::Int32Value* TreeNode::release_depth() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.TreeNode.depth) + + ::google::protobuf::Int32Value* temp = depth_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + depth_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* TreeNode::unsafe_arena_release_depth() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.TreeNode.depth) + + ::google::protobuf::Int32Value* temp = depth_; + depth_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* TreeNode::mutable_depth() { + + if (depth_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::Int32Value>(GetArenaNoVirtual()); + depth_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.TreeNode.depth) + return depth_; +} +inline void TreeNode::set_allocated_depth(::google::protobuf::Int32Value* depth) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(depth_); + } + if (depth) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(depth)->GetArena(); + if (message_arena != submessage_arena) { + depth = ::google::protobuf::internal::GetOwnedMessage( + message_arena, depth, submessage_arena); + } + + } else { + + } + depth_ = depth; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.depth) +} + +// .google.protobuf.Int32Value subtree_size = 3; +inline bool TreeNode::has_subtree_size() const { + return this != internal_default_instance() && subtree_size_ != NULL; +} +inline const ::google::protobuf::Int32Value& TreeNode::_internal_subtree_size() const { + return *subtree_size_; +} +inline const ::google::protobuf::Int32Value& TreeNode::subtree_size() const { + const ::google::protobuf::Int32Value* p = subtree_size_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.TreeNode.subtree_size) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_Int32Value_default_instance_); +} +inline ::google::protobuf::Int32Value* TreeNode::release_subtree_size() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.TreeNode.subtree_size) + + ::google::protobuf::Int32Value* temp = subtree_size_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + subtree_size_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* TreeNode::unsafe_arena_release_subtree_size() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.TreeNode.subtree_size) + + ::google::protobuf::Int32Value* temp = subtree_size_; + subtree_size_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* TreeNode::mutable_subtree_size() { + + if (subtree_size_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::Int32Value>(GetArenaNoVirtual()); + subtree_size_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.TreeNode.subtree_size) + return subtree_size_; +} +inline void TreeNode::set_allocated_subtree_size(::google::protobuf::Int32Value* subtree_size) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(subtree_size_); + } + if (subtree_size) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(subtree_size)->GetArena(); + if (message_arena != submessage_arena) { + subtree_size = ::google::protobuf::internal::GetOwnedMessage( + message_arena, subtree_size, submessage_arena); + } + + } else { + + } + subtree_size_ = subtree_size; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.subtree_size) +} + +// .diplomacy.tensorflow.decision_trees.BinaryNode binary_node = 4; +inline bool TreeNode::has_binary_node() const { + return node_type_case() == kBinaryNode; +} +inline void TreeNode::set_has_binary_node() { + _oneof_case_[0] = kBinaryNode; +} +inline void TreeNode::clear_binary_node() { + if (has_binary_node()) { + if (GetArenaNoVirtual() == NULL) { + delete node_type_.binary_node_; + } + clear_has_node_type(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::BinaryNode& TreeNode::_internal_binary_node() const { + return *node_type_.binary_node_; +} +inline ::diplomacy::tensorflow::decision_trees::BinaryNode* TreeNode::release_binary_node() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.TreeNode.binary_node) + if (has_binary_node()) { + clear_has_node_type(); + ::diplomacy::tensorflow::decision_trees::BinaryNode* temp = node_type_.binary_node_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_type_.binary_node_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::BinaryNode& TreeNode::binary_node() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.TreeNode.binary_node) + return has_binary_node() + ? *node_type_.binary_node_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::BinaryNode*>(&::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::BinaryNode* TreeNode::unsafe_arena_release_binary_node() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.TreeNode.binary_node) + if (has_binary_node()) { + clear_has_node_type(); + ::diplomacy::tensorflow::decision_trees::BinaryNode* temp = node_type_.binary_node_; + node_type_.binary_node_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_binary_node(::diplomacy::tensorflow::decision_trees::BinaryNode* binary_node) { + clear_node_type(); + if (binary_node) { + set_has_binary_node(); + node_type_.binary_node_ = binary_node; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.binary_node) +} +inline ::diplomacy::tensorflow::decision_trees::BinaryNode* TreeNode::mutable_binary_node() { + if (!has_binary_node()) { + clear_node_type(); + set_has_binary_node(); + node_type_.binary_node_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::BinaryNode >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.TreeNode.binary_node) + return node_type_.binary_node_; +} + +// .diplomacy.tensorflow.decision_trees.Leaf leaf = 5; +inline bool TreeNode::has_leaf() const { + return node_type_case() == kLeaf; +} +inline void TreeNode::set_has_leaf() { + _oneof_case_[0] = kLeaf; +} +inline void TreeNode::clear_leaf() { + if (has_leaf()) { + if (GetArenaNoVirtual() == NULL) { + delete node_type_.leaf_; + } + clear_has_node_type(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::Leaf& TreeNode::_internal_leaf() const { + return *node_type_.leaf_; +} +inline ::diplomacy::tensorflow::decision_trees::Leaf* TreeNode::release_leaf() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.TreeNode.leaf) + if (has_leaf()) { + clear_has_node_type(); + ::diplomacy::tensorflow::decision_trees::Leaf* temp = node_type_.leaf_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_type_.leaf_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::Leaf& TreeNode::leaf() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.TreeNode.leaf) + return has_leaf() + ? *node_type_.leaf_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::Leaf*>(&::diplomacy::tensorflow::decision_trees::_Leaf_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Leaf* TreeNode::unsafe_arena_release_leaf() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.TreeNode.leaf) + if (has_leaf()) { + clear_has_node_type(); + ::diplomacy::tensorflow::decision_trees::Leaf* temp = node_type_.leaf_; + node_type_.leaf_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_leaf(::diplomacy::tensorflow::decision_trees::Leaf* leaf) { + clear_node_type(); + if (leaf) { + set_has_leaf(); + node_type_.leaf_ = leaf; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.leaf) +} +inline ::diplomacy::tensorflow::decision_trees::Leaf* TreeNode::mutable_leaf() { + if (!has_leaf()) { + clear_node_type(); + set_has_leaf(); + node_type_.leaf_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Leaf >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.TreeNode.leaf) + return node_type_.leaf_; +} + +// .google.protobuf.Any custom_node_type = 6; +inline bool TreeNode::has_custom_node_type() const { + return node_type_case() == kCustomNodeType; +} +inline void TreeNode::set_has_custom_node_type() { + _oneof_case_[0] = kCustomNodeType; +} +inline const ::google::protobuf::Any& TreeNode::_internal_custom_node_type() const { + return *node_type_.custom_node_type_; +} +inline ::google::protobuf::Any* TreeNode::release_custom_node_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.TreeNode.custom_node_type) + if (has_custom_node_type()) { + clear_has_node_type(); + ::google::protobuf::Any* temp = node_type_.custom_node_type_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_type_.custom_node_type_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::google::protobuf::Any& TreeNode::custom_node_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.TreeNode.custom_node_type) + return has_custom_node_type() + ? *node_type_.custom_node_type_ + : *reinterpret_cast< ::google::protobuf::Any*>(&::google::protobuf::_Any_default_instance_); +} +inline ::google::protobuf::Any* TreeNode::unsafe_arena_release_custom_node_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.TreeNode.custom_node_type) + if (has_custom_node_type()) { + clear_has_node_type(); + ::google::protobuf::Any* temp = node_type_.custom_node_type_; + node_type_.custom_node_type_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void TreeNode::unsafe_arena_set_allocated_custom_node_type(::google::protobuf::Any* custom_node_type) { + clear_node_type(); + if (custom_node_type) { + set_has_custom_node_type(); + node_type_.custom_node_type_ = custom_node_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.TreeNode.custom_node_type) +} +inline ::google::protobuf::Any* TreeNode::mutable_custom_node_type() { + if (!has_custom_node_type()) { + clear_node_type(); + set_has_custom_node_type(); + node_type_.custom_node_type_ = CreateMaybeMessage< ::google::protobuf::Any >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.TreeNode.custom_node_type) + return node_type_.custom_node_type_; +} + +// repeated .google.protobuf.Any additional_data = 7; +inline int TreeNode::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* TreeNode::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.TreeNode.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +TreeNode::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.TreeNode.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& TreeNode::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.TreeNode.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* TreeNode::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.TreeNode.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +TreeNode::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.TreeNode.additional_data) + return additional_data_; +} + +inline bool TreeNode::has_node_type() const { + return node_type_case() != NODE_TYPE_NOT_SET; +} +inline void TreeNode::clear_has_node_type() { + _oneof_case_[0] = NODE_TYPE_NOT_SET; +} +inline TreeNode::NodeTypeCase TreeNode::node_type_case() const { + return TreeNode::NodeTypeCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// BinaryNode + +// .google.protobuf.Int32Value left_child_id = 1; +inline bool BinaryNode::has_left_child_id() const { + return this != internal_default_instance() && left_child_id_ != NULL; +} +inline const ::google::protobuf::Int32Value& BinaryNode::_internal_left_child_id() const { + return *left_child_id_; +} +inline const ::google::protobuf::Int32Value& BinaryNode::left_child_id() const { + const ::google::protobuf::Int32Value* p = left_child_id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.BinaryNode.left_child_id) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_Int32Value_default_instance_); +} +inline ::google::protobuf::Int32Value* BinaryNode::release_left_child_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.BinaryNode.left_child_id) + + ::google::protobuf::Int32Value* temp = left_child_id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + left_child_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* BinaryNode::unsafe_arena_release_left_child_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.BinaryNode.left_child_id) + + ::google::protobuf::Int32Value* temp = left_child_id_; + left_child_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* BinaryNode::mutable_left_child_id() { + + if (left_child_id_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::Int32Value>(GetArenaNoVirtual()); + left_child_id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.BinaryNode.left_child_id) + return left_child_id_; +} +inline void BinaryNode::set_allocated_left_child_id(::google::protobuf::Int32Value* left_child_id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(left_child_id_); + } + if (left_child_id) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(left_child_id)->GetArena(); + if (message_arena != submessage_arena) { + left_child_id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, left_child_id, submessage_arena); + } + + } else { + + } + left_child_id_ = left_child_id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.left_child_id) +} + +// .google.protobuf.Int32Value right_child_id = 2; +inline bool BinaryNode::has_right_child_id() const { + return this != internal_default_instance() && right_child_id_ != NULL; +} +inline const ::google::protobuf::Int32Value& BinaryNode::_internal_right_child_id() const { + return *right_child_id_; +} +inline const ::google::protobuf::Int32Value& BinaryNode::right_child_id() const { + const ::google::protobuf::Int32Value* p = right_child_id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.BinaryNode.right_child_id) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_Int32Value_default_instance_); +} +inline ::google::protobuf::Int32Value* BinaryNode::release_right_child_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.BinaryNode.right_child_id) + + ::google::protobuf::Int32Value* temp = right_child_id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + right_child_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* BinaryNode::unsafe_arena_release_right_child_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.BinaryNode.right_child_id) + + ::google::protobuf::Int32Value* temp = right_child_id_; + right_child_id_ = NULL; + return temp; +} +inline ::google::protobuf::Int32Value* BinaryNode::mutable_right_child_id() { + + if (right_child_id_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::Int32Value>(GetArenaNoVirtual()); + right_child_id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.BinaryNode.right_child_id) + return right_child_id_; +} +inline void BinaryNode::set_allocated_right_child_id(::google::protobuf::Int32Value* right_child_id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(right_child_id_); + } + if (right_child_id) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(right_child_id)->GetArena(); + if (message_arena != submessage_arena) { + right_child_id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, right_child_id, submessage_arena); + } + + } else { + + } + right_child_id_ = right_child_id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.right_child_id) +} + +// .diplomacy.tensorflow.decision_trees.BinaryNode.Direction default_direction = 3; +inline void BinaryNode::clear_default_direction() { + default_direction_ = 0; +} +inline ::diplomacy::tensorflow::decision_trees::BinaryNode_Direction BinaryNode::default_direction() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.BinaryNode.default_direction) + return static_cast< ::diplomacy::tensorflow::decision_trees::BinaryNode_Direction >(default_direction_); +} +inline void BinaryNode::set_default_direction(::diplomacy::tensorflow::decision_trees::BinaryNode_Direction value) { + + default_direction_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.BinaryNode.default_direction) +} + +// .diplomacy.tensorflow.decision_trees.InequalityTest inequality_left_child_test = 4; +inline bool BinaryNode::has_inequality_left_child_test() const { + return left_child_test_case() == kInequalityLeftChildTest; +} +inline void BinaryNode::set_has_inequality_left_child_test() { + _oneof_case_[0] = kInequalityLeftChildTest; +} +inline void BinaryNode::clear_inequality_left_child_test() { + if (has_inequality_left_child_test()) { + if (GetArenaNoVirtual() == NULL) { + delete left_child_test_.inequality_left_child_test_; + } + clear_has_left_child_test(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::InequalityTest& BinaryNode::_internal_inequality_left_child_test() const { + return *left_child_test_.inequality_left_child_test_; +} +inline ::diplomacy::tensorflow::decision_trees::InequalityTest* BinaryNode::release_inequality_left_child_test() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.BinaryNode.inequality_left_child_test) + if (has_inequality_left_child_test()) { + clear_has_left_child_test(); + ::diplomacy::tensorflow::decision_trees::InequalityTest* temp = left_child_test_.inequality_left_child_test_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + left_child_test_.inequality_left_child_test_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::InequalityTest& BinaryNode::inequality_left_child_test() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.BinaryNode.inequality_left_child_test) + return has_inequality_left_child_test() + ? *left_child_test_.inequality_left_child_test_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::InequalityTest*>(&::diplomacy::tensorflow::decision_trees::_InequalityTest_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::InequalityTest* BinaryNode::unsafe_arena_release_inequality_left_child_test() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.BinaryNode.inequality_left_child_test) + if (has_inequality_left_child_test()) { + clear_has_left_child_test(); + ::diplomacy::tensorflow::decision_trees::InequalityTest* temp = left_child_test_.inequality_left_child_test_; + left_child_test_.inequality_left_child_test_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void BinaryNode::unsafe_arena_set_allocated_inequality_left_child_test(::diplomacy::tensorflow::decision_trees::InequalityTest* inequality_left_child_test) { + clear_left_child_test(); + if (inequality_left_child_test) { + set_has_inequality_left_child_test(); + left_child_test_.inequality_left_child_test_ = inequality_left_child_test; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.inequality_left_child_test) +} +inline ::diplomacy::tensorflow::decision_trees::InequalityTest* BinaryNode::mutable_inequality_left_child_test() { + if (!has_inequality_left_child_test()) { + clear_left_child_test(); + set_has_inequality_left_child_test(); + left_child_test_.inequality_left_child_test_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::InequalityTest >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.BinaryNode.inequality_left_child_test) + return left_child_test_.inequality_left_child_test_; +} + +// .google.protobuf.Any custom_left_child_test = 5; +inline bool BinaryNode::has_custom_left_child_test() const { + return left_child_test_case() == kCustomLeftChildTest; +} +inline void BinaryNode::set_has_custom_left_child_test() { + _oneof_case_[0] = kCustomLeftChildTest; +} +inline const ::google::protobuf::Any& BinaryNode::_internal_custom_left_child_test() const { + return *left_child_test_.custom_left_child_test_; +} +inline ::google::protobuf::Any* BinaryNode::release_custom_left_child_test() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.BinaryNode.custom_left_child_test) + if (has_custom_left_child_test()) { + clear_has_left_child_test(); + ::google::protobuf::Any* temp = left_child_test_.custom_left_child_test_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + left_child_test_.custom_left_child_test_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::google::protobuf::Any& BinaryNode::custom_left_child_test() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.BinaryNode.custom_left_child_test) + return has_custom_left_child_test() + ? *left_child_test_.custom_left_child_test_ + : *reinterpret_cast< ::google::protobuf::Any*>(&::google::protobuf::_Any_default_instance_); +} +inline ::google::protobuf::Any* BinaryNode::unsafe_arena_release_custom_left_child_test() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.BinaryNode.custom_left_child_test) + if (has_custom_left_child_test()) { + clear_has_left_child_test(); + ::google::protobuf::Any* temp = left_child_test_.custom_left_child_test_; + left_child_test_.custom_left_child_test_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void BinaryNode::unsafe_arena_set_allocated_custom_left_child_test(::google::protobuf::Any* custom_left_child_test) { + clear_left_child_test(); + if (custom_left_child_test) { + set_has_custom_left_child_test(); + left_child_test_.custom_left_child_test_ = custom_left_child_test; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.BinaryNode.custom_left_child_test) +} +inline ::google::protobuf::Any* BinaryNode::mutable_custom_left_child_test() { + if (!has_custom_left_child_test()) { + clear_left_child_test(); + set_has_custom_left_child_test(); + left_child_test_.custom_left_child_test_ = CreateMaybeMessage< ::google::protobuf::Any >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.BinaryNode.custom_left_child_test) + return left_child_test_.custom_left_child_test_; +} + +inline bool BinaryNode::has_left_child_test() const { + return left_child_test_case() != LEFT_CHILD_TEST_NOT_SET; +} +inline void BinaryNode::clear_has_left_child_test() { + _oneof_case_[0] = LEFT_CHILD_TEST_NOT_SET; +} +inline BinaryNode::LeftChildTestCase BinaryNode::left_child_test_case() const { + return BinaryNode::LeftChildTestCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// SparseVector + +// map sparse_value = 1; +inline int SparseVector::sparse_value_size() const { + return sparse_value_.size(); +} +inline void SparseVector::clear_sparse_value() { + sparse_value_.Clear(); +} +inline const ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >& +SparseVector::sparse_value() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.decision_trees.SparseVector.sparse_value) + return sparse_value_.GetMap(); +} +inline ::google::protobuf::Map< ::google::protobuf::int64, ::diplomacy::tensorflow::decision_trees::Value >* +SparseVector::mutable_sparse_value() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.decision_trees.SparseVector.sparse_value) + return sparse_value_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// Vector + +// repeated .diplomacy.tensorflow.decision_trees.Value value = 1; +inline int Vector::value_size() const { + return value_.size(); +} +inline void Vector::clear_value() { + value_.Clear(); +} +inline ::diplomacy::tensorflow::decision_trees::Value* Vector::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Vector.value) + return value_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >* +Vector::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Vector.value) + return &value_; +} +inline const ::diplomacy::tensorflow::decision_trees::Value& Vector::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Vector.value) + return value_.Get(index); +} +inline ::diplomacy::tensorflow::decision_trees::Value* Vector::add_value() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Vector.value) + return value_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >& +Vector::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Vector.value) + return value_; +} + +// ------------------------------------------------------------------- + +// Leaf + +// .diplomacy.tensorflow.decision_trees.Vector vector = 1; +inline bool Leaf::has_vector() const { + return leaf_case() == kVector; +} +inline void Leaf::set_has_vector() { + _oneof_case_[0] = kVector; +} +inline void Leaf::clear_vector() { + if (has_vector()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.vector_; + } + clear_has_leaf(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& Leaf::_internal_vector() const { + return *leaf_.vector_; +} +inline ::diplomacy::tensorflow::decision_trees::Vector* Leaf::release_vector() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Leaf.vector) + if (has_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::decision_trees::Vector* temp = leaf_.vector_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_.vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& Leaf::vector() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Leaf.vector) + return has_vector() + ? *leaf_.vector_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::Vector*>(&::diplomacy::tensorflow::decision_trees::_Vector_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Vector* Leaf::unsafe_arena_release_vector() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Leaf.vector) + if (has_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::decision_trees::Vector* temp = leaf_.vector_; + leaf_.vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Leaf::unsafe_arena_set_allocated_vector(::diplomacy::tensorflow::decision_trees::Vector* vector) { + clear_leaf(); + if (vector) { + set_has_vector(); + leaf_.vector_ = vector; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Leaf.vector) +} +inline ::diplomacy::tensorflow::decision_trees::Vector* Leaf::mutable_vector() { + if (!has_vector()) { + clear_leaf(); + set_has_vector(); + leaf_.vector_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Vector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Leaf.vector) + return leaf_.vector_; +} + +// .diplomacy.tensorflow.decision_trees.SparseVector sparse_vector = 2; +inline bool Leaf::has_sparse_vector() const { + return leaf_case() == kSparseVector; +} +inline void Leaf::set_has_sparse_vector() { + _oneof_case_[0] = kSparseVector; +} +inline void Leaf::clear_sparse_vector() { + if (has_sparse_vector()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.sparse_vector_; + } + clear_has_leaf(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::SparseVector& Leaf::_internal_sparse_vector() const { + return *leaf_.sparse_vector_; +} +inline ::diplomacy::tensorflow::decision_trees::SparseVector* Leaf::release_sparse_vector() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Leaf.sparse_vector) + if (has_sparse_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::decision_trees::SparseVector* temp = leaf_.sparse_vector_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_.sparse_vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::SparseVector& Leaf::sparse_vector() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Leaf.sparse_vector) + return has_sparse_vector() + ? *leaf_.sparse_vector_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::SparseVector*>(&::diplomacy::tensorflow::decision_trees::_SparseVector_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::SparseVector* Leaf::unsafe_arena_release_sparse_vector() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Leaf.sparse_vector) + if (has_sparse_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::decision_trees::SparseVector* temp = leaf_.sparse_vector_; + leaf_.sparse_vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Leaf::unsafe_arena_set_allocated_sparse_vector(::diplomacy::tensorflow::decision_trees::SparseVector* sparse_vector) { + clear_leaf(); + if (sparse_vector) { + set_has_sparse_vector(); + leaf_.sparse_vector_ = sparse_vector; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Leaf.sparse_vector) +} +inline ::diplomacy::tensorflow::decision_trees::SparseVector* Leaf::mutable_sparse_vector() { + if (!has_sparse_vector()) { + clear_leaf(); + set_has_sparse_vector(); + leaf_.sparse_vector_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::SparseVector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Leaf.sparse_vector) + return leaf_.sparse_vector_; +} + +// repeated .google.protobuf.Any additional_data = 3; +inline int Leaf::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* Leaf::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Leaf.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +Leaf::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.Leaf.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& Leaf::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Leaf.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* Leaf::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.Leaf.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +Leaf::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.Leaf.additional_data) + return additional_data_; +} + +inline bool Leaf::has_leaf() const { + return leaf_case() != LEAF_NOT_SET; +} +inline void Leaf::clear_has_leaf() { + _oneof_case_[0] = LEAF_NOT_SET; +} +inline Leaf::LeafCase Leaf::leaf_case() const { + return Leaf::LeafCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// FeatureId + +// .google.protobuf.StringValue id = 1; +inline bool FeatureId::has_id() const { + return this != internal_default_instance() && id_ != NULL; +} +inline const ::google::protobuf::StringValue& FeatureId::_internal_id() const { + return *id_; +} +inline const ::google::protobuf::StringValue& FeatureId::id() const { + const ::google::protobuf::StringValue* p = id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.FeatureId.id) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_StringValue_default_instance_); +} +inline ::google::protobuf::StringValue* FeatureId::release_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.FeatureId.id) + + ::google::protobuf::StringValue* temp = id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + id_ = NULL; + return temp; +} +inline ::google::protobuf::StringValue* FeatureId::unsafe_arena_release_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.FeatureId.id) + + ::google::protobuf::StringValue* temp = id_; + id_ = NULL; + return temp; +} +inline ::google::protobuf::StringValue* FeatureId::mutable_id() { + + if (id_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::StringValue>(GetArenaNoVirtual()); + id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.FeatureId.id) + return id_; +} +inline void FeatureId::set_allocated_id(::google::protobuf::StringValue* id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(id_); + } + if (id) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(id)->GetArena(); + if (message_arena != submessage_arena) { + id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, id, submessage_arena); + } + + } else { + + } + id_ = id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.FeatureId.id) +} + +// repeated .google.protobuf.Any additional_data = 2; +inline int FeatureId::additional_data_size() const { + return additional_data_.size(); +} +inline ::google::protobuf::Any* FeatureId::mutable_additional_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.FeatureId.additional_data) + return additional_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >* +FeatureId::mutable_additional_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.FeatureId.additional_data) + return &additional_data_; +} +inline const ::google::protobuf::Any& FeatureId::additional_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.FeatureId.additional_data) + return additional_data_.Get(index); +} +inline ::google::protobuf::Any* FeatureId::add_additional_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.FeatureId.additional_data) + return additional_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Any >& +FeatureId::additional_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.FeatureId.additional_data) + return additional_data_; +} + +// ------------------------------------------------------------------- + +// ObliqueFeatures + +// repeated .diplomacy.tensorflow.decision_trees.FeatureId features = 1; +inline int ObliqueFeatures::features_size() const { + return features_.size(); +} +inline void ObliqueFeatures::clear_features() { + features_.Clear(); +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* ObliqueFeatures::mutable_features(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.ObliqueFeatures.features) + return features_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::FeatureId >* +ObliqueFeatures::mutable_features() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.ObliqueFeatures.features) + return &features_; +} +inline const ::diplomacy::tensorflow::decision_trees::FeatureId& ObliqueFeatures::features(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.ObliqueFeatures.features) + return features_.Get(index); +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* ObliqueFeatures::add_features() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.ObliqueFeatures.features) + return features_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::FeatureId >& +ObliqueFeatures::features() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.ObliqueFeatures.features) + return features_; +} + +// repeated float weights = 2; +inline int ObliqueFeatures::weights_size() const { + return weights_.size(); +} +inline void ObliqueFeatures::clear_weights() { + weights_.Clear(); +} +inline float ObliqueFeatures::weights(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.ObliqueFeatures.weights) + return weights_.Get(index); +} +inline void ObliqueFeatures::set_weights(int index, float value) { + weights_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.ObliqueFeatures.weights) +} +inline void ObliqueFeatures::add_weights(float value) { + weights_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.ObliqueFeatures.weights) +} +inline const ::google::protobuf::RepeatedField< float >& +ObliqueFeatures::weights() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.ObliqueFeatures.weights) + return weights_; +} +inline ::google::protobuf::RepeatedField< float >* +ObliqueFeatures::mutable_weights() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.ObliqueFeatures.weights) + return &weights_; +} + +// ------------------------------------------------------------------- + +// InequalityTest + +// .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; +inline bool InequalityTest::has_feature_id() const { + return FeatureSum_case() == kFeatureId; +} +inline void InequalityTest::set_has_feature_id() { + _oneof_case_[0] = kFeatureId; +} +inline void InequalityTest::clear_feature_id() { + if (has_feature_id()) { + if (GetArenaNoVirtual() == NULL) { + delete FeatureSum_.feature_id_; + } + clear_has_FeatureSum(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::FeatureId& InequalityTest::_internal_feature_id() const { + return *FeatureSum_.feature_id_; +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* InequalityTest::release_feature_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.InequalityTest.feature_id) + if (has_feature_id()) { + clear_has_FeatureSum(); + ::diplomacy::tensorflow::decision_trees::FeatureId* temp = FeatureSum_.feature_id_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + FeatureSum_.feature_id_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::FeatureId& InequalityTest::feature_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.InequalityTest.feature_id) + return has_feature_id() + ? *FeatureSum_.feature_id_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::FeatureId*>(&::diplomacy::tensorflow::decision_trees::_FeatureId_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* InequalityTest::unsafe_arena_release_feature_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.InequalityTest.feature_id) + if (has_feature_id()) { + clear_has_FeatureSum(); + ::diplomacy::tensorflow::decision_trees::FeatureId* temp = FeatureSum_.feature_id_; + FeatureSum_.feature_id_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void InequalityTest::unsafe_arena_set_allocated_feature_id(::diplomacy::tensorflow::decision_trees::FeatureId* feature_id) { + clear_FeatureSum(); + if (feature_id) { + set_has_feature_id(); + FeatureSum_.feature_id_ = feature_id; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.InequalityTest.feature_id) +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* InequalityTest::mutable_feature_id() { + if (!has_feature_id()) { + clear_FeatureSum(); + set_has_feature_id(); + FeatureSum_.feature_id_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::FeatureId >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.InequalityTest.feature_id) + return FeatureSum_.feature_id_; +} + +// .diplomacy.tensorflow.decision_trees.ObliqueFeatures oblique = 4; +inline bool InequalityTest::has_oblique() const { + return FeatureSum_case() == kOblique; +} +inline void InequalityTest::set_has_oblique() { + _oneof_case_[0] = kOblique; +} +inline void InequalityTest::clear_oblique() { + if (has_oblique()) { + if (GetArenaNoVirtual() == NULL) { + delete FeatureSum_.oblique_; + } + clear_has_FeatureSum(); + } +} +inline const ::diplomacy::tensorflow::decision_trees::ObliqueFeatures& InequalityTest::_internal_oblique() const { + return *FeatureSum_.oblique_; +} +inline ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* InequalityTest::release_oblique() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.InequalityTest.oblique) + if (has_oblique()) { + clear_has_FeatureSum(); + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* temp = FeatureSum_.oblique_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + FeatureSum_.oblique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::ObliqueFeatures& InequalityTest::oblique() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.InequalityTest.oblique) + return has_oblique() + ? *FeatureSum_.oblique_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::ObliqueFeatures*>(&::diplomacy::tensorflow::decision_trees::_ObliqueFeatures_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* InequalityTest::unsafe_arena_release_oblique() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.InequalityTest.oblique) + if (has_oblique()) { + clear_has_FeatureSum(); + ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* temp = FeatureSum_.oblique_; + FeatureSum_.oblique_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void InequalityTest::unsafe_arena_set_allocated_oblique(::diplomacy::tensorflow::decision_trees::ObliqueFeatures* oblique) { + clear_FeatureSum(); + if (oblique) { + set_has_oblique(); + FeatureSum_.oblique_ = oblique; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.InequalityTest.oblique) +} +inline ::diplomacy::tensorflow::decision_trees::ObliqueFeatures* InequalityTest::mutable_oblique() { + if (!has_oblique()) { + clear_FeatureSum(); + set_has_oblique(); + FeatureSum_.oblique_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::ObliqueFeatures >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.InequalityTest.oblique) + return FeatureSum_.oblique_; +} + +// .diplomacy.tensorflow.decision_trees.InequalityTest.Type type = 2; +inline void InequalityTest::clear_type() { + type_ = 0; +} +inline ::diplomacy::tensorflow::decision_trees::InequalityTest_Type InequalityTest::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.InequalityTest.type) + return static_cast< ::diplomacy::tensorflow::decision_trees::InequalityTest_Type >(type_); +} +inline void InequalityTest::set_type(::diplomacy::tensorflow::decision_trees::InequalityTest_Type value) { + + type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.InequalityTest.type) +} + +// .diplomacy.tensorflow.decision_trees.Value threshold = 3; +inline bool InequalityTest::has_threshold() const { + return this != internal_default_instance() && threshold_ != NULL; +} +inline void InequalityTest::clear_threshold() { + if (GetArenaNoVirtual() == NULL && threshold_ != NULL) { + delete threshold_; + } + threshold_ = NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::Value& InequalityTest::_internal_threshold() const { + return *threshold_; +} +inline const ::diplomacy::tensorflow::decision_trees::Value& InequalityTest::threshold() const { + const ::diplomacy::tensorflow::decision_trees::Value* p = threshold_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.InequalityTest.threshold) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_Value_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Value* InequalityTest::release_threshold() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.InequalityTest.threshold) + + ::diplomacy::tensorflow::decision_trees::Value* temp = threshold_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + threshold_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Value* InequalityTest::unsafe_arena_release_threshold() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.InequalityTest.threshold) + + ::diplomacy::tensorflow::decision_trees::Value* temp = threshold_; + threshold_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Value* InequalityTest::mutable_threshold() { + + if (threshold_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Value>(GetArenaNoVirtual()); + threshold_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.InequalityTest.threshold) + return threshold_; +} +inline void InequalityTest::set_allocated_threshold(::diplomacy::tensorflow::decision_trees::Value* threshold) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete threshold_; + } + if (threshold) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(threshold); + if (message_arena != submessage_arena) { + threshold = ::google::protobuf::internal::GetOwnedMessage( + message_arena, threshold, submessage_arena); + } + + } else { + + } + threshold_ = threshold; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.InequalityTest.threshold) +} + +inline bool InequalityTest::has_FeatureSum() const { + return FeatureSum_case() != FEATURESUM_NOT_SET; +} +inline void InequalityTest::clear_has_FeatureSum() { + _oneof_case_[0] = FEATURESUM_NOT_SET; +} +inline InequalityTest::FeatureSumCase InequalityTest::FeatureSum_case() const { + return InequalityTest::FeatureSumCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Value + +// float float_value = 1; +inline bool Value::has_float_value() const { + return value_case() == kFloatValue; +} +inline void Value::set_has_float_value() { + _oneof_case_[0] = kFloatValue; +} +inline void Value::clear_float_value() { + if (has_float_value()) { + value_.float_value_ = 0; + clear_has_value(); + } +} +inline float Value::float_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Value.float_value) + if (has_float_value()) { + return value_.float_value_; + } + return 0; +} +inline void Value::set_float_value(float value) { + if (!has_float_value()) { + clear_value(); + set_has_float_value(); + } + value_.float_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.Value.float_value) +} + +// double double_value = 2; +inline bool Value::has_double_value() const { + return value_case() == kDoubleValue; +} +inline void Value::set_has_double_value() { + _oneof_case_[0] = kDoubleValue; +} +inline void Value::clear_double_value() { + if (has_double_value()) { + value_.double_value_ = 0; + clear_has_value(); + } +} +inline double Value::double_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Value.double_value) + if (has_double_value()) { + return value_.double_value_; + } + return 0; +} +inline void Value::set_double_value(double value) { + if (!has_double_value()) { + clear_value(); + set_has_double_value(); + } + value_.double_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.Value.double_value) +} + +// int32 int32_value = 3; +inline bool Value::has_int32_value() const { + return value_case() == kInt32Value; +} +inline void Value::set_has_int32_value() { + _oneof_case_[0] = kInt32Value; +} +inline void Value::clear_int32_value() { + if (has_int32_value()) { + value_.int32_value_ = 0; + clear_has_value(); + } +} +inline ::google::protobuf::int32 Value::int32_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Value.int32_value) + if (has_int32_value()) { + return value_.int32_value_; + } + return 0; +} +inline void Value::set_int32_value(::google::protobuf::int32 value) { + if (!has_int32_value()) { + clear_value(); + set_has_int32_value(); + } + value_.int32_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.Value.int32_value) +} + +// int64 int64_value = 4; +inline bool Value::has_int64_value() const { + return value_case() == kInt64Value; +} +inline void Value::set_has_int64_value() { + _oneof_case_[0] = kInt64Value; +} +inline void Value::clear_int64_value() { + if (has_int64_value()) { + value_.int64_value_ = GOOGLE_LONGLONG(0); + clear_has_value(); + } +} +inline ::google::protobuf::int64 Value::int64_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Value.int64_value) + if (has_int64_value()) { + return value_.int64_value_; + } + return GOOGLE_LONGLONG(0); +} +inline void Value::set_int64_value(::google::protobuf::int64 value) { + if (!has_int64_value()) { + clear_value(); + set_has_int64_value(); + } + value_.int64_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.Value.int64_value) +} + +// .google.protobuf.Any custom_value = 5; +inline bool Value::has_custom_value() const { + return value_case() == kCustomValue; +} +inline void Value::set_has_custom_value() { + _oneof_case_[0] = kCustomValue; +} +inline const ::google::protobuf::Any& Value::_internal_custom_value() const { + return *value_.custom_value_; +} +inline ::google::protobuf::Any* Value::release_custom_value() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.Value.custom_value) + if (has_custom_value()) { + clear_has_value(); + ::google::protobuf::Any* temp = value_.custom_value_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.custom_value_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::google::protobuf::Any& Value::custom_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.Value.custom_value) + return has_custom_value() + ? *value_.custom_value_ + : *reinterpret_cast< ::google::protobuf::Any*>(&::google::protobuf::_Any_default_instance_); +} +inline ::google::protobuf::Any* Value::unsafe_arena_release_custom_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.decision_trees.Value.custom_value) + if (has_custom_value()) { + clear_has_value(); + ::google::protobuf::Any* temp = value_.custom_value_; + value_.custom_value_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Value::unsafe_arena_set_allocated_custom_value(::google::protobuf::Any* custom_value) { + clear_value(); + if (custom_value) { + set_has_custom_value(); + value_.custom_value_ = custom_value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.decision_trees.Value.custom_value) +} +inline ::google::protobuf::Any* Value::mutable_custom_value() { + if (!has_custom_value()) { + clear_value(); + set_has_custom_value(); + value_.custom_value_ = CreateMaybeMessage< ::google::protobuf::Any >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.Value.custom_value) + return value_.custom_value_; +} + +inline bool Value::has_value() const { + return value_case() != VALUE_NOT_SET; +} +inline void Value::clear_has_value() { + _oneof_case_[0] = VALUE_NOT_SET; +} +inline Value::ValueCase Value::value_case() const { + return Value::ValueCase(_oneof_case_[0]); +} +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::decision_trees::BinaryNode_Direction> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::decision_trees::BinaryNode_Direction>() { + return ::diplomacy::tensorflow::decision_trees::BinaryNode_Direction_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::decision_trees::InequalityTest_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::decision_trees::InequalityTest_Type>() { + return ::diplomacy::tensorflow::decision_trees::InequalityTest_Type_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto new file mode 100644 index 0000000..31fe828 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto @@ -0,0 +1,183 @@ +// Generic representation of tree-based models. + +// This proto establishes a shared standard: "fully compatible" projects should +// provide support for all reasonable models expressed through it. Therefore, +// it should be kept as simple as possible, and should never contain +// project-specific design choices. + +// Status: work in progress. This proto can change anytime without notice. + +syntax = "proto3"; +option cc_enable_arenas = true; + +package diplomacy.tensorflow.decision_trees; + +import "google/protobuf/any.proto"; +import "google/protobuf/wrappers.proto"; + +// A generic handle for any type of model. +message Model { + oneof model { + DecisionTree decision_tree = 1; + Ensemble ensemble = 2; + google.protobuf.Any custom_model = 3; + } + repeated google.protobuf.Any additional_data = 4; +} + +message ModelAndFeatures { + message Feature { + // TODO(jonasz): Remove this field, as it's confusing. Ctx: cr/153569450. + FeatureId feature_id = 1 [deprecated = true]; + repeated google.protobuf.Any additional_data = 2; + }; + // Given a FeatureId feature_id, the feature's description is in + // features[feature_id.id.value]. + map features = 1; + Model model = 2; + repeated google.protobuf.Any additional_data = 3; +} + +// An ordered sequence of models. This message can be used to express bagged or +// boosted models, as well as custom ensembles. +message Ensemble { + message Member { + Model submodel = 1; + google.protobuf.Int32Value submodel_id = 2; + repeated google.protobuf.Any additional_data = 3; + } + repeated Member members = 100; // A higher id for more readable printing. + + // The presence of a certain combination_technique indicates how to combine + // the outputs of member models in order to compute the ensemble's output. + oneof combination_technique { + Summation summation_combination_technique = 1; + Averaging averaging_combination_technique = 2; + google.protobuf.Any custom_combination_technique = 3; + } + repeated google.protobuf.Any additional_data = 4; +} + +// When present, the Ensemble's output is the sum of member models' outputs. +message Summation { + repeated google.protobuf.Any additional_data = 1; +}; + + +// When present, the Ensemble's output is the average of member models' outputs. +message Averaging { + repeated google.protobuf.Any additional_data = 1; +}; + + +message DecisionTree { + repeated TreeNode nodes = 1; + repeated google.protobuf.Any additional_data = 2; +}; + + +message TreeNode { + // Following fields are provided for convenience and better readability. + // Filling them in is not required. + google.protobuf.Int32Value node_id = 1; + google.protobuf.Int32Value depth = 2; + google.protobuf.Int32Value subtree_size = 3; + + oneof node_type { + BinaryNode binary_node = 4; + Leaf leaf = 5; + google.protobuf.Any custom_node_type = 6; + } + + repeated google.protobuf.Any additional_data = 7; +} + + +message BinaryNode { + google.protobuf.Int32Value left_child_id = 1; + google.protobuf.Int32Value right_child_id = 2; + enum Direction { + LEFT = 0; + RIGHT = 1; + } + // When left_child_test is undefined for a particular datapoint (e.g. because + // it's not defined when feature value is missing), the datapoint should go + // in this direction. + Direction default_direction = 3; + // When a datapoint satisfies the test, it should be propagated to the left + // child. + oneof left_child_test { + InequalityTest inequality_left_child_test = 4; + google.protobuf.Any custom_left_child_test = 5; + } +}; + +// A SparseVector represents a vector in which only certain select elements +// are non-zero. Maps labels to values (e.g. class id to probability or count). +message SparseVector { + map sparse_value = 1; +} + +message Vector { + repeated Value value = 1; +} + +message Leaf { + oneof leaf { + // The interpretation of the values held in the leaves of a decision tree + // is application specific, but some common cases are: + // 1) len(vector) = 1, and the floating point value[0] holds the class 0 + // probability in a two class classification problem. + // 2) len(vector) = 1, and the integer value[0] holds the class prediction. + // 3) The floating point value[i] holds the class i probability prediction. + // 4) The floating point value[i] holds the i-th component of the + // vector prediction in a regression problem. + // 5) sparse_vector holds the sparse class predictions for a classification + // problem with a large number of classes. + Vector vector = 1; + SparseVector sparse_vector = 2; + } + // For non-standard handling of leaves. + repeated google.protobuf.Any additional_data = 3; +}; + + +message FeatureId { + google.protobuf.StringValue id = 1; + repeated google.protobuf.Any additional_data = 2; +}; + +message ObliqueFeatures { + // total value is sum(features[i] * weights[i]). + repeated FeatureId features = 1; + repeated float weights = 2; +} + + +message InequalityTest { + // When the feature is missing, the test's outcome is undefined. + oneof FeatureSum { + FeatureId feature_id = 1; + ObliqueFeatures oblique = 4; + } + enum Type { + LESS_OR_EQUAL = 0; + LESS_THAN = 1; + GREATER_OR_EQUAL = 2; + GREATER_THAN = 3; + }; + Type type = 2; + Value threshold = 3; +}; + + +// Represents a single value of any type, e.g. 5 or "abc". +message Value { + oneof value { + float float_value = 1; + double double_value = 2; + int32 int32_value = 3; + int64 int64_value = 4; + google.protobuf.Any custom_value = 5; + } +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.pb.cc new file mode 100644 index 0000000..81cdc3e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.pb.cc @@ -0,0 +1,470 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto + +#include "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Value; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_FeatureId; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { +class MatchingValuesTestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MatchingValuesTest_default_instance_; +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto { +static void InitDefaultsMatchingValuesTest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::decision_trees::_MatchingValuesTest_default_instance_; + new (ptr) ::diplomacy::tensorflow::decision_trees::MatchingValuesTest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::decision_trees::MatchingValuesTest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_MatchingValuesTest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsMatchingValuesTest}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_FeatureId.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Value.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_MatchingValuesTest.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::MatchingValuesTest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::MatchingValuesTest, feature_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::MatchingValuesTest, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::decision_trees::MatchingValuesTest, inverse_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::decision_trees::MatchingValuesTest)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::decision_trees::_MatchingValuesTest_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nUdiplomacy_tensorflow/contrib/decision_" + "trees/proto/generic_tree_model_extension" + "s.proto\022#diplomacy.tensorflow.decision_t" + "rees\032Jdiplomacy_tensorflow/contrib/decis" + "ion_trees/proto/generic_tree_model.proto" + "\"\244\001\n\022MatchingValuesTest\022B\n\nfeature_id\030\001 " + "\001(\0132..diplomacy.tensorflow.decision_tree" + "s.FeatureId\0229\n\005value\030\002 \003(\0132*.diplomacy.t" + "ensorflow.decision_trees.Value\022\017\n\007invers" + "e\030\003 \001(\010b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 375); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { + +// =================================================================== + +void MatchingValuesTest::InitAsDefaultInstance() { + ::diplomacy::tensorflow::decision_trees::_MatchingValuesTest_default_instance_._instance.get_mutable()->feature_id_ = const_cast< ::diplomacy::tensorflow::decision_trees::FeatureId*>( + ::diplomacy::tensorflow::decision_trees::FeatureId::internal_default_instance()); +} +void MatchingValuesTest::clear_feature_id() { + if (GetArenaNoVirtual() == NULL && feature_id_ != NULL) { + delete feature_id_; + } + feature_id_ = NULL; +} +void MatchingValuesTest::clear_value() { + value_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MatchingValuesTest::kFeatureIdFieldNumber; +const int MatchingValuesTest::kValueFieldNumber; +const int MatchingValuesTest::kInverseFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MatchingValuesTest::MatchingValuesTest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto::scc_info_MatchingValuesTest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.decision_trees.MatchingValuesTest) +} +MatchingValuesTest::MatchingValuesTest(const MatchingValuesTest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_feature_id()) { + feature_id_ = new ::diplomacy::tensorflow::decision_trees::FeatureId(*from.feature_id_); + } else { + feature_id_ = NULL; + } + inverse_ = from.inverse_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.decision_trees.MatchingValuesTest) +} + +void MatchingValuesTest::SharedCtor() { + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&inverse_) - + reinterpret_cast(&feature_id_)) + sizeof(inverse_)); +} + +MatchingValuesTest::~MatchingValuesTest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + SharedDtor(); +} + +void MatchingValuesTest::SharedDtor() { + if (this != internal_default_instance()) delete feature_id_; +} + +void MatchingValuesTest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MatchingValuesTest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MatchingValuesTest& MatchingValuesTest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto::scc_info_MatchingValuesTest.base); + return *internal_default_instance(); +} + + +void MatchingValuesTest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + if (GetArenaNoVirtual() == NULL && feature_id_ != NULL) { + delete feature_id_; + } + feature_id_ = NULL; + inverse_ = false; + _internal_metadata_.Clear(); +} + +bool MatchingValuesTest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_feature_id())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.decision_trees.Value value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_value())); + } else { + goto handle_unusual; + } + break; + } + + // bool inverse = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &inverse_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + return false; +#undef DO_ +} + +void MatchingValuesTest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + if (this->has_feature_id()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_feature_id(), output); + } + + // repeated .diplomacy.tensorflow.decision_trees.Value value = 2; + for (unsigned int i = 0, + n = static_cast(this->value_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->value(static_cast(i)), + output); + } + + // bool inverse = 3; + if (this->inverse() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->inverse(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.decision_trees.MatchingValuesTest) +} + +::google::protobuf::uint8* MatchingValuesTest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + if (this->has_feature_id()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_feature_id(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.decision_trees.Value value = 2; + for (unsigned int i = 0, + n = static_cast(this->value_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->value(static_cast(i)), deterministic, target); + } + + // bool inverse = 3; + if (this->inverse() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->inverse(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + return target; +} + +size_t MatchingValuesTest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.decision_trees.Value value = 2; + { + unsigned int count = static_cast(this->value_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->value(static_cast(i))); + } + } + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + if (this->has_feature_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *feature_id_); + } + + // bool inverse = 3; + if (this->inverse() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MatchingValuesTest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + GOOGLE_DCHECK_NE(&from, this); + const MatchingValuesTest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + MergeFrom(*source); + } +} + +void MatchingValuesTest::MergeFrom(const MatchingValuesTest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); + if (from.has_feature_id()) { + mutable_feature_id()->::diplomacy::tensorflow::decision_trees::FeatureId::MergeFrom(from.feature_id()); + } + if (from.inverse() != 0) { + set_inverse(from.inverse()); + } +} + +void MatchingValuesTest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MatchingValuesTest::CopyFrom(const MatchingValuesTest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MatchingValuesTest::IsInitialized() const { + return true; +} + +void MatchingValuesTest::Swap(MatchingValuesTest* other) { + if (other == this) return; + InternalSwap(other); +} +void MatchingValuesTest::InternalSwap(MatchingValuesTest* other) { + using std::swap; + CastToBase(&value_)->InternalSwap(CastToBase(&other->value_)); + swap(feature_id_, other->feature_id_); + swap(inverse_, other->inverse_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MatchingValuesTest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::decision_trees::MatchingValuesTest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::MatchingValuesTest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::decision_trees::MatchingValuesTest >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.pb.h new file mode 100644 index 0000000..69841b7 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.pb.h @@ -0,0 +1,309 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { +class MatchingValuesTest; +class MatchingValuesTestDefaultTypeInternal; +extern MatchingValuesTestDefaultTypeInternal _MatchingValuesTest_default_instance_; +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::decision_trees::MatchingValuesTest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::MatchingValuesTest>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace decision_trees { + +// =================================================================== + +class MatchingValuesTest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.decision_trees.MatchingValuesTest) */ { + public: + MatchingValuesTest(); + virtual ~MatchingValuesTest(); + + MatchingValuesTest(const MatchingValuesTest& from); + + inline MatchingValuesTest& operator=(const MatchingValuesTest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MatchingValuesTest(MatchingValuesTest&& from) noexcept + : MatchingValuesTest() { + *this = ::std::move(from); + } + + inline MatchingValuesTest& operator=(MatchingValuesTest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MatchingValuesTest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MatchingValuesTest* internal_default_instance() { + return reinterpret_cast( + &_MatchingValuesTest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(MatchingValuesTest* other); + friend void swap(MatchingValuesTest& a, MatchingValuesTest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MatchingValuesTest* New() const final { + return CreateMaybeMessage(NULL); + } + + MatchingValuesTest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MatchingValuesTest& from); + void MergeFrom(const MatchingValuesTest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MatchingValuesTest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.decision_trees.Value value = 2; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 2; + ::diplomacy::tensorflow::decision_trees::Value* mutable_value(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >* + mutable_value(); + const ::diplomacy::tensorflow::decision_trees::Value& value(int index) const; + ::diplomacy::tensorflow::decision_trees::Value* add_value(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >& + value() const; + + // .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; + bool has_feature_id() const; + void clear_feature_id(); + static const int kFeatureIdFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::FeatureId& _internal_feature_id() const; + public: + const ::diplomacy::tensorflow::decision_trees::FeatureId& feature_id() const; + ::diplomacy::tensorflow::decision_trees::FeatureId* release_feature_id(); + ::diplomacy::tensorflow::decision_trees::FeatureId* mutable_feature_id(); + void set_allocated_feature_id(::diplomacy::tensorflow::decision_trees::FeatureId* feature_id); + + // bool inverse = 3; + void clear_inverse(); + static const int kInverseFieldNumber = 3; + bool inverse() const; + void set_inverse(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value > value_; + ::diplomacy::tensorflow::decision_trees::FeatureId* feature_id_; + bool inverse_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// MatchingValuesTest + +// .diplomacy.tensorflow.decision_trees.FeatureId feature_id = 1; +inline bool MatchingValuesTest::has_feature_id() const { + return this != internal_default_instance() && feature_id_ != NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::FeatureId& MatchingValuesTest::_internal_feature_id() const { + return *feature_id_; +} +inline const ::diplomacy::tensorflow::decision_trees::FeatureId& MatchingValuesTest::feature_id() const { + const ::diplomacy::tensorflow::decision_trees::FeatureId* p = feature_id_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.MatchingValuesTest.feature_id) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_FeatureId_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* MatchingValuesTest::release_feature_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.decision_trees.MatchingValuesTest.feature_id) + + ::diplomacy::tensorflow::decision_trees::FeatureId* temp = feature_id_; + feature_id_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::FeatureId* MatchingValuesTest::mutable_feature_id() { + + if (feature_id_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::FeatureId>(GetArenaNoVirtual()); + feature_id_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.MatchingValuesTest.feature_id) + return feature_id_; +} +inline void MatchingValuesTest::set_allocated_feature_id(::diplomacy::tensorflow::decision_trees::FeatureId* feature_id) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(feature_id_); + } + if (feature_id) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(feature_id)->GetArena(); + if (message_arena != submessage_arena) { + feature_id = ::google::protobuf::internal::GetOwnedMessage( + message_arena, feature_id, submessage_arena); + } + + } else { + + } + feature_id_ = feature_id; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.decision_trees.MatchingValuesTest.feature_id) +} + +// repeated .diplomacy.tensorflow.decision_trees.Value value = 2; +inline int MatchingValuesTest::value_size() const { + return value_.size(); +} +inline ::diplomacy::tensorflow::decision_trees::Value* MatchingValuesTest::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.decision_trees.MatchingValuesTest.value) + return value_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >* +MatchingValuesTest::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.decision_trees.MatchingValuesTest.value) + return &value_; +} +inline const ::diplomacy::tensorflow::decision_trees::Value& MatchingValuesTest::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.MatchingValuesTest.value) + return value_.Get(index); +} +inline ::diplomacy::tensorflow::decision_trees::Value* MatchingValuesTest::add_value() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.decision_trees.MatchingValuesTest.value) + return value_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::Value >& +MatchingValuesTest::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.decision_trees.MatchingValuesTest.value) + return value_; +} + +// bool inverse = 3; +inline void MatchingValuesTest::clear_inverse() { + inverse_ = false; +} +inline bool MatchingValuesTest::inverse() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.decision_trees.MatchingValuesTest.inverse) + return inverse_; +} +inline void MatchingValuesTest::set_inverse(bool value) { + + inverse_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.decision_trees.MatchingValuesTest.inverse) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace decision_trees +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_5fextensions_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto new file mode 100644 index 0000000..e3eb868 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto @@ -0,0 +1,18 @@ +// Messages in this file are not part of the basic standard established by +// generic_tree_model.proto (see the toplevel comment in that file). + +syntax = "proto3"; + +package diplomacy.tensorflow.decision_trees; + +import "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto"; + +// Used in generic_tree_model.BinaryNode.left_child_test. +// Tests whether the feature's value belongs to the specified list, +// (or does not belong if inverse=True). +message MatchingValuesTest { + // When the feature is missing, the test's outcome is undefined. + FeatureId feature_id = 1; + repeated Value value = 2; + bool inverse = 3; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions_pb2.py new file mode 100644 index 0000000..c5990d5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions_pb2.py @@ -0,0 +1,87 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.contrib.decision_trees.proto import generic_tree_model_pb2 as diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto', + package='diplomacy.tensorflow.decision_trees', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nUdiplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_extensions.proto\x12#diplomacy.tensorflow.decision_trees\x1aJdiplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto\"\xa4\x01\n\x12MatchingValuesTest\x12\x42\n\nfeature_id\x18\x01 \x01(\x0b\x32..diplomacy.tensorflow.decision_trees.FeatureId\x12\x39\n\x05value\x18\x02 \x03(\x0b\x32*.diplomacy.tensorflow.decision_trees.Value\x12\x0f\n\x07inverse\x18\x03 \x01(\x08\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2.DESCRIPTOR,]) + + + + +_MATCHINGVALUESTEST = _descriptor.Descriptor( + name='MatchingValuesTest', + full_name='diplomacy.tensorflow.decision_trees.MatchingValuesTest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.decision_trees.MatchingValuesTest.feature_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.decision_trees.MatchingValuesTest.value', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inverse', full_name='diplomacy.tensorflow.decision_trees.MatchingValuesTest.inverse', index=2, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=203, + serialized_end=367, +) + +_MATCHINGVALUESTEST.fields_by_name['feature_id'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._FEATUREID +_MATCHINGVALUESTEST.fields_by_name['value'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._VALUE +DESCRIPTOR.message_types_by_name['MatchingValuesTest'] = _MATCHINGVALUESTEST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +MatchingValuesTest = _reflection.GeneratedProtocolMessageType('MatchingValuesTest', (_message.Message,), dict( + DESCRIPTOR = _MATCHINGVALUESTEST, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_extensions_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.MatchingValuesTest) + )) +_sym_db.RegisterMessage(MatchingValuesTest) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_pb2.py new file mode 100644 index 0000000..4868d30 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model_pb2.py @@ -0,0 +1,1215 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto', + package='diplomacy.tensorflow.decision_trees', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\nJdiplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto\x12#diplomacy.tensorflow.decision_trees\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xfc\x01\n\x05Model\x12J\n\rdecision_tree\x18\x01 \x01(\x0b\x32\x31.diplomacy.tensorflow.decision_trees.DecisionTreeH\x00\x12\x41\n\x08\x65nsemble\x18\x02 \x01(\x0b\x32-.diplomacy.tensorflow.decision_trees.EnsembleH\x00\x12,\n\x0c\x63ustom_model\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12-\n\x0f\x61\x64\x64itional_data\x18\x04 \x03(\x0b\x32\x14.google.protobuf.AnyB\x07\n\x05model\"\xc6\x03\n\x10ModelAndFeatures\x12U\n\x08\x66\x65\x61tures\x18\x01 \x03(\x0b\x32\x43.diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry\x12\x39\n\x05model\x18\x02 \x01(\x0b\x32*.diplomacy.tensorflow.decision_trees.Model\x12-\n\x0f\x61\x64\x64itional_data\x18\x03 \x03(\x0b\x32\x14.google.protobuf.Any\x1a\x80\x01\n\x07\x46\x65\x61ture\x12\x46\n\nfeature_id\x18\x01 \x01(\x0b\x32..diplomacy.tensorflow.decision_trees.FeatureIdB\x02\x18\x01\x12-\n\x0f\x61\x64\x64itional_data\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\x1an\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature:\x02\x38\x01\"\xb7\x04\n\x08\x45nsemble\x12\x45\n\x07members\x18\x64 \x03(\x0b\x32\x34.diplomacy.tensorflow.decision_trees.Ensemble.Member\x12Y\n\x1fsummation_combination_technique\x18\x01 \x01(\x0b\x32..diplomacy.tensorflow.decision_trees.SummationH\x00\x12Y\n\x1f\x61veraging_combination_technique\x18\x02 \x01(\x0b\x32..diplomacy.tensorflow.decision_trees.AveragingH\x00\x12<\n\x1c\x63ustom_combination_technique\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12-\n\x0f\x61\x64\x64itional_data\x18\x04 \x03(\x0b\x32\x14.google.protobuf.Any\x1a\xa7\x01\n\x06Member\x12<\n\x08submodel\x18\x01 \x01(\x0b\x32*.diplomacy.tensorflow.decision_trees.Model\x12\x30\n\x0bsubmodel_id\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12-\n\x0f\x61\x64\x64itional_data\x18\x03 \x03(\x0b\x32\x14.google.protobuf.AnyB\x17\n\x15\x63ombination_technique\":\n\tSummation\x12-\n\x0f\x61\x64\x64itional_data\x18\x01 \x03(\x0b\x32\x14.google.protobuf.Any\":\n\tAveraging\x12-\n\x0f\x61\x64\x64itional_data\x18\x01 \x03(\x0b\x32\x14.google.protobuf.Any\"{\n\x0c\x44\x65\x63isionTree\x12<\n\x05nodes\x18\x01 \x03(\x0b\x32-.diplomacy.tensorflow.decision_trees.TreeNode\x12-\n\x0f\x61\x64\x64itional_data\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\"\x88\x03\n\x08TreeNode\x12,\n\x07node_id\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12*\n\x05\x64\x65pth\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x31\n\x0csubtree_size\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x46\n\x0b\x62inary_node\x18\x04 \x01(\x0b\x32/.diplomacy.tensorflow.decision_trees.BinaryNodeH\x00\x12\x39\n\x04leaf\x18\x05 \x01(\x0b\x32).diplomacy.tensorflow.decision_trees.LeafH\x00\x12\x30\n\x10\x63ustom_node_type\x18\x06 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12-\n\x0f\x61\x64\x64itional_data\x18\x07 \x03(\x0b\x32\x14.google.protobuf.AnyB\x0b\n\tnode_type\"\x93\x03\n\nBinaryNode\x12\x32\n\rleft_child_id\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x33\n\x0eright_child_id\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12T\n\x11\x64\x65\x66\x61ult_direction\x18\x03 \x01(\x0e\x32\x39.diplomacy.tensorflow.decision_trees.BinaryNode.Direction\x12Y\n\x1ainequality_left_child_test\x18\x04 \x01(\x0b\x32\x33.diplomacy.tensorflow.decision_trees.InequalityTestH\x00\x12\x36\n\x16\x63ustom_left_child_test\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\" \n\tDirection\x12\x08\n\x04LEFT\x10\x00\x12\t\n\x05RIGHT\x10\x01\x42\x11\n\x0fleft_child_test\"\xc8\x01\n\x0cSparseVector\x12X\n\x0csparse_value\x18\x01 \x03(\x0b\x32\x42.diplomacy.tensorflow.decision_trees.SparseVector.SparseValueEntry\x1a^\n\x10SparseValueEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.diplomacy.tensorflow.decision_trees.Value:\x02\x38\x01\"C\n\x06Vector\x12\x39\n\x05value\x18\x01 \x03(\x0b\x32*.diplomacy.tensorflow.decision_trees.Value\"\xc8\x01\n\x04Leaf\x12=\n\x06vector\x18\x01 \x01(\x0b\x32+.diplomacy.tensorflow.decision_trees.VectorH\x00\x12J\n\rsparse_vector\x18\x02 \x01(\x0b\x32\x31.diplomacy.tensorflow.decision_trees.SparseVectorH\x00\x12-\n\x0f\x61\x64\x64itional_data\x18\x03 \x03(\x0b\x32\x14.google.protobuf.AnyB\x06\n\x04leaf\"d\n\tFeatureId\x12(\n\x02id\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12-\n\x0f\x61\x64\x64itional_data\x18\x02 \x03(\x0b\x32\x14.google.protobuf.Any\"d\n\x0fObliqueFeatures\x12@\n\x08\x66\x65\x61tures\x18\x01 \x03(\x0b\x32..diplomacy.tensorflow.decision_trees.FeatureId\x12\x0f\n\x07weights\x18\x02 \x03(\x02\"\x86\x03\n\x0eInequalityTest\x12\x44\n\nfeature_id\x18\x01 \x01(\x0b\x32..diplomacy.tensorflow.decision_trees.FeatureIdH\x00\x12G\n\x07oblique\x18\x04 \x01(\x0b\x32\x34.diplomacy.tensorflow.decision_trees.ObliqueFeaturesH\x00\x12\x46\n\x04type\x18\x02 \x01(\x0e\x32\x38.diplomacy.tensorflow.decision_trees.InequalityTest.Type\x12=\n\tthreshold\x18\x03 \x01(\x0b\x32*.diplomacy.tensorflow.decision_trees.Value\"P\n\x04Type\x12\x11\n\rLESS_OR_EQUAL\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x14\n\x10GREATER_OR_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\x42\x0c\n\nFeatureSum\"\x9b\x01\n\x05Value\x12\x15\n\x0b\x66loat_value\x18\x01 \x01(\x02H\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x15\n\x0bint32_value\x18\x03 \x01(\x05H\x00\x12\x15\n\x0bint64_value\x18\x04 \x01(\x03H\x00\x12,\n\x0c\x63ustom_value\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x42\x07\n\x05valueB\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,]) + + + +_BINARYNODE_DIRECTION = _descriptor.EnumDescriptor( + name='Direction', + full_name='diplomacy.tensorflow.decision_trees.BinaryNode.Direction', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='LEFT', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='RIGHT', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2449, + serialized_end=2481, +) +_sym_db.RegisterEnumDescriptor(_BINARYNODE_DIRECTION) + +_INEQUALITYTEST_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='diplomacy.tensorflow.decision_trees.InequalityTest.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='LESS_OR_EQUAL', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LESS_THAN', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GREATER_OR_EQUAL', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GREATER_THAN', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3478, + serialized_end=3558, +) +_sym_db.RegisterEnumDescriptor(_INEQUALITYTEST_TYPE) + + +_MODEL = _descriptor.Descriptor( + name='Model', + full_name='diplomacy.tensorflow.decision_trees.Model', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='decision_tree', full_name='diplomacy.tensorflow.decision_trees.Model.decision_tree', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='ensemble', full_name='diplomacy.tensorflow.decision_trees.Model.ensemble', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom_model', full_name='diplomacy.tensorflow.decision_trees.Model.custom_model', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.Model.additional_data', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='model', full_name='diplomacy.tensorflow.decision_trees.Model.model', + index=0, containing_type=None, fields=[]), + ], + serialized_start=175, + serialized_end=427, +) + + +_MODELANDFEATURES_FEATURE = _descriptor.Descriptor( + name='Feature', + full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.feature_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature.additional_data', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=644, + serialized_end=772, +) + +_MODELANDFEATURES_FEATURESENTRY = _descriptor.Descriptor( + name='FeaturesEntry', + full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=774, + serialized_end=884, +) + +_MODELANDFEATURES = _descriptor.Descriptor( + name='ModelAndFeatures', + full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='features', full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.features', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='model', full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.model', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.ModelAndFeatures.additional_data', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_MODELANDFEATURES_FEATURE, _MODELANDFEATURES_FEATURESENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=430, + serialized_end=884, +) + + +_ENSEMBLE_MEMBER = _descriptor.Descriptor( + name='Member', + full_name='diplomacy.tensorflow.decision_trees.Ensemble.Member', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='submodel', full_name='diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='submodel_id', full_name='diplomacy.tensorflow.decision_trees.Ensemble.Member.submodel_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.Ensemble.Member.additional_data', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1262, + serialized_end=1429, +) + +_ENSEMBLE = _descriptor.Descriptor( + name='Ensemble', + full_name='diplomacy.tensorflow.decision_trees.Ensemble', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='members', full_name='diplomacy.tensorflow.decision_trees.Ensemble.members', index=0, + number=100, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='summation_combination_technique', full_name='diplomacy.tensorflow.decision_trees.Ensemble.summation_combination_technique', index=1, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='averaging_combination_technique', full_name='diplomacy.tensorflow.decision_trees.Ensemble.averaging_combination_technique', index=2, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom_combination_technique', full_name='diplomacy.tensorflow.decision_trees.Ensemble.custom_combination_technique', index=3, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.Ensemble.additional_data', index=4, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_ENSEMBLE_MEMBER, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='combination_technique', full_name='diplomacy.tensorflow.decision_trees.Ensemble.combination_technique', + index=0, containing_type=None, fields=[]), + ], + serialized_start=887, + serialized_end=1454, +) + + +_SUMMATION = _descriptor.Descriptor( + name='Summation', + full_name='diplomacy.tensorflow.decision_trees.Summation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.Summation.additional_data', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1456, + serialized_end=1514, +) + + +_AVERAGING = _descriptor.Descriptor( + name='Averaging', + full_name='diplomacy.tensorflow.decision_trees.Averaging', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.Averaging.additional_data', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1516, + serialized_end=1574, +) + + +_DECISIONTREE = _descriptor.Descriptor( + name='DecisionTree', + full_name='diplomacy.tensorflow.decision_trees.DecisionTree', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nodes', full_name='diplomacy.tensorflow.decision_trees.DecisionTree.nodes', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.DecisionTree.additional_data', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1576, + serialized_end=1699, +) + + +_TREENODE = _descriptor.Descriptor( + name='TreeNode', + full_name='diplomacy.tensorflow.decision_trees.TreeNode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_id', full_name='diplomacy.tensorflow.decision_trees.TreeNode.node_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='depth', full_name='diplomacy.tensorflow.decision_trees.TreeNode.depth', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='subtree_size', full_name='diplomacy.tensorflow.decision_trees.TreeNode.subtree_size', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='binary_node', full_name='diplomacy.tensorflow.decision_trees.TreeNode.binary_node', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='leaf', full_name='diplomacy.tensorflow.decision_trees.TreeNode.leaf', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom_node_type', full_name='diplomacy.tensorflow.decision_trees.TreeNode.custom_node_type', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.TreeNode.additional_data', index=6, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='node_type', full_name='diplomacy.tensorflow.decision_trees.TreeNode.node_type', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1702, + serialized_end=2094, +) + + +_BINARYNODE = _descriptor.Descriptor( + name='BinaryNode', + full_name='diplomacy.tensorflow.decision_trees.BinaryNode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='left_child_id', full_name='diplomacy.tensorflow.decision_trees.BinaryNode.left_child_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_child_id', full_name='diplomacy.tensorflow.decision_trees.BinaryNode.right_child_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default_direction', full_name='diplomacy.tensorflow.decision_trees.BinaryNode.default_direction', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inequality_left_child_test', full_name='diplomacy.tensorflow.decision_trees.BinaryNode.inequality_left_child_test', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom_left_child_test', full_name='diplomacy.tensorflow.decision_trees.BinaryNode.custom_left_child_test', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _BINARYNODE_DIRECTION, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='left_child_test', full_name='diplomacy.tensorflow.decision_trees.BinaryNode.left_child_test', + index=0, containing_type=None, fields=[]), + ], + serialized_start=2097, + serialized_end=2500, +) + + +_SPARSEVECTOR_SPARSEVALUEENTRY = _descriptor.Descriptor( + name='SparseValueEntry', + full_name='diplomacy.tensorflow.decision_trees.SparseVector.SparseValueEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.decision_trees.SparseVector.SparseValueEntry.key', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.decision_trees.SparseVector.SparseValueEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2609, + serialized_end=2703, +) + +_SPARSEVECTOR = _descriptor.Descriptor( + name='SparseVector', + full_name='diplomacy.tensorflow.decision_trees.SparseVector', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='sparse_value', full_name='diplomacy.tensorflow.decision_trees.SparseVector.sparse_value', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SPARSEVECTOR_SPARSEVALUEENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2503, + serialized_end=2703, +) + + +_VECTOR = _descriptor.Descriptor( + name='Vector', + full_name='diplomacy.tensorflow.decision_trees.Vector', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.decision_trees.Vector.value', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2705, + serialized_end=2772, +) + + +_LEAF = _descriptor.Descriptor( + name='Leaf', + full_name='diplomacy.tensorflow.decision_trees.Leaf', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='vector', full_name='diplomacy.tensorflow.decision_trees.Leaf.vector', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sparse_vector', full_name='diplomacy.tensorflow.decision_trees.Leaf.sparse_vector', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.Leaf.additional_data', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='leaf', full_name='diplomacy.tensorflow.decision_trees.Leaf.leaf', + index=0, containing_type=None, fields=[]), + ], + serialized_start=2775, + serialized_end=2975, +) + + +_FEATUREID = _descriptor.Descriptor( + name='FeatureId', + full_name='diplomacy.tensorflow.decision_trees.FeatureId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='diplomacy.tensorflow.decision_trees.FeatureId.id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_data', full_name='diplomacy.tensorflow.decision_trees.FeatureId.additional_data', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2977, + serialized_end=3077, +) + + +_OBLIQUEFEATURES = _descriptor.Descriptor( + name='ObliqueFeatures', + full_name='diplomacy.tensorflow.decision_trees.ObliqueFeatures', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='features', full_name='diplomacy.tensorflow.decision_trees.ObliqueFeatures.features', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='weights', full_name='diplomacy.tensorflow.decision_trees.ObliqueFeatures.weights', index=1, + number=2, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3079, + serialized_end=3179, +) + + +_INEQUALITYTEST = _descriptor.Descriptor( + name='InequalityTest', + full_name='diplomacy.tensorflow.decision_trees.InequalityTest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.decision_trees.InequalityTest.feature_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='oblique', full_name='diplomacy.tensorflow.decision_trees.InequalityTest.oblique', index=1, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.decision_trees.InequalityTest.type', index=2, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='threshold', full_name='diplomacy.tensorflow.decision_trees.InequalityTest.threshold', index=3, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _INEQUALITYTEST_TYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='FeatureSum', full_name='diplomacy.tensorflow.decision_trees.InequalityTest.FeatureSum', + index=0, containing_type=None, fields=[]), + ], + serialized_start=3182, + serialized_end=3572, +) + + +_VALUE = _descriptor.Descriptor( + name='Value', + full_name='diplomacy.tensorflow.decision_trees.Value', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='float_value', full_name='diplomacy.tensorflow.decision_trees.Value.float_value', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='double_value', full_name='diplomacy.tensorflow.decision_trees.Value.double_value', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int32_value', full_name='diplomacy.tensorflow.decision_trees.Value.int32_value', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int64_value', full_name='diplomacy.tensorflow.decision_trees.Value.int64_value', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom_value', full_name='diplomacy.tensorflow.decision_trees.Value.custom_value', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='value', full_name='diplomacy.tensorflow.decision_trees.Value.value', + index=0, containing_type=None, fields=[]), + ], + serialized_start=3575, + serialized_end=3730, +) + +_MODEL.fields_by_name['decision_tree'].message_type = _DECISIONTREE +_MODEL.fields_by_name['ensemble'].message_type = _ENSEMBLE +_MODEL.fields_by_name['custom_model'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_MODEL.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_MODEL.oneofs_by_name['model'].fields.append( + _MODEL.fields_by_name['decision_tree']) +_MODEL.fields_by_name['decision_tree'].containing_oneof = _MODEL.oneofs_by_name['model'] +_MODEL.oneofs_by_name['model'].fields.append( + _MODEL.fields_by_name['ensemble']) +_MODEL.fields_by_name['ensemble'].containing_oneof = _MODEL.oneofs_by_name['model'] +_MODEL.oneofs_by_name['model'].fields.append( + _MODEL.fields_by_name['custom_model']) +_MODEL.fields_by_name['custom_model'].containing_oneof = _MODEL.oneofs_by_name['model'] +_MODELANDFEATURES_FEATURE.fields_by_name['feature_id'].message_type = _FEATUREID +_MODELANDFEATURES_FEATURE.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_MODELANDFEATURES_FEATURE.containing_type = _MODELANDFEATURES +_MODELANDFEATURES_FEATURESENTRY.fields_by_name['value'].message_type = _MODELANDFEATURES_FEATURE +_MODELANDFEATURES_FEATURESENTRY.containing_type = _MODELANDFEATURES +_MODELANDFEATURES.fields_by_name['features'].message_type = _MODELANDFEATURES_FEATURESENTRY +_MODELANDFEATURES.fields_by_name['model'].message_type = _MODEL +_MODELANDFEATURES.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_ENSEMBLE_MEMBER.fields_by_name['submodel'].message_type = _MODEL +_ENSEMBLE_MEMBER.fields_by_name['submodel_id'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT32VALUE +_ENSEMBLE_MEMBER.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_ENSEMBLE_MEMBER.containing_type = _ENSEMBLE +_ENSEMBLE.fields_by_name['members'].message_type = _ENSEMBLE_MEMBER +_ENSEMBLE.fields_by_name['summation_combination_technique'].message_type = _SUMMATION +_ENSEMBLE.fields_by_name['averaging_combination_technique'].message_type = _AVERAGING +_ENSEMBLE.fields_by_name['custom_combination_technique'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_ENSEMBLE.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_ENSEMBLE.oneofs_by_name['combination_technique'].fields.append( + _ENSEMBLE.fields_by_name['summation_combination_technique']) +_ENSEMBLE.fields_by_name['summation_combination_technique'].containing_oneof = _ENSEMBLE.oneofs_by_name['combination_technique'] +_ENSEMBLE.oneofs_by_name['combination_technique'].fields.append( + _ENSEMBLE.fields_by_name['averaging_combination_technique']) +_ENSEMBLE.fields_by_name['averaging_combination_technique'].containing_oneof = _ENSEMBLE.oneofs_by_name['combination_technique'] +_ENSEMBLE.oneofs_by_name['combination_technique'].fields.append( + _ENSEMBLE.fields_by_name['custom_combination_technique']) +_ENSEMBLE.fields_by_name['custom_combination_technique'].containing_oneof = _ENSEMBLE.oneofs_by_name['combination_technique'] +_SUMMATION.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_AVERAGING.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_DECISIONTREE.fields_by_name['nodes'].message_type = _TREENODE +_DECISIONTREE.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_TREENODE.fields_by_name['node_id'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT32VALUE +_TREENODE.fields_by_name['depth'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT32VALUE +_TREENODE.fields_by_name['subtree_size'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT32VALUE +_TREENODE.fields_by_name['binary_node'].message_type = _BINARYNODE +_TREENODE.fields_by_name['leaf'].message_type = _LEAF +_TREENODE.fields_by_name['custom_node_type'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_TREENODE.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_TREENODE.oneofs_by_name['node_type'].fields.append( + _TREENODE.fields_by_name['binary_node']) +_TREENODE.fields_by_name['binary_node'].containing_oneof = _TREENODE.oneofs_by_name['node_type'] +_TREENODE.oneofs_by_name['node_type'].fields.append( + _TREENODE.fields_by_name['leaf']) +_TREENODE.fields_by_name['leaf'].containing_oneof = _TREENODE.oneofs_by_name['node_type'] +_TREENODE.oneofs_by_name['node_type'].fields.append( + _TREENODE.fields_by_name['custom_node_type']) +_TREENODE.fields_by_name['custom_node_type'].containing_oneof = _TREENODE.oneofs_by_name['node_type'] +_BINARYNODE.fields_by_name['left_child_id'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT32VALUE +_BINARYNODE.fields_by_name['right_child_id'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT32VALUE +_BINARYNODE.fields_by_name['default_direction'].enum_type = _BINARYNODE_DIRECTION +_BINARYNODE.fields_by_name['inequality_left_child_test'].message_type = _INEQUALITYTEST +_BINARYNODE.fields_by_name['custom_left_child_test'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_BINARYNODE_DIRECTION.containing_type = _BINARYNODE +_BINARYNODE.oneofs_by_name['left_child_test'].fields.append( + _BINARYNODE.fields_by_name['inequality_left_child_test']) +_BINARYNODE.fields_by_name['inequality_left_child_test'].containing_oneof = _BINARYNODE.oneofs_by_name['left_child_test'] +_BINARYNODE.oneofs_by_name['left_child_test'].fields.append( + _BINARYNODE.fields_by_name['custom_left_child_test']) +_BINARYNODE.fields_by_name['custom_left_child_test'].containing_oneof = _BINARYNODE.oneofs_by_name['left_child_test'] +_SPARSEVECTOR_SPARSEVALUEENTRY.fields_by_name['value'].message_type = _VALUE +_SPARSEVECTOR_SPARSEVALUEENTRY.containing_type = _SPARSEVECTOR +_SPARSEVECTOR.fields_by_name['sparse_value'].message_type = _SPARSEVECTOR_SPARSEVALUEENTRY +_VECTOR.fields_by_name['value'].message_type = _VALUE +_LEAF.fields_by_name['vector'].message_type = _VECTOR +_LEAF.fields_by_name['sparse_vector'].message_type = _SPARSEVECTOR +_LEAF.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_LEAF.oneofs_by_name['leaf'].fields.append( + _LEAF.fields_by_name['vector']) +_LEAF.fields_by_name['vector'].containing_oneof = _LEAF.oneofs_by_name['leaf'] +_LEAF.oneofs_by_name['leaf'].fields.append( + _LEAF.fields_by_name['sparse_vector']) +_LEAF.fields_by_name['sparse_vector'].containing_oneof = _LEAF.oneofs_by_name['leaf'] +_FEATUREID.fields_by_name['id'].message_type = google_dot_protobuf_dot_wrappers__pb2._STRINGVALUE +_FEATUREID.fields_by_name['additional_data'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_OBLIQUEFEATURES.fields_by_name['features'].message_type = _FEATUREID +_INEQUALITYTEST.fields_by_name['feature_id'].message_type = _FEATUREID +_INEQUALITYTEST.fields_by_name['oblique'].message_type = _OBLIQUEFEATURES +_INEQUALITYTEST.fields_by_name['type'].enum_type = _INEQUALITYTEST_TYPE +_INEQUALITYTEST.fields_by_name['threshold'].message_type = _VALUE +_INEQUALITYTEST_TYPE.containing_type = _INEQUALITYTEST +_INEQUALITYTEST.oneofs_by_name['FeatureSum'].fields.append( + _INEQUALITYTEST.fields_by_name['feature_id']) +_INEQUALITYTEST.fields_by_name['feature_id'].containing_oneof = _INEQUALITYTEST.oneofs_by_name['FeatureSum'] +_INEQUALITYTEST.oneofs_by_name['FeatureSum'].fields.append( + _INEQUALITYTEST.fields_by_name['oblique']) +_INEQUALITYTEST.fields_by_name['oblique'].containing_oneof = _INEQUALITYTEST.oneofs_by_name['FeatureSum'] +_VALUE.fields_by_name['custom_value'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_VALUE.oneofs_by_name['value'].fields.append( + _VALUE.fields_by_name['float_value']) +_VALUE.fields_by_name['float_value'].containing_oneof = _VALUE.oneofs_by_name['value'] +_VALUE.oneofs_by_name['value'].fields.append( + _VALUE.fields_by_name['double_value']) +_VALUE.fields_by_name['double_value'].containing_oneof = _VALUE.oneofs_by_name['value'] +_VALUE.oneofs_by_name['value'].fields.append( + _VALUE.fields_by_name['int32_value']) +_VALUE.fields_by_name['int32_value'].containing_oneof = _VALUE.oneofs_by_name['value'] +_VALUE.oneofs_by_name['value'].fields.append( + _VALUE.fields_by_name['int64_value']) +_VALUE.fields_by_name['int64_value'].containing_oneof = _VALUE.oneofs_by_name['value'] +_VALUE.oneofs_by_name['value'].fields.append( + _VALUE.fields_by_name['custom_value']) +_VALUE.fields_by_name['custom_value'].containing_oneof = _VALUE.oneofs_by_name['value'] +DESCRIPTOR.message_types_by_name['Model'] = _MODEL +DESCRIPTOR.message_types_by_name['ModelAndFeatures'] = _MODELANDFEATURES +DESCRIPTOR.message_types_by_name['Ensemble'] = _ENSEMBLE +DESCRIPTOR.message_types_by_name['Summation'] = _SUMMATION +DESCRIPTOR.message_types_by_name['Averaging'] = _AVERAGING +DESCRIPTOR.message_types_by_name['DecisionTree'] = _DECISIONTREE +DESCRIPTOR.message_types_by_name['TreeNode'] = _TREENODE +DESCRIPTOR.message_types_by_name['BinaryNode'] = _BINARYNODE +DESCRIPTOR.message_types_by_name['SparseVector'] = _SPARSEVECTOR +DESCRIPTOR.message_types_by_name['Vector'] = _VECTOR +DESCRIPTOR.message_types_by_name['Leaf'] = _LEAF +DESCRIPTOR.message_types_by_name['FeatureId'] = _FEATUREID +DESCRIPTOR.message_types_by_name['ObliqueFeatures'] = _OBLIQUEFEATURES +DESCRIPTOR.message_types_by_name['InequalityTest'] = _INEQUALITYTEST +DESCRIPTOR.message_types_by_name['Value'] = _VALUE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Model = _reflection.GeneratedProtocolMessageType('Model', (_message.Message,), dict( + DESCRIPTOR = _MODEL, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Model) + )) +_sym_db.RegisterMessage(Model) + +ModelAndFeatures = _reflection.GeneratedProtocolMessageType('ModelAndFeatures', (_message.Message,), dict( + + Feature = _reflection.GeneratedProtocolMessageType('Feature', (_message.Message,), dict( + DESCRIPTOR = _MODELANDFEATURES_FEATURE, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.ModelAndFeatures.Feature) + )) + , + + FeaturesEntry = _reflection.GeneratedProtocolMessageType('FeaturesEntry', (_message.Message,), dict( + DESCRIPTOR = _MODELANDFEATURES_FEATURESENTRY, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.ModelAndFeatures.FeaturesEntry) + )) + , + DESCRIPTOR = _MODELANDFEATURES, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.ModelAndFeatures) + )) +_sym_db.RegisterMessage(ModelAndFeatures) +_sym_db.RegisterMessage(ModelAndFeatures.Feature) +_sym_db.RegisterMessage(ModelAndFeatures.FeaturesEntry) + +Ensemble = _reflection.GeneratedProtocolMessageType('Ensemble', (_message.Message,), dict( + + Member = _reflection.GeneratedProtocolMessageType('Member', (_message.Message,), dict( + DESCRIPTOR = _ENSEMBLE_MEMBER, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Ensemble.Member) + )) + , + DESCRIPTOR = _ENSEMBLE, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Ensemble) + )) +_sym_db.RegisterMessage(Ensemble) +_sym_db.RegisterMessage(Ensemble.Member) + +Summation = _reflection.GeneratedProtocolMessageType('Summation', (_message.Message,), dict( + DESCRIPTOR = _SUMMATION, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Summation) + )) +_sym_db.RegisterMessage(Summation) + +Averaging = _reflection.GeneratedProtocolMessageType('Averaging', (_message.Message,), dict( + DESCRIPTOR = _AVERAGING, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Averaging) + )) +_sym_db.RegisterMessage(Averaging) + +DecisionTree = _reflection.GeneratedProtocolMessageType('DecisionTree', (_message.Message,), dict( + DESCRIPTOR = _DECISIONTREE, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.DecisionTree) + )) +_sym_db.RegisterMessage(DecisionTree) + +TreeNode = _reflection.GeneratedProtocolMessageType('TreeNode', (_message.Message,), dict( + DESCRIPTOR = _TREENODE, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.TreeNode) + )) +_sym_db.RegisterMessage(TreeNode) + +BinaryNode = _reflection.GeneratedProtocolMessageType('BinaryNode', (_message.Message,), dict( + DESCRIPTOR = _BINARYNODE, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.BinaryNode) + )) +_sym_db.RegisterMessage(BinaryNode) + +SparseVector = _reflection.GeneratedProtocolMessageType('SparseVector', (_message.Message,), dict( + + SparseValueEntry = _reflection.GeneratedProtocolMessageType('SparseValueEntry', (_message.Message,), dict( + DESCRIPTOR = _SPARSEVECTOR_SPARSEVALUEENTRY, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.SparseVector.SparseValueEntry) + )) + , + DESCRIPTOR = _SPARSEVECTOR, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.SparseVector) + )) +_sym_db.RegisterMessage(SparseVector) +_sym_db.RegisterMessage(SparseVector.SparseValueEntry) + +Vector = _reflection.GeneratedProtocolMessageType('Vector', (_message.Message,), dict( + DESCRIPTOR = _VECTOR, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Vector) + )) +_sym_db.RegisterMessage(Vector) + +Leaf = _reflection.GeneratedProtocolMessageType('Leaf', (_message.Message,), dict( + DESCRIPTOR = _LEAF, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Leaf) + )) +_sym_db.RegisterMessage(Leaf) + +FeatureId = _reflection.GeneratedProtocolMessageType('FeatureId', (_message.Message,), dict( + DESCRIPTOR = _FEATUREID, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.FeatureId) + )) +_sym_db.RegisterMessage(FeatureId) + +ObliqueFeatures = _reflection.GeneratedProtocolMessageType('ObliqueFeatures', (_message.Message,), dict( + DESCRIPTOR = _OBLIQUEFEATURES, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.ObliqueFeatures) + )) +_sym_db.RegisterMessage(ObliqueFeatures) + +InequalityTest = _reflection.GeneratedProtocolMessageType('InequalityTest', (_message.Message,), dict( + DESCRIPTOR = _INEQUALITYTEST, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.InequalityTest) + )) +_sym_db.RegisterMessage(InequalityTest) + +Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), dict( + DESCRIPTOR = _VALUE, + __module__ = 'diplomacy_tensorflow.contrib.decision_trees.proto.generic_tree_model_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.decision_trees.Value) + )) +_sym_db.RegisterMessage(Value) + + +DESCRIPTOR._options = None +_MODELANDFEATURES_FEATURE.fields_by_name['feature_id']._options = None +_MODELANDFEATURES_FEATURESENTRY._options = None +_SPARSEVECTOR_SPARSEVALUEENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.pb.cc new file mode 100644 index 0000000..9b29958 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.pb.cc @@ -0,0 +1,577 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/gdr/gdr.proto + +#include "diplomacy_tensorflow/contrib/gdr/gdr.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +class RemoteMemoryRegionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _RemoteMemoryRegion_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto { +static void InitDefaultsRemoteMemoryRegion() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_RemoteMemoryRegion_default_instance_; + new (ptr) ::diplomacy::tensorflow::RemoteMemoryRegion(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::RemoteMemoryRegion::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_RemoteMemoryRegion = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRemoteMemoryRegion}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_RemoteMemoryRegion.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteMemoryRegion, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteMemoryRegion, host_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteMemoryRegion, port_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteMemoryRegion, addr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteMemoryRegion, rkey_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteMemoryRegion, tensor_key_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::RemoteMemoryRegion)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_RemoteMemoryRegion_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/gdr/gdr.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n*diplomacy_tensorflow/contrib/gdr/gdr.p" + "roto\022\024diplomacy.tensorflow\"`\n\022RemoteMemo" + "ryRegion\022\014\n\004host\030\001 \001(\t\022\014\n\004port\030\002 \001(\t\022\014\n\004" + "addr\030\003 \001(\004\022\014\n\004rkey\030\004 \001(\r\022\022\n\ntensor_key\030\005" + " \001(\rB\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 177); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/gdr/gdr.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void RemoteMemoryRegion::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RemoteMemoryRegion::kHostFieldNumber; +const int RemoteMemoryRegion::kPortFieldNumber; +const int RemoteMemoryRegion::kAddrFieldNumber; +const int RemoteMemoryRegion::kRkeyFieldNumber; +const int RemoteMemoryRegion::kTensorKeyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RemoteMemoryRegion::RemoteMemoryRegion() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::scc_info_RemoteMemoryRegion.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.RemoteMemoryRegion) +} +RemoteMemoryRegion::RemoteMemoryRegion(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::scc_info_RemoteMemoryRegion.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.RemoteMemoryRegion) +} +RemoteMemoryRegion::RemoteMemoryRegion(const RemoteMemoryRegion& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + host_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.host().size() > 0) { + host_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host(), + GetArenaNoVirtual()); + } + port_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.port().size() > 0) { + port_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.port(), + GetArenaNoVirtual()); + } + ::memcpy(&addr_, &from.addr_, + static_cast(reinterpret_cast(&tensor_key_) - + reinterpret_cast(&addr_)) + sizeof(tensor_key_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.RemoteMemoryRegion) +} + +void RemoteMemoryRegion::SharedCtor() { + host_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + port_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&addr_, 0, static_cast( + reinterpret_cast(&tensor_key_) - + reinterpret_cast(&addr_)) + sizeof(tensor_key_)); +} + +RemoteMemoryRegion::~RemoteMemoryRegion() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.RemoteMemoryRegion) + SharedDtor(); +} + +void RemoteMemoryRegion::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + host_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + port_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void RemoteMemoryRegion::ArenaDtor(void* object) { + RemoteMemoryRegion* _this = reinterpret_cast< RemoteMemoryRegion* >(object); + (void)_this; +} +void RemoteMemoryRegion::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void RemoteMemoryRegion::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* RemoteMemoryRegion::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const RemoteMemoryRegion& RemoteMemoryRegion::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::scc_info_RemoteMemoryRegion.base); + return *internal_default_instance(); +} + + +void RemoteMemoryRegion::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.RemoteMemoryRegion) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + host_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + port_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&addr_, 0, static_cast( + reinterpret_cast(&tensor_key_) - + reinterpret_cast(&addr_)) + sizeof(tensor_key_)); + _internal_metadata_.Clear(); +} + +bool RemoteMemoryRegion::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.RemoteMemoryRegion) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string host = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_host())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host().data(), static_cast(this->host().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.RemoteMemoryRegion.host")); + } else { + goto handle_unusual; + } + break; + } + + // string port = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_port())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->port().data(), static_cast(this->port().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.RemoteMemoryRegion.port")); + } else { + goto handle_unusual; + } + break; + } + + // uint64 addr = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &addr_))); + } else { + goto handle_unusual; + } + break; + } + + // uint32 rkey = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rkey_))); + } else { + goto handle_unusual; + } + break; + } + + // uint32 tensor_key = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &tensor_key_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.RemoteMemoryRegion) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.RemoteMemoryRegion) + return false; +#undef DO_ +} + +void RemoteMemoryRegion::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.RemoteMemoryRegion) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string host = 1; + if (this->host().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host().data(), static_cast(this->host().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteMemoryRegion.host"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->host(), output); + } + + // string port = 2; + if (this->port().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->port().data(), static_cast(this->port().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteMemoryRegion.port"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->port(), output); + } + + // uint64 addr = 3; + if (this->addr() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->addr(), output); + } + + // uint32 rkey = 4; + if (this->rkey() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->rkey(), output); + } + + // uint32 tensor_key = 5; + if (this->tensor_key() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->tensor_key(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.RemoteMemoryRegion) +} + +::google::protobuf::uint8* RemoteMemoryRegion::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.RemoteMemoryRegion) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string host = 1; + if (this->host().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host().data(), static_cast(this->host().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteMemoryRegion.host"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->host(), target); + } + + // string port = 2; + if (this->port().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->port().data(), static_cast(this->port().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteMemoryRegion.port"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->port(), target); + } + + // uint64 addr = 3; + if (this->addr() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->addr(), target); + } + + // uint32 rkey = 4; + if (this->rkey() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->rkey(), target); + } + + // uint32 tensor_key = 5; + if (this->tensor_key() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->tensor_key(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.RemoteMemoryRegion) + return target; +} + +size_t RemoteMemoryRegion::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.RemoteMemoryRegion) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string host = 1; + if (this->host().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->host()); + } + + // string port = 2; + if (this->port().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->port()); + } + + // uint64 addr = 3; + if (this->addr() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->addr()); + } + + // uint32 rkey = 4; + if (this->rkey() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->rkey()); + } + + // uint32 tensor_key = 5; + if (this->tensor_key() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->tensor_key()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void RemoteMemoryRegion::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.RemoteMemoryRegion) + GOOGLE_DCHECK_NE(&from, this); + const RemoteMemoryRegion* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.RemoteMemoryRegion) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.RemoteMemoryRegion) + MergeFrom(*source); + } +} + +void RemoteMemoryRegion::MergeFrom(const RemoteMemoryRegion& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.RemoteMemoryRegion) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.host().size() > 0) { + set_host(from.host()); + } + if (from.port().size() > 0) { + set_port(from.port()); + } + if (from.addr() != 0) { + set_addr(from.addr()); + } + if (from.rkey() != 0) { + set_rkey(from.rkey()); + } + if (from.tensor_key() != 0) { + set_tensor_key(from.tensor_key()); + } +} + +void RemoteMemoryRegion::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.RemoteMemoryRegion) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RemoteMemoryRegion::CopyFrom(const RemoteMemoryRegion& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.RemoteMemoryRegion) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RemoteMemoryRegion::IsInitialized() const { + return true; +} + +void RemoteMemoryRegion::Swap(RemoteMemoryRegion* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + RemoteMemoryRegion* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void RemoteMemoryRegion::UnsafeArenaSwap(RemoteMemoryRegion* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void RemoteMemoryRegion::InternalSwap(RemoteMemoryRegion* other) { + using std::swap; + host_.Swap(&other->host_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + port_.Swap(&other->port_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(addr_, other->addr_); + swap(rkey_, other->rkey_); + swap(tensor_key_, other->tensor_key_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata RemoteMemoryRegion::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::RemoteMemoryRegion* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::RemoteMemoryRegion >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::RemoteMemoryRegion >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.pb.h new file mode 100644 index 0000000..fbd1022 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.pb.h @@ -0,0 +1,457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/gdr/gdr.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto +namespace diplomacy { +namespace tensorflow { +class RemoteMemoryRegion; +class RemoteMemoryRegionDefaultTypeInternal; +extern RemoteMemoryRegionDefaultTypeInternal _RemoteMemoryRegion_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::RemoteMemoryRegion* Arena::CreateMaybeMessage<::diplomacy::tensorflow::RemoteMemoryRegion>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class RemoteMemoryRegion : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.RemoteMemoryRegion) */ { + public: + RemoteMemoryRegion(); + virtual ~RemoteMemoryRegion(); + + RemoteMemoryRegion(const RemoteMemoryRegion& from); + + inline RemoteMemoryRegion& operator=(const RemoteMemoryRegion& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + RemoteMemoryRegion(RemoteMemoryRegion&& from) noexcept + : RemoteMemoryRegion() { + *this = ::std::move(from); + } + + inline RemoteMemoryRegion& operator=(RemoteMemoryRegion&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const RemoteMemoryRegion& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const RemoteMemoryRegion* internal_default_instance() { + return reinterpret_cast( + &_RemoteMemoryRegion_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(RemoteMemoryRegion* other); + void Swap(RemoteMemoryRegion* other); + friend void swap(RemoteMemoryRegion& a, RemoteMemoryRegion& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline RemoteMemoryRegion* New() const final { + return CreateMaybeMessage(NULL); + } + + RemoteMemoryRegion* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const RemoteMemoryRegion& from); + void MergeFrom(const RemoteMemoryRegion& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RemoteMemoryRegion* other); + protected: + explicit RemoteMemoryRegion(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string host = 1; + void clear_host(); + static const int kHostFieldNumber = 1; + const ::std::string& host() const; + void set_host(const ::std::string& value); + #if LANG_CXX11 + void set_host(::std::string&& value); + #endif + void set_host(const char* value); + void set_host(const char* value, size_t size); + ::std::string* mutable_host(); + ::std::string* release_host(); + void set_allocated_host(::std::string* host); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_host(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_host( + ::std::string* host); + + // string port = 2; + void clear_port(); + static const int kPortFieldNumber = 2; + const ::std::string& port() const; + void set_port(const ::std::string& value); + #if LANG_CXX11 + void set_port(::std::string&& value); + #endif + void set_port(const char* value); + void set_port(const char* value, size_t size); + ::std::string* mutable_port(); + ::std::string* release_port(); + void set_allocated_port(::std::string* port); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_port(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_port( + ::std::string* port); + + // uint64 addr = 3; + void clear_addr(); + static const int kAddrFieldNumber = 3; + ::google::protobuf::uint64 addr() const; + void set_addr(::google::protobuf::uint64 value); + + // uint32 rkey = 4; + void clear_rkey(); + static const int kRkeyFieldNumber = 4; + ::google::protobuf::uint32 rkey() const; + void set_rkey(::google::protobuf::uint32 value); + + // uint32 tensor_key = 5; + void clear_tensor_key(); + static const int kTensorKeyFieldNumber = 5; + ::google::protobuf::uint32 tensor_key() const; + void set_tensor_key(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.RemoteMemoryRegion) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr host_; + ::google::protobuf::internal::ArenaStringPtr port_; + ::google::protobuf::uint64 addr_; + ::google::protobuf::uint32 rkey_; + ::google::protobuf::uint32 tensor_key_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// RemoteMemoryRegion + +// string host = 1; +inline void RemoteMemoryRegion::clear_host() { + host_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& RemoteMemoryRegion::host() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteMemoryRegion.host) + return host_.Get(); +} +inline void RemoteMemoryRegion::set_host(const ::std::string& value) { + + host_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteMemoryRegion.host) +} +#if LANG_CXX11 +inline void RemoteMemoryRegion::set_host(::std::string&& value) { + + host_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.RemoteMemoryRegion.host) +} +#endif +inline void RemoteMemoryRegion::set_host(const char* value) { + GOOGLE_DCHECK(value != NULL); + + host_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.RemoteMemoryRegion.host) +} +inline void RemoteMemoryRegion::set_host(const char* value, + size_t size) { + + host_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.RemoteMemoryRegion.host) +} +inline ::std::string* RemoteMemoryRegion::mutable_host() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteMemoryRegion.host) + return host_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* RemoteMemoryRegion::release_host() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.RemoteMemoryRegion.host) + + return host_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void RemoteMemoryRegion::set_allocated_host(::std::string* host) { + if (host != NULL) { + + } else { + + } + host_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.RemoteMemoryRegion.host) +} +inline ::std::string* RemoteMemoryRegion::unsafe_arena_release_host() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.RemoteMemoryRegion.host) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return host_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void RemoteMemoryRegion::unsafe_arena_set_allocated_host( + ::std::string* host) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (host != NULL) { + + } else { + + } + host_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + host, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.RemoteMemoryRegion.host) +} + +// string port = 2; +inline void RemoteMemoryRegion::clear_port() { + port_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& RemoteMemoryRegion::port() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteMemoryRegion.port) + return port_.Get(); +} +inline void RemoteMemoryRegion::set_port(const ::std::string& value) { + + port_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteMemoryRegion.port) +} +#if LANG_CXX11 +inline void RemoteMemoryRegion::set_port(::std::string&& value) { + + port_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.RemoteMemoryRegion.port) +} +#endif +inline void RemoteMemoryRegion::set_port(const char* value) { + GOOGLE_DCHECK(value != NULL); + + port_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.RemoteMemoryRegion.port) +} +inline void RemoteMemoryRegion::set_port(const char* value, + size_t size) { + + port_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.RemoteMemoryRegion.port) +} +inline ::std::string* RemoteMemoryRegion::mutable_port() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteMemoryRegion.port) + return port_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* RemoteMemoryRegion::release_port() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.RemoteMemoryRegion.port) + + return port_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void RemoteMemoryRegion::set_allocated_port(::std::string* port) { + if (port != NULL) { + + } else { + + } + port_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), port, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.RemoteMemoryRegion.port) +} +inline ::std::string* RemoteMemoryRegion::unsafe_arena_release_port() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.RemoteMemoryRegion.port) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return port_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void RemoteMemoryRegion::unsafe_arena_set_allocated_port( + ::std::string* port) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (port != NULL) { + + } else { + + } + port_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + port, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.RemoteMemoryRegion.port) +} + +// uint64 addr = 3; +inline void RemoteMemoryRegion::clear_addr() { + addr_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 RemoteMemoryRegion::addr() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteMemoryRegion.addr) + return addr_; +} +inline void RemoteMemoryRegion::set_addr(::google::protobuf::uint64 value) { + + addr_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteMemoryRegion.addr) +} + +// uint32 rkey = 4; +inline void RemoteMemoryRegion::clear_rkey() { + rkey_ = 0u; +} +inline ::google::protobuf::uint32 RemoteMemoryRegion::rkey() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteMemoryRegion.rkey) + return rkey_; +} +inline void RemoteMemoryRegion::set_rkey(::google::protobuf::uint32 value) { + + rkey_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteMemoryRegion.rkey) +} + +// uint32 tensor_key = 5; +inline void RemoteMemoryRegion::clear_tensor_key() { + tensor_key_ = 0u; +} +inline ::google::protobuf::uint32 RemoteMemoryRegion::tensor_key() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteMemoryRegion.tensor_key) + return tensor_key_; +} +inline void RemoteMemoryRegion::set_tensor_key(::google::protobuf::uint32 value) { + + tensor_key_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteMemoryRegion.tensor_key) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fgdr_2fgdr_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.proto new file mode 100644 index 0000000..768cc7b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; + +message RemoteMemoryRegion { + string host = 1; + string port = 2; + uint64 addr = 3; + uint32 rkey = 4; + uint32 tensor_key = 5; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr_pb2.py new file mode 100644 index 0000000..d681466 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/gdr/gdr_pb2.py @@ -0,0 +1,98 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/gdr/gdr.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/gdr/gdr.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n*diplomacy_tensorflow/contrib/gdr/gdr.proto\x12\x14\x64iplomacy.tensorflow\"`\n\x12RemoteMemoryRegion\x12\x0c\n\x04host\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\t\x12\x0c\n\x04\x61\x64\x64r\x18\x03 \x01(\x04\x12\x0c\n\x04rkey\x18\x04 \x01(\r\x12\x12\n\ntensor_key\x18\x05 \x01(\rB\x03\xf8\x01\x01\x62\x06proto3') +) + + + + +_REMOTEMEMORYREGION = _descriptor.Descriptor( + name='RemoteMemoryRegion', + full_name='diplomacy.tensorflow.RemoteMemoryRegion', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='host', full_name='diplomacy.tensorflow.RemoteMemoryRegion.host', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='port', full_name='diplomacy.tensorflow.RemoteMemoryRegion.port', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='addr', full_name='diplomacy.tensorflow.RemoteMemoryRegion.addr', index=2, + number=3, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rkey', full_name='diplomacy.tensorflow.RemoteMemoryRegion.rkey', index=3, + number=4, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_key', full_name='diplomacy.tensorflow.RemoteMemoryRegion.tensor_key', index=4, + number=5, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=68, + serialized_end=164, +) + +DESCRIPTOR.message_types_by_name['RemoteMemoryRegion'] = _REMOTEMEMORYREGION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +RemoteMemoryRegion = _reflection.GeneratedProtocolMessageType('RemoteMemoryRegion', (_message.Message,), dict( + DESCRIPTOR = _REMOTEMEMORYREGION, + __module__ = 'diplomacy_tensorflow.contrib.gdr.gdr_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.RemoteMemoryRegion) + )) +_sym_db.RegisterMessage(RemoteMemoryRegion) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.pb.cc new file mode 100644 index 0000000..0b1bd29 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.pb.cc @@ -0,0 +1,593 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/mpi/mpi_msg.proto + +#include "diplomacy_tensorflow/contrib/mpi/mpi_msg.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fworker_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fworker_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_RecvTensorResponse; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fworker_2eproto +namespace diplomacy { +namespace tensorflow { +class MPIRecvTensorResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MPIRecvTensorResponse_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto { +static void InitDefaultsMPIRecvTensorResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MPIRecvTensorResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::MPIRecvTensorResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MPIRecvTensorResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_MPIRecvTensorResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMPIRecvTensorResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fworker_2eproto::scc_info_RecvTensorResponse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_MPIRecvTensorResponse.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MPIRecvTensorResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MPIRecvTensorResponse, response_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MPIRecvTensorResponse, singlesend_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MPIRecvTensorResponse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MPIRecvTensorResponse, step_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MPIRecvTensorResponse, checksum_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::MPIRecvTensorResponse)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_MPIRecvTensorResponse_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/mpi/mpi_msg.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n.diplomacy_tensorflow/contrib/mpi/mpi_m" + "sg.proto\022\024diplomacy.tensorflow\032/diplomac" + "y_tensorflow/core/protobuf/worker.proto\"" + "\227\001\n\025MPIRecvTensorResponse\022:\n\010response\030\001 " + "\001(\0132(.diplomacy.tensorflow.RecvTensorRes" + "ponse\022\022\n\nsingleSend\030\002 \001(\010\022\013\n\003key\030\003 \001(\t\022\017" + "\n\007step_id\030\004 \001(\003\022\020\n\010checksum\030\005 \001(\004B\003\370\001\001b\006" + "proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 286); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/mpi/mpi_msg.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fworker_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void MPIRecvTensorResponse::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_MPIRecvTensorResponse_default_instance_._instance.get_mutable()->response_ = const_cast< ::diplomacy::tensorflow::RecvTensorResponse*>( + ::diplomacy::tensorflow::RecvTensorResponse::internal_default_instance()); +} +void MPIRecvTensorResponse::unsafe_arena_set_allocated_response( + ::diplomacy::tensorflow::RecvTensorResponse* response) { + if (GetArenaNoVirtual() == NULL) { + delete response_; + } + response_ = response; + if (response) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MPIRecvTensorResponse.response) +} +void MPIRecvTensorResponse::clear_response() { + if (GetArenaNoVirtual() == NULL && response_ != NULL) { + delete response_; + } + response_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MPIRecvTensorResponse::kResponseFieldNumber; +const int MPIRecvTensorResponse::kSingleSendFieldNumber; +const int MPIRecvTensorResponse::kKeyFieldNumber; +const int MPIRecvTensorResponse::kStepIdFieldNumber; +const int MPIRecvTensorResponse::kChecksumFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MPIRecvTensorResponse::MPIRecvTensorResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::scc_info_MPIRecvTensorResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MPIRecvTensorResponse) +} +MPIRecvTensorResponse::MPIRecvTensorResponse(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::scc_info_MPIRecvTensorResponse.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MPIRecvTensorResponse) +} +MPIRecvTensorResponse::MPIRecvTensorResponse(const MPIRecvTensorResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.key().size() > 0) { + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key(), + GetArenaNoVirtual()); + } + if (from.has_response()) { + response_ = new ::diplomacy::tensorflow::RecvTensorResponse(*from.response_); + } else { + response_ = NULL; + } + ::memcpy(&step_id_, &from.step_id_, + static_cast(reinterpret_cast(&singlesend_) - + reinterpret_cast(&step_id_)) + sizeof(singlesend_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MPIRecvTensorResponse) +} + +void MPIRecvTensorResponse::SharedCtor() { + key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&response_, 0, static_cast( + reinterpret_cast(&singlesend_) - + reinterpret_cast(&response_)) + sizeof(singlesend_)); +} + +MPIRecvTensorResponse::~MPIRecvTensorResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MPIRecvTensorResponse) + SharedDtor(); +} + +void MPIRecvTensorResponse::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete response_; +} + +void MPIRecvTensorResponse::ArenaDtor(void* object) { + MPIRecvTensorResponse* _this = reinterpret_cast< MPIRecvTensorResponse* >(object); + (void)_this; +} +void MPIRecvTensorResponse::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MPIRecvTensorResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MPIRecvTensorResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MPIRecvTensorResponse& MPIRecvTensorResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::scc_info_MPIRecvTensorResponse.base); + return *internal_default_instance(); +} + + +void MPIRecvTensorResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MPIRecvTensorResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + key_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && response_ != NULL) { + delete response_; + } + response_ = NULL; + ::memset(&step_id_, 0, static_cast( + reinterpret_cast(&singlesend_) - + reinterpret_cast(&step_id_)) + sizeof(singlesend_)); + _internal_metadata_.Clear(); +} + +bool MPIRecvTensorResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MPIRecvTensorResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.RecvTensorResponse response = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_response())); + } else { + goto handle_unusual; + } + break; + } + + // bool singleSend = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &singlesend_))); + } else { + goto handle_unusual; + } + break; + } + + // string key = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_key())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MPIRecvTensorResponse.key")); + } else { + goto handle_unusual; + } + break; + } + + // int64 step_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &step_id_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 checksum = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &checksum_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MPIRecvTensorResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MPIRecvTensorResponse) + return false; +#undef DO_ +} + +void MPIRecvTensorResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MPIRecvTensorResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.RecvTensorResponse response = 1; + if (this->has_response()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_response(), output); + } + + // bool singleSend = 2; + if (this->singlesend() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->singlesend(), output); + } + + // string key = 3; + if (this->key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MPIRecvTensorResponse.key"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->key(), output); + } + + // int64 step_id = 4; + if (this->step_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->step_id(), output); + } + + // uint64 checksum = 5; + if (this->checksum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->checksum(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MPIRecvTensorResponse) +} + +::google::protobuf::uint8* MPIRecvTensorResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MPIRecvTensorResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.RecvTensorResponse response = 1; + if (this->has_response()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_response(), deterministic, target); + } + + // bool singleSend = 2; + if (this->singlesend() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->singlesend(), target); + } + + // string key = 3; + if (this->key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->key().data(), static_cast(this->key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MPIRecvTensorResponse.key"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->key(), target); + } + + // int64 step_id = 4; + if (this->step_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->step_id(), target); + } + + // uint64 checksum = 5; + if (this->checksum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->checksum(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MPIRecvTensorResponse) + return target; +} + +size_t MPIRecvTensorResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MPIRecvTensorResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string key = 3; + if (this->key().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->key()); + } + + // .diplomacy.tensorflow.RecvTensorResponse response = 1; + if (this->has_response()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *response_); + } + + // int64 step_id = 4; + if (this->step_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->step_id()); + } + + // uint64 checksum = 5; + if (this->checksum() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->checksum()); + } + + // bool singleSend = 2; + if (this->singlesend() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MPIRecvTensorResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MPIRecvTensorResponse) + GOOGLE_DCHECK_NE(&from, this); + const MPIRecvTensorResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MPIRecvTensorResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MPIRecvTensorResponse) + MergeFrom(*source); + } +} + +void MPIRecvTensorResponse::MergeFrom(const MPIRecvTensorResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MPIRecvTensorResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.key().size() > 0) { + set_key(from.key()); + } + if (from.has_response()) { + mutable_response()->::diplomacy::tensorflow::RecvTensorResponse::MergeFrom(from.response()); + } + if (from.step_id() != 0) { + set_step_id(from.step_id()); + } + if (from.checksum() != 0) { + set_checksum(from.checksum()); + } + if (from.singlesend() != 0) { + set_singlesend(from.singlesend()); + } +} + +void MPIRecvTensorResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MPIRecvTensorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MPIRecvTensorResponse::CopyFrom(const MPIRecvTensorResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MPIRecvTensorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MPIRecvTensorResponse::IsInitialized() const { + return true; +} + +void MPIRecvTensorResponse::Swap(MPIRecvTensorResponse* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MPIRecvTensorResponse* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MPIRecvTensorResponse::UnsafeArenaSwap(MPIRecvTensorResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MPIRecvTensorResponse::InternalSwap(MPIRecvTensorResponse* other) { + using std::swap; + key_.Swap(&other->key_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(response_, other->response_); + swap(step_id_, other->step_id_); + swap(checksum_, other->checksum_); + swap(singlesend_, other->singlesend_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MPIRecvTensorResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MPIRecvTensorResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MPIRecvTensorResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MPIRecvTensorResponse >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.pb.h new file mode 100644 index 0000000..8550fd8 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.pb.h @@ -0,0 +1,434 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/mpi/mpi_msg.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/protobuf/worker.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto +namespace diplomacy { +namespace tensorflow { +class MPIRecvTensorResponse; +class MPIRecvTensorResponseDefaultTypeInternal; +extern MPIRecvTensorResponseDefaultTypeInternal _MPIRecvTensorResponse_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::MPIRecvTensorResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MPIRecvTensorResponse>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class MPIRecvTensorResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MPIRecvTensorResponse) */ { + public: + MPIRecvTensorResponse(); + virtual ~MPIRecvTensorResponse(); + + MPIRecvTensorResponse(const MPIRecvTensorResponse& from); + + inline MPIRecvTensorResponse& operator=(const MPIRecvTensorResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MPIRecvTensorResponse(MPIRecvTensorResponse&& from) noexcept + : MPIRecvTensorResponse() { + *this = ::std::move(from); + } + + inline MPIRecvTensorResponse& operator=(MPIRecvTensorResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MPIRecvTensorResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MPIRecvTensorResponse* internal_default_instance() { + return reinterpret_cast( + &_MPIRecvTensorResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(MPIRecvTensorResponse* other); + void Swap(MPIRecvTensorResponse* other); + friend void swap(MPIRecvTensorResponse& a, MPIRecvTensorResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MPIRecvTensorResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + MPIRecvTensorResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MPIRecvTensorResponse& from); + void MergeFrom(const MPIRecvTensorResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MPIRecvTensorResponse* other); + protected: + explicit MPIRecvTensorResponse(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string key = 3; + void clear_key(); + static const int kKeyFieldNumber = 3; + const ::std::string& key() const; + void set_key(const ::std::string& value); + #if LANG_CXX11 + void set_key(::std::string&& value); + #endif + void set_key(const char* value); + void set_key(const char* value, size_t size); + ::std::string* mutable_key(); + ::std::string* release_key(); + void set_allocated_key(::std::string* key); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_key(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_key( + ::std::string* key); + + // .diplomacy.tensorflow.RecvTensorResponse response = 1; + bool has_response() const; + void clear_response(); + static const int kResponseFieldNumber = 1; + private: + const ::diplomacy::tensorflow::RecvTensorResponse& _internal_response() const; + public: + const ::diplomacy::tensorflow::RecvTensorResponse& response() const; + ::diplomacy::tensorflow::RecvTensorResponse* release_response(); + ::diplomacy::tensorflow::RecvTensorResponse* mutable_response(); + void set_allocated_response(::diplomacy::tensorflow::RecvTensorResponse* response); + void unsafe_arena_set_allocated_response( + ::diplomacy::tensorflow::RecvTensorResponse* response); + ::diplomacy::tensorflow::RecvTensorResponse* unsafe_arena_release_response(); + + // int64 step_id = 4; + void clear_step_id(); + static const int kStepIdFieldNumber = 4; + ::google::protobuf::int64 step_id() const; + void set_step_id(::google::protobuf::int64 value); + + // uint64 checksum = 5; + void clear_checksum(); + static const int kChecksumFieldNumber = 5; + ::google::protobuf::uint64 checksum() const; + void set_checksum(::google::protobuf::uint64 value); + + // bool singleSend = 2; + void clear_singlesend(); + static const int kSingleSendFieldNumber = 2; + bool singlesend() const; + void set_singlesend(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MPIRecvTensorResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr key_; + ::diplomacy::tensorflow::RecvTensorResponse* response_; + ::google::protobuf::int64 step_id_; + ::google::protobuf::uint64 checksum_; + bool singlesend_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// MPIRecvTensorResponse + +// .diplomacy.tensorflow.RecvTensorResponse response = 1; +inline bool MPIRecvTensorResponse::has_response() const { + return this != internal_default_instance() && response_ != NULL; +} +inline const ::diplomacy::tensorflow::RecvTensorResponse& MPIRecvTensorResponse::_internal_response() const { + return *response_; +} +inline const ::diplomacy::tensorflow::RecvTensorResponse& MPIRecvTensorResponse::response() const { + const ::diplomacy::tensorflow::RecvTensorResponse* p = response_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MPIRecvTensorResponse.response) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_RecvTensorResponse_default_instance_); +} +inline ::diplomacy::tensorflow::RecvTensorResponse* MPIRecvTensorResponse::release_response() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MPIRecvTensorResponse.response) + + ::diplomacy::tensorflow::RecvTensorResponse* temp = response_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + response_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::RecvTensorResponse* MPIRecvTensorResponse::unsafe_arena_release_response() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MPIRecvTensorResponse.response) + + ::diplomacy::tensorflow::RecvTensorResponse* temp = response_; + response_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::RecvTensorResponse* MPIRecvTensorResponse::mutable_response() { + + if (response_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::RecvTensorResponse>(GetArenaNoVirtual()); + response_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MPIRecvTensorResponse.response) + return response_; +} +inline void MPIRecvTensorResponse::set_allocated_response(::diplomacy::tensorflow::RecvTensorResponse* response) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(response_); + } + if (response) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(response)->GetArena(); + if (message_arena != submessage_arena) { + response = ::google::protobuf::internal::GetOwnedMessage( + message_arena, response, submessage_arena); + } + + } else { + + } + response_ = response; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MPIRecvTensorResponse.response) +} + +// bool singleSend = 2; +inline void MPIRecvTensorResponse::clear_singlesend() { + singlesend_ = false; +} +inline bool MPIRecvTensorResponse::singlesend() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MPIRecvTensorResponse.singleSend) + return singlesend_; +} +inline void MPIRecvTensorResponse::set_singlesend(bool value) { + + singlesend_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MPIRecvTensorResponse.singleSend) +} + +// string key = 3; +inline void MPIRecvTensorResponse::clear_key() { + key_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MPIRecvTensorResponse::key() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MPIRecvTensorResponse.key) + return key_.Get(); +} +inline void MPIRecvTensorResponse::set_key(const ::std::string& value) { + + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MPIRecvTensorResponse.key) +} +#if LANG_CXX11 +inline void MPIRecvTensorResponse::set_key(::std::string&& value) { + + key_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MPIRecvTensorResponse.key) +} +#endif +inline void MPIRecvTensorResponse::set_key(const char* value) { + GOOGLE_DCHECK(value != NULL); + + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MPIRecvTensorResponse.key) +} +inline void MPIRecvTensorResponse::set_key(const char* value, + size_t size) { + + key_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MPIRecvTensorResponse.key) +} +inline ::std::string* MPIRecvTensorResponse::mutable_key() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MPIRecvTensorResponse.key) + return key_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MPIRecvTensorResponse::release_key() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MPIRecvTensorResponse.key) + + return key_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MPIRecvTensorResponse::set_allocated_key(::std::string* key) { + if (key != NULL) { + + } else { + + } + key_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), key, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MPIRecvTensorResponse.key) +} +inline ::std::string* MPIRecvTensorResponse::unsafe_arena_release_key() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MPIRecvTensorResponse.key) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return key_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MPIRecvTensorResponse::unsafe_arena_set_allocated_key( + ::std::string* key) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (key != NULL) { + + } else { + + } + key_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + key, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MPIRecvTensorResponse.key) +} + +// int64 step_id = 4; +inline void MPIRecvTensorResponse::clear_step_id() { + step_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MPIRecvTensorResponse::step_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MPIRecvTensorResponse.step_id) + return step_id_; +} +inline void MPIRecvTensorResponse::set_step_id(::google::protobuf::int64 value) { + + step_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MPIRecvTensorResponse.step_id) +} + +// uint64 checksum = 5; +inline void MPIRecvTensorResponse::clear_checksum() { + checksum_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 MPIRecvTensorResponse::checksum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MPIRecvTensorResponse.checksum) + return checksum_; +} +inline void MPIRecvTensorResponse::set_checksum(::google::protobuf::uint64 value) { + + checksum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MPIRecvTensorResponse.checksum) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fmpi_2fmpi_5fmsg_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.proto new file mode 100644 index 0000000..b841a3c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg.proto @@ -0,0 +1,19 @@ + +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; + +import "diplomacy_tensorflow/core/protobuf/worker.proto"; + + +message MPIRecvTensorResponse { + RecvTensorResponse response = 1; + bool singleSend = 2; + string key = 3; + int64 step_id = 4; + uint64 checksum = 5; +} + + + diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg_pb2.py new file mode 100644 index 0000000..827b89d --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi/mpi_msg_pb2.py @@ -0,0 +1,101 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/mpi/mpi_msg.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.protobuf import worker_pb2 as diplomacy__tensorflow_dot_core_dot_protobuf_dot_worker__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/mpi/mpi_msg.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n.diplomacy_tensorflow/contrib/mpi/mpi_msg.proto\x12\x14\x64iplomacy.tensorflow\x1a/diplomacy_tensorflow/core/protobuf/worker.proto\"\x97\x01\n\x15MPIRecvTensorResponse\x12:\n\x08response\x18\x01 \x01(\x0b\x32(.diplomacy.tensorflow.RecvTensorResponse\x12\x12\n\nsingleSend\x18\x02 \x01(\x08\x12\x0b\n\x03key\x18\x03 \x01(\t\x12\x0f\n\x07step_id\x18\x04 \x01(\x03\x12\x10\n\x08\x63hecksum\x18\x05 \x01(\x04\x42\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_protobuf_dot_worker__pb2.DESCRIPTOR,]) + + + + +_MPIRECVTENSORRESPONSE = _descriptor.Descriptor( + name='MPIRecvTensorResponse', + full_name='diplomacy.tensorflow.MPIRecvTensorResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='response', full_name='diplomacy.tensorflow.MPIRecvTensorResponse.response', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='singleSend', full_name='diplomacy.tensorflow.MPIRecvTensorResponse.singleSend', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.MPIRecvTensorResponse.key', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='step_id', full_name='diplomacy.tensorflow.MPIRecvTensorResponse.step_id', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='checksum', full_name='diplomacy.tensorflow.MPIRecvTensorResponse.checksum', index=4, + number=5, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=122, + serialized_end=273, +) + +_MPIRECVTENSORRESPONSE.fields_by_name['response'].message_type = diplomacy__tensorflow_dot_core_dot_protobuf_dot_worker__pb2._RECVTENSORRESPONSE +DESCRIPTOR.message_types_by_name['MPIRecvTensorResponse'] = _MPIRECVTENSORRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +MPIRecvTensorResponse = _reflection.GeneratedProtocolMessageType('MPIRecvTensorResponse', (_message.Message,), dict( + DESCRIPTOR = _MPIRECVTENSORRESPONSE, + __module__ = 'diplomacy_tensorflow.contrib.mpi.mpi_msg_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MPIRecvTensorResponse) + )) +_sym_db.RegisterMessage(MPIRecvTensorResponse) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.pb.cc new file mode 100644 index 0000000..347ab8b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.pb.cc @@ -0,0 +1,1000 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto + +#include "diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +namespace contrib { +namespace mpi_collectives { +class MPIRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MPIRequest_default_instance_; +class MPIResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MPIResponse_default_instance_; +} // namespace mpi_collectives +} // namespace contrib +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto { +static void InitDefaultsMPIRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::contrib::mpi_collectives::_MPIRequest_default_instance_; + new (ptr) ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_MPIRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMPIRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base,}}; + +static void InitDefaultsMPIResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::contrib::mpi_collectives::_MPIResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MPIResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMPIResponse}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_MPIRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_MPIResponse.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest, request_rank_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest, request_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest, tensor_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest, tensor_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest, tensor_shape_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse, response_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse, tensor_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse, error_message_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest)}, + { 10, -1, sizeof(::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::contrib::mpi_collectives::_MPIRequest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::contrib::mpi_collectives::_MPIResponse_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n>diplomacy_tensorflow/contrib/mpi_colle" + "ctives/mpi_message.proto\022,diplomacy.tens" + "orflow.contrib.mpi_collectives\0326diplomac" + "y_tensorflow/core/framework/tensor_shape" + ".proto\032/diplomacy_tensorflow/core/framew" + "ork/types.proto\"\263\002\n\nMPIRequest\022\024\n\014reques" + "t_rank\030\001 \001(\005\022Z\n\014request_type\030\002 \001(\0162D.dip" + "lomacy.tensorflow.contrib.mpi_collective" + "s.MPIRequest.RequestType\0223\n\013tensor_type\030" + "\003 \001(\0162\036.diplomacy.tensorflow.DataType\022\023\n" + "\013tensor_name\030\004 \001(\t\022<\n\014tensor_shape\030\005 \001(\013" + "2&.diplomacy.tensorflow.TensorShapeProto" + "\"+\n\013RequestType\022\r\n\tALLREDUCE\020\000\022\r\n\tALLGAT" + "HER\020\001\"\351\001\n\013MPIResponse\022]\n\rresponse_type\030\001" + " \001(\0162F.diplomacy.tensorflow.contrib.mpi_" + "collectives.MPIResponse.ResponseType\022\023\n\013" + "tensor_name\030\002 \001(\t\022\025\n\rerror_message\030\003 \001(\t" + "\"O\n\014ResponseType\022\r\n\tALLREDUCE\020\000\022\r\n\tALLGA" + "THER\020\001\022\t\n\005ERROR\020\002\022\010\n\004DONE\020\003\022\014\n\010SHUTDOWN\020" + "\004b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 769); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto +namespace diplomacy { +namespace tensorflow { +namespace contrib { +namespace mpi_collectives { +const ::google::protobuf::EnumDescriptor* MPIRequest_RequestType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::file_level_enum_descriptors[0]; +} +bool MPIRequest_RequestType_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const MPIRequest_RequestType MPIRequest::ALLREDUCE; +const MPIRequest_RequestType MPIRequest::ALLGATHER; +const MPIRequest_RequestType MPIRequest::RequestType_MIN; +const MPIRequest_RequestType MPIRequest::RequestType_MAX; +const int MPIRequest::RequestType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* MPIResponse_ResponseType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::file_level_enum_descriptors[1]; +} +bool MPIResponse_ResponseType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const MPIResponse_ResponseType MPIResponse::ALLREDUCE; +const MPIResponse_ResponseType MPIResponse::ALLGATHER; +const MPIResponse_ResponseType MPIResponse::ERROR; +const MPIResponse_ResponseType MPIResponse::DONE; +const MPIResponse_ResponseType MPIResponse::SHUTDOWN; +const MPIResponse_ResponseType MPIResponse::ResponseType_MIN; +const MPIResponse_ResponseType MPIResponse::ResponseType_MAX; +const int MPIResponse::ResponseType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void MPIRequest::InitAsDefaultInstance() { + ::diplomacy::tensorflow::contrib::mpi_collectives::_MPIRequest_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); +} +void MPIRequest::clear_tensor_shape() { + if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) { + delete tensor_shape_; + } + tensor_shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MPIRequest::kRequestRankFieldNumber; +const int MPIRequest::kRequestTypeFieldNumber; +const int MPIRequest::kTensorTypeFieldNumber; +const int MPIRequest::kTensorNameFieldNumber; +const int MPIRequest::kTensorShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MPIRequest::MPIRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::scc_info_MPIRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) +} +MPIRequest::MPIRequest(const MPIRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tensor_name().size() > 0) { + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } + if (from.has_tensor_shape()) { + tensor_shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.tensor_shape_); + } else { + tensor_shape_ = NULL; + } + ::memcpy(&request_rank_, &from.request_rank_, + static_cast(reinterpret_cast(&tensor_type_) - + reinterpret_cast(&request_rank_)) + sizeof(tensor_type_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) +} + +void MPIRequest::SharedCtor() { + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&tensor_shape_, 0, static_cast( + reinterpret_cast(&tensor_type_) - + reinterpret_cast(&tensor_shape_)) + sizeof(tensor_type_)); +} + +MPIRequest::~MPIRequest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + SharedDtor(); +} + +void MPIRequest::SharedDtor() { + tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete tensor_shape_; +} + +void MPIRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MPIRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MPIRequest& MPIRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::scc_info_MPIRequest.base); + return *internal_default_instance(); +} + + +void MPIRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) { + delete tensor_shape_; + } + tensor_shape_ = NULL; + ::memset(&request_rank_, 0, static_cast( + reinterpret_cast(&tensor_type_) - + reinterpret_cast(&request_rank_)) + sizeof(tensor_type_)); + _internal_metadata_.Clear(); +} + +bool MPIRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 request_rank = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &request_rank_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType request_type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_request_type(static_cast< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType tensor_type = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_tensor_type(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string tensor_name = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor_shape())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + return false; +#undef DO_ +} + +void MPIRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 request_rank = 1; + if (this->request_rank() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->request_rank(), output); + } + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType request_type = 2; + if (this->request_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->request_type(), output); + } + + // .diplomacy.tensorflow.DataType tensor_type = 3; + if (this->tensor_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->tensor_type(), output); + } + + // string tensor_name = 4; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->tensor_name(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 5; + if (this->has_tensor_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_tensor_shape(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) +} + +::google::protobuf::uint8* MPIRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 request_rank = 1; + if (this->request_rank() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->request_rank(), target); + } + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType request_type = 2; + if (this->request_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->request_type(), target); + } + + // .diplomacy.tensorflow.DataType tensor_type = 3; + if (this->tensor_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->tensor_type(), target); + } + + // string tensor_name = 4; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->tensor_name(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 5; + if (this->has_tensor_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_tensor_shape(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + return target; +} + +size_t MPIRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string tensor_name = 4; + if (this->tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tensor_name()); + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 5; + if (this->has_tensor_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tensor_shape_); + } + + // int32 request_rank = 1; + if (this->request_rank() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->request_rank()); + } + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType request_type = 2; + if (this->request_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->request_type()); + } + + // .diplomacy.tensorflow.DataType tensor_type = 3; + if (this->tensor_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->tensor_type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MPIRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + GOOGLE_DCHECK_NE(&from, this); + const MPIRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + MergeFrom(*source); + } +} + +void MPIRequest::MergeFrom(const MPIRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.tensor_name().size() > 0) { + + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } + if (from.has_tensor_shape()) { + mutable_tensor_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape()); + } + if (from.request_rank() != 0) { + set_request_rank(from.request_rank()); + } + if (from.request_type() != 0) { + set_request_type(from.request_type()); + } + if (from.tensor_type() != 0) { + set_tensor_type(from.tensor_type()); + } +} + +void MPIRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MPIRequest::CopyFrom(const MPIRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MPIRequest::IsInitialized() const { + return true; +} + +void MPIRequest::Swap(MPIRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void MPIRequest::InternalSwap(MPIRequest* other) { + using std::swap; + tensor_name_.Swap(&other->tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(tensor_shape_, other->tensor_shape_); + swap(request_rank_, other->request_rank_); + swap(request_type_, other->request_type_); + swap(tensor_type_, other->tensor_type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MPIRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MPIResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MPIResponse::kResponseTypeFieldNumber; +const int MPIResponse::kTensorNameFieldNumber; +const int MPIResponse::kErrorMessageFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MPIResponse::MPIResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::scc_info_MPIResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) +} +MPIResponse::MPIResponse(const MPIResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tensor_name().size() > 0) { + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.error_message().size() > 0) { + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + response_type_ = from.response_type_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) +} + +void MPIResponse::SharedCtor() { + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + response_type_ = 0; +} + +MPIResponse::~MPIResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + SharedDtor(); +} + +void MPIResponse::SharedDtor() { + tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void MPIResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MPIResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MPIResponse& MPIResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::scc_info_MPIResponse.base); + return *internal_default_instance(); +} + + +void MPIResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + response_type_ = 0; + _internal_metadata_.Clear(); +} + +bool MPIResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType response_type = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_response_type(static_cast< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string tensor_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + // string error_message = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_error_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + return false; +#undef DO_ +} + +void MPIResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType response_type = 1; + if (this->response_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->response_type(), output); + } + + // string tensor_name = 2; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->tensor_name(), output); + } + + // string error_message = 3; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->error_message(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) +} + +::google::protobuf::uint8* MPIResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType response_type = 1; + if (this->response_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->response_type(), target); + } + + // string tensor_name = 2; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->tensor_name(), target); + } + + // string error_message = 3; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->error_message(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + return target; +} + +size_t MPIResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string tensor_name = 2; + if (this->tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tensor_name()); + } + + // string error_message = 3; + if (this->error_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->error_message()); + } + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType response_type = 1; + if (this->response_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->response_type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MPIResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + GOOGLE_DCHECK_NE(&from, this); + const MPIResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + MergeFrom(*source); + } +} + +void MPIResponse::MergeFrom(const MPIResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.tensor_name().size() > 0) { + + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } + if (from.error_message().size() > 0) { + + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + if (from.response_type() != 0) { + set_response_type(from.response_type()); + } +} + +void MPIResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MPIResponse::CopyFrom(const MPIResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MPIResponse::IsInitialized() const { + return true; +} + +void MPIResponse::Swap(MPIResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void MPIResponse::InternalSwap(MPIResponse* other) { + using std::swap; + tensor_name_.Swap(&other->tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + error_message_.Swap(&other->error_message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(response_type_, other->response_type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MPIResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace mpi_collectives +} // namespace contrib +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.pb.h new file mode 100644 index 0000000..3e916e1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.pb.h @@ -0,0 +1,768 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto +namespace diplomacy { +namespace tensorflow { +namespace contrib { +namespace mpi_collectives { +class MPIRequest; +class MPIRequestDefaultTypeInternal; +extern MPIRequestDefaultTypeInternal _MPIRequest_default_instance_; +class MPIResponse; +class MPIResponseDefaultTypeInternal; +extern MPIResponseDefaultTypeInternal _MPIResponse_default_instance_; +} // namespace mpi_collectives +} // namespace contrib +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest>(Arena*); +template<> ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace contrib { +namespace mpi_collectives { + +enum MPIRequest_RequestType { + MPIRequest_RequestType_ALLREDUCE = 0, + MPIRequest_RequestType_ALLGATHER = 1, + MPIRequest_RequestType_MPIRequest_RequestType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + MPIRequest_RequestType_MPIRequest_RequestType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool MPIRequest_RequestType_IsValid(int value); +const MPIRequest_RequestType MPIRequest_RequestType_RequestType_MIN = MPIRequest_RequestType_ALLREDUCE; +const MPIRequest_RequestType MPIRequest_RequestType_RequestType_MAX = MPIRequest_RequestType_ALLGATHER; +const int MPIRequest_RequestType_RequestType_ARRAYSIZE = MPIRequest_RequestType_RequestType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* MPIRequest_RequestType_descriptor(); +inline const ::std::string& MPIRequest_RequestType_Name(MPIRequest_RequestType value) { + return ::google::protobuf::internal::NameOfEnum( + MPIRequest_RequestType_descriptor(), value); +} +inline bool MPIRequest_RequestType_Parse( + const ::std::string& name, MPIRequest_RequestType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + MPIRequest_RequestType_descriptor(), name, value); +} +enum MPIResponse_ResponseType { + MPIResponse_ResponseType_ALLREDUCE = 0, + MPIResponse_ResponseType_ALLGATHER = 1, + MPIResponse_ResponseType_ERROR = 2, + MPIResponse_ResponseType_DONE = 3, + MPIResponse_ResponseType_SHUTDOWN = 4, + MPIResponse_ResponseType_MPIResponse_ResponseType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + MPIResponse_ResponseType_MPIResponse_ResponseType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool MPIResponse_ResponseType_IsValid(int value); +const MPIResponse_ResponseType MPIResponse_ResponseType_ResponseType_MIN = MPIResponse_ResponseType_ALLREDUCE; +const MPIResponse_ResponseType MPIResponse_ResponseType_ResponseType_MAX = MPIResponse_ResponseType_SHUTDOWN; +const int MPIResponse_ResponseType_ResponseType_ARRAYSIZE = MPIResponse_ResponseType_ResponseType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* MPIResponse_ResponseType_descriptor(); +inline const ::std::string& MPIResponse_ResponseType_Name(MPIResponse_ResponseType value) { + return ::google::protobuf::internal::NameOfEnum( + MPIResponse_ResponseType_descriptor(), value); +} +inline bool MPIResponse_ResponseType_Parse( + const ::std::string& name, MPIResponse_ResponseType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + MPIResponse_ResponseType_descriptor(), name, value); +} +// =================================================================== + +class MPIRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) */ { + public: + MPIRequest(); + virtual ~MPIRequest(); + + MPIRequest(const MPIRequest& from); + + inline MPIRequest& operator=(const MPIRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MPIRequest(MPIRequest&& from) noexcept + : MPIRequest() { + *this = ::std::move(from); + } + + inline MPIRequest& operator=(MPIRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MPIRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MPIRequest* internal_default_instance() { + return reinterpret_cast( + &_MPIRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(MPIRequest* other); + friend void swap(MPIRequest& a, MPIRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MPIRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + MPIRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MPIRequest& from); + void MergeFrom(const MPIRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MPIRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef MPIRequest_RequestType RequestType; + static const RequestType ALLREDUCE = + MPIRequest_RequestType_ALLREDUCE; + static const RequestType ALLGATHER = + MPIRequest_RequestType_ALLGATHER; + static inline bool RequestType_IsValid(int value) { + return MPIRequest_RequestType_IsValid(value); + } + static const RequestType RequestType_MIN = + MPIRequest_RequestType_RequestType_MIN; + static const RequestType RequestType_MAX = + MPIRequest_RequestType_RequestType_MAX; + static const int RequestType_ARRAYSIZE = + MPIRequest_RequestType_RequestType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + RequestType_descriptor() { + return MPIRequest_RequestType_descriptor(); + } + static inline const ::std::string& RequestType_Name(RequestType value) { + return MPIRequest_RequestType_Name(value); + } + static inline bool RequestType_Parse(const ::std::string& name, + RequestType* value) { + return MPIRequest_RequestType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // string tensor_name = 4; + void clear_tensor_name(); + static const int kTensorNameFieldNumber = 4; + const ::std::string& tensor_name() const; + void set_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_tensor_name(::std::string&& value); + #endif + void set_tensor_name(const char* value); + void set_tensor_name(const char* value, size_t size); + ::std::string* mutable_tensor_name(); + ::std::string* release_tensor_name(); + void set_allocated_tensor_name(::std::string* tensor_name); + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 5; + bool has_tensor_shape() const; + void clear_tensor_shape(); + static const int kTensorShapeFieldNumber = 5; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_tensor_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& tensor_shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_tensor_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_tensor_shape(); + void set_allocated_tensor_shape(::diplomacy::tensorflow::TensorShapeProto* tensor_shape); + + // int32 request_rank = 1; + void clear_request_rank(); + static const int kRequestRankFieldNumber = 1; + ::google::protobuf::int32 request_rank() const; + void set_request_rank(::google::protobuf::int32 value); + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType request_type = 2; + void clear_request_type(); + static const int kRequestTypeFieldNumber = 2; + ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType request_type() const; + void set_request_type(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType value); + + // .diplomacy.tensorflow.DataType tensor_type = 3; + void clear_tensor_type(); + static const int kTensorTypeFieldNumber = 3; + ::diplomacy::tensorflow::DataType tensor_type() const; + void set_tensor_type(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr tensor_name_; + ::diplomacy::tensorflow::TensorShapeProto* tensor_shape_; + ::google::protobuf::int32 request_rank_; + int request_type_; + int tensor_type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MPIResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) */ { + public: + MPIResponse(); + virtual ~MPIResponse(); + + MPIResponse(const MPIResponse& from); + + inline MPIResponse& operator=(const MPIResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MPIResponse(MPIResponse&& from) noexcept + : MPIResponse() { + *this = ::std::move(from); + } + + inline MPIResponse& operator=(MPIResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MPIResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MPIResponse* internal_default_instance() { + return reinterpret_cast( + &_MPIResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(MPIResponse* other); + friend void swap(MPIResponse& a, MPIResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MPIResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + MPIResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MPIResponse& from); + void MergeFrom(const MPIResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MPIResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef MPIResponse_ResponseType ResponseType; + static const ResponseType ALLREDUCE = + MPIResponse_ResponseType_ALLREDUCE; + static const ResponseType ALLGATHER = + MPIResponse_ResponseType_ALLGATHER; + static const ResponseType ERROR = + MPIResponse_ResponseType_ERROR; + static const ResponseType DONE = + MPIResponse_ResponseType_DONE; + static const ResponseType SHUTDOWN = + MPIResponse_ResponseType_SHUTDOWN; + static inline bool ResponseType_IsValid(int value) { + return MPIResponse_ResponseType_IsValid(value); + } + static const ResponseType ResponseType_MIN = + MPIResponse_ResponseType_ResponseType_MIN; + static const ResponseType ResponseType_MAX = + MPIResponse_ResponseType_ResponseType_MAX; + static const int ResponseType_ARRAYSIZE = + MPIResponse_ResponseType_ResponseType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + ResponseType_descriptor() { + return MPIResponse_ResponseType_descriptor(); + } + static inline const ::std::string& ResponseType_Name(ResponseType value) { + return MPIResponse_ResponseType_Name(value); + } + static inline bool ResponseType_Parse(const ::std::string& name, + ResponseType* value) { + return MPIResponse_ResponseType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // string tensor_name = 2; + void clear_tensor_name(); + static const int kTensorNameFieldNumber = 2; + const ::std::string& tensor_name() const; + void set_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_tensor_name(::std::string&& value); + #endif + void set_tensor_name(const char* value); + void set_tensor_name(const char* value, size_t size); + ::std::string* mutable_tensor_name(); + ::std::string* release_tensor_name(); + void set_allocated_tensor_name(::std::string* tensor_name); + + // string error_message = 3; + void clear_error_message(); + static const int kErrorMessageFieldNumber = 3; + const ::std::string& error_message() const; + void set_error_message(const ::std::string& value); + #if LANG_CXX11 + void set_error_message(::std::string&& value); + #endif + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + ::std::string* mutable_error_message(); + ::std::string* release_error_message(); + void set_allocated_error_message(::std::string* error_message); + + // .diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType response_type = 1; + void clear_response_type(); + static const int kResponseTypeFieldNumber = 1; + ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType response_type() const; + void set_response_type(::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr tensor_name_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + int response_type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// MPIRequest + +// int32 request_rank = 1; +inline void MPIRequest::clear_request_rank() { + request_rank_ = 0; +} +inline ::google::protobuf::int32 MPIRequest::request_rank() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.request_rank) + return request_rank_; +} +inline void MPIRequest::set_request_rank(::google::protobuf::int32 value) { + + request_rank_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.request_rank) +} + +// .diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType request_type = 2; +inline void MPIRequest::clear_request_type() { + request_type_ = 0; +} +inline ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType MPIRequest::request_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.request_type) + return static_cast< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType >(request_type_); +} +inline void MPIRequest::set_request_type(::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType value) { + + request_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.request_type) +} + +// .diplomacy.tensorflow.DataType tensor_type = 3; +inline void MPIRequest::clear_tensor_type() { + tensor_type_ = 0; +} +inline ::diplomacy::tensorflow::DataType MPIRequest::tensor_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_type) + return static_cast< ::diplomacy::tensorflow::DataType >(tensor_type_); +} +inline void MPIRequest::set_tensor_type(::diplomacy::tensorflow::DataType value) { + + tensor_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_type) +} + +// string tensor_name = 4; +inline void MPIRequest::clear_tensor_name() { + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& MPIRequest::tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) + return tensor_name_.GetNoArena(); +} +inline void MPIRequest::set_tensor_name(const ::std::string& value) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) +} +#if LANG_CXX11 +inline void MPIRequest::set_tensor_name(::std::string&& value) { + + tensor_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) +} +#endif +inline void MPIRequest::set_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) +} +inline void MPIRequest::set_tensor_name(const char* value, size_t size) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) +} +inline ::std::string* MPIRequest::mutable_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) + return tensor_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* MPIRequest::release_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) + + return tensor_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MPIRequest::set_allocated_tensor_name(::std::string* tensor_name) { + if (tensor_name != NULL) { + + } else { + + } + tensor_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name) +} + +// .diplomacy.tensorflow.TensorShapeProto tensor_shape = 5; +inline bool MPIRequest::has_tensor_shape() const { + return this != internal_default_instance() && tensor_shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& MPIRequest::_internal_tensor_shape() const { + return *tensor_shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& MPIRequest::tensor_shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = tensor_shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* MPIRequest::release_tensor_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = tensor_shape_; + tensor_shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* MPIRequest::mutable_tensor_shape() { + + if (tensor_shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + tensor_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_shape) + return tensor_shape_; +} +inline void MPIRequest::set_allocated_tensor_shape(::diplomacy::tensorflow::TensorShapeProto* tensor_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_shape_); + } + if (tensor_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor_shape)->GetArena(); + if (message_arena != submessage_arena) { + tensor_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor_shape, submessage_arena); + } + + } else { + + } + tensor_shape_ = tensor_shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_shape) +} + +// ------------------------------------------------------------------- + +// MPIResponse + +// .diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType response_type = 1; +inline void MPIResponse::clear_response_type() { + response_type_ = 0; +} +inline ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType MPIResponse::response_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.response_type) + return static_cast< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType >(response_type_); +} +inline void MPIResponse::set_response_type(::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType value) { + + response_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.response_type) +} + +// string tensor_name = 2; +inline void MPIResponse::clear_tensor_name() { + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& MPIResponse::tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) + return tensor_name_.GetNoArena(); +} +inline void MPIResponse::set_tensor_name(const ::std::string& value) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) +} +#if LANG_CXX11 +inline void MPIResponse::set_tensor_name(::std::string&& value) { + + tensor_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) +} +#endif +inline void MPIResponse::set_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) +} +inline void MPIResponse::set_tensor_name(const char* value, size_t size) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) +} +inline ::std::string* MPIResponse::mutable_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) + return tensor_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* MPIResponse::release_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) + + return tensor_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MPIResponse::set_allocated_tensor_name(::std::string* tensor_name) { + if (tensor_name != NULL) { + + } else { + + } + tensor_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name) +} + +// string error_message = 3; +inline void MPIResponse::clear_error_message() { + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& MPIResponse::error_message() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) + return error_message_.GetNoArena(); +} +inline void MPIResponse::set_error_message(const ::std::string& value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) +} +#if LANG_CXX11 +inline void MPIResponse::set_error_message(::std::string&& value) { + + error_message_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) +} +#endif +inline void MPIResponse::set_error_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) +} +inline void MPIResponse::set_error_message(const char* value, size_t size) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) +} +inline ::std::string* MPIResponse::mutable_error_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) + return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* MPIResponse::release_error_message() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) + + return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MPIResponse::set_allocated_error_message(::std::string* error_message) { + if (error_message != NULL) { + + } else { + + } + error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace mpi_collectives +} // namespace contrib +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType>() { + return ::diplomacy::tensorflow::contrib::mpi_collectives::MPIRequest_RequestType_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType>() { + return ::diplomacy::tensorflow::contrib::mpi_collectives::MPIResponse_ResponseType_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fmpi_5fcollectives_2fmpi_5fmessage_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto new file mode 100644 index 0000000..f7edb04 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto @@ -0,0 +1,64 @@ +/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +package diplomacy.tensorflow.contrib.mpi_collectives; + +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +// An MPIRequest is a message sent from a rank greater than zero to the +// coordinator (rank zero), informing the coordinator of an operation that +// the rank wants to do and the tensor that it wants to apply the operation to. +message MPIRequest { + enum RequestType { + ALLREDUCE = 0; + ALLGATHER = 1; + } + + // The request rank is necessary to create a consistent ordering of results, + // for example in the allgather where the order of outputs should be sorted + // by rank. + int32 request_rank = 1; + RequestType request_type = 2; + DataType tensor_type = 3; + string tensor_name = 4; + TensorShapeProto tensor_shape = 5; +}; + +// An MPIResponse is a message sent from the coordinator (rank zero) to a rank +// greater than zero, informing the rank of an operation should be performed +// now. If the operation requested would result in an error (for example, due +// to a type or shape mismatch), then the MPIResponse can contain an error and +// an error message instead. Finally, an MPIResponse can be a DONE message (if +// there are no more tensors to reduce on this tick of the background loop) or +// SHUTDOWN if all MPI processes should shut down. +message MPIResponse { + enum ResponseType { + ALLREDUCE = 0; + ALLGATHER = 1; + ERROR = 2; + DONE = 3; + SHUTDOWN = 4; + } + + // Empty if the type is DONE or SHUTDOWN. + ResponseType response_type = 1; + string tensor_name = 2; + + // Empty unless response_type is ERROR. + string error_message = 3; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message_pb2.py new file mode 100644 index 0000000..79c5690 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/mpi_collectives/mpi_message_pb2.py @@ -0,0 +1,217 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto', + package='diplomacy.tensorflow.contrib.mpi_collectives', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n>diplomacy_tensorflow/contrib/mpi_collectives/mpi_message.proto\x12,diplomacy.tensorflow.contrib.mpi_collectives\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"\xb3\x02\n\nMPIRequest\x12\x14\n\x0crequest_rank\x18\x01 \x01(\x05\x12Z\n\x0crequest_type\x18\x02 \x01(\x0e\x32\x44.diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType\x12\x33\n\x0btensor_type\x18\x03 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\x12\x13\n\x0btensor_name\x18\x04 \x01(\t\x12<\n\x0ctensor_shape\x18\x05 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProto\"+\n\x0bRequestType\x12\r\n\tALLREDUCE\x10\x00\x12\r\n\tALLGATHER\x10\x01\"\xe9\x01\n\x0bMPIResponse\x12]\n\rresponse_type\x18\x01 \x01(\x0e\x32\x46.diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType\x12\x13\n\x0btensor_name\x18\x02 \x01(\t\x12\x15\n\rerror_message\x18\x03 \x01(\t\"O\n\x0cResponseType\x12\r\n\tALLREDUCE\x10\x00\x12\r\n\tALLGATHER\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\x0c\n\x08SHUTDOWN\x10\x04\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + +_MPIREQUEST_REQUESTTYPE = _descriptor.EnumDescriptor( + name='RequestType', + full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.RequestType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ALLREDUCE', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ALLGATHER', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=482, + serialized_end=525, +) +_sym_db.RegisterEnumDescriptor(_MPIREQUEST_REQUESTTYPE) + +_MPIRESPONSE_RESPONSETYPE = _descriptor.EnumDescriptor( + name='ResponseType', + full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.ResponseType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ALLREDUCE', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ALLGATHER', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ERROR', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DONE', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SHUTDOWN', index=4, number=4, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=682, + serialized_end=761, +) +_sym_db.RegisterEnumDescriptor(_MPIRESPONSE_RESPONSETYPE) + + +_MPIREQUEST = _descriptor.Descriptor( + name='MPIRequest', + full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='request_rank', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.request_rank', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='request_type', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.request_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_type', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_type', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_name', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_name', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_shape', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest.tensor_shape', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _MPIREQUEST_REQUESTTYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=218, + serialized_end=525, +) + + +_MPIRESPONSE = _descriptor.Descriptor( + name='MPIResponse', + full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='response_type', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.response_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_name', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.tensor_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='error_message', full_name='diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse.error_message', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _MPIRESPONSE_RESPONSETYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=528, + serialized_end=761, +) + +_MPIREQUEST.fields_by_name['request_type'].enum_type = _MPIREQUEST_REQUESTTYPE +_MPIREQUEST.fields_by_name['tensor_type'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_MPIREQUEST.fields_by_name['tensor_shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_MPIREQUEST_REQUESTTYPE.containing_type = _MPIREQUEST +_MPIRESPONSE.fields_by_name['response_type'].enum_type = _MPIRESPONSE_RESPONSETYPE +_MPIRESPONSE_RESPONSETYPE.containing_type = _MPIRESPONSE +DESCRIPTOR.message_types_by_name['MPIRequest'] = _MPIREQUEST +DESCRIPTOR.message_types_by_name['MPIResponse'] = _MPIRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +MPIRequest = _reflection.GeneratedProtocolMessageType('MPIRequest', (_message.Message,), dict( + DESCRIPTOR = _MPIREQUEST, + __module__ = 'diplomacy_tensorflow.contrib.mpi_collectives.mpi_message_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.contrib.mpi_collectives.MPIRequest) + )) +_sym_db.RegisterMessage(MPIRequest) + +MPIResponse = _reflection.GeneratedProtocolMessageType('MPIResponse', (_message.Message,), dict( + DESCRIPTOR = _MPIRESPONSE, + __module__ = 'diplomacy_tensorflow.contrib.mpi_collectives.mpi_message_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.contrib.mpi_collectives.MPIResponse) + )) +_sym_db.RegisterMessage(MPIResponse) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.pb.cc new file mode 100644 index 0000000..4df1303 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.pb.cc @@ -0,0 +1,2735 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/session_bundle/manifest.proto + +#include "diplomacy_tensorflow/contrib/session_bundle/manifest.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TensorBinding; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ClassificationSignature; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_GenericSignature; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_GenericSignature_MapEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_RegressionSignature; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Signatures_NamedSignaturesEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Signature; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto +namespace diplomacy { +namespace tensorflow { +namespace serving { +class Signatures_NamedSignaturesEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Signatures_NamedSignaturesEntry_DoNotUse_default_instance_; +class SignaturesDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Signatures_default_instance_; +class TensorBindingDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorBinding_default_instance_; +class AssetFileDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AssetFile_default_instance_; +class SignatureDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::serving::RegressionSignature* regression_signature_; + const ::diplomacy::tensorflow::serving::ClassificationSignature* classification_signature_; + const ::diplomacy::tensorflow::serving::GenericSignature* generic_signature_; +} _Signature_default_instance_; +class RegressionSignatureDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _RegressionSignature_default_instance_; +class ClassificationSignatureDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ClassificationSignature_default_instance_; +class GenericSignature_MapEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GenericSignature_MapEntry_DoNotUse_default_instance_; +class GenericSignatureDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GenericSignature_default_instance_; +} // namespace serving +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto { +static void InitDefaultsSignatures_NamedSignaturesEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_Signatures_NamedSignaturesEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse(); + } + ::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Signatures_NamedSignaturesEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSignatures_NamedSignaturesEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_Signature.base,}}; + +static void InitDefaultsSignatures() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_Signatures_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::Signatures(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::serving::Signatures::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_Signatures = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsSignatures}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_Signature.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_Signatures_NamedSignaturesEntry_DoNotUse.base,}}; + +static void InitDefaultsTensorBinding() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_TensorBinding_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::TensorBinding(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::serving::TensorBinding::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TensorBinding = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTensorBinding}, {}}; + +static void InitDefaultsAssetFile() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_AssetFile_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::AssetFile(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::serving::AssetFile::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_AssetFile = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsAssetFile}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_TensorBinding.base,}}; + +static void InitDefaultsSignature() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_Signature_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::Signature(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::serving::Signature::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_Signature = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsSignature}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_RegressionSignature.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_ClassificationSignature.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_GenericSignature.base,}}; + +static void InitDefaultsRegressionSignature() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_RegressionSignature_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::RegressionSignature(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::serving::RegressionSignature::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_RegressionSignature = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsRegressionSignature}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_TensorBinding.base,}}; + +static void InitDefaultsClassificationSignature() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_ClassificationSignature_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::ClassificationSignature(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::serving::ClassificationSignature::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ClassificationSignature = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsClassificationSignature}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_TensorBinding.base,}}; + +static void InitDefaultsGenericSignature_MapEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_GenericSignature_MapEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse(); + } + ::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_GenericSignature_MapEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsGenericSignature_MapEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_TensorBinding.base,}}; + +static void InitDefaultsGenericSignature() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::serving::_GenericSignature_default_instance_; + new (ptr) ::diplomacy::tensorflow::serving::GenericSignature(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::serving::GenericSignature::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_GenericSignature = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsGenericSignature}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_GenericSignature_MapEntry_DoNotUse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Signatures_NamedSignaturesEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_Signatures.base); + ::google::protobuf::internal::InitSCC(&scc_info_TensorBinding.base); + ::google::protobuf::internal::InitSCC(&scc_info_AssetFile.base); + ::google::protobuf::internal::InitSCC(&scc_info_Signature.base); + ::google::protobuf::internal::InitSCC(&scc_info_RegressionSignature.base); + ::google::protobuf::internal::InitSCC(&scc_info_ClassificationSignature.base); + ::google::protobuf::internal::InitSCC(&scc_info_GenericSignature_MapEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_GenericSignature.base); +} + +::google::protobuf::Metadata file_level_metadata[9]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signatures, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signatures, default_signature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signatures, named_signatures_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::TensorBinding, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::TensorBinding, tensor_name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::AssetFile, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::AssetFile, tensor_binding_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::AssetFile, filename_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signature, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signature, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::serving::SignatureDefaultTypeInternal, regression_signature_), + offsetof(::diplomacy::tensorflow::serving::SignatureDefaultTypeInternal, classification_signature_), + offsetof(::diplomacy::tensorflow::serving::SignatureDefaultTypeInternal, generic_signature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::Signature, type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::RegressionSignature, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::RegressionSignature, input_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::RegressionSignature, output_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::ClassificationSignature, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::ClassificationSignature, input_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::ClassificationSignature, classes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::ClassificationSignature, scores_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::GenericSignature, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::serving::GenericSignature, map_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 7, sizeof(::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse)}, + { 9, -1, sizeof(::diplomacy::tensorflow::serving::Signatures)}, + { 16, -1, sizeof(::diplomacy::tensorflow::serving::TensorBinding)}, + { 22, -1, sizeof(::diplomacy::tensorflow::serving::AssetFile)}, + { 29, -1, sizeof(::diplomacy::tensorflow::serving::Signature)}, + { 38, -1, sizeof(::diplomacy::tensorflow::serving::RegressionSignature)}, + { 45, -1, sizeof(::diplomacy::tensorflow::serving::ClassificationSignature)}, + { 53, 60, sizeof(::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse)}, + { 62, -1, sizeof(::diplomacy::tensorflow::serving::GenericSignature)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::serving::_Signatures_NamedSignaturesEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_Signatures_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_TensorBinding_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_AssetFile_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_Signature_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_RegressionSignature_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_ClassificationSignature_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_GenericSignature_MapEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::serving::_GenericSignature_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/session_bundle/manifest.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 9); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n:diplomacy_tensorflow/contrib/session_b" + "undle/manifest.proto\022\034diplomacy.tensorfl" + "ow.serving\"\212\002\n\nSignatures\022B\n\021default_sig" + "nature\030\001 \001(\0132\'.diplomacy.tensorflow.serv" + "ing.Signature\022W\n\020named_signatures\030\002 \003(\0132" + "=.diplomacy.tensorflow.serving.Signature" + "s.NamedSignaturesEntry\032_\n\024NamedSignature" + "sEntry\022\013\n\003key\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.dip" + "lomacy.tensorflow.serving.Signature:\0028\001\"" + "$\n\rTensorBinding\022\023\n\013tensor_name\030\001 \001(\t\"b\n" + "\tAssetFile\022C\n\016tensor_binding\030\001 \001(\0132+.dip" + "lomacy.tensorflow.serving.TensorBinding\022" + "\020\n\010filename\030\002 \001(\t\"\216\002\n\tSignature\022Q\n\024regre" + "ssion_signature\030\001 \001(\01321.diplomacy.tensor" + "flow.serving.RegressionSignatureH\000\022Y\n\030cl" + "assification_signature\030\002 \001(\01325.diplomacy" + ".tensorflow.serving.ClassificationSignat" + "ureH\000\022K\n\021generic_signature\030\003 \001(\0132..diplo" + "macy.tensorflow.serving.GenericSignature" + "H\000B\006\n\004type\"\216\001\n\023RegressionSignature\022:\n\005in" + "put\030\001 \001(\0132+.diplomacy.tensorflow.serving" + ".TensorBinding\022;\n\006output\030\002 \001(\0132+.diploma" + "cy.tensorflow.serving.TensorBinding\"\320\001\n\027" + "ClassificationSignature\022:\n\005input\030\001 \001(\0132+" + ".diplomacy.tensorflow.serving.TensorBind" + "ing\022<\n\007classes\030\002 \001(\0132+.diplomacy.tensorf" + "low.serving.TensorBinding\022;\n\006scores\030\003 \001(" + "\0132+.diplomacy.tensorflow.serving.TensorB" + "inding\"\261\001\n\020GenericSignature\022D\n\003map\030\001 \003(\013" + "27.diplomacy.tensorflow.serving.GenericS" + "ignature.MapEntry\032W\n\010MapEntry\022\013\n\003key\030\001 \001" + "(\t\022:\n\005value\030\002 \001(\0132+.diplomacy.tensorflow" + ".serving.TensorBinding:\0028\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1314); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/session_bundle/manifest.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto +namespace diplomacy { +namespace tensorflow { +namespace serving { + +// =================================================================== + +Signatures_NamedSignaturesEntry_DoNotUse::Signatures_NamedSignaturesEntry_DoNotUse() {} +Signatures_NamedSignaturesEntry_DoNotUse::Signatures_NamedSignaturesEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void Signatures_NamedSignaturesEntry_DoNotUse::MergeFrom(const Signatures_NamedSignaturesEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata Signatures_NamedSignaturesEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[0]; +} +void Signatures_NamedSignaturesEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void Signatures::InitAsDefaultInstance() { + ::diplomacy::tensorflow::serving::_Signatures_default_instance_._instance.get_mutable()->default_signature_ = const_cast< ::diplomacy::tensorflow::serving::Signature*>( + ::diplomacy::tensorflow::serving::Signature::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Signatures::kDefaultSignatureFieldNumber; +const int Signatures::kNamedSignaturesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Signatures::Signatures() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_Signatures.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.serving.Signatures) +} +Signatures::Signatures(const Signatures& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + named_signatures_.MergeFrom(from.named_signatures_); + if (from.has_default_signature()) { + default_signature_ = new ::diplomacy::tensorflow::serving::Signature(*from.default_signature_); + } else { + default_signature_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.serving.Signatures) +} + +void Signatures::SharedCtor() { + default_signature_ = NULL; +} + +Signatures::~Signatures() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.serving.Signatures) + SharedDtor(); +} + +void Signatures::SharedDtor() { + if (this != internal_default_instance()) delete default_signature_; +} + +void Signatures::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Signatures::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Signatures& Signatures::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_Signatures.base); + return *internal_default_instance(); +} + + +void Signatures::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.serving.Signatures) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + named_signatures_.Clear(); + if (GetArenaNoVirtual() == NULL && default_signature_ != NULL) { + delete default_signature_; + } + default_signature_ = NULL; + _internal_metadata_.Clear(); +} + +bool Signatures::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.serving.Signatures) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.serving.Signature default_signature = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_default_signature())); + } else { + goto handle_unusual; + } + break; + } + + // map named_signatures = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + Signatures_NamedSignaturesEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + Signatures_NamedSignaturesEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::serving::Signature, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature > > parser(&named_signatures_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.serving.Signatures) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.serving.Signatures) + return false; +#undef DO_ +} + +void Signatures::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.serving.Signatures) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.Signature default_signature = 1; + if (this->has_default_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_default_signature(), output); + } + + // map named_signatures = 2; + if (!this->named_signatures().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->named_signatures().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->named_signatures().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::const_iterator + it = this->named_signatures().begin(); + it != this->named_signatures().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(named_signatures_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::const_iterator + it = this->named_signatures().begin(); + it != this->named_signatures().end(); ++it) { + entry.reset(named_signatures_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.serving.Signatures) +} + +::google::protobuf::uint8* Signatures::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.serving.Signatures) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.Signature default_signature = 1; + if (this->has_default_signature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_default_signature(), deterministic, target); + } + + // map named_signatures = 2; + if (!this->named_signatures().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry.key"); + } + }; + + if (deterministic && + this->named_signatures().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->named_signatures().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::const_iterator + it = this->named_signatures().begin(); + it != this->named_signatures().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(named_signatures_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::const_iterator + it = this->named_signatures().begin(); + it != this->named_signatures().end(); ++it) { + entry.reset(named_signatures_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.serving.Signatures) + return target; +} + +size_t Signatures::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.serving.Signatures) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map named_signatures = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->named_signatures_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >::const_iterator + it = this->named_signatures().begin(); + it != this->named_signatures().end(); ++it) { + entry.reset(named_signatures_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + // .diplomacy.tensorflow.serving.Signature default_signature = 1; + if (this->has_default_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *default_signature_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Signatures::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.serving.Signatures) + GOOGLE_DCHECK_NE(&from, this); + const Signatures* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.serving.Signatures) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.serving.Signatures) + MergeFrom(*source); + } +} + +void Signatures::MergeFrom(const Signatures& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.serving.Signatures) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + named_signatures_.MergeFrom(from.named_signatures_); + if (from.has_default_signature()) { + mutable_default_signature()->::diplomacy::tensorflow::serving::Signature::MergeFrom(from.default_signature()); + } +} + +void Signatures::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.serving.Signatures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Signatures::CopyFrom(const Signatures& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.serving.Signatures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Signatures::IsInitialized() const { + return true; +} + +void Signatures::Swap(Signatures* other) { + if (other == this) return; + InternalSwap(other); +} +void Signatures::InternalSwap(Signatures* other) { + using std::swap; + named_signatures_.Swap(&other->named_signatures_); + swap(default_signature_, other->default_signature_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Signatures::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TensorBinding::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorBinding::kTensorNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorBinding::TensorBinding() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_TensorBinding.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.serving.TensorBinding) +} +TensorBinding::TensorBinding(const TensorBinding& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tensor_name().size() > 0) { + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.serving.TensorBinding) +} + +void TensorBinding::SharedCtor() { + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +TensorBinding::~TensorBinding() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.serving.TensorBinding) + SharedDtor(); +} + +void TensorBinding::SharedDtor() { + tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void TensorBinding::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorBinding::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorBinding& TensorBinding::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_TensorBinding.base); + return *internal_default_instance(); +} + + +void TensorBinding::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.serving.TensorBinding) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool TensorBinding::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.serving.TensorBinding) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string tensor_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.serving.TensorBinding.tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.serving.TensorBinding) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.serving.TensorBinding) + return false; +#undef DO_ +} + +void TensorBinding::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.serving.TensorBinding) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string tensor_name = 1; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.TensorBinding.tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->tensor_name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.serving.TensorBinding) +} + +::google::protobuf::uint8* TensorBinding::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.serving.TensorBinding) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string tensor_name = 1; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.TensorBinding.tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->tensor_name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.serving.TensorBinding) + return target; +} + +size_t TensorBinding::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.serving.TensorBinding) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string tensor_name = 1; + if (this->tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tensor_name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorBinding::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.serving.TensorBinding) + GOOGLE_DCHECK_NE(&from, this); + const TensorBinding* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.serving.TensorBinding) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.serving.TensorBinding) + MergeFrom(*source); + } +} + +void TensorBinding::MergeFrom(const TensorBinding& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.serving.TensorBinding) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.tensor_name().size() > 0) { + + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } +} + +void TensorBinding::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.serving.TensorBinding) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorBinding::CopyFrom(const TensorBinding& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.serving.TensorBinding) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorBinding::IsInitialized() const { + return true; +} + +void TensorBinding::Swap(TensorBinding* other) { + if (other == this) return; + InternalSwap(other); +} +void TensorBinding::InternalSwap(TensorBinding* other) { + using std::swap; + tensor_name_.Swap(&other->tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorBinding::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void AssetFile::InitAsDefaultInstance() { + ::diplomacy::tensorflow::serving::_AssetFile_default_instance_._instance.get_mutable()->tensor_binding_ = const_cast< ::diplomacy::tensorflow::serving::TensorBinding*>( + ::diplomacy::tensorflow::serving::TensorBinding::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AssetFile::kTensorBindingFieldNumber; +const int AssetFile::kFilenameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AssetFile::AssetFile() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_AssetFile.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.serving.AssetFile) +} +AssetFile::AssetFile(const AssetFile& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.filename().size() > 0) { + filename_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.filename_); + } + if (from.has_tensor_binding()) { + tensor_binding_ = new ::diplomacy::tensorflow::serving::TensorBinding(*from.tensor_binding_); + } else { + tensor_binding_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.serving.AssetFile) +} + +void AssetFile::SharedCtor() { + filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tensor_binding_ = NULL; +} + +AssetFile::~AssetFile() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.serving.AssetFile) + SharedDtor(); +} + +void AssetFile::SharedDtor() { + filename_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete tensor_binding_; +} + +void AssetFile::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AssetFile::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AssetFile& AssetFile::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_AssetFile.base); + return *internal_default_instance(); +} + + +void AssetFile::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.serving.AssetFile) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + filename_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && tensor_binding_ != NULL) { + delete tensor_binding_; + } + tensor_binding_ = NULL; + _internal_metadata_.Clear(); +} + +bool AssetFile::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.serving.AssetFile) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.serving.TensorBinding tensor_binding = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor_binding())); + } else { + goto handle_unusual; + } + break; + } + + // string filename = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_filename())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->filename().data(), static_cast(this->filename().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.serving.AssetFile.filename")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.serving.AssetFile) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.serving.AssetFile) + return false; +#undef DO_ +} + +void AssetFile::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.serving.AssetFile) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.TensorBinding tensor_binding = 1; + if (this->has_tensor_binding()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_tensor_binding(), output); + } + + // string filename = 2; + if (this->filename().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->filename().data(), static_cast(this->filename().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.AssetFile.filename"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->filename(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.serving.AssetFile) +} + +::google::protobuf::uint8* AssetFile::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.serving.AssetFile) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.TensorBinding tensor_binding = 1; + if (this->has_tensor_binding()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_tensor_binding(), deterministic, target); + } + + // string filename = 2; + if (this->filename().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->filename().data(), static_cast(this->filename().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.AssetFile.filename"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->filename(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.serving.AssetFile) + return target; +} + +size_t AssetFile::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.serving.AssetFile) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string filename = 2; + if (this->filename().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->filename()); + } + + // .diplomacy.tensorflow.serving.TensorBinding tensor_binding = 1; + if (this->has_tensor_binding()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tensor_binding_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AssetFile::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.serving.AssetFile) + GOOGLE_DCHECK_NE(&from, this); + const AssetFile* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.serving.AssetFile) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.serving.AssetFile) + MergeFrom(*source); + } +} + +void AssetFile::MergeFrom(const AssetFile& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.serving.AssetFile) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.filename().size() > 0) { + + filename_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.filename_); + } + if (from.has_tensor_binding()) { + mutable_tensor_binding()->::diplomacy::tensorflow::serving::TensorBinding::MergeFrom(from.tensor_binding()); + } +} + +void AssetFile::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.serving.AssetFile) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AssetFile::CopyFrom(const AssetFile& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.serving.AssetFile) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AssetFile::IsInitialized() const { + return true; +} + +void AssetFile::Swap(AssetFile* other) { + if (other == this) return; + InternalSwap(other); +} +void AssetFile::InternalSwap(AssetFile* other) { + using std::swap; + filename_.Swap(&other->filename_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(tensor_binding_, other->tensor_binding_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AssetFile::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Signature::InitAsDefaultInstance() { + ::diplomacy::tensorflow::serving::_Signature_default_instance_.regression_signature_ = const_cast< ::diplomacy::tensorflow::serving::RegressionSignature*>( + ::diplomacy::tensorflow::serving::RegressionSignature::internal_default_instance()); + ::diplomacy::tensorflow::serving::_Signature_default_instance_.classification_signature_ = const_cast< ::diplomacy::tensorflow::serving::ClassificationSignature*>( + ::diplomacy::tensorflow::serving::ClassificationSignature::internal_default_instance()); + ::diplomacy::tensorflow::serving::_Signature_default_instance_.generic_signature_ = const_cast< ::diplomacy::tensorflow::serving::GenericSignature*>( + ::diplomacy::tensorflow::serving::GenericSignature::internal_default_instance()); +} +void Signature::set_allocated_regression_signature(::diplomacy::tensorflow::serving::RegressionSignature* regression_signature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_type(); + if (regression_signature) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + regression_signature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, regression_signature, submessage_arena); + } + set_has_regression_signature(); + type_.regression_signature_ = regression_signature; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.Signature.regression_signature) +} +void Signature::set_allocated_classification_signature(::diplomacy::tensorflow::serving::ClassificationSignature* classification_signature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_type(); + if (classification_signature) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + classification_signature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, classification_signature, submessage_arena); + } + set_has_classification_signature(); + type_.classification_signature_ = classification_signature; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.Signature.classification_signature) +} +void Signature::set_allocated_generic_signature(::diplomacy::tensorflow::serving::GenericSignature* generic_signature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_type(); + if (generic_signature) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + generic_signature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, generic_signature, submessage_arena); + } + set_has_generic_signature(); + type_.generic_signature_ = generic_signature; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.Signature.generic_signature) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Signature::kRegressionSignatureFieldNumber; +const int Signature::kClassificationSignatureFieldNumber; +const int Signature::kGenericSignatureFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Signature::Signature() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_Signature.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.serving.Signature) +} +Signature::Signature(const Signature& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_type(); + switch (from.type_case()) { + case kRegressionSignature: { + mutable_regression_signature()->::diplomacy::tensorflow::serving::RegressionSignature::MergeFrom(from.regression_signature()); + break; + } + case kClassificationSignature: { + mutable_classification_signature()->::diplomacy::tensorflow::serving::ClassificationSignature::MergeFrom(from.classification_signature()); + break; + } + case kGenericSignature: { + mutable_generic_signature()->::diplomacy::tensorflow::serving::GenericSignature::MergeFrom(from.generic_signature()); + break; + } + case TYPE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.serving.Signature) +} + +void Signature::SharedCtor() { + clear_has_type(); +} + +Signature::~Signature() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.serving.Signature) + SharedDtor(); +} + +void Signature::SharedDtor() { + if (has_type()) { + clear_type(); + } +} + +void Signature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Signature::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Signature& Signature::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_Signature.base); + return *internal_default_instance(); +} + + +void Signature::clear_type() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.serving.Signature) + switch (type_case()) { + case kRegressionSignature: { + delete type_.regression_signature_; + break; + } + case kClassificationSignature: { + delete type_.classification_signature_; + break; + } + case kGenericSignature: { + delete type_.generic_signature_; + break; + } + case TYPE_NOT_SET: { + break; + } + } + _oneof_case_[0] = TYPE_NOT_SET; +} + + +void Signature::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.serving.Signature) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_type(); + _internal_metadata_.Clear(); +} + +bool Signature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.serving.Signature) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.serving.RegressionSignature regression_signature = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_regression_signature())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.serving.ClassificationSignature classification_signature = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_classification_signature())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.serving.GenericSignature generic_signature = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_generic_signature())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.serving.Signature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.serving.Signature) + return false; +#undef DO_ +} + +void Signature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.serving.Signature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.RegressionSignature regression_signature = 1; + if (has_regression_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_regression_signature(), output); + } + + // .diplomacy.tensorflow.serving.ClassificationSignature classification_signature = 2; + if (has_classification_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_classification_signature(), output); + } + + // .diplomacy.tensorflow.serving.GenericSignature generic_signature = 3; + if (has_generic_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_generic_signature(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.serving.Signature) +} + +::google::protobuf::uint8* Signature::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.serving.Signature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.RegressionSignature regression_signature = 1; + if (has_regression_signature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_regression_signature(), deterministic, target); + } + + // .diplomacy.tensorflow.serving.ClassificationSignature classification_signature = 2; + if (has_classification_signature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_classification_signature(), deterministic, target); + } + + // .diplomacy.tensorflow.serving.GenericSignature generic_signature = 3; + if (has_generic_signature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_generic_signature(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.serving.Signature) + return target; +} + +size_t Signature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.serving.Signature) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (type_case()) { + // .diplomacy.tensorflow.serving.RegressionSignature regression_signature = 1; + case kRegressionSignature: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *type_.regression_signature_); + break; + } + // .diplomacy.tensorflow.serving.ClassificationSignature classification_signature = 2; + case kClassificationSignature: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *type_.classification_signature_); + break; + } + // .diplomacy.tensorflow.serving.GenericSignature generic_signature = 3; + case kGenericSignature: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *type_.generic_signature_); + break; + } + case TYPE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Signature::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.serving.Signature) + GOOGLE_DCHECK_NE(&from, this); + const Signature* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.serving.Signature) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.serving.Signature) + MergeFrom(*source); + } +} + +void Signature::MergeFrom(const Signature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.serving.Signature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.type_case()) { + case kRegressionSignature: { + mutable_regression_signature()->::diplomacy::tensorflow::serving::RegressionSignature::MergeFrom(from.regression_signature()); + break; + } + case kClassificationSignature: { + mutable_classification_signature()->::diplomacy::tensorflow::serving::ClassificationSignature::MergeFrom(from.classification_signature()); + break; + } + case kGenericSignature: { + mutable_generic_signature()->::diplomacy::tensorflow::serving::GenericSignature::MergeFrom(from.generic_signature()); + break; + } + case TYPE_NOT_SET: { + break; + } + } +} + +void Signature::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.serving.Signature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Signature::CopyFrom(const Signature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.serving.Signature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Signature::IsInitialized() const { + return true; +} + +void Signature::Swap(Signature* other) { + if (other == this) return; + InternalSwap(other); +} +void Signature::InternalSwap(Signature* other) { + using std::swap; + swap(type_, other->type_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Signature::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void RegressionSignature::InitAsDefaultInstance() { + ::diplomacy::tensorflow::serving::_RegressionSignature_default_instance_._instance.get_mutable()->input_ = const_cast< ::diplomacy::tensorflow::serving::TensorBinding*>( + ::diplomacy::tensorflow::serving::TensorBinding::internal_default_instance()); + ::diplomacy::tensorflow::serving::_RegressionSignature_default_instance_._instance.get_mutable()->output_ = const_cast< ::diplomacy::tensorflow::serving::TensorBinding*>( + ::diplomacy::tensorflow::serving::TensorBinding::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RegressionSignature::kInputFieldNumber; +const int RegressionSignature::kOutputFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RegressionSignature::RegressionSignature() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_RegressionSignature.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.serving.RegressionSignature) +} +RegressionSignature::RegressionSignature(const RegressionSignature& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_input()) { + input_ = new ::diplomacy::tensorflow::serving::TensorBinding(*from.input_); + } else { + input_ = NULL; + } + if (from.has_output()) { + output_ = new ::diplomacy::tensorflow::serving::TensorBinding(*from.output_); + } else { + output_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.serving.RegressionSignature) +} + +void RegressionSignature::SharedCtor() { + ::memset(&input_, 0, static_cast( + reinterpret_cast(&output_) - + reinterpret_cast(&input_)) + sizeof(output_)); +} + +RegressionSignature::~RegressionSignature() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.serving.RegressionSignature) + SharedDtor(); +} + +void RegressionSignature::SharedDtor() { + if (this != internal_default_instance()) delete input_; + if (this != internal_default_instance()) delete output_; +} + +void RegressionSignature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* RegressionSignature::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const RegressionSignature& RegressionSignature::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_RegressionSignature.base); + return *internal_default_instance(); +} + + +void RegressionSignature::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.serving.RegressionSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && input_ != NULL) { + delete input_; + } + input_ = NULL; + if (GetArenaNoVirtual() == NULL && output_ != NULL) { + delete output_; + } + output_ = NULL; + _internal_metadata_.Clear(); +} + +bool RegressionSignature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.serving.RegressionSignature) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_input())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.serving.TensorBinding output = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_output())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.serving.RegressionSignature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.serving.RegressionSignature) + return false; +#undef DO_ +} + +void RegressionSignature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.serving.RegressionSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + if (this->has_input()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_input(), output); + } + + // .diplomacy.tensorflow.serving.TensorBinding output = 2; + if (this->has_output()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_output(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.serving.RegressionSignature) +} + +::google::protobuf::uint8* RegressionSignature::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.serving.RegressionSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + if (this->has_input()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_input(), deterministic, target); + } + + // .diplomacy.tensorflow.serving.TensorBinding output = 2; + if (this->has_output()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_output(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.serving.RegressionSignature) + return target; +} + +size_t RegressionSignature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.serving.RegressionSignature) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + if (this->has_input()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *input_); + } + + // .diplomacy.tensorflow.serving.TensorBinding output = 2; + if (this->has_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *output_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void RegressionSignature::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.serving.RegressionSignature) + GOOGLE_DCHECK_NE(&from, this); + const RegressionSignature* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.serving.RegressionSignature) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.serving.RegressionSignature) + MergeFrom(*source); + } +} + +void RegressionSignature::MergeFrom(const RegressionSignature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.serving.RegressionSignature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_input()) { + mutable_input()->::diplomacy::tensorflow::serving::TensorBinding::MergeFrom(from.input()); + } + if (from.has_output()) { + mutable_output()->::diplomacy::tensorflow::serving::TensorBinding::MergeFrom(from.output()); + } +} + +void RegressionSignature::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.serving.RegressionSignature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RegressionSignature::CopyFrom(const RegressionSignature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.serving.RegressionSignature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RegressionSignature::IsInitialized() const { + return true; +} + +void RegressionSignature::Swap(RegressionSignature* other) { + if (other == this) return; + InternalSwap(other); +} +void RegressionSignature::InternalSwap(RegressionSignature* other) { + using std::swap; + swap(input_, other->input_); + swap(output_, other->output_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata RegressionSignature::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ClassificationSignature::InitAsDefaultInstance() { + ::diplomacy::tensorflow::serving::_ClassificationSignature_default_instance_._instance.get_mutable()->input_ = const_cast< ::diplomacy::tensorflow::serving::TensorBinding*>( + ::diplomacy::tensorflow::serving::TensorBinding::internal_default_instance()); + ::diplomacy::tensorflow::serving::_ClassificationSignature_default_instance_._instance.get_mutable()->classes_ = const_cast< ::diplomacy::tensorflow::serving::TensorBinding*>( + ::diplomacy::tensorflow::serving::TensorBinding::internal_default_instance()); + ::diplomacy::tensorflow::serving::_ClassificationSignature_default_instance_._instance.get_mutable()->scores_ = const_cast< ::diplomacy::tensorflow::serving::TensorBinding*>( + ::diplomacy::tensorflow::serving::TensorBinding::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ClassificationSignature::kInputFieldNumber; +const int ClassificationSignature::kClassesFieldNumber; +const int ClassificationSignature::kScoresFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ClassificationSignature::ClassificationSignature() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_ClassificationSignature.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.serving.ClassificationSignature) +} +ClassificationSignature::ClassificationSignature(const ClassificationSignature& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_input()) { + input_ = new ::diplomacy::tensorflow::serving::TensorBinding(*from.input_); + } else { + input_ = NULL; + } + if (from.has_classes()) { + classes_ = new ::diplomacy::tensorflow::serving::TensorBinding(*from.classes_); + } else { + classes_ = NULL; + } + if (from.has_scores()) { + scores_ = new ::diplomacy::tensorflow::serving::TensorBinding(*from.scores_); + } else { + scores_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.serving.ClassificationSignature) +} + +void ClassificationSignature::SharedCtor() { + ::memset(&input_, 0, static_cast( + reinterpret_cast(&scores_) - + reinterpret_cast(&input_)) + sizeof(scores_)); +} + +ClassificationSignature::~ClassificationSignature() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.serving.ClassificationSignature) + SharedDtor(); +} + +void ClassificationSignature::SharedDtor() { + if (this != internal_default_instance()) delete input_; + if (this != internal_default_instance()) delete classes_; + if (this != internal_default_instance()) delete scores_; +} + +void ClassificationSignature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ClassificationSignature::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ClassificationSignature& ClassificationSignature::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_ClassificationSignature.base); + return *internal_default_instance(); +} + + +void ClassificationSignature::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.serving.ClassificationSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && input_ != NULL) { + delete input_; + } + input_ = NULL; + if (GetArenaNoVirtual() == NULL && classes_ != NULL) { + delete classes_; + } + classes_ = NULL; + if (GetArenaNoVirtual() == NULL && scores_ != NULL) { + delete scores_; + } + scores_ = NULL; + _internal_metadata_.Clear(); +} + +bool ClassificationSignature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.serving.ClassificationSignature) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_input())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.serving.TensorBinding classes = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_classes())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.serving.TensorBinding scores = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_scores())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.serving.ClassificationSignature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.serving.ClassificationSignature) + return false; +#undef DO_ +} + +void ClassificationSignature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.serving.ClassificationSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + if (this->has_input()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_input(), output); + } + + // .diplomacy.tensorflow.serving.TensorBinding classes = 2; + if (this->has_classes()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_classes(), output); + } + + // .diplomacy.tensorflow.serving.TensorBinding scores = 3; + if (this->has_scores()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_scores(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.serving.ClassificationSignature) +} + +::google::protobuf::uint8* ClassificationSignature::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.serving.ClassificationSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + if (this->has_input()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_input(), deterministic, target); + } + + // .diplomacy.tensorflow.serving.TensorBinding classes = 2; + if (this->has_classes()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_classes(), deterministic, target); + } + + // .diplomacy.tensorflow.serving.TensorBinding scores = 3; + if (this->has_scores()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_scores(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.serving.ClassificationSignature) + return target; +} + +size_t ClassificationSignature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.serving.ClassificationSignature) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + if (this->has_input()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *input_); + } + + // .diplomacy.tensorflow.serving.TensorBinding classes = 2; + if (this->has_classes()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *classes_); + } + + // .diplomacy.tensorflow.serving.TensorBinding scores = 3; + if (this->has_scores()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *scores_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ClassificationSignature::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.serving.ClassificationSignature) + GOOGLE_DCHECK_NE(&from, this); + const ClassificationSignature* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.serving.ClassificationSignature) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.serving.ClassificationSignature) + MergeFrom(*source); + } +} + +void ClassificationSignature::MergeFrom(const ClassificationSignature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.serving.ClassificationSignature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_input()) { + mutable_input()->::diplomacy::tensorflow::serving::TensorBinding::MergeFrom(from.input()); + } + if (from.has_classes()) { + mutable_classes()->::diplomacy::tensorflow::serving::TensorBinding::MergeFrom(from.classes()); + } + if (from.has_scores()) { + mutable_scores()->::diplomacy::tensorflow::serving::TensorBinding::MergeFrom(from.scores()); + } +} + +void ClassificationSignature::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.serving.ClassificationSignature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ClassificationSignature::CopyFrom(const ClassificationSignature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.serving.ClassificationSignature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClassificationSignature::IsInitialized() const { + return true; +} + +void ClassificationSignature::Swap(ClassificationSignature* other) { + if (other == this) return; + InternalSwap(other); +} +void ClassificationSignature::InternalSwap(ClassificationSignature* other) { + using std::swap; + swap(input_, other->input_); + swap(classes_, other->classes_); + swap(scores_, other->scores_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ClassificationSignature::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +GenericSignature_MapEntry_DoNotUse::GenericSignature_MapEntry_DoNotUse() {} +GenericSignature_MapEntry_DoNotUse::GenericSignature_MapEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void GenericSignature_MapEntry_DoNotUse::MergeFrom(const GenericSignature_MapEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata GenericSignature_MapEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[7]; +} +void GenericSignature_MapEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void GenericSignature::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GenericSignature::kMapFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GenericSignature::GenericSignature() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_GenericSignature.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.serving.GenericSignature) +} +GenericSignature::GenericSignature(const GenericSignature& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + map_.MergeFrom(from.map_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.serving.GenericSignature) +} + +void GenericSignature::SharedCtor() { +} + +GenericSignature::~GenericSignature() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.serving.GenericSignature) + SharedDtor(); +} + +void GenericSignature::SharedDtor() { +} + +void GenericSignature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GenericSignature::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GenericSignature& GenericSignature::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::scc_info_GenericSignature.base); + return *internal_default_instance(); +} + + +void GenericSignature::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.serving.GenericSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + map_.Clear(); + _internal_metadata_.Clear(); +} + +bool GenericSignature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.serving.GenericSignature) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map map = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + GenericSignature_MapEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + GenericSignature_MapEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::serving::TensorBinding, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding > > parser(&map_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.serving.GenericSignature.MapEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.serving.GenericSignature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.serving.GenericSignature) + return false; +#undef DO_ +} + +void GenericSignature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.serving.GenericSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map map = 1; + if (!this->map().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.GenericSignature.MapEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->map().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->map().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::const_iterator + it = this->map().begin(); + it != this->map().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(map_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::const_iterator + it = this->map().begin(); + it != this->map().end(); ++it) { + entry.reset(map_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.serving.GenericSignature) +} + +::google::protobuf::uint8* GenericSignature::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.serving.GenericSignature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map map = 1; + if (!this->map().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.serving.GenericSignature.MapEntry.key"); + } + }; + + if (deterministic && + this->map().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->map().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::const_iterator + it = this->map().begin(); + it != this->map().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(map_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::const_iterator + it = this->map().begin(); + it != this->map().end(); ++it) { + entry.reset(map_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.serving.GenericSignature) + return target; +} + +size_t GenericSignature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.serving.GenericSignature) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map map = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->map_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >::const_iterator + it = this->map().begin(); + it != this->map().end(); ++it) { + entry.reset(map_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GenericSignature::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.serving.GenericSignature) + GOOGLE_DCHECK_NE(&from, this); + const GenericSignature* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.serving.GenericSignature) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.serving.GenericSignature) + MergeFrom(*source); + } +} + +void GenericSignature::MergeFrom(const GenericSignature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.serving.GenericSignature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + map_.MergeFrom(from.map_); +} + +void GenericSignature::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.serving.GenericSignature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GenericSignature::CopyFrom(const GenericSignature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.serving.GenericSignature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GenericSignature::IsInitialized() const { + return true; +} + +void GenericSignature::Swap(GenericSignature* other) { + if (other == this) return; + InternalSwap(other); +} +void GenericSignature::InternalSwap(GenericSignature* other) { + using std::swap; + map_.Swap(&other->map_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GenericSignature::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace serving +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::Signatures* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::Signatures >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::Signatures >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::TensorBinding* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::TensorBinding >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::TensorBinding >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::AssetFile* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::AssetFile >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::AssetFile >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::Signature* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::Signature >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::Signature >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::RegressionSignature* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::RegressionSignature >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::RegressionSignature >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::ClassificationSignature* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::ClassificationSignature >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::ClassificationSignature >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::serving::GenericSignature* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::serving::GenericSignature >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::serving::GenericSignature >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.pb.h new file mode 100644 index 0000000..671d900 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.pb.h @@ -0,0 +1,1755 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/session_bundle/manifest.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[9]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto +namespace diplomacy { +namespace tensorflow { +namespace serving { +class AssetFile; +class AssetFileDefaultTypeInternal; +extern AssetFileDefaultTypeInternal _AssetFile_default_instance_; +class ClassificationSignature; +class ClassificationSignatureDefaultTypeInternal; +extern ClassificationSignatureDefaultTypeInternal _ClassificationSignature_default_instance_; +class GenericSignature; +class GenericSignatureDefaultTypeInternal; +extern GenericSignatureDefaultTypeInternal _GenericSignature_default_instance_; +class GenericSignature_MapEntry_DoNotUse; +class GenericSignature_MapEntry_DoNotUseDefaultTypeInternal; +extern GenericSignature_MapEntry_DoNotUseDefaultTypeInternal _GenericSignature_MapEntry_DoNotUse_default_instance_; +class RegressionSignature; +class RegressionSignatureDefaultTypeInternal; +extern RegressionSignatureDefaultTypeInternal _RegressionSignature_default_instance_; +class Signature; +class SignatureDefaultTypeInternal; +extern SignatureDefaultTypeInternal _Signature_default_instance_; +class Signatures; +class SignaturesDefaultTypeInternal; +extern SignaturesDefaultTypeInternal _Signatures_default_instance_; +class Signatures_NamedSignaturesEntry_DoNotUse; +class Signatures_NamedSignaturesEntry_DoNotUseDefaultTypeInternal; +extern Signatures_NamedSignaturesEntry_DoNotUseDefaultTypeInternal _Signatures_NamedSignaturesEntry_DoNotUse_default_instance_; +class TensorBinding; +class TensorBindingDefaultTypeInternal; +extern TensorBindingDefaultTypeInternal _TensorBinding_default_instance_; +} // namespace serving +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::serving::AssetFile* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::AssetFile>(Arena*); +template<> ::diplomacy::tensorflow::serving::ClassificationSignature* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::ClassificationSignature>(Arena*); +template<> ::diplomacy::tensorflow::serving::GenericSignature* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::GenericSignature>(Arena*); +template<> ::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::GenericSignature_MapEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::serving::RegressionSignature* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::RegressionSignature>(Arena*); +template<> ::diplomacy::tensorflow::serving::Signature* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::Signature>(Arena*); +template<> ::diplomacy::tensorflow::serving::Signatures* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::Signatures>(Arena*); +template<> ::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::Signatures_NamedSignaturesEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::serving::TensorBinding* Arena::CreateMaybeMessage<::diplomacy::tensorflow::serving::TensorBinding>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace serving { + +// =================================================================== + +class Signatures_NamedSignaturesEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + Signatures_NamedSignaturesEntry_DoNotUse(); + Signatures_NamedSignaturesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const Signatures_NamedSignaturesEntry_DoNotUse& other); + static const Signatures_NamedSignaturesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Signatures_NamedSignaturesEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class Signatures : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.serving.Signatures) */ { + public: + Signatures(); + virtual ~Signatures(); + + Signatures(const Signatures& from); + + inline Signatures& operator=(const Signatures& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Signatures(Signatures&& from) noexcept + : Signatures() { + *this = ::std::move(from); + } + + inline Signatures& operator=(Signatures&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Signatures& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Signatures* internal_default_instance() { + return reinterpret_cast( + &_Signatures_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(Signatures* other); + friend void swap(Signatures& a, Signatures& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Signatures* New() const final { + return CreateMaybeMessage(NULL); + } + + Signatures* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Signatures& from); + void MergeFrom(const Signatures& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Signatures* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map named_signatures = 2; + int named_signatures_size() const; + void clear_named_signatures(); + static const int kNamedSignaturesFieldNumber = 2; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >& + named_signatures() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >* + mutable_named_signatures(); + + // .diplomacy.tensorflow.serving.Signature default_signature = 1; + bool has_default_signature() const; + void clear_default_signature(); + static const int kDefaultSignatureFieldNumber = 1; + private: + const ::diplomacy::tensorflow::serving::Signature& _internal_default_signature() const; + public: + const ::diplomacy::tensorflow::serving::Signature& default_signature() const; + ::diplomacy::tensorflow::serving::Signature* release_default_signature(); + ::diplomacy::tensorflow::serving::Signature* mutable_default_signature(); + void set_allocated_default_signature(::diplomacy::tensorflow::serving::Signature* default_signature); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.Signatures) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::MapField< + Signatures_NamedSignaturesEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::serving::Signature, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > named_signatures_; + ::diplomacy::tensorflow::serving::Signature* default_signature_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TensorBinding : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.serving.TensorBinding) */ { + public: + TensorBinding(); + virtual ~TensorBinding(); + + TensorBinding(const TensorBinding& from); + + inline TensorBinding& operator=(const TensorBinding& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorBinding(TensorBinding&& from) noexcept + : TensorBinding() { + *this = ::std::move(from); + } + + inline TensorBinding& operator=(TensorBinding&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorBinding& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorBinding* internal_default_instance() { + return reinterpret_cast( + &_TensorBinding_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(TensorBinding* other); + friend void swap(TensorBinding& a, TensorBinding& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorBinding* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorBinding* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorBinding& from); + void MergeFrom(const TensorBinding& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorBinding* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string tensor_name = 1; + void clear_tensor_name(); + static const int kTensorNameFieldNumber = 1; + const ::std::string& tensor_name() const; + void set_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_tensor_name(::std::string&& value); + #endif + void set_tensor_name(const char* value); + void set_tensor_name(const char* value, size_t size); + ::std::string* mutable_tensor_name(); + ::std::string* release_tensor_name(); + void set_allocated_tensor_name(::std::string* tensor_name); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.TensorBinding) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr tensor_name_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class AssetFile : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.serving.AssetFile) */ { + public: + AssetFile(); + virtual ~AssetFile(); + + AssetFile(const AssetFile& from); + + inline AssetFile& operator=(const AssetFile& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AssetFile(AssetFile&& from) noexcept + : AssetFile() { + *this = ::std::move(from); + } + + inline AssetFile& operator=(AssetFile&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const AssetFile& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AssetFile* internal_default_instance() { + return reinterpret_cast( + &_AssetFile_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(AssetFile* other); + friend void swap(AssetFile& a, AssetFile& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AssetFile* New() const final { + return CreateMaybeMessage(NULL); + } + + AssetFile* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AssetFile& from); + void MergeFrom(const AssetFile& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AssetFile* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string filename = 2; + void clear_filename(); + static const int kFilenameFieldNumber = 2; + const ::std::string& filename() const; + void set_filename(const ::std::string& value); + #if LANG_CXX11 + void set_filename(::std::string&& value); + #endif + void set_filename(const char* value); + void set_filename(const char* value, size_t size); + ::std::string* mutable_filename(); + ::std::string* release_filename(); + void set_allocated_filename(::std::string* filename); + + // .diplomacy.tensorflow.serving.TensorBinding tensor_binding = 1; + bool has_tensor_binding() const; + void clear_tensor_binding(); + static const int kTensorBindingFieldNumber = 1; + private: + const ::diplomacy::tensorflow::serving::TensorBinding& _internal_tensor_binding() const; + public: + const ::diplomacy::tensorflow::serving::TensorBinding& tensor_binding() const; + ::diplomacy::tensorflow::serving::TensorBinding* release_tensor_binding(); + ::diplomacy::tensorflow::serving::TensorBinding* mutable_tensor_binding(); + void set_allocated_tensor_binding(::diplomacy::tensorflow::serving::TensorBinding* tensor_binding); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.AssetFile) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr filename_; + ::diplomacy::tensorflow::serving::TensorBinding* tensor_binding_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Signature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.serving.Signature) */ { + public: + Signature(); + virtual ~Signature(); + + Signature(const Signature& from); + + inline Signature& operator=(const Signature& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Signature(Signature&& from) noexcept + : Signature() { + *this = ::std::move(from); + } + + inline Signature& operator=(Signature&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Signature& default_instance(); + + enum TypeCase { + kRegressionSignature = 1, + kClassificationSignature = 2, + kGenericSignature = 3, + TYPE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Signature* internal_default_instance() { + return reinterpret_cast( + &_Signature_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(Signature* other); + friend void swap(Signature& a, Signature& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Signature* New() const final { + return CreateMaybeMessage(NULL); + } + + Signature* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Signature& from); + void MergeFrom(const Signature& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Signature* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.serving.RegressionSignature regression_signature = 1; + bool has_regression_signature() const; + void clear_regression_signature(); + static const int kRegressionSignatureFieldNumber = 1; + private: + const ::diplomacy::tensorflow::serving::RegressionSignature& _internal_regression_signature() const; + public: + const ::diplomacy::tensorflow::serving::RegressionSignature& regression_signature() const; + ::diplomacy::tensorflow::serving::RegressionSignature* release_regression_signature(); + ::diplomacy::tensorflow::serving::RegressionSignature* mutable_regression_signature(); + void set_allocated_regression_signature(::diplomacy::tensorflow::serving::RegressionSignature* regression_signature); + + // .diplomacy.tensorflow.serving.ClassificationSignature classification_signature = 2; + bool has_classification_signature() const; + void clear_classification_signature(); + static const int kClassificationSignatureFieldNumber = 2; + private: + const ::diplomacy::tensorflow::serving::ClassificationSignature& _internal_classification_signature() const; + public: + const ::diplomacy::tensorflow::serving::ClassificationSignature& classification_signature() const; + ::diplomacy::tensorflow::serving::ClassificationSignature* release_classification_signature(); + ::diplomacy::tensorflow::serving::ClassificationSignature* mutable_classification_signature(); + void set_allocated_classification_signature(::diplomacy::tensorflow::serving::ClassificationSignature* classification_signature); + + // .diplomacy.tensorflow.serving.GenericSignature generic_signature = 3; + bool has_generic_signature() const; + void clear_generic_signature(); + static const int kGenericSignatureFieldNumber = 3; + private: + const ::diplomacy::tensorflow::serving::GenericSignature& _internal_generic_signature() const; + public: + const ::diplomacy::tensorflow::serving::GenericSignature& generic_signature() const; + ::diplomacy::tensorflow::serving::GenericSignature* release_generic_signature(); + ::diplomacy::tensorflow::serving::GenericSignature* mutable_generic_signature(); + void set_allocated_generic_signature(::diplomacy::tensorflow::serving::GenericSignature* generic_signature); + + void clear_type(); + TypeCase type_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.Signature) + private: + void set_has_regression_signature(); + void set_has_classification_signature(); + void set_has_generic_signature(); + + inline bool has_type() const; + inline void clear_has_type(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + union TypeUnion { + TypeUnion() {} + ::diplomacy::tensorflow::serving::RegressionSignature* regression_signature_; + ::diplomacy::tensorflow::serving::ClassificationSignature* classification_signature_; + ::diplomacy::tensorflow::serving::GenericSignature* generic_signature_; + } type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class RegressionSignature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.serving.RegressionSignature) */ { + public: + RegressionSignature(); + virtual ~RegressionSignature(); + + RegressionSignature(const RegressionSignature& from); + + inline RegressionSignature& operator=(const RegressionSignature& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + RegressionSignature(RegressionSignature&& from) noexcept + : RegressionSignature() { + *this = ::std::move(from); + } + + inline RegressionSignature& operator=(RegressionSignature&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const RegressionSignature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const RegressionSignature* internal_default_instance() { + return reinterpret_cast( + &_RegressionSignature_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(RegressionSignature* other); + friend void swap(RegressionSignature& a, RegressionSignature& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline RegressionSignature* New() const final { + return CreateMaybeMessage(NULL); + } + + RegressionSignature* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const RegressionSignature& from); + void MergeFrom(const RegressionSignature& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RegressionSignature* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + bool has_input() const; + void clear_input(); + static const int kInputFieldNumber = 1; + private: + const ::diplomacy::tensorflow::serving::TensorBinding& _internal_input() const; + public: + const ::diplomacy::tensorflow::serving::TensorBinding& input() const; + ::diplomacy::tensorflow::serving::TensorBinding* release_input(); + ::diplomacy::tensorflow::serving::TensorBinding* mutable_input(); + void set_allocated_input(::diplomacy::tensorflow::serving::TensorBinding* input); + + // .diplomacy.tensorflow.serving.TensorBinding output = 2; + bool has_output() const; + void clear_output(); + static const int kOutputFieldNumber = 2; + private: + const ::diplomacy::tensorflow::serving::TensorBinding& _internal_output() const; + public: + const ::diplomacy::tensorflow::serving::TensorBinding& output() const; + ::diplomacy::tensorflow::serving::TensorBinding* release_output(); + ::diplomacy::tensorflow::serving::TensorBinding* mutable_output(); + void set_allocated_output(::diplomacy::tensorflow::serving::TensorBinding* output); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.RegressionSignature) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::diplomacy::tensorflow::serving::TensorBinding* input_; + ::diplomacy::tensorflow::serving::TensorBinding* output_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ClassificationSignature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.serving.ClassificationSignature) */ { + public: + ClassificationSignature(); + virtual ~ClassificationSignature(); + + ClassificationSignature(const ClassificationSignature& from); + + inline ClassificationSignature& operator=(const ClassificationSignature& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ClassificationSignature(ClassificationSignature&& from) noexcept + : ClassificationSignature() { + *this = ::std::move(from); + } + + inline ClassificationSignature& operator=(ClassificationSignature&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ClassificationSignature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ClassificationSignature* internal_default_instance() { + return reinterpret_cast( + &_ClassificationSignature_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(ClassificationSignature* other); + friend void swap(ClassificationSignature& a, ClassificationSignature& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ClassificationSignature* New() const final { + return CreateMaybeMessage(NULL); + } + + ClassificationSignature* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ClassificationSignature& from); + void MergeFrom(const ClassificationSignature& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ClassificationSignature* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.serving.TensorBinding input = 1; + bool has_input() const; + void clear_input(); + static const int kInputFieldNumber = 1; + private: + const ::diplomacy::tensorflow::serving::TensorBinding& _internal_input() const; + public: + const ::diplomacy::tensorflow::serving::TensorBinding& input() const; + ::diplomacy::tensorflow::serving::TensorBinding* release_input(); + ::diplomacy::tensorflow::serving::TensorBinding* mutable_input(); + void set_allocated_input(::diplomacy::tensorflow::serving::TensorBinding* input); + + // .diplomacy.tensorflow.serving.TensorBinding classes = 2; + bool has_classes() const; + void clear_classes(); + static const int kClassesFieldNumber = 2; + private: + const ::diplomacy::tensorflow::serving::TensorBinding& _internal_classes() const; + public: + const ::diplomacy::tensorflow::serving::TensorBinding& classes() const; + ::diplomacy::tensorflow::serving::TensorBinding* release_classes(); + ::diplomacy::tensorflow::serving::TensorBinding* mutable_classes(); + void set_allocated_classes(::diplomacy::tensorflow::serving::TensorBinding* classes); + + // .diplomacy.tensorflow.serving.TensorBinding scores = 3; + bool has_scores() const; + void clear_scores(); + static const int kScoresFieldNumber = 3; + private: + const ::diplomacy::tensorflow::serving::TensorBinding& _internal_scores() const; + public: + const ::diplomacy::tensorflow::serving::TensorBinding& scores() const; + ::diplomacy::tensorflow::serving::TensorBinding* release_scores(); + ::diplomacy::tensorflow::serving::TensorBinding* mutable_scores(); + void set_allocated_scores(::diplomacy::tensorflow::serving::TensorBinding* scores); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.ClassificationSignature) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::diplomacy::tensorflow::serving::TensorBinding* input_; + ::diplomacy::tensorflow::serving::TensorBinding* classes_; + ::diplomacy::tensorflow::serving::TensorBinding* scores_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GenericSignature_MapEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + GenericSignature_MapEntry_DoNotUse(); + GenericSignature_MapEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const GenericSignature_MapEntry_DoNotUse& other); + static const GenericSignature_MapEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_GenericSignature_MapEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class GenericSignature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.serving.GenericSignature) */ { + public: + GenericSignature(); + virtual ~GenericSignature(); + + GenericSignature(const GenericSignature& from); + + inline GenericSignature& operator=(const GenericSignature& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GenericSignature(GenericSignature&& from) noexcept + : GenericSignature() { + *this = ::std::move(from); + } + + inline GenericSignature& operator=(GenericSignature&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const GenericSignature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GenericSignature* internal_default_instance() { + return reinterpret_cast( + &_GenericSignature_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void Swap(GenericSignature* other); + friend void swap(GenericSignature& a, GenericSignature& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GenericSignature* New() const final { + return CreateMaybeMessage(NULL); + } + + GenericSignature* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GenericSignature& from); + void MergeFrom(const GenericSignature& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GenericSignature* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map map = 1; + int map_size() const; + void clear_map(); + static const int kMapFieldNumber = 1; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >& + map() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >* + mutable_map(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.GenericSignature) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::MapField< + GenericSignature_MapEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::serving::TensorBinding, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > map_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// Signatures + +// .diplomacy.tensorflow.serving.Signature default_signature = 1; +inline bool Signatures::has_default_signature() const { + return this != internal_default_instance() && default_signature_ != NULL; +} +inline void Signatures::clear_default_signature() { + if (GetArenaNoVirtual() == NULL && default_signature_ != NULL) { + delete default_signature_; + } + default_signature_ = NULL; +} +inline const ::diplomacy::tensorflow::serving::Signature& Signatures::_internal_default_signature() const { + return *default_signature_; +} +inline const ::diplomacy::tensorflow::serving::Signature& Signatures::default_signature() const { + const ::diplomacy::tensorflow::serving::Signature* p = default_signature_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.Signatures.default_signature) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::serving::_Signature_default_instance_); +} +inline ::diplomacy::tensorflow::serving::Signature* Signatures::release_default_signature() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.Signatures.default_signature) + + ::diplomacy::tensorflow::serving::Signature* temp = default_signature_; + default_signature_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::serving::Signature* Signatures::mutable_default_signature() { + + if (default_signature_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::serving::Signature>(GetArenaNoVirtual()); + default_signature_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.Signatures.default_signature) + return default_signature_; +} +inline void Signatures::set_allocated_default_signature(::diplomacy::tensorflow::serving::Signature* default_signature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete default_signature_; + } + if (default_signature) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + default_signature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, default_signature, submessage_arena); + } + + } else { + + } + default_signature_ = default_signature; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.Signatures.default_signature) +} + +// map named_signatures = 2; +inline int Signatures::named_signatures_size() const { + return named_signatures_.size(); +} +inline void Signatures::clear_named_signatures() { + named_signatures_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >& +Signatures::named_signatures() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.serving.Signatures.named_signatures) + return named_signatures_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::Signature >* +Signatures::mutable_named_signatures() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.serving.Signatures.named_signatures) + return named_signatures_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// TensorBinding + +// string tensor_name = 1; +inline void TensorBinding::clear_tensor_name() { + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& TensorBinding::tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.TensorBinding.tensor_name) + return tensor_name_.GetNoArena(); +} +inline void TensorBinding::set_tensor_name(const ::std::string& value) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.serving.TensorBinding.tensor_name) +} +#if LANG_CXX11 +inline void TensorBinding::set_tensor_name(::std::string&& value) { + + tensor_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.serving.TensorBinding.tensor_name) +} +#endif +inline void TensorBinding::set_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.serving.TensorBinding.tensor_name) +} +inline void TensorBinding::set_tensor_name(const char* value, size_t size) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.serving.TensorBinding.tensor_name) +} +inline ::std::string* TensorBinding::mutable_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.TensorBinding.tensor_name) + return tensor_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TensorBinding::release_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.TensorBinding.tensor_name) + + return tensor_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TensorBinding::set_allocated_tensor_name(::std::string* tensor_name) { + if (tensor_name != NULL) { + + } else { + + } + tensor_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.TensorBinding.tensor_name) +} + +// ------------------------------------------------------------------- + +// AssetFile + +// .diplomacy.tensorflow.serving.TensorBinding tensor_binding = 1; +inline bool AssetFile::has_tensor_binding() const { + return this != internal_default_instance() && tensor_binding_ != NULL; +} +inline void AssetFile::clear_tensor_binding() { + if (GetArenaNoVirtual() == NULL && tensor_binding_ != NULL) { + delete tensor_binding_; + } + tensor_binding_ = NULL; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& AssetFile::_internal_tensor_binding() const { + return *tensor_binding_; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& AssetFile::tensor_binding() const { + const ::diplomacy::tensorflow::serving::TensorBinding* p = tensor_binding_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.AssetFile.tensor_binding) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::serving::_TensorBinding_default_instance_); +} +inline ::diplomacy::tensorflow::serving::TensorBinding* AssetFile::release_tensor_binding() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.AssetFile.tensor_binding) + + ::diplomacy::tensorflow::serving::TensorBinding* temp = tensor_binding_; + tensor_binding_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::serving::TensorBinding* AssetFile::mutable_tensor_binding() { + + if (tensor_binding_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::serving::TensorBinding>(GetArenaNoVirtual()); + tensor_binding_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.AssetFile.tensor_binding) + return tensor_binding_; +} +inline void AssetFile::set_allocated_tensor_binding(::diplomacy::tensorflow::serving::TensorBinding* tensor_binding) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete tensor_binding_; + } + if (tensor_binding) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + tensor_binding = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor_binding, submessage_arena); + } + + } else { + + } + tensor_binding_ = tensor_binding; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.AssetFile.tensor_binding) +} + +// string filename = 2; +inline void AssetFile::clear_filename() { + filename_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& AssetFile::filename() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.AssetFile.filename) + return filename_.GetNoArena(); +} +inline void AssetFile::set_filename(const ::std::string& value) { + + filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.serving.AssetFile.filename) +} +#if LANG_CXX11 +inline void AssetFile::set_filename(::std::string&& value) { + + filename_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.serving.AssetFile.filename) +} +#endif +inline void AssetFile::set_filename(const char* value) { + GOOGLE_DCHECK(value != NULL); + + filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.serving.AssetFile.filename) +} +inline void AssetFile::set_filename(const char* value, size_t size) { + + filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.serving.AssetFile.filename) +} +inline ::std::string* AssetFile::mutable_filename() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.AssetFile.filename) + return filename_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* AssetFile::release_filename() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.AssetFile.filename) + + return filename_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void AssetFile::set_allocated_filename(::std::string* filename) { + if (filename != NULL) { + + } else { + + } + filename_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), filename); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.AssetFile.filename) +} + +// ------------------------------------------------------------------- + +// Signature + +// .diplomacy.tensorflow.serving.RegressionSignature regression_signature = 1; +inline bool Signature::has_regression_signature() const { + return type_case() == kRegressionSignature; +} +inline void Signature::set_has_regression_signature() { + _oneof_case_[0] = kRegressionSignature; +} +inline void Signature::clear_regression_signature() { + if (has_regression_signature()) { + delete type_.regression_signature_; + clear_has_type(); + } +} +inline const ::diplomacy::tensorflow::serving::RegressionSignature& Signature::_internal_regression_signature() const { + return *type_.regression_signature_; +} +inline ::diplomacy::tensorflow::serving::RegressionSignature* Signature::release_regression_signature() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.Signature.regression_signature) + if (has_regression_signature()) { + clear_has_type(); + ::diplomacy::tensorflow::serving::RegressionSignature* temp = type_.regression_signature_; + type_.regression_signature_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::serving::RegressionSignature& Signature::regression_signature() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.Signature.regression_signature) + return has_regression_signature() + ? *type_.regression_signature_ + : *reinterpret_cast< ::diplomacy::tensorflow::serving::RegressionSignature*>(&::diplomacy::tensorflow::serving::_RegressionSignature_default_instance_); +} +inline ::diplomacy::tensorflow::serving::RegressionSignature* Signature::mutable_regression_signature() { + if (!has_regression_signature()) { + clear_type(); + set_has_regression_signature(); + type_.regression_signature_ = CreateMaybeMessage< ::diplomacy::tensorflow::serving::RegressionSignature >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.Signature.regression_signature) + return type_.regression_signature_; +} + +// .diplomacy.tensorflow.serving.ClassificationSignature classification_signature = 2; +inline bool Signature::has_classification_signature() const { + return type_case() == kClassificationSignature; +} +inline void Signature::set_has_classification_signature() { + _oneof_case_[0] = kClassificationSignature; +} +inline void Signature::clear_classification_signature() { + if (has_classification_signature()) { + delete type_.classification_signature_; + clear_has_type(); + } +} +inline const ::diplomacy::tensorflow::serving::ClassificationSignature& Signature::_internal_classification_signature() const { + return *type_.classification_signature_; +} +inline ::diplomacy::tensorflow::serving::ClassificationSignature* Signature::release_classification_signature() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.Signature.classification_signature) + if (has_classification_signature()) { + clear_has_type(); + ::diplomacy::tensorflow::serving::ClassificationSignature* temp = type_.classification_signature_; + type_.classification_signature_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::serving::ClassificationSignature& Signature::classification_signature() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.Signature.classification_signature) + return has_classification_signature() + ? *type_.classification_signature_ + : *reinterpret_cast< ::diplomacy::tensorflow::serving::ClassificationSignature*>(&::diplomacy::tensorflow::serving::_ClassificationSignature_default_instance_); +} +inline ::diplomacy::tensorflow::serving::ClassificationSignature* Signature::mutable_classification_signature() { + if (!has_classification_signature()) { + clear_type(); + set_has_classification_signature(); + type_.classification_signature_ = CreateMaybeMessage< ::diplomacy::tensorflow::serving::ClassificationSignature >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.Signature.classification_signature) + return type_.classification_signature_; +} + +// .diplomacy.tensorflow.serving.GenericSignature generic_signature = 3; +inline bool Signature::has_generic_signature() const { + return type_case() == kGenericSignature; +} +inline void Signature::set_has_generic_signature() { + _oneof_case_[0] = kGenericSignature; +} +inline void Signature::clear_generic_signature() { + if (has_generic_signature()) { + delete type_.generic_signature_; + clear_has_type(); + } +} +inline const ::diplomacy::tensorflow::serving::GenericSignature& Signature::_internal_generic_signature() const { + return *type_.generic_signature_; +} +inline ::diplomacy::tensorflow::serving::GenericSignature* Signature::release_generic_signature() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.Signature.generic_signature) + if (has_generic_signature()) { + clear_has_type(); + ::diplomacy::tensorflow::serving::GenericSignature* temp = type_.generic_signature_; + type_.generic_signature_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::serving::GenericSignature& Signature::generic_signature() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.Signature.generic_signature) + return has_generic_signature() + ? *type_.generic_signature_ + : *reinterpret_cast< ::diplomacy::tensorflow::serving::GenericSignature*>(&::diplomacy::tensorflow::serving::_GenericSignature_default_instance_); +} +inline ::diplomacy::tensorflow::serving::GenericSignature* Signature::mutable_generic_signature() { + if (!has_generic_signature()) { + clear_type(); + set_has_generic_signature(); + type_.generic_signature_ = CreateMaybeMessage< ::diplomacy::tensorflow::serving::GenericSignature >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.Signature.generic_signature) + return type_.generic_signature_; +} + +inline bool Signature::has_type() const { + return type_case() != TYPE_NOT_SET; +} +inline void Signature::clear_has_type() { + _oneof_case_[0] = TYPE_NOT_SET; +} +inline Signature::TypeCase Signature::type_case() const { + return Signature::TypeCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// RegressionSignature + +// .diplomacy.tensorflow.serving.TensorBinding input = 1; +inline bool RegressionSignature::has_input() const { + return this != internal_default_instance() && input_ != NULL; +} +inline void RegressionSignature::clear_input() { + if (GetArenaNoVirtual() == NULL && input_ != NULL) { + delete input_; + } + input_ = NULL; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& RegressionSignature::_internal_input() const { + return *input_; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& RegressionSignature::input() const { + const ::diplomacy::tensorflow::serving::TensorBinding* p = input_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.RegressionSignature.input) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::serving::_TensorBinding_default_instance_); +} +inline ::diplomacy::tensorflow::serving::TensorBinding* RegressionSignature::release_input() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.RegressionSignature.input) + + ::diplomacy::tensorflow::serving::TensorBinding* temp = input_; + input_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::serving::TensorBinding* RegressionSignature::mutable_input() { + + if (input_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::serving::TensorBinding>(GetArenaNoVirtual()); + input_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.RegressionSignature.input) + return input_; +} +inline void RegressionSignature::set_allocated_input(::diplomacy::tensorflow::serving::TensorBinding* input) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete input_; + } + if (input) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + input = ::google::protobuf::internal::GetOwnedMessage( + message_arena, input, submessage_arena); + } + + } else { + + } + input_ = input; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.RegressionSignature.input) +} + +// .diplomacy.tensorflow.serving.TensorBinding output = 2; +inline bool RegressionSignature::has_output() const { + return this != internal_default_instance() && output_ != NULL; +} +inline void RegressionSignature::clear_output() { + if (GetArenaNoVirtual() == NULL && output_ != NULL) { + delete output_; + } + output_ = NULL; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& RegressionSignature::_internal_output() const { + return *output_; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& RegressionSignature::output() const { + const ::diplomacy::tensorflow::serving::TensorBinding* p = output_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.RegressionSignature.output) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::serving::_TensorBinding_default_instance_); +} +inline ::diplomacy::tensorflow::serving::TensorBinding* RegressionSignature::release_output() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.RegressionSignature.output) + + ::diplomacy::tensorflow::serving::TensorBinding* temp = output_; + output_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::serving::TensorBinding* RegressionSignature::mutable_output() { + + if (output_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::serving::TensorBinding>(GetArenaNoVirtual()); + output_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.RegressionSignature.output) + return output_; +} +inline void RegressionSignature::set_allocated_output(::diplomacy::tensorflow::serving::TensorBinding* output) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete output_; + } + if (output) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + output = ::google::protobuf::internal::GetOwnedMessage( + message_arena, output, submessage_arena); + } + + } else { + + } + output_ = output; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.RegressionSignature.output) +} + +// ------------------------------------------------------------------- + +// ClassificationSignature + +// .diplomacy.tensorflow.serving.TensorBinding input = 1; +inline bool ClassificationSignature::has_input() const { + return this != internal_default_instance() && input_ != NULL; +} +inline void ClassificationSignature::clear_input() { + if (GetArenaNoVirtual() == NULL && input_ != NULL) { + delete input_; + } + input_ = NULL; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& ClassificationSignature::_internal_input() const { + return *input_; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& ClassificationSignature::input() const { + const ::diplomacy::tensorflow::serving::TensorBinding* p = input_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.ClassificationSignature.input) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::serving::_TensorBinding_default_instance_); +} +inline ::diplomacy::tensorflow::serving::TensorBinding* ClassificationSignature::release_input() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.ClassificationSignature.input) + + ::diplomacy::tensorflow::serving::TensorBinding* temp = input_; + input_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::serving::TensorBinding* ClassificationSignature::mutable_input() { + + if (input_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::serving::TensorBinding>(GetArenaNoVirtual()); + input_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.ClassificationSignature.input) + return input_; +} +inline void ClassificationSignature::set_allocated_input(::diplomacy::tensorflow::serving::TensorBinding* input) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete input_; + } + if (input) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + input = ::google::protobuf::internal::GetOwnedMessage( + message_arena, input, submessage_arena); + } + + } else { + + } + input_ = input; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.ClassificationSignature.input) +} + +// .diplomacy.tensorflow.serving.TensorBinding classes = 2; +inline bool ClassificationSignature::has_classes() const { + return this != internal_default_instance() && classes_ != NULL; +} +inline void ClassificationSignature::clear_classes() { + if (GetArenaNoVirtual() == NULL && classes_ != NULL) { + delete classes_; + } + classes_ = NULL; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& ClassificationSignature::_internal_classes() const { + return *classes_; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& ClassificationSignature::classes() const { + const ::diplomacy::tensorflow::serving::TensorBinding* p = classes_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.ClassificationSignature.classes) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::serving::_TensorBinding_default_instance_); +} +inline ::diplomacy::tensorflow::serving::TensorBinding* ClassificationSignature::release_classes() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.ClassificationSignature.classes) + + ::diplomacy::tensorflow::serving::TensorBinding* temp = classes_; + classes_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::serving::TensorBinding* ClassificationSignature::mutable_classes() { + + if (classes_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::serving::TensorBinding>(GetArenaNoVirtual()); + classes_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.ClassificationSignature.classes) + return classes_; +} +inline void ClassificationSignature::set_allocated_classes(::diplomacy::tensorflow::serving::TensorBinding* classes) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete classes_; + } + if (classes) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + classes = ::google::protobuf::internal::GetOwnedMessage( + message_arena, classes, submessage_arena); + } + + } else { + + } + classes_ = classes; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.ClassificationSignature.classes) +} + +// .diplomacy.tensorflow.serving.TensorBinding scores = 3; +inline bool ClassificationSignature::has_scores() const { + return this != internal_default_instance() && scores_ != NULL; +} +inline void ClassificationSignature::clear_scores() { + if (GetArenaNoVirtual() == NULL && scores_ != NULL) { + delete scores_; + } + scores_ = NULL; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& ClassificationSignature::_internal_scores() const { + return *scores_; +} +inline const ::diplomacy::tensorflow::serving::TensorBinding& ClassificationSignature::scores() const { + const ::diplomacy::tensorflow::serving::TensorBinding* p = scores_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.serving.ClassificationSignature.scores) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::serving::_TensorBinding_default_instance_); +} +inline ::diplomacy::tensorflow::serving::TensorBinding* ClassificationSignature::release_scores() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.serving.ClassificationSignature.scores) + + ::diplomacy::tensorflow::serving::TensorBinding* temp = scores_; + scores_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::serving::TensorBinding* ClassificationSignature::mutable_scores() { + + if (scores_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::serving::TensorBinding>(GetArenaNoVirtual()); + scores_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.serving.ClassificationSignature.scores) + return scores_; +} +inline void ClassificationSignature::set_allocated_scores(::diplomacy::tensorflow::serving::TensorBinding* scores) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete scores_; + } + if (scores) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + scores = ::google::protobuf::internal::GetOwnedMessage( + message_arena, scores, submessage_arena); + } + + } else { + + } + scores_ = scores; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.serving.ClassificationSignature.scores) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// GenericSignature + +// map map = 1; +inline int GenericSignature::map_size() const { + return map_.size(); +} +inline void GenericSignature::clear_map() { + map_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >& +GenericSignature::map() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.serving.GenericSignature.map) + return map_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::serving::TensorBinding >* +GenericSignature::mutable_map() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.serving.GenericSignature.map) + return map_.MutableMap(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace serving +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fsession_5fbundle_2fmanifest_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.proto new file mode 100644 index 0000000..ab4beeb --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.serving; + +// Signatures of model export. +message Signatures { + // Default signature of the graph. + // WARNING(break-tutorial-inline-code): The following code snippet is + // in-lined in tutorials, please update tutorial documents accordingly + // whenever code changes. + Signature default_signature = 1; + + // Named signatures of the graph. + map named_signatures = 2; +}; + +// A binding to a tensor including the name and, possibly in the future, type +// or other metadata. For example, this may specify whether a tensor supports +// batch vs single inference. +message TensorBinding { + // The name of the tensor to bind to. + string tensor_name = 1; +}; + +// An asset file or set of sharded files with the same name that will be bound +// to a tensor at init / session_bundle load time. +message AssetFile { + // The tensor to bind the asset filename to. + TensorBinding tensor_binding = 1; + // The filename within the assets directory. Note: does not include the base + // path or asset directory prefix. Base paths can and will change when models + // are deployed for serving. + string filename = 2; +} + +// A Signature specifies the inputs and outputs of commonly used graphs. +message Signature { + oneof type { + RegressionSignature regression_signature = 1; + ClassificationSignature classification_signature = 2; + GenericSignature generic_signature = 3; + } +}; + +// RegressionSignature specifies a graph that takes an input and returns an +// output. +message RegressionSignature { + TensorBinding input = 1; + TensorBinding output = 2; +}; + +// ClassificationSignature specifies a graph that takes an input and returns +// classes and their scores. +// WARNING(break-tutorial-inline-code): The following code snippet is +// in-lined in tutorials, please update tutorial documents accordingly +// whenever code changes. +message ClassificationSignature { + TensorBinding input = 1; + TensorBinding classes = 2; + TensorBinding scores = 3; +}; + +// GenericSignature specifies a map from logical name to Tensor name. +// Typical application of GenericSignature is to use a single GenericSignature +// that includes all of the Tensor nodes and target names that may be useful at +// serving, analysis or debugging time. The recommended name for this signature +// in the ModelManifest is "generic_bindings". +message GenericSignature { + map map = 1; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest_pb2.py new file mode 100644 index 0000000..32be31c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/session_bundle/manifest_pb2.py @@ -0,0 +1,472 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/session_bundle/manifest.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/session_bundle/manifest.proto', + package='diplomacy.tensorflow.serving', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n:diplomacy_tensorflow/contrib/session_bundle/manifest.proto\x12\x1c\x64iplomacy.tensorflow.serving\"\x8a\x02\n\nSignatures\x12\x42\n\x11\x64\x65\x66\x61ult_signature\x18\x01 \x01(\x0b\x32\'.diplomacy.tensorflow.serving.Signature\x12W\n\x10named_signatures\x18\x02 \x03(\x0b\x32=.diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry\x1a_\n\x14NamedSignaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.diplomacy.tensorflow.serving.Signature:\x02\x38\x01\"$\n\rTensorBinding\x12\x13\n\x0btensor_name\x18\x01 \x01(\t\"b\n\tAssetFile\x12\x43\n\x0etensor_binding\x18\x01 \x01(\x0b\x32+.diplomacy.tensorflow.serving.TensorBinding\x12\x10\n\x08\x66ilename\x18\x02 \x01(\t\"\x8e\x02\n\tSignature\x12Q\n\x14regression_signature\x18\x01 \x01(\x0b\x32\x31.diplomacy.tensorflow.serving.RegressionSignatureH\x00\x12Y\n\x18\x63lassification_signature\x18\x02 \x01(\x0b\x32\x35.diplomacy.tensorflow.serving.ClassificationSignatureH\x00\x12K\n\x11generic_signature\x18\x03 \x01(\x0b\x32..diplomacy.tensorflow.serving.GenericSignatureH\x00\x42\x06\n\x04type\"\x8e\x01\n\x13RegressionSignature\x12:\n\x05input\x18\x01 \x01(\x0b\x32+.diplomacy.tensorflow.serving.TensorBinding\x12;\n\x06output\x18\x02 \x01(\x0b\x32+.diplomacy.tensorflow.serving.TensorBinding\"\xd0\x01\n\x17\x43lassificationSignature\x12:\n\x05input\x18\x01 \x01(\x0b\x32+.diplomacy.tensorflow.serving.TensorBinding\x12<\n\x07\x63lasses\x18\x02 \x01(\x0b\x32+.diplomacy.tensorflow.serving.TensorBinding\x12;\n\x06scores\x18\x03 \x01(\x0b\x32+.diplomacy.tensorflow.serving.TensorBinding\"\xb1\x01\n\x10GenericSignature\x12\x44\n\x03map\x18\x01 \x03(\x0b\x32\x37.diplomacy.tensorflow.serving.GenericSignature.MapEntry\x1aW\n\x08MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.diplomacy.tensorflow.serving.TensorBinding:\x02\x38\x01\x62\x06proto3') +) + + + + +_SIGNATURES_NAMEDSIGNATURESENTRY = _descriptor.Descriptor( + name='NamedSignaturesEntry', + full_name='diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=264, + serialized_end=359, +) + +_SIGNATURES = _descriptor.Descriptor( + name='Signatures', + full_name='diplomacy.tensorflow.serving.Signatures', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='default_signature', full_name='diplomacy.tensorflow.serving.Signatures.default_signature', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='named_signatures', full_name='diplomacy.tensorflow.serving.Signatures.named_signatures', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SIGNATURES_NAMEDSIGNATURESENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=93, + serialized_end=359, +) + + +_TENSORBINDING = _descriptor.Descriptor( + name='TensorBinding', + full_name='diplomacy.tensorflow.serving.TensorBinding', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tensor_name', full_name='diplomacy.tensorflow.serving.TensorBinding.tensor_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=361, + serialized_end=397, +) + + +_ASSETFILE = _descriptor.Descriptor( + name='AssetFile', + full_name='diplomacy.tensorflow.serving.AssetFile', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tensor_binding', full_name='diplomacy.tensorflow.serving.AssetFile.tensor_binding', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='filename', full_name='diplomacy.tensorflow.serving.AssetFile.filename', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=399, + serialized_end=497, +) + + +_SIGNATURE = _descriptor.Descriptor( + name='Signature', + full_name='diplomacy.tensorflow.serving.Signature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='regression_signature', full_name='diplomacy.tensorflow.serving.Signature.regression_signature', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='classification_signature', full_name='diplomacy.tensorflow.serving.Signature.classification_signature', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='generic_signature', full_name='diplomacy.tensorflow.serving.Signature.generic_signature', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='type', full_name='diplomacy.tensorflow.serving.Signature.type', + index=0, containing_type=None, fields=[]), + ], + serialized_start=500, + serialized_end=770, +) + + +_REGRESSIONSIGNATURE = _descriptor.Descriptor( + name='RegressionSignature', + full_name='diplomacy.tensorflow.serving.RegressionSignature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input', full_name='diplomacy.tensorflow.serving.RegressionSignature.input', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output', full_name='diplomacy.tensorflow.serving.RegressionSignature.output', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=773, + serialized_end=915, +) + + +_CLASSIFICATIONSIGNATURE = _descriptor.Descriptor( + name='ClassificationSignature', + full_name='diplomacy.tensorflow.serving.ClassificationSignature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input', full_name='diplomacy.tensorflow.serving.ClassificationSignature.input', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='classes', full_name='diplomacy.tensorflow.serving.ClassificationSignature.classes', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='scores', full_name='diplomacy.tensorflow.serving.ClassificationSignature.scores', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=918, + serialized_end=1126, +) + + +_GENERICSIGNATURE_MAPENTRY = _descriptor.Descriptor( + name='MapEntry', + full_name='diplomacy.tensorflow.serving.GenericSignature.MapEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.serving.GenericSignature.MapEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.serving.GenericSignature.MapEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1219, + serialized_end=1306, +) + +_GENERICSIGNATURE = _descriptor.Descriptor( + name='GenericSignature', + full_name='diplomacy.tensorflow.serving.GenericSignature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='map', full_name='diplomacy.tensorflow.serving.GenericSignature.map', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_GENERICSIGNATURE_MAPENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1129, + serialized_end=1306, +) + +_SIGNATURES_NAMEDSIGNATURESENTRY.fields_by_name['value'].message_type = _SIGNATURE +_SIGNATURES_NAMEDSIGNATURESENTRY.containing_type = _SIGNATURES +_SIGNATURES.fields_by_name['default_signature'].message_type = _SIGNATURE +_SIGNATURES.fields_by_name['named_signatures'].message_type = _SIGNATURES_NAMEDSIGNATURESENTRY +_ASSETFILE.fields_by_name['tensor_binding'].message_type = _TENSORBINDING +_SIGNATURE.fields_by_name['regression_signature'].message_type = _REGRESSIONSIGNATURE +_SIGNATURE.fields_by_name['classification_signature'].message_type = _CLASSIFICATIONSIGNATURE +_SIGNATURE.fields_by_name['generic_signature'].message_type = _GENERICSIGNATURE +_SIGNATURE.oneofs_by_name['type'].fields.append( + _SIGNATURE.fields_by_name['regression_signature']) +_SIGNATURE.fields_by_name['regression_signature'].containing_oneof = _SIGNATURE.oneofs_by_name['type'] +_SIGNATURE.oneofs_by_name['type'].fields.append( + _SIGNATURE.fields_by_name['classification_signature']) +_SIGNATURE.fields_by_name['classification_signature'].containing_oneof = _SIGNATURE.oneofs_by_name['type'] +_SIGNATURE.oneofs_by_name['type'].fields.append( + _SIGNATURE.fields_by_name['generic_signature']) +_SIGNATURE.fields_by_name['generic_signature'].containing_oneof = _SIGNATURE.oneofs_by_name['type'] +_REGRESSIONSIGNATURE.fields_by_name['input'].message_type = _TENSORBINDING +_REGRESSIONSIGNATURE.fields_by_name['output'].message_type = _TENSORBINDING +_CLASSIFICATIONSIGNATURE.fields_by_name['input'].message_type = _TENSORBINDING +_CLASSIFICATIONSIGNATURE.fields_by_name['classes'].message_type = _TENSORBINDING +_CLASSIFICATIONSIGNATURE.fields_by_name['scores'].message_type = _TENSORBINDING +_GENERICSIGNATURE_MAPENTRY.fields_by_name['value'].message_type = _TENSORBINDING +_GENERICSIGNATURE_MAPENTRY.containing_type = _GENERICSIGNATURE +_GENERICSIGNATURE.fields_by_name['map'].message_type = _GENERICSIGNATURE_MAPENTRY +DESCRIPTOR.message_types_by_name['Signatures'] = _SIGNATURES +DESCRIPTOR.message_types_by_name['TensorBinding'] = _TENSORBINDING +DESCRIPTOR.message_types_by_name['AssetFile'] = _ASSETFILE +DESCRIPTOR.message_types_by_name['Signature'] = _SIGNATURE +DESCRIPTOR.message_types_by_name['RegressionSignature'] = _REGRESSIONSIGNATURE +DESCRIPTOR.message_types_by_name['ClassificationSignature'] = _CLASSIFICATIONSIGNATURE +DESCRIPTOR.message_types_by_name['GenericSignature'] = _GENERICSIGNATURE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Signatures = _reflection.GeneratedProtocolMessageType('Signatures', (_message.Message,), dict( + + NamedSignaturesEntry = _reflection.GeneratedProtocolMessageType('NamedSignaturesEntry', (_message.Message,), dict( + DESCRIPTOR = _SIGNATURES_NAMEDSIGNATURESENTRY, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.Signatures.NamedSignaturesEntry) + )) + , + DESCRIPTOR = _SIGNATURES, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.Signatures) + )) +_sym_db.RegisterMessage(Signatures) +_sym_db.RegisterMessage(Signatures.NamedSignaturesEntry) + +TensorBinding = _reflection.GeneratedProtocolMessageType('TensorBinding', (_message.Message,), dict( + DESCRIPTOR = _TENSORBINDING, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.TensorBinding) + )) +_sym_db.RegisterMessage(TensorBinding) + +AssetFile = _reflection.GeneratedProtocolMessageType('AssetFile', (_message.Message,), dict( + DESCRIPTOR = _ASSETFILE, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.AssetFile) + )) +_sym_db.RegisterMessage(AssetFile) + +Signature = _reflection.GeneratedProtocolMessageType('Signature', (_message.Message,), dict( + DESCRIPTOR = _SIGNATURE, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.Signature) + )) +_sym_db.RegisterMessage(Signature) + +RegressionSignature = _reflection.GeneratedProtocolMessageType('RegressionSignature', (_message.Message,), dict( + DESCRIPTOR = _REGRESSIONSIGNATURE, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.RegressionSignature) + )) +_sym_db.RegisterMessage(RegressionSignature) + +ClassificationSignature = _reflection.GeneratedProtocolMessageType('ClassificationSignature', (_message.Message,), dict( + DESCRIPTOR = _CLASSIFICATIONSIGNATURE, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.ClassificationSignature) + )) +_sym_db.RegisterMessage(ClassificationSignature) + +GenericSignature = _reflection.GeneratedProtocolMessageType('GenericSignature', (_message.Message,), dict( + + MapEntry = _reflection.GeneratedProtocolMessageType('MapEntry', (_message.Message,), dict( + DESCRIPTOR = _GENERICSIGNATURE_MAPENTRY, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.GenericSignature.MapEntry) + )) + , + DESCRIPTOR = _GENERICSIGNATURE, + __module__ = 'diplomacy_tensorflow.contrib.session_bundle.manifest_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.serving.GenericSignature) + )) +_sym_db.RegisterMessage(GenericSignature) +_sym_db.RegisterMessage(GenericSignature.MapEntry) + + +_SIGNATURES_NAMEDSIGNATURESENTRY._options = None +_GENERICSIGNATURE_MAPENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.cc new file mode 100644 index 0000000..6752c3a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.cc @@ -0,0 +1,3353 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto + +#include "diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SparseVector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Vector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_BinaryNode; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_TreeNode; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GiniStats; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LeafStat_LeastSquaresRegressionStats; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_FertileSlot; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_LeafStat; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_SplitCandidate; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_LeafStat_GiniImpurityClassificationStats; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { +class FertileStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FertileStats_default_instance_; +class GiniStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GiniStats_default_instance_; +class LeafStat_GiniImpurityClassificationStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::decision_trees::Vector* dense_counts_; + const ::diplomacy::tensorflow::decision_trees::SparseVector* sparse_counts_; +} _LeafStat_GiniImpurityClassificationStats_default_instance_; +class LeafStat_LeastSquaresRegressionStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LeafStat_LeastSquaresRegressionStats_default_instance_; +class LeafStatDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* classification_; + const ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* regression_; +} _LeafStat_default_instance_; +class FertileSlotDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FertileSlot_default_instance_; +class SplitCandidateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SplitCandidate_default_instance_; +class TreePathDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TreePath_default_instance_; +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto { +static void InitDefaultsFertileStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_FertileStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::FertileStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::FertileStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_FertileStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFertileStats}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_FertileSlot.base,}}; + +static void InitDefaultsGiniStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_GiniStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::GiniStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::GiniStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GiniStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGiniStats}, {}}; + +static void InitDefaultsLeafStat_GiniImpurityClassificationStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_LeafStat_GiniImpurityClassificationStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_LeafStat_GiniImpurityClassificationStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsLeafStat_GiniImpurityClassificationStats}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Vector.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_SparseVector.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_GiniStats.base,}}; + +static void InitDefaultsLeafStat_LeastSquaresRegressionStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_LeafStat_LeastSquaresRegressionStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_LeafStat_LeastSquaresRegressionStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsLeafStat_LeastSquaresRegressionStats}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_Vector.base,}}; + +static void InitDefaultsLeafStat() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::LeafStat(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::LeafStat::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_LeafStat = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsLeafStat}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_GiniImpurityClassificationStats.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_LeastSquaresRegressionStats.base,}}; + +static void InitDefaultsFertileSlot() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_FertileSlot_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::FertileSlot(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::FertileSlot::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_FertileSlot = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFertileSlot}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_SplitCandidate.base,}}; + +static void InitDefaultsSplitCandidate() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_SplitCandidate_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::SplitCandidate(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::SplitCandidate::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_SplitCandidate = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsSplitCandidate}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_BinaryNode.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat.base,}}; + +static void InitDefaultsTreePath() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_TreePath_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::TreePath(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::TreePath::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TreePath = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTreePath}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::scc_info_TreeNode.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_FertileStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_GiniStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_LeafStat_GiniImpurityClassificationStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_LeafStat_LeastSquaresRegressionStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_LeafStat.base); + ::google::protobuf::internal::InitSCC(&scc_info_FertileSlot.base); + ::google::protobuf::internal::InitSCC(&scc_info_SplitCandidate.base); + ::google::protobuf::internal::InitSCC(&scc_info_TreePath.base); +} + +::google::protobuf::Metadata file_level_metadata[8]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileStats, node_to_slot_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::GiniStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::GiniStats, square_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStatsDefaultTypeInternal, dense_counts_), + offsetof(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStatsDefaultTypeInternal, sparse_counts_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats, gini_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats, counts_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats, mean_output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats, mean_output_squares_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat, weight_sum_), + offsetof(::diplomacy::tensorflow::tensorforest::LeafStatDefaultTypeInternal, classification_), + offsetof(::diplomacy::tensorflow::tensorforest::LeafStatDefaultTypeInternal, regression_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LeafStat, leaf_stat_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileSlot, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileSlot, leaf_stats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileSlot, candidates_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileSlot, post_init_leaf_stats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileSlot, node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::FertileSlot, depth_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitCandidate, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitCandidate, split_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitCandidate, left_stats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitCandidate, right_stats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitCandidate, unique_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TreePath, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TreePath, nodes_visited_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tensorforest::FertileStats)}, + { 6, -1, sizeof(::diplomacy::tensorflow::tensorforest::GiniStats)}, + { 12, -1, sizeof(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats)}, + { 21, -1, sizeof(::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats)}, + { 28, -1, sizeof(::diplomacy::tensorflow::tensorforest::LeafStat)}, + { 37, -1, sizeof(::diplomacy::tensorflow::tensorforest::FertileSlot)}, + { 47, -1, sizeof(::diplomacy::tensorflow::tensorforest::SplitCandidate)}, + { 56, -1, sizeof(::diplomacy::tensorflow::tensorforest::TreePath)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_FertileStats_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_GiniStats_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_LeafStat_GiniImpurityClassificationStats_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_LeafStat_LeastSquaresRegressionStats_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_FertileSlot_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_SplitCandidate_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_TreePath_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 8); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nDdiplomacy_tensorflow/contrib/tensor_fo" + "rest/proto/fertile_stats.proto\022!diplomac" + "y.tensorflow.tensorforest\032Jdiplomacy_ten" + "sorflow/contrib/decision_trees/proto/gen" + "eric_tree_model.proto\"T\n\014FertileStats\022D\n" + "\014node_to_slot\030\001 \003(\0132..diplomacy.tensorfl" + "ow.tensorforest.FertileSlot\"\033\n\tGiniStats" + "\022\016\n\006square\030\002 \001(\002\"\230\005\n\010LeafStat\022\022\n\nweight_" + "sum\030\003 \001(\002\022e\n\016classification\030\001 \001(\0132K.dipl" + "omacy.tensorflow.tensorforest.LeafStat.G" + "iniImpurityClassificationStatsH\000\022]\n\nregr" + "ession\030\002 \001(\0132G.diplomacy.tensorflow.tens" + "orforest.LeafStat.LeastSquaresRegression" + "StatsH\000\032\370\001\n\037GiniImpurityClassificationSt" + "ats\022C\n\014dense_counts\030\001 \001(\0132+.diplomacy.te" + "nsorflow.decision_trees.VectorH\000\022J\n\rspar" + "se_counts\030\002 \001(\01321.diplomacy.tensorflow.d" + "ecision_trees.SparseVectorH\000\022:\n\004gini\030\003 \001" + "(\0132,.diplomacy.tensorflow.tensorforest.G" + "iniStatsB\010\n\006counts\032\251\001\n\033LeastSquaresRegre" + "ssionStats\022@\n\013mean_output\030\001 \001(\0132+.diplom" + "acy.tensorflow.decision_trees.Vector\022H\n\023" + "mean_output_squares\030\002 \001(\0132+.diplomacy.te" + "nsorflow.decision_trees.VectorB\013\n\tleaf_s" + "tat\"\200\002\n\013FertileSlot\022\?\n\nleaf_stats\030\004 \001(\0132" + "+.diplomacy.tensorflow.tensorforest.Leaf" + "Stat\022E\n\ncandidates\030\001 \003(\01321.diplomacy.ten" + "sorflow.tensorforest.SplitCandidate\022I\n\024p" + "ost_init_leaf_stats\030\006 \001(\0132+.diplomacy.te" + "nsorflow.tensorforest.LeafStat\022\017\n\007node_i" + "d\030\005 \001(\005\022\r\n\005depth\030\007 \001(\005\"\346\001\n\016SplitCandidat" + "e\022>\n\005split\030\001 \001(\0132/.diplomacy.tensorflow." + "decision_trees.BinaryNode\022\?\n\nleft_stats\030" + "\004 \001(\0132+.diplomacy.tensorflow.tensorfores" + "t.LeafStat\022@\n\013right_stats\030\005 \001(\0132+.diplom" + "acy.tensorflow.tensorforest.LeafStat\022\021\n\t" + "unique_id\030\006 \001(\t\"P\n\010TreePath\022D\n\rnodes_vis" + "ited\030\001 \003(\0132-.diplomacy.tensorflow.decisi" + "on_trees.TreeNodeB\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1550); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { + +// =================================================================== + +void FertileStats::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FertileStats::kNodeToSlotFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FertileStats::FertileStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_FertileStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.FertileStats) +} +FertileStats::FertileStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_to_slot_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_FertileStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.FertileStats) +} +FertileStats::FertileStats(const FertileStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + node_to_slot_(from.node_to_slot_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.FertileStats) +} + +void FertileStats::SharedCtor() { +} + +FertileStats::~FertileStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.FertileStats) + SharedDtor(); +} + +void FertileStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void FertileStats::ArenaDtor(void* object) { + FertileStats* _this = reinterpret_cast< FertileStats* >(object); + (void)_this; +} +void FertileStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FertileStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FertileStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FertileStats& FertileStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_FertileStats.base); + return *internal_default_instance(); +} + + +void FertileStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.FertileStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_to_slot_.Clear(); + _internal_metadata_.Clear(); +} + +bool FertileStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.FertileStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tensorforest.FertileSlot node_to_slot = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node_to_slot())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.FertileStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.FertileStats) + return false; +#undef DO_ +} + +void FertileStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.FertileStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tensorforest.FertileSlot node_to_slot = 1; + for (unsigned int i = 0, + n = static_cast(this->node_to_slot_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->node_to_slot(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.FertileStats) +} + +::google::protobuf::uint8* FertileStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.FertileStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tensorforest.FertileSlot node_to_slot = 1; + for (unsigned int i = 0, + n = static_cast(this->node_to_slot_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->node_to_slot(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.FertileStats) + return target; +} + +size_t FertileStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.FertileStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tensorforest.FertileSlot node_to_slot = 1; + { + unsigned int count = static_cast(this->node_to_slot_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node_to_slot(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FertileStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.FertileStats) + GOOGLE_DCHECK_NE(&from, this); + const FertileStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.FertileStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.FertileStats) + MergeFrom(*source); + } +} + +void FertileStats::MergeFrom(const FertileStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.FertileStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + node_to_slot_.MergeFrom(from.node_to_slot_); +} + +void FertileStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.FertileStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FertileStats::CopyFrom(const FertileStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.FertileStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FertileStats::IsInitialized() const { + return true; +} + +void FertileStats::Swap(FertileStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FertileStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FertileStats::UnsafeArenaSwap(FertileStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FertileStats::InternalSwap(FertileStats* other) { + using std::swap; + CastToBase(&node_to_slot_)->InternalSwap(CastToBase(&other->node_to_slot_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FertileStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GiniStats::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GiniStats::kSquareFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GiniStats::GiniStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_GiniStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.GiniStats) +} +GiniStats::GiniStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_GiniStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.GiniStats) +} +GiniStats::GiniStats(const GiniStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + square_ = from.square_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.GiniStats) +} + +void GiniStats::SharedCtor() { + square_ = 0; +} + +GiniStats::~GiniStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.GiniStats) + SharedDtor(); +} + +void GiniStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GiniStats::ArenaDtor(void* object) { + GiniStats* _this = reinterpret_cast< GiniStats* >(object); + (void)_this; +} +void GiniStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GiniStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GiniStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GiniStats& GiniStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_GiniStats.base); + return *internal_default_instance(); +} + + +void GiniStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.GiniStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + square_ = 0; + _internal_metadata_.Clear(); +} + +bool GiniStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.GiniStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float square = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &square_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.GiniStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.GiniStats) + return false; +#undef DO_ +} + +void GiniStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.GiniStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float square = 2; + if (this->square() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->square(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.GiniStats) +} + +::google::protobuf::uint8* GiniStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.GiniStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float square = 2; + if (this->square() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->square(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.GiniStats) + return target; +} + +size_t GiniStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.GiniStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float square = 2; + if (this->square() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GiniStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.GiniStats) + GOOGLE_DCHECK_NE(&from, this); + const GiniStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.GiniStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.GiniStats) + MergeFrom(*source); + } +} + +void GiniStats::MergeFrom(const GiniStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.GiniStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.square() != 0) { + set_square(from.square()); + } +} + +void GiniStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.GiniStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GiniStats::CopyFrom(const GiniStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.GiniStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GiniStats::IsInitialized() const { + return true; +} + +void GiniStats::Swap(GiniStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GiniStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GiniStats::UnsafeArenaSwap(GiniStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GiniStats::InternalSwap(GiniStats* other) { + using std::swap; + swap(square_, other->square_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GiniStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LeafStat_GiniImpurityClassificationStats::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_LeafStat_GiniImpurityClassificationStats_default_instance_.dense_counts_ = const_cast< ::diplomacy::tensorflow::decision_trees::Vector*>( + ::diplomacy::tensorflow::decision_trees::Vector::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_LeafStat_GiniImpurityClassificationStats_default_instance_.sparse_counts_ = const_cast< ::diplomacy::tensorflow::decision_trees::SparseVector*>( + ::diplomacy::tensorflow::decision_trees::SparseVector::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_LeafStat_GiniImpurityClassificationStats_default_instance_._instance.get_mutable()->gini_ = const_cast< ::diplomacy::tensorflow::tensorforest::GiniStats*>( + ::diplomacy::tensorflow::tensorforest::GiniStats::internal_default_instance()); +} +void LeafStat_GiniImpurityClassificationStats::set_allocated_dense_counts(::diplomacy::tensorflow::decision_trees::Vector* dense_counts) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_counts(); + if (dense_counts) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(dense_counts)->GetArena(); + if (message_arena != submessage_arena) { + dense_counts = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dense_counts, submessage_arena); + } + set_has_dense_counts(); + counts_.dense_counts_ = dense_counts; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.dense_counts) +} +void LeafStat_GiniImpurityClassificationStats::clear_dense_counts() { + if (has_dense_counts()) { + if (GetArenaNoVirtual() == NULL) { + delete counts_.dense_counts_; + } + clear_has_counts(); + } +} +void LeafStat_GiniImpurityClassificationStats::set_allocated_sparse_counts(::diplomacy::tensorflow::decision_trees::SparseVector* sparse_counts) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_counts(); + if (sparse_counts) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(sparse_counts)->GetArena(); + if (message_arena != submessage_arena) { + sparse_counts = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sparse_counts, submessage_arena); + } + set_has_sparse_counts(); + counts_.sparse_counts_ = sparse_counts; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.sparse_counts) +} +void LeafStat_GiniImpurityClassificationStats::clear_sparse_counts() { + if (has_sparse_counts()) { + if (GetArenaNoVirtual() == NULL) { + delete counts_.sparse_counts_; + } + clear_has_counts(); + } +} +void LeafStat_GiniImpurityClassificationStats::unsafe_arena_set_allocated_gini( + ::diplomacy::tensorflow::tensorforest::GiniStats* gini) { + if (GetArenaNoVirtual() == NULL) { + delete gini_; + } + gini_ = gini; + if (gini) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.gini) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LeafStat_GiniImpurityClassificationStats::kDenseCountsFieldNumber; +const int LeafStat_GiniImpurityClassificationStats::kSparseCountsFieldNumber; +const int LeafStat_GiniImpurityClassificationStats::kGiniFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LeafStat_GiniImpurityClassificationStats::LeafStat_GiniImpurityClassificationStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_GiniImpurityClassificationStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) +} +LeafStat_GiniImpurityClassificationStats::LeafStat_GiniImpurityClassificationStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_GiniImpurityClassificationStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) +} +LeafStat_GiniImpurityClassificationStats::LeafStat_GiniImpurityClassificationStats(const LeafStat_GiniImpurityClassificationStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_gini()) { + gini_ = new ::diplomacy::tensorflow::tensorforest::GiniStats(*from.gini_); + } else { + gini_ = NULL; + } + clear_has_counts(); + switch (from.counts_case()) { + case kDenseCounts: { + mutable_dense_counts()->::diplomacy::tensorflow::decision_trees::Vector::MergeFrom(from.dense_counts()); + break; + } + case kSparseCounts: { + mutable_sparse_counts()->::diplomacy::tensorflow::decision_trees::SparseVector::MergeFrom(from.sparse_counts()); + break; + } + case COUNTS_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) +} + +void LeafStat_GiniImpurityClassificationStats::SharedCtor() { + gini_ = NULL; + clear_has_counts(); +} + +LeafStat_GiniImpurityClassificationStats::~LeafStat_GiniImpurityClassificationStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + SharedDtor(); +} + +void LeafStat_GiniImpurityClassificationStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete gini_; + if (has_counts()) { + clear_counts(); + } +} + +void LeafStat_GiniImpurityClassificationStats::ArenaDtor(void* object) { + LeafStat_GiniImpurityClassificationStats* _this = reinterpret_cast< LeafStat_GiniImpurityClassificationStats* >(object); + (void)_this; +} +void LeafStat_GiniImpurityClassificationStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LeafStat_GiniImpurityClassificationStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LeafStat_GiniImpurityClassificationStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LeafStat_GiniImpurityClassificationStats& LeafStat_GiniImpurityClassificationStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_GiniImpurityClassificationStats.base); + return *internal_default_instance(); +} + + +void LeafStat_GiniImpurityClassificationStats::clear_counts() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + switch (counts_case()) { + case kDenseCounts: { + if (GetArenaNoVirtual() == NULL) { + delete counts_.dense_counts_; + } + break; + } + case kSparseCounts: { + if (GetArenaNoVirtual() == NULL) { + delete counts_.sparse_counts_; + } + break; + } + case COUNTS_NOT_SET: { + break; + } + } + _oneof_case_[0] = COUNTS_NOT_SET; +} + + +void LeafStat_GiniImpurityClassificationStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && gini_ != NULL) { + delete gini_; + } + gini_ = NULL; + clear_counts(); + _internal_metadata_.Clear(); +} + +bool LeafStat_GiniImpurityClassificationStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.Vector dense_counts = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dense_counts())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_counts = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sparse_counts())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.GiniStats gini = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_gini())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + return false; +#undef DO_ +} + +void LeafStat_GiniImpurityClassificationStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Vector dense_counts = 1; + if (has_dense_counts()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_dense_counts(), output); + } + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_counts = 2; + if (has_sparse_counts()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_sparse_counts(), output); + } + + // .diplomacy.tensorflow.tensorforest.GiniStats gini = 3; + if (this->has_gini()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_gini(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) +} + +::google::protobuf::uint8* LeafStat_GiniImpurityClassificationStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Vector dense_counts = 1; + if (has_dense_counts()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_dense_counts(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_counts = 2; + if (has_sparse_counts()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_sparse_counts(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.GiniStats gini = 3; + if (this->has_gini()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_gini(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + return target; +} + +size_t LeafStat_GiniImpurityClassificationStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.tensorforest.GiniStats gini = 3; + if (this->has_gini()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *gini_); + } + + switch (counts_case()) { + // .diplomacy.tensorflow.decision_trees.Vector dense_counts = 1; + case kDenseCounts: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *counts_.dense_counts_); + break; + } + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_counts = 2; + case kSparseCounts: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *counts_.sparse_counts_); + break; + } + case COUNTS_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LeafStat_GiniImpurityClassificationStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + GOOGLE_DCHECK_NE(&from, this); + const LeafStat_GiniImpurityClassificationStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + MergeFrom(*source); + } +} + +void LeafStat_GiniImpurityClassificationStats::MergeFrom(const LeafStat_GiniImpurityClassificationStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_gini()) { + mutable_gini()->::diplomacy::tensorflow::tensorforest::GiniStats::MergeFrom(from.gini()); + } + switch (from.counts_case()) { + case kDenseCounts: { + mutable_dense_counts()->::diplomacy::tensorflow::decision_trees::Vector::MergeFrom(from.dense_counts()); + break; + } + case kSparseCounts: { + mutable_sparse_counts()->::diplomacy::tensorflow::decision_trees::SparseVector::MergeFrom(from.sparse_counts()); + break; + } + case COUNTS_NOT_SET: { + break; + } + } +} + +void LeafStat_GiniImpurityClassificationStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LeafStat_GiniImpurityClassificationStats::CopyFrom(const LeafStat_GiniImpurityClassificationStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LeafStat_GiniImpurityClassificationStats::IsInitialized() const { + return true; +} + +void LeafStat_GiniImpurityClassificationStats::Swap(LeafStat_GiniImpurityClassificationStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LeafStat_GiniImpurityClassificationStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LeafStat_GiniImpurityClassificationStats::UnsafeArenaSwap(LeafStat_GiniImpurityClassificationStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LeafStat_GiniImpurityClassificationStats::InternalSwap(LeafStat_GiniImpurityClassificationStats* other) { + using std::swap; + swap(gini_, other->gini_); + swap(counts_, other->counts_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LeafStat_GiniImpurityClassificationStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LeafStat_LeastSquaresRegressionStats::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_LeafStat_LeastSquaresRegressionStats_default_instance_._instance.get_mutable()->mean_output_ = const_cast< ::diplomacy::tensorflow::decision_trees::Vector*>( + ::diplomacy::tensorflow::decision_trees::Vector::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_LeafStat_LeastSquaresRegressionStats_default_instance_._instance.get_mutable()->mean_output_squares_ = const_cast< ::diplomacy::tensorflow::decision_trees::Vector*>( + ::diplomacy::tensorflow::decision_trees::Vector::internal_default_instance()); +} +void LeafStat_LeastSquaresRegressionStats::unsafe_arena_set_allocated_mean_output( + ::diplomacy::tensorflow::decision_trees::Vector* mean_output) { + if (GetArenaNoVirtual() == NULL) { + delete mean_output_; + } + mean_output_ = mean_output; + if (mean_output) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output) +} +void LeafStat_LeastSquaresRegressionStats::clear_mean_output() { + if (GetArenaNoVirtual() == NULL && mean_output_ != NULL) { + delete mean_output_; + } + mean_output_ = NULL; +} +void LeafStat_LeastSquaresRegressionStats::unsafe_arena_set_allocated_mean_output_squares( + ::diplomacy::tensorflow::decision_trees::Vector* mean_output_squares) { + if (GetArenaNoVirtual() == NULL) { + delete mean_output_squares_; + } + mean_output_squares_ = mean_output_squares; + if (mean_output_squares) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output_squares) +} +void LeafStat_LeastSquaresRegressionStats::clear_mean_output_squares() { + if (GetArenaNoVirtual() == NULL && mean_output_squares_ != NULL) { + delete mean_output_squares_; + } + mean_output_squares_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LeafStat_LeastSquaresRegressionStats::kMeanOutputFieldNumber; +const int LeafStat_LeastSquaresRegressionStats::kMeanOutputSquaresFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LeafStat_LeastSquaresRegressionStats::LeafStat_LeastSquaresRegressionStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_LeastSquaresRegressionStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) +} +LeafStat_LeastSquaresRegressionStats::LeafStat_LeastSquaresRegressionStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_LeastSquaresRegressionStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) +} +LeafStat_LeastSquaresRegressionStats::LeafStat_LeastSquaresRegressionStats(const LeafStat_LeastSquaresRegressionStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_mean_output()) { + mean_output_ = new ::diplomacy::tensorflow::decision_trees::Vector(*from.mean_output_); + } else { + mean_output_ = NULL; + } + if (from.has_mean_output_squares()) { + mean_output_squares_ = new ::diplomacy::tensorflow::decision_trees::Vector(*from.mean_output_squares_); + } else { + mean_output_squares_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) +} + +void LeafStat_LeastSquaresRegressionStats::SharedCtor() { + ::memset(&mean_output_, 0, static_cast( + reinterpret_cast(&mean_output_squares_) - + reinterpret_cast(&mean_output_)) + sizeof(mean_output_squares_)); +} + +LeafStat_LeastSquaresRegressionStats::~LeafStat_LeastSquaresRegressionStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + SharedDtor(); +} + +void LeafStat_LeastSquaresRegressionStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete mean_output_; + if (this != internal_default_instance()) delete mean_output_squares_; +} + +void LeafStat_LeastSquaresRegressionStats::ArenaDtor(void* object) { + LeafStat_LeastSquaresRegressionStats* _this = reinterpret_cast< LeafStat_LeastSquaresRegressionStats* >(object); + (void)_this; +} +void LeafStat_LeastSquaresRegressionStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LeafStat_LeastSquaresRegressionStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LeafStat_LeastSquaresRegressionStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LeafStat_LeastSquaresRegressionStats& LeafStat_LeastSquaresRegressionStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat_LeastSquaresRegressionStats.base); + return *internal_default_instance(); +} + + +void LeafStat_LeastSquaresRegressionStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && mean_output_ != NULL) { + delete mean_output_; + } + mean_output_ = NULL; + if (GetArenaNoVirtual() == NULL && mean_output_squares_ != NULL) { + delete mean_output_squares_; + } + mean_output_squares_ = NULL; + _internal_metadata_.Clear(); +} + +bool LeafStat_LeastSquaresRegressionStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.Vector mean_output = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_mean_output())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.Vector mean_output_squares = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_mean_output_squares())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + return false; +#undef DO_ +} + +void LeafStat_LeastSquaresRegressionStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Vector mean_output = 1; + if (this->has_mean_output()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_mean_output(), output); + } + + // .diplomacy.tensorflow.decision_trees.Vector mean_output_squares = 2; + if (this->has_mean_output_squares()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_mean_output_squares(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) +} + +::google::protobuf::uint8* LeafStat_LeastSquaresRegressionStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.Vector mean_output = 1; + if (this->has_mean_output()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_mean_output(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.Vector mean_output_squares = 2; + if (this->has_mean_output_squares()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_mean_output_squares(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + return target; +} + +size_t LeafStat_LeastSquaresRegressionStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.decision_trees.Vector mean_output = 1; + if (this->has_mean_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *mean_output_); + } + + // .diplomacy.tensorflow.decision_trees.Vector mean_output_squares = 2; + if (this->has_mean_output_squares()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *mean_output_squares_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LeafStat_LeastSquaresRegressionStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + GOOGLE_DCHECK_NE(&from, this); + const LeafStat_LeastSquaresRegressionStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + MergeFrom(*source); + } +} + +void LeafStat_LeastSquaresRegressionStats::MergeFrom(const LeafStat_LeastSquaresRegressionStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_mean_output()) { + mutable_mean_output()->::diplomacy::tensorflow::decision_trees::Vector::MergeFrom(from.mean_output()); + } + if (from.has_mean_output_squares()) { + mutable_mean_output_squares()->::diplomacy::tensorflow::decision_trees::Vector::MergeFrom(from.mean_output_squares()); + } +} + +void LeafStat_LeastSquaresRegressionStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LeafStat_LeastSquaresRegressionStats::CopyFrom(const LeafStat_LeastSquaresRegressionStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LeafStat_LeastSquaresRegressionStats::IsInitialized() const { + return true; +} + +void LeafStat_LeastSquaresRegressionStats::Swap(LeafStat_LeastSquaresRegressionStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LeafStat_LeastSquaresRegressionStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LeafStat_LeastSquaresRegressionStats::UnsafeArenaSwap(LeafStat_LeastSquaresRegressionStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LeafStat_LeastSquaresRegressionStats::InternalSwap(LeafStat_LeastSquaresRegressionStats* other) { + using std::swap; + swap(mean_output_, other->mean_output_); + swap(mean_output_squares_, other->mean_output_squares_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LeafStat_LeastSquaresRegressionStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LeafStat::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_.classification_ = const_cast< ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats*>( + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_.regression_ = const_cast< ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats*>( + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats::internal_default_instance()); +} +void LeafStat::set_allocated_classification(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* classification) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf_stat(); + if (classification) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(classification); + if (message_arena != submessage_arena) { + classification = ::google::protobuf::internal::GetOwnedMessage( + message_arena, classification, submessage_arena); + } + set_has_classification(); + leaf_stat_.classification_ = classification; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.classification) +} +void LeafStat::set_allocated_regression(::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* regression) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf_stat(); + if (regression) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(regression); + if (message_arena != submessage_arena) { + regression = ::google::protobuf::internal::GetOwnedMessage( + message_arena, regression, submessage_arena); + } + set_has_regression(); + leaf_stat_.regression_ = regression; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.regression) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LeafStat::kWeightSumFieldNumber; +const int LeafStat::kClassificationFieldNumber; +const int LeafStat::kRegressionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LeafStat::LeafStat() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.LeafStat) +} +LeafStat::LeafStat(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.LeafStat) +} +LeafStat::LeafStat(const LeafStat& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + weight_sum_ = from.weight_sum_; + clear_has_leaf_stat(); + switch (from.leaf_stat_case()) { + case kClassification: { + mutable_classification()->::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats::MergeFrom(from.classification()); + break; + } + case kRegression: { + mutable_regression()->::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats::MergeFrom(from.regression()); + break; + } + case LEAF_STAT_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.LeafStat) +} + +void LeafStat::SharedCtor() { + weight_sum_ = 0; + clear_has_leaf_stat(); +} + +LeafStat::~LeafStat() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.LeafStat) + SharedDtor(); +} + +void LeafStat::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_leaf_stat()) { + clear_leaf_stat(); + } +} + +void LeafStat::ArenaDtor(void* object) { + LeafStat* _this = reinterpret_cast< LeafStat* >(object); + (void)_this; +} +void LeafStat::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LeafStat::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LeafStat::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LeafStat& LeafStat::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_LeafStat.base); + return *internal_default_instance(); +} + + +void LeafStat::clear_leaf_stat() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tensorforest.LeafStat) + switch (leaf_stat_case()) { + case kClassification: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_stat_.classification_; + } + break; + } + case kRegression: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_stat_.regression_; + } + break; + } + case LEAF_STAT_NOT_SET: { + break; + } + } + _oneof_case_[0] = LEAF_STAT_NOT_SET; +} + + +void LeafStat::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.LeafStat) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + weight_sum_ = 0; + clear_leaf_stat(); + _internal_metadata_.Clear(); +} + +bool LeafStat::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.LeafStat) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats classification = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_classification())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats regression = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_regression())); + } else { + goto handle_unusual; + } + break; + } + + // float weight_sum = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_sum_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.LeafStat) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.LeafStat) + return false; +#undef DO_ +} + +void LeafStat::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.LeafStat) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats classification = 1; + if (has_classification()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_classification(), output); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats regression = 2; + if (has_regression()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_regression(), output); + } + + // float weight_sum = 3; + if (this->weight_sum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->weight_sum(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.LeafStat) +} + +::google::protobuf::uint8* LeafStat::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.LeafStat) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats classification = 1; + if (has_classification()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_classification(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats regression = 2; + if (has_regression()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_regression(), deterministic, target); + } + + // float weight_sum = 3; + if (this->weight_sum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->weight_sum(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.LeafStat) + return target; +} + +size_t LeafStat::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.LeafStat) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float weight_sum = 3; + if (this->weight_sum() != 0) { + total_size += 1 + 4; + } + + switch (leaf_stat_case()) { + // .diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats classification = 1; + case kClassification: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_stat_.classification_); + break; + } + // .diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats regression = 2; + case kRegression: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_stat_.regression_); + break; + } + case LEAF_STAT_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LeafStat::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.LeafStat) + GOOGLE_DCHECK_NE(&from, this); + const LeafStat* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.LeafStat) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.LeafStat) + MergeFrom(*source); + } +} + +void LeafStat::MergeFrom(const LeafStat& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.LeafStat) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.weight_sum() != 0) { + set_weight_sum(from.weight_sum()); + } + switch (from.leaf_stat_case()) { + case kClassification: { + mutable_classification()->::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats::MergeFrom(from.classification()); + break; + } + case kRegression: { + mutable_regression()->::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats::MergeFrom(from.regression()); + break; + } + case LEAF_STAT_NOT_SET: { + break; + } + } +} + +void LeafStat::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.LeafStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LeafStat::CopyFrom(const LeafStat& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.LeafStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LeafStat::IsInitialized() const { + return true; +} + +void LeafStat::Swap(LeafStat* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LeafStat* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LeafStat::UnsafeArenaSwap(LeafStat* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LeafStat::InternalSwap(LeafStat* other) { + using std::swap; + swap(weight_sum_, other->weight_sum_); + swap(leaf_stat_, other->leaf_stat_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LeafStat::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FertileSlot::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_FertileSlot_default_instance_._instance.get_mutable()->leaf_stats_ = const_cast< ::diplomacy::tensorflow::tensorforest::LeafStat*>( + ::diplomacy::tensorflow::tensorforest::LeafStat::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_FertileSlot_default_instance_._instance.get_mutable()->post_init_leaf_stats_ = const_cast< ::diplomacy::tensorflow::tensorforest::LeafStat*>( + ::diplomacy::tensorflow::tensorforest::LeafStat::internal_default_instance()); +} +void FertileSlot::unsafe_arena_set_allocated_leaf_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* leaf_stats) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_stats_; + } + leaf_stats_ = leaf_stats; + if (leaf_stats) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.FertileSlot.leaf_stats) +} +void FertileSlot::unsafe_arena_set_allocated_post_init_leaf_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* post_init_leaf_stats) { + if (GetArenaNoVirtual() == NULL) { + delete post_init_leaf_stats_; + } + post_init_leaf_stats_ = post_init_leaf_stats; + if (post_init_leaf_stats) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.FertileSlot.post_init_leaf_stats) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FertileSlot::kLeafStatsFieldNumber; +const int FertileSlot::kCandidatesFieldNumber; +const int FertileSlot::kPostInitLeafStatsFieldNumber; +const int FertileSlot::kNodeIdFieldNumber; +const int FertileSlot::kDepthFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FertileSlot::FertileSlot() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_FertileSlot.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.FertileSlot) +} +FertileSlot::FertileSlot(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + candidates_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_FertileSlot.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.FertileSlot) +} +FertileSlot::FertileSlot(const FertileSlot& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + candidates_(from.candidates_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_leaf_stats()) { + leaf_stats_ = new ::diplomacy::tensorflow::tensorforest::LeafStat(*from.leaf_stats_); + } else { + leaf_stats_ = NULL; + } + if (from.has_post_init_leaf_stats()) { + post_init_leaf_stats_ = new ::diplomacy::tensorflow::tensorforest::LeafStat(*from.post_init_leaf_stats_); + } else { + post_init_leaf_stats_ = NULL; + } + ::memcpy(&node_id_, &from.node_id_, + static_cast(reinterpret_cast(&depth_) - + reinterpret_cast(&node_id_)) + sizeof(depth_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.FertileSlot) +} + +void FertileSlot::SharedCtor() { + ::memset(&leaf_stats_, 0, static_cast( + reinterpret_cast(&depth_) - + reinterpret_cast(&leaf_stats_)) + sizeof(depth_)); +} + +FertileSlot::~FertileSlot() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.FertileSlot) + SharedDtor(); +} + +void FertileSlot::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete leaf_stats_; + if (this != internal_default_instance()) delete post_init_leaf_stats_; +} + +void FertileSlot::ArenaDtor(void* object) { + FertileSlot* _this = reinterpret_cast< FertileSlot* >(object); + (void)_this; +} +void FertileSlot::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FertileSlot::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FertileSlot::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FertileSlot& FertileSlot::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_FertileSlot.base); + return *internal_default_instance(); +} + + +void FertileSlot::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.FertileSlot) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + candidates_.Clear(); + if (GetArenaNoVirtual() == NULL && leaf_stats_ != NULL) { + delete leaf_stats_; + } + leaf_stats_ = NULL; + if (GetArenaNoVirtual() == NULL && post_init_leaf_stats_ != NULL) { + delete post_init_leaf_stats_; + } + post_init_leaf_stats_ = NULL; + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&depth_) - + reinterpret_cast(&node_id_)) + sizeof(depth_)); + _internal_metadata_.Clear(); +} + +bool FertileSlot::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.FertileSlot) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tensorforest.SplitCandidate candidates = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_candidates())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.LeafStat leaf_stats = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_leaf_stats())); + } else { + goto handle_unusual; + } + break; + } + + // int32 node_id = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &node_id_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.LeafStat post_init_leaf_stats = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_post_init_leaf_stats())); + } else { + goto handle_unusual; + } + break; + } + + // int32 depth = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &depth_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.FertileSlot) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.FertileSlot) + return false; +#undef DO_ +} + +void FertileSlot::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.FertileSlot) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tensorforest.SplitCandidate candidates = 1; + for (unsigned int i = 0, + n = static_cast(this->candidates_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->candidates(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat leaf_stats = 4; + if (this->has_leaf_stats()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_leaf_stats(), output); + } + + // int32 node_id = 5; + if (this->node_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->node_id(), output); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat post_init_leaf_stats = 6; + if (this->has_post_init_leaf_stats()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_post_init_leaf_stats(), output); + } + + // int32 depth = 7; + if (this->depth() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->depth(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.FertileSlot) +} + +::google::protobuf::uint8* FertileSlot::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.FertileSlot) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tensorforest.SplitCandidate candidates = 1; + for (unsigned int i = 0, + n = static_cast(this->candidates_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->candidates(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat leaf_stats = 4; + if (this->has_leaf_stats()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_leaf_stats(), deterministic, target); + } + + // int32 node_id = 5; + if (this->node_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->node_id(), target); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat post_init_leaf_stats = 6; + if (this->has_post_init_leaf_stats()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_post_init_leaf_stats(), deterministic, target); + } + + // int32 depth = 7; + if (this->depth() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->depth(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.FertileSlot) + return target; +} + +size_t FertileSlot::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.FertileSlot) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tensorforest.SplitCandidate candidates = 1; + { + unsigned int count = static_cast(this->candidates_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->candidates(static_cast(i))); + } + } + + // .diplomacy.tensorflow.tensorforest.LeafStat leaf_stats = 4; + if (this->has_leaf_stats()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_stats_); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat post_init_leaf_stats = 6; + if (this->has_post_init_leaf_stats()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *post_init_leaf_stats_); + } + + // int32 node_id = 5; + if (this->node_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->node_id()); + } + + // int32 depth = 7; + if (this->depth() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->depth()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FertileSlot::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.FertileSlot) + GOOGLE_DCHECK_NE(&from, this); + const FertileSlot* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.FertileSlot) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.FertileSlot) + MergeFrom(*source); + } +} + +void FertileSlot::MergeFrom(const FertileSlot& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.FertileSlot) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + candidates_.MergeFrom(from.candidates_); + if (from.has_leaf_stats()) { + mutable_leaf_stats()->::diplomacy::tensorflow::tensorforest::LeafStat::MergeFrom(from.leaf_stats()); + } + if (from.has_post_init_leaf_stats()) { + mutable_post_init_leaf_stats()->::diplomacy::tensorflow::tensorforest::LeafStat::MergeFrom(from.post_init_leaf_stats()); + } + if (from.node_id() != 0) { + set_node_id(from.node_id()); + } + if (from.depth() != 0) { + set_depth(from.depth()); + } +} + +void FertileSlot::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.FertileSlot) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FertileSlot::CopyFrom(const FertileSlot& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.FertileSlot) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FertileSlot::IsInitialized() const { + return true; +} + +void FertileSlot::Swap(FertileSlot* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FertileSlot* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FertileSlot::UnsafeArenaSwap(FertileSlot* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FertileSlot::InternalSwap(FertileSlot* other) { + using std::swap; + CastToBase(&candidates_)->InternalSwap(CastToBase(&other->candidates_)); + swap(leaf_stats_, other->leaf_stats_); + swap(post_init_leaf_stats_, other->post_init_leaf_stats_); + swap(node_id_, other->node_id_); + swap(depth_, other->depth_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FertileSlot::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SplitCandidate::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_SplitCandidate_default_instance_._instance.get_mutable()->split_ = const_cast< ::diplomacy::tensorflow::decision_trees::BinaryNode*>( + ::diplomacy::tensorflow::decision_trees::BinaryNode::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_SplitCandidate_default_instance_._instance.get_mutable()->left_stats_ = const_cast< ::diplomacy::tensorflow::tensorforest::LeafStat*>( + ::diplomacy::tensorflow::tensorforest::LeafStat::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_SplitCandidate_default_instance_._instance.get_mutable()->right_stats_ = const_cast< ::diplomacy::tensorflow::tensorforest::LeafStat*>( + ::diplomacy::tensorflow::tensorforest::LeafStat::internal_default_instance()); +} +void SplitCandidate::unsafe_arena_set_allocated_split( + ::diplomacy::tensorflow::decision_trees::BinaryNode* split) { + if (GetArenaNoVirtual() == NULL) { + delete split_; + } + split_ = split; + if (split) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.split) +} +void SplitCandidate::clear_split() { + if (GetArenaNoVirtual() == NULL && split_ != NULL) { + delete split_; + } + split_ = NULL; +} +void SplitCandidate::unsafe_arena_set_allocated_left_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* left_stats) { + if (GetArenaNoVirtual() == NULL) { + delete left_stats_; + } + left_stats_ = left_stats; + if (left_stats) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.left_stats) +} +void SplitCandidate::unsafe_arena_set_allocated_right_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* right_stats) { + if (GetArenaNoVirtual() == NULL) { + delete right_stats_; + } + right_stats_ = right_stats; + if (right_stats) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.right_stats) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SplitCandidate::kSplitFieldNumber; +const int SplitCandidate::kLeftStatsFieldNumber; +const int SplitCandidate::kRightStatsFieldNumber; +const int SplitCandidate::kUniqueIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SplitCandidate::SplitCandidate() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_SplitCandidate.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.SplitCandidate) +} +SplitCandidate::SplitCandidate(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_SplitCandidate.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.SplitCandidate) +} +SplitCandidate::SplitCandidate(const SplitCandidate& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + unique_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.unique_id().size() > 0) { + unique_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.unique_id(), + GetArenaNoVirtual()); + } + if (from.has_split()) { + split_ = new ::diplomacy::tensorflow::decision_trees::BinaryNode(*from.split_); + } else { + split_ = NULL; + } + if (from.has_left_stats()) { + left_stats_ = new ::diplomacy::tensorflow::tensorforest::LeafStat(*from.left_stats_); + } else { + left_stats_ = NULL; + } + if (from.has_right_stats()) { + right_stats_ = new ::diplomacy::tensorflow::tensorforest::LeafStat(*from.right_stats_); + } else { + right_stats_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.SplitCandidate) +} + +void SplitCandidate::SharedCtor() { + unique_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&split_, 0, static_cast( + reinterpret_cast(&right_stats_) - + reinterpret_cast(&split_)) + sizeof(right_stats_)); +} + +SplitCandidate::~SplitCandidate() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.SplitCandidate) + SharedDtor(); +} + +void SplitCandidate::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + unique_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete split_; + if (this != internal_default_instance()) delete left_stats_; + if (this != internal_default_instance()) delete right_stats_; +} + +void SplitCandidate::ArenaDtor(void* object) { + SplitCandidate* _this = reinterpret_cast< SplitCandidate* >(object); + (void)_this; +} +void SplitCandidate::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SplitCandidate::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SplitCandidate::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SplitCandidate& SplitCandidate::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_SplitCandidate.base); + return *internal_default_instance(); +} + + +void SplitCandidate::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + unique_id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && split_ != NULL) { + delete split_; + } + split_ = NULL; + if (GetArenaNoVirtual() == NULL && left_stats_ != NULL) { + delete left_stats_; + } + left_stats_ = NULL; + if (GetArenaNoVirtual() == NULL && right_stats_ != NULL) { + delete right_stats_; + } + right_stats_ = NULL; + _internal_metadata_.Clear(); +} + +bool SplitCandidate::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.decision_trees.BinaryNode split = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.LeafStat left_stats = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_left_stats())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.LeafStat right_stats = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_right_stats())); + } else { + goto handle_unusual; + } + break; + } + + // string unique_id = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_unique_id())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->unique_id().data(), static_cast(this->unique_id().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.SplitCandidate) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.SplitCandidate) + return false; +#undef DO_ +} + +void SplitCandidate::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.BinaryNode split = 1; + if (this->has_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_split(), output); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat left_stats = 4; + if (this->has_left_stats()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_left_stats(), output); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat right_stats = 5; + if (this->has_right_stats()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_right_stats(), output); + } + + // string unique_id = 6; + if (this->unique_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->unique_id().data(), static_cast(this->unique_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->unique_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.SplitCandidate) +} + +::google::protobuf::uint8* SplitCandidate::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.decision_trees.BinaryNode split = 1; + if (this->has_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_split(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat left_stats = 4; + if (this->has_left_stats()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_left_stats(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat right_stats = 5; + if (this->has_right_stats()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_right_stats(), deterministic, target); + } + + // string unique_id = 6; + if (this->unique_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->unique_id().data(), static_cast(this->unique_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->unique_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.SplitCandidate) + return target; +} + +size_t SplitCandidate::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string unique_id = 6; + if (this->unique_id().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->unique_id()); + } + + // .diplomacy.tensorflow.decision_trees.BinaryNode split = 1; + if (this->has_split()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *split_); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat left_stats = 4; + if (this->has_left_stats()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *left_stats_); + } + + // .diplomacy.tensorflow.tensorforest.LeafStat right_stats = 5; + if (this->has_right_stats()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *right_stats_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SplitCandidate::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + GOOGLE_DCHECK_NE(&from, this); + const SplitCandidate* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.SplitCandidate) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.SplitCandidate) + MergeFrom(*source); + } +} + +void SplitCandidate::MergeFrom(const SplitCandidate& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.unique_id().size() > 0) { + set_unique_id(from.unique_id()); + } + if (from.has_split()) { + mutable_split()->::diplomacy::tensorflow::decision_trees::BinaryNode::MergeFrom(from.split()); + } + if (from.has_left_stats()) { + mutable_left_stats()->::diplomacy::tensorflow::tensorforest::LeafStat::MergeFrom(from.left_stats()); + } + if (from.has_right_stats()) { + mutable_right_stats()->::diplomacy::tensorflow::tensorforest::LeafStat::MergeFrom(from.right_stats()); + } +} + +void SplitCandidate::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SplitCandidate::CopyFrom(const SplitCandidate& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.SplitCandidate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SplitCandidate::IsInitialized() const { + return true; +} + +void SplitCandidate::Swap(SplitCandidate* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SplitCandidate* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SplitCandidate::UnsafeArenaSwap(SplitCandidate* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SplitCandidate::InternalSwap(SplitCandidate* other) { + using std::swap; + unique_id_.Swap(&other->unique_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(split_, other->split_); + swap(left_stats_, other->left_stats_); + swap(right_stats_, other->right_stats_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SplitCandidate::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TreePath::InitAsDefaultInstance() { +} +void TreePath::clear_nodes_visited() { + nodes_visited_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreePath::kNodesVisitedFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreePath::TreePath() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_TreePath.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.TreePath) +} +TreePath::TreePath(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + nodes_visited_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_TreePath.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tensorforest.TreePath) +} +TreePath::TreePath(const TreePath& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + nodes_visited_(from.nodes_visited_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.TreePath) +} + +void TreePath::SharedCtor() { +} + +TreePath::~TreePath() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.TreePath) + SharedDtor(); +} + +void TreePath::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TreePath::ArenaDtor(void* object) { + TreePath* _this = reinterpret_cast< TreePath* >(object); + (void)_this; +} +void TreePath::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreePath::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreePath::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreePath& TreePath::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::scc_info_TreePath.base); + return *internal_default_instance(); +} + + +void TreePath::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.TreePath) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + nodes_visited_.Clear(); + _internal_metadata_.Clear(); +} + +bool TreePath::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.TreePath) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes_visited = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_nodes_visited())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.TreePath) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.TreePath) + return false; +#undef DO_ +} + +void TreePath::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.TreePath) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes_visited = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_visited_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->nodes_visited(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.TreePath) +} + +::google::protobuf::uint8* TreePath::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.TreePath) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes_visited = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_visited_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->nodes_visited(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.TreePath) + return target; +} + +size_t TreePath::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.TreePath) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes_visited = 1; + { + unsigned int count = static_cast(this->nodes_visited_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->nodes_visited(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreePath::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.TreePath) + GOOGLE_DCHECK_NE(&from, this); + const TreePath* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.TreePath) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.TreePath) + MergeFrom(*source); + } +} + +void TreePath::MergeFrom(const TreePath& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.TreePath) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + nodes_visited_.MergeFrom(from.nodes_visited_); +} + +void TreePath::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.TreePath) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreePath::CopyFrom(const TreePath& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.TreePath) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreePath::IsInitialized() const { + return true; +} + +void TreePath::Swap(TreePath* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreePath* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreePath::UnsafeArenaSwap(TreePath* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreePath::InternalSwap(TreePath* other) { + using std::swap; + CastToBase(&nodes_visited_)->InternalSwap(CastToBase(&other->nodes_visited_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreePath::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::FertileStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::FertileStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::FertileStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::GiniStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::GiniStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::GiniStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::LeafStat* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::LeafStat >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::LeafStat >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::FertileSlot* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::FertileSlot >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::FertileSlot >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::SplitCandidate* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::SplitCandidate >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::SplitCandidate >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::TreePath* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::TreePath >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tensorforest::TreePath >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.h new file mode 100644 index 0000000..a9ad503 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.h @@ -0,0 +1,2364 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[8]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { +class FertileSlot; +class FertileSlotDefaultTypeInternal; +extern FertileSlotDefaultTypeInternal _FertileSlot_default_instance_; +class FertileStats; +class FertileStatsDefaultTypeInternal; +extern FertileStatsDefaultTypeInternal _FertileStats_default_instance_; +class GiniStats; +class GiniStatsDefaultTypeInternal; +extern GiniStatsDefaultTypeInternal _GiniStats_default_instance_; +class LeafStat; +class LeafStatDefaultTypeInternal; +extern LeafStatDefaultTypeInternal _LeafStat_default_instance_; +class LeafStat_GiniImpurityClassificationStats; +class LeafStat_GiniImpurityClassificationStatsDefaultTypeInternal; +extern LeafStat_GiniImpurityClassificationStatsDefaultTypeInternal _LeafStat_GiniImpurityClassificationStats_default_instance_; +class LeafStat_LeastSquaresRegressionStats; +class LeafStat_LeastSquaresRegressionStatsDefaultTypeInternal; +extern LeafStat_LeastSquaresRegressionStatsDefaultTypeInternal _LeafStat_LeastSquaresRegressionStats_default_instance_; +class SplitCandidate; +class SplitCandidateDefaultTypeInternal; +extern SplitCandidateDefaultTypeInternal _SplitCandidate_default_instance_; +class TreePath; +class TreePathDefaultTypeInternal; +extern TreePathDefaultTypeInternal _TreePath_default_instance_; +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tensorforest::FertileSlot* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::FertileSlot>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::FertileStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::FertileStats>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::GiniStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::GiniStats>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::LeafStat* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LeafStat>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::SplitCandidate* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::SplitCandidate>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::TreePath* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::TreePath>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { + +// =================================================================== + +class FertileStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.FertileStats) */ { + public: + FertileStats(); + virtual ~FertileStats(); + + FertileStats(const FertileStats& from); + + inline FertileStats& operator=(const FertileStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FertileStats(FertileStats&& from) noexcept + : FertileStats() { + *this = ::std::move(from); + } + + inline FertileStats& operator=(FertileStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FertileStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FertileStats* internal_default_instance() { + return reinterpret_cast( + &_FertileStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(FertileStats* other); + void Swap(FertileStats* other); + friend void swap(FertileStats& a, FertileStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FertileStats* New() const final { + return CreateMaybeMessage(NULL); + } + + FertileStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FertileStats& from); + void MergeFrom(const FertileStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FertileStats* other); + protected: + explicit FertileStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tensorforest.FertileSlot node_to_slot = 1; + int node_to_slot_size() const; + void clear_node_to_slot(); + static const int kNodeToSlotFieldNumber = 1; + ::diplomacy::tensorflow::tensorforest::FertileSlot* mutable_node_to_slot(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::FertileSlot >* + mutable_node_to_slot(); + const ::diplomacy::tensorflow::tensorforest::FertileSlot& node_to_slot(int index) const; + ::diplomacy::tensorflow::tensorforest::FertileSlot* add_node_to_slot(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::FertileSlot >& + node_to_slot() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.FertileStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::FertileSlot > node_to_slot_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GiniStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.GiniStats) */ { + public: + GiniStats(); + virtual ~GiniStats(); + + GiniStats(const GiniStats& from); + + inline GiniStats& operator=(const GiniStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GiniStats(GiniStats&& from) noexcept + : GiniStats() { + *this = ::std::move(from); + } + + inline GiniStats& operator=(GiniStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GiniStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GiniStats* internal_default_instance() { + return reinterpret_cast( + &_GiniStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(GiniStats* other); + void Swap(GiniStats* other); + friend void swap(GiniStats& a, GiniStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GiniStats* New() const final { + return CreateMaybeMessage(NULL); + } + + GiniStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GiniStats& from); + void MergeFrom(const GiniStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GiniStats* other); + protected: + explicit GiniStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float square = 2; + void clear_square(); + static const int kSquareFieldNumber = 2; + float square() const; + void set_square(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.GiniStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float square_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LeafStat_GiniImpurityClassificationStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) */ { + public: + LeafStat_GiniImpurityClassificationStats(); + virtual ~LeafStat_GiniImpurityClassificationStats(); + + LeafStat_GiniImpurityClassificationStats(const LeafStat_GiniImpurityClassificationStats& from); + + inline LeafStat_GiniImpurityClassificationStats& operator=(const LeafStat_GiniImpurityClassificationStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LeafStat_GiniImpurityClassificationStats(LeafStat_GiniImpurityClassificationStats&& from) noexcept + : LeafStat_GiniImpurityClassificationStats() { + *this = ::std::move(from); + } + + inline LeafStat_GiniImpurityClassificationStats& operator=(LeafStat_GiniImpurityClassificationStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LeafStat_GiniImpurityClassificationStats& default_instance(); + + enum CountsCase { + kDenseCounts = 1, + kSparseCounts = 2, + COUNTS_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LeafStat_GiniImpurityClassificationStats* internal_default_instance() { + return reinterpret_cast( + &_LeafStat_GiniImpurityClassificationStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(LeafStat_GiniImpurityClassificationStats* other); + void Swap(LeafStat_GiniImpurityClassificationStats* other); + friend void swap(LeafStat_GiniImpurityClassificationStats& a, LeafStat_GiniImpurityClassificationStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LeafStat_GiniImpurityClassificationStats* New() const final { + return CreateMaybeMessage(NULL); + } + + LeafStat_GiniImpurityClassificationStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LeafStat_GiniImpurityClassificationStats& from); + void MergeFrom(const LeafStat_GiniImpurityClassificationStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LeafStat_GiniImpurityClassificationStats* other); + protected: + explicit LeafStat_GiniImpurityClassificationStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.tensorforest.GiniStats gini = 3; + bool has_gini() const; + void clear_gini(); + static const int kGiniFieldNumber = 3; + private: + const ::diplomacy::tensorflow::tensorforest::GiniStats& _internal_gini() const; + public: + const ::diplomacy::tensorflow::tensorforest::GiniStats& gini() const; + ::diplomacy::tensorflow::tensorforest::GiniStats* release_gini(); + ::diplomacy::tensorflow::tensorforest::GiniStats* mutable_gini(); + void set_allocated_gini(::diplomacy::tensorflow::tensorforest::GiniStats* gini); + void unsafe_arena_set_allocated_gini( + ::diplomacy::tensorflow::tensorforest::GiniStats* gini); + ::diplomacy::tensorflow::tensorforest::GiniStats* unsafe_arena_release_gini(); + + // .diplomacy.tensorflow.decision_trees.Vector dense_counts = 1; + bool has_dense_counts() const; + void clear_dense_counts(); + static const int kDenseCountsFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::Vector& _internal_dense_counts() const; + public: + const ::diplomacy::tensorflow::decision_trees::Vector& dense_counts() const; + ::diplomacy::tensorflow::decision_trees::Vector* release_dense_counts(); + ::diplomacy::tensorflow::decision_trees::Vector* mutable_dense_counts(); + void set_allocated_dense_counts(::diplomacy::tensorflow::decision_trees::Vector* dense_counts); + void unsafe_arena_set_allocated_dense_counts( + ::diplomacy::tensorflow::decision_trees::Vector* dense_counts); + ::diplomacy::tensorflow::decision_trees::Vector* unsafe_arena_release_dense_counts(); + + // .diplomacy.tensorflow.decision_trees.SparseVector sparse_counts = 2; + bool has_sparse_counts() const; + void clear_sparse_counts(); + static const int kSparseCountsFieldNumber = 2; + private: + const ::diplomacy::tensorflow::decision_trees::SparseVector& _internal_sparse_counts() const; + public: + const ::diplomacy::tensorflow::decision_trees::SparseVector& sparse_counts() const; + ::diplomacy::tensorflow::decision_trees::SparseVector* release_sparse_counts(); + ::diplomacy::tensorflow::decision_trees::SparseVector* mutable_sparse_counts(); + void set_allocated_sparse_counts(::diplomacy::tensorflow::decision_trees::SparseVector* sparse_counts); + void unsafe_arena_set_allocated_sparse_counts( + ::diplomacy::tensorflow::decision_trees::SparseVector* sparse_counts); + ::diplomacy::tensorflow::decision_trees::SparseVector* unsafe_arena_release_sparse_counts(); + + void clear_counts(); + CountsCase counts_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + private: + void set_has_dense_counts(); + void set_has_sparse_counts(); + + inline bool has_counts() const; + inline void clear_has_counts(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::tensorforest::GiniStats* gini_; + union CountsUnion { + CountsUnion() {} + ::diplomacy::tensorflow::decision_trees::Vector* dense_counts_; + ::diplomacy::tensorflow::decision_trees::SparseVector* sparse_counts_; + } counts_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LeafStat_LeastSquaresRegressionStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) */ { + public: + LeafStat_LeastSquaresRegressionStats(); + virtual ~LeafStat_LeastSquaresRegressionStats(); + + LeafStat_LeastSquaresRegressionStats(const LeafStat_LeastSquaresRegressionStats& from); + + inline LeafStat_LeastSquaresRegressionStats& operator=(const LeafStat_LeastSquaresRegressionStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LeafStat_LeastSquaresRegressionStats(LeafStat_LeastSquaresRegressionStats&& from) noexcept + : LeafStat_LeastSquaresRegressionStats() { + *this = ::std::move(from); + } + + inline LeafStat_LeastSquaresRegressionStats& operator=(LeafStat_LeastSquaresRegressionStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LeafStat_LeastSquaresRegressionStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LeafStat_LeastSquaresRegressionStats* internal_default_instance() { + return reinterpret_cast( + &_LeafStat_LeastSquaresRegressionStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(LeafStat_LeastSquaresRegressionStats* other); + void Swap(LeafStat_LeastSquaresRegressionStats* other); + friend void swap(LeafStat_LeastSquaresRegressionStats& a, LeafStat_LeastSquaresRegressionStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LeafStat_LeastSquaresRegressionStats* New() const final { + return CreateMaybeMessage(NULL); + } + + LeafStat_LeastSquaresRegressionStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LeafStat_LeastSquaresRegressionStats& from); + void MergeFrom(const LeafStat_LeastSquaresRegressionStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LeafStat_LeastSquaresRegressionStats* other); + protected: + explicit LeafStat_LeastSquaresRegressionStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.decision_trees.Vector mean_output = 1; + bool has_mean_output() const; + void clear_mean_output(); + static const int kMeanOutputFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::Vector& _internal_mean_output() const; + public: + const ::diplomacy::tensorflow::decision_trees::Vector& mean_output() const; + ::diplomacy::tensorflow::decision_trees::Vector* release_mean_output(); + ::diplomacy::tensorflow::decision_trees::Vector* mutable_mean_output(); + void set_allocated_mean_output(::diplomacy::tensorflow::decision_trees::Vector* mean_output); + void unsafe_arena_set_allocated_mean_output( + ::diplomacy::tensorflow::decision_trees::Vector* mean_output); + ::diplomacy::tensorflow::decision_trees::Vector* unsafe_arena_release_mean_output(); + + // .diplomacy.tensorflow.decision_trees.Vector mean_output_squares = 2; + bool has_mean_output_squares() const; + void clear_mean_output_squares(); + static const int kMeanOutputSquaresFieldNumber = 2; + private: + const ::diplomacy::tensorflow::decision_trees::Vector& _internal_mean_output_squares() const; + public: + const ::diplomacy::tensorflow::decision_trees::Vector& mean_output_squares() const; + ::diplomacy::tensorflow::decision_trees::Vector* release_mean_output_squares(); + ::diplomacy::tensorflow::decision_trees::Vector* mutable_mean_output_squares(); + void set_allocated_mean_output_squares(::diplomacy::tensorflow::decision_trees::Vector* mean_output_squares); + void unsafe_arena_set_allocated_mean_output_squares( + ::diplomacy::tensorflow::decision_trees::Vector* mean_output_squares); + ::diplomacy::tensorflow::decision_trees::Vector* unsafe_arena_release_mean_output_squares(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::decision_trees::Vector* mean_output_; + ::diplomacy::tensorflow::decision_trees::Vector* mean_output_squares_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LeafStat : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.LeafStat) */ { + public: + LeafStat(); + virtual ~LeafStat(); + + LeafStat(const LeafStat& from); + + inline LeafStat& operator=(const LeafStat& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LeafStat(LeafStat&& from) noexcept + : LeafStat() { + *this = ::std::move(from); + } + + inline LeafStat& operator=(LeafStat&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LeafStat& default_instance(); + + enum LeafStatCase { + kClassification = 1, + kRegression = 2, + LEAF_STAT_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LeafStat* internal_default_instance() { + return reinterpret_cast( + &_LeafStat_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(LeafStat* other); + void Swap(LeafStat* other); + friend void swap(LeafStat& a, LeafStat& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LeafStat* New() const final { + return CreateMaybeMessage(NULL); + } + + LeafStat* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LeafStat& from); + void MergeFrom(const LeafStat& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LeafStat* other); + protected: + explicit LeafStat(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef LeafStat_GiniImpurityClassificationStats GiniImpurityClassificationStats; + typedef LeafStat_LeastSquaresRegressionStats LeastSquaresRegressionStats; + + // accessors ------------------------------------------------------- + + // float weight_sum = 3; + void clear_weight_sum(); + static const int kWeightSumFieldNumber = 3; + float weight_sum() const; + void set_weight_sum(float value); + + // .diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats classification = 1; + bool has_classification() const; + void clear_classification(); + static const int kClassificationFieldNumber = 1; + private: + const ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats& _internal_classification() const; + public: + const ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats& classification() const; + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* release_classification(); + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* mutable_classification(); + void set_allocated_classification(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* classification); + void unsafe_arena_set_allocated_classification( + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* classification); + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* unsafe_arena_release_classification(); + + // .diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats regression = 2; + bool has_regression() const; + void clear_regression(); + static const int kRegressionFieldNumber = 2; + private: + const ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats& _internal_regression() const; + public: + const ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats& regression() const; + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* release_regression(); + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* mutable_regression(); + void set_allocated_regression(::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* regression); + void unsafe_arena_set_allocated_regression( + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* regression); + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* unsafe_arena_release_regression(); + + void clear_leaf_stat(); + LeafStatCase leaf_stat_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LeafStat) + private: + void set_has_classification(); + void set_has_regression(); + + inline bool has_leaf_stat() const; + inline void clear_has_leaf_stat(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float weight_sum_; + union LeafStatUnion { + LeafStatUnion() {} + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* classification_; + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* regression_; + } leaf_stat_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FertileSlot : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.FertileSlot) */ { + public: + FertileSlot(); + virtual ~FertileSlot(); + + FertileSlot(const FertileSlot& from); + + inline FertileSlot& operator=(const FertileSlot& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FertileSlot(FertileSlot&& from) noexcept + : FertileSlot() { + *this = ::std::move(from); + } + + inline FertileSlot& operator=(FertileSlot&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FertileSlot& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FertileSlot* internal_default_instance() { + return reinterpret_cast( + &_FertileSlot_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(FertileSlot* other); + void Swap(FertileSlot* other); + friend void swap(FertileSlot& a, FertileSlot& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FertileSlot* New() const final { + return CreateMaybeMessage(NULL); + } + + FertileSlot* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FertileSlot& from); + void MergeFrom(const FertileSlot& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FertileSlot* other); + protected: + explicit FertileSlot(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tensorforest.SplitCandidate candidates = 1; + int candidates_size() const; + void clear_candidates(); + static const int kCandidatesFieldNumber = 1; + ::diplomacy::tensorflow::tensorforest::SplitCandidate* mutable_candidates(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::SplitCandidate >* + mutable_candidates(); + const ::diplomacy::tensorflow::tensorforest::SplitCandidate& candidates(int index) const; + ::diplomacy::tensorflow::tensorforest::SplitCandidate* add_candidates(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::SplitCandidate >& + candidates() const; + + // .diplomacy.tensorflow.tensorforest.LeafStat leaf_stats = 4; + bool has_leaf_stats() const; + void clear_leaf_stats(); + static const int kLeafStatsFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tensorforest::LeafStat& _internal_leaf_stats() const; + public: + const ::diplomacy::tensorflow::tensorforest::LeafStat& leaf_stats() const; + ::diplomacy::tensorflow::tensorforest::LeafStat* release_leaf_stats(); + ::diplomacy::tensorflow::tensorforest::LeafStat* mutable_leaf_stats(); + void set_allocated_leaf_stats(::diplomacy::tensorflow::tensorforest::LeafStat* leaf_stats); + void unsafe_arena_set_allocated_leaf_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* leaf_stats); + ::diplomacy::tensorflow::tensorforest::LeafStat* unsafe_arena_release_leaf_stats(); + + // .diplomacy.tensorflow.tensorforest.LeafStat post_init_leaf_stats = 6; + bool has_post_init_leaf_stats() const; + void clear_post_init_leaf_stats(); + static const int kPostInitLeafStatsFieldNumber = 6; + private: + const ::diplomacy::tensorflow::tensorforest::LeafStat& _internal_post_init_leaf_stats() const; + public: + const ::diplomacy::tensorflow::tensorforest::LeafStat& post_init_leaf_stats() const; + ::diplomacy::tensorflow::tensorforest::LeafStat* release_post_init_leaf_stats(); + ::diplomacy::tensorflow::tensorforest::LeafStat* mutable_post_init_leaf_stats(); + void set_allocated_post_init_leaf_stats(::diplomacy::tensorflow::tensorforest::LeafStat* post_init_leaf_stats); + void unsafe_arena_set_allocated_post_init_leaf_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* post_init_leaf_stats); + ::diplomacy::tensorflow::tensorforest::LeafStat* unsafe_arena_release_post_init_leaf_stats(); + + // int32 node_id = 5; + void clear_node_id(); + static const int kNodeIdFieldNumber = 5; + ::google::protobuf::int32 node_id() const; + void set_node_id(::google::protobuf::int32 value); + + // int32 depth = 7; + void clear_depth(); + static const int kDepthFieldNumber = 7; + ::google::protobuf::int32 depth() const; + void set_depth(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.FertileSlot) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::SplitCandidate > candidates_; + ::diplomacy::tensorflow::tensorforest::LeafStat* leaf_stats_; + ::diplomacy::tensorflow::tensorforest::LeafStat* post_init_leaf_stats_; + ::google::protobuf::int32 node_id_; + ::google::protobuf::int32 depth_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SplitCandidate : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.SplitCandidate) */ { + public: + SplitCandidate(); + virtual ~SplitCandidate(); + + SplitCandidate(const SplitCandidate& from); + + inline SplitCandidate& operator=(const SplitCandidate& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SplitCandidate(SplitCandidate&& from) noexcept + : SplitCandidate() { + *this = ::std::move(from); + } + + inline SplitCandidate& operator=(SplitCandidate&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SplitCandidate& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SplitCandidate* internal_default_instance() { + return reinterpret_cast( + &_SplitCandidate_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(SplitCandidate* other); + void Swap(SplitCandidate* other); + friend void swap(SplitCandidate& a, SplitCandidate& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SplitCandidate* New() const final { + return CreateMaybeMessage(NULL); + } + + SplitCandidate* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SplitCandidate& from); + void MergeFrom(const SplitCandidate& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SplitCandidate* other); + protected: + explicit SplitCandidate(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string unique_id = 6; + void clear_unique_id(); + static const int kUniqueIdFieldNumber = 6; + const ::std::string& unique_id() const; + void set_unique_id(const ::std::string& value); + #if LANG_CXX11 + void set_unique_id(::std::string&& value); + #endif + void set_unique_id(const char* value); + void set_unique_id(const char* value, size_t size); + ::std::string* mutable_unique_id(); + ::std::string* release_unique_id(); + void set_allocated_unique_id(::std::string* unique_id); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_unique_id(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_unique_id( + ::std::string* unique_id); + + // .diplomacy.tensorflow.decision_trees.BinaryNode split = 1; + bool has_split() const; + void clear_split(); + static const int kSplitFieldNumber = 1; + private: + const ::diplomacy::tensorflow::decision_trees::BinaryNode& _internal_split() const; + public: + const ::diplomacy::tensorflow::decision_trees::BinaryNode& split() const; + ::diplomacy::tensorflow::decision_trees::BinaryNode* release_split(); + ::diplomacy::tensorflow::decision_trees::BinaryNode* mutable_split(); + void set_allocated_split(::diplomacy::tensorflow::decision_trees::BinaryNode* split); + void unsafe_arena_set_allocated_split( + ::diplomacy::tensorflow::decision_trees::BinaryNode* split); + ::diplomacy::tensorflow::decision_trees::BinaryNode* unsafe_arena_release_split(); + + // .diplomacy.tensorflow.tensorforest.LeafStat left_stats = 4; + bool has_left_stats() const; + void clear_left_stats(); + static const int kLeftStatsFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tensorforest::LeafStat& _internal_left_stats() const; + public: + const ::diplomacy::tensorflow::tensorforest::LeafStat& left_stats() const; + ::diplomacy::tensorflow::tensorforest::LeafStat* release_left_stats(); + ::diplomacy::tensorflow::tensorforest::LeafStat* mutable_left_stats(); + void set_allocated_left_stats(::diplomacy::tensorflow::tensorforest::LeafStat* left_stats); + void unsafe_arena_set_allocated_left_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* left_stats); + ::diplomacy::tensorflow::tensorforest::LeafStat* unsafe_arena_release_left_stats(); + + // .diplomacy.tensorflow.tensorforest.LeafStat right_stats = 5; + bool has_right_stats() const; + void clear_right_stats(); + static const int kRightStatsFieldNumber = 5; + private: + const ::diplomacy::tensorflow::tensorforest::LeafStat& _internal_right_stats() const; + public: + const ::diplomacy::tensorflow::tensorforest::LeafStat& right_stats() const; + ::diplomacy::tensorflow::tensorforest::LeafStat* release_right_stats(); + ::diplomacy::tensorflow::tensorforest::LeafStat* mutable_right_stats(); + void set_allocated_right_stats(::diplomacy::tensorflow::tensorforest::LeafStat* right_stats); + void unsafe_arena_set_allocated_right_stats( + ::diplomacy::tensorflow::tensorforest::LeafStat* right_stats); + ::diplomacy::tensorflow::tensorforest::LeafStat* unsafe_arena_release_right_stats(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.SplitCandidate) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr unique_id_; + ::diplomacy::tensorflow::decision_trees::BinaryNode* split_; + ::diplomacy::tensorflow::tensorforest::LeafStat* left_stats_; + ::diplomacy::tensorflow::tensorforest::LeafStat* right_stats_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TreePath : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.TreePath) */ { + public: + TreePath(); + virtual ~TreePath(); + + TreePath(const TreePath& from); + + inline TreePath& operator=(const TreePath& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreePath(TreePath&& from) noexcept + : TreePath() { + *this = ::std::move(from); + } + + inline TreePath& operator=(TreePath&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreePath& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreePath* internal_default_instance() { + return reinterpret_cast( + &_TreePath_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(TreePath* other); + void Swap(TreePath* other); + friend void swap(TreePath& a, TreePath& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreePath* New() const final { + return CreateMaybeMessage(NULL); + } + + TreePath* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreePath& from); + void MergeFrom(const TreePath& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreePath* other); + protected: + explicit TreePath(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes_visited = 1; + int nodes_visited_size() const; + void clear_nodes_visited(); + static const int kNodesVisitedFieldNumber = 1; + ::diplomacy::tensorflow::decision_trees::TreeNode* mutable_nodes_visited(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >* + mutable_nodes_visited(); + const ::diplomacy::tensorflow::decision_trees::TreeNode& nodes_visited(int index) const; + ::diplomacy::tensorflow::decision_trees::TreeNode* add_nodes_visited(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >& + nodes_visited() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.TreePath) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode > nodes_visited_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// FertileStats + +// repeated .diplomacy.tensorflow.tensorforest.FertileSlot node_to_slot = 1; +inline int FertileStats::node_to_slot_size() const { + return node_to_slot_.size(); +} +inline void FertileStats::clear_node_to_slot() { + node_to_slot_.Clear(); +} +inline ::diplomacy::tensorflow::tensorforest::FertileSlot* FertileStats::mutable_node_to_slot(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.FertileStats.node_to_slot) + return node_to_slot_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::FertileSlot >* +FertileStats::mutable_node_to_slot() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tensorforest.FertileStats.node_to_slot) + return &node_to_slot_; +} +inline const ::diplomacy::tensorflow::tensorforest::FertileSlot& FertileStats::node_to_slot(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.FertileStats.node_to_slot) + return node_to_slot_.Get(index); +} +inline ::diplomacy::tensorflow::tensorforest::FertileSlot* FertileStats::add_node_to_slot() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tensorforest.FertileStats.node_to_slot) + return node_to_slot_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::FertileSlot >& +FertileStats::node_to_slot() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tensorforest.FertileStats.node_to_slot) + return node_to_slot_; +} + +// ------------------------------------------------------------------- + +// GiniStats + +// float square = 2; +inline void GiniStats::clear_square() { + square_ = 0; +} +inline float GiniStats::square() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.GiniStats.square) + return square_; +} +inline void GiniStats::set_square(float value) { + + square_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.GiniStats.square) +} + +// ------------------------------------------------------------------- + +// LeafStat_GiniImpurityClassificationStats + +// .diplomacy.tensorflow.decision_trees.Vector dense_counts = 1; +inline bool LeafStat_GiniImpurityClassificationStats::has_dense_counts() const { + return counts_case() == kDenseCounts; +} +inline void LeafStat_GiniImpurityClassificationStats::set_has_dense_counts() { + _oneof_case_[0] = kDenseCounts; +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& LeafStat_GiniImpurityClassificationStats::_internal_dense_counts() const { + return *counts_.dense_counts_; +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_GiniImpurityClassificationStats::release_dense_counts() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.dense_counts) + if (has_dense_counts()) { + clear_has_counts(); + ::diplomacy::tensorflow::decision_trees::Vector* temp = counts_.dense_counts_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + counts_.dense_counts_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& LeafStat_GiniImpurityClassificationStats::dense_counts() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.dense_counts) + return has_dense_counts() + ? *counts_.dense_counts_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::Vector*>(&::diplomacy::tensorflow::decision_trees::_Vector_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_GiniImpurityClassificationStats::unsafe_arena_release_dense_counts() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.dense_counts) + if (has_dense_counts()) { + clear_has_counts(); + ::diplomacy::tensorflow::decision_trees::Vector* temp = counts_.dense_counts_; + counts_.dense_counts_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void LeafStat_GiniImpurityClassificationStats::unsafe_arena_set_allocated_dense_counts(::diplomacy::tensorflow::decision_trees::Vector* dense_counts) { + clear_counts(); + if (dense_counts) { + set_has_dense_counts(); + counts_.dense_counts_ = dense_counts; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.dense_counts) +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_GiniImpurityClassificationStats::mutable_dense_counts() { + if (!has_dense_counts()) { + clear_counts(); + set_has_dense_counts(); + counts_.dense_counts_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::Vector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.dense_counts) + return counts_.dense_counts_; +} + +// .diplomacy.tensorflow.decision_trees.SparseVector sparse_counts = 2; +inline bool LeafStat_GiniImpurityClassificationStats::has_sparse_counts() const { + return counts_case() == kSparseCounts; +} +inline void LeafStat_GiniImpurityClassificationStats::set_has_sparse_counts() { + _oneof_case_[0] = kSparseCounts; +} +inline const ::diplomacy::tensorflow::decision_trees::SparseVector& LeafStat_GiniImpurityClassificationStats::_internal_sparse_counts() const { + return *counts_.sparse_counts_; +} +inline ::diplomacy::tensorflow::decision_trees::SparseVector* LeafStat_GiniImpurityClassificationStats::release_sparse_counts() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.sparse_counts) + if (has_sparse_counts()) { + clear_has_counts(); + ::diplomacy::tensorflow::decision_trees::SparseVector* temp = counts_.sparse_counts_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + counts_.sparse_counts_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::decision_trees::SparseVector& LeafStat_GiniImpurityClassificationStats::sparse_counts() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.sparse_counts) + return has_sparse_counts() + ? *counts_.sparse_counts_ + : *reinterpret_cast< ::diplomacy::tensorflow::decision_trees::SparseVector*>(&::diplomacy::tensorflow::decision_trees::_SparseVector_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::SparseVector* LeafStat_GiniImpurityClassificationStats::unsafe_arena_release_sparse_counts() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.sparse_counts) + if (has_sparse_counts()) { + clear_has_counts(); + ::diplomacy::tensorflow::decision_trees::SparseVector* temp = counts_.sparse_counts_; + counts_.sparse_counts_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void LeafStat_GiniImpurityClassificationStats::unsafe_arena_set_allocated_sparse_counts(::diplomacy::tensorflow::decision_trees::SparseVector* sparse_counts) { + clear_counts(); + if (sparse_counts) { + set_has_sparse_counts(); + counts_.sparse_counts_ = sparse_counts; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.sparse_counts) +} +inline ::diplomacy::tensorflow::decision_trees::SparseVector* LeafStat_GiniImpurityClassificationStats::mutable_sparse_counts() { + if (!has_sparse_counts()) { + clear_counts(); + set_has_sparse_counts(); + counts_.sparse_counts_ = CreateMaybeMessage< ::diplomacy::tensorflow::decision_trees::SparseVector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.sparse_counts) + return counts_.sparse_counts_; +} + +// .diplomacy.tensorflow.tensorforest.GiniStats gini = 3; +inline bool LeafStat_GiniImpurityClassificationStats::has_gini() const { + return this != internal_default_instance() && gini_ != NULL; +} +inline void LeafStat_GiniImpurityClassificationStats::clear_gini() { + if (GetArenaNoVirtual() == NULL && gini_ != NULL) { + delete gini_; + } + gini_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::GiniStats& LeafStat_GiniImpurityClassificationStats::_internal_gini() const { + return *gini_; +} +inline const ::diplomacy::tensorflow::tensorforest::GiniStats& LeafStat_GiniImpurityClassificationStats::gini() const { + const ::diplomacy::tensorflow::tensorforest::GiniStats* p = gini_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.gini) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_GiniStats_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::GiniStats* LeafStat_GiniImpurityClassificationStats::release_gini() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.gini) + + ::diplomacy::tensorflow::tensorforest::GiniStats* temp = gini_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + gini_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::GiniStats* LeafStat_GiniImpurityClassificationStats::unsafe_arena_release_gini() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.gini) + + ::diplomacy::tensorflow::tensorforest::GiniStats* temp = gini_; + gini_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::GiniStats* LeafStat_GiniImpurityClassificationStats::mutable_gini() { + + if (gini_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::GiniStats>(GetArenaNoVirtual()); + gini_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.gini) + return gini_; +} +inline void LeafStat_GiniImpurityClassificationStats::set_allocated_gini(::diplomacy::tensorflow::tensorforest::GiniStats* gini) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete gini_; + } + if (gini) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(gini); + if (message_arena != submessage_arena) { + gini = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gini, submessage_arena); + } + + } else { + + } + gini_ = gini; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.gini) +} + +inline bool LeafStat_GiniImpurityClassificationStats::has_counts() const { + return counts_case() != COUNTS_NOT_SET; +} +inline void LeafStat_GiniImpurityClassificationStats::clear_has_counts() { + _oneof_case_[0] = COUNTS_NOT_SET; +} +inline LeafStat_GiniImpurityClassificationStats::CountsCase LeafStat_GiniImpurityClassificationStats::counts_case() const { + return LeafStat_GiniImpurityClassificationStats::CountsCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// LeafStat_LeastSquaresRegressionStats + +// .diplomacy.tensorflow.decision_trees.Vector mean_output = 1; +inline bool LeafStat_LeastSquaresRegressionStats::has_mean_output() const { + return this != internal_default_instance() && mean_output_ != NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& LeafStat_LeastSquaresRegressionStats::_internal_mean_output() const { + return *mean_output_; +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& LeafStat_LeastSquaresRegressionStats::mean_output() const { + const ::diplomacy::tensorflow::decision_trees::Vector* p = mean_output_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_Vector_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_LeastSquaresRegressionStats::release_mean_output() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output) + + ::diplomacy::tensorflow::decision_trees::Vector* temp = mean_output_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + mean_output_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_LeastSquaresRegressionStats::unsafe_arena_release_mean_output() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output) + + ::diplomacy::tensorflow::decision_trees::Vector* temp = mean_output_; + mean_output_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_LeastSquaresRegressionStats::mutable_mean_output() { + + if (mean_output_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Vector>(GetArenaNoVirtual()); + mean_output_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output) + return mean_output_; +} +inline void LeafStat_LeastSquaresRegressionStats::set_allocated_mean_output(::diplomacy::tensorflow::decision_trees::Vector* mean_output) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(mean_output_); + } + if (mean_output) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(mean_output)->GetArena(); + if (message_arena != submessage_arena) { + mean_output = ::google::protobuf::internal::GetOwnedMessage( + message_arena, mean_output, submessage_arena); + } + + } else { + + } + mean_output_ = mean_output; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output) +} + +// .diplomacy.tensorflow.decision_trees.Vector mean_output_squares = 2; +inline bool LeafStat_LeastSquaresRegressionStats::has_mean_output_squares() const { + return this != internal_default_instance() && mean_output_squares_ != NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& LeafStat_LeastSquaresRegressionStats::_internal_mean_output_squares() const { + return *mean_output_squares_; +} +inline const ::diplomacy::tensorflow::decision_trees::Vector& LeafStat_LeastSquaresRegressionStats::mean_output_squares() const { + const ::diplomacy::tensorflow::decision_trees::Vector* p = mean_output_squares_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output_squares) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_Vector_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_LeastSquaresRegressionStats::release_mean_output_squares() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output_squares) + + ::diplomacy::tensorflow::decision_trees::Vector* temp = mean_output_squares_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + mean_output_squares_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_LeastSquaresRegressionStats::unsafe_arena_release_mean_output_squares() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output_squares) + + ::diplomacy::tensorflow::decision_trees::Vector* temp = mean_output_squares_; + mean_output_squares_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::Vector* LeafStat_LeastSquaresRegressionStats::mutable_mean_output_squares() { + + if (mean_output_squares_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::Vector>(GetArenaNoVirtual()); + mean_output_squares_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output_squares) + return mean_output_squares_; +} +inline void LeafStat_LeastSquaresRegressionStats::set_allocated_mean_output_squares(::diplomacy::tensorflow::decision_trees::Vector* mean_output_squares) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(mean_output_squares_); + } + if (mean_output_squares) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(mean_output_squares)->GetArena(); + if (message_arena != submessage_arena) { + mean_output_squares = ::google::protobuf::internal::GetOwnedMessage( + message_arena, mean_output_squares, submessage_arena); + } + + } else { + + } + mean_output_squares_ = mean_output_squares; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output_squares) +} + +// ------------------------------------------------------------------- + +// LeafStat + +// float weight_sum = 3; +inline void LeafStat::clear_weight_sum() { + weight_sum_ = 0; +} +inline float LeafStat::weight_sum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.weight_sum) + return weight_sum_; +} +inline void LeafStat::set_weight_sum(float value) { + + weight_sum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.LeafStat.weight_sum) +} + +// .diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats classification = 1; +inline bool LeafStat::has_classification() const { + return leaf_stat_case() == kClassification; +} +inline void LeafStat::set_has_classification() { + _oneof_case_[0] = kClassification; +} +inline void LeafStat::clear_classification() { + if (has_classification()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_stat_.classification_; + } + clear_has_leaf_stat(); + } +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats& LeafStat::_internal_classification() const { + return *leaf_stat_.classification_; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* LeafStat::release_classification() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.LeafStat.classification) + if (has_classification()) { + clear_has_leaf_stat(); + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* temp = leaf_stat_.classification_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_stat_.classification_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats& LeafStat::classification() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.classification) + return has_classification() + ? *leaf_stat_.classification_ + : *reinterpret_cast< ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats*>(&::diplomacy::tensorflow::tensorforest::_LeafStat_GiniImpurityClassificationStats_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* LeafStat::unsafe_arena_release_classification() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.LeafStat.classification) + if (has_classification()) { + clear_has_leaf_stat(); + ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* temp = leaf_stat_.classification_; + leaf_stat_.classification_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void LeafStat::unsafe_arena_set_allocated_classification(::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* classification) { + clear_leaf_stat(); + if (classification) { + set_has_classification(); + leaf_stat_.classification_ = classification; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.classification) +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats* LeafStat::mutable_classification() { + if (!has_classification()) { + clear_leaf_stat(); + set_has_classification(); + leaf_stat_.classification_ = CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::LeafStat_GiniImpurityClassificationStats >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.LeafStat.classification) + return leaf_stat_.classification_; +} + +// .diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats regression = 2; +inline bool LeafStat::has_regression() const { + return leaf_stat_case() == kRegression; +} +inline void LeafStat::set_has_regression() { + _oneof_case_[0] = kRegression; +} +inline void LeafStat::clear_regression() { + if (has_regression()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_stat_.regression_; + } + clear_has_leaf_stat(); + } +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats& LeafStat::_internal_regression() const { + return *leaf_stat_.regression_; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* LeafStat::release_regression() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.LeafStat.regression) + if (has_regression()) { + clear_has_leaf_stat(); + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* temp = leaf_stat_.regression_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_stat_.regression_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats& LeafStat::regression() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LeafStat.regression) + return has_regression() + ? *leaf_stat_.regression_ + : *reinterpret_cast< ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats*>(&::diplomacy::tensorflow::tensorforest::_LeafStat_LeastSquaresRegressionStats_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* LeafStat::unsafe_arena_release_regression() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.LeafStat.regression) + if (has_regression()) { + clear_has_leaf_stat(); + ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* temp = leaf_stat_.regression_; + leaf_stat_.regression_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void LeafStat::unsafe_arena_set_allocated_regression(::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* regression) { + clear_leaf_stat(); + if (regression) { + set_has_regression(); + leaf_stat_.regression_ = regression; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.LeafStat.regression) +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats* LeafStat::mutable_regression() { + if (!has_regression()) { + clear_leaf_stat(); + set_has_regression(); + leaf_stat_.regression_ = CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::LeafStat_LeastSquaresRegressionStats >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.LeafStat.regression) + return leaf_stat_.regression_; +} + +inline bool LeafStat::has_leaf_stat() const { + return leaf_stat_case() != LEAF_STAT_NOT_SET; +} +inline void LeafStat::clear_has_leaf_stat() { + _oneof_case_[0] = LEAF_STAT_NOT_SET; +} +inline LeafStat::LeafStatCase LeafStat::leaf_stat_case() const { + return LeafStat::LeafStatCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// FertileSlot + +// .diplomacy.tensorflow.tensorforest.LeafStat leaf_stats = 4; +inline bool FertileSlot::has_leaf_stats() const { + return this != internal_default_instance() && leaf_stats_ != NULL; +} +inline void FertileSlot::clear_leaf_stats() { + if (GetArenaNoVirtual() == NULL && leaf_stats_ != NULL) { + delete leaf_stats_; + } + leaf_stats_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& FertileSlot::_internal_leaf_stats() const { + return *leaf_stats_; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& FertileSlot::leaf_stats() const { + const ::diplomacy::tensorflow::tensorforest::LeafStat* p = leaf_stats_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.FertileSlot.leaf_stats) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* FertileSlot::release_leaf_stats() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.FertileSlot.leaf_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = leaf_stats_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* FertileSlot::unsafe_arena_release_leaf_stats() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.FertileSlot.leaf_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = leaf_stats_; + leaf_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* FertileSlot::mutable_leaf_stats() { + + if (leaf_stats_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LeafStat>(GetArenaNoVirtual()); + leaf_stats_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.FertileSlot.leaf_stats) + return leaf_stats_; +} +inline void FertileSlot::set_allocated_leaf_stats(::diplomacy::tensorflow::tensorforest::LeafStat* leaf_stats) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete leaf_stats_; + } + if (leaf_stats) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(leaf_stats); + if (message_arena != submessage_arena) { + leaf_stats = ::google::protobuf::internal::GetOwnedMessage( + message_arena, leaf_stats, submessage_arena); + } + + } else { + + } + leaf_stats_ = leaf_stats; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.FertileSlot.leaf_stats) +} + +// repeated .diplomacy.tensorflow.tensorforest.SplitCandidate candidates = 1; +inline int FertileSlot::candidates_size() const { + return candidates_.size(); +} +inline void FertileSlot::clear_candidates() { + candidates_.Clear(); +} +inline ::diplomacy::tensorflow::tensorforest::SplitCandidate* FertileSlot::mutable_candidates(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.FertileSlot.candidates) + return candidates_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::SplitCandidate >* +FertileSlot::mutable_candidates() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tensorforest.FertileSlot.candidates) + return &candidates_; +} +inline const ::diplomacy::tensorflow::tensorforest::SplitCandidate& FertileSlot::candidates(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.FertileSlot.candidates) + return candidates_.Get(index); +} +inline ::diplomacy::tensorflow::tensorforest::SplitCandidate* FertileSlot::add_candidates() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tensorforest.FertileSlot.candidates) + return candidates_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tensorforest::SplitCandidate >& +FertileSlot::candidates() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tensorforest.FertileSlot.candidates) + return candidates_; +} + +// .diplomacy.tensorflow.tensorforest.LeafStat post_init_leaf_stats = 6; +inline bool FertileSlot::has_post_init_leaf_stats() const { + return this != internal_default_instance() && post_init_leaf_stats_ != NULL; +} +inline void FertileSlot::clear_post_init_leaf_stats() { + if (GetArenaNoVirtual() == NULL && post_init_leaf_stats_ != NULL) { + delete post_init_leaf_stats_; + } + post_init_leaf_stats_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& FertileSlot::_internal_post_init_leaf_stats() const { + return *post_init_leaf_stats_; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& FertileSlot::post_init_leaf_stats() const { + const ::diplomacy::tensorflow::tensorforest::LeafStat* p = post_init_leaf_stats_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.FertileSlot.post_init_leaf_stats) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* FertileSlot::release_post_init_leaf_stats() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.FertileSlot.post_init_leaf_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = post_init_leaf_stats_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + post_init_leaf_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* FertileSlot::unsafe_arena_release_post_init_leaf_stats() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.FertileSlot.post_init_leaf_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = post_init_leaf_stats_; + post_init_leaf_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* FertileSlot::mutable_post_init_leaf_stats() { + + if (post_init_leaf_stats_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LeafStat>(GetArenaNoVirtual()); + post_init_leaf_stats_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.FertileSlot.post_init_leaf_stats) + return post_init_leaf_stats_; +} +inline void FertileSlot::set_allocated_post_init_leaf_stats(::diplomacy::tensorflow::tensorforest::LeafStat* post_init_leaf_stats) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete post_init_leaf_stats_; + } + if (post_init_leaf_stats) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(post_init_leaf_stats); + if (message_arena != submessage_arena) { + post_init_leaf_stats = ::google::protobuf::internal::GetOwnedMessage( + message_arena, post_init_leaf_stats, submessage_arena); + } + + } else { + + } + post_init_leaf_stats_ = post_init_leaf_stats; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.FertileSlot.post_init_leaf_stats) +} + +// int32 node_id = 5; +inline void FertileSlot::clear_node_id() { + node_id_ = 0; +} +inline ::google::protobuf::int32 FertileSlot::node_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.FertileSlot.node_id) + return node_id_; +} +inline void FertileSlot::set_node_id(::google::protobuf::int32 value) { + + node_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.FertileSlot.node_id) +} + +// int32 depth = 7; +inline void FertileSlot::clear_depth() { + depth_ = 0; +} +inline ::google::protobuf::int32 FertileSlot::depth() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.FertileSlot.depth) + return depth_; +} +inline void FertileSlot::set_depth(::google::protobuf::int32 value) { + + depth_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.FertileSlot.depth) +} + +// ------------------------------------------------------------------- + +// SplitCandidate + +// .diplomacy.tensorflow.decision_trees.BinaryNode split = 1; +inline bool SplitCandidate::has_split() const { + return this != internal_default_instance() && split_ != NULL; +} +inline const ::diplomacy::tensorflow::decision_trees::BinaryNode& SplitCandidate::_internal_split() const { + return *split_; +} +inline const ::diplomacy::tensorflow::decision_trees::BinaryNode& SplitCandidate::split() const { + const ::diplomacy::tensorflow::decision_trees::BinaryNode* p = split_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitCandidate.split) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::decision_trees::_BinaryNode_default_instance_); +} +inline ::diplomacy::tensorflow::decision_trees::BinaryNode* SplitCandidate::release_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.SplitCandidate.split) + + ::diplomacy::tensorflow::decision_trees::BinaryNode* temp = split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + split_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::BinaryNode* SplitCandidate::unsafe_arena_release_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.SplitCandidate.split) + + ::diplomacy::tensorflow::decision_trees::BinaryNode* temp = split_; + split_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::decision_trees::BinaryNode* SplitCandidate::mutable_split() { + + if (split_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::decision_trees::BinaryNode>(GetArenaNoVirtual()); + split_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.SplitCandidate.split) + return split_; +} +inline void SplitCandidate::set_allocated_split(::diplomacy::tensorflow::decision_trees::BinaryNode* split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(split_); + } + if (split) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(split)->GetArena(); + if (message_arena != submessage_arena) { + split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, split, submessage_arena); + } + + } else { + + } + split_ = split; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.split) +} + +// .diplomacy.tensorflow.tensorforest.LeafStat left_stats = 4; +inline bool SplitCandidate::has_left_stats() const { + return this != internal_default_instance() && left_stats_ != NULL; +} +inline void SplitCandidate::clear_left_stats() { + if (GetArenaNoVirtual() == NULL && left_stats_ != NULL) { + delete left_stats_; + } + left_stats_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& SplitCandidate::_internal_left_stats() const { + return *left_stats_; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& SplitCandidate::left_stats() const { + const ::diplomacy::tensorflow::tensorforest::LeafStat* p = left_stats_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitCandidate.left_stats) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* SplitCandidate::release_left_stats() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.SplitCandidate.left_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = left_stats_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + left_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* SplitCandidate::unsafe_arena_release_left_stats() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.SplitCandidate.left_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = left_stats_; + left_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* SplitCandidate::mutable_left_stats() { + + if (left_stats_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LeafStat>(GetArenaNoVirtual()); + left_stats_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.SplitCandidate.left_stats) + return left_stats_; +} +inline void SplitCandidate::set_allocated_left_stats(::diplomacy::tensorflow::tensorforest::LeafStat* left_stats) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete left_stats_; + } + if (left_stats) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(left_stats); + if (message_arena != submessage_arena) { + left_stats = ::google::protobuf::internal::GetOwnedMessage( + message_arena, left_stats, submessage_arena); + } + + } else { + + } + left_stats_ = left_stats; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.left_stats) +} + +// .diplomacy.tensorflow.tensorforest.LeafStat right_stats = 5; +inline bool SplitCandidate::has_right_stats() const { + return this != internal_default_instance() && right_stats_ != NULL; +} +inline void SplitCandidate::clear_right_stats() { + if (GetArenaNoVirtual() == NULL && right_stats_ != NULL) { + delete right_stats_; + } + right_stats_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& SplitCandidate::_internal_right_stats() const { + return *right_stats_; +} +inline const ::diplomacy::tensorflow::tensorforest::LeafStat& SplitCandidate::right_stats() const { + const ::diplomacy::tensorflow::tensorforest::LeafStat* p = right_stats_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitCandidate.right_stats) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_LeafStat_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* SplitCandidate::release_right_stats() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.SplitCandidate.right_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = right_stats_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + right_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* SplitCandidate::unsafe_arena_release_right_stats() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.SplitCandidate.right_stats) + + ::diplomacy::tensorflow::tensorforest::LeafStat* temp = right_stats_; + right_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::LeafStat* SplitCandidate::mutable_right_stats() { + + if (right_stats_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LeafStat>(GetArenaNoVirtual()); + right_stats_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.SplitCandidate.right_stats) + return right_stats_; +} +inline void SplitCandidate::set_allocated_right_stats(::diplomacy::tensorflow::tensorforest::LeafStat* right_stats) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete right_stats_; + } + if (right_stats) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(right_stats); + if (message_arena != submessage_arena) { + right_stats = ::google::protobuf::internal::GetOwnedMessage( + message_arena, right_stats, submessage_arena); + } + + } else { + + } + right_stats_ = right_stats; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.right_stats) +} + +// string unique_id = 6; +inline void SplitCandidate::clear_unique_id() { + unique_id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SplitCandidate::unique_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) + return unique_id_.Get(); +} +inline void SplitCandidate::set_unique_id(const ::std::string& value) { + + unique_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) +} +#if LANG_CXX11 +inline void SplitCandidate::set_unique_id(::std::string&& value) { + + unique_id_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) +} +#endif +inline void SplitCandidate::set_unique_id(const char* value) { + GOOGLE_DCHECK(value != NULL); + + unique_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) +} +inline void SplitCandidate::set_unique_id(const char* value, + size_t size) { + + unique_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) +} +inline ::std::string* SplitCandidate::mutable_unique_id() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) + return unique_id_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SplitCandidate::release_unique_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) + + return unique_id_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SplitCandidate::set_allocated_unique_id(::std::string* unique_id) { + if (unique_id != NULL) { + + } else { + + } + unique_id_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), unique_id, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) +} +inline ::std::string* SplitCandidate::unsafe_arena_release_unique_id() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return unique_id_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SplitCandidate::unsafe_arena_set_allocated_unique_id( + ::std::string* unique_id) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (unique_id != NULL) { + + } else { + + } + unique_id_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + unique_id, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id) +} + +// ------------------------------------------------------------------- + +// TreePath + +// repeated .diplomacy.tensorflow.decision_trees.TreeNode nodes_visited = 1; +inline int TreePath::nodes_visited_size() const { + return nodes_visited_.size(); +} +inline ::diplomacy::tensorflow::decision_trees::TreeNode* TreePath::mutable_nodes_visited(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TreePath.nodes_visited) + return nodes_visited_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >* +TreePath::mutable_nodes_visited() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tensorforest.TreePath.nodes_visited) + return &nodes_visited_; +} +inline const ::diplomacy::tensorflow::decision_trees::TreeNode& TreePath::nodes_visited(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TreePath.nodes_visited) + return nodes_visited_.Get(index); +} +inline ::diplomacy::tensorflow::decision_trees::TreeNode* TreePath::add_nodes_visited() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tensorforest.TreePath.nodes_visited) + return nodes_visited_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::decision_trees::TreeNode >& +TreePath::nodes_visited() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tensorforest.TreePath.nodes_visited) + return nodes_visited_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ffertile_5fstats_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto new file mode 100644 index 0000000..8d8a0ec --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; +option cc_enable_arenas = true; + +package diplomacy.tensorflow.tensorforest; + +import "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto"; + + +message FertileStats { + // Tracks stats for each node. node_to_slot[i] is the FertileSlot for node i. + // This may be sized to max_nodes initially, or grow dynamically as needed. + repeated FertileSlot node_to_slot = 1; +} + + +message GiniStats { + // This allows us to quickly track and calculate impurity (classification) + // by storing the sum of input weights and the sum of the squares of the + // input weights. Weighted gini is then: 1 - (square / sum * sum). + // Updates to these numbers are: + // old_i = leaf->value(label) + // new_i = old_i + incoming_weight + // sum -> sum + incoming_weight + // square -> square - (old_i ^ 2) + (new_i ^ 2) + // total_left_sum -> total_left_sum - old_left_i * old_total_i + + // new_left_i * new_total_i + float square = 2; +} + +message LeafStat { + // The sum of the weights of the training examples that we have seen. + // This is here, outside of the leaf_stat oneof, because almost all + // types will want it. + float weight_sum = 3; + + // TODO(thomaswc): Move the GiniStats out of LeafStats and into something + // that only tracks them for splits. + message GiniImpurityClassificationStats { + oneof counts { + decision_trees.Vector dense_counts = 1; + decision_trees.SparseVector sparse_counts = 2; + } + GiniStats gini = 3; + } + + // This is the info needed for calculating variance for regression. + // Variance will still have to be summed over every output, but the + // number of outputs in regression problems is almost always 1. + message LeastSquaresRegressionStats { + decision_trees.Vector mean_output = 1; + decision_trees.Vector mean_output_squares = 2; + } + + oneof leaf_stat { + GiniImpurityClassificationStats classification = 1; + LeastSquaresRegressionStats regression = 2; + // TODO(thomaswc): Add in v5's SparseClassStats. + } +} + +message FertileSlot { + // The statistics for *all* the examples seen at this leaf. + LeafStat leaf_stats = 4; + + repeated SplitCandidate candidates = 1; + + // The statistics for the examples seen at this leaf after all the + // splits have been initialized. If post_init_leaf_stats.weight_sum + // is > 0, then all candidates have been initialized. We need to track + // both leaf_stats and post_init_leaf_stats because the first is used + // to create the decision_tree::Leaf and the second is used to infer + // the statistics for the right side of a split (given the leaf side + // stats). + LeafStat post_init_leaf_stats = 6; + + int32 node_id = 5; + int32 depth = 7; +} + +message SplitCandidate { + // proto representing the potential node. + decision_trees.BinaryNode split = 1; + + // Right counts are inferred from FertileSlot.leaf_stats and left. + LeafStat left_stats = 4; + + // Right stats (not full counts) are kept here. + LeafStat right_stats = 5; + + // Fields used when training with a graph runner. + string unique_id = 6; +} + +// Proto used for tracking tree paths during inference time. +message TreePath { + // Nodes are listed in order that they were traversed. i.e. nodes_visited[0] + // is the tree's root node. + repeated decision_trees.TreeNode nodes_visited = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats_pb2.py new file mode 100644 index 0000000..78b8dad --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats_pb2.py @@ -0,0 +1,462 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.contrib.decision_trees.proto import generic_tree_model_pb2 as diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto', + package='diplomacy.tensorflow.tensorforest', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\nDdiplomacy_tensorflow/contrib/tensor_forest/proto/fertile_stats.proto\x12!diplomacy.tensorflow.tensorforest\x1aJdiplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto\"T\n\x0c\x46\x65rtileStats\x12\x44\n\x0cnode_to_slot\x18\x01 \x03(\x0b\x32..diplomacy.tensorflow.tensorforest.FertileSlot\"\x1b\n\tGiniStats\x12\x0e\n\x06square\x18\x02 \x01(\x02\"\x98\x05\n\x08LeafStat\x12\x12\n\nweight_sum\x18\x03 \x01(\x02\x12\x65\n\x0e\x63lassification\x18\x01 \x01(\x0b\x32K.diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStatsH\x00\x12]\n\nregression\x18\x02 \x01(\x0b\x32G.diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStatsH\x00\x1a\xf8\x01\n\x1fGiniImpurityClassificationStats\x12\x43\n\x0c\x64\x65nse_counts\x18\x01 \x01(\x0b\x32+.diplomacy.tensorflow.decision_trees.VectorH\x00\x12J\n\rsparse_counts\x18\x02 \x01(\x0b\x32\x31.diplomacy.tensorflow.decision_trees.SparseVectorH\x00\x12:\n\x04gini\x18\x03 \x01(\x0b\x32,.diplomacy.tensorflow.tensorforest.GiniStatsB\x08\n\x06\x63ounts\x1a\xa9\x01\n\x1bLeastSquaresRegressionStats\x12@\n\x0bmean_output\x18\x01 \x01(\x0b\x32+.diplomacy.tensorflow.decision_trees.Vector\x12H\n\x13mean_output_squares\x18\x02 \x01(\x0b\x32+.diplomacy.tensorflow.decision_trees.VectorB\x0b\n\tleaf_stat\"\x80\x02\n\x0b\x46\x65rtileSlot\x12?\n\nleaf_stats\x18\x04 \x01(\x0b\x32+.diplomacy.tensorflow.tensorforest.LeafStat\x12\x45\n\ncandidates\x18\x01 \x03(\x0b\x32\x31.diplomacy.tensorflow.tensorforest.SplitCandidate\x12I\n\x14post_init_leaf_stats\x18\x06 \x01(\x0b\x32+.diplomacy.tensorflow.tensorforest.LeafStat\x12\x0f\n\x07node_id\x18\x05 \x01(\x05\x12\r\n\x05\x64\x65pth\x18\x07 \x01(\x05\"\xe6\x01\n\x0eSplitCandidate\x12>\n\x05split\x18\x01 \x01(\x0b\x32/.diplomacy.tensorflow.decision_trees.BinaryNode\x12?\n\nleft_stats\x18\x04 \x01(\x0b\x32+.diplomacy.tensorflow.tensorforest.LeafStat\x12@\n\x0bright_stats\x18\x05 \x01(\x0b\x32+.diplomacy.tensorflow.tensorforest.LeafStat\x12\x11\n\tunique_id\x18\x06 \x01(\t\"P\n\x08TreePath\x12\x44\n\rnodes_visited\x18\x01 \x03(\x0b\x32-.diplomacy.tensorflow.decision_trees.TreeNodeB\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2.DESCRIPTOR,]) + + + + +_FERTILESTATS = _descriptor.Descriptor( + name='FertileStats', + full_name='diplomacy.tensorflow.tensorforest.FertileStats', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_to_slot', full_name='diplomacy.tensorflow.tensorforest.FertileStats.node_to_slot', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=183, + serialized_end=267, +) + + +_GINISTATS = _descriptor.Descriptor( + name='GiniStats', + full_name='diplomacy.tensorflow.tensorforest.GiniStats', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='square', full_name='diplomacy.tensorflow.tensorforest.GiniStats.square', index=0, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=269, + serialized_end=296, +) + + +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS = _descriptor.Descriptor( + name='GiniImpurityClassificationStats', + full_name='diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dense_counts', full_name='diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.dense_counts', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sparse_counts', full_name='diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.sparse_counts', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='gini', full_name='diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.gini', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='counts', full_name='diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats.counts', + index=0, containing_type=None, fields=[]), + ], + serialized_start=530, + serialized_end=778, +) + +_LEAFSTAT_LEASTSQUARESREGRESSIONSTATS = _descriptor.Descriptor( + name='LeastSquaresRegressionStats', + full_name='diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='mean_output', full_name='diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mean_output_squares', full_name='diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats.mean_output_squares', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=781, + serialized_end=950, +) + +_LEAFSTAT = _descriptor.Descriptor( + name='LeafStat', + full_name='diplomacy.tensorflow.tensorforest.LeafStat', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='weight_sum', full_name='diplomacy.tensorflow.tensorforest.LeafStat.weight_sum', index=0, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='classification', full_name='diplomacy.tensorflow.tensorforest.LeafStat.classification', index=1, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='regression', full_name='diplomacy.tensorflow.tensorforest.LeafStat.regression', index=2, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS, _LEAFSTAT_LEASTSQUARESREGRESSIONSTATS, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='leaf_stat', full_name='diplomacy.tensorflow.tensorforest.LeafStat.leaf_stat', + index=0, containing_type=None, fields=[]), + ], + serialized_start=299, + serialized_end=963, +) + + +_FERTILESLOT = _descriptor.Descriptor( + name='FertileSlot', + full_name='diplomacy.tensorflow.tensorforest.FertileSlot', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='leaf_stats', full_name='diplomacy.tensorflow.tensorforest.FertileSlot.leaf_stats', index=0, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='candidates', full_name='diplomacy.tensorflow.tensorforest.FertileSlot.candidates', index=1, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='post_init_leaf_stats', full_name='diplomacy.tensorflow.tensorforest.FertileSlot.post_init_leaf_stats', index=2, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_id', full_name='diplomacy.tensorflow.tensorforest.FertileSlot.node_id', index=3, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='depth', full_name='diplomacy.tensorflow.tensorforest.FertileSlot.depth', index=4, + number=7, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=966, + serialized_end=1222, +) + + +_SPLITCANDIDATE = _descriptor.Descriptor( + name='SplitCandidate', + full_name='diplomacy.tensorflow.tensorforest.SplitCandidate', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='split', full_name='diplomacy.tensorflow.tensorforest.SplitCandidate.split', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_stats', full_name='diplomacy.tensorflow.tensorforest.SplitCandidate.left_stats', index=1, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_stats', full_name='diplomacy.tensorflow.tensorforest.SplitCandidate.right_stats', index=2, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='unique_id', full_name='diplomacy.tensorflow.tensorforest.SplitCandidate.unique_id', index=3, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1225, + serialized_end=1455, +) + + +_TREEPATH = _descriptor.Descriptor( + name='TreePath', + full_name='diplomacy.tensorflow.tensorforest.TreePath', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nodes_visited', full_name='diplomacy.tensorflow.tensorforest.TreePath.nodes_visited', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1457, + serialized_end=1537, +) + +_FERTILESTATS.fields_by_name['node_to_slot'].message_type = _FERTILESLOT +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.fields_by_name['dense_counts'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._VECTOR +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.fields_by_name['sparse_counts'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._SPARSEVECTOR +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.fields_by_name['gini'].message_type = _GINISTATS +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.containing_type = _LEAFSTAT +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.oneofs_by_name['counts'].fields.append( + _LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.fields_by_name['dense_counts']) +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.fields_by_name['dense_counts'].containing_oneof = _LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.oneofs_by_name['counts'] +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.oneofs_by_name['counts'].fields.append( + _LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.fields_by_name['sparse_counts']) +_LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.fields_by_name['sparse_counts'].containing_oneof = _LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS.oneofs_by_name['counts'] +_LEAFSTAT_LEASTSQUARESREGRESSIONSTATS.fields_by_name['mean_output'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._VECTOR +_LEAFSTAT_LEASTSQUARESREGRESSIONSTATS.fields_by_name['mean_output_squares'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._VECTOR +_LEAFSTAT_LEASTSQUARESREGRESSIONSTATS.containing_type = _LEAFSTAT +_LEAFSTAT.fields_by_name['classification'].message_type = _LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS +_LEAFSTAT.fields_by_name['regression'].message_type = _LEAFSTAT_LEASTSQUARESREGRESSIONSTATS +_LEAFSTAT.oneofs_by_name['leaf_stat'].fields.append( + _LEAFSTAT.fields_by_name['classification']) +_LEAFSTAT.fields_by_name['classification'].containing_oneof = _LEAFSTAT.oneofs_by_name['leaf_stat'] +_LEAFSTAT.oneofs_by_name['leaf_stat'].fields.append( + _LEAFSTAT.fields_by_name['regression']) +_LEAFSTAT.fields_by_name['regression'].containing_oneof = _LEAFSTAT.oneofs_by_name['leaf_stat'] +_FERTILESLOT.fields_by_name['leaf_stats'].message_type = _LEAFSTAT +_FERTILESLOT.fields_by_name['candidates'].message_type = _SPLITCANDIDATE +_FERTILESLOT.fields_by_name['post_init_leaf_stats'].message_type = _LEAFSTAT +_SPLITCANDIDATE.fields_by_name['split'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._BINARYNODE +_SPLITCANDIDATE.fields_by_name['left_stats'].message_type = _LEAFSTAT +_SPLITCANDIDATE.fields_by_name['right_stats'].message_type = _LEAFSTAT +_TREEPATH.fields_by_name['nodes_visited'].message_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._TREENODE +DESCRIPTOR.message_types_by_name['FertileStats'] = _FERTILESTATS +DESCRIPTOR.message_types_by_name['GiniStats'] = _GINISTATS +DESCRIPTOR.message_types_by_name['LeafStat'] = _LEAFSTAT +DESCRIPTOR.message_types_by_name['FertileSlot'] = _FERTILESLOT +DESCRIPTOR.message_types_by_name['SplitCandidate'] = _SPLITCANDIDATE +DESCRIPTOR.message_types_by_name['TreePath'] = _TREEPATH +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +FertileStats = _reflection.GeneratedProtocolMessageType('FertileStats', (_message.Message,), dict( + DESCRIPTOR = _FERTILESTATS, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.FertileStats) + )) +_sym_db.RegisterMessage(FertileStats) + +GiniStats = _reflection.GeneratedProtocolMessageType('GiniStats', (_message.Message,), dict( + DESCRIPTOR = _GINISTATS, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.GiniStats) + )) +_sym_db.RegisterMessage(GiniStats) + +LeafStat = _reflection.GeneratedProtocolMessageType('LeafStat', (_message.Message,), dict( + + GiniImpurityClassificationStats = _reflection.GeneratedProtocolMessageType('GiniImpurityClassificationStats', (_message.Message,), dict( + DESCRIPTOR = _LEAFSTAT_GINIIMPURITYCLASSIFICATIONSTATS, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LeafStat.GiniImpurityClassificationStats) + )) + , + + LeastSquaresRegressionStats = _reflection.GeneratedProtocolMessageType('LeastSquaresRegressionStats', (_message.Message,), dict( + DESCRIPTOR = _LEAFSTAT_LEASTSQUARESREGRESSIONSTATS, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LeafStat.LeastSquaresRegressionStats) + )) + , + DESCRIPTOR = _LEAFSTAT, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LeafStat) + )) +_sym_db.RegisterMessage(LeafStat) +_sym_db.RegisterMessage(LeafStat.GiniImpurityClassificationStats) +_sym_db.RegisterMessage(LeafStat.LeastSquaresRegressionStats) + +FertileSlot = _reflection.GeneratedProtocolMessageType('FertileSlot', (_message.Message,), dict( + DESCRIPTOR = _FERTILESLOT, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.FertileSlot) + )) +_sym_db.RegisterMessage(FertileSlot) + +SplitCandidate = _reflection.GeneratedProtocolMessageType('SplitCandidate', (_message.Message,), dict( + DESCRIPTOR = _SPLITCANDIDATE, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.SplitCandidate) + )) +_sym_db.RegisterMessage(SplitCandidate) + +TreePath = _reflection.GeneratedProtocolMessageType('TreePath', (_message.Message,), dict( + DESCRIPTOR = _TREEPATH, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.fertile_stats_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.TreePath) + )) +_sym_db.RegisterMessage(TreePath) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.pb.cc new file mode 100644 index 0000000..78481b4 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.pb.cc @@ -0,0 +1,3624 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto + +#include "diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ExponentialParam; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_LinearParam; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ThresholdParam; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SplitFinishConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SplitPruningConfig; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_DepthDependentParam; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { +class SplitPruningConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SplitPruningConfig_default_instance_; +class SplitFinishConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SplitFinishConfig_default_instance_; +class LinearParamDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LinearParam_default_instance_; +class ExponentialParamDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExponentialParam_default_instance_; +class ThresholdParamDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ThresholdParam_default_instance_; +class DepthDependentParamDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + float constant_value_; + const ::diplomacy::tensorflow::tensorforest::LinearParam* linear_; + const ::diplomacy::tensorflow::tensorforest::ExponentialParam* exponential_; + const ::diplomacy::tensorflow::tensorforest::ThresholdParam* threshold_; +} _DepthDependentParam_default_instance_; +class TensorForestParamsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorForestParams_default_instance_; +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto { +static void InitDefaultsSplitPruningConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_SplitPruningConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::SplitPruningConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::SplitPruningConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SplitPruningConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSplitPruningConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_DepthDependentParam.base,}}; + +static void InitDefaultsSplitFinishConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_SplitFinishConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::SplitFinishConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::SplitFinishConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SplitFinishConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSplitFinishConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_DepthDependentParam.base,}}; + +static void InitDefaultsLinearParam() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_LinearParam_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::LinearParam(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::LinearParam::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_LinearParam = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLinearParam}, {}}; + +static void InitDefaultsExponentialParam() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_ExponentialParam_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::ExponentialParam(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::ExponentialParam::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ExponentialParam = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsExponentialParam}, {}}; + +static void InitDefaultsThresholdParam() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_ThresholdParam_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::ThresholdParam(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::ThresholdParam::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ThresholdParam = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsThresholdParam}, {}}; + +static void InitDefaultsDepthDependentParam() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::DepthDependentParam(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::DepthDependentParam::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_DepthDependentParam = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsDepthDependentParam}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_LinearParam.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_ExponentialParam.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_ThresholdParam.base,}}; + +static void InitDefaultsTensorForestParams() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_; + new (ptr) ::diplomacy::tensorflow::tensorforest::TensorForestParams(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tensorforest::TensorForestParams::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_TensorForestParams = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsTensorForestParams}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_SplitPruningConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_SplitFinishConfig.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_DepthDependentParam.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_SplitPruningConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_SplitFinishConfig.base); + ::google::protobuf::internal::InitSCC(&scc_info_LinearParam.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExponentialParam.base); + ::google::protobuf::internal::InitSCC(&scc_info_ThresholdParam.base); + ::google::protobuf::internal::InitSCC(&scc_info_DepthDependentParam.base); + ::google::protobuf::internal::InitSCC(&scc_info_TensorForestParams.base); +} + +::google::protobuf::Metadata file_level_metadata[7]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[5]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitPruningConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitPruningConfig, prune_every_samples_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitPruningConfig, type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitFinishConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitFinishConfig, check_every_steps_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::SplitFinishConfig, type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LinearParam, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LinearParam, slope_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LinearParam, y_intercept_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LinearParam, min_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::LinearParam, max_val_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ExponentialParam, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ExponentialParam, bias_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ExponentialParam, base_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ExponentialParam, multiplier_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ExponentialParam, depth_multiplier_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ThresholdParam, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ThresholdParam, on_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ThresholdParam, off_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::ThresholdParam, threshold_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::DepthDependentParam, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::DepthDependentParam, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::tensorforest::DepthDependentParamDefaultTypeInternal, constant_value_), + offsetof(::diplomacy::tensorflow::tensorforest::DepthDependentParamDefaultTypeInternal, linear_), + offsetof(::diplomacy::tensorflow::tensorforest::DepthDependentParamDefaultTypeInternal, exponential_), + offsetof(::diplomacy::tensorflow::tensorforest::DepthDependentParamDefaultTypeInternal, threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::DepthDependentParam, ParamType_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, leaf_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, stats_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, collection_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, pruning_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, finish_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, num_trees_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, max_nodes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, num_features_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, inequality_test_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, is_regression_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, drop_final_class_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, collate_examples_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, checkpoint_stats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, use_running_stats_method_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, initialize_average_splits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, inference_tree_paths_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, num_outputs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, num_splits_to_consider_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, split_after_samples_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, dominate_fraction_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, min_split_samples_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, graph_dir_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, num_select_features_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tensorforest::TensorForestParams, num_classes_to_track_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tensorforest::SplitPruningConfig)}, + { 7, -1, sizeof(::diplomacy::tensorflow::tensorforest::SplitFinishConfig)}, + { 14, -1, sizeof(::diplomacy::tensorflow::tensorforest::LinearParam)}, + { 23, -1, sizeof(::diplomacy::tensorflow::tensorforest::ExponentialParam)}, + { 32, -1, sizeof(::diplomacy::tensorflow::tensorforest::ThresholdParam)}, + { 40, -1, sizeof(::diplomacy::tensorflow::tensorforest::DepthDependentParam)}, + { 50, -1, sizeof(::diplomacy::tensorflow::tensorforest::TensorForestParams)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_SplitPruningConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_SplitFinishConfig_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_LinearParam_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_ExponentialParam_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_ThresholdParam_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nKdiplomacy_tensorflow/contrib/tensor_fo" + "rest/proto/tensor_forest_params.proto\022!d" + "iplomacy.tensorflow.tensorforest\032Jdiplom" + "acy_tensorflow/contrib/decision_trees/pr" + "oto/generic_tree_model.proto\"\264\001\n\022SplitPr" + "uningConfig\022S\n\023prune_every_samples\030\001 \001(\013" + "26.diplomacy.tensorflow.tensorforest.Dep" + "thDependentParam\022I\n\004type\030\002 \001(\0162;.diploma" + "cy.tensorflow.tensorforest.SplitPruningS" + "trategyType\"\260\001\n\021SplitFinishConfig\022Q\n\021che" + "ck_every_steps\030\001 \001(\01326.diplomacy.tensorf" + "low.tensorforest.DepthDependentParam\022H\n\004" + "type\030\002 \001(\0162:.diplomacy.tensorflow.tensor" + "forest.SplitFinishStrategyType\"S\n\013Linear" + "Param\022\r\n\005slope\030\001 \001(\002\022\023\n\013y_intercept\030\002 \001(" + "\002\022\017\n\007min_val\030\003 \001(\002\022\017\n\007max_val\030\004 \001(\002\"\\\n\020E" + "xponentialParam\022\014\n\004bias\030\001 \001(\002\022\014\n\004base\030\002 " + "\001(\002\022\022\n\nmultiplier\030\003 \001(\002\022\030\n\020depth_multipl" + "ier\030\004 \001(\002\"H\n\016ThresholdParam\022\020\n\010on_value\030" + "\001 \001(\002\022\021\n\toff_value\030\002 \001(\002\022\021\n\tthreshold\030\003 " + "\001(\002\"\222\002\n\023DepthDependentParam\022\030\n\016constant_" + "value\030\001 \001(\002H\000\022@\n\006linear\030\002 \001(\0132..diplomac" + "y.tensorflow.tensorforest.LinearParamH\000\022" + "J\n\013exponential\030\003 \001(\01323.diplomacy.tensorf" + "low.tensorforest.ExponentialParamH\000\022F\n\tt" + "hreshold\030\004 \001(\01321.diplomacy.tensorflow.te" + "nsorforest.ThresholdParamH\000B\013\n\tParamType" + "\"\233\t\n\022TensorForestParams\022C\n\tleaf_type\030\001 \001" + "(\01620.diplomacy.tensorflow.tensorforest.L" + "eafModelType\022E\n\nstats_type\030\002 \001(\01621.diplo" + "macy.tensorflow.tensorforest.StatsModelT" + "ype\022O\n\017collection_type\030\003 \001(\01626.diplomacy" + ".tensorflow.tensorforest.SplitCollection" + "Type\022K\n\014pruning_type\030\004 \001(\01325.diplomacy.t" + "ensorflow.tensorforest.SplitPruningConfi" + "g\022I\n\013finish_type\030\005 \001(\01324.diplomacy.tenso" + "rflow.tensorforest.SplitFinishConfig\022\021\n\t" + "num_trees\030\006 \001(\005\022\021\n\tmax_nodes\030\007 \001(\005\022\024\n\014nu" + "m_features\030\025 \001(\005\022V\n\024inequality_test_type" + "\030\023 \001(\01628.diplomacy.tensorflow.decision_t" + "rees.InequalityTest.Type\022\025\n\ris_regressio" + "n\030\010 \001(\010\022\030\n\020drop_final_class\030\t \001(\010\022\030\n\020col" + "late_examples\030\n \001(\010\022\030\n\020checkpoint_stats\030" + "\013 \001(\010\022 \n\030use_running_stats_method\030\024 \001(\010\022" + "!\n\031initialize_average_splits\030\026 \001(\010\022\034\n\024in" + "ference_tree_paths\030\027 \001(\010\022\023\n\013num_outputs\030" + "\014 \001(\005\022V\n\026num_splits_to_consider\030\r \001(\01326." + "diplomacy.tensorflow.tensorforest.DepthD" + "ependentParam\022S\n\023split_after_samples\030\016 \001" + "(\01326.diplomacy.tensorflow.tensorforest.D" + "epthDependentParam\022Q\n\021dominate_fraction\030" + "\017 \001(\01326.diplomacy.tensorflow.tensorfores" + "t.DepthDependentParam\022Q\n\021min_split_sampl" + "es\030\022 \001(\01326.diplomacy.tensorflow.tensorfo" + "rest.DepthDependentParam\022\021\n\tgraph_dir\030\020 " + "\001(\t\022\033\n\023num_select_features\030\021 \001(\005\022\034\n\024num_" + "classes_to_track\030\030 \001(\005*\220\001\n\rLeafModelType" + "\022\036\n\032MODEL_DENSE_CLASSIFICATION\020\000\022\037\n\033MODE" + "L_SPARSE_CLASSIFICATION\020\001\022\024\n\020MODEL_REGRE" + "SSION\020\002\022(\n$MODEL_SPARSE_OR_DENSE_CLASSIF" + "ICATION\020\003*\245\001\n\016StatsModelType\022\024\n\020STATS_DE" + "NSE_GINI\020\000\022\025\n\021STATS_SPARSE_GINI\020\001\022\"\n\036STA" + "TS_LEAST_SQUARES_REGRESSION\020\002\022 \n\034STATS_S" + "PARSE_THEN_DENSE_GINI\020\003\022 \n\034STATS_FIXED_S" + "IZE_SPARSE_GINI\020\004*H\n\023SplitCollectionType" + "\022\024\n\020COLLECTION_BASIC\020\000\022\033\n\027GRAPH_RUNNER_C" + "OLLECTION\020\001*\226\001\n\030SplitPruningStrategyType" + "\022\024\n\020SPLIT_PRUNE_NONE\020\000\022\024\n\020SPLIT_PRUNE_HA" + "LF\020\001\022\027\n\023SPLIT_PRUNE_QUARTER\020\002\022\032\n\026SPLIT_P" + "RUNE_10_PERCENT\020\003\022\031\n\025SPLIT_PRUNE_HOEFFDI" + "NG\020\004*{\n\027SplitFinishStrategyType\022\026\n\022SPLIT" + "_FINISH_BASIC\020\000\022#\n\037SPLIT_FINISH_DOMINATE" + "_HOEFFDING\020\002\022#\n\037SPLIT_FINISH_DOMINATE_BO" + "OTSTRAP\020\003b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 2937); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fdecision_5ftrees_2fproto_2fgeneric_5ftree_5fmodel_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { +const ::google::protobuf::EnumDescriptor* LeafModelType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_enum_descriptors[0]; +} +bool LeafModelType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* StatsModelType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_enum_descriptors[1]; +} +bool StatsModelType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* SplitCollectionType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_enum_descriptors[2]; +} +bool SplitCollectionType_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* SplitPruningStrategyType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_enum_descriptors[3]; +} +bool SplitPruningStrategyType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* SplitFinishStrategyType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_enum_descriptors[4]; +} +bool SplitFinishStrategyType_IsValid(int value) { + switch (value) { + case 0: + case 2: + case 3: + return true; + default: + return false; + } +} + + +// =================================================================== + +void SplitPruningConfig::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_SplitPruningConfig_default_instance_._instance.get_mutable()->prune_every_samples_ = const_cast< ::diplomacy::tensorflow::tensorforest::DepthDependentParam*>( + ::diplomacy::tensorflow::tensorforest::DepthDependentParam::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SplitPruningConfig::kPruneEverySamplesFieldNumber; +const int SplitPruningConfig::kTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SplitPruningConfig::SplitPruningConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_SplitPruningConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.SplitPruningConfig) +} +SplitPruningConfig::SplitPruningConfig(const SplitPruningConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_prune_every_samples()) { + prune_every_samples_ = new ::diplomacy::tensorflow::tensorforest::DepthDependentParam(*from.prune_every_samples_); + } else { + prune_every_samples_ = NULL; + } + type_ = from.type_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.SplitPruningConfig) +} + +void SplitPruningConfig::SharedCtor() { + ::memset(&prune_every_samples_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&prune_every_samples_)) + sizeof(type_)); +} + +SplitPruningConfig::~SplitPruningConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + SharedDtor(); +} + +void SplitPruningConfig::SharedDtor() { + if (this != internal_default_instance()) delete prune_every_samples_; +} + +void SplitPruningConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SplitPruningConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SplitPruningConfig& SplitPruningConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_SplitPruningConfig.base); + return *internal_default_instance(); +} + + +void SplitPruningConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && prune_every_samples_ != NULL) { + delete prune_every_samples_; + } + prune_every_samples_ = NULL; + type_ = 0; + _internal_metadata_.Clear(); +} + +bool SplitPruningConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tensorforest.DepthDependentParam prune_every_samples = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_prune_every_samples())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningStrategyType type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + return false; +#undef DO_ +} + +void SplitPruningConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam prune_every_samples = 1; + if (this->has_prune_every_samples()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_prune_every_samples(), output); + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningStrategyType type = 2; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.SplitPruningConfig) +} + +::google::protobuf::uint8* SplitPruningConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam prune_every_samples = 1; + if (this->has_prune_every_samples()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_prune_every_samples(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningStrategyType type = 2; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->type(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + return target; +} + +size_t SplitPruningConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.tensorforest.DepthDependentParam prune_every_samples = 1; + if (this->has_prune_every_samples()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *prune_every_samples_); + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningStrategyType type = 2; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SplitPruningConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + GOOGLE_DCHECK_NE(&from, this); + const SplitPruningConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + MergeFrom(*source); + } +} + +void SplitPruningConfig::MergeFrom(const SplitPruningConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_prune_every_samples()) { + mutable_prune_every_samples()->::diplomacy::tensorflow::tensorforest::DepthDependentParam::MergeFrom(from.prune_every_samples()); + } + if (from.type() != 0) { + set_type(from.type()); + } +} + +void SplitPruningConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SplitPruningConfig::CopyFrom(const SplitPruningConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SplitPruningConfig::IsInitialized() const { + return true; +} + +void SplitPruningConfig::Swap(SplitPruningConfig* other) { + if (other == this) return; + InternalSwap(other); +} +void SplitPruningConfig::InternalSwap(SplitPruningConfig* other) { + using std::swap; + swap(prune_every_samples_, other->prune_every_samples_); + swap(type_, other->type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SplitPruningConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SplitFinishConfig::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_SplitFinishConfig_default_instance_._instance.get_mutable()->check_every_steps_ = const_cast< ::diplomacy::tensorflow::tensorforest::DepthDependentParam*>( + ::diplomacy::tensorflow::tensorforest::DepthDependentParam::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SplitFinishConfig::kCheckEveryStepsFieldNumber; +const int SplitFinishConfig::kTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SplitFinishConfig::SplitFinishConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_SplitFinishConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.SplitFinishConfig) +} +SplitFinishConfig::SplitFinishConfig(const SplitFinishConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_check_every_steps()) { + check_every_steps_ = new ::diplomacy::tensorflow::tensorforest::DepthDependentParam(*from.check_every_steps_); + } else { + check_every_steps_ = NULL; + } + type_ = from.type_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.SplitFinishConfig) +} + +void SplitFinishConfig::SharedCtor() { + ::memset(&check_every_steps_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&check_every_steps_)) + sizeof(type_)); +} + +SplitFinishConfig::~SplitFinishConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + SharedDtor(); +} + +void SplitFinishConfig::SharedDtor() { + if (this != internal_default_instance()) delete check_every_steps_; +} + +void SplitFinishConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SplitFinishConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SplitFinishConfig& SplitFinishConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_SplitFinishConfig.base); + return *internal_default_instance(); +} + + +void SplitFinishConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && check_every_steps_ != NULL) { + delete check_every_steps_; + } + check_every_steps_ = NULL; + type_ = 0; + _internal_metadata_.Clear(); +} + +bool SplitFinishConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tensorforest.DepthDependentParam check_every_steps = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_check_every_steps())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishStrategyType type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + return false; +#undef DO_ +} + +void SplitFinishConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam check_every_steps = 1; + if (this->has_check_every_steps()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_check_every_steps(), output); + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishStrategyType type = 2; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.SplitFinishConfig) +} + +::google::protobuf::uint8* SplitFinishConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam check_every_steps = 1; + if (this->has_check_every_steps()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_check_every_steps(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishStrategyType type = 2; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->type(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + return target; +} + +size_t SplitFinishConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.tensorforest.DepthDependentParam check_every_steps = 1; + if (this->has_check_every_steps()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *check_every_steps_); + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishStrategyType type = 2; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SplitFinishConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + GOOGLE_DCHECK_NE(&from, this); + const SplitFinishConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + MergeFrom(*source); + } +} + +void SplitFinishConfig::MergeFrom(const SplitFinishConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_check_every_steps()) { + mutable_check_every_steps()->::diplomacy::tensorflow::tensorforest::DepthDependentParam::MergeFrom(from.check_every_steps()); + } + if (from.type() != 0) { + set_type(from.type()); + } +} + +void SplitFinishConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SplitFinishConfig::CopyFrom(const SplitFinishConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SplitFinishConfig::IsInitialized() const { + return true; +} + +void SplitFinishConfig::Swap(SplitFinishConfig* other) { + if (other == this) return; + InternalSwap(other); +} +void SplitFinishConfig::InternalSwap(SplitFinishConfig* other) { + using std::swap; + swap(check_every_steps_, other->check_every_steps_); + swap(type_, other->type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SplitFinishConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LinearParam::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LinearParam::kSlopeFieldNumber; +const int LinearParam::kYInterceptFieldNumber; +const int LinearParam::kMinValFieldNumber; +const int LinearParam::kMaxValFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LinearParam::LinearParam() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_LinearParam.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.LinearParam) +} +LinearParam::LinearParam(const LinearParam& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&slope_, &from.slope_, + static_cast(reinterpret_cast(&max_val_) - + reinterpret_cast(&slope_)) + sizeof(max_val_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.LinearParam) +} + +void LinearParam::SharedCtor() { + ::memset(&slope_, 0, static_cast( + reinterpret_cast(&max_val_) - + reinterpret_cast(&slope_)) + sizeof(max_val_)); +} + +LinearParam::~LinearParam() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.LinearParam) + SharedDtor(); +} + +void LinearParam::SharedDtor() { +} + +void LinearParam::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LinearParam::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LinearParam& LinearParam::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_LinearParam.base); + return *internal_default_instance(); +} + + +void LinearParam::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.LinearParam) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&slope_, 0, static_cast( + reinterpret_cast(&max_val_) - + reinterpret_cast(&slope_)) + sizeof(max_val_)); + _internal_metadata_.Clear(); +} + +bool LinearParam::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.LinearParam) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float slope = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &slope_))); + } else { + goto handle_unusual; + } + break; + } + + // float y_intercept = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &y_intercept_))); + } else { + goto handle_unusual; + } + break; + } + + // float min_val = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_val_))); + } else { + goto handle_unusual; + } + break; + } + + // float max_val = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_val_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.LinearParam) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.LinearParam) + return false; +#undef DO_ +} + +void LinearParam::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.LinearParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float slope = 1; + if (this->slope() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->slope(), output); + } + + // float y_intercept = 2; + if (this->y_intercept() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->y_intercept(), output); + } + + // float min_val = 3; + if (this->min_val() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->min_val(), output); + } + + // float max_val = 4; + if (this->max_val() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->max_val(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.LinearParam) +} + +::google::protobuf::uint8* LinearParam::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.LinearParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float slope = 1; + if (this->slope() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->slope(), target); + } + + // float y_intercept = 2; + if (this->y_intercept() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->y_intercept(), target); + } + + // float min_val = 3; + if (this->min_val() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->min_val(), target); + } + + // float max_val = 4; + if (this->max_val() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->max_val(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.LinearParam) + return target; +} + +size_t LinearParam::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.LinearParam) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float slope = 1; + if (this->slope() != 0) { + total_size += 1 + 4; + } + + // float y_intercept = 2; + if (this->y_intercept() != 0) { + total_size += 1 + 4; + } + + // float min_val = 3; + if (this->min_val() != 0) { + total_size += 1 + 4; + } + + // float max_val = 4; + if (this->max_val() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LinearParam::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.LinearParam) + GOOGLE_DCHECK_NE(&from, this); + const LinearParam* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.LinearParam) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.LinearParam) + MergeFrom(*source); + } +} + +void LinearParam::MergeFrom(const LinearParam& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.LinearParam) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.slope() != 0) { + set_slope(from.slope()); + } + if (from.y_intercept() != 0) { + set_y_intercept(from.y_intercept()); + } + if (from.min_val() != 0) { + set_min_val(from.min_val()); + } + if (from.max_val() != 0) { + set_max_val(from.max_val()); + } +} + +void LinearParam::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.LinearParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LinearParam::CopyFrom(const LinearParam& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.LinearParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LinearParam::IsInitialized() const { + return true; +} + +void LinearParam::Swap(LinearParam* other) { + if (other == this) return; + InternalSwap(other); +} +void LinearParam::InternalSwap(LinearParam* other) { + using std::swap; + swap(slope_, other->slope_); + swap(y_intercept_, other->y_intercept_); + swap(min_val_, other->min_val_); + swap(max_val_, other->max_val_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LinearParam::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ExponentialParam::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExponentialParam::kBiasFieldNumber; +const int ExponentialParam::kBaseFieldNumber; +const int ExponentialParam::kMultiplierFieldNumber; +const int ExponentialParam::kDepthMultiplierFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExponentialParam::ExponentialParam() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_ExponentialParam.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.ExponentialParam) +} +ExponentialParam::ExponentialParam(const ExponentialParam& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&bias_, &from.bias_, + static_cast(reinterpret_cast(&depth_multiplier_) - + reinterpret_cast(&bias_)) + sizeof(depth_multiplier_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.ExponentialParam) +} + +void ExponentialParam::SharedCtor() { + ::memset(&bias_, 0, static_cast( + reinterpret_cast(&depth_multiplier_) - + reinterpret_cast(&bias_)) + sizeof(depth_multiplier_)); +} + +ExponentialParam::~ExponentialParam() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.ExponentialParam) + SharedDtor(); +} + +void ExponentialParam::SharedDtor() { +} + +void ExponentialParam::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExponentialParam::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExponentialParam& ExponentialParam::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_ExponentialParam.base); + return *internal_default_instance(); +} + + +void ExponentialParam::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&bias_, 0, static_cast( + reinterpret_cast(&depth_multiplier_) - + reinterpret_cast(&bias_)) + sizeof(depth_multiplier_)); + _internal_metadata_.Clear(); +} + +bool ExponentialParam::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float bias = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &bias_))); + } else { + goto handle_unusual; + } + break; + } + + // float base = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + } else { + goto handle_unusual; + } + break; + } + + // float multiplier = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &multiplier_))); + } else { + goto handle_unusual; + } + break; + } + + // float depth_multiplier = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &depth_multiplier_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.ExponentialParam) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.ExponentialParam) + return false; +#undef DO_ +} + +void ExponentialParam::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float bias = 1; + if (this->bias() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->bias(), output); + } + + // float base = 2; + if (this->base() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->base(), output); + } + + // float multiplier = 3; + if (this->multiplier() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->multiplier(), output); + } + + // float depth_multiplier = 4; + if (this->depth_multiplier() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->depth_multiplier(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.ExponentialParam) +} + +::google::protobuf::uint8* ExponentialParam::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float bias = 1; + if (this->bias() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->bias(), target); + } + + // float base = 2; + if (this->base() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->base(), target); + } + + // float multiplier = 3; + if (this->multiplier() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->multiplier(), target); + } + + // float depth_multiplier = 4; + if (this->depth_multiplier() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->depth_multiplier(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.ExponentialParam) + return target; +} + +size_t ExponentialParam::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float bias = 1; + if (this->bias() != 0) { + total_size += 1 + 4; + } + + // float base = 2; + if (this->base() != 0) { + total_size += 1 + 4; + } + + // float multiplier = 3; + if (this->multiplier() != 0) { + total_size += 1 + 4; + } + + // float depth_multiplier = 4; + if (this->depth_multiplier() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExponentialParam::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + GOOGLE_DCHECK_NE(&from, this); + const ExponentialParam* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.ExponentialParam) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.ExponentialParam) + MergeFrom(*source); + } +} + +void ExponentialParam::MergeFrom(const ExponentialParam& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.bias() != 0) { + set_bias(from.bias()); + } + if (from.base() != 0) { + set_base(from.base()); + } + if (from.multiplier() != 0) { + set_multiplier(from.multiplier()); + } + if (from.depth_multiplier() != 0) { + set_depth_multiplier(from.depth_multiplier()); + } +} + +void ExponentialParam::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExponentialParam::CopyFrom(const ExponentialParam& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.ExponentialParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExponentialParam::IsInitialized() const { + return true; +} + +void ExponentialParam::Swap(ExponentialParam* other) { + if (other == this) return; + InternalSwap(other); +} +void ExponentialParam::InternalSwap(ExponentialParam* other) { + using std::swap; + swap(bias_, other->bias_); + swap(base_, other->base_); + swap(multiplier_, other->multiplier_); + swap(depth_multiplier_, other->depth_multiplier_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExponentialParam::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ThresholdParam::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ThresholdParam::kOnValueFieldNumber; +const int ThresholdParam::kOffValueFieldNumber; +const int ThresholdParam::kThresholdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ThresholdParam::ThresholdParam() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_ThresholdParam.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.ThresholdParam) +} +ThresholdParam::ThresholdParam(const ThresholdParam& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&on_value_, &from.on_value_, + static_cast(reinterpret_cast(&threshold_) - + reinterpret_cast(&on_value_)) + sizeof(threshold_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.ThresholdParam) +} + +void ThresholdParam::SharedCtor() { + ::memset(&on_value_, 0, static_cast( + reinterpret_cast(&threshold_) - + reinterpret_cast(&on_value_)) + sizeof(threshold_)); +} + +ThresholdParam::~ThresholdParam() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.ThresholdParam) + SharedDtor(); +} + +void ThresholdParam::SharedDtor() { +} + +void ThresholdParam::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ThresholdParam::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ThresholdParam& ThresholdParam::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_ThresholdParam.base); + return *internal_default_instance(); +} + + +void ThresholdParam::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&on_value_, 0, static_cast( + reinterpret_cast(&threshold_) - + reinterpret_cast(&on_value_)) + sizeof(threshold_)); + _internal_metadata_.Clear(); +} + +bool ThresholdParam::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float on_value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &on_value_))); + } else { + goto handle_unusual; + } + break; + } + + // float off_value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &off_value_))); + } else { + goto handle_unusual; + } + break; + } + + // float threshold = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.ThresholdParam) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.ThresholdParam) + return false; +#undef DO_ +} + +void ThresholdParam::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float on_value = 1; + if (this->on_value() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->on_value(), output); + } + + // float off_value = 2; + if (this->off_value() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->off_value(), output); + } + + // float threshold = 3; + if (this->threshold() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->threshold(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.ThresholdParam) +} + +::google::protobuf::uint8* ThresholdParam::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float on_value = 1; + if (this->on_value() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->on_value(), target); + } + + // float off_value = 2; + if (this->off_value() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->off_value(), target); + } + + // float threshold = 3; + if (this->threshold() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->threshold(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.ThresholdParam) + return target; +} + +size_t ThresholdParam::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float on_value = 1; + if (this->on_value() != 0) { + total_size += 1 + 4; + } + + // float off_value = 2; + if (this->off_value() != 0) { + total_size += 1 + 4; + } + + // float threshold = 3; + if (this->threshold() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ThresholdParam::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + GOOGLE_DCHECK_NE(&from, this); + const ThresholdParam* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.ThresholdParam) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.ThresholdParam) + MergeFrom(*source); + } +} + +void ThresholdParam::MergeFrom(const ThresholdParam& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.on_value() != 0) { + set_on_value(from.on_value()); + } + if (from.off_value() != 0) { + set_off_value(from.off_value()); + } + if (from.threshold() != 0) { + set_threshold(from.threshold()); + } +} + +void ThresholdParam::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ThresholdParam::CopyFrom(const ThresholdParam& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.ThresholdParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ThresholdParam::IsInitialized() const { + return true; +} + +void ThresholdParam::Swap(ThresholdParam* other) { + if (other == this) return; + InternalSwap(other); +} +void ThresholdParam::InternalSwap(ThresholdParam* other) { + using std::swap; + swap(on_value_, other->on_value_); + swap(off_value_, other->off_value_); + swap(threshold_, other->threshold_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ThresholdParam::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DepthDependentParam::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_.constant_value_ = 0; + ::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_.linear_ = const_cast< ::diplomacy::tensorflow::tensorforest::LinearParam*>( + ::diplomacy::tensorflow::tensorforest::LinearParam::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_.exponential_ = const_cast< ::diplomacy::tensorflow::tensorforest::ExponentialParam*>( + ::diplomacy::tensorflow::tensorforest::ExponentialParam::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_.threshold_ = const_cast< ::diplomacy::tensorflow::tensorforest::ThresholdParam*>( + ::diplomacy::tensorflow::tensorforest::ThresholdParam::internal_default_instance()); +} +void DepthDependentParam::set_allocated_linear(::diplomacy::tensorflow::tensorforest::LinearParam* linear) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_ParamType(); + if (linear) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + linear = ::google::protobuf::internal::GetOwnedMessage( + message_arena, linear, submessage_arena); + } + set_has_linear(); + ParamType_.linear_ = linear; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.DepthDependentParam.linear) +} +void DepthDependentParam::set_allocated_exponential(::diplomacy::tensorflow::tensorforest::ExponentialParam* exponential) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_ParamType(); + if (exponential) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + exponential = ::google::protobuf::internal::GetOwnedMessage( + message_arena, exponential, submessage_arena); + } + set_has_exponential(); + ParamType_.exponential_ = exponential; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.DepthDependentParam.exponential) +} +void DepthDependentParam::set_allocated_threshold(::diplomacy::tensorflow::tensorforest::ThresholdParam* threshold) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_ParamType(); + if (threshold) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + threshold = ::google::protobuf::internal::GetOwnedMessage( + message_arena, threshold, submessage_arena); + } + set_has_threshold(); + ParamType_.threshold_ = threshold; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.DepthDependentParam.threshold) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DepthDependentParam::kConstantValueFieldNumber; +const int DepthDependentParam::kLinearFieldNumber; +const int DepthDependentParam::kExponentialFieldNumber; +const int DepthDependentParam::kThresholdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DepthDependentParam::DepthDependentParam() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_DepthDependentParam.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.DepthDependentParam) +} +DepthDependentParam::DepthDependentParam(const DepthDependentParam& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_ParamType(); + switch (from.ParamType_case()) { + case kConstantValue: { + set_constant_value(from.constant_value()); + break; + } + case kLinear: { + mutable_linear()->::diplomacy::tensorflow::tensorforest::LinearParam::MergeFrom(from.linear()); + break; + } + case kExponential: { + mutable_exponential()->::diplomacy::tensorflow::tensorforest::ExponentialParam::MergeFrom(from.exponential()); + break; + } + case kThreshold: { + mutable_threshold()->::diplomacy::tensorflow::tensorforest::ThresholdParam::MergeFrom(from.threshold()); + break; + } + case PARAMTYPE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.DepthDependentParam) +} + +void DepthDependentParam::SharedCtor() { + clear_has_ParamType(); +} + +DepthDependentParam::~DepthDependentParam() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.DepthDependentParam) + SharedDtor(); +} + +void DepthDependentParam::SharedDtor() { + if (has_ParamType()) { + clear_ParamType(); + } +} + +void DepthDependentParam::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DepthDependentParam::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DepthDependentParam& DepthDependentParam::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_DepthDependentParam.base); + return *internal_default_instance(); +} + + +void DepthDependentParam::clear_ParamType() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + switch (ParamType_case()) { + case kConstantValue: { + // No need to clear + break; + } + case kLinear: { + delete ParamType_.linear_; + break; + } + case kExponential: { + delete ParamType_.exponential_; + break; + } + case kThreshold: { + delete ParamType_.threshold_; + break; + } + case PARAMTYPE_NOT_SET: { + break; + } + } + _oneof_case_[0] = PARAMTYPE_NOT_SET; +} + + +void DepthDependentParam::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_ParamType(); + _internal_metadata_.Clear(); +} + +bool DepthDependentParam::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float constant_value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + clear_ParamType(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &ParamType_.constant_value_))); + set_has_constant_value(); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.LinearParam linear = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_linear())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.ExponentialParam exponential = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_exponential())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.ThresholdParam threshold = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_threshold())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.DepthDependentParam) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.DepthDependentParam) + return false; +#undef DO_ +} + +void DepthDependentParam::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float constant_value = 1; + if (has_constant_value()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->constant_value(), output); + } + + // .diplomacy.tensorflow.tensorforest.LinearParam linear = 2; + if (has_linear()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_linear(), output); + } + + // .diplomacy.tensorflow.tensorforest.ExponentialParam exponential = 3; + if (has_exponential()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_exponential(), output); + } + + // .diplomacy.tensorflow.tensorforest.ThresholdParam threshold = 4; + if (has_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_threshold(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.DepthDependentParam) +} + +::google::protobuf::uint8* DepthDependentParam::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float constant_value = 1; + if (has_constant_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->constant_value(), target); + } + + // .diplomacy.tensorflow.tensorforest.LinearParam linear = 2; + if (has_linear()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_linear(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.ExponentialParam exponential = 3; + if (has_exponential()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_exponential(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.ThresholdParam threshold = 4; + if (has_threshold()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_threshold(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.DepthDependentParam) + return target; +} + +size_t DepthDependentParam::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (ParamType_case()) { + // float constant_value = 1; + case kConstantValue: { + total_size += 1 + 4; + break; + } + // .diplomacy.tensorflow.tensorforest.LinearParam linear = 2; + case kLinear: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *ParamType_.linear_); + break; + } + // .diplomacy.tensorflow.tensorforest.ExponentialParam exponential = 3; + case kExponential: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *ParamType_.exponential_); + break; + } + // .diplomacy.tensorflow.tensorforest.ThresholdParam threshold = 4; + case kThreshold: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *ParamType_.threshold_); + break; + } + case PARAMTYPE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DepthDependentParam::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + GOOGLE_DCHECK_NE(&from, this); + const DepthDependentParam* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.DepthDependentParam) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.DepthDependentParam) + MergeFrom(*source); + } +} + +void DepthDependentParam::MergeFrom(const DepthDependentParam& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.ParamType_case()) { + case kConstantValue: { + set_constant_value(from.constant_value()); + break; + } + case kLinear: { + mutable_linear()->::diplomacy::tensorflow::tensorforest::LinearParam::MergeFrom(from.linear()); + break; + } + case kExponential: { + mutable_exponential()->::diplomacy::tensorflow::tensorforest::ExponentialParam::MergeFrom(from.exponential()); + break; + } + case kThreshold: { + mutable_threshold()->::diplomacy::tensorflow::tensorforest::ThresholdParam::MergeFrom(from.threshold()); + break; + } + case PARAMTYPE_NOT_SET: { + break; + } + } +} + +void DepthDependentParam::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DepthDependentParam::CopyFrom(const DepthDependentParam& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.DepthDependentParam) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DepthDependentParam::IsInitialized() const { + return true; +} + +void DepthDependentParam::Swap(DepthDependentParam* other) { + if (other == this) return; + InternalSwap(other); +} +void DepthDependentParam::InternalSwap(DepthDependentParam* other) { + using std::swap; + swap(ParamType_, other->ParamType_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DepthDependentParam::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TensorForestParams::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_._instance.get_mutable()->pruning_type_ = const_cast< ::diplomacy::tensorflow::tensorforest::SplitPruningConfig*>( + ::diplomacy::tensorflow::tensorforest::SplitPruningConfig::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_._instance.get_mutable()->finish_type_ = const_cast< ::diplomacy::tensorflow::tensorforest::SplitFinishConfig*>( + ::diplomacy::tensorflow::tensorforest::SplitFinishConfig::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_._instance.get_mutable()->num_splits_to_consider_ = const_cast< ::diplomacy::tensorflow::tensorforest::DepthDependentParam*>( + ::diplomacy::tensorflow::tensorforest::DepthDependentParam::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_._instance.get_mutable()->split_after_samples_ = const_cast< ::diplomacy::tensorflow::tensorforest::DepthDependentParam*>( + ::diplomacy::tensorflow::tensorforest::DepthDependentParam::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_._instance.get_mutable()->dominate_fraction_ = const_cast< ::diplomacy::tensorflow::tensorforest::DepthDependentParam*>( + ::diplomacy::tensorflow::tensorforest::DepthDependentParam::internal_default_instance()); + ::diplomacy::tensorflow::tensorforest::_TensorForestParams_default_instance_._instance.get_mutable()->min_split_samples_ = const_cast< ::diplomacy::tensorflow::tensorforest::DepthDependentParam*>( + ::diplomacy::tensorflow::tensorforest::DepthDependentParam::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorForestParams::kLeafTypeFieldNumber; +const int TensorForestParams::kStatsTypeFieldNumber; +const int TensorForestParams::kCollectionTypeFieldNumber; +const int TensorForestParams::kPruningTypeFieldNumber; +const int TensorForestParams::kFinishTypeFieldNumber; +const int TensorForestParams::kNumTreesFieldNumber; +const int TensorForestParams::kMaxNodesFieldNumber; +const int TensorForestParams::kNumFeaturesFieldNumber; +const int TensorForestParams::kInequalityTestTypeFieldNumber; +const int TensorForestParams::kIsRegressionFieldNumber; +const int TensorForestParams::kDropFinalClassFieldNumber; +const int TensorForestParams::kCollateExamplesFieldNumber; +const int TensorForestParams::kCheckpointStatsFieldNumber; +const int TensorForestParams::kUseRunningStatsMethodFieldNumber; +const int TensorForestParams::kInitializeAverageSplitsFieldNumber; +const int TensorForestParams::kInferenceTreePathsFieldNumber; +const int TensorForestParams::kNumOutputsFieldNumber; +const int TensorForestParams::kNumSplitsToConsiderFieldNumber; +const int TensorForestParams::kSplitAfterSamplesFieldNumber; +const int TensorForestParams::kDominateFractionFieldNumber; +const int TensorForestParams::kMinSplitSamplesFieldNumber; +const int TensorForestParams::kGraphDirFieldNumber; +const int TensorForestParams::kNumSelectFeaturesFieldNumber; +const int TensorForestParams::kNumClassesToTrackFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorForestParams::TensorForestParams() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_TensorForestParams.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tensorforest.TensorForestParams) +} +TensorForestParams::TensorForestParams(const TensorForestParams& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + graph_dir_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.graph_dir().size() > 0) { + graph_dir_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.graph_dir_); + } + if (from.has_pruning_type()) { + pruning_type_ = new ::diplomacy::tensorflow::tensorforest::SplitPruningConfig(*from.pruning_type_); + } else { + pruning_type_ = NULL; + } + if (from.has_finish_type()) { + finish_type_ = new ::diplomacy::tensorflow::tensorforest::SplitFinishConfig(*from.finish_type_); + } else { + finish_type_ = NULL; + } + if (from.has_num_splits_to_consider()) { + num_splits_to_consider_ = new ::diplomacy::tensorflow::tensorforest::DepthDependentParam(*from.num_splits_to_consider_); + } else { + num_splits_to_consider_ = NULL; + } + if (from.has_split_after_samples()) { + split_after_samples_ = new ::diplomacy::tensorflow::tensorforest::DepthDependentParam(*from.split_after_samples_); + } else { + split_after_samples_ = NULL; + } + if (from.has_dominate_fraction()) { + dominate_fraction_ = new ::diplomacy::tensorflow::tensorforest::DepthDependentParam(*from.dominate_fraction_); + } else { + dominate_fraction_ = NULL; + } + if (from.has_min_split_samples()) { + min_split_samples_ = new ::diplomacy::tensorflow::tensorforest::DepthDependentParam(*from.min_split_samples_); + } else { + min_split_samples_ = NULL; + } + ::memcpy(&leaf_type_, &from.leaf_type_, + static_cast(reinterpret_cast(&num_classes_to_track_) - + reinterpret_cast(&leaf_type_)) + sizeof(num_classes_to_track_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tensorforest.TensorForestParams) +} + +void TensorForestParams::SharedCtor() { + graph_dir_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&pruning_type_, 0, static_cast( + reinterpret_cast(&num_classes_to_track_) - + reinterpret_cast(&pruning_type_)) + sizeof(num_classes_to_track_)); +} + +TensorForestParams::~TensorForestParams() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tensorforest.TensorForestParams) + SharedDtor(); +} + +void TensorForestParams::SharedDtor() { + graph_dir_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete pruning_type_; + if (this != internal_default_instance()) delete finish_type_; + if (this != internal_default_instance()) delete num_splits_to_consider_; + if (this != internal_default_instance()) delete split_after_samples_; + if (this != internal_default_instance()) delete dominate_fraction_; + if (this != internal_default_instance()) delete min_split_samples_; +} + +void TensorForestParams::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorForestParams::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorForestParams& TensorForestParams::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::scc_info_TensorForestParams.base); + return *internal_default_instance(); +} + + +void TensorForestParams::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + graph_dir_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && pruning_type_ != NULL) { + delete pruning_type_; + } + pruning_type_ = NULL; + if (GetArenaNoVirtual() == NULL && finish_type_ != NULL) { + delete finish_type_; + } + finish_type_ = NULL; + if (GetArenaNoVirtual() == NULL && num_splits_to_consider_ != NULL) { + delete num_splits_to_consider_; + } + num_splits_to_consider_ = NULL; + if (GetArenaNoVirtual() == NULL && split_after_samples_ != NULL) { + delete split_after_samples_; + } + split_after_samples_ = NULL; + if (GetArenaNoVirtual() == NULL && dominate_fraction_ != NULL) { + delete dominate_fraction_; + } + dominate_fraction_ = NULL; + if (GetArenaNoVirtual() == NULL && min_split_samples_ != NULL) { + delete min_split_samples_; + } + min_split_samples_ = NULL; + ::memset(&leaf_type_, 0, static_cast( + reinterpret_cast(&num_classes_to_track_) - + reinterpret_cast(&leaf_type_)) + sizeof(num_classes_to_track_)); + _internal_metadata_.Clear(); +} + +bool TensorForestParams::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tensorforest.LeafModelType leaf_type = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_leaf_type(static_cast< ::diplomacy::tensorflow::tensorforest::LeafModelType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.StatsModelType stats_type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_stats_type(static_cast< ::diplomacy::tensorflow::tensorforest::StatsModelType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.SplitCollectionType collection_type = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_collection_type(static_cast< ::diplomacy::tensorflow::tensorforest::SplitCollectionType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningConfig pruning_type = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_pruning_type())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishConfig finish_type = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_finish_type())); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_trees = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_trees_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 max_nodes = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_nodes_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_regression = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_regression_))); + } else { + goto handle_unusual; + } + break; + } + + // bool drop_final_class = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &drop_final_class_))); + } else { + goto handle_unusual; + } + break; + } + + // bool collate_examples = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &collate_examples_))); + } else { + goto handle_unusual; + } + break; + } + + // bool checkpoint_stats = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &checkpoint_stats_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_outputs = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_outputs_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam num_splits_to_consider = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_num_splits_to_consider())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam split_after_samples = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_split_after_samples())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam dominate_fraction = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dominate_fraction())); + } else { + goto handle_unusual; + } + break; + } + + // string graph_dir = 16; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(130u /* 130 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_graph_dir())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_dir().data(), static_cast(this->graph_dir().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir")); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_select_features = 17; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_select_features_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam min_split_samples = 18; + case 18: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_min_split_samples())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type inequality_test_type = 19; + case 19: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(152u /* 152 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_inequality_test_type(static_cast< ::diplomacy::tensorflow::decision_trees::InequalityTest_Type >(value)); + } else { + goto handle_unusual; + } + break; + } + + // bool use_running_stats_method = 20; + case 20: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(160u /* 160 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_running_stats_method_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_features = 21; + case 21: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(168u /* 168 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_features_))); + } else { + goto handle_unusual; + } + break; + } + + // bool initialize_average_splits = 22; + case 22: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(176u /* 176 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &initialize_average_splits_))); + } else { + goto handle_unusual; + } + break; + } + + // bool inference_tree_paths = 23; + case 23: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(184u /* 184 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &inference_tree_paths_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_classes_to_track = 24; + case 24: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(192u /* 192 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_classes_to_track_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tensorforest.TensorForestParams) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tensorforest.TensorForestParams) + return false; +#undef DO_ +} + +void TensorForestParams::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.LeafModelType leaf_type = 1; + if (this->leaf_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->leaf_type(), output); + } + + // .diplomacy.tensorflow.tensorforest.StatsModelType stats_type = 2; + if (this->stats_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->stats_type(), output); + } + + // .diplomacy.tensorflow.tensorforest.SplitCollectionType collection_type = 3; + if (this->collection_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->collection_type(), output); + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningConfig pruning_type = 4; + if (this->has_pruning_type()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_pruning_type(), output); + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishConfig finish_type = 5; + if (this->has_finish_type()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_finish_type(), output); + } + + // int32 num_trees = 6; + if (this->num_trees() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->num_trees(), output); + } + + // int32 max_nodes = 7; + if (this->max_nodes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->max_nodes(), output); + } + + // bool is_regression = 8; + if (this->is_regression() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->is_regression(), output); + } + + // bool drop_final_class = 9; + if (this->drop_final_class() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->drop_final_class(), output); + } + + // bool collate_examples = 10; + if (this->collate_examples() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->collate_examples(), output); + } + + // bool checkpoint_stats = 11; + if (this->checkpoint_stats() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->checkpoint_stats(), output); + } + + // int32 num_outputs = 12; + if (this->num_outputs() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->num_outputs(), output); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam num_splits_to_consider = 13; + if (this->has_num_splits_to_consider()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, this->_internal_num_splits_to_consider(), output); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam split_after_samples = 14; + if (this->has_split_after_samples()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 14, this->_internal_split_after_samples(), output); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam dominate_fraction = 15; + if (this->has_dominate_fraction()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 15, this->_internal_dominate_fraction(), output); + } + + // string graph_dir = 16; + if (this->graph_dir().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_dir().data(), static_cast(this->graph_dir().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 16, this->graph_dir(), output); + } + + // int32 num_select_features = 17; + if (this->num_select_features() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->num_select_features(), output); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam min_split_samples = 18; + if (this->has_min_split_samples()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 18, this->_internal_min_split_samples(), output); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type inequality_test_type = 19; + if (this->inequality_test_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 19, this->inequality_test_type(), output); + } + + // bool use_running_stats_method = 20; + if (this->use_running_stats_method() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(20, this->use_running_stats_method(), output); + } + + // int32 num_features = 21; + if (this->num_features() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(21, this->num_features(), output); + } + + // bool initialize_average_splits = 22; + if (this->initialize_average_splits() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(22, this->initialize_average_splits(), output); + } + + // bool inference_tree_paths = 23; + if (this->inference_tree_paths() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(23, this->inference_tree_paths(), output); + } + + // int32 num_classes_to_track = 24; + if (this->num_classes_to_track() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(24, this->num_classes_to_track(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tensorforest.TensorForestParams) +} + +::google::protobuf::uint8* TensorForestParams::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tensorforest.LeafModelType leaf_type = 1; + if (this->leaf_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->leaf_type(), target); + } + + // .diplomacy.tensorflow.tensorforest.StatsModelType stats_type = 2; + if (this->stats_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->stats_type(), target); + } + + // .diplomacy.tensorflow.tensorforest.SplitCollectionType collection_type = 3; + if (this->collection_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->collection_type(), target); + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningConfig pruning_type = 4; + if (this->has_pruning_type()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_pruning_type(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishConfig finish_type = 5; + if (this->has_finish_type()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_finish_type(), deterministic, target); + } + + // int32 num_trees = 6; + if (this->num_trees() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->num_trees(), target); + } + + // int32 max_nodes = 7; + if (this->max_nodes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->max_nodes(), target); + } + + // bool is_regression = 8; + if (this->is_regression() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->is_regression(), target); + } + + // bool drop_final_class = 9; + if (this->drop_final_class() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->drop_final_class(), target); + } + + // bool collate_examples = 10; + if (this->collate_examples() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->collate_examples(), target); + } + + // bool checkpoint_stats = 11; + if (this->checkpoint_stats() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(11, this->checkpoint_stats(), target); + } + + // int32 num_outputs = 12; + if (this->num_outputs() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->num_outputs(), target); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam num_splits_to_consider = 13; + if (this->has_num_splits_to_consider()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 13, this->_internal_num_splits_to_consider(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam split_after_samples = 14; + if (this->has_split_after_samples()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 14, this->_internal_split_after_samples(), deterministic, target); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam dominate_fraction = 15; + if (this->has_dominate_fraction()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 15, this->_internal_dominate_fraction(), deterministic, target); + } + + // string graph_dir = 16; + if (this->graph_dir().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_dir().data(), static_cast(this->graph_dir().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 16, this->graph_dir(), target); + } + + // int32 num_select_features = 17; + if (this->num_select_features() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(17, this->num_select_features(), target); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam min_split_samples = 18; + if (this->has_min_split_samples()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 18, this->_internal_min_split_samples(), deterministic, target); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type inequality_test_type = 19; + if (this->inequality_test_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 19, this->inequality_test_type(), target); + } + + // bool use_running_stats_method = 20; + if (this->use_running_stats_method() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(20, this->use_running_stats_method(), target); + } + + // int32 num_features = 21; + if (this->num_features() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(21, this->num_features(), target); + } + + // bool initialize_average_splits = 22; + if (this->initialize_average_splits() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(22, this->initialize_average_splits(), target); + } + + // bool inference_tree_paths = 23; + if (this->inference_tree_paths() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->inference_tree_paths(), target); + } + + // int32 num_classes_to_track = 24; + if (this->num_classes_to_track() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(24, this->num_classes_to_track(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tensorforest.TensorForestParams) + return target; +} + +size_t TensorForestParams::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string graph_dir = 16; + if (this->graph_dir().size() > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->graph_dir()); + } + + // .diplomacy.tensorflow.tensorforest.SplitPruningConfig pruning_type = 4; + if (this->has_pruning_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *pruning_type_); + } + + // .diplomacy.tensorflow.tensorforest.SplitFinishConfig finish_type = 5; + if (this->has_finish_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *finish_type_); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam num_splits_to_consider = 13; + if (this->has_num_splits_to_consider()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *num_splits_to_consider_); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam split_after_samples = 14; + if (this->has_split_after_samples()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *split_after_samples_); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam dominate_fraction = 15; + if (this->has_dominate_fraction()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *dominate_fraction_); + } + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam min_split_samples = 18; + if (this->has_min_split_samples()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *min_split_samples_); + } + + // .diplomacy.tensorflow.tensorforest.LeafModelType leaf_type = 1; + if (this->leaf_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->leaf_type()); + } + + // .diplomacy.tensorflow.tensorforest.StatsModelType stats_type = 2; + if (this->stats_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->stats_type()); + } + + // .diplomacy.tensorflow.tensorforest.SplitCollectionType collection_type = 3; + if (this->collection_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->collection_type()); + } + + // int32 num_trees = 6; + if (this->num_trees() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_trees()); + } + + // int32 max_nodes = 7; + if (this->max_nodes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->max_nodes()); + } + + // bool is_regression = 8; + if (this->is_regression() != 0) { + total_size += 1 + 1; + } + + // bool drop_final_class = 9; + if (this->drop_final_class() != 0) { + total_size += 1 + 1; + } + + // bool collate_examples = 10; + if (this->collate_examples() != 0) { + total_size += 1 + 1; + } + + // bool checkpoint_stats = 11; + if (this->checkpoint_stats() != 0) { + total_size += 1 + 1; + } + + // int32 num_outputs = 12; + if (this->num_outputs() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_outputs()); + } + + // int32 num_select_features = 17; + if (this->num_select_features() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_select_features()); + } + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type inequality_test_type = 19; + if (this->inequality_test_type() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->inequality_test_type()); + } + + // int32 num_features = 21; + if (this->num_features() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_features()); + } + + // bool use_running_stats_method = 20; + if (this->use_running_stats_method() != 0) { + total_size += 2 + 1; + } + + // bool initialize_average_splits = 22; + if (this->initialize_average_splits() != 0) { + total_size += 2 + 1; + } + + // bool inference_tree_paths = 23; + if (this->inference_tree_paths() != 0) { + total_size += 2 + 1; + } + + // int32 num_classes_to_track = 24; + if (this->num_classes_to_track() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_classes_to_track()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorForestParams::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + GOOGLE_DCHECK_NE(&from, this); + const TensorForestParams* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tensorforest.TensorForestParams) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tensorforest.TensorForestParams) + MergeFrom(*source); + } +} + +void TensorForestParams::MergeFrom(const TensorForestParams& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.graph_dir().size() > 0) { + + graph_dir_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.graph_dir_); + } + if (from.has_pruning_type()) { + mutable_pruning_type()->::diplomacy::tensorflow::tensorforest::SplitPruningConfig::MergeFrom(from.pruning_type()); + } + if (from.has_finish_type()) { + mutable_finish_type()->::diplomacy::tensorflow::tensorforest::SplitFinishConfig::MergeFrom(from.finish_type()); + } + if (from.has_num_splits_to_consider()) { + mutable_num_splits_to_consider()->::diplomacy::tensorflow::tensorforest::DepthDependentParam::MergeFrom(from.num_splits_to_consider()); + } + if (from.has_split_after_samples()) { + mutable_split_after_samples()->::diplomacy::tensorflow::tensorforest::DepthDependentParam::MergeFrom(from.split_after_samples()); + } + if (from.has_dominate_fraction()) { + mutable_dominate_fraction()->::diplomacy::tensorflow::tensorforest::DepthDependentParam::MergeFrom(from.dominate_fraction()); + } + if (from.has_min_split_samples()) { + mutable_min_split_samples()->::diplomacy::tensorflow::tensorforest::DepthDependentParam::MergeFrom(from.min_split_samples()); + } + if (from.leaf_type() != 0) { + set_leaf_type(from.leaf_type()); + } + if (from.stats_type() != 0) { + set_stats_type(from.stats_type()); + } + if (from.collection_type() != 0) { + set_collection_type(from.collection_type()); + } + if (from.num_trees() != 0) { + set_num_trees(from.num_trees()); + } + if (from.max_nodes() != 0) { + set_max_nodes(from.max_nodes()); + } + if (from.is_regression() != 0) { + set_is_regression(from.is_regression()); + } + if (from.drop_final_class() != 0) { + set_drop_final_class(from.drop_final_class()); + } + if (from.collate_examples() != 0) { + set_collate_examples(from.collate_examples()); + } + if (from.checkpoint_stats() != 0) { + set_checkpoint_stats(from.checkpoint_stats()); + } + if (from.num_outputs() != 0) { + set_num_outputs(from.num_outputs()); + } + if (from.num_select_features() != 0) { + set_num_select_features(from.num_select_features()); + } + if (from.inequality_test_type() != 0) { + set_inequality_test_type(from.inequality_test_type()); + } + if (from.num_features() != 0) { + set_num_features(from.num_features()); + } + if (from.use_running_stats_method() != 0) { + set_use_running_stats_method(from.use_running_stats_method()); + } + if (from.initialize_average_splits() != 0) { + set_initialize_average_splits(from.initialize_average_splits()); + } + if (from.inference_tree_paths() != 0) { + set_inference_tree_paths(from.inference_tree_paths()); + } + if (from.num_classes_to_track() != 0) { + set_num_classes_to_track(from.num_classes_to_track()); + } +} + +void TensorForestParams::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorForestParams::CopyFrom(const TensorForestParams& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tensorforest.TensorForestParams) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorForestParams::IsInitialized() const { + return true; +} + +void TensorForestParams::Swap(TensorForestParams* other) { + if (other == this) return; + InternalSwap(other); +} +void TensorForestParams::InternalSwap(TensorForestParams* other) { + using std::swap; + graph_dir_.Swap(&other->graph_dir_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(pruning_type_, other->pruning_type_); + swap(finish_type_, other->finish_type_); + swap(num_splits_to_consider_, other->num_splits_to_consider_); + swap(split_after_samples_, other->split_after_samples_); + swap(dominate_fraction_, other->dominate_fraction_); + swap(min_split_samples_, other->min_split_samples_); + swap(leaf_type_, other->leaf_type_); + swap(stats_type_, other->stats_type_); + swap(collection_type_, other->collection_type_); + swap(num_trees_, other->num_trees_); + swap(max_nodes_, other->max_nodes_); + swap(is_regression_, other->is_regression_); + swap(drop_final_class_, other->drop_final_class_); + swap(collate_examples_, other->collate_examples_); + swap(checkpoint_stats_, other->checkpoint_stats_); + swap(num_outputs_, other->num_outputs_); + swap(num_select_features_, other->num_select_features_); + swap(inequality_test_type_, other->inequality_test_type_); + swap(num_features_, other->num_features_); + swap(use_running_stats_method_, other->use_running_stats_method_); + swap(initialize_average_splits_, other->initialize_average_splits_); + swap(inference_tree_paths_, other->inference_tree_paths_); + swap(num_classes_to_track_, other->num_classes_to_track_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorForestParams::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::SplitPruningConfig >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tensorforest::SplitPruningConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::SplitFinishConfig >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tensorforest::SplitFinishConfig >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::LinearParam* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::LinearParam >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tensorforest::LinearParam >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::ExponentialParam* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::ExponentialParam >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tensorforest::ExponentialParam >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::ThresholdParam* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::ThresholdParam >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tensorforest::ThresholdParam >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::DepthDependentParam* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::DepthDependentParam >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tensorforest::DepthDependentParam >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tensorforest::TensorForestParams* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::TensorForestParams >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tensorforest::TensorForestParams >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.pb.h new file mode 100644 index 0000000..00a6efa --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.pb.h @@ -0,0 +1,2444 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[7]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { +class DepthDependentParam; +class DepthDependentParamDefaultTypeInternal; +extern DepthDependentParamDefaultTypeInternal _DepthDependentParam_default_instance_; +class ExponentialParam; +class ExponentialParamDefaultTypeInternal; +extern ExponentialParamDefaultTypeInternal _ExponentialParam_default_instance_; +class LinearParam; +class LinearParamDefaultTypeInternal; +extern LinearParamDefaultTypeInternal _LinearParam_default_instance_; +class SplitFinishConfig; +class SplitFinishConfigDefaultTypeInternal; +extern SplitFinishConfigDefaultTypeInternal _SplitFinishConfig_default_instance_; +class SplitPruningConfig; +class SplitPruningConfigDefaultTypeInternal; +extern SplitPruningConfigDefaultTypeInternal _SplitPruningConfig_default_instance_; +class TensorForestParams; +class TensorForestParamsDefaultTypeInternal; +extern TensorForestParamsDefaultTypeInternal _TensorForestParams_default_instance_; +class ThresholdParam; +class ThresholdParamDefaultTypeInternal; +extern ThresholdParamDefaultTypeInternal _ThresholdParam_default_instance_; +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tensorforest::DepthDependentParam* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::DepthDependentParam>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::ExponentialParam* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::ExponentialParam>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::LinearParam* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::LinearParam>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::SplitFinishConfig>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::SplitPruningConfig>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::TensorForestParams* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::TensorForestParams>(Arena*); +template<> ::diplomacy::tensorflow::tensorforest::ThresholdParam* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::ThresholdParam>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tensorforest { + +enum LeafModelType { + MODEL_DENSE_CLASSIFICATION = 0, + MODEL_SPARSE_CLASSIFICATION = 1, + MODEL_REGRESSION = 2, + MODEL_SPARSE_OR_DENSE_CLASSIFICATION = 3, + LeafModelType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + LeafModelType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool LeafModelType_IsValid(int value); +const LeafModelType LeafModelType_MIN = MODEL_DENSE_CLASSIFICATION; +const LeafModelType LeafModelType_MAX = MODEL_SPARSE_OR_DENSE_CLASSIFICATION; +const int LeafModelType_ARRAYSIZE = LeafModelType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LeafModelType_descriptor(); +inline const ::std::string& LeafModelType_Name(LeafModelType value) { + return ::google::protobuf::internal::NameOfEnum( + LeafModelType_descriptor(), value); +} +inline bool LeafModelType_Parse( + const ::std::string& name, LeafModelType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LeafModelType_descriptor(), name, value); +} +enum StatsModelType { + STATS_DENSE_GINI = 0, + STATS_SPARSE_GINI = 1, + STATS_LEAST_SQUARES_REGRESSION = 2, + STATS_SPARSE_THEN_DENSE_GINI = 3, + STATS_FIXED_SIZE_SPARSE_GINI = 4, + StatsModelType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + StatsModelType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool StatsModelType_IsValid(int value); +const StatsModelType StatsModelType_MIN = STATS_DENSE_GINI; +const StatsModelType StatsModelType_MAX = STATS_FIXED_SIZE_SPARSE_GINI; +const int StatsModelType_ARRAYSIZE = StatsModelType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* StatsModelType_descriptor(); +inline const ::std::string& StatsModelType_Name(StatsModelType value) { + return ::google::protobuf::internal::NameOfEnum( + StatsModelType_descriptor(), value); +} +inline bool StatsModelType_Parse( + const ::std::string& name, StatsModelType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + StatsModelType_descriptor(), name, value); +} +enum SplitCollectionType { + COLLECTION_BASIC = 0, + GRAPH_RUNNER_COLLECTION = 1, + SplitCollectionType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + SplitCollectionType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool SplitCollectionType_IsValid(int value); +const SplitCollectionType SplitCollectionType_MIN = COLLECTION_BASIC; +const SplitCollectionType SplitCollectionType_MAX = GRAPH_RUNNER_COLLECTION; +const int SplitCollectionType_ARRAYSIZE = SplitCollectionType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SplitCollectionType_descriptor(); +inline const ::std::string& SplitCollectionType_Name(SplitCollectionType value) { + return ::google::protobuf::internal::NameOfEnum( + SplitCollectionType_descriptor(), value); +} +inline bool SplitCollectionType_Parse( + const ::std::string& name, SplitCollectionType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SplitCollectionType_descriptor(), name, value); +} +enum SplitPruningStrategyType { + SPLIT_PRUNE_NONE = 0, + SPLIT_PRUNE_HALF = 1, + SPLIT_PRUNE_QUARTER = 2, + SPLIT_PRUNE_10_PERCENT = 3, + SPLIT_PRUNE_HOEFFDING = 4, + SplitPruningStrategyType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + SplitPruningStrategyType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool SplitPruningStrategyType_IsValid(int value); +const SplitPruningStrategyType SplitPruningStrategyType_MIN = SPLIT_PRUNE_NONE; +const SplitPruningStrategyType SplitPruningStrategyType_MAX = SPLIT_PRUNE_HOEFFDING; +const int SplitPruningStrategyType_ARRAYSIZE = SplitPruningStrategyType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SplitPruningStrategyType_descriptor(); +inline const ::std::string& SplitPruningStrategyType_Name(SplitPruningStrategyType value) { + return ::google::protobuf::internal::NameOfEnum( + SplitPruningStrategyType_descriptor(), value); +} +inline bool SplitPruningStrategyType_Parse( + const ::std::string& name, SplitPruningStrategyType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SplitPruningStrategyType_descriptor(), name, value); +} +enum SplitFinishStrategyType { + SPLIT_FINISH_BASIC = 0, + SPLIT_FINISH_DOMINATE_HOEFFDING = 2, + SPLIT_FINISH_DOMINATE_BOOTSTRAP = 3, + SplitFinishStrategyType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + SplitFinishStrategyType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool SplitFinishStrategyType_IsValid(int value); +const SplitFinishStrategyType SplitFinishStrategyType_MIN = SPLIT_FINISH_BASIC; +const SplitFinishStrategyType SplitFinishStrategyType_MAX = SPLIT_FINISH_DOMINATE_BOOTSTRAP; +const int SplitFinishStrategyType_ARRAYSIZE = SplitFinishStrategyType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SplitFinishStrategyType_descriptor(); +inline const ::std::string& SplitFinishStrategyType_Name(SplitFinishStrategyType value) { + return ::google::protobuf::internal::NameOfEnum( + SplitFinishStrategyType_descriptor(), value); +} +inline bool SplitFinishStrategyType_Parse( + const ::std::string& name, SplitFinishStrategyType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SplitFinishStrategyType_descriptor(), name, value); +} +// =================================================================== + +class SplitPruningConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.SplitPruningConfig) */ { + public: + SplitPruningConfig(); + virtual ~SplitPruningConfig(); + + SplitPruningConfig(const SplitPruningConfig& from); + + inline SplitPruningConfig& operator=(const SplitPruningConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SplitPruningConfig(SplitPruningConfig&& from) noexcept + : SplitPruningConfig() { + *this = ::std::move(from); + } + + inline SplitPruningConfig& operator=(SplitPruningConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const SplitPruningConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SplitPruningConfig* internal_default_instance() { + return reinterpret_cast( + &_SplitPruningConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(SplitPruningConfig* other); + friend void swap(SplitPruningConfig& a, SplitPruningConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SplitPruningConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + SplitPruningConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SplitPruningConfig& from); + void MergeFrom(const SplitPruningConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SplitPruningConfig* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam prune_every_samples = 1; + bool has_prune_every_samples() const; + void clear_prune_every_samples(); + static const int kPruneEverySamplesFieldNumber = 1; + private: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& _internal_prune_every_samples() const; + public: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& prune_every_samples() const; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* release_prune_every_samples(); + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* mutable_prune_every_samples(); + void set_allocated_prune_every_samples(::diplomacy::tensorflow::tensorforest::DepthDependentParam* prune_every_samples); + + // .diplomacy.tensorflow.tensorforest.SplitPruningStrategyType type = 2; + void clear_type(); + static const int kTypeFieldNumber = 2; + ::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType type() const; + void set_type(::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* prune_every_samples_; + int type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SplitFinishConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.SplitFinishConfig) */ { + public: + SplitFinishConfig(); + virtual ~SplitFinishConfig(); + + SplitFinishConfig(const SplitFinishConfig& from); + + inline SplitFinishConfig& operator=(const SplitFinishConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SplitFinishConfig(SplitFinishConfig&& from) noexcept + : SplitFinishConfig() { + *this = ::std::move(from); + } + + inline SplitFinishConfig& operator=(SplitFinishConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const SplitFinishConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SplitFinishConfig* internal_default_instance() { + return reinterpret_cast( + &_SplitFinishConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(SplitFinishConfig* other); + friend void swap(SplitFinishConfig& a, SplitFinishConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SplitFinishConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + SplitFinishConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SplitFinishConfig& from); + void MergeFrom(const SplitFinishConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SplitFinishConfig* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam check_every_steps = 1; + bool has_check_every_steps() const; + void clear_check_every_steps(); + static const int kCheckEveryStepsFieldNumber = 1; + private: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& _internal_check_every_steps() const; + public: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& check_every_steps() const; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* release_check_every_steps(); + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* mutable_check_every_steps(); + void set_allocated_check_every_steps(::diplomacy::tensorflow::tensorforest::DepthDependentParam* check_every_steps); + + // .diplomacy.tensorflow.tensorforest.SplitFinishStrategyType type = 2; + void clear_type(); + static const int kTypeFieldNumber = 2; + ::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType type() const; + void set_type(::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* check_every_steps_; + int type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LinearParam : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.LinearParam) */ { + public: + LinearParam(); + virtual ~LinearParam(); + + LinearParam(const LinearParam& from); + + inline LinearParam& operator=(const LinearParam& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LinearParam(LinearParam&& from) noexcept + : LinearParam() { + *this = ::std::move(from); + } + + inline LinearParam& operator=(LinearParam&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const LinearParam& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LinearParam* internal_default_instance() { + return reinterpret_cast( + &_LinearParam_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(LinearParam* other); + friend void swap(LinearParam& a, LinearParam& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LinearParam* New() const final { + return CreateMaybeMessage(NULL); + } + + LinearParam* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LinearParam& from); + void MergeFrom(const LinearParam& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LinearParam* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float slope = 1; + void clear_slope(); + static const int kSlopeFieldNumber = 1; + float slope() const; + void set_slope(float value); + + // float y_intercept = 2; + void clear_y_intercept(); + static const int kYInterceptFieldNumber = 2; + float y_intercept() const; + void set_y_intercept(float value); + + // float min_val = 3; + void clear_min_val(); + static const int kMinValFieldNumber = 3; + float min_val() const; + void set_min_val(float value); + + // float max_val = 4; + void clear_max_val(); + static const int kMaxValFieldNumber = 4; + float max_val() const; + void set_max_val(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LinearParam) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float slope_; + float y_intercept_; + float min_val_; + float max_val_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExponentialParam : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.ExponentialParam) */ { + public: + ExponentialParam(); + virtual ~ExponentialParam(); + + ExponentialParam(const ExponentialParam& from); + + inline ExponentialParam& operator=(const ExponentialParam& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExponentialParam(ExponentialParam&& from) noexcept + : ExponentialParam() { + *this = ::std::move(from); + } + + inline ExponentialParam& operator=(ExponentialParam&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ExponentialParam& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExponentialParam* internal_default_instance() { + return reinterpret_cast( + &_ExponentialParam_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(ExponentialParam* other); + friend void swap(ExponentialParam& a, ExponentialParam& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExponentialParam* New() const final { + return CreateMaybeMessage(NULL); + } + + ExponentialParam* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExponentialParam& from); + void MergeFrom(const ExponentialParam& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExponentialParam* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float bias = 1; + void clear_bias(); + static const int kBiasFieldNumber = 1; + float bias() const; + void set_bias(float value); + + // float base = 2; + void clear_base(); + static const int kBaseFieldNumber = 2; + float base() const; + void set_base(float value); + + // float multiplier = 3; + void clear_multiplier(); + static const int kMultiplierFieldNumber = 3; + float multiplier() const; + void set_multiplier(float value); + + // float depth_multiplier = 4; + void clear_depth_multiplier(); + static const int kDepthMultiplierFieldNumber = 4; + float depth_multiplier() const; + void set_depth_multiplier(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.ExponentialParam) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float bias_; + float base_; + float multiplier_; + float depth_multiplier_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ThresholdParam : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.ThresholdParam) */ { + public: + ThresholdParam(); + virtual ~ThresholdParam(); + + ThresholdParam(const ThresholdParam& from); + + inline ThresholdParam& operator=(const ThresholdParam& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ThresholdParam(ThresholdParam&& from) noexcept + : ThresholdParam() { + *this = ::std::move(from); + } + + inline ThresholdParam& operator=(ThresholdParam&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ThresholdParam& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ThresholdParam* internal_default_instance() { + return reinterpret_cast( + &_ThresholdParam_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(ThresholdParam* other); + friend void swap(ThresholdParam& a, ThresholdParam& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ThresholdParam* New() const final { + return CreateMaybeMessage(NULL); + } + + ThresholdParam* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ThresholdParam& from); + void MergeFrom(const ThresholdParam& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ThresholdParam* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float on_value = 1; + void clear_on_value(); + static const int kOnValueFieldNumber = 1; + float on_value() const; + void set_on_value(float value); + + // float off_value = 2; + void clear_off_value(); + static const int kOffValueFieldNumber = 2; + float off_value() const; + void set_off_value(float value); + + // float threshold = 3; + void clear_threshold(); + static const int kThresholdFieldNumber = 3; + float threshold() const; + void set_threshold(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.ThresholdParam) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float on_value_; + float off_value_; + float threshold_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DepthDependentParam : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.DepthDependentParam) */ { + public: + DepthDependentParam(); + virtual ~DepthDependentParam(); + + DepthDependentParam(const DepthDependentParam& from); + + inline DepthDependentParam& operator=(const DepthDependentParam& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DepthDependentParam(DepthDependentParam&& from) noexcept + : DepthDependentParam() { + *this = ::std::move(from); + } + + inline DepthDependentParam& operator=(DepthDependentParam&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DepthDependentParam& default_instance(); + + enum ParamTypeCase { + kConstantValue = 1, + kLinear = 2, + kExponential = 3, + kThreshold = 4, + PARAMTYPE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DepthDependentParam* internal_default_instance() { + return reinterpret_cast( + &_DepthDependentParam_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(DepthDependentParam* other); + friend void swap(DepthDependentParam& a, DepthDependentParam& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DepthDependentParam* New() const final { + return CreateMaybeMessage(NULL); + } + + DepthDependentParam* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DepthDependentParam& from); + void MergeFrom(const DepthDependentParam& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DepthDependentParam* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float constant_value = 1; + private: + bool has_constant_value() const; + public: + void clear_constant_value(); + static const int kConstantValueFieldNumber = 1; + float constant_value() const; + void set_constant_value(float value); + + // .diplomacy.tensorflow.tensorforest.LinearParam linear = 2; + bool has_linear() const; + void clear_linear(); + static const int kLinearFieldNumber = 2; + private: + const ::diplomacy::tensorflow::tensorforest::LinearParam& _internal_linear() const; + public: + const ::diplomacy::tensorflow::tensorforest::LinearParam& linear() const; + ::diplomacy::tensorflow::tensorforest::LinearParam* release_linear(); + ::diplomacy::tensorflow::tensorforest::LinearParam* mutable_linear(); + void set_allocated_linear(::diplomacy::tensorflow::tensorforest::LinearParam* linear); + + // .diplomacy.tensorflow.tensorforest.ExponentialParam exponential = 3; + bool has_exponential() const; + void clear_exponential(); + static const int kExponentialFieldNumber = 3; + private: + const ::diplomacy::tensorflow::tensorforest::ExponentialParam& _internal_exponential() const; + public: + const ::diplomacy::tensorflow::tensorforest::ExponentialParam& exponential() const; + ::diplomacy::tensorflow::tensorforest::ExponentialParam* release_exponential(); + ::diplomacy::tensorflow::tensorforest::ExponentialParam* mutable_exponential(); + void set_allocated_exponential(::diplomacy::tensorflow::tensorforest::ExponentialParam* exponential); + + // .diplomacy.tensorflow.tensorforest.ThresholdParam threshold = 4; + bool has_threshold() const; + void clear_threshold(); + static const int kThresholdFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tensorforest::ThresholdParam& _internal_threshold() const; + public: + const ::diplomacy::tensorflow::tensorforest::ThresholdParam& threshold() const; + ::diplomacy::tensorflow::tensorforest::ThresholdParam* release_threshold(); + ::diplomacy::tensorflow::tensorforest::ThresholdParam* mutable_threshold(); + void set_allocated_threshold(::diplomacy::tensorflow::tensorforest::ThresholdParam* threshold); + + void clear_ParamType(); + ParamTypeCase ParamType_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.DepthDependentParam) + private: + void set_has_constant_value(); + void set_has_linear(); + void set_has_exponential(); + void set_has_threshold(); + + inline bool has_ParamType() const; + inline void clear_has_ParamType(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + union ParamTypeUnion { + ParamTypeUnion() {} + float constant_value_; + ::diplomacy::tensorflow::tensorforest::LinearParam* linear_; + ::diplomacy::tensorflow::tensorforest::ExponentialParam* exponential_; + ::diplomacy::tensorflow::tensorforest::ThresholdParam* threshold_; + } ParamType_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TensorForestParams : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tensorforest.TensorForestParams) */ { + public: + TensorForestParams(); + virtual ~TensorForestParams(); + + TensorForestParams(const TensorForestParams& from); + + inline TensorForestParams& operator=(const TensorForestParams& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorForestParams(TensorForestParams&& from) noexcept + : TensorForestParams() { + *this = ::std::move(from); + } + + inline TensorForestParams& operator=(TensorForestParams&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorForestParams& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorForestParams* internal_default_instance() { + return reinterpret_cast( + &_TensorForestParams_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(TensorForestParams* other); + friend void swap(TensorForestParams& a, TensorForestParams& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorForestParams* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorForestParams* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorForestParams& from); + void MergeFrom(const TensorForestParams& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorForestParams* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string graph_dir = 16; + void clear_graph_dir(); + static const int kGraphDirFieldNumber = 16; + const ::std::string& graph_dir() const; + void set_graph_dir(const ::std::string& value); + #if LANG_CXX11 + void set_graph_dir(::std::string&& value); + #endif + void set_graph_dir(const char* value); + void set_graph_dir(const char* value, size_t size); + ::std::string* mutable_graph_dir(); + ::std::string* release_graph_dir(); + void set_allocated_graph_dir(::std::string* graph_dir); + + // .diplomacy.tensorflow.tensorforest.SplitPruningConfig pruning_type = 4; + bool has_pruning_type() const; + void clear_pruning_type(); + static const int kPruningTypeFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tensorforest::SplitPruningConfig& _internal_pruning_type() const; + public: + const ::diplomacy::tensorflow::tensorforest::SplitPruningConfig& pruning_type() const; + ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* release_pruning_type(); + ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* mutable_pruning_type(); + void set_allocated_pruning_type(::diplomacy::tensorflow::tensorforest::SplitPruningConfig* pruning_type); + + // .diplomacy.tensorflow.tensorforest.SplitFinishConfig finish_type = 5; + bool has_finish_type() const; + void clear_finish_type(); + static const int kFinishTypeFieldNumber = 5; + private: + const ::diplomacy::tensorflow::tensorforest::SplitFinishConfig& _internal_finish_type() const; + public: + const ::diplomacy::tensorflow::tensorforest::SplitFinishConfig& finish_type() const; + ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* release_finish_type(); + ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* mutable_finish_type(); + void set_allocated_finish_type(::diplomacy::tensorflow::tensorforest::SplitFinishConfig* finish_type); + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam num_splits_to_consider = 13; + bool has_num_splits_to_consider() const; + void clear_num_splits_to_consider(); + static const int kNumSplitsToConsiderFieldNumber = 13; + private: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& _internal_num_splits_to_consider() const; + public: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& num_splits_to_consider() const; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* release_num_splits_to_consider(); + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* mutable_num_splits_to_consider(); + void set_allocated_num_splits_to_consider(::diplomacy::tensorflow::tensorforest::DepthDependentParam* num_splits_to_consider); + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam split_after_samples = 14; + bool has_split_after_samples() const; + void clear_split_after_samples(); + static const int kSplitAfterSamplesFieldNumber = 14; + private: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& _internal_split_after_samples() const; + public: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& split_after_samples() const; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* release_split_after_samples(); + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* mutable_split_after_samples(); + void set_allocated_split_after_samples(::diplomacy::tensorflow::tensorforest::DepthDependentParam* split_after_samples); + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam dominate_fraction = 15; + bool has_dominate_fraction() const; + void clear_dominate_fraction(); + static const int kDominateFractionFieldNumber = 15; + private: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& _internal_dominate_fraction() const; + public: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& dominate_fraction() const; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* release_dominate_fraction(); + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* mutable_dominate_fraction(); + void set_allocated_dominate_fraction(::diplomacy::tensorflow::tensorforest::DepthDependentParam* dominate_fraction); + + // .diplomacy.tensorflow.tensorforest.DepthDependentParam min_split_samples = 18; + bool has_min_split_samples() const; + void clear_min_split_samples(); + static const int kMinSplitSamplesFieldNumber = 18; + private: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& _internal_min_split_samples() const; + public: + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& min_split_samples() const; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* release_min_split_samples(); + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* mutable_min_split_samples(); + void set_allocated_min_split_samples(::diplomacy::tensorflow::tensorforest::DepthDependentParam* min_split_samples); + + // .diplomacy.tensorflow.tensorforest.LeafModelType leaf_type = 1; + void clear_leaf_type(); + static const int kLeafTypeFieldNumber = 1; + ::diplomacy::tensorflow::tensorforest::LeafModelType leaf_type() const; + void set_leaf_type(::diplomacy::tensorflow::tensorforest::LeafModelType value); + + // .diplomacy.tensorflow.tensorforest.StatsModelType stats_type = 2; + void clear_stats_type(); + static const int kStatsTypeFieldNumber = 2; + ::diplomacy::tensorflow::tensorforest::StatsModelType stats_type() const; + void set_stats_type(::diplomacy::tensorflow::tensorforest::StatsModelType value); + + // .diplomacy.tensorflow.tensorforest.SplitCollectionType collection_type = 3; + void clear_collection_type(); + static const int kCollectionTypeFieldNumber = 3; + ::diplomacy::tensorflow::tensorforest::SplitCollectionType collection_type() const; + void set_collection_type(::diplomacy::tensorflow::tensorforest::SplitCollectionType value); + + // int32 num_trees = 6; + void clear_num_trees(); + static const int kNumTreesFieldNumber = 6; + ::google::protobuf::int32 num_trees() const; + void set_num_trees(::google::protobuf::int32 value); + + // int32 max_nodes = 7; + void clear_max_nodes(); + static const int kMaxNodesFieldNumber = 7; + ::google::protobuf::int32 max_nodes() const; + void set_max_nodes(::google::protobuf::int32 value); + + // bool is_regression = 8; + void clear_is_regression(); + static const int kIsRegressionFieldNumber = 8; + bool is_regression() const; + void set_is_regression(bool value); + + // bool drop_final_class = 9; + void clear_drop_final_class(); + static const int kDropFinalClassFieldNumber = 9; + bool drop_final_class() const; + void set_drop_final_class(bool value); + + // bool collate_examples = 10; + void clear_collate_examples(); + static const int kCollateExamplesFieldNumber = 10; + bool collate_examples() const; + void set_collate_examples(bool value); + + // bool checkpoint_stats = 11; + void clear_checkpoint_stats(); + static const int kCheckpointStatsFieldNumber = 11; + bool checkpoint_stats() const; + void set_checkpoint_stats(bool value); + + // int32 num_outputs = 12; + void clear_num_outputs(); + static const int kNumOutputsFieldNumber = 12; + ::google::protobuf::int32 num_outputs() const; + void set_num_outputs(::google::protobuf::int32 value); + + // int32 num_select_features = 17; + void clear_num_select_features(); + static const int kNumSelectFeaturesFieldNumber = 17; + ::google::protobuf::int32 num_select_features() const; + void set_num_select_features(::google::protobuf::int32 value); + + // .diplomacy.tensorflow.decision_trees.InequalityTest.Type inequality_test_type = 19; + void clear_inequality_test_type(); + static const int kInequalityTestTypeFieldNumber = 19; + ::diplomacy::tensorflow::decision_trees::InequalityTest_Type inequality_test_type() const; + void set_inequality_test_type(::diplomacy::tensorflow::decision_trees::InequalityTest_Type value); + + // int32 num_features = 21; + void clear_num_features(); + static const int kNumFeaturesFieldNumber = 21; + ::google::protobuf::int32 num_features() const; + void set_num_features(::google::protobuf::int32 value); + + // bool use_running_stats_method = 20; + void clear_use_running_stats_method(); + static const int kUseRunningStatsMethodFieldNumber = 20; + bool use_running_stats_method() const; + void set_use_running_stats_method(bool value); + + // bool initialize_average_splits = 22; + void clear_initialize_average_splits(); + static const int kInitializeAverageSplitsFieldNumber = 22; + bool initialize_average_splits() const; + void set_initialize_average_splits(bool value); + + // bool inference_tree_paths = 23; + void clear_inference_tree_paths(); + static const int kInferenceTreePathsFieldNumber = 23; + bool inference_tree_paths() const; + void set_inference_tree_paths(bool value); + + // int32 num_classes_to_track = 24; + void clear_num_classes_to_track(); + static const int kNumClassesToTrackFieldNumber = 24; + ::google::protobuf::int32 num_classes_to_track() const; + void set_num_classes_to_track(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.TensorForestParams) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr graph_dir_; + ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* pruning_type_; + ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* finish_type_; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* num_splits_to_consider_; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* split_after_samples_; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* dominate_fraction_; + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* min_split_samples_; + int leaf_type_; + int stats_type_; + int collection_type_; + ::google::protobuf::int32 num_trees_; + ::google::protobuf::int32 max_nodes_; + bool is_regression_; + bool drop_final_class_; + bool collate_examples_; + bool checkpoint_stats_; + ::google::protobuf::int32 num_outputs_; + ::google::protobuf::int32 num_select_features_; + int inequality_test_type_; + ::google::protobuf::int32 num_features_; + bool use_running_stats_method_; + bool initialize_average_splits_; + bool inference_tree_paths_; + ::google::protobuf::int32 num_classes_to_track_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// SplitPruningConfig + +// .diplomacy.tensorflow.tensorforest.DepthDependentParam prune_every_samples = 1; +inline bool SplitPruningConfig::has_prune_every_samples() const { + return this != internal_default_instance() && prune_every_samples_ != NULL; +} +inline void SplitPruningConfig::clear_prune_every_samples() { + if (GetArenaNoVirtual() == NULL && prune_every_samples_ != NULL) { + delete prune_every_samples_; + } + prune_every_samples_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& SplitPruningConfig::_internal_prune_every_samples() const { + return *prune_every_samples_; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& SplitPruningConfig::prune_every_samples() const { + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam* p = prune_every_samples_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitPruningConfig.prune_every_samples) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* SplitPruningConfig::release_prune_every_samples() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.SplitPruningConfig.prune_every_samples) + + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* temp = prune_every_samples_; + prune_every_samples_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* SplitPruningConfig::mutable_prune_every_samples() { + + if (prune_every_samples_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::DepthDependentParam>(GetArenaNoVirtual()); + prune_every_samples_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.SplitPruningConfig.prune_every_samples) + return prune_every_samples_; +} +inline void SplitPruningConfig::set_allocated_prune_every_samples(::diplomacy::tensorflow::tensorforest::DepthDependentParam* prune_every_samples) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete prune_every_samples_; + } + if (prune_every_samples) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + prune_every_samples = ::google::protobuf::internal::GetOwnedMessage( + message_arena, prune_every_samples, submessage_arena); + } + + } else { + + } + prune_every_samples_ = prune_every_samples; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.SplitPruningConfig.prune_every_samples) +} + +// .diplomacy.tensorflow.tensorforest.SplitPruningStrategyType type = 2; +inline void SplitPruningConfig::clear_type() { + type_ = 0; +} +inline ::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType SplitPruningConfig::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitPruningConfig.type) + return static_cast< ::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType >(type_); +} +inline void SplitPruningConfig::set_type(::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.SplitPruningConfig.type) +} + +// ------------------------------------------------------------------- + +// SplitFinishConfig + +// .diplomacy.tensorflow.tensorforest.DepthDependentParam check_every_steps = 1; +inline bool SplitFinishConfig::has_check_every_steps() const { + return this != internal_default_instance() && check_every_steps_ != NULL; +} +inline void SplitFinishConfig::clear_check_every_steps() { + if (GetArenaNoVirtual() == NULL && check_every_steps_ != NULL) { + delete check_every_steps_; + } + check_every_steps_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& SplitFinishConfig::_internal_check_every_steps() const { + return *check_every_steps_; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& SplitFinishConfig::check_every_steps() const { + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam* p = check_every_steps_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitFinishConfig.check_every_steps) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* SplitFinishConfig::release_check_every_steps() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.SplitFinishConfig.check_every_steps) + + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* temp = check_every_steps_; + check_every_steps_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* SplitFinishConfig::mutable_check_every_steps() { + + if (check_every_steps_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::DepthDependentParam>(GetArenaNoVirtual()); + check_every_steps_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.SplitFinishConfig.check_every_steps) + return check_every_steps_; +} +inline void SplitFinishConfig::set_allocated_check_every_steps(::diplomacy::tensorflow::tensorforest::DepthDependentParam* check_every_steps) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete check_every_steps_; + } + if (check_every_steps) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + check_every_steps = ::google::protobuf::internal::GetOwnedMessage( + message_arena, check_every_steps, submessage_arena); + } + + } else { + + } + check_every_steps_ = check_every_steps; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.SplitFinishConfig.check_every_steps) +} + +// .diplomacy.tensorflow.tensorforest.SplitFinishStrategyType type = 2; +inline void SplitFinishConfig::clear_type() { + type_ = 0; +} +inline ::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType SplitFinishConfig::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.SplitFinishConfig.type) + return static_cast< ::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType >(type_); +} +inline void SplitFinishConfig::set_type(::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.SplitFinishConfig.type) +} + +// ------------------------------------------------------------------- + +// LinearParam + +// float slope = 1; +inline void LinearParam::clear_slope() { + slope_ = 0; +} +inline float LinearParam::slope() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LinearParam.slope) + return slope_; +} +inline void LinearParam::set_slope(float value) { + + slope_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.LinearParam.slope) +} + +// float y_intercept = 2; +inline void LinearParam::clear_y_intercept() { + y_intercept_ = 0; +} +inline float LinearParam::y_intercept() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LinearParam.y_intercept) + return y_intercept_; +} +inline void LinearParam::set_y_intercept(float value) { + + y_intercept_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.LinearParam.y_intercept) +} + +// float min_val = 3; +inline void LinearParam::clear_min_val() { + min_val_ = 0; +} +inline float LinearParam::min_val() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LinearParam.min_val) + return min_val_; +} +inline void LinearParam::set_min_val(float value) { + + min_val_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.LinearParam.min_val) +} + +// float max_val = 4; +inline void LinearParam::clear_max_val() { + max_val_ = 0; +} +inline float LinearParam::max_val() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.LinearParam.max_val) + return max_val_; +} +inline void LinearParam::set_max_val(float value) { + + max_val_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.LinearParam.max_val) +} + +// ------------------------------------------------------------------- + +// ExponentialParam + +// float bias = 1; +inline void ExponentialParam::clear_bias() { + bias_ = 0; +} +inline float ExponentialParam::bias() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.ExponentialParam.bias) + return bias_; +} +inline void ExponentialParam::set_bias(float value) { + + bias_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.ExponentialParam.bias) +} + +// float base = 2; +inline void ExponentialParam::clear_base() { + base_ = 0; +} +inline float ExponentialParam::base() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.ExponentialParam.base) + return base_; +} +inline void ExponentialParam::set_base(float value) { + + base_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.ExponentialParam.base) +} + +// float multiplier = 3; +inline void ExponentialParam::clear_multiplier() { + multiplier_ = 0; +} +inline float ExponentialParam::multiplier() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.ExponentialParam.multiplier) + return multiplier_; +} +inline void ExponentialParam::set_multiplier(float value) { + + multiplier_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.ExponentialParam.multiplier) +} + +// float depth_multiplier = 4; +inline void ExponentialParam::clear_depth_multiplier() { + depth_multiplier_ = 0; +} +inline float ExponentialParam::depth_multiplier() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.ExponentialParam.depth_multiplier) + return depth_multiplier_; +} +inline void ExponentialParam::set_depth_multiplier(float value) { + + depth_multiplier_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.ExponentialParam.depth_multiplier) +} + +// ------------------------------------------------------------------- + +// ThresholdParam + +// float on_value = 1; +inline void ThresholdParam::clear_on_value() { + on_value_ = 0; +} +inline float ThresholdParam::on_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.ThresholdParam.on_value) + return on_value_; +} +inline void ThresholdParam::set_on_value(float value) { + + on_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.ThresholdParam.on_value) +} + +// float off_value = 2; +inline void ThresholdParam::clear_off_value() { + off_value_ = 0; +} +inline float ThresholdParam::off_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.ThresholdParam.off_value) + return off_value_; +} +inline void ThresholdParam::set_off_value(float value) { + + off_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.ThresholdParam.off_value) +} + +// float threshold = 3; +inline void ThresholdParam::clear_threshold() { + threshold_ = 0; +} +inline float ThresholdParam::threshold() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.ThresholdParam.threshold) + return threshold_; +} +inline void ThresholdParam::set_threshold(float value) { + + threshold_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.ThresholdParam.threshold) +} + +// ------------------------------------------------------------------- + +// DepthDependentParam + +// float constant_value = 1; +inline bool DepthDependentParam::has_constant_value() const { + return ParamType_case() == kConstantValue; +} +inline void DepthDependentParam::set_has_constant_value() { + _oneof_case_[0] = kConstantValue; +} +inline void DepthDependentParam::clear_constant_value() { + if (has_constant_value()) { + ParamType_.constant_value_ = 0; + clear_has_ParamType(); + } +} +inline float DepthDependentParam::constant_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.DepthDependentParam.constant_value) + if (has_constant_value()) { + return ParamType_.constant_value_; + } + return 0; +} +inline void DepthDependentParam::set_constant_value(float value) { + if (!has_constant_value()) { + clear_ParamType(); + set_has_constant_value(); + } + ParamType_.constant_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.DepthDependentParam.constant_value) +} + +// .diplomacy.tensorflow.tensorforest.LinearParam linear = 2; +inline bool DepthDependentParam::has_linear() const { + return ParamType_case() == kLinear; +} +inline void DepthDependentParam::set_has_linear() { + _oneof_case_[0] = kLinear; +} +inline void DepthDependentParam::clear_linear() { + if (has_linear()) { + delete ParamType_.linear_; + clear_has_ParamType(); + } +} +inline const ::diplomacy::tensorflow::tensorforest::LinearParam& DepthDependentParam::_internal_linear() const { + return *ParamType_.linear_; +} +inline ::diplomacy::tensorflow::tensorforest::LinearParam* DepthDependentParam::release_linear() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.DepthDependentParam.linear) + if (has_linear()) { + clear_has_ParamType(); + ::diplomacy::tensorflow::tensorforest::LinearParam* temp = ParamType_.linear_; + ParamType_.linear_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tensorforest::LinearParam& DepthDependentParam::linear() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.DepthDependentParam.linear) + return has_linear() + ? *ParamType_.linear_ + : *reinterpret_cast< ::diplomacy::tensorflow::tensorforest::LinearParam*>(&::diplomacy::tensorflow::tensorforest::_LinearParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::LinearParam* DepthDependentParam::mutable_linear() { + if (!has_linear()) { + clear_ParamType(); + set_has_linear(); + ParamType_.linear_ = CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::LinearParam >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.DepthDependentParam.linear) + return ParamType_.linear_; +} + +// .diplomacy.tensorflow.tensorforest.ExponentialParam exponential = 3; +inline bool DepthDependentParam::has_exponential() const { + return ParamType_case() == kExponential; +} +inline void DepthDependentParam::set_has_exponential() { + _oneof_case_[0] = kExponential; +} +inline void DepthDependentParam::clear_exponential() { + if (has_exponential()) { + delete ParamType_.exponential_; + clear_has_ParamType(); + } +} +inline const ::diplomacy::tensorflow::tensorforest::ExponentialParam& DepthDependentParam::_internal_exponential() const { + return *ParamType_.exponential_; +} +inline ::diplomacy::tensorflow::tensorforest::ExponentialParam* DepthDependentParam::release_exponential() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.DepthDependentParam.exponential) + if (has_exponential()) { + clear_has_ParamType(); + ::diplomacy::tensorflow::tensorforest::ExponentialParam* temp = ParamType_.exponential_; + ParamType_.exponential_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tensorforest::ExponentialParam& DepthDependentParam::exponential() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.DepthDependentParam.exponential) + return has_exponential() + ? *ParamType_.exponential_ + : *reinterpret_cast< ::diplomacy::tensorflow::tensorforest::ExponentialParam*>(&::diplomacy::tensorflow::tensorforest::_ExponentialParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::ExponentialParam* DepthDependentParam::mutable_exponential() { + if (!has_exponential()) { + clear_ParamType(); + set_has_exponential(); + ParamType_.exponential_ = CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::ExponentialParam >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.DepthDependentParam.exponential) + return ParamType_.exponential_; +} + +// .diplomacy.tensorflow.tensorforest.ThresholdParam threshold = 4; +inline bool DepthDependentParam::has_threshold() const { + return ParamType_case() == kThreshold; +} +inline void DepthDependentParam::set_has_threshold() { + _oneof_case_[0] = kThreshold; +} +inline void DepthDependentParam::clear_threshold() { + if (has_threshold()) { + delete ParamType_.threshold_; + clear_has_ParamType(); + } +} +inline const ::diplomacy::tensorflow::tensorforest::ThresholdParam& DepthDependentParam::_internal_threshold() const { + return *ParamType_.threshold_; +} +inline ::diplomacy::tensorflow::tensorforest::ThresholdParam* DepthDependentParam::release_threshold() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.DepthDependentParam.threshold) + if (has_threshold()) { + clear_has_ParamType(); + ::diplomacy::tensorflow::tensorforest::ThresholdParam* temp = ParamType_.threshold_; + ParamType_.threshold_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tensorforest::ThresholdParam& DepthDependentParam::threshold() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.DepthDependentParam.threshold) + return has_threshold() + ? *ParamType_.threshold_ + : *reinterpret_cast< ::diplomacy::tensorflow::tensorforest::ThresholdParam*>(&::diplomacy::tensorflow::tensorforest::_ThresholdParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::ThresholdParam* DepthDependentParam::mutable_threshold() { + if (!has_threshold()) { + clear_ParamType(); + set_has_threshold(); + ParamType_.threshold_ = CreateMaybeMessage< ::diplomacy::tensorflow::tensorforest::ThresholdParam >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.DepthDependentParam.threshold) + return ParamType_.threshold_; +} + +inline bool DepthDependentParam::has_ParamType() const { + return ParamType_case() != PARAMTYPE_NOT_SET; +} +inline void DepthDependentParam::clear_has_ParamType() { + _oneof_case_[0] = PARAMTYPE_NOT_SET; +} +inline DepthDependentParam::ParamTypeCase DepthDependentParam::ParamType_case() const { + return DepthDependentParam::ParamTypeCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// TensorForestParams + +// .diplomacy.tensorflow.tensorforest.LeafModelType leaf_type = 1; +inline void TensorForestParams::clear_leaf_type() { + leaf_type_ = 0; +} +inline ::diplomacy::tensorflow::tensorforest::LeafModelType TensorForestParams::leaf_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.leaf_type) + return static_cast< ::diplomacy::tensorflow::tensorforest::LeafModelType >(leaf_type_); +} +inline void TensorForestParams::set_leaf_type(::diplomacy::tensorflow::tensorforest::LeafModelType value) { + + leaf_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.leaf_type) +} + +// .diplomacy.tensorflow.tensorforest.StatsModelType stats_type = 2; +inline void TensorForestParams::clear_stats_type() { + stats_type_ = 0; +} +inline ::diplomacy::tensorflow::tensorforest::StatsModelType TensorForestParams::stats_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.stats_type) + return static_cast< ::diplomacy::tensorflow::tensorforest::StatsModelType >(stats_type_); +} +inline void TensorForestParams::set_stats_type(::diplomacy::tensorflow::tensorforest::StatsModelType value) { + + stats_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.stats_type) +} + +// .diplomacy.tensorflow.tensorforest.SplitCollectionType collection_type = 3; +inline void TensorForestParams::clear_collection_type() { + collection_type_ = 0; +} +inline ::diplomacy::tensorflow::tensorforest::SplitCollectionType TensorForestParams::collection_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.collection_type) + return static_cast< ::diplomacy::tensorflow::tensorforest::SplitCollectionType >(collection_type_); +} +inline void TensorForestParams::set_collection_type(::diplomacy::tensorflow::tensorforest::SplitCollectionType value) { + + collection_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.collection_type) +} + +// .diplomacy.tensorflow.tensorforest.SplitPruningConfig pruning_type = 4; +inline bool TensorForestParams::has_pruning_type() const { + return this != internal_default_instance() && pruning_type_ != NULL; +} +inline void TensorForestParams::clear_pruning_type() { + if (GetArenaNoVirtual() == NULL && pruning_type_ != NULL) { + delete pruning_type_; + } + pruning_type_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::SplitPruningConfig& TensorForestParams::_internal_pruning_type() const { + return *pruning_type_; +} +inline const ::diplomacy::tensorflow::tensorforest::SplitPruningConfig& TensorForestParams::pruning_type() const { + const ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* p = pruning_type_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.pruning_type) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_SplitPruningConfig_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* TensorForestParams::release_pruning_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.TensorForestParams.pruning_type) + + ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* temp = pruning_type_; + pruning_type_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::SplitPruningConfig* TensorForestParams::mutable_pruning_type() { + + if (pruning_type_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::SplitPruningConfig>(GetArenaNoVirtual()); + pruning_type_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TensorForestParams.pruning_type) + return pruning_type_; +} +inline void TensorForestParams::set_allocated_pruning_type(::diplomacy::tensorflow::tensorforest::SplitPruningConfig* pruning_type) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete pruning_type_; + } + if (pruning_type) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + pruning_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, pruning_type, submessage_arena); + } + + } else { + + } + pruning_type_ = pruning_type; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.TensorForestParams.pruning_type) +} + +// .diplomacy.tensorflow.tensorforest.SplitFinishConfig finish_type = 5; +inline bool TensorForestParams::has_finish_type() const { + return this != internal_default_instance() && finish_type_ != NULL; +} +inline void TensorForestParams::clear_finish_type() { + if (GetArenaNoVirtual() == NULL && finish_type_ != NULL) { + delete finish_type_; + } + finish_type_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::SplitFinishConfig& TensorForestParams::_internal_finish_type() const { + return *finish_type_; +} +inline const ::diplomacy::tensorflow::tensorforest::SplitFinishConfig& TensorForestParams::finish_type() const { + const ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* p = finish_type_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.finish_type) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_SplitFinishConfig_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* TensorForestParams::release_finish_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.TensorForestParams.finish_type) + + ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* temp = finish_type_; + finish_type_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::SplitFinishConfig* TensorForestParams::mutable_finish_type() { + + if (finish_type_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::SplitFinishConfig>(GetArenaNoVirtual()); + finish_type_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TensorForestParams.finish_type) + return finish_type_; +} +inline void TensorForestParams::set_allocated_finish_type(::diplomacy::tensorflow::tensorforest::SplitFinishConfig* finish_type) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete finish_type_; + } + if (finish_type) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + finish_type = ::google::protobuf::internal::GetOwnedMessage( + message_arena, finish_type, submessage_arena); + } + + } else { + + } + finish_type_ = finish_type; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.TensorForestParams.finish_type) +} + +// int32 num_trees = 6; +inline void TensorForestParams::clear_num_trees() { + num_trees_ = 0; +} +inline ::google::protobuf::int32 TensorForestParams::num_trees() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.num_trees) + return num_trees_; +} +inline void TensorForestParams::set_num_trees(::google::protobuf::int32 value) { + + num_trees_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.num_trees) +} + +// int32 max_nodes = 7; +inline void TensorForestParams::clear_max_nodes() { + max_nodes_ = 0; +} +inline ::google::protobuf::int32 TensorForestParams::max_nodes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.max_nodes) + return max_nodes_; +} +inline void TensorForestParams::set_max_nodes(::google::protobuf::int32 value) { + + max_nodes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.max_nodes) +} + +// int32 num_features = 21; +inline void TensorForestParams::clear_num_features() { + num_features_ = 0; +} +inline ::google::protobuf::int32 TensorForestParams::num_features() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.num_features) + return num_features_; +} +inline void TensorForestParams::set_num_features(::google::protobuf::int32 value) { + + num_features_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.num_features) +} + +// .diplomacy.tensorflow.decision_trees.InequalityTest.Type inequality_test_type = 19; +inline void TensorForestParams::clear_inequality_test_type() { + inequality_test_type_ = 0; +} +inline ::diplomacy::tensorflow::decision_trees::InequalityTest_Type TensorForestParams::inequality_test_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.inequality_test_type) + return static_cast< ::diplomacy::tensorflow::decision_trees::InequalityTest_Type >(inequality_test_type_); +} +inline void TensorForestParams::set_inequality_test_type(::diplomacy::tensorflow::decision_trees::InequalityTest_Type value) { + + inequality_test_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.inequality_test_type) +} + +// bool is_regression = 8; +inline void TensorForestParams::clear_is_regression() { + is_regression_ = false; +} +inline bool TensorForestParams::is_regression() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.is_regression) + return is_regression_; +} +inline void TensorForestParams::set_is_regression(bool value) { + + is_regression_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.is_regression) +} + +// bool drop_final_class = 9; +inline void TensorForestParams::clear_drop_final_class() { + drop_final_class_ = false; +} +inline bool TensorForestParams::drop_final_class() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.drop_final_class) + return drop_final_class_; +} +inline void TensorForestParams::set_drop_final_class(bool value) { + + drop_final_class_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.drop_final_class) +} + +// bool collate_examples = 10; +inline void TensorForestParams::clear_collate_examples() { + collate_examples_ = false; +} +inline bool TensorForestParams::collate_examples() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.collate_examples) + return collate_examples_; +} +inline void TensorForestParams::set_collate_examples(bool value) { + + collate_examples_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.collate_examples) +} + +// bool checkpoint_stats = 11; +inline void TensorForestParams::clear_checkpoint_stats() { + checkpoint_stats_ = false; +} +inline bool TensorForestParams::checkpoint_stats() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.checkpoint_stats) + return checkpoint_stats_; +} +inline void TensorForestParams::set_checkpoint_stats(bool value) { + + checkpoint_stats_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.checkpoint_stats) +} + +// bool use_running_stats_method = 20; +inline void TensorForestParams::clear_use_running_stats_method() { + use_running_stats_method_ = false; +} +inline bool TensorForestParams::use_running_stats_method() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.use_running_stats_method) + return use_running_stats_method_; +} +inline void TensorForestParams::set_use_running_stats_method(bool value) { + + use_running_stats_method_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.use_running_stats_method) +} + +// bool initialize_average_splits = 22; +inline void TensorForestParams::clear_initialize_average_splits() { + initialize_average_splits_ = false; +} +inline bool TensorForestParams::initialize_average_splits() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.initialize_average_splits) + return initialize_average_splits_; +} +inline void TensorForestParams::set_initialize_average_splits(bool value) { + + initialize_average_splits_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.initialize_average_splits) +} + +// bool inference_tree_paths = 23; +inline void TensorForestParams::clear_inference_tree_paths() { + inference_tree_paths_ = false; +} +inline bool TensorForestParams::inference_tree_paths() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.inference_tree_paths) + return inference_tree_paths_; +} +inline void TensorForestParams::set_inference_tree_paths(bool value) { + + inference_tree_paths_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.inference_tree_paths) +} + +// int32 num_outputs = 12; +inline void TensorForestParams::clear_num_outputs() { + num_outputs_ = 0; +} +inline ::google::protobuf::int32 TensorForestParams::num_outputs() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.num_outputs) + return num_outputs_; +} +inline void TensorForestParams::set_num_outputs(::google::protobuf::int32 value) { + + num_outputs_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.num_outputs) +} + +// .diplomacy.tensorflow.tensorforest.DepthDependentParam num_splits_to_consider = 13; +inline bool TensorForestParams::has_num_splits_to_consider() const { + return this != internal_default_instance() && num_splits_to_consider_ != NULL; +} +inline void TensorForestParams::clear_num_splits_to_consider() { + if (GetArenaNoVirtual() == NULL && num_splits_to_consider_ != NULL) { + delete num_splits_to_consider_; + } + num_splits_to_consider_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::_internal_num_splits_to_consider() const { + return *num_splits_to_consider_; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::num_splits_to_consider() const { + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam* p = num_splits_to_consider_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.num_splits_to_consider) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::release_num_splits_to_consider() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.TensorForestParams.num_splits_to_consider) + + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* temp = num_splits_to_consider_; + num_splits_to_consider_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::mutable_num_splits_to_consider() { + + if (num_splits_to_consider_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::DepthDependentParam>(GetArenaNoVirtual()); + num_splits_to_consider_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TensorForestParams.num_splits_to_consider) + return num_splits_to_consider_; +} +inline void TensorForestParams::set_allocated_num_splits_to_consider(::diplomacy::tensorflow::tensorforest::DepthDependentParam* num_splits_to_consider) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete num_splits_to_consider_; + } + if (num_splits_to_consider) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + num_splits_to_consider = ::google::protobuf::internal::GetOwnedMessage( + message_arena, num_splits_to_consider, submessage_arena); + } + + } else { + + } + num_splits_to_consider_ = num_splits_to_consider; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.TensorForestParams.num_splits_to_consider) +} + +// .diplomacy.tensorflow.tensorforest.DepthDependentParam split_after_samples = 14; +inline bool TensorForestParams::has_split_after_samples() const { + return this != internal_default_instance() && split_after_samples_ != NULL; +} +inline void TensorForestParams::clear_split_after_samples() { + if (GetArenaNoVirtual() == NULL && split_after_samples_ != NULL) { + delete split_after_samples_; + } + split_after_samples_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::_internal_split_after_samples() const { + return *split_after_samples_; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::split_after_samples() const { + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam* p = split_after_samples_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.split_after_samples) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::release_split_after_samples() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.TensorForestParams.split_after_samples) + + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* temp = split_after_samples_; + split_after_samples_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::mutable_split_after_samples() { + + if (split_after_samples_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::DepthDependentParam>(GetArenaNoVirtual()); + split_after_samples_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TensorForestParams.split_after_samples) + return split_after_samples_; +} +inline void TensorForestParams::set_allocated_split_after_samples(::diplomacy::tensorflow::tensorforest::DepthDependentParam* split_after_samples) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete split_after_samples_; + } + if (split_after_samples) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + split_after_samples = ::google::protobuf::internal::GetOwnedMessage( + message_arena, split_after_samples, submessage_arena); + } + + } else { + + } + split_after_samples_ = split_after_samples; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.TensorForestParams.split_after_samples) +} + +// .diplomacy.tensorflow.tensorforest.DepthDependentParam dominate_fraction = 15; +inline bool TensorForestParams::has_dominate_fraction() const { + return this != internal_default_instance() && dominate_fraction_ != NULL; +} +inline void TensorForestParams::clear_dominate_fraction() { + if (GetArenaNoVirtual() == NULL && dominate_fraction_ != NULL) { + delete dominate_fraction_; + } + dominate_fraction_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::_internal_dominate_fraction() const { + return *dominate_fraction_; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::dominate_fraction() const { + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam* p = dominate_fraction_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.dominate_fraction) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::release_dominate_fraction() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.TensorForestParams.dominate_fraction) + + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* temp = dominate_fraction_; + dominate_fraction_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::mutable_dominate_fraction() { + + if (dominate_fraction_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::DepthDependentParam>(GetArenaNoVirtual()); + dominate_fraction_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TensorForestParams.dominate_fraction) + return dominate_fraction_; +} +inline void TensorForestParams::set_allocated_dominate_fraction(::diplomacy::tensorflow::tensorforest::DepthDependentParam* dominate_fraction) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete dominate_fraction_; + } + if (dominate_fraction) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + dominate_fraction = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dominate_fraction, submessage_arena); + } + + } else { + + } + dominate_fraction_ = dominate_fraction; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.TensorForestParams.dominate_fraction) +} + +// .diplomacy.tensorflow.tensorforest.DepthDependentParam min_split_samples = 18; +inline bool TensorForestParams::has_min_split_samples() const { + return this != internal_default_instance() && min_split_samples_ != NULL; +} +inline void TensorForestParams::clear_min_split_samples() { + if (GetArenaNoVirtual() == NULL && min_split_samples_ != NULL) { + delete min_split_samples_; + } + min_split_samples_ = NULL; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::_internal_min_split_samples() const { + return *min_split_samples_; +} +inline const ::diplomacy::tensorflow::tensorforest::DepthDependentParam& TensorForestParams::min_split_samples() const { + const ::diplomacy::tensorflow::tensorforest::DepthDependentParam* p = min_split_samples_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.min_split_samples) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tensorforest::_DepthDependentParam_default_instance_); +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::release_min_split_samples() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.TensorForestParams.min_split_samples) + + ::diplomacy::tensorflow::tensorforest::DepthDependentParam* temp = min_split_samples_; + min_split_samples_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tensorforest::DepthDependentParam* TensorForestParams::mutable_min_split_samples() { + + if (min_split_samples_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tensorforest::DepthDependentParam>(GetArenaNoVirtual()); + min_split_samples_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TensorForestParams.min_split_samples) + return min_split_samples_; +} +inline void TensorForestParams::set_allocated_min_split_samples(::diplomacy::tensorflow::tensorforest::DepthDependentParam* min_split_samples) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete min_split_samples_; + } + if (min_split_samples) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + min_split_samples = ::google::protobuf::internal::GetOwnedMessage( + message_arena, min_split_samples, submessage_arena); + } + + } else { + + } + min_split_samples_ = min_split_samples; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.TensorForestParams.min_split_samples) +} + +// string graph_dir = 16; +inline void TensorForestParams::clear_graph_dir() { + graph_dir_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& TensorForestParams::graph_dir() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) + return graph_dir_.GetNoArena(); +} +inline void TensorForestParams::set_graph_dir(const ::std::string& value) { + + graph_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) +} +#if LANG_CXX11 +inline void TensorForestParams::set_graph_dir(::std::string&& value) { + + graph_dir_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) +} +#endif +inline void TensorForestParams::set_graph_dir(const char* value) { + GOOGLE_DCHECK(value != NULL); + + graph_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) +} +inline void TensorForestParams::set_graph_dir(const char* value, size_t size) { + + graph_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) +} +inline ::std::string* TensorForestParams::mutable_graph_dir() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) + return graph_dir_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TensorForestParams::release_graph_dir() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) + + return graph_dir_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TensorForestParams::set_allocated_graph_dir(::std::string* graph_dir) { + if (graph_dir != NULL) { + + } else { + + } + graph_dir_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), graph_dir); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir) +} + +// int32 num_select_features = 17; +inline void TensorForestParams::clear_num_select_features() { + num_select_features_ = 0; +} +inline ::google::protobuf::int32 TensorForestParams::num_select_features() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.num_select_features) + return num_select_features_; +} +inline void TensorForestParams::set_num_select_features(::google::protobuf::int32 value) { + + num_select_features_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.num_select_features) +} + +// int32 num_classes_to_track = 24; +inline void TensorForestParams::clear_num_classes_to_track() { + num_classes_to_track_ = 0; +} +inline ::google::protobuf::int32 TensorForestParams::num_classes_to_track() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tensorforest.TensorForestParams.num_classes_to_track) + return num_classes_to_track_; +} +inline void TensorForestParams::set_num_classes_to_track(::google::protobuf::int32 value) { + + num_classes_to_track_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tensorforest.TensorForestParams.num_classes_to_track) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorforest +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::tensorforest::LeafModelType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::tensorforest::LeafModelType>() { + return ::diplomacy::tensorflow::tensorforest::LeafModelType_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::tensorforest::StatsModelType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::tensorforest::StatsModelType>() { + return ::diplomacy::tensorflow::tensorforest::StatsModelType_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::tensorforest::SplitCollectionType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::tensorforest::SplitCollectionType>() { + return ::diplomacy::tensorflow::tensorforest::SplitCollectionType_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType>() { + return ::diplomacy::tensorflow::tensorforest::SplitPruningStrategyType_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType>() { + return ::diplomacy::tensorflow::tensorforest::SplitFinishStrategyType_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensor_5fforest_2fproto_2ftensor_5fforest_5fparams_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto new file mode 100644 index 0000000..73a7122 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto @@ -0,0 +1,154 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tensorforest; + +import "diplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto"; + +// Leaf models specify what is returned at inference time, and how it is +// stored in the decision_trees.Leaf protos. +enum LeafModelType { + MODEL_DENSE_CLASSIFICATION = 0; + MODEL_SPARSE_CLASSIFICATION = 1; + MODEL_REGRESSION = 2; + MODEL_SPARSE_OR_DENSE_CLASSIFICATION = 3; +} + +// Stats models generally specify information that is collected which is +// necessary to choose a split at a node. Specifically, they operate on +// a SplitCandidate::LeafStat proto. +enum StatsModelType { + STATS_DENSE_GINI = 0; + STATS_SPARSE_GINI = 1; + STATS_LEAST_SQUARES_REGRESSION = 2; + // STATS_SPARSE_THEN_DENSE_GINI is deprecated and no longer supported. + STATS_SPARSE_THEN_DENSE_GINI = 3; + STATS_FIXED_SIZE_SPARSE_GINI = 4; +} + +// Allows selection of operations on the collection of split candidates. +// Basic infers right split stats from the leaf stats and each candidate's +// left stats. +enum SplitCollectionType { + COLLECTION_BASIC = 0; + GRAPH_RUNNER_COLLECTION = 1; +} + +// Pruning strategies define how candidates are pruned over time. +// SPLIT_PRUNE_HALF prunes the worst half of splits every prune_ever_samples, +// etc. Note that prune_every_samples plays against the depth-dependent +// split_after_samples, so they should be set together. +enum SplitPruningStrategyType { + SPLIT_PRUNE_NONE = 0; + SPLIT_PRUNE_HALF = 1; + SPLIT_PRUNE_QUARTER = 2; + SPLIT_PRUNE_10_PERCENT = 3; + // SPLIT_PRUNE_HOEFFDING prunes splits whose Gini impurity is worst than + // the best split's by more than the Hoeffding bound. + SPLIT_PRUNE_HOEFFDING = 4; +} + +message SplitPruningConfig { + DepthDependentParam prune_every_samples = 1; + SplitPruningStrategyType type = 2; +} + +// Finish strategies define when slots are considered finished. +// Basic requires at least split_after_samples, and doesn't allow slots to +// finish until the leaf has received more than one class. Hoeffding splits +// early after min_split_samples if one split is dominating the rest according +// to hoeffding bounds. Bootstrap does the same but compares gini's calculated +// with sampled smoothed counts. +enum SplitFinishStrategyType { + SPLIT_FINISH_BASIC = 0; + SPLIT_FINISH_DOMINATE_HOEFFDING = 2; + SPLIT_FINISH_DOMINATE_BOOTSTRAP = 3; +} + +message SplitFinishConfig { + // Configure how often we check for finish, because some finish methods + // are expensive to perform. + DepthDependentParam check_every_steps = 1; + SplitFinishStrategyType type = 2; +} + +// A parameter that changes linearly with depth, with upper and lower bounds. +message LinearParam { + float slope = 1; + float y_intercept = 2; + float min_val = 3; + float max_val = 4; +} + +// A parameter that changes expoentially with the form +// f = c + mb^(k*d) +// where: +// c: constant bias +// b: base +// m: multiplier +// k: depth multiplier +// d: depth +message ExponentialParam { + float bias = 1; + float base = 2; + float multiplier = 3; + float depth_multiplier = 4; +} + +// A parameter that is 'off' until depth >= a threshold, then is 'on'. +message ThresholdParam { + float on_value = 1; + float off_value = 2; + float threshold = 3; +} + +// A parameter that may change with node depth. +message DepthDependentParam { + oneof ParamType { + float constant_value = 1; + LinearParam linear = 2; + ExponentialParam exponential = 3; + ThresholdParam threshold = 4; + } +} + +message TensorForestParams { + // ------------ Types that control training subsystems ------ // + LeafModelType leaf_type = 1; + StatsModelType stats_type = 2; + SplitCollectionType collection_type = 3; + SplitPruningConfig pruning_type = 4; + SplitFinishConfig finish_type = 5; + + // --------- Parameters that can't change by definition --------------- // + int32 num_trees = 6; + int32 max_nodes = 7; + int32 num_features = 21; + + decision_trees.InequalityTest.Type inequality_test_type = 19; + + // Some booleans controlling execution + bool is_regression = 8; + bool drop_final_class = 9; + bool collate_examples = 10; + bool checkpoint_stats = 11; + bool use_running_stats_method = 20; + bool initialize_average_splits = 22; + bool inference_tree_paths = 23; + + // Number of classes (classification) or targets (regression) + int32 num_outputs = 12; + + // --------- Parameters that could be depth-dependent --------------- // + DepthDependentParam num_splits_to_consider = 13; + DepthDependentParam split_after_samples = 14; + DepthDependentParam dominate_fraction = 15; + DepthDependentParam min_split_samples = 18; + + // --------- Parameters for experimental features ---------------------- // + string graph_dir = 16; + int32 num_select_features = 17; + + // When using a FixedSizeSparseClassificationGrowStats, keep track of + // this many classes. + int32 num_classes_to_track = 24; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params_pb2.py new file mode 100644 index 0000000..faf43c6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params_pb2.py @@ -0,0 +1,765 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.contrib.decision_trees.proto import generic_tree_model_pb2 as diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto', + package='diplomacy.tensorflow.tensorforest', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nKdiplomacy_tensorflow/contrib/tensor_forest/proto/tensor_forest_params.proto\x12!diplomacy.tensorflow.tensorforest\x1aJdiplomacy_tensorflow/contrib/decision_trees/proto/generic_tree_model.proto\"\xb4\x01\n\x12SplitPruningConfig\x12S\n\x13prune_every_samples\x18\x01 \x01(\x0b\x32\x36.diplomacy.tensorflow.tensorforest.DepthDependentParam\x12I\n\x04type\x18\x02 \x01(\x0e\x32;.diplomacy.tensorflow.tensorforest.SplitPruningStrategyType\"\xb0\x01\n\x11SplitFinishConfig\x12Q\n\x11\x63heck_every_steps\x18\x01 \x01(\x0b\x32\x36.diplomacy.tensorflow.tensorforest.DepthDependentParam\x12H\n\x04type\x18\x02 \x01(\x0e\x32:.diplomacy.tensorflow.tensorforest.SplitFinishStrategyType\"S\n\x0bLinearParam\x12\r\n\x05slope\x18\x01 \x01(\x02\x12\x13\n\x0by_intercept\x18\x02 \x01(\x02\x12\x0f\n\x07min_val\x18\x03 \x01(\x02\x12\x0f\n\x07max_val\x18\x04 \x01(\x02\"\\\n\x10\x45xponentialParam\x12\x0c\n\x04\x62ias\x18\x01 \x01(\x02\x12\x0c\n\x04\x62\x61se\x18\x02 \x01(\x02\x12\x12\n\nmultiplier\x18\x03 \x01(\x02\x12\x18\n\x10\x64\x65pth_multiplier\x18\x04 \x01(\x02\"H\n\x0eThresholdParam\x12\x10\n\x08on_value\x18\x01 \x01(\x02\x12\x11\n\toff_value\x18\x02 \x01(\x02\x12\x11\n\tthreshold\x18\x03 \x01(\x02\"\x92\x02\n\x13\x44\x65pthDependentParam\x12\x18\n\x0e\x63onstant_value\x18\x01 \x01(\x02H\x00\x12@\n\x06linear\x18\x02 \x01(\x0b\x32..diplomacy.tensorflow.tensorforest.LinearParamH\x00\x12J\n\x0b\x65xponential\x18\x03 \x01(\x0b\x32\x33.diplomacy.tensorflow.tensorforest.ExponentialParamH\x00\x12\x46\n\tthreshold\x18\x04 \x01(\x0b\x32\x31.diplomacy.tensorflow.tensorforest.ThresholdParamH\x00\x42\x0b\n\tParamType\"\x9b\t\n\x12TensorForestParams\x12\x43\n\tleaf_type\x18\x01 \x01(\x0e\x32\x30.diplomacy.tensorflow.tensorforest.LeafModelType\x12\x45\n\nstats_type\x18\x02 \x01(\x0e\x32\x31.diplomacy.tensorflow.tensorforest.StatsModelType\x12O\n\x0f\x63ollection_type\x18\x03 \x01(\x0e\x32\x36.diplomacy.tensorflow.tensorforest.SplitCollectionType\x12K\n\x0cpruning_type\x18\x04 \x01(\x0b\x32\x35.diplomacy.tensorflow.tensorforest.SplitPruningConfig\x12I\n\x0b\x66inish_type\x18\x05 \x01(\x0b\x32\x34.diplomacy.tensorflow.tensorforest.SplitFinishConfig\x12\x11\n\tnum_trees\x18\x06 \x01(\x05\x12\x11\n\tmax_nodes\x18\x07 \x01(\x05\x12\x14\n\x0cnum_features\x18\x15 \x01(\x05\x12V\n\x14inequality_test_type\x18\x13 \x01(\x0e\x32\x38.diplomacy.tensorflow.decision_trees.InequalityTest.Type\x12\x15\n\ris_regression\x18\x08 \x01(\x08\x12\x18\n\x10\x64rop_final_class\x18\t \x01(\x08\x12\x18\n\x10\x63ollate_examples\x18\n \x01(\x08\x12\x18\n\x10\x63heckpoint_stats\x18\x0b \x01(\x08\x12 \n\x18use_running_stats_method\x18\x14 \x01(\x08\x12!\n\x19initialize_average_splits\x18\x16 \x01(\x08\x12\x1c\n\x14inference_tree_paths\x18\x17 \x01(\x08\x12\x13\n\x0bnum_outputs\x18\x0c \x01(\x05\x12V\n\x16num_splits_to_consider\x18\r \x01(\x0b\x32\x36.diplomacy.tensorflow.tensorforest.DepthDependentParam\x12S\n\x13split_after_samples\x18\x0e \x01(\x0b\x32\x36.diplomacy.tensorflow.tensorforest.DepthDependentParam\x12Q\n\x11\x64ominate_fraction\x18\x0f \x01(\x0b\x32\x36.diplomacy.tensorflow.tensorforest.DepthDependentParam\x12Q\n\x11min_split_samples\x18\x12 \x01(\x0b\x32\x36.diplomacy.tensorflow.tensorforest.DepthDependentParam\x12\x11\n\tgraph_dir\x18\x10 \x01(\t\x12\x1b\n\x13num_select_features\x18\x11 \x01(\x05\x12\x1c\n\x14num_classes_to_track\x18\x18 \x01(\x05*\x90\x01\n\rLeafModelType\x12\x1e\n\x1aMODEL_DENSE_CLASSIFICATION\x10\x00\x12\x1f\n\x1bMODEL_SPARSE_CLASSIFICATION\x10\x01\x12\x14\n\x10MODEL_REGRESSION\x10\x02\x12(\n$MODEL_SPARSE_OR_DENSE_CLASSIFICATION\x10\x03*\xa5\x01\n\x0eStatsModelType\x12\x14\n\x10STATS_DENSE_GINI\x10\x00\x12\x15\n\x11STATS_SPARSE_GINI\x10\x01\x12\"\n\x1eSTATS_LEAST_SQUARES_REGRESSION\x10\x02\x12 \n\x1cSTATS_SPARSE_THEN_DENSE_GINI\x10\x03\x12 \n\x1cSTATS_FIXED_SIZE_SPARSE_GINI\x10\x04*H\n\x13SplitCollectionType\x12\x14\n\x10\x43OLLECTION_BASIC\x10\x00\x12\x1b\n\x17GRAPH_RUNNER_COLLECTION\x10\x01*\x96\x01\n\x18SplitPruningStrategyType\x12\x14\n\x10SPLIT_PRUNE_NONE\x10\x00\x12\x14\n\x10SPLIT_PRUNE_HALF\x10\x01\x12\x17\n\x13SPLIT_PRUNE_QUARTER\x10\x02\x12\x1a\n\x16SPLIT_PRUNE_10_PERCENT\x10\x03\x12\x19\n\x15SPLIT_PRUNE_HOEFFDING\x10\x04*{\n\x17SplitFinishStrategyType\x12\x16\n\x12SPLIT_FINISH_BASIC\x10\x00\x12#\n\x1fSPLIT_FINISH_DOMINATE_HOEFFDING\x10\x02\x12#\n\x1fSPLIT_FINISH_DOMINATE_BOOTSTRAP\x10\x03\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2.DESCRIPTOR,]) + +_LEAFMODELTYPE = _descriptor.EnumDescriptor( + name='LeafModelType', + full_name='diplomacy.tensorflow.tensorforest.LeafModelType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='MODEL_DENSE_CLASSIFICATION', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MODEL_SPARSE_CLASSIFICATION', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MODEL_REGRESSION', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MODEL_SPARSE_OR_DENSE_CLASSIFICATION', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2265, + serialized_end=2409, +) +_sym_db.RegisterEnumDescriptor(_LEAFMODELTYPE) + +LeafModelType = enum_type_wrapper.EnumTypeWrapper(_LEAFMODELTYPE) +_STATSMODELTYPE = _descriptor.EnumDescriptor( + name='StatsModelType', + full_name='diplomacy.tensorflow.tensorforest.StatsModelType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='STATS_DENSE_GINI', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STATS_SPARSE_GINI', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STATS_LEAST_SQUARES_REGRESSION', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STATS_SPARSE_THEN_DENSE_GINI', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STATS_FIXED_SIZE_SPARSE_GINI', index=4, number=4, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2412, + serialized_end=2577, +) +_sym_db.RegisterEnumDescriptor(_STATSMODELTYPE) + +StatsModelType = enum_type_wrapper.EnumTypeWrapper(_STATSMODELTYPE) +_SPLITCOLLECTIONTYPE = _descriptor.EnumDescriptor( + name='SplitCollectionType', + full_name='diplomacy.tensorflow.tensorforest.SplitCollectionType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='COLLECTION_BASIC', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GRAPH_RUNNER_COLLECTION', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2579, + serialized_end=2651, +) +_sym_db.RegisterEnumDescriptor(_SPLITCOLLECTIONTYPE) + +SplitCollectionType = enum_type_wrapper.EnumTypeWrapper(_SPLITCOLLECTIONTYPE) +_SPLITPRUNINGSTRATEGYTYPE = _descriptor.EnumDescriptor( + name='SplitPruningStrategyType', + full_name='diplomacy.tensorflow.tensorforest.SplitPruningStrategyType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='SPLIT_PRUNE_NONE', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SPLIT_PRUNE_HALF', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SPLIT_PRUNE_QUARTER', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SPLIT_PRUNE_10_PERCENT', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SPLIT_PRUNE_HOEFFDING', index=4, number=4, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2654, + serialized_end=2804, +) +_sym_db.RegisterEnumDescriptor(_SPLITPRUNINGSTRATEGYTYPE) + +SplitPruningStrategyType = enum_type_wrapper.EnumTypeWrapper(_SPLITPRUNINGSTRATEGYTYPE) +_SPLITFINISHSTRATEGYTYPE = _descriptor.EnumDescriptor( + name='SplitFinishStrategyType', + full_name='diplomacy.tensorflow.tensorforest.SplitFinishStrategyType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='SPLIT_FINISH_BASIC', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SPLIT_FINISH_DOMINATE_HOEFFDING', index=1, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SPLIT_FINISH_DOMINATE_BOOTSTRAP', index=2, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2806, + serialized_end=2929, +) +_sym_db.RegisterEnumDescriptor(_SPLITFINISHSTRATEGYTYPE) + +SplitFinishStrategyType = enum_type_wrapper.EnumTypeWrapper(_SPLITFINISHSTRATEGYTYPE) +MODEL_DENSE_CLASSIFICATION = 0 +MODEL_SPARSE_CLASSIFICATION = 1 +MODEL_REGRESSION = 2 +MODEL_SPARSE_OR_DENSE_CLASSIFICATION = 3 +STATS_DENSE_GINI = 0 +STATS_SPARSE_GINI = 1 +STATS_LEAST_SQUARES_REGRESSION = 2 +STATS_SPARSE_THEN_DENSE_GINI = 3 +STATS_FIXED_SIZE_SPARSE_GINI = 4 +COLLECTION_BASIC = 0 +GRAPH_RUNNER_COLLECTION = 1 +SPLIT_PRUNE_NONE = 0 +SPLIT_PRUNE_HALF = 1 +SPLIT_PRUNE_QUARTER = 2 +SPLIT_PRUNE_10_PERCENT = 3 +SPLIT_PRUNE_HOEFFDING = 4 +SPLIT_FINISH_BASIC = 0 +SPLIT_FINISH_DOMINATE_HOEFFDING = 2 +SPLIT_FINISH_DOMINATE_BOOTSTRAP = 3 + + + +_SPLITPRUNINGCONFIG = _descriptor.Descriptor( + name='SplitPruningConfig', + full_name='diplomacy.tensorflow.tensorforest.SplitPruningConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='prune_every_samples', full_name='diplomacy.tensorflow.tensorforest.SplitPruningConfig.prune_every_samples', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.tensorforest.SplitPruningConfig.type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=191, + serialized_end=371, +) + + +_SPLITFINISHCONFIG = _descriptor.Descriptor( + name='SplitFinishConfig', + full_name='diplomacy.tensorflow.tensorforest.SplitFinishConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='check_every_steps', full_name='diplomacy.tensorflow.tensorforest.SplitFinishConfig.check_every_steps', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.tensorforest.SplitFinishConfig.type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=374, + serialized_end=550, +) + + +_LINEARPARAM = _descriptor.Descriptor( + name='LinearParam', + full_name='diplomacy.tensorflow.tensorforest.LinearParam', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='slope', full_name='diplomacy.tensorflow.tensorforest.LinearParam.slope', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='y_intercept', full_name='diplomacy.tensorflow.tensorforest.LinearParam.y_intercept', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_val', full_name='diplomacy.tensorflow.tensorforest.LinearParam.min_val', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_val', full_name='diplomacy.tensorflow.tensorforest.LinearParam.max_val', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=552, + serialized_end=635, +) + + +_EXPONENTIALPARAM = _descriptor.Descriptor( + name='ExponentialParam', + full_name='diplomacy.tensorflow.tensorforest.ExponentialParam', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='bias', full_name='diplomacy.tensorflow.tensorforest.ExponentialParam.bias', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='base', full_name='diplomacy.tensorflow.tensorforest.ExponentialParam.base', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='multiplier', full_name='diplomacy.tensorflow.tensorforest.ExponentialParam.multiplier', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='depth_multiplier', full_name='diplomacy.tensorflow.tensorforest.ExponentialParam.depth_multiplier', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=637, + serialized_end=729, +) + + +_THRESHOLDPARAM = _descriptor.Descriptor( + name='ThresholdParam', + full_name='diplomacy.tensorflow.tensorforest.ThresholdParam', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='on_value', full_name='diplomacy.tensorflow.tensorforest.ThresholdParam.on_value', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='off_value', full_name='diplomacy.tensorflow.tensorforest.ThresholdParam.off_value', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='threshold', full_name='diplomacy.tensorflow.tensorforest.ThresholdParam.threshold', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=731, + serialized_end=803, +) + + +_DEPTHDEPENDENTPARAM = _descriptor.Descriptor( + name='DepthDependentParam', + full_name='diplomacy.tensorflow.tensorforest.DepthDependentParam', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='constant_value', full_name='diplomacy.tensorflow.tensorforest.DepthDependentParam.constant_value', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='linear', full_name='diplomacy.tensorflow.tensorforest.DepthDependentParam.linear', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='exponential', full_name='diplomacy.tensorflow.tensorforest.DepthDependentParam.exponential', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='threshold', full_name='diplomacy.tensorflow.tensorforest.DepthDependentParam.threshold', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='ParamType', full_name='diplomacy.tensorflow.tensorforest.DepthDependentParam.ParamType', + index=0, containing_type=None, fields=[]), + ], + serialized_start=806, + serialized_end=1080, +) + + +_TENSORFORESTPARAMS = _descriptor.Descriptor( + name='TensorForestParams', + full_name='diplomacy.tensorflow.tensorforest.TensorForestParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='leaf_type', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.leaf_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='stats_type', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.stats_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='collection_type', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.collection_type', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='pruning_type', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.pruning_type', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='finish_type', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.finish_type', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_trees', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.num_trees', index=5, + number=6, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_nodes', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.max_nodes', index=6, + number=7, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_features', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.num_features', index=7, + number=21, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inequality_test_type', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.inequality_test_type', index=8, + number=19, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_regression', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.is_regression', index=9, + number=8, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='drop_final_class', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.drop_final_class', index=10, + number=9, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='collate_examples', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.collate_examples', index=11, + number=10, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='checkpoint_stats', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.checkpoint_stats', index=12, + number=11, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='use_running_stats_method', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.use_running_stats_method', index=13, + number=20, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initialize_average_splits', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.initialize_average_splits', index=14, + number=22, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inference_tree_paths', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.inference_tree_paths', index=15, + number=23, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_outputs', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.num_outputs', index=16, + number=12, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_splits_to_consider', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.num_splits_to_consider', index=17, + number=13, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='split_after_samples', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.split_after_samples', index=18, + number=14, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dominate_fraction', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.dominate_fraction', index=19, + number=15, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_split_samples', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.min_split_samples', index=20, + number=18, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph_dir', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.graph_dir', index=21, + number=16, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_select_features', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.num_select_features', index=22, + number=17, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_classes_to_track', full_name='diplomacy.tensorflow.tensorforest.TensorForestParams.num_classes_to_track', index=23, + number=24, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1083, + serialized_end=2262, +) + +_SPLITPRUNINGCONFIG.fields_by_name['prune_every_samples'].message_type = _DEPTHDEPENDENTPARAM +_SPLITPRUNINGCONFIG.fields_by_name['type'].enum_type = _SPLITPRUNINGSTRATEGYTYPE +_SPLITFINISHCONFIG.fields_by_name['check_every_steps'].message_type = _DEPTHDEPENDENTPARAM +_SPLITFINISHCONFIG.fields_by_name['type'].enum_type = _SPLITFINISHSTRATEGYTYPE +_DEPTHDEPENDENTPARAM.fields_by_name['linear'].message_type = _LINEARPARAM +_DEPTHDEPENDENTPARAM.fields_by_name['exponential'].message_type = _EXPONENTIALPARAM +_DEPTHDEPENDENTPARAM.fields_by_name['threshold'].message_type = _THRESHOLDPARAM +_DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'].fields.append( + _DEPTHDEPENDENTPARAM.fields_by_name['constant_value']) +_DEPTHDEPENDENTPARAM.fields_by_name['constant_value'].containing_oneof = _DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'] +_DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'].fields.append( + _DEPTHDEPENDENTPARAM.fields_by_name['linear']) +_DEPTHDEPENDENTPARAM.fields_by_name['linear'].containing_oneof = _DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'] +_DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'].fields.append( + _DEPTHDEPENDENTPARAM.fields_by_name['exponential']) +_DEPTHDEPENDENTPARAM.fields_by_name['exponential'].containing_oneof = _DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'] +_DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'].fields.append( + _DEPTHDEPENDENTPARAM.fields_by_name['threshold']) +_DEPTHDEPENDENTPARAM.fields_by_name['threshold'].containing_oneof = _DEPTHDEPENDENTPARAM.oneofs_by_name['ParamType'] +_TENSORFORESTPARAMS.fields_by_name['leaf_type'].enum_type = _LEAFMODELTYPE +_TENSORFORESTPARAMS.fields_by_name['stats_type'].enum_type = _STATSMODELTYPE +_TENSORFORESTPARAMS.fields_by_name['collection_type'].enum_type = _SPLITCOLLECTIONTYPE +_TENSORFORESTPARAMS.fields_by_name['pruning_type'].message_type = _SPLITPRUNINGCONFIG +_TENSORFORESTPARAMS.fields_by_name['finish_type'].message_type = _SPLITFINISHCONFIG +_TENSORFORESTPARAMS.fields_by_name['inequality_test_type'].enum_type = diplomacy__tensorflow_dot_contrib_dot_decision__trees_dot_proto_dot_generic__tree__model__pb2._INEQUALITYTEST_TYPE +_TENSORFORESTPARAMS.fields_by_name['num_splits_to_consider'].message_type = _DEPTHDEPENDENTPARAM +_TENSORFORESTPARAMS.fields_by_name['split_after_samples'].message_type = _DEPTHDEPENDENTPARAM +_TENSORFORESTPARAMS.fields_by_name['dominate_fraction'].message_type = _DEPTHDEPENDENTPARAM +_TENSORFORESTPARAMS.fields_by_name['min_split_samples'].message_type = _DEPTHDEPENDENTPARAM +DESCRIPTOR.message_types_by_name['SplitPruningConfig'] = _SPLITPRUNINGCONFIG +DESCRIPTOR.message_types_by_name['SplitFinishConfig'] = _SPLITFINISHCONFIG +DESCRIPTOR.message_types_by_name['LinearParam'] = _LINEARPARAM +DESCRIPTOR.message_types_by_name['ExponentialParam'] = _EXPONENTIALPARAM +DESCRIPTOR.message_types_by_name['ThresholdParam'] = _THRESHOLDPARAM +DESCRIPTOR.message_types_by_name['DepthDependentParam'] = _DEPTHDEPENDENTPARAM +DESCRIPTOR.message_types_by_name['TensorForestParams'] = _TENSORFORESTPARAMS +DESCRIPTOR.enum_types_by_name['LeafModelType'] = _LEAFMODELTYPE +DESCRIPTOR.enum_types_by_name['StatsModelType'] = _STATSMODELTYPE +DESCRIPTOR.enum_types_by_name['SplitCollectionType'] = _SPLITCOLLECTIONTYPE +DESCRIPTOR.enum_types_by_name['SplitPruningStrategyType'] = _SPLITPRUNINGSTRATEGYTYPE +DESCRIPTOR.enum_types_by_name['SplitFinishStrategyType'] = _SPLITFINISHSTRATEGYTYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +SplitPruningConfig = _reflection.GeneratedProtocolMessageType('SplitPruningConfig', (_message.Message,), dict( + DESCRIPTOR = _SPLITPRUNINGCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.tensor_forest_params_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.SplitPruningConfig) + )) +_sym_db.RegisterMessage(SplitPruningConfig) + +SplitFinishConfig = _reflection.GeneratedProtocolMessageType('SplitFinishConfig', (_message.Message,), dict( + DESCRIPTOR = _SPLITFINISHCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.tensor_forest_params_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.SplitFinishConfig) + )) +_sym_db.RegisterMessage(SplitFinishConfig) + +LinearParam = _reflection.GeneratedProtocolMessageType('LinearParam', (_message.Message,), dict( + DESCRIPTOR = _LINEARPARAM, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.tensor_forest_params_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.LinearParam) + )) +_sym_db.RegisterMessage(LinearParam) + +ExponentialParam = _reflection.GeneratedProtocolMessageType('ExponentialParam', (_message.Message,), dict( + DESCRIPTOR = _EXPONENTIALPARAM, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.tensor_forest_params_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.ExponentialParam) + )) +_sym_db.RegisterMessage(ExponentialParam) + +ThresholdParam = _reflection.GeneratedProtocolMessageType('ThresholdParam', (_message.Message,), dict( + DESCRIPTOR = _THRESHOLDPARAM, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.tensor_forest_params_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.ThresholdParam) + )) +_sym_db.RegisterMessage(ThresholdParam) + +DepthDependentParam = _reflection.GeneratedProtocolMessageType('DepthDependentParam', (_message.Message,), dict( + DESCRIPTOR = _DEPTHDEPENDENTPARAM, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.tensor_forest_params_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.DepthDependentParam) + )) +_sym_db.RegisterMessage(DepthDependentParam) + +TensorForestParams = _reflection.GeneratedProtocolMessageType('TensorForestParams', (_message.Message,), dict( + DESCRIPTOR = _TENSORFORESTPARAMS, + __module__ = 'diplomacy_tensorflow.contrib.tensor_forest.proto.tensor_forest_params_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tensorforest.TensorForestParams) + )) +_sym_db.RegisterMessage(TensorForestParams) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.pb.cc new file mode 100644 index 0000000..69e963c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.pb.cc @@ -0,0 +1,1391 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto + +#include "diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SpriteMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_EmbeddingInfo; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto +namespace diplomacy { +namespace tensorflow { +class SpriteMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SpriteMetadata_default_instance_; +class EmbeddingInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _EmbeddingInfo_default_instance_; +class ProjectorConfigDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProjectorConfig_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto { +static void InitDefaultsSpriteMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_SpriteMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::SpriteMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::SpriteMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SpriteMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSpriteMetadata}, {}}; + +static void InitDefaultsEmbeddingInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_EmbeddingInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::EmbeddingInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::EmbeddingInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_EmbeddingInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsEmbeddingInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_SpriteMetadata.base,}}; + +static void InitDefaultsProjectorConfig() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProjectorConfig_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProjectorConfig(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProjectorConfig::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ProjectorConfig = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsProjectorConfig}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_EmbeddingInfo.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_SpriteMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_EmbeddingInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProjectorConfig.base); +} + +::google::protobuf::Metadata file_level_metadata[3]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SpriteMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SpriteMetadata, image_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SpriteMetadata, single_image_dim_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EmbeddingInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EmbeddingInfo, tensor_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EmbeddingInfo, metadata_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EmbeddingInfo, bookmarks_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EmbeddingInfo, tensor_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EmbeddingInfo, sprite_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EmbeddingInfo, tensor_path_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProjectorConfig, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProjectorConfig, model_checkpoint_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProjectorConfig, embeddings_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProjectorConfig, model_checkpoint_dir_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::SpriteMetadata)}, + { 7, -1, sizeof(::diplomacy::tensorflow::EmbeddingInfo)}, + { 18, -1, sizeof(::diplomacy::tensorflow::ProjectorConfig)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_SpriteMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_EmbeddingInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProjectorConfig_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nQdiplomacy_tensorflow/contrib/tensorboa" + "rd/plugins/projector/projector_config.pr" + "oto\022\024diplomacy.tensorflow\">\n\016SpriteMetad" + "ata\022\022\n\nimage_path\030\001 \001(\t\022\030\n\020single_image_" + "dim\030\002 \003(\r\"\264\001\n\rEmbeddingInfo\022\023\n\013tensor_na" + "me\030\001 \001(\t\022\025\n\rmetadata_path\030\002 \001(\t\022\026\n\016bookm" + "arks_path\030\003 \001(\t\022\024\n\014tensor_shape\030\004 \003(\r\0224\n" + "\006sprite\030\005 \001(\0132$.diplomacy.tensorflow.Spr" + "iteMetadata\022\023\n\013tensor_path\030\006 \001(\t\"\207\001\n\017Pro" + "jectorConfig\022\035\n\025model_checkpoint_path\030\001 " + "\001(\t\0227\n\nembeddings\030\002 \003(\0132#.diplomacy.tens" + "orflow.EmbeddingInfo\022\034\n\024model_checkpoint" + "_dir\030\003 \001(\tb\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 498); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void SpriteMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SpriteMetadata::kImagePathFieldNumber; +const int SpriteMetadata::kSingleImageDimFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SpriteMetadata::SpriteMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_SpriteMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.SpriteMetadata) +} +SpriteMetadata::SpriteMetadata(const SpriteMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + single_image_dim_(from.single_image_dim_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + image_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.image_path().size() > 0) { + image_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_path_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.SpriteMetadata) +} + +void SpriteMetadata::SharedCtor() { + image_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +SpriteMetadata::~SpriteMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.SpriteMetadata) + SharedDtor(); +} + +void SpriteMetadata::SharedDtor() { + image_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SpriteMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SpriteMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SpriteMetadata& SpriteMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_SpriteMetadata.base); + return *internal_default_instance(); +} + + +void SpriteMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.SpriteMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + single_image_dim_.Clear(); + image_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool SpriteMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.SpriteMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string image_path = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_image_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image_path().data(), static_cast(this->image_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.SpriteMetadata.image_path")); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 single_image_dim = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_single_image_dim()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 18u, input, this->mutable_single_image_dim()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.SpriteMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.SpriteMetadata) + return false; +#undef DO_ +} + +void SpriteMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.SpriteMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string image_path = 1; + if (this->image_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image_path().data(), static_cast(this->image_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SpriteMetadata.image_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->image_path(), output); + } + + // repeated uint32 single_image_dim = 2; + if (this->single_image_dim_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _single_image_dim_cached_byte_size_)); + } + for (int i = 0, n = this->single_image_dim_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->single_image_dim(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.SpriteMetadata) +} + +::google::protobuf::uint8* SpriteMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.SpriteMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string image_path = 1; + if (this->image_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->image_path().data(), static_cast(this->image_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SpriteMetadata.image_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->image_path(), target); + } + + // repeated uint32 single_image_dim = 2; + if (this->single_image_dim_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _single_image_dim_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->single_image_dim_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.SpriteMetadata) + return target; +} + +size_t SpriteMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.SpriteMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated uint32 single_image_dim = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->single_image_dim_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _single_image_dim_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string image_path = 1; + if (this->image_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->image_path()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SpriteMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.SpriteMetadata) + GOOGLE_DCHECK_NE(&from, this); + const SpriteMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.SpriteMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.SpriteMetadata) + MergeFrom(*source); + } +} + +void SpriteMetadata::MergeFrom(const SpriteMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.SpriteMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + single_image_dim_.MergeFrom(from.single_image_dim_); + if (from.image_path().size() > 0) { + + image_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.image_path_); + } +} + +void SpriteMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.SpriteMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SpriteMetadata::CopyFrom(const SpriteMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.SpriteMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SpriteMetadata::IsInitialized() const { + return true; +} + +void SpriteMetadata::Swap(SpriteMetadata* other) { + if (other == this) return; + InternalSwap(other); +} +void SpriteMetadata::InternalSwap(SpriteMetadata* other) { + using std::swap; + single_image_dim_.InternalSwap(&other->single_image_dim_); + image_path_.Swap(&other->image_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SpriteMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void EmbeddingInfo::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_EmbeddingInfo_default_instance_._instance.get_mutable()->sprite_ = const_cast< ::diplomacy::tensorflow::SpriteMetadata*>( + ::diplomacy::tensorflow::SpriteMetadata::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EmbeddingInfo::kTensorNameFieldNumber; +const int EmbeddingInfo::kMetadataPathFieldNumber; +const int EmbeddingInfo::kBookmarksPathFieldNumber; +const int EmbeddingInfo::kTensorShapeFieldNumber; +const int EmbeddingInfo::kSpriteFieldNumber; +const int EmbeddingInfo::kTensorPathFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EmbeddingInfo::EmbeddingInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_EmbeddingInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.EmbeddingInfo) +} +EmbeddingInfo::EmbeddingInfo(const EmbeddingInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + tensor_shape_(from.tensor_shape_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tensor_name().size() > 0) { + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } + metadata_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.metadata_path().size() > 0) { + metadata_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.metadata_path_); + } + bookmarks_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.bookmarks_path().size() > 0) { + bookmarks_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.bookmarks_path_); + } + tensor_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tensor_path().size() > 0) { + tensor_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_path_); + } + if (from.has_sprite()) { + sprite_ = new ::diplomacy::tensorflow::SpriteMetadata(*from.sprite_); + } else { + sprite_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.EmbeddingInfo) +} + +void EmbeddingInfo::SharedCtor() { + tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + metadata_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bookmarks_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tensor_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + sprite_ = NULL; +} + +EmbeddingInfo::~EmbeddingInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.EmbeddingInfo) + SharedDtor(); +} + +void EmbeddingInfo::SharedDtor() { + tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + metadata_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bookmarks_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tensor_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete sprite_; +} + +void EmbeddingInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* EmbeddingInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const EmbeddingInfo& EmbeddingInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_EmbeddingInfo.base); + return *internal_default_instance(); +} + + +void EmbeddingInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.EmbeddingInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tensor_shape_.Clear(); + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + metadata_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bookmarks_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tensor_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && sprite_ != NULL) { + delete sprite_; + } + sprite_ = NULL; + _internal_metadata_.Clear(); +} + +bool EmbeddingInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.EmbeddingInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string tensor_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EmbeddingInfo.tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + // string metadata_path = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_metadata_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->metadata_path().data(), static_cast(this->metadata_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EmbeddingInfo.metadata_path")); + } else { + goto handle_unusual; + } + break; + } + + // string bookmarks_path = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_bookmarks_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->bookmarks_path().data(), static_cast(this->bookmarks_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EmbeddingInfo.bookmarks_path")); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 tensor_shape = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_tensor_shape()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 34u, input, this->mutable_tensor_shape()))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.SpriteMetadata sprite = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sprite())); + } else { + goto handle_unusual; + } + break; + } + + // string tensor_path = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tensor_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_path().data(), static_cast(this->tensor_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EmbeddingInfo.tensor_path")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.EmbeddingInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.EmbeddingInfo) + return false; +#undef DO_ +} + +void EmbeddingInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.EmbeddingInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string tensor_name = 1; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->tensor_name(), output); + } + + // string metadata_path = 2; + if (this->metadata_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->metadata_path().data(), static_cast(this->metadata_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.metadata_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->metadata_path(), output); + } + + // string bookmarks_path = 3; + if (this->bookmarks_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->bookmarks_path().data(), static_cast(this->bookmarks_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.bookmarks_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->bookmarks_path(), output); + } + + // repeated uint32 tensor_shape = 4; + if (this->tensor_shape_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _tensor_shape_cached_byte_size_)); + } + for (int i = 0, n = this->tensor_shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->tensor_shape(i), output); + } + + // .diplomacy.tensorflow.SpriteMetadata sprite = 5; + if (this->has_sprite()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_sprite(), output); + } + + // string tensor_path = 6; + if (this->tensor_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_path().data(), static_cast(this->tensor_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.tensor_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->tensor_path(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.EmbeddingInfo) +} + +::google::protobuf::uint8* EmbeddingInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.EmbeddingInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string tensor_name = 1; + if (this->tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_name().data(), static_cast(this->tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->tensor_name(), target); + } + + // string metadata_path = 2; + if (this->metadata_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->metadata_path().data(), static_cast(this->metadata_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.metadata_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->metadata_path(), target); + } + + // string bookmarks_path = 3; + if (this->bookmarks_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->bookmarks_path().data(), static_cast(this->bookmarks_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.bookmarks_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->bookmarks_path(), target); + } + + // repeated uint32 tensor_shape = 4; + if (this->tensor_shape_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _tensor_shape_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->tensor_shape_, target); + } + + // .diplomacy.tensorflow.SpriteMetadata sprite = 5; + if (this->has_sprite()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_sprite(), deterministic, target); + } + + // string tensor_path = 6; + if (this->tensor_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tensor_path().data(), static_cast(this->tensor_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EmbeddingInfo.tensor_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->tensor_path(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.EmbeddingInfo) + return target; +} + +size_t EmbeddingInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.EmbeddingInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated uint32 tensor_shape = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->tensor_shape_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _tensor_shape_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string tensor_name = 1; + if (this->tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tensor_name()); + } + + // string metadata_path = 2; + if (this->metadata_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->metadata_path()); + } + + // string bookmarks_path = 3; + if (this->bookmarks_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->bookmarks_path()); + } + + // string tensor_path = 6; + if (this->tensor_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tensor_path()); + } + + // .diplomacy.tensorflow.SpriteMetadata sprite = 5; + if (this->has_sprite()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *sprite_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void EmbeddingInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.EmbeddingInfo) + GOOGLE_DCHECK_NE(&from, this); + const EmbeddingInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.EmbeddingInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.EmbeddingInfo) + MergeFrom(*source); + } +} + +void EmbeddingInfo::MergeFrom(const EmbeddingInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.EmbeddingInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + tensor_shape_.MergeFrom(from.tensor_shape_); + if (from.tensor_name().size() > 0) { + + tensor_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_name_); + } + if (from.metadata_path().size() > 0) { + + metadata_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.metadata_path_); + } + if (from.bookmarks_path().size() > 0) { + + bookmarks_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.bookmarks_path_); + } + if (from.tensor_path().size() > 0) { + + tensor_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_path_); + } + if (from.has_sprite()) { + mutable_sprite()->::diplomacy::tensorflow::SpriteMetadata::MergeFrom(from.sprite()); + } +} + +void EmbeddingInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.EmbeddingInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EmbeddingInfo::CopyFrom(const EmbeddingInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.EmbeddingInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EmbeddingInfo::IsInitialized() const { + return true; +} + +void EmbeddingInfo::Swap(EmbeddingInfo* other) { + if (other == this) return; + InternalSwap(other); +} +void EmbeddingInfo::InternalSwap(EmbeddingInfo* other) { + using std::swap; + tensor_shape_.InternalSwap(&other->tensor_shape_); + tensor_name_.Swap(&other->tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + metadata_path_.Swap(&other->metadata_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + bookmarks_path_.Swap(&other->bookmarks_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + tensor_path_.Swap(&other->tensor_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(sprite_, other->sprite_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata EmbeddingInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ProjectorConfig::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProjectorConfig::kModelCheckpointPathFieldNumber; +const int ProjectorConfig::kEmbeddingsFieldNumber; +const int ProjectorConfig::kModelCheckpointDirFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProjectorConfig::ProjectorConfig() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_ProjectorConfig.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProjectorConfig) +} +ProjectorConfig::ProjectorConfig(const ProjectorConfig& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + embeddings_(from.embeddings_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + model_checkpoint_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.model_checkpoint_path().size() > 0) { + model_checkpoint_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.model_checkpoint_path_); + } + model_checkpoint_dir_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.model_checkpoint_dir().size() > 0) { + model_checkpoint_dir_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.model_checkpoint_dir_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProjectorConfig) +} + +void ProjectorConfig::SharedCtor() { + model_checkpoint_path_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + model_checkpoint_dir_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ProjectorConfig::~ProjectorConfig() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProjectorConfig) + SharedDtor(); +} + +void ProjectorConfig::SharedDtor() { + model_checkpoint_path_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + model_checkpoint_dir_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ProjectorConfig::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProjectorConfig::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProjectorConfig& ProjectorConfig::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::scc_info_ProjectorConfig.base); + return *internal_default_instance(); +} + + +void ProjectorConfig::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProjectorConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + embeddings_.Clear(); + model_checkpoint_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + model_checkpoint_dir_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool ProjectorConfig::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProjectorConfig) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string model_checkpoint_path = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_model_checkpoint_path())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->model_checkpoint_path().data(), static_cast(this->model_checkpoint_path().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.EmbeddingInfo embeddings = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_embeddings())); + } else { + goto handle_unusual; + } + break; + } + + // string model_checkpoint_dir = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_model_checkpoint_dir())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->model_checkpoint_dir().data(), static_cast(this->model_checkpoint_dir().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProjectorConfig) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProjectorConfig) + return false; +#undef DO_ +} + +void ProjectorConfig::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProjectorConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string model_checkpoint_path = 1; + if (this->model_checkpoint_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->model_checkpoint_path().data(), static_cast(this->model_checkpoint_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->model_checkpoint_path(), output); + } + + // repeated .diplomacy.tensorflow.EmbeddingInfo embeddings = 2; + for (unsigned int i = 0, + n = static_cast(this->embeddings_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->embeddings(static_cast(i)), + output); + } + + // string model_checkpoint_dir = 3; + if (this->model_checkpoint_dir().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->model_checkpoint_dir().data(), static_cast(this->model_checkpoint_dir().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->model_checkpoint_dir(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProjectorConfig) +} + +::google::protobuf::uint8* ProjectorConfig::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProjectorConfig) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string model_checkpoint_path = 1; + if (this->model_checkpoint_path().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->model_checkpoint_path().data(), static_cast(this->model_checkpoint_path().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->model_checkpoint_path(), target); + } + + // repeated .diplomacy.tensorflow.EmbeddingInfo embeddings = 2; + for (unsigned int i = 0, + n = static_cast(this->embeddings_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->embeddings(static_cast(i)), deterministic, target); + } + + // string model_checkpoint_dir = 3; + if (this->model_checkpoint_dir().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->model_checkpoint_dir().data(), static_cast(this->model_checkpoint_dir().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->model_checkpoint_dir(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProjectorConfig) + return target; +} + +size_t ProjectorConfig::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProjectorConfig) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.EmbeddingInfo embeddings = 2; + { + unsigned int count = static_cast(this->embeddings_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->embeddings(static_cast(i))); + } + } + + // string model_checkpoint_path = 1; + if (this->model_checkpoint_path().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->model_checkpoint_path()); + } + + // string model_checkpoint_dir = 3; + if (this->model_checkpoint_dir().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->model_checkpoint_dir()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProjectorConfig::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProjectorConfig) + GOOGLE_DCHECK_NE(&from, this); + const ProjectorConfig* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProjectorConfig) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProjectorConfig) + MergeFrom(*source); + } +} + +void ProjectorConfig::MergeFrom(const ProjectorConfig& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProjectorConfig) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + embeddings_.MergeFrom(from.embeddings_); + if (from.model_checkpoint_path().size() > 0) { + + model_checkpoint_path_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.model_checkpoint_path_); + } + if (from.model_checkpoint_dir().size() > 0) { + + model_checkpoint_dir_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.model_checkpoint_dir_); + } +} + +void ProjectorConfig::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProjectorConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProjectorConfig::CopyFrom(const ProjectorConfig& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProjectorConfig) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProjectorConfig::IsInitialized() const { + return true; +} + +void ProjectorConfig::Swap(ProjectorConfig* other) { + if (other == this) return; + InternalSwap(other); +} +void ProjectorConfig::InternalSwap(ProjectorConfig* other) { + using std::swap; + CastToBase(&embeddings_)->InternalSwap(CastToBase(&other->embeddings_)); + model_checkpoint_path_.Swap(&other->model_checkpoint_path_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + model_checkpoint_dir_.Swap(&other->model_checkpoint_dir_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProjectorConfig::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::SpriteMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::SpriteMetadata >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::SpriteMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::EmbeddingInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::EmbeddingInfo >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::EmbeddingInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProjectorConfig* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProjectorConfig >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProjectorConfig >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.pb.h new file mode 100644 index 0000000..cd33e80 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.pb.h @@ -0,0 +1,1067 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[3]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto +namespace diplomacy { +namespace tensorflow { +class EmbeddingInfo; +class EmbeddingInfoDefaultTypeInternal; +extern EmbeddingInfoDefaultTypeInternal _EmbeddingInfo_default_instance_; +class ProjectorConfig; +class ProjectorConfigDefaultTypeInternal; +extern ProjectorConfigDefaultTypeInternal _ProjectorConfig_default_instance_; +class SpriteMetadata; +class SpriteMetadataDefaultTypeInternal; +extern SpriteMetadataDefaultTypeInternal _SpriteMetadata_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::EmbeddingInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::EmbeddingInfo>(Arena*); +template<> ::diplomacy::tensorflow::ProjectorConfig* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProjectorConfig>(Arena*); +template<> ::diplomacy::tensorflow::SpriteMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SpriteMetadata>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class SpriteMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SpriteMetadata) */ { + public: + SpriteMetadata(); + virtual ~SpriteMetadata(); + + SpriteMetadata(const SpriteMetadata& from); + + inline SpriteMetadata& operator=(const SpriteMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SpriteMetadata(SpriteMetadata&& from) noexcept + : SpriteMetadata() { + *this = ::std::move(from); + } + + inline SpriteMetadata& operator=(SpriteMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const SpriteMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SpriteMetadata* internal_default_instance() { + return reinterpret_cast( + &_SpriteMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(SpriteMetadata* other); + friend void swap(SpriteMetadata& a, SpriteMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SpriteMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + SpriteMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SpriteMetadata& from); + void MergeFrom(const SpriteMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SpriteMetadata* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated uint32 single_image_dim = 2; + int single_image_dim_size() const; + void clear_single_image_dim(); + static const int kSingleImageDimFieldNumber = 2; + ::google::protobuf::uint32 single_image_dim(int index) const; + void set_single_image_dim(int index, ::google::protobuf::uint32 value); + void add_single_image_dim(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + single_image_dim() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_single_image_dim(); + + // string image_path = 1; + void clear_image_path(); + static const int kImagePathFieldNumber = 1; + const ::std::string& image_path() const; + void set_image_path(const ::std::string& value); + #if LANG_CXX11 + void set_image_path(::std::string&& value); + #endif + void set_image_path(const char* value); + void set_image_path(const char* value, size_t size); + ::std::string* mutable_image_path(); + ::std::string* release_image_path(); + void set_allocated_image_path(::std::string* image_path); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SpriteMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > single_image_dim_; + mutable int _single_image_dim_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr image_path_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class EmbeddingInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.EmbeddingInfo) */ { + public: + EmbeddingInfo(); + virtual ~EmbeddingInfo(); + + EmbeddingInfo(const EmbeddingInfo& from); + + inline EmbeddingInfo& operator=(const EmbeddingInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + EmbeddingInfo(EmbeddingInfo&& from) noexcept + : EmbeddingInfo() { + *this = ::std::move(from); + } + + inline EmbeddingInfo& operator=(EmbeddingInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const EmbeddingInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const EmbeddingInfo* internal_default_instance() { + return reinterpret_cast( + &_EmbeddingInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(EmbeddingInfo* other); + friend void swap(EmbeddingInfo& a, EmbeddingInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline EmbeddingInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + EmbeddingInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const EmbeddingInfo& from); + void MergeFrom(const EmbeddingInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EmbeddingInfo* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated uint32 tensor_shape = 4; + int tensor_shape_size() const; + void clear_tensor_shape(); + static const int kTensorShapeFieldNumber = 4; + ::google::protobuf::uint32 tensor_shape(int index) const; + void set_tensor_shape(int index, ::google::protobuf::uint32 value); + void add_tensor_shape(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + tensor_shape() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_tensor_shape(); + + // string tensor_name = 1; + void clear_tensor_name(); + static const int kTensorNameFieldNumber = 1; + const ::std::string& tensor_name() const; + void set_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_tensor_name(::std::string&& value); + #endif + void set_tensor_name(const char* value); + void set_tensor_name(const char* value, size_t size); + ::std::string* mutable_tensor_name(); + ::std::string* release_tensor_name(); + void set_allocated_tensor_name(::std::string* tensor_name); + + // string metadata_path = 2; + void clear_metadata_path(); + static const int kMetadataPathFieldNumber = 2; + const ::std::string& metadata_path() const; + void set_metadata_path(const ::std::string& value); + #if LANG_CXX11 + void set_metadata_path(::std::string&& value); + #endif + void set_metadata_path(const char* value); + void set_metadata_path(const char* value, size_t size); + ::std::string* mutable_metadata_path(); + ::std::string* release_metadata_path(); + void set_allocated_metadata_path(::std::string* metadata_path); + + // string bookmarks_path = 3; + void clear_bookmarks_path(); + static const int kBookmarksPathFieldNumber = 3; + const ::std::string& bookmarks_path() const; + void set_bookmarks_path(const ::std::string& value); + #if LANG_CXX11 + void set_bookmarks_path(::std::string&& value); + #endif + void set_bookmarks_path(const char* value); + void set_bookmarks_path(const char* value, size_t size); + ::std::string* mutable_bookmarks_path(); + ::std::string* release_bookmarks_path(); + void set_allocated_bookmarks_path(::std::string* bookmarks_path); + + // string tensor_path = 6; + void clear_tensor_path(); + static const int kTensorPathFieldNumber = 6; + const ::std::string& tensor_path() const; + void set_tensor_path(const ::std::string& value); + #if LANG_CXX11 + void set_tensor_path(::std::string&& value); + #endif + void set_tensor_path(const char* value); + void set_tensor_path(const char* value, size_t size); + ::std::string* mutable_tensor_path(); + ::std::string* release_tensor_path(); + void set_allocated_tensor_path(::std::string* tensor_path); + + // .diplomacy.tensorflow.SpriteMetadata sprite = 5; + bool has_sprite() const; + void clear_sprite(); + static const int kSpriteFieldNumber = 5; + private: + const ::diplomacy::tensorflow::SpriteMetadata& _internal_sprite() const; + public: + const ::diplomacy::tensorflow::SpriteMetadata& sprite() const; + ::diplomacy::tensorflow::SpriteMetadata* release_sprite(); + ::diplomacy::tensorflow::SpriteMetadata* mutable_sprite(); + void set_allocated_sprite(::diplomacy::tensorflow::SpriteMetadata* sprite); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EmbeddingInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > tensor_shape_; + mutable int _tensor_shape_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr tensor_name_; + ::google::protobuf::internal::ArenaStringPtr metadata_path_; + ::google::protobuf::internal::ArenaStringPtr bookmarks_path_; + ::google::protobuf::internal::ArenaStringPtr tensor_path_; + ::diplomacy::tensorflow::SpriteMetadata* sprite_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProjectorConfig : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProjectorConfig) */ { + public: + ProjectorConfig(); + virtual ~ProjectorConfig(); + + ProjectorConfig(const ProjectorConfig& from); + + inline ProjectorConfig& operator=(const ProjectorConfig& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProjectorConfig(ProjectorConfig&& from) noexcept + : ProjectorConfig() { + *this = ::std::move(from); + } + + inline ProjectorConfig& operator=(ProjectorConfig&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProjectorConfig& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProjectorConfig* internal_default_instance() { + return reinterpret_cast( + &_ProjectorConfig_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(ProjectorConfig* other); + friend void swap(ProjectorConfig& a, ProjectorConfig& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProjectorConfig* New() const final { + return CreateMaybeMessage(NULL); + } + + ProjectorConfig* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProjectorConfig& from); + void MergeFrom(const ProjectorConfig& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProjectorConfig* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.EmbeddingInfo embeddings = 2; + int embeddings_size() const; + void clear_embeddings(); + static const int kEmbeddingsFieldNumber = 2; + ::diplomacy::tensorflow::EmbeddingInfo* mutable_embeddings(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EmbeddingInfo >* + mutable_embeddings(); + const ::diplomacy::tensorflow::EmbeddingInfo& embeddings(int index) const; + ::diplomacy::tensorflow::EmbeddingInfo* add_embeddings(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EmbeddingInfo >& + embeddings() const; + + // string model_checkpoint_path = 1; + void clear_model_checkpoint_path(); + static const int kModelCheckpointPathFieldNumber = 1; + const ::std::string& model_checkpoint_path() const; + void set_model_checkpoint_path(const ::std::string& value); + #if LANG_CXX11 + void set_model_checkpoint_path(::std::string&& value); + #endif + void set_model_checkpoint_path(const char* value); + void set_model_checkpoint_path(const char* value, size_t size); + ::std::string* mutable_model_checkpoint_path(); + ::std::string* release_model_checkpoint_path(); + void set_allocated_model_checkpoint_path(::std::string* model_checkpoint_path); + + // string model_checkpoint_dir = 3; + void clear_model_checkpoint_dir(); + static const int kModelCheckpointDirFieldNumber = 3; + const ::std::string& model_checkpoint_dir() const; + void set_model_checkpoint_dir(const ::std::string& value); + #if LANG_CXX11 + void set_model_checkpoint_dir(::std::string&& value); + #endif + void set_model_checkpoint_dir(const char* value); + void set_model_checkpoint_dir(const char* value, size_t size); + ::std::string* mutable_model_checkpoint_dir(); + ::std::string* release_model_checkpoint_dir(); + void set_allocated_model_checkpoint_dir(::std::string* model_checkpoint_dir); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProjectorConfig) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EmbeddingInfo > embeddings_; + ::google::protobuf::internal::ArenaStringPtr model_checkpoint_path_; + ::google::protobuf::internal::ArenaStringPtr model_checkpoint_dir_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// SpriteMetadata + +// string image_path = 1; +inline void SpriteMetadata::clear_image_path() { + image_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& SpriteMetadata::image_path() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SpriteMetadata.image_path) + return image_path_.GetNoArena(); +} +inline void SpriteMetadata::set_image_path(const ::std::string& value) { + + image_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SpriteMetadata.image_path) +} +#if LANG_CXX11 +inline void SpriteMetadata::set_image_path(::std::string&& value) { + + image_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SpriteMetadata.image_path) +} +#endif +inline void SpriteMetadata::set_image_path(const char* value) { + GOOGLE_DCHECK(value != NULL); + + image_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SpriteMetadata.image_path) +} +inline void SpriteMetadata::set_image_path(const char* value, size_t size) { + + image_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SpriteMetadata.image_path) +} +inline ::std::string* SpriteMetadata::mutable_image_path() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SpriteMetadata.image_path) + return image_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SpriteMetadata::release_image_path() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SpriteMetadata.image_path) + + return image_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SpriteMetadata::set_allocated_image_path(::std::string* image_path) { + if (image_path != NULL) { + + } else { + + } + image_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), image_path); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SpriteMetadata.image_path) +} + +// repeated uint32 single_image_dim = 2; +inline int SpriteMetadata::single_image_dim_size() const { + return single_image_dim_.size(); +} +inline void SpriteMetadata::clear_single_image_dim() { + single_image_dim_.Clear(); +} +inline ::google::protobuf::uint32 SpriteMetadata::single_image_dim(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SpriteMetadata.single_image_dim) + return single_image_dim_.Get(index); +} +inline void SpriteMetadata::set_single_image_dim(int index, ::google::protobuf::uint32 value) { + single_image_dim_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SpriteMetadata.single_image_dim) +} +inline void SpriteMetadata::add_single_image_dim(::google::protobuf::uint32 value) { + single_image_dim_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.SpriteMetadata.single_image_dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SpriteMetadata::single_image_dim() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.SpriteMetadata.single_image_dim) + return single_image_dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SpriteMetadata::mutable_single_image_dim() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.SpriteMetadata.single_image_dim) + return &single_image_dim_; +} + +// ------------------------------------------------------------------- + +// EmbeddingInfo + +// string tensor_name = 1; +inline void EmbeddingInfo::clear_tensor_name() { + tensor_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EmbeddingInfo::tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EmbeddingInfo.tensor_name) + return tensor_name_.GetNoArena(); +} +inline void EmbeddingInfo::set_tensor_name(const ::std::string& value) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EmbeddingInfo.tensor_name) +} +#if LANG_CXX11 +inline void EmbeddingInfo::set_tensor_name(::std::string&& value) { + + tensor_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EmbeddingInfo.tensor_name) +} +#endif +inline void EmbeddingInfo::set_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EmbeddingInfo.tensor_name) +} +inline void EmbeddingInfo::set_tensor_name(const char* value, size_t size) { + + tensor_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EmbeddingInfo.tensor_name) +} +inline ::std::string* EmbeddingInfo::mutable_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EmbeddingInfo.tensor_name) + return tensor_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EmbeddingInfo::release_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EmbeddingInfo.tensor_name) + + return tensor_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EmbeddingInfo::set_allocated_tensor_name(::std::string* tensor_name) { + if (tensor_name != NULL) { + + } else { + + } + tensor_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EmbeddingInfo.tensor_name) +} + +// string metadata_path = 2; +inline void EmbeddingInfo::clear_metadata_path() { + metadata_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EmbeddingInfo::metadata_path() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EmbeddingInfo.metadata_path) + return metadata_path_.GetNoArena(); +} +inline void EmbeddingInfo::set_metadata_path(const ::std::string& value) { + + metadata_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EmbeddingInfo.metadata_path) +} +#if LANG_CXX11 +inline void EmbeddingInfo::set_metadata_path(::std::string&& value) { + + metadata_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EmbeddingInfo.metadata_path) +} +#endif +inline void EmbeddingInfo::set_metadata_path(const char* value) { + GOOGLE_DCHECK(value != NULL); + + metadata_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EmbeddingInfo.metadata_path) +} +inline void EmbeddingInfo::set_metadata_path(const char* value, size_t size) { + + metadata_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EmbeddingInfo.metadata_path) +} +inline ::std::string* EmbeddingInfo::mutable_metadata_path() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EmbeddingInfo.metadata_path) + return metadata_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EmbeddingInfo::release_metadata_path() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EmbeddingInfo.metadata_path) + + return metadata_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EmbeddingInfo::set_allocated_metadata_path(::std::string* metadata_path) { + if (metadata_path != NULL) { + + } else { + + } + metadata_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), metadata_path); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EmbeddingInfo.metadata_path) +} + +// string bookmarks_path = 3; +inline void EmbeddingInfo::clear_bookmarks_path() { + bookmarks_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EmbeddingInfo::bookmarks_path() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) + return bookmarks_path_.GetNoArena(); +} +inline void EmbeddingInfo::set_bookmarks_path(const ::std::string& value) { + + bookmarks_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) +} +#if LANG_CXX11 +inline void EmbeddingInfo::set_bookmarks_path(::std::string&& value) { + + bookmarks_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) +} +#endif +inline void EmbeddingInfo::set_bookmarks_path(const char* value) { + GOOGLE_DCHECK(value != NULL); + + bookmarks_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) +} +inline void EmbeddingInfo::set_bookmarks_path(const char* value, size_t size) { + + bookmarks_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) +} +inline ::std::string* EmbeddingInfo::mutable_bookmarks_path() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) + return bookmarks_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EmbeddingInfo::release_bookmarks_path() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) + + return bookmarks_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EmbeddingInfo::set_allocated_bookmarks_path(::std::string* bookmarks_path) { + if (bookmarks_path != NULL) { + + } else { + + } + bookmarks_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), bookmarks_path); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EmbeddingInfo.bookmarks_path) +} + +// repeated uint32 tensor_shape = 4; +inline int EmbeddingInfo::tensor_shape_size() const { + return tensor_shape_.size(); +} +inline void EmbeddingInfo::clear_tensor_shape() { + tensor_shape_.Clear(); +} +inline ::google::protobuf::uint32 EmbeddingInfo::tensor_shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EmbeddingInfo.tensor_shape) + return tensor_shape_.Get(index); +} +inline void EmbeddingInfo::set_tensor_shape(int index, ::google::protobuf::uint32 value) { + tensor_shape_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EmbeddingInfo.tensor_shape) +} +inline void EmbeddingInfo::add_tensor_shape(::google::protobuf::uint32 value) { + tensor_shape_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.EmbeddingInfo.tensor_shape) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +EmbeddingInfo::tensor_shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.EmbeddingInfo.tensor_shape) + return tensor_shape_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +EmbeddingInfo::mutable_tensor_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.EmbeddingInfo.tensor_shape) + return &tensor_shape_; +} + +// .diplomacy.tensorflow.SpriteMetadata sprite = 5; +inline bool EmbeddingInfo::has_sprite() const { + return this != internal_default_instance() && sprite_ != NULL; +} +inline void EmbeddingInfo::clear_sprite() { + if (GetArenaNoVirtual() == NULL && sprite_ != NULL) { + delete sprite_; + } + sprite_ = NULL; +} +inline const ::diplomacy::tensorflow::SpriteMetadata& EmbeddingInfo::_internal_sprite() const { + return *sprite_; +} +inline const ::diplomacy::tensorflow::SpriteMetadata& EmbeddingInfo::sprite() const { + const ::diplomacy::tensorflow::SpriteMetadata* p = sprite_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EmbeddingInfo.sprite) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_SpriteMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::SpriteMetadata* EmbeddingInfo::release_sprite() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EmbeddingInfo.sprite) + + ::diplomacy::tensorflow::SpriteMetadata* temp = sprite_; + sprite_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SpriteMetadata* EmbeddingInfo::mutable_sprite() { + + if (sprite_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::SpriteMetadata>(GetArenaNoVirtual()); + sprite_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EmbeddingInfo.sprite) + return sprite_; +} +inline void EmbeddingInfo::set_allocated_sprite(::diplomacy::tensorflow::SpriteMetadata* sprite) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete sprite_; + } + if (sprite) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + sprite = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sprite, submessage_arena); + } + + } else { + + } + sprite_ = sprite; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EmbeddingInfo.sprite) +} + +// string tensor_path = 6; +inline void EmbeddingInfo::clear_tensor_path() { + tensor_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EmbeddingInfo::tensor_path() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EmbeddingInfo.tensor_path) + return tensor_path_.GetNoArena(); +} +inline void EmbeddingInfo::set_tensor_path(const ::std::string& value) { + + tensor_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EmbeddingInfo.tensor_path) +} +#if LANG_CXX11 +inline void EmbeddingInfo::set_tensor_path(::std::string&& value) { + + tensor_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EmbeddingInfo.tensor_path) +} +#endif +inline void EmbeddingInfo::set_tensor_path(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tensor_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EmbeddingInfo.tensor_path) +} +inline void EmbeddingInfo::set_tensor_path(const char* value, size_t size) { + + tensor_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EmbeddingInfo.tensor_path) +} +inline ::std::string* EmbeddingInfo::mutable_tensor_path() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EmbeddingInfo.tensor_path) + return tensor_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EmbeddingInfo::release_tensor_path() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EmbeddingInfo.tensor_path) + + return tensor_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EmbeddingInfo::set_allocated_tensor_path(::std::string* tensor_path) { + if (tensor_path != NULL) { + + } else { + + } + tensor_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_path); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EmbeddingInfo.tensor_path) +} + +// ------------------------------------------------------------------- + +// ProjectorConfig + +// string model_checkpoint_path = 1; +inline void ProjectorConfig::clear_model_checkpoint_path() { + model_checkpoint_path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProjectorConfig::model_checkpoint_path() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) + return model_checkpoint_path_.GetNoArena(); +} +inline void ProjectorConfig::set_model_checkpoint_path(const ::std::string& value) { + + model_checkpoint_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) +} +#if LANG_CXX11 +inline void ProjectorConfig::set_model_checkpoint_path(::std::string&& value) { + + model_checkpoint_path_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) +} +#endif +inline void ProjectorConfig::set_model_checkpoint_path(const char* value) { + GOOGLE_DCHECK(value != NULL); + + model_checkpoint_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) +} +inline void ProjectorConfig::set_model_checkpoint_path(const char* value, size_t size) { + + model_checkpoint_path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) +} +inline ::std::string* ProjectorConfig::mutable_model_checkpoint_path() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) + return model_checkpoint_path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProjectorConfig::release_model_checkpoint_path() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) + + return model_checkpoint_path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProjectorConfig::set_allocated_model_checkpoint_path(::std::string* model_checkpoint_path) { + if (model_checkpoint_path != NULL) { + + } else { + + } + model_checkpoint_path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), model_checkpoint_path); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path) +} + +// repeated .diplomacy.tensorflow.EmbeddingInfo embeddings = 2; +inline int ProjectorConfig::embeddings_size() const { + return embeddings_.size(); +} +inline void ProjectorConfig::clear_embeddings() { + embeddings_.Clear(); +} +inline ::diplomacy::tensorflow::EmbeddingInfo* ProjectorConfig::mutable_embeddings(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProjectorConfig.embeddings) + return embeddings_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EmbeddingInfo >* +ProjectorConfig::mutable_embeddings() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ProjectorConfig.embeddings) + return &embeddings_; +} +inline const ::diplomacy::tensorflow::EmbeddingInfo& ProjectorConfig::embeddings(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProjectorConfig.embeddings) + return embeddings_.Get(index); +} +inline ::diplomacy::tensorflow::EmbeddingInfo* ProjectorConfig::add_embeddings() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ProjectorConfig.embeddings) + return embeddings_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EmbeddingInfo >& +ProjectorConfig::embeddings() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ProjectorConfig.embeddings) + return embeddings_; +} + +// string model_checkpoint_dir = 3; +inline void ProjectorConfig::clear_model_checkpoint_dir() { + model_checkpoint_dir_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProjectorConfig::model_checkpoint_dir() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) + return model_checkpoint_dir_.GetNoArena(); +} +inline void ProjectorConfig::set_model_checkpoint_dir(const ::std::string& value) { + + model_checkpoint_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) +} +#if LANG_CXX11 +inline void ProjectorConfig::set_model_checkpoint_dir(::std::string&& value) { + + model_checkpoint_dir_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) +} +#endif +inline void ProjectorConfig::set_model_checkpoint_dir(const char* value) { + GOOGLE_DCHECK(value != NULL); + + model_checkpoint_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) +} +inline void ProjectorConfig::set_model_checkpoint_dir(const char* value, size_t size) { + + model_checkpoint_dir_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) +} +inline ::std::string* ProjectorConfig::mutable_model_checkpoint_dir() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) + return model_checkpoint_dir_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProjectorConfig::release_model_checkpoint_dir() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) + + return model_checkpoint_dir_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProjectorConfig::set_allocated_model_checkpoint_dir(::std::string* model_checkpoint_dir) { + if (model_checkpoint_dir != NULL) { + + } else { + + } + model_checkpoint_dir_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), model_checkpoint_dir); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftensorboard_2fplugins_2fprojector_2fprojector_5fconfig_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto new file mode 100644 index 0000000..f1b3075 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto @@ -0,0 +1,46 @@ +/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +package diplomacy.tensorflow; + +message SpriteMetadata { + string image_path = 1; + // [width, height] of a single image in the sprite. + repeated uint32 single_image_dim = 2; +} + +message EmbeddingInfo { + string tensor_name = 1; + string metadata_path = 2; + string bookmarks_path = 3; + // Shape of the 2D tensor [N x D]. If missing, it will be inferred from the + // model checkpoint. + repeated uint32 tensor_shape = 4; + SpriteMetadata sprite = 5; + // Path to the TSV file holding the tensor values. If missing, the tensor + // is assumed to be stored in the model checkpoint. + string tensor_path = 6; +} + +message ProjectorConfig { + // Path to the checkpoint file. Use either this or model_checkpoint_dir. + string model_checkpoint_path = 1; + repeated EmbeddingInfo embeddings = 2; + // Path to the checkpoint directory. The directory will be scanned for the + // latest checkpoint file. + string model_checkpoint_dir = 3; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config_pb2.py new file mode 100644 index 0000000..8df9c64 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config_pb2.py @@ -0,0 +1,205 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nQdiplomacy_tensorflow/contrib/tensorboard/plugins/projector/projector_config.proto\x12\x14\x64iplomacy.tensorflow\">\n\x0eSpriteMetadata\x12\x12\n\nimage_path\x18\x01 \x01(\t\x12\x18\n\x10single_image_dim\x18\x02 \x03(\r\"\xb4\x01\n\rEmbeddingInfo\x12\x13\n\x0btensor_name\x18\x01 \x01(\t\x12\x15\n\rmetadata_path\x18\x02 \x01(\t\x12\x16\n\x0e\x62ookmarks_path\x18\x03 \x01(\t\x12\x14\n\x0ctensor_shape\x18\x04 \x03(\r\x12\x34\n\x06sprite\x18\x05 \x01(\x0b\x32$.diplomacy.tensorflow.SpriteMetadata\x12\x13\n\x0btensor_path\x18\x06 \x01(\t\"\x87\x01\n\x0fProjectorConfig\x12\x1d\n\x15model_checkpoint_path\x18\x01 \x01(\t\x12\x37\n\nembeddings\x18\x02 \x03(\x0b\x32#.diplomacy.tensorflow.EmbeddingInfo\x12\x1c\n\x14model_checkpoint_dir\x18\x03 \x01(\tb\x06proto3') +) + + + + +_SPRITEMETADATA = _descriptor.Descriptor( + name='SpriteMetadata', + full_name='diplomacy.tensorflow.SpriteMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='image_path', full_name='diplomacy.tensorflow.SpriteMetadata.image_path', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='single_image_dim', full_name='diplomacy.tensorflow.SpriteMetadata.single_image_dim', index=1, + number=2, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=107, + serialized_end=169, +) + + +_EMBEDDINGINFO = _descriptor.Descriptor( + name='EmbeddingInfo', + full_name='diplomacy.tensorflow.EmbeddingInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tensor_name', full_name='diplomacy.tensorflow.EmbeddingInfo.tensor_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata_path', full_name='diplomacy.tensorflow.EmbeddingInfo.metadata_path', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bookmarks_path', full_name='diplomacy.tensorflow.EmbeddingInfo.bookmarks_path', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_shape', full_name='diplomacy.tensorflow.EmbeddingInfo.tensor_shape', index=3, + number=4, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sprite', full_name='diplomacy.tensorflow.EmbeddingInfo.sprite', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_path', full_name='diplomacy.tensorflow.EmbeddingInfo.tensor_path', index=5, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=172, + serialized_end=352, +) + + +_PROJECTORCONFIG = _descriptor.Descriptor( + name='ProjectorConfig', + full_name='diplomacy.tensorflow.ProjectorConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='model_checkpoint_path', full_name='diplomacy.tensorflow.ProjectorConfig.model_checkpoint_path', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='embeddings', full_name='diplomacy.tensorflow.ProjectorConfig.embeddings', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='model_checkpoint_dir', full_name='diplomacy.tensorflow.ProjectorConfig.model_checkpoint_dir', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=355, + serialized_end=490, +) + +_EMBEDDINGINFO.fields_by_name['sprite'].message_type = _SPRITEMETADATA +_PROJECTORCONFIG.fields_by_name['embeddings'].message_type = _EMBEDDINGINFO +DESCRIPTOR.message_types_by_name['SpriteMetadata'] = _SPRITEMETADATA +DESCRIPTOR.message_types_by_name['EmbeddingInfo'] = _EMBEDDINGINFO +DESCRIPTOR.message_types_by_name['ProjectorConfig'] = _PROJECTORCONFIG +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +SpriteMetadata = _reflection.GeneratedProtocolMessageType('SpriteMetadata', (_message.Message,), dict( + DESCRIPTOR = _SPRITEMETADATA, + __module__ = 'diplomacy_tensorflow.contrib.tensorboard.plugins.projector.projector_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SpriteMetadata) + )) +_sym_db.RegisterMessage(SpriteMetadata) + +EmbeddingInfo = _reflection.GeneratedProtocolMessageType('EmbeddingInfo', (_message.Message,), dict( + DESCRIPTOR = _EMBEDDINGINFO, + __module__ = 'diplomacy_tensorflow.contrib.tensorboard.plugins.projector.projector_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EmbeddingInfo) + )) +_sym_db.RegisterMessage(EmbeddingInfo) + +ProjectorConfig = _reflection.GeneratedProtocolMessageType('ProjectorConfig', (_message.Message,), dict( + DESCRIPTOR = _PROJECTORCONFIG, + __module__ = 'diplomacy_tensorflow.contrib.tensorboard.plugins.projector.projector_config_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProjectorConfig) + )) +_sym_db.RegisterMessage(ProjectorConfig) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.cc new file mode 100644 index 0000000..0f50c01 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.cc @@ -0,0 +1,2789 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto + +#include "diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Metrics; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Node_InstructionCategory; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Node_XLAInstruction_LayoutAnalysis_Dimension; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Node_XLAInstruction; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Node_XLAInstruction_LayoutAnalysis; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Node; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +namespace op_profile { +class ProfileDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Profile_default_instance_; +class Node_InstructionCategoryDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Node_InstructionCategory_default_instance_; +class Node_XLAInstruction_LayoutAnalysis_DimensionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Node_XLAInstruction_LayoutAnalysis_Dimension_default_instance_; +class Node_XLAInstruction_LayoutAnalysisDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Node_XLAInstruction_LayoutAnalysis_default_instance_; +class Node_XLAInstructionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Node_XLAInstruction_default_instance_; +class NodeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* category_; + const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* xla_; +} _Node_default_instance_; +class MetricsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Metrics_default_instance_; +} // namespace op_profile +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto { +static void InitDefaultsProfile() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::op_profile::_Profile_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::op_profile::Profile(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::op_profile::Profile::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Profile = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsProfile}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node.base,}}; + +static void InitDefaultsNode_InstructionCategory() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::op_profile::_Node_InstructionCategory_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Node_InstructionCategory = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsNode_InstructionCategory}, {}}; + +static void InitDefaultsNode_XLAInstruction_LayoutAnalysis_Dimension() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_LayoutAnalysis_Dimension_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Node_XLAInstruction_LayoutAnalysis_Dimension = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsNode_XLAInstruction_LayoutAnalysis_Dimension}, {}}; + +static void InitDefaultsNode_XLAInstruction_LayoutAnalysis() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_LayoutAnalysis_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Node_XLAInstruction_LayoutAnalysis = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNode_XLAInstruction_LayoutAnalysis}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction_LayoutAnalysis_Dimension.base,}}; + +static void InitDefaultsNode_XLAInstruction() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Node_XLAInstruction = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNode_XLAInstruction}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction_LayoutAnalysis.base,}}; + +static void InitDefaultsNode() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::op_profile::_Node_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::op_profile::Node(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::op_profile::Node::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_Node = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsNode}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Metrics.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_InstructionCategory.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction.base,}}; + +static void InitDefaultsMetrics() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::op_profile::_Metrics_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::op_profile::Metrics(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::op_profile::Metrics::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Metrics = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMetrics}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Profile.base); + ::google::protobuf::internal::InitSCC(&scc_info_Node_InstructionCategory.base); + ::google::protobuf::internal::InitSCC(&scc_info_Node_XLAInstruction_LayoutAnalysis_Dimension.base); + ::google::protobuf::internal::InitSCC(&scc_info_Node_XLAInstruction_LayoutAnalysis.base); + ::google::protobuf::internal::InitSCC(&scc_info_Node_XLAInstruction.base); + ::google::protobuf::internal::InitSCC(&scc_info_Node.base); + ::google::protobuf::internal::InitSCC(&scc_info_Metrics.base); +} + +::google::protobuf::Metadata file_level_metadata[7]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Profile, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Profile, by_category_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Profile, by_program_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension, alignment_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension, semantics_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis, dimensions_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction, op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction, expression_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction, provenance_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction, category_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction, layout_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node, metrics_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node, children_), + offsetof(::diplomacy::tensorflow::tpu::op_profile::NodeDefaultTypeInternal, category_), + offsetof(::diplomacy::tensorflow::tpu::op_profile::NodeDefaultTypeInternal, xla_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node, num_children_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Node, contents_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Metrics, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Metrics, time_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Metrics, flops_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Metrics, memory_bandwidth_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Metrics, raw_time_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Metrics, raw_flops_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::op_profile::Metrics, raw_bytes_accessed_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tpu::op_profile::Profile)}, + { 7, -1, sizeof(::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory)}, + { 12, -1, sizeof(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension)}, + { 20, -1, sizeof(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis)}, + { 26, -1, sizeof(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction)}, + { 36, -1, sizeof(::diplomacy::tensorflow::tpu::op_profile::Node)}, + { 48, -1, sizeof(::diplomacy::tensorflow::tpu::op_profile::Metrics)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tpu::op_profile::_Profile_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::op_profile::_Node_InstructionCategory_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_LayoutAnalysis_Dimension_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_LayoutAnalysis_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::op_profile::_Node_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::op_profile::_Metrics_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n:diplomacy_tensorflow/contrib/tpu/profi" + "ler/op_profile.proto\022#diplomacy.tensorfl" + "ow.tpu.op_profile\"\267\001\n\007Profile\022>\n\013by_cate" + "gory\030\001 \001(\0132).diplomacy.tensorflow.tpu.op" + "_profile.Node\022=\n\nby_program\030\004 \001(\0132).dipl" + "omacy.tensorflow.tpu.op_profile.NodeJ\004\010\002" + "\020\003J\004\010\003\020\004R\024by_program_structureR\013per_prog" + "ram\"\322\005\n\004Node\022\014\n\004name\030\001 \001(\t\022=\n\007metrics\030\002 " + "\001(\0132,.diplomacy.tensorflow.tpu.op_profil" + "e.Metrics\022;\n\010children\030\003 \003(\0132).diplomacy." + "tensorflow.tpu.op_profile.Node\022Q\n\010catego" + "ry\030\004 \001(\0132=.diplomacy.tensorflow.tpu.op_p" + "rofile.Node.InstructionCategoryH\000\022G\n\003xla" + "\030\005 \001(\01328.diplomacy.tensorflow.tpu.op_pro" + "file.Node.XLAInstructionH\000\022\024\n\014num_childr" + "en\030\006 \001(\005\032\025\n\023InstructionCategory\032\352\002\n\016XLAI" + "nstruction\022\n\n\002op\030\001 \001(\t\022\022\n\nexpression\030\002 \001" + "(\t\022\022\n\nprovenance\030\003 \001(\t\022\020\n\010category\030\004 \001(\t" + "\022W\n\006layout\030\005 \001(\0132G.diplomacy.tensorflow." + "tpu.op_profile.Node.XLAInstruction.Layou" + "tAnalysis\032\270\001\n\016LayoutAnalysis\022e\n\ndimensio" + "ns\030\001 \003(\0132Q.diplomacy.tensorflow.tpu.op_p" + "rofile.Node.XLAInstruction.LayoutAnalysi" + "s.Dimension\032\?\n\tDimension\022\014\n\004size\030\001 \001(\005\022\021" + "\n\talignment\030\002 \001(\005\022\021\n\tsemantics\030\003 \001(\tB\n\n\010" + "contents\"\201\001\n\007Metrics\022\014\n\004time\030\001 \001(\001\022\r\n\005fl" + "ops\030\002 \001(\001\022\030\n\020memory_bandwidth\030\003 \001(\001\022\020\n\010r" + "aw_time\030\013 \001(\001\022\021\n\traw_flops\030\014 \001(\001\022\032\n\022raw_" + "bytes_accessed\030\r \001(\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1148); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +namespace op_profile { + +// =================================================================== + +void Profile::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::op_profile::_Profile_default_instance_._instance.get_mutable()->by_category_ = const_cast< ::diplomacy::tensorflow::tpu::op_profile::Node*>( + ::diplomacy::tensorflow::tpu::op_profile::Node::internal_default_instance()); + ::diplomacy::tensorflow::tpu::op_profile::_Profile_default_instance_._instance.get_mutable()->by_program_ = const_cast< ::diplomacy::tensorflow::tpu::op_profile::Node*>( + ::diplomacy::tensorflow::tpu::op_profile::Node::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Profile::kByCategoryFieldNumber; +const int Profile::kByProgramFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Profile::Profile() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Profile.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.op_profile.Profile) +} +Profile::Profile(const Profile& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_by_category()) { + by_category_ = new ::diplomacy::tensorflow::tpu::op_profile::Node(*from.by_category_); + } else { + by_category_ = NULL; + } + if (from.has_by_program()) { + by_program_ = new ::diplomacy::tensorflow::tpu::op_profile::Node(*from.by_program_); + } else { + by_program_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.op_profile.Profile) +} + +void Profile::SharedCtor() { + ::memset(&by_category_, 0, static_cast( + reinterpret_cast(&by_program_) - + reinterpret_cast(&by_category_)) + sizeof(by_program_)); +} + +Profile::~Profile() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.op_profile.Profile) + SharedDtor(); +} + +void Profile::SharedDtor() { + if (this != internal_default_instance()) delete by_category_; + if (this != internal_default_instance()) delete by_program_; +} + +void Profile::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Profile::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Profile& Profile::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Profile.base); + return *internal_default_instance(); +} + + +void Profile::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.op_profile.Profile) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && by_category_ != NULL) { + delete by_category_; + } + by_category_ = NULL; + if (GetArenaNoVirtual() == NULL && by_program_ != NULL) { + delete by_program_; + } + by_program_ = NULL; + _internal_metadata_.Clear(); +} + +bool Profile::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.op_profile.Profile) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tpu.op_profile.Node by_category = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_by_category())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.op_profile.Node by_program = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_by_program())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.op_profile.Profile) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.op_profile.Profile) + return false; +#undef DO_ +} + +void Profile::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.op_profile.Profile) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tpu.op_profile.Node by_category = 1; + if (this->has_by_category()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_by_category(), output); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node by_program = 4; + if (this->has_by_program()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_by_program(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.op_profile.Profile) +} + +::google::protobuf::uint8* Profile::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.op_profile.Profile) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tpu.op_profile.Node by_category = 1; + if (this->has_by_category()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_by_category(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node by_program = 4; + if (this->has_by_program()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_by_program(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.op_profile.Profile) + return target; +} + +size_t Profile::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.op_profile.Profile) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.tpu.op_profile.Node by_category = 1; + if (this->has_by_category()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *by_category_); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node by_program = 4; + if (this->has_by_program()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *by_program_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Profile::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Profile) + GOOGLE_DCHECK_NE(&from, this); + const Profile* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.op_profile.Profile) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.op_profile.Profile) + MergeFrom(*source); + } +} + +void Profile::MergeFrom(const Profile& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Profile) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_by_category()) { + mutable_by_category()->::diplomacy::tensorflow::tpu::op_profile::Node::MergeFrom(from.by_category()); + } + if (from.has_by_program()) { + mutable_by_program()->::diplomacy::tensorflow::tpu::op_profile::Node::MergeFrom(from.by_program()); + } +} + +void Profile::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Profile) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Profile::CopyFrom(const Profile& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Profile) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Profile::IsInitialized() const { + return true; +} + +void Profile::Swap(Profile* other) { + if (other == this) return; + InternalSwap(other); +} +void Profile::InternalSwap(Profile* other) { + using std::swap; + swap(by_category_, other->by_category_); + swap(by_program_, other->by_program_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Profile::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Node_InstructionCategory::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Node_InstructionCategory::Node_InstructionCategory() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_InstructionCategory.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) +} +Node_InstructionCategory::Node_InstructionCategory(const Node_InstructionCategory& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) +} + +void Node_InstructionCategory::SharedCtor() { +} + +Node_InstructionCategory::~Node_InstructionCategory() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + SharedDtor(); +} + +void Node_InstructionCategory::SharedDtor() { +} + +void Node_InstructionCategory::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Node_InstructionCategory::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Node_InstructionCategory& Node_InstructionCategory::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_InstructionCategory.base); + return *internal_default_instance(); +} + + +void Node_InstructionCategory::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +bool Node_InstructionCategory::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + return false; +#undef DO_ +} + +void Node_InstructionCategory::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) +} + +::google::protobuf::uint8* Node_InstructionCategory::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + return target; +} + +size_t Node_InstructionCategory::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Node_InstructionCategory::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + GOOGLE_DCHECK_NE(&from, this); + const Node_InstructionCategory* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + MergeFrom(*source); + } +} + +void Node_InstructionCategory::MergeFrom(const Node_InstructionCategory& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void Node_InstructionCategory::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Node_InstructionCategory::CopyFrom(const Node_InstructionCategory& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Node_InstructionCategory::IsInitialized() const { + return true; +} + +void Node_InstructionCategory::Swap(Node_InstructionCategory* other) { + if (other == this) return; + InternalSwap(other); +} +void Node_InstructionCategory::InternalSwap(Node_InstructionCategory* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Node_InstructionCategory::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Node_XLAInstruction_LayoutAnalysis_Dimension::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Node_XLAInstruction_LayoutAnalysis_Dimension::kSizeFieldNumber; +const int Node_XLAInstruction_LayoutAnalysis_Dimension::kAlignmentFieldNumber; +const int Node_XLAInstruction_LayoutAnalysis_Dimension::kSemanticsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Node_XLAInstruction_LayoutAnalysis_Dimension::Node_XLAInstruction_LayoutAnalysis_Dimension() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction_LayoutAnalysis_Dimension.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) +} +Node_XLAInstruction_LayoutAnalysis_Dimension::Node_XLAInstruction_LayoutAnalysis_Dimension(const Node_XLAInstruction_LayoutAnalysis_Dimension& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + semantics_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.semantics().size() > 0) { + semantics_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.semantics_); + } + ::memcpy(&size_, &from.size_, + static_cast(reinterpret_cast(&alignment_) - + reinterpret_cast(&size_)) + sizeof(alignment_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::SharedCtor() { + semantics_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&size_, 0, static_cast( + reinterpret_cast(&alignment_) - + reinterpret_cast(&size_)) + sizeof(alignment_)); +} + +Node_XLAInstruction_LayoutAnalysis_Dimension::~Node_XLAInstruction_LayoutAnalysis_Dimension() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + SharedDtor(); +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::SharedDtor() { + semantics_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Node_XLAInstruction_LayoutAnalysis_Dimension::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Node_XLAInstruction_LayoutAnalysis_Dimension& Node_XLAInstruction_LayoutAnalysis_Dimension::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction_LayoutAnalysis_Dimension.base); + return *internal_default_instance(); +} + + +void Node_XLAInstruction_LayoutAnalysis_Dimension::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + semantics_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&size_, 0, static_cast( + reinterpret_cast(&alignment_) - + reinterpret_cast(&size_)) + sizeof(alignment_)); + _internal_metadata_.Clear(); +} + +bool Node_XLAInstruction_LayoutAnalysis_Dimension::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 size = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &size_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 alignment = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &alignment_))); + } else { + goto handle_unusual; + } + break; + } + + // string semantics = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_semantics())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->semantics().data(), static_cast(this->semantics().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + return false; +#undef DO_ +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 size = 1; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->size(), output); + } + + // int32 alignment = 2; + if (this->alignment() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->alignment(), output); + } + + // string semantics = 3; + if (this->semantics().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->semantics().data(), static_cast(this->semantics().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->semantics(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) +} + +::google::protobuf::uint8* Node_XLAInstruction_LayoutAnalysis_Dimension::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 size = 1; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->size(), target); + } + + // int32 alignment = 2; + if (this->alignment() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->alignment(), target); + } + + // string semantics = 3; + if (this->semantics().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->semantics().data(), static_cast(this->semantics().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->semantics(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + return target; +} + +size_t Node_XLAInstruction_LayoutAnalysis_Dimension::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string semantics = 3; + if (this->semantics().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->semantics()); + } + + // int32 size = 1; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->size()); + } + + // int32 alignment = 2; + if (this->alignment() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->alignment()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + GOOGLE_DCHECK_NE(&from, this); + const Node_XLAInstruction_LayoutAnalysis_Dimension* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + MergeFrom(*source); + } +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::MergeFrom(const Node_XLAInstruction_LayoutAnalysis_Dimension& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.semantics().size() > 0) { + + semantics_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.semantics_); + } + if (from.size() != 0) { + set_size(from.size()); + } + if (from.alignment() != 0) { + set_alignment(from.alignment()); + } +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::CopyFrom(const Node_XLAInstruction_LayoutAnalysis_Dimension& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Node_XLAInstruction_LayoutAnalysis_Dimension::IsInitialized() const { + return true; +} + +void Node_XLAInstruction_LayoutAnalysis_Dimension::Swap(Node_XLAInstruction_LayoutAnalysis_Dimension* other) { + if (other == this) return; + InternalSwap(other); +} +void Node_XLAInstruction_LayoutAnalysis_Dimension::InternalSwap(Node_XLAInstruction_LayoutAnalysis_Dimension* other) { + using std::swap; + semantics_.Swap(&other->semantics_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(size_, other->size_); + swap(alignment_, other->alignment_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Node_XLAInstruction_LayoutAnalysis_Dimension::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Node_XLAInstruction_LayoutAnalysis::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Node_XLAInstruction_LayoutAnalysis::kDimensionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Node_XLAInstruction_LayoutAnalysis::Node_XLAInstruction_LayoutAnalysis() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction_LayoutAnalysis.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) +} +Node_XLAInstruction_LayoutAnalysis::Node_XLAInstruction_LayoutAnalysis(const Node_XLAInstruction_LayoutAnalysis& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dimensions_(from.dimensions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) +} + +void Node_XLAInstruction_LayoutAnalysis::SharedCtor() { +} + +Node_XLAInstruction_LayoutAnalysis::~Node_XLAInstruction_LayoutAnalysis() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + SharedDtor(); +} + +void Node_XLAInstruction_LayoutAnalysis::SharedDtor() { +} + +void Node_XLAInstruction_LayoutAnalysis::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Node_XLAInstruction_LayoutAnalysis::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Node_XLAInstruction_LayoutAnalysis& Node_XLAInstruction_LayoutAnalysis::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction_LayoutAnalysis.base); + return *internal_default_instance(); +} + + +void Node_XLAInstruction_LayoutAnalysis::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dimensions_.Clear(); + _internal_metadata_.Clear(); +} + +bool Node_XLAInstruction_LayoutAnalysis::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension dimensions = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_dimensions())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + return false; +#undef DO_ +} + +void Node_XLAInstruction_LayoutAnalysis::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension dimensions = 1; + for (unsigned int i = 0, + n = static_cast(this->dimensions_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->dimensions(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) +} + +::google::protobuf::uint8* Node_XLAInstruction_LayoutAnalysis::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension dimensions = 1; + for (unsigned int i = 0, + n = static_cast(this->dimensions_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->dimensions(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + return target; +} + +size_t Node_XLAInstruction_LayoutAnalysis::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension dimensions = 1; + { + unsigned int count = static_cast(this->dimensions_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->dimensions(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Node_XLAInstruction_LayoutAnalysis::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + GOOGLE_DCHECK_NE(&from, this); + const Node_XLAInstruction_LayoutAnalysis* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + MergeFrom(*source); + } +} + +void Node_XLAInstruction_LayoutAnalysis::MergeFrom(const Node_XLAInstruction_LayoutAnalysis& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dimensions_.MergeFrom(from.dimensions_); +} + +void Node_XLAInstruction_LayoutAnalysis::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Node_XLAInstruction_LayoutAnalysis::CopyFrom(const Node_XLAInstruction_LayoutAnalysis& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Node_XLAInstruction_LayoutAnalysis::IsInitialized() const { + return true; +} + +void Node_XLAInstruction_LayoutAnalysis::Swap(Node_XLAInstruction_LayoutAnalysis* other) { + if (other == this) return; + InternalSwap(other); +} +void Node_XLAInstruction_LayoutAnalysis::InternalSwap(Node_XLAInstruction_LayoutAnalysis* other) { + using std::swap; + CastToBase(&dimensions_)->InternalSwap(CastToBase(&other->dimensions_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Node_XLAInstruction_LayoutAnalysis::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Node_XLAInstruction::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_default_instance_._instance.get_mutable()->layout_ = const_cast< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis*>( + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Node_XLAInstruction::kOpFieldNumber; +const int Node_XLAInstruction::kExpressionFieldNumber; +const int Node_XLAInstruction::kProvenanceFieldNumber; +const int Node_XLAInstruction::kCategoryFieldNumber; +const int Node_XLAInstruction::kLayoutFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Node_XLAInstruction::Node_XLAInstruction() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) +} +Node_XLAInstruction::Node_XLAInstruction(const Node_XLAInstruction& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.op().size() > 0) { + op_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op_); + } + expression_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.expression().size() > 0) { + expression_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.expression_); + } + provenance_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.provenance().size() > 0) { + provenance_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.provenance_); + } + category_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.category().size() > 0) { + category_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.category_); + } + if (from.has_layout()) { + layout_ = new ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis(*from.layout_); + } else { + layout_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) +} + +void Node_XLAInstruction::SharedCtor() { + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + expression_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + provenance_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + category_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layout_ = NULL; +} + +Node_XLAInstruction::~Node_XLAInstruction() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + SharedDtor(); +} + +void Node_XLAInstruction::SharedDtor() { + op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + expression_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + provenance_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + category_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete layout_; +} + +void Node_XLAInstruction::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Node_XLAInstruction::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Node_XLAInstruction& Node_XLAInstruction::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node_XLAInstruction.base); + return *internal_default_instance(); +} + + +void Node_XLAInstruction::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + op_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + expression_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + provenance_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + category_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && layout_ != NULL) { + delete layout_; + } + layout_ = NULL; + _internal_metadata_.Clear(); +} + +bool Node_XLAInstruction::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string op = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op")); + } else { + goto handle_unusual; + } + break; + } + + // string expression = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_expression())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->expression().data(), static_cast(this->expression().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression")); + } else { + goto handle_unusual; + } + break; + } + + // string provenance = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_provenance())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->provenance().data(), static_cast(this->provenance().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance")); + } else { + goto handle_unusual; + } + break; + } + + // string category = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_category())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->category().data(), static_cast(this->category().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis layout = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_layout())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + return false; +#undef DO_ +} + +void Node_XLAInstruction::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op = 1; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->op(), output); + } + + // string expression = 2; + if (this->expression().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->expression().data(), static_cast(this->expression().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->expression(), output); + } + + // string provenance = 3; + if (this->provenance().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->provenance().data(), static_cast(this->provenance().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->provenance(), output); + } + + // string category = 4; + if (this->category().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->category().data(), static_cast(this->category().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->category(), output); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis layout = 5; + if (this->has_layout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_layout(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) +} + +::google::protobuf::uint8* Node_XLAInstruction::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op = 1; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->op(), target); + } + + // string expression = 2; + if (this->expression().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->expression().data(), static_cast(this->expression().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->expression(), target); + } + + // string provenance = 3; + if (this->provenance().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->provenance().data(), static_cast(this->provenance().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->provenance(), target); + } + + // string category = 4; + if (this->category().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->category().data(), static_cast(this->category().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->category(), target); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis layout = 5; + if (this->has_layout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_layout(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + return target; +} + +size_t Node_XLAInstruction::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string op = 1; + if (this->op().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op()); + } + + // string expression = 2; + if (this->expression().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->expression()); + } + + // string provenance = 3; + if (this->provenance().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->provenance()); + } + + // string category = 4; + if (this->category().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->category()); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis layout = 5; + if (this->has_layout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *layout_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Node_XLAInstruction::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + GOOGLE_DCHECK_NE(&from, this); + const Node_XLAInstruction* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + MergeFrom(*source); + } +} + +void Node_XLAInstruction::MergeFrom(const Node_XLAInstruction& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.op().size() > 0) { + + op_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op_); + } + if (from.expression().size() > 0) { + + expression_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.expression_); + } + if (from.provenance().size() > 0) { + + provenance_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.provenance_); + } + if (from.category().size() > 0) { + + category_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.category_); + } + if (from.has_layout()) { + mutable_layout()->::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis::MergeFrom(from.layout()); + } +} + +void Node_XLAInstruction::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Node_XLAInstruction::CopyFrom(const Node_XLAInstruction& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Node_XLAInstruction::IsInitialized() const { + return true; +} + +void Node_XLAInstruction::Swap(Node_XLAInstruction* other) { + if (other == this) return; + InternalSwap(other); +} +void Node_XLAInstruction::InternalSwap(Node_XLAInstruction* other) { + using std::swap; + op_.Swap(&other->op_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + expression_.Swap(&other->expression_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + provenance_.Swap(&other->provenance_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + category_.Swap(&other->category_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(layout_, other->layout_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Node_XLAInstruction::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Node::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::op_profile::_Node_default_instance_._instance.get_mutable()->metrics_ = const_cast< ::diplomacy::tensorflow::tpu::op_profile::Metrics*>( + ::diplomacy::tensorflow::tpu::op_profile::Metrics::internal_default_instance()); + ::diplomacy::tensorflow::tpu::op_profile::_Node_default_instance_.category_ = const_cast< ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory*>( + ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory::internal_default_instance()); + ::diplomacy::tensorflow::tpu::op_profile::_Node_default_instance_.xla_ = const_cast< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction*>( + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction::internal_default_instance()); +} +void Node::set_allocated_category(::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* category) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_contents(); + if (category) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + category = ::google::protobuf::internal::GetOwnedMessage( + message_arena, category, submessage_arena); + } + set_has_category(); + contents_.category_ = category; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.category) +} +void Node::set_allocated_xla(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* xla) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_contents(); + if (xla) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + xla = ::google::protobuf::internal::GetOwnedMessage( + message_arena, xla, submessage_arena); + } + set_has_xla(); + contents_.xla_ = xla; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.xla) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Node::kNameFieldNumber; +const int Node::kMetricsFieldNumber; +const int Node::kChildrenFieldNumber; +const int Node::kCategoryFieldNumber; +const int Node::kXlaFieldNumber; +const int Node::kNumChildrenFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Node::Node() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.op_profile.Node) +} +Node::Node(const Node& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + children_(from.children_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_metrics()) { + metrics_ = new ::diplomacy::tensorflow::tpu::op_profile::Metrics(*from.metrics_); + } else { + metrics_ = NULL; + } + num_children_ = from.num_children_; + clear_has_contents(); + switch (from.contents_case()) { + case kCategory: { + mutable_category()->::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory::MergeFrom(from.category()); + break; + } + case kXla: { + mutable_xla()->::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction::MergeFrom(from.xla()); + break; + } + case CONTENTS_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.op_profile.Node) +} + +void Node::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&metrics_, 0, static_cast( + reinterpret_cast(&num_children_) - + reinterpret_cast(&metrics_)) + sizeof(num_children_)); + clear_has_contents(); +} + +Node::~Node() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.op_profile.Node) + SharedDtor(); +} + +void Node::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete metrics_; + if (has_contents()) { + clear_contents(); + } +} + +void Node::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Node::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Node& Node::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Node.base); + return *internal_default_instance(); +} + + +void Node::clear_contents() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tpu.op_profile.Node) + switch (contents_case()) { + case kCategory: { + delete contents_.category_; + break; + } + case kXla: { + delete contents_.xla_; + break; + } + case CONTENTS_NOT_SET: { + break; + } + } + _oneof_case_[0] = CONTENTS_NOT_SET; +} + + +void Node::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.op_profile.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + children_.Clear(); + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && metrics_ != NULL) { + delete metrics_; + } + metrics_ = NULL; + num_children_ = 0; + clear_contents(); + _internal_metadata_.Clear(); +} + +bool Node::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.op_profile.Node) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.op_profile.Node.name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.op_profile.Metrics metrics = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_metrics())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.tpu.op_profile.Node children = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_children())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory category = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_category())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction xla = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_xla())); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_children = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_children_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.op_profile.Node) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.op_profile.Node) + return false; +#undef DO_ +} + +void Node::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.op_profile.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // .diplomacy.tensorflow.tpu.op_profile.Metrics metrics = 2; + if (this->has_metrics()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_metrics(), output); + } + + // repeated .diplomacy.tensorflow.tpu.op_profile.Node children = 3; + for (unsigned int i = 0, + n = static_cast(this->children_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->children(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory category = 4; + if (has_category()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_category(), output); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction xla = 5; + if (has_xla()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_xla(), output); + } + + // int32 num_children = 6; + if (this->num_children() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->num_children(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.op_profile.Node) +} + +::google::protobuf::uint8* Node::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.op_profile.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.op_profile.Node.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // .diplomacy.tensorflow.tpu.op_profile.Metrics metrics = 2; + if (this->has_metrics()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_metrics(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.tpu.op_profile.Node children = 3; + for (unsigned int i = 0, + n = static_cast(this->children_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->children(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory category = 4; + if (has_category()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_category(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction xla = 5; + if (has_xla()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_xla(), deterministic, target); + } + + // int32 num_children = 6; + if (this->num_children() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->num_children(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.op_profile.Node) + return target; +} + +size_t Node::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.op_profile.Node) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tpu.op_profile.Node children = 3; + { + unsigned int count = static_cast(this->children_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->children(static_cast(i))); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy.tensorflow.tpu.op_profile.Metrics metrics = 2; + if (this->has_metrics()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *metrics_); + } + + // int32 num_children = 6; + if (this->num_children() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_children()); + } + + switch (contents_case()) { + // .diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory category = 4; + case kCategory: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *contents_.category_); + break; + } + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction xla = 5; + case kXla: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *contents_.xla_); + break; + } + case CONTENTS_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Node::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node) + GOOGLE_DCHECK_NE(&from, this); + const Node* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.op_profile.Node) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.op_profile.Node) + MergeFrom(*source); + } +} + +void Node::MergeFrom(const Node& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Node) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + children_.MergeFrom(from.children_); + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_metrics()) { + mutable_metrics()->::diplomacy::tensorflow::tpu::op_profile::Metrics::MergeFrom(from.metrics()); + } + if (from.num_children() != 0) { + set_num_children(from.num_children()); + } + switch (from.contents_case()) { + case kCategory: { + mutable_category()->::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory::MergeFrom(from.category()); + break; + } + case kXla: { + mutable_xla()->::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction::MergeFrom(from.xla()); + break; + } + case CONTENTS_NOT_SET: { + break; + } + } +} + +void Node::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Node::CopyFrom(const Node& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Node) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Node::IsInitialized() const { + return true; +} + +void Node::Swap(Node* other) { + if (other == this) return; + InternalSwap(other); +} +void Node::InternalSwap(Node* other) { + using std::swap; + CastToBase(&children_)->InternalSwap(CastToBase(&other->children_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(metrics_, other->metrics_); + swap(num_children_, other->num_children_); + swap(contents_, other->contents_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Node::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Metrics::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Metrics::kTimeFieldNumber; +const int Metrics::kFlopsFieldNumber; +const int Metrics::kMemoryBandwidthFieldNumber; +const int Metrics::kRawTimeFieldNumber; +const int Metrics::kRawFlopsFieldNumber; +const int Metrics::kRawBytesAccessedFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Metrics::Metrics() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Metrics.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.op_profile.Metrics) +} +Metrics::Metrics(const Metrics& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&time_, &from.time_, + static_cast(reinterpret_cast(&raw_bytes_accessed_) - + reinterpret_cast(&time_)) + sizeof(raw_bytes_accessed_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.op_profile.Metrics) +} + +void Metrics::SharedCtor() { + ::memset(&time_, 0, static_cast( + reinterpret_cast(&raw_bytes_accessed_) - + reinterpret_cast(&time_)) + sizeof(raw_bytes_accessed_)); +} + +Metrics::~Metrics() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.op_profile.Metrics) + SharedDtor(); +} + +void Metrics::SharedDtor() { +} + +void Metrics::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Metrics::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Metrics& Metrics::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Metrics.base); + return *internal_default_instance(); +} + + +void Metrics::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&time_, 0, static_cast( + reinterpret_cast(&raw_bytes_accessed_) - + reinterpret_cast(&time_)) + sizeof(raw_bytes_accessed_)); + _internal_metadata_.Clear(); +} + +bool Metrics::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // double time = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &time_))); + } else { + goto handle_unusual; + } + break; + } + + // double flops = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &flops_))); + } else { + goto handle_unusual; + } + break; + } + + // double memory_bandwidth = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(25u /* 25 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &memory_bandwidth_))); + } else { + goto handle_unusual; + } + break; + } + + // double raw_time = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(89u /* 89 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &raw_time_))); + } else { + goto handle_unusual; + } + break; + } + + // double raw_flops = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &raw_flops_))); + } else { + goto handle_unusual; + } + break; + } + + // double raw_bytes_accessed = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(105u /* 105 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &raw_bytes_accessed_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.op_profile.Metrics) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.op_profile.Metrics) + return false; +#undef DO_ +} + +void Metrics::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double time = 1; + if (this->time() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->time(), output); + } + + // double flops = 2; + if (this->flops() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->flops(), output); + } + + // double memory_bandwidth = 3; + if (this->memory_bandwidth() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->memory_bandwidth(), output); + } + + // double raw_time = 11; + if (this->raw_time() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(11, this->raw_time(), output); + } + + // double raw_flops = 12; + if (this->raw_flops() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(12, this->raw_flops(), output); + } + + // double raw_bytes_accessed = 13; + if (this->raw_bytes_accessed() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(13, this->raw_bytes_accessed(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.op_profile.Metrics) +} + +::google::protobuf::uint8* Metrics::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double time = 1; + if (this->time() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->time(), target); + } + + // double flops = 2; + if (this->flops() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->flops(), target); + } + + // double memory_bandwidth = 3; + if (this->memory_bandwidth() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(3, this->memory_bandwidth(), target); + } + + // double raw_time = 11; + if (this->raw_time() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(11, this->raw_time(), target); + } + + // double raw_flops = 12; + if (this->raw_flops() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(12, this->raw_flops(), target); + } + + // double raw_bytes_accessed = 13; + if (this->raw_bytes_accessed() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(13, this->raw_bytes_accessed(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.op_profile.Metrics) + return target; +} + +size_t Metrics::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // double time = 1; + if (this->time() != 0) { + total_size += 1 + 8; + } + + // double flops = 2; + if (this->flops() != 0) { + total_size += 1 + 8; + } + + // double memory_bandwidth = 3; + if (this->memory_bandwidth() != 0) { + total_size += 1 + 8; + } + + // double raw_time = 11; + if (this->raw_time() != 0) { + total_size += 1 + 8; + } + + // double raw_flops = 12; + if (this->raw_flops() != 0) { + total_size += 1 + 8; + } + + // double raw_bytes_accessed = 13; + if (this->raw_bytes_accessed() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Metrics::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + GOOGLE_DCHECK_NE(&from, this); + const Metrics* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.op_profile.Metrics) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.op_profile.Metrics) + MergeFrom(*source); + } +} + +void Metrics::MergeFrom(const Metrics& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.time() != 0) { + set_time(from.time()); + } + if (from.flops() != 0) { + set_flops(from.flops()); + } + if (from.memory_bandwidth() != 0) { + set_memory_bandwidth(from.memory_bandwidth()); + } + if (from.raw_time() != 0) { + set_raw_time(from.raw_time()); + } + if (from.raw_flops() != 0) { + set_raw_flops(from.raw_flops()); + } + if (from.raw_bytes_accessed() != 0) { + set_raw_bytes_accessed(from.raw_bytes_accessed()); + } +} + +void Metrics::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Metrics::CopyFrom(const Metrics& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.op_profile.Metrics) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Metrics::IsInitialized() const { + return true; +} + +void Metrics::Swap(Metrics* other) { + if (other == this) return; + InternalSwap(other); +} +void Metrics::InternalSwap(Metrics* other) { + using std::swap; + swap(time_, other->time_); + swap(flops_, other->flops_); + swap(memory_bandwidth_, other->memory_bandwidth_); + swap(raw_time_, other->raw_time_); + swap(raw_flops_, other->raw_flops_); + swap(raw_bytes_accessed_, other->raw_bytes_accessed_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Metrics::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace op_profile +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::op_profile::Profile* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Profile >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::op_profile::Profile >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::op_profile::Node* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Node >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::op_profile::Node >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::op_profile::Metrics* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Metrics >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::op_profile::Metrics >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.h new file mode 100644 index 0000000..12f6679 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.h @@ -0,0 +1,1924 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[7]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +namespace op_profile { +class Metrics; +class MetricsDefaultTypeInternal; +extern MetricsDefaultTypeInternal _Metrics_default_instance_; +class Node; +class NodeDefaultTypeInternal; +extern NodeDefaultTypeInternal _Node_default_instance_; +class Node_InstructionCategory; +class Node_InstructionCategoryDefaultTypeInternal; +extern Node_InstructionCategoryDefaultTypeInternal _Node_InstructionCategory_default_instance_; +class Node_XLAInstruction; +class Node_XLAInstructionDefaultTypeInternal; +extern Node_XLAInstructionDefaultTypeInternal _Node_XLAInstruction_default_instance_; +class Node_XLAInstruction_LayoutAnalysis; +class Node_XLAInstruction_LayoutAnalysisDefaultTypeInternal; +extern Node_XLAInstruction_LayoutAnalysisDefaultTypeInternal _Node_XLAInstruction_LayoutAnalysis_default_instance_; +class Node_XLAInstruction_LayoutAnalysis_Dimension; +class Node_XLAInstruction_LayoutAnalysis_DimensionDefaultTypeInternal; +extern Node_XLAInstruction_LayoutAnalysis_DimensionDefaultTypeInternal _Node_XLAInstruction_LayoutAnalysis_Dimension_default_instance_; +class Profile; +class ProfileDefaultTypeInternal; +extern ProfileDefaultTypeInternal _Profile_default_instance_; +} // namespace op_profile +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tpu::op_profile::Metrics* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Metrics>(Arena*); +template<> ::diplomacy::tensorflow::tpu::op_profile::Node* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node>(Arena*); +template<> ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory>(Arena*); +template<> ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction>(Arena*); +template<> ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis>(Arena*); +template<> ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension>(Arena*); +template<> ::diplomacy::tensorflow::tpu::op_profile::Profile* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Profile>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tpu { +namespace op_profile { + +// =================================================================== + +class Profile : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.op_profile.Profile) */ { + public: + Profile(); + virtual ~Profile(); + + Profile(const Profile& from); + + inline Profile& operator=(const Profile& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Profile(Profile&& from) noexcept + : Profile() { + *this = ::std::move(from); + } + + inline Profile& operator=(Profile&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Profile& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Profile* internal_default_instance() { + return reinterpret_cast( + &_Profile_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Profile* other); + friend void swap(Profile& a, Profile& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Profile* New() const final { + return CreateMaybeMessage(NULL); + } + + Profile* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Profile& from); + void MergeFrom(const Profile& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Profile* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.tpu.op_profile.Node by_category = 1; + bool has_by_category() const; + void clear_by_category(); + static const int kByCategoryFieldNumber = 1; + private: + const ::diplomacy::tensorflow::tpu::op_profile::Node& _internal_by_category() const; + public: + const ::diplomacy::tensorflow::tpu::op_profile::Node& by_category() const; + ::diplomacy::tensorflow::tpu::op_profile::Node* release_by_category(); + ::diplomacy::tensorflow::tpu::op_profile::Node* mutable_by_category(); + void set_allocated_by_category(::diplomacy::tensorflow::tpu::op_profile::Node* by_category); + + // .diplomacy.tensorflow.tpu.op_profile.Node by_program = 4; + bool has_by_program() const; + void clear_by_program(); + static const int kByProgramFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tpu::op_profile::Node& _internal_by_program() const; + public: + const ::diplomacy::tensorflow::tpu::op_profile::Node& by_program() const; + ::diplomacy::tensorflow::tpu::op_profile::Node* release_by_program(); + ::diplomacy::tensorflow::tpu::op_profile::Node* mutable_by_program(); + void set_allocated_by_program(::diplomacy::tensorflow::tpu::op_profile::Node* by_program); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Profile) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::diplomacy::tensorflow::tpu::op_profile::Node* by_category_; + ::diplomacy::tensorflow::tpu::op_profile::Node* by_program_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Node_InstructionCategory : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) */ { + public: + Node_InstructionCategory(); + virtual ~Node_InstructionCategory(); + + Node_InstructionCategory(const Node_InstructionCategory& from); + + inline Node_InstructionCategory& operator=(const Node_InstructionCategory& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Node_InstructionCategory(Node_InstructionCategory&& from) noexcept + : Node_InstructionCategory() { + *this = ::std::move(from); + } + + inline Node_InstructionCategory& operator=(Node_InstructionCategory&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Node_InstructionCategory& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Node_InstructionCategory* internal_default_instance() { + return reinterpret_cast( + &_Node_InstructionCategory_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(Node_InstructionCategory* other); + friend void swap(Node_InstructionCategory& a, Node_InstructionCategory& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Node_InstructionCategory* New() const final { + return CreateMaybeMessage(NULL); + } + + Node_InstructionCategory* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Node_InstructionCategory& from); + void MergeFrom(const Node_InstructionCategory& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Node_InstructionCategory* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Node_XLAInstruction_LayoutAnalysis_Dimension : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) */ { + public: + Node_XLAInstruction_LayoutAnalysis_Dimension(); + virtual ~Node_XLAInstruction_LayoutAnalysis_Dimension(); + + Node_XLAInstruction_LayoutAnalysis_Dimension(const Node_XLAInstruction_LayoutAnalysis_Dimension& from); + + inline Node_XLAInstruction_LayoutAnalysis_Dimension& operator=(const Node_XLAInstruction_LayoutAnalysis_Dimension& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Node_XLAInstruction_LayoutAnalysis_Dimension(Node_XLAInstruction_LayoutAnalysis_Dimension&& from) noexcept + : Node_XLAInstruction_LayoutAnalysis_Dimension() { + *this = ::std::move(from); + } + + inline Node_XLAInstruction_LayoutAnalysis_Dimension& operator=(Node_XLAInstruction_LayoutAnalysis_Dimension&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Node_XLAInstruction_LayoutAnalysis_Dimension& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Node_XLAInstruction_LayoutAnalysis_Dimension* internal_default_instance() { + return reinterpret_cast( + &_Node_XLAInstruction_LayoutAnalysis_Dimension_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(Node_XLAInstruction_LayoutAnalysis_Dimension* other); + friend void swap(Node_XLAInstruction_LayoutAnalysis_Dimension& a, Node_XLAInstruction_LayoutAnalysis_Dimension& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Node_XLAInstruction_LayoutAnalysis_Dimension* New() const final { + return CreateMaybeMessage(NULL); + } + + Node_XLAInstruction_LayoutAnalysis_Dimension* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Node_XLAInstruction_LayoutAnalysis_Dimension& from); + void MergeFrom(const Node_XLAInstruction_LayoutAnalysis_Dimension& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Node_XLAInstruction_LayoutAnalysis_Dimension* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string semantics = 3; + void clear_semantics(); + static const int kSemanticsFieldNumber = 3; + const ::std::string& semantics() const; + void set_semantics(const ::std::string& value); + #if LANG_CXX11 + void set_semantics(::std::string&& value); + #endif + void set_semantics(const char* value); + void set_semantics(const char* value, size_t size); + ::std::string* mutable_semantics(); + ::std::string* release_semantics(); + void set_allocated_semantics(::std::string* semantics); + + // int32 size = 1; + void clear_size(); + static const int kSizeFieldNumber = 1; + ::google::protobuf::int32 size() const; + void set_size(::google::protobuf::int32 value); + + // int32 alignment = 2; + void clear_alignment(); + static const int kAlignmentFieldNumber = 2; + ::google::protobuf::int32 alignment() const; + void set_alignment(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr semantics_; + ::google::protobuf::int32 size_; + ::google::protobuf::int32 alignment_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Node_XLAInstruction_LayoutAnalysis : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) */ { + public: + Node_XLAInstruction_LayoutAnalysis(); + virtual ~Node_XLAInstruction_LayoutAnalysis(); + + Node_XLAInstruction_LayoutAnalysis(const Node_XLAInstruction_LayoutAnalysis& from); + + inline Node_XLAInstruction_LayoutAnalysis& operator=(const Node_XLAInstruction_LayoutAnalysis& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Node_XLAInstruction_LayoutAnalysis(Node_XLAInstruction_LayoutAnalysis&& from) noexcept + : Node_XLAInstruction_LayoutAnalysis() { + *this = ::std::move(from); + } + + inline Node_XLAInstruction_LayoutAnalysis& operator=(Node_XLAInstruction_LayoutAnalysis&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Node_XLAInstruction_LayoutAnalysis& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Node_XLAInstruction_LayoutAnalysis* internal_default_instance() { + return reinterpret_cast( + &_Node_XLAInstruction_LayoutAnalysis_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(Node_XLAInstruction_LayoutAnalysis* other); + friend void swap(Node_XLAInstruction_LayoutAnalysis& a, Node_XLAInstruction_LayoutAnalysis& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Node_XLAInstruction_LayoutAnalysis* New() const final { + return CreateMaybeMessage(NULL); + } + + Node_XLAInstruction_LayoutAnalysis* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Node_XLAInstruction_LayoutAnalysis& from); + void MergeFrom(const Node_XLAInstruction_LayoutAnalysis& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Node_XLAInstruction_LayoutAnalysis* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Node_XLAInstruction_LayoutAnalysis_Dimension Dimension; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension dimensions = 1; + int dimensions_size() const; + void clear_dimensions(); + static const int kDimensionsFieldNumber = 1; + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension* mutable_dimensions(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension >* + mutable_dimensions(); + const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension& dimensions(int index) const; + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension* add_dimensions(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension >& + dimensions() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension > dimensions_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Node_XLAInstruction : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) */ { + public: + Node_XLAInstruction(); + virtual ~Node_XLAInstruction(); + + Node_XLAInstruction(const Node_XLAInstruction& from); + + inline Node_XLAInstruction& operator=(const Node_XLAInstruction& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Node_XLAInstruction(Node_XLAInstruction&& from) noexcept + : Node_XLAInstruction() { + *this = ::std::move(from); + } + + inline Node_XLAInstruction& operator=(Node_XLAInstruction&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Node_XLAInstruction& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Node_XLAInstruction* internal_default_instance() { + return reinterpret_cast( + &_Node_XLAInstruction_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(Node_XLAInstruction* other); + friend void swap(Node_XLAInstruction& a, Node_XLAInstruction& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Node_XLAInstruction* New() const final { + return CreateMaybeMessage(NULL); + } + + Node_XLAInstruction* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Node_XLAInstruction& from); + void MergeFrom(const Node_XLAInstruction& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Node_XLAInstruction* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Node_XLAInstruction_LayoutAnalysis LayoutAnalysis; + + // accessors ------------------------------------------------------- + + // string op = 1; + void clear_op(); + static const int kOpFieldNumber = 1; + const ::std::string& op() const; + void set_op(const ::std::string& value); + #if LANG_CXX11 + void set_op(::std::string&& value); + #endif + void set_op(const char* value); + void set_op(const char* value, size_t size); + ::std::string* mutable_op(); + ::std::string* release_op(); + void set_allocated_op(::std::string* op); + + // string expression = 2; + void clear_expression(); + static const int kExpressionFieldNumber = 2; + const ::std::string& expression() const; + void set_expression(const ::std::string& value); + #if LANG_CXX11 + void set_expression(::std::string&& value); + #endif + void set_expression(const char* value); + void set_expression(const char* value, size_t size); + ::std::string* mutable_expression(); + ::std::string* release_expression(); + void set_allocated_expression(::std::string* expression); + + // string provenance = 3; + void clear_provenance(); + static const int kProvenanceFieldNumber = 3; + const ::std::string& provenance() const; + void set_provenance(const ::std::string& value); + #if LANG_CXX11 + void set_provenance(::std::string&& value); + #endif + void set_provenance(const char* value); + void set_provenance(const char* value, size_t size); + ::std::string* mutable_provenance(); + ::std::string* release_provenance(); + void set_allocated_provenance(::std::string* provenance); + + // string category = 4; + void clear_category(); + static const int kCategoryFieldNumber = 4; + const ::std::string& category() const; + void set_category(const ::std::string& value); + #if LANG_CXX11 + void set_category(::std::string&& value); + #endif + void set_category(const char* value); + void set_category(const char* value, size_t size); + ::std::string* mutable_category(); + ::std::string* release_category(); + void set_allocated_category(::std::string* category); + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis layout = 5; + bool has_layout() const; + void clear_layout(); + static const int kLayoutFieldNumber = 5; + private: + const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis& _internal_layout() const; + public: + const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis& layout() const; + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* release_layout(); + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* mutable_layout(); + void set_allocated_layout(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* layout); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr op_; + ::google::protobuf::internal::ArenaStringPtr expression_; + ::google::protobuf::internal::ArenaStringPtr provenance_; + ::google::protobuf::internal::ArenaStringPtr category_; + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* layout_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Node : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.op_profile.Node) */ { + public: + Node(); + virtual ~Node(); + + Node(const Node& from); + + inline Node& operator=(const Node& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Node(Node&& from) noexcept + : Node() { + *this = ::std::move(from); + } + + inline Node& operator=(Node&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Node& default_instance(); + + enum ContentsCase { + kCategory = 4, + kXla = 5, + CONTENTS_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Node* internal_default_instance() { + return reinterpret_cast( + &_Node_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(Node* other); + friend void swap(Node& a, Node& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Node* New() const final { + return CreateMaybeMessage(NULL); + } + + Node* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Node& from); + void MergeFrom(const Node& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Node* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Node_InstructionCategory InstructionCategory; + typedef Node_XLAInstruction XLAInstruction; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tpu.op_profile.Node children = 3; + int children_size() const; + void clear_children(); + static const int kChildrenFieldNumber = 3; + ::diplomacy::tensorflow::tpu::op_profile::Node* mutable_children(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node >* + mutable_children(); + const ::diplomacy::tensorflow::tpu::op_profile::Node& children(int index) const; + ::diplomacy::tensorflow::tpu::op_profile::Node* add_children(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node >& + children() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // .diplomacy.tensorflow.tpu.op_profile.Metrics metrics = 2; + bool has_metrics() const; + void clear_metrics(); + static const int kMetricsFieldNumber = 2; + private: + const ::diplomacy::tensorflow::tpu::op_profile::Metrics& _internal_metrics() const; + public: + const ::diplomacy::tensorflow::tpu::op_profile::Metrics& metrics() const; + ::diplomacy::tensorflow::tpu::op_profile::Metrics* release_metrics(); + ::diplomacy::tensorflow::tpu::op_profile::Metrics* mutable_metrics(); + void set_allocated_metrics(::diplomacy::tensorflow::tpu::op_profile::Metrics* metrics); + + // int32 num_children = 6; + void clear_num_children(); + static const int kNumChildrenFieldNumber = 6; + ::google::protobuf::int32 num_children() const; + void set_num_children(::google::protobuf::int32 value); + + // .diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory category = 4; + bool has_category() const; + void clear_category(); + static const int kCategoryFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory& _internal_category() const; + public: + const ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory& category() const; + ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* release_category(); + ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* mutable_category(); + void set_allocated_category(::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* category); + + // .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction xla = 5; + bool has_xla() const; + void clear_xla(); + static const int kXlaFieldNumber = 5; + private: + const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction& _internal_xla() const; + public: + const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction& xla() const; + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* release_xla(); + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* mutable_xla(); + void set_allocated_xla(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* xla); + + void clear_contents(); + ContentsCase contents_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node) + private: + void set_has_category(); + void set_has_xla(); + + inline bool has_contents() const; + inline void clear_has_contents(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node > children_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::diplomacy::tensorflow::tpu::op_profile::Metrics* metrics_; + ::google::protobuf::int32 num_children_; + union ContentsUnion { + ContentsUnion() {} + ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* category_; + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* xla_; + } contents_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Metrics : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.op_profile.Metrics) */ { + public: + Metrics(); + virtual ~Metrics(); + + Metrics(const Metrics& from); + + inline Metrics& operator=(const Metrics& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Metrics(Metrics&& from) noexcept + : Metrics() { + *this = ::std::move(from); + } + + inline Metrics& operator=(Metrics&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Metrics& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Metrics* internal_default_instance() { + return reinterpret_cast( + &_Metrics_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(Metrics* other); + friend void swap(Metrics& a, Metrics& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Metrics* New() const final { + return CreateMaybeMessage(NULL); + } + + Metrics* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Metrics& from); + void MergeFrom(const Metrics& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Metrics* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // double time = 1; + void clear_time(); + static const int kTimeFieldNumber = 1; + double time() const; + void set_time(double value); + + // double flops = 2; + void clear_flops(); + static const int kFlopsFieldNumber = 2; + double flops() const; + void set_flops(double value); + + // double memory_bandwidth = 3; + void clear_memory_bandwidth(); + static const int kMemoryBandwidthFieldNumber = 3; + double memory_bandwidth() const; + void set_memory_bandwidth(double value); + + // double raw_time = 11; + void clear_raw_time(); + static const int kRawTimeFieldNumber = 11; + double raw_time() const; + void set_raw_time(double value); + + // double raw_flops = 12; + void clear_raw_flops(); + static const int kRawFlopsFieldNumber = 12; + double raw_flops() const; + void set_raw_flops(double value); + + // double raw_bytes_accessed = 13; + void clear_raw_bytes_accessed(); + static const int kRawBytesAccessedFieldNumber = 13; + double raw_bytes_accessed() const; + void set_raw_bytes_accessed(double value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Metrics) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + double time_; + double flops_; + double memory_bandwidth_; + double raw_time_; + double raw_flops_; + double raw_bytes_accessed_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Profile + +// .diplomacy.tensorflow.tpu.op_profile.Node by_category = 1; +inline bool Profile::has_by_category() const { + return this != internal_default_instance() && by_category_ != NULL; +} +inline void Profile::clear_by_category() { + if (GetArenaNoVirtual() == NULL && by_category_ != NULL) { + delete by_category_; + } + by_category_ = NULL; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node& Profile::_internal_by_category() const { + return *by_category_; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node& Profile::by_category() const { + const ::diplomacy::tensorflow::tpu::op_profile::Node* p = by_category_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Profile.by_category) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::op_profile::_Node_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node* Profile::release_by_category() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Profile.by_category) + + ::diplomacy::tensorflow::tpu::op_profile::Node* temp = by_category_; + by_category_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node* Profile::mutable_by_category() { + + if (by_category_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node>(GetArenaNoVirtual()); + by_category_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Profile.by_category) + return by_category_; +} +inline void Profile::set_allocated_by_category(::diplomacy::tensorflow::tpu::op_profile::Node* by_category) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete by_category_; + } + if (by_category) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + by_category = ::google::protobuf::internal::GetOwnedMessage( + message_arena, by_category, submessage_arena); + } + + } else { + + } + by_category_ = by_category; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Profile.by_category) +} + +// .diplomacy.tensorflow.tpu.op_profile.Node by_program = 4; +inline bool Profile::has_by_program() const { + return this != internal_default_instance() && by_program_ != NULL; +} +inline void Profile::clear_by_program() { + if (GetArenaNoVirtual() == NULL && by_program_ != NULL) { + delete by_program_; + } + by_program_ = NULL; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node& Profile::_internal_by_program() const { + return *by_program_; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node& Profile::by_program() const { + const ::diplomacy::tensorflow::tpu::op_profile::Node* p = by_program_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Profile.by_program) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::op_profile::_Node_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node* Profile::release_by_program() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Profile.by_program) + + ::diplomacy::tensorflow::tpu::op_profile::Node* temp = by_program_; + by_program_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node* Profile::mutable_by_program() { + + if (by_program_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node>(GetArenaNoVirtual()); + by_program_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Profile.by_program) + return by_program_; +} +inline void Profile::set_allocated_by_program(::diplomacy::tensorflow::tpu::op_profile::Node* by_program) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete by_program_; + } + if (by_program) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + by_program = ::google::protobuf::internal::GetOwnedMessage( + message_arena, by_program, submessage_arena); + } + + } else { + + } + by_program_ = by_program; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Profile.by_program) +} + +// ------------------------------------------------------------------- + +// Node_InstructionCategory + +// ------------------------------------------------------------------- + +// Node_XLAInstruction_LayoutAnalysis_Dimension + +// int32 size = 1; +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::clear_size() { + size_ = 0; +} +inline ::google::protobuf::int32 Node_XLAInstruction_LayoutAnalysis_Dimension::size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.size) + return size_; +} +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::set_size(::google::protobuf::int32 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.size) +} + +// int32 alignment = 2; +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::clear_alignment() { + alignment_ = 0; +} +inline ::google::protobuf::int32 Node_XLAInstruction_LayoutAnalysis_Dimension::alignment() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.alignment) + return alignment_; +} +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::set_alignment(::google::protobuf::int32 value) { + + alignment_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.alignment) +} + +// string semantics = 3; +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::clear_semantics() { + semantics_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Node_XLAInstruction_LayoutAnalysis_Dimension::semantics() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) + return semantics_.GetNoArena(); +} +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::set_semantics(const ::std::string& value) { + + semantics_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) +} +#if LANG_CXX11 +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::set_semantics(::std::string&& value) { + + semantics_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) +} +#endif +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::set_semantics(const char* value) { + GOOGLE_DCHECK(value != NULL); + + semantics_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) +} +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::set_semantics(const char* value, size_t size) { + + semantics_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) +} +inline ::std::string* Node_XLAInstruction_LayoutAnalysis_Dimension::mutable_semantics() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) + return semantics_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Node_XLAInstruction_LayoutAnalysis_Dimension::release_semantics() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) + + return semantics_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Node_XLAInstruction_LayoutAnalysis_Dimension::set_allocated_semantics(::std::string* semantics) { + if (semantics != NULL) { + + } else { + + } + semantics_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), semantics); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics) +} + +// ------------------------------------------------------------------- + +// Node_XLAInstruction_LayoutAnalysis + +// repeated .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension dimensions = 1; +inline int Node_XLAInstruction_LayoutAnalysis::dimensions_size() const { + return dimensions_.size(); +} +inline void Node_XLAInstruction_LayoutAnalysis::clear_dimensions() { + dimensions_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension* Node_XLAInstruction_LayoutAnalysis::mutable_dimensions(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.dimensions) + return dimensions_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension >* +Node_XLAInstruction_LayoutAnalysis::mutable_dimensions() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.dimensions) + return &dimensions_; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension& Node_XLAInstruction_LayoutAnalysis::dimensions(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.dimensions) + return dimensions_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension* Node_XLAInstruction_LayoutAnalysis::add_dimensions() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.dimensions) + return dimensions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis_Dimension >& +Node_XLAInstruction_LayoutAnalysis::dimensions() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.dimensions) + return dimensions_; +} + +// ------------------------------------------------------------------- + +// Node_XLAInstruction + +// string op = 1; +inline void Node_XLAInstruction::clear_op() { + op_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Node_XLAInstruction::op() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) + return op_.GetNoArena(); +} +inline void Node_XLAInstruction::set_op(const ::std::string& value) { + + op_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) +} +#if LANG_CXX11 +inline void Node_XLAInstruction::set_op(::std::string&& value) { + + op_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) +} +#endif +inline void Node_XLAInstruction::set_op(const char* value) { + GOOGLE_DCHECK(value != NULL); + + op_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) +} +inline void Node_XLAInstruction::set_op(const char* value, size_t size) { + + op_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) +} +inline ::std::string* Node_XLAInstruction::mutable_op() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) + return op_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Node_XLAInstruction::release_op() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) + + return op_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Node_XLAInstruction::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op) +} + +// string expression = 2; +inline void Node_XLAInstruction::clear_expression() { + expression_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Node_XLAInstruction::expression() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) + return expression_.GetNoArena(); +} +inline void Node_XLAInstruction::set_expression(const ::std::string& value) { + + expression_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) +} +#if LANG_CXX11 +inline void Node_XLAInstruction::set_expression(::std::string&& value) { + + expression_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) +} +#endif +inline void Node_XLAInstruction::set_expression(const char* value) { + GOOGLE_DCHECK(value != NULL); + + expression_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) +} +inline void Node_XLAInstruction::set_expression(const char* value, size_t size) { + + expression_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) +} +inline ::std::string* Node_XLAInstruction::mutable_expression() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) + return expression_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Node_XLAInstruction::release_expression() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) + + return expression_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Node_XLAInstruction::set_allocated_expression(::std::string* expression) { + if (expression != NULL) { + + } else { + + } + expression_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), expression); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression) +} + +// string provenance = 3; +inline void Node_XLAInstruction::clear_provenance() { + provenance_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Node_XLAInstruction::provenance() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) + return provenance_.GetNoArena(); +} +inline void Node_XLAInstruction::set_provenance(const ::std::string& value) { + + provenance_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) +} +#if LANG_CXX11 +inline void Node_XLAInstruction::set_provenance(::std::string&& value) { + + provenance_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) +} +#endif +inline void Node_XLAInstruction::set_provenance(const char* value) { + GOOGLE_DCHECK(value != NULL); + + provenance_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) +} +inline void Node_XLAInstruction::set_provenance(const char* value, size_t size) { + + provenance_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) +} +inline ::std::string* Node_XLAInstruction::mutable_provenance() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) + return provenance_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Node_XLAInstruction::release_provenance() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) + + return provenance_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Node_XLAInstruction::set_allocated_provenance(::std::string* provenance) { + if (provenance != NULL) { + + } else { + + } + provenance_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), provenance); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance) +} + +// string category = 4; +inline void Node_XLAInstruction::clear_category() { + category_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Node_XLAInstruction::category() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) + return category_.GetNoArena(); +} +inline void Node_XLAInstruction::set_category(const ::std::string& value) { + + category_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) +} +#if LANG_CXX11 +inline void Node_XLAInstruction::set_category(::std::string&& value) { + + category_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) +} +#endif +inline void Node_XLAInstruction::set_category(const char* value) { + GOOGLE_DCHECK(value != NULL); + + category_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) +} +inline void Node_XLAInstruction::set_category(const char* value, size_t size) { + + category_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) +} +inline ::std::string* Node_XLAInstruction::mutable_category() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) + return category_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Node_XLAInstruction::release_category() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) + + return category_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Node_XLAInstruction::set_allocated_category(::std::string* category) { + if (category != NULL) { + + } else { + + } + category_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), category); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category) +} + +// .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis layout = 5; +inline bool Node_XLAInstruction::has_layout() const { + return this != internal_default_instance() && layout_ != NULL; +} +inline void Node_XLAInstruction::clear_layout() { + if (GetArenaNoVirtual() == NULL && layout_ != NULL) { + delete layout_; + } + layout_ = NULL; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis& Node_XLAInstruction::_internal_layout() const { + return *layout_; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis& Node_XLAInstruction::layout() const { + const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* p = layout_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.layout) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_LayoutAnalysis_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* Node_XLAInstruction::release_layout() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.layout) + + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* temp = layout_; + layout_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* Node_XLAInstruction::mutable_layout() { + + if (layout_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis>(GetArenaNoVirtual()); + layout_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.layout) + return layout_; +} +inline void Node_XLAInstruction::set_allocated_layout(::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction_LayoutAnalysis* layout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete layout_; + } + if (layout) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + layout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, layout, submessage_arena); + } + + } else { + + } + layout_ = layout; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.layout) +} + +// ------------------------------------------------------------------- + +// Node + +// string name = 1; +inline void Node::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Node::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.name) + return name_.GetNoArena(); +} +inline void Node::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.name) +} +#if LANG_CXX11 +inline void Node::set_name(::std::string&& value) { + + name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.op_profile.Node.name) +} +#endif +inline void Node::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.op_profile.Node.name) +} +inline void Node::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.op_profile.Node.name) +} +inline ::std::string* Node::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Node::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Node::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.name) +} + +// .diplomacy.tensorflow.tpu.op_profile.Metrics metrics = 2; +inline bool Node::has_metrics() const { + return this != internal_default_instance() && metrics_ != NULL; +} +inline void Node::clear_metrics() { + if (GetArenaNoVirtual() == NULL && metrics_ != NULL) { + delete metrics_; + } + metrics_ = NULL; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Metrics& Node::_internal_metrics() const { + return *metrics_; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Metrics& Node::metrics() const { + const ::diplomacy::tensorflow::tpu::op_profile::Metrics* p = metrics_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.metrics) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::op_profile::_Metrics_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Metrics* Node::release_metrics() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.metrics) + + ::diplomacy::tensorflow::tpu::op_profile::Metrics* temp = metrics_; + metrics_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::op_profile::Metrics* Node::mutable_metrics() { + + if (metrics_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Metrics>(GetArenaNoVirtual()); + metrics_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.metrics) + return metrics_; +} +inline void Node::set_allocated_metrics(::diplomacy::tensorflow::tpu::op_profile::Metrics* metrics) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete metrics_; + } + if (metrics) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + metrics = ::google::protobuf::internal::GetOwnedMessage( + message_arena, metrics, submessage_arena); + } + + } else { + + } + metrics_ = metrics; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.op_profile.Node.metrics) +} + +// repeated .diplomacy.tensorflow.tpu.op_profile.Node children = 3; +inline int Node::children_size() const { + return children_.size(); +} +inline void Node::clear_children() { + children_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node* Node::mutable_children(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.children) + return children_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node >* +Node::mutable_children() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.op_profile.Node.children) + return &children_; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node& Node::children(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.children) + return children_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node* Node::add_children() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.op_profile.Node.children) + return children_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::op_profile::Node >& +Node::children() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.op_profile.Node.children) + return children_; +} + +// .diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory category = 4; +inline bool Node::has_category() const { + return contents_case() == kCategory; +} +inline void Node::set_has_category() { + _oneof_case_[0] = kCategory; +} +inline void Node::clear_category() { + if (has_category()) { + delete contents_.category_; + clear_has_contents(); + } +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory& Node::_internal_category() const { + return *contents_.category_; +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* Node::release_category() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.category) + if (has_category()) { + clear_has_contents(); + ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* temp = contents_.category_; + contents_.category_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory& Node::category() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.category) + return has_category() + ? *contents_.category_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory*>(&::diplomacy::tensorflow::tpu::op_profile::_Node_InstructionCategory_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory* Node::mutable_category() { + if (!has_category()) { + clear_contents(); + set_has_category(); + contents_.category_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Node_InstructionCategory >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.category) + return contents_.category_; +} + +// .diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction xla = 5; +inline bool Node::has_xla() const { + return contents_case() == kXla; +} +inline void Node::set_has_xla() { + _oneof_case_[0] = kXla; +} +inline void Node::clear_xla() { + if (has_xla()) { + delete contents_.xla_; + clear_has_contents(); + } +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction& Node::_internal_xla() const { + return *contents_.xla_; +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* Node::release_xla() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.op_profile.Node.xla) + if (has_xla()) { + clear_has_contents(); + ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* temp = contents_.xla_; + contents_.xla_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction& Node::xla() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.xla) + return has_xla() + ? *contents_.xla_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction*>(&::diplomacy::tensorflow::tpu::op_profile::_Node_XLAInstruction_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction* Node::mutable_xla() { + if (!has_xla()) { + clear_contents(); + set_has_xla(); + contents_.xla_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::op_profile::Node_XLAInstruction >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.op_profile.Node.xla) + return contents_.xla_; +} + +// int32 num_children = 6; +inline void Node::clear_num_children() { + num_children_ = 0; +} +inline ::google::protobuf::int32 Node::num_children() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Node.num_children) + return num_children_; +} +inline void Node::set_num_children(::google::protobuf::int32 value) { + + num_children_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Node.num_children) +} + +inline bool Node::has_contents() const { + return contents_case() != CONTENTS_NOT_SET; +} +inline void Node::clear_has_contents() { + _oneof_case_[0] = CONTENTS_NOT_SET; +} +inline Node::ContentsCase Node::contents_case() const { + return Node::ContentsCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Metrics + +// double time = 1; +inline void Metrics::clear_time() { + time_ = 0; +} +inline double Metrics::time() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Metrics.time) + return time_; +} +inline void Metrics::set_time(double value) { + + time_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Metrics.time) +} + +// double flops = 2; +inline void Metrics::clear_flops() { + flops_ = 0; +} +inline double Metrics::flops() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Metrics.flops) + return flops_; +} +inline void Metrics::set_flops(double value) { + + flops_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Metrics.flops) +} + +// double memory_bandwidth = 3; +inline void Metrics::clear_memory_bandwidth() { + memory_bandwidth_ = 0; +} +inline double Metrics::memory_bandwidth() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Metrics.memory_bandwidth) + return memory_bandwidth_; +} +inline void Metrics::set_memory_bandwidth(double value) { + + memory_bandwidth_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Metrics.memory_bandwidth) +} + +// double raw_time = 11; +inline void Metrics::clear_raw_time() { + raw_time_ = 0; +} +inline double Metrics::raw_time() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Metrics.raw_time) + return raw_time_; +} +inline void Metrics::set_raw_time(double value) { + + raw_time_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Metrics.raw_time) +} + +// double raw_flops = 12; +inline void Metrics::clear_raw_flops() { + raw_flops_ = 0; +} +inline double Metrics::raw_flops() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Metrics.raw_flops) + return raw_flops_; +} +inline void Metrics::set_raw_flops(double value) { + + raw_flops_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Metrics.raw_flops) +} + +// double raw_bytes_accessed = 13; +inline void Metrics::clear_raw_bytes_accessed() { + raw_bytes_accessed_ = 0; +} +inline double Metrics::raw_bytes_accessed() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.op_profile.Metrics.raw_bytes_accessed) + return raw_bytes_accessed_; +} +inline void Metrics::set_raw_bytes_accessed(double value) { + + raw_bytes_accessed_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.op_profile.Metrics.raw_bytes_accessed) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace op_profile +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto new file mode 100644 index 0000000..f548ecb --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tpu.op_profile; + +// Profile is the top-level data that summarizes a program. +message Profile { + reserved 2; + reserved "by_program_structure"; + reserved 3; + reserved "per_program"; + // Root of a profile broken down by instruction category. + Node by_category = 1; + // Root of a profile broken down by program. + Node by_program = 4; +} + +// An entry in the profile tree. (An instruction, or set of instructions). +message Node { + string name = 1; // Semantics depend on contents. + Metrics metrics = 2; // May be omitted e.g. for fused instructions. + repeated Node children = 3; // Subjected to pruning. + + // Details about what this node represents. + oneof contents { + InstructionCategory category = 4; + XLAInstruction xla = 5; + } + + int32 num_children = 6; // Total number of children before pruning. + // A category of XLA instructions. + // name is a descriptive string, like "data formatting". + message InstructionCategory { + } + // A single XLA instruction. + // name is the unique instruction id, like "%multiply.5". + message XLAInstruction { + string op = 1; // Opcode like %multiply + string expression = 2; // %multiply = [shape]multiply(operand1, operand2) + string provenance = 3; // Typically the TensorFlow operation name. + string category = 4; + // Describes the physical memory layout of the instruction's primary input. + // e.g. for a convolution, this analyzes the image and ignores the kernel. + LayoutAnalysis layout = 5; + message LayoutAnalysis { + // The physical data layout, from most-minor to most-major dimensions. + repeated Dimension dimensions = 1; + message Dimension { + int32 size = 1; // Size of the data in this dimension. + int32 alignment = 2; // Data must be padded to a multiple of alignment. + string semantics = 3; // What the dimension represents, e.g. "spatial". + } + } + } +} + +// Measurements of an operation (or aggregated set of operations). +// Metrics are always "total" rather than "self". +message Metrics { + // Core-time taken by this operation, as a fraction of all operations. + double time = 1; + // Floating point computations performed by this operation, as a fraction of + // peak core FLOPS * program time. This representation has useful properties: + // - it is proportional to the number of floating point operations performed + // - utilization is flops/time + // - wasted potential flops is proportional to time - flops + // - it does not reveal the peak core FLOPS of the hardware + double flops = 2; + + // The memory bandwidth used to load operands, as a fraction of + // thereotical memory bandwidth on the specific hardware. + double memory_bandwidth = 3; + + double raw_time = 11; // Elapsed core-time in picoseconds. + double raw_flops = 12; // Total floating-point operations performed. + double raw_bytes_accessed = 13; // Total bytes accessed (include read/write). +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile_pb2.py new file mode 100644 index 0000000..66f37d9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/op_profile_pb2.py @@ -0,0 +1,432 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto', + package='diplomacy.tensorflow.tpu.op_profile', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n:diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto\x12#diplomacy.tensorflow.tpu.op_profile\"\xb7\x01\n\x07Profile\x12>\n\x0b\x62y_category\x18\x01 \x01(\x0b\x32).diplomacy.tensorflow.tpu.op_profile.Node\x12=\n\nby_program\x18\x04 \x01(\x0b\x32).diplomacy.tensorflow.tpu.op_profile.NodeJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04R\x14\x62y_program_structureR\x0bper_program\"\xd2\x05\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x12=\n\x07metrics\x18\x02 \x01(\x0b\x32,.diplomacy.tensorflow.tpu.op_profile.Metrics\x12;\n\x08\x63hildren\x18\x03 \x03(\x0b\x32).diplomacy.tensorflow.tpu.op_profile.Node\x12Q\n\x08\x63\x61tegory\x18\x04 \x01(\x0b\x32=.diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategoryH\x00\x12G\n\x03xla\x18\x05 \x01(\x0b\x32\x38.diplomacy.tensorflow.tpu.op_profile.Node.XLAInstructionH\x00\x12\x14\n\x0cnum_children\x18\x06 \x01(\x05\x1a\x15\n\x13InstructionCategory\x1a\xea\x02\n\x0eXLAInstruction\x12\n\n\x02op\x18\x01 \x01(\t\x12\x12\n\nexpression\x18\x02 \x01(\t\x12\x12\n\nprovenance\x18\x03 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x04 \x01(\t\x12W\n\x06layout\x18\x05 \x01(\x0b\x32G.diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis\x1a\xb8\x01\n\x0eLayoutAnalysis\x12\x65\n\ndimensions\x18\x01 \x03(\x0b\x32Q.diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension\x1a?\n\tDimension\x12\x0c\n\x04size\x18\x01 \x01(\x05\x12\x11\n\talignment\x18\x02 \x01(\x05\x12\x11\n\tsemantics\x18\x03 \x01(\tB\n\n\x08\x63ontents\"\x81\x01\n\x07Metrics\x12\x0c\n\x04time\x18\x01 \x01(\x01\x12\r\n\x05\x66lops\x18\x02 \x01(\x01\x12\x18\n\x10memory_bandwidth\x18\x03 \x01(\x01\x12\x10\n\x08raw_time\x18\x0b \x01(\x01\x12\x11\n\traw_flops\x18\x0c \x01(\x01\x12\x1a\n\x12raw_bytes_accessed\x18\r \x01(\x01\x62\x06proto3') +) + + + + +_PROFILE = _descriptor.Descriptor( + name='Profile', + full_name='diplomacy.tensorflow.tpu.op_profile.Profile', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='by_category', full_name='diplomacy.tensorflow.tpu.op_profile.Profile.by_category', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='by_program', full_name='diplomacy.tensorflow.tpu.op_profile.Profile.by_program', index=1, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=100, + serialized_end=283, +) + + +_NODE_INSTRUCTIONCATEGORY = _descriptor.Descriptor( + name='InstructionCategory', + full_name='diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=610, + serialized_end=631, +) + +_NODE_XLAINSTRUCTION_LAYOUTANALYSIS_DIMENSION = _descriptor.Descriptor( + name='Dimension', + full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='size', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.size', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='alignment', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.alignment', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='semantics', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension.semantics', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=933, + serialized_end=996, +) + +_NODE_XLAINSTRUCTION_LAYOUTANALYSIS = _descriptor.Descriptor( + name='LayoutAnalysis', + full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dimensions', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.dimensions', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_NODE_XLAINSTRUCTION_LAYOUTANALYSIS_DIMENSION, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=812, + serialized_end=996, +) + +_NODE_XLAINSTRUCTION = _descriptor.Descriptor( + name='XLAInstruction', + full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.op', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='expression', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.expression', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='provenance', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.provenance', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='category', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.category', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='layout', full_name='diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.layout', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_NODE_XLAINSTRUCTION_LAYOUTANALYSIS, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=634, + serialized_end=996, +) + +_NODE = _descriptor.Descriptor( + name='Node', + full_name='diplomacy.tensorflow.tpu.op_profile.Node', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.tpu.op_profile.Node.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metrics', full_name='diplomacy.tensorflow.tpu.op_profile.Node.metrics', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='children', full_name='diplomacy.tensorflow.tpu.op_profile.Node.children', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='category', full_name='diplomacy.tensorflow.tpu.op_profile.Node.category', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='xla', full_name='diplomacy.tensorflow.tpu.op_profile.Node.xla', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_children', full_name='diplomacy.tensorflow.tpu.op_profile.Node.num_children', index=5, + number=6, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_NODE_INSTRUCTIONCATEGORY, _NODE_XLAINSTRUCTION, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='contents', full_name='diplomacy.tensorflow.tpu.op_profile.Node.contents', + index=0, containing_type=None, fields=[]), + ], + serialized_start=286, + serialized_end=1008, +) + + +_METRICS = _descriptor.Descriptor( + name='Metrics', + full_name='diplomacy.tensorflow.tpu.op_profile.Metrics', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='time', full_name='diplomacy.tensorflow.tpu.op_profile.Metrics.time', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='flops', full_name='diplomacy.tensorflow.tpu.op_profile.Metrics.flops', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='memory_bandwidth', full_name='diplomacy.tensorflow.tpu.op_profile.Metrics.memory_bandwidth', index=2, + number=3, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='raw_time', full_name='diplomacy.tensorflow.tpu.op_profile.Metrics.raw_time', index=3, + number=11, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='raw_flops', full_name='diplomacy.tensorflow.tpu.op_profile.Metrics.raw_flops', index=4, + number=12, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='raw_bytes_accessed', full_name='diplomacy.tensorflow.tpu.op_profile.Metrics.raw_bytes_accessed', index=5, + number=13, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1011, + serialized_end=1140, +) + +_PROFILE.fields_by_name['by_category'].message_type = _NODE +_PROFILE.fields_by_name['by_program'].message_type = _NODE +_NODE_INSTRUCTIONCATEGORY.containing_type = _NODE +_NODE_XLAINSTRUCTION_LAYOUTANALYSIS_DIMENSION.containing_type = _NODE_XLAINSTRUCTION_LAYOUTANALYSIS +_NODE_XLAINSTRUCTION_LAYOUTANALYSIS.fields_by_name['dimensions'].message_type = _NODE_XLAINSTRUCTION_LAYOUTANALYSIS_DIMENSION +_NODE_XLAINSTRUCTION_LAYOUTANALYSIS.containing_type = _NODE_XLAINSTRUCTION +_NODE_XLAINSTRUCTION.fields_by_name['layout'].message_type = _NODE_XLAINSTRUCTION_LAYOUTANALYSIS +_NODE_XLAINSTRUCTION.containing_type = _NODE +_NODE.fields_by_name['metrics'].message_type = _METRICS +_NODE.fields_by_name['children'].message_type = _NODE +_NODE.fields_by_name['category'].message_type = _NODE_INSTRUCTIONCATEGORY +_NODE.fields_by_name['xla'].message_type = _NODE_XLAINSTRUCTION +_NODE.oneofs_by_name['contents'].fields.append( + _NODE.fields_by_name['category']) +_NODE.fields_by_name['category'].containing_oneof = _NODE.oneofs_by_name['contents'] +_NODE.oneofs_by_name['contents'].fields.append( + _NODE.fields_by_name['xla']) +_NODE.fields_by_name['xla'].containing_oneof = _NODE.oneofs_by_name['contents'] +DESCRIPTOR.message_types_by_name['Profile'] = _PROFILE +DESCRIPTOR.message_types_by_name['Node'] = _NODE +DESCRIPTOR.message_types_by_name['Metrics'] = _METRICS +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Profile = _reflection.GeneratedProtocolMessageType('Profile', (_message.Message,), dict( + DESCRIPTOR = _PROFILE, + __module__ = 'diplomacy_tensorflow.contrib.tpu.profiler.op_profile_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Profile) + )) +_sym_db.RegisterMessage(Profile) + +Node = _reflection.GeneratedProtocolMessageType('Node', (_message.Message,), dict( + + InstructionCategory = _reflection.GeneratedProtocolMessageType('InstructionCategory', (_message.Message,), dict( + DESCRIPTOR = _NODE_INSTRUCTIONCATEGORY, + __module__ = 'diplomacy_tensorflow.contrib.tpu.profiler.op_profile_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.InstructionCategory) + )) + , + + XLAInstruction = _reflection.GeneratedProtocolMessageType('XLAInstruction', (_message.Message,), dict( + + LayoutAnalysis = _reflection.GeneratedProtocolMessageType('LayoutAnalysis', (_message.Message,), dict( + + Dimension = _reflection.GeneratedProtocolMessageType('Dimension', (_message.Message,), dict( + DESCRIPTOR = _NODE_XLAINSTRUCTION_LAYOUTANALYSIS_DIMENSION, + __module__ = 'diplomacy_tensorflow.contrib.tpu.profiler.op_profile_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis.Dimension) + )) + , + DESCRIPTOR = _NODE_XLAINSTRUCTION_LAYOUTANALYSIS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.profiler.op_profile_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction.LayoutAnalysis) + )) + , + DESCRIPTOR = _NODE_XLAINSTRUCTION, + __module__ = 'diplomacy_tensorflow.contrib.tpu.profiler.op_profile_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node.XLAInstruction) + )) + , + DESCRIPTOR = _NODE, + __module__ = 'diplomacy_tensorflow.contrib.tpu.profiler.op_profile_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Node) + )) +_sym_db.RegisterMessage(Node) +_sym_db.RegisterMessage(Node.InstructionCategory) +_sym_db.RegisterMessage(Node.XLAInstruction) +_sym_db.RegisterMessage(Node.XLAInstruction.LayoutAnalysis) +_sym_db.RegisterMessage(Node.XLAInstruction.LayoutAnalysis.Dimension) + +Metrics = _reflection.GeneratedProtocolMessageType('Metrics', (_message.Message,), dict( + DESCRIPTOR = _METRICS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.profiler.op_profile_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.op_profile.Metrics) + )) +_sym_db.RegisterMessage(Metrics) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.cc new file mode 100644 index 0000000..d588cc6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.cc @@ -0,0 +1,2881 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.proto + +#include "diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Profile; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ProfileOptions; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ProfileToolData; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ToolRequestOptions; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ProfileRequest_ToolOptionsEntry_DoNotUse; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_GraphDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fconfig_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fconfig_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_RunMetadata; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fconfig_2eproto +namespace diplomacy { +namespace tensorflow { +class ProfileOptionsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileOptions_default_instance_; +class ToolRequestOptionsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ToolRequestOptions_default_instance_; +class ProfileRequest_ToolOptionsEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileRequest_ToolOptionsEntry_DoNotUse_default_instance_; +class ProfileRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileRequest_default_instance_; +class ProfileToolDataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileToolData_default_instance_; +class ProfileResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileResponse_default_instance_; +class MonitorRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MonitorRequest_default_instance_; +class MonitorResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MonitorResponse_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto { +static void InitDefaultsProfileOptions() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileOptions_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProfileOptions::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ProfileOptions = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsProfileOptions}, {}}; + +static void InitDefaultsToolRequestOptions() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ToolRequestOptions_default_instance_; + new (ptr) ::diplomacy::tensorflow::ToolRequestOptions(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ToolRequestOptions::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ToolRequestOptions = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsToolRequestOptions}, {}}; + +static void InitDefaultsProfileRequest_ToolOptionsEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileRequest_ToolOptionsEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse(); + } + ::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ProfileRequest_ToolOptionsEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsProfileRequest_ToolOptionsEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ToolRequestOptions.base,}}; + +static void InitDefaultsProfileRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileRequest_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProfileRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_ProfileRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsProfileRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileRequest_ToolOptionsEntry_DoNotUse.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileOptions.base,}}; + +static void InitDefaultsProfileToolData() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileToolData_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileToolData(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProfileToolData::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ProfileToolData = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsProfileToolData}, {}}; + +static void InitDefaultsProfileResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProfileResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_ProfileResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsProfileResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::scc_info_GraphDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fconfig_2eproto::scc_info_RunMetadata.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2fop_5fprofile_2eproto::scc_info_Profile.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileToolData.base,}}; + +static void InitDefaultsMonitorRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MonitorRequest_default_instance_; + new (ptr) ::diplomacy::tensorflow::MonitorRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MonitorRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MonitorRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMonitorRequest}, {}}; + +static void InitDefaultsMonitorResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MonitorResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::MonitorResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MonitorResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MonitorResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMonitorResponse}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_ProfileOptions.base); + ::google::protobuf::internal::InitSCC(&scc_info_ToolRequestOptions.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileRequest_ToolOptionsEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileToolData.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_MonitorRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_MonitorResponse.base); +} + +::google::protobuf::Metadata file_level_metadata[8]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileOptions, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileOptions, include_dataset_ops_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ToolRequestOptions, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ToolRequestOptions, output_formats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ToolRequestOptions, save_to_repo_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, duration_ms_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, max_events_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, tools_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, tool_options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, opts_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, repository_root_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, session_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileRequest, host_name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileToolData, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileToolData, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileToolData, data_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileResponse, computation_graph_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileResponse, hlo_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileResponse, encoded_trace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileResponse, op_profile_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileResponse, tool_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileResponse, empty_trace_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MonitorRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MonitorRequest, duration_ms_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MonitorRequest, monitoring_level_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MonitorResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MonitorResponse, data_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::ProfileOptions)}, + { 6, -1, sizeof(::diplomacy::tensorflow::ToolRequestOptions)}, + { 13, 20, sizeof(::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse)}, + { 22, -1, sizeof(::diplomacy::tensorflow::ProfileRequest)}, + { 35, -1, sizeof(::diplomacy::tensorflow::ProfileToolData)}, + { 42, -1, sizeof(::diplomacy::tensorflow::ProfileResponse)}, + { 53, -1, sizeof(::diplomacy::tensorflow::MonitorRequest)}, + { 60, -1, sizeof(::diplomacy::tensorflow::MonitorResponse)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_ProfileOptions_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ToolRequestOptions_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileRequest_ToolOptionsEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileRequest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileToolData_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileResponse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MonitorRequest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MonitorResponse_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 8); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n= 1900 +const int ProfileOptions::kIncludeDatasetOpsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProfileOptions::ProfileOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileOptions.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProfileOptions) +} +ProfileOptions::ProfileOptions(const ProfileOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + include_dataset_ops_ = from.include_dataset_ops_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProfileOptions) +} + +void ProfileOptions::SharedCtor() { + include_dataset_ops_ = false; +} + +ProfileOptions::~ProfileOptions() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProfileOptions) + SharedDtor(); +} + +void ProfileOptions::SharedDtor() { +} + +void ProfileOptions::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProfileOptions::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProfileOptions& ProfileOptions::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileOptions.base); + return *internal_default_instance(); +} + + +void ProfileOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProfileOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + include_dataset_ops_ = false; + _internal_metadata_.Clear(); +} + +bool ProfileOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProfileOptions) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // bool include_dataset_ops = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &include_dataset_ops_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProfileOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProfileOptions) + return false; +#undef DO_ +} + +void ProfileOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProfileOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool include_dataset_ops = 1; + if (this->include_dataset_ops() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->include_dataset_ops(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProfileOptions) +} + +::google::protobuf::uint8* ProfileOptions::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProfileOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool include_dataset_ops = 1; + if (this->include_dataset_ops() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->include_dataset_ops(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProfileOptions) + return target; +} + +size_t ProfileOptions::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProfileOptions) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // bool include_dataset_ops = 1; + if (this->include_dataset_ops() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProfileOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProfileOptions) + GOOGLE_DCHECK_NE(&from, this); + const ProfileOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProfileOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProfileOptions) + MergeFrom(*source); + } +} + +void ProfileOptions::MergeFrom(const ProfileOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProfileOptions) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.include_dataset_ops() != 0) { + set_include_dataset_ops(from.include_dataset_ops()); + } +} + +void ProfileOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProfileOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProfileOptions::CopyFrom(const ProfileOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProfileOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProfileOptions::IsInitialized() const { + return true; +} + +void ProfileOptions::Swap(ProfileOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void ProfileOptions::InternalSwap(ProfileOptions* other) { + using std::swap; + swap(include_dataset_ops_, other->include_dataset_ops_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProfileOptions::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ToolRequestOptions::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ToolRequestOptions::kOutputFormatsFieldNumber; +const int ToolRequestOptions::kSaveToRepoFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ToolRequestOptions::ToolRequestOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ToolRequestOptions.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ToolRequestOptions) +} +ToolRequestOptions::ToolRequestOptions(const ToolRequestOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + output_formats_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.output_formats().size() > 0) { + output_formats_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_formats_); + } + save_to_repo_ = from.save_to_repo_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ToolRequestOptions) +} + +void ToolRequestOptions::SharedCtor() { + output_formats_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + save_to_repo_ = false; +} + +ToolRequestOptions::~ToolRequestOptions() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ToolRequestOptions) + SharedDtor(); +} + +void ToolRequestOptions::SharedDtor() { + output_formats_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ToolRequestOptions::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ToolRequestOptions::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ToolRequestOptions& ToolRequestOptions::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ToolRequestOptions.base); + return *internal_default_instance(); +} + + +void ToolRequestOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ToolRequestOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + output_formats_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + save_to_repo_ = false; + _internal_metadata_.Clear(); +} + +bool ToolRequestOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ToolRequestOptions) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string output_formats = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_output_formats())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_formats().data(), static_cast(this->output_formats().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ToolRequestOptions.output_formats")); + } else { + goto handle_unusual; + } + break; + } + + // bool save_to_repo = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &save_to_repo_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ToolRequestOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ToolRequestOptions) + return false; +#undef DO_ +} + +void ToolRequestOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ToolRequestOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string output_formats = 2; + if (this->output_formats().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_formats().data(), static_cast(this->output_formats().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ToolRequestOptions.output_formats"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->output_formats(), output); + } + + // bool save_to_repo = 3; + if (this->save_to_repo() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->save_to_repo(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ToolRequestOptions) +} + +::google::protobuf::uint8* ToolRequestOptions::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ToolRequestOptions) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string output_formats = 2; + if (this->output_formats().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_formats().data(), static_cast(this->output_formats().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ToolRequestOptions.output_formats"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->output_formats(), target); + } + + // bool save_to_repo = 3; + if (this->save_to_repo() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->save_to_repo(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ToolRequestOptions) + return target; +} + +size_t ToolRequestOptions::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ToolRequestOptions) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string output_formats = 2; + if (this->output_formats().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->output_formats()); + } + + // bool save_to_repo = 3; + if (this->save_to_repo() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ToolRequestOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ToolRequestOptions) + GOOGLE_DCHECK_NE(&from, this); + const ToolRequestOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ToolRequestOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ToolRequestOptions) + MergeFrom(*source); + } +} + +void ToolRequestOptions::MergeFrom(const ToolRequestOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ToolRequestOptions) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.output_formats().size() > 0) { + + output_formats_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_formats_); + } + if (from.save_to_repo() != 0) { + set_save_to_repo(from.save_to_repo()); + } +} + +void ToolRequestOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ToolRequestOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ToolRequestOptions::CopyFrom(const ToolRequestOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ToolRequestOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ToolRequestOptions::IsInitialized() const { + return true; +} + +void ToolRequestOptions::Swap(ToolRequestOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void ToolRequestOptions::InternalSwap(ToolRequestOptions* other) { + using std::swap; + output_formats_.Swap(&other->output_formats_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(save_to_repo_, other->save_to_repo_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ToolRequestOptions::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +ProfileRequest_ToolOptionsEntry_DoNotUse::ProfileRequest_ToolOptionsEntry_DoNotUse() {} +ProfileRequest_ToolOptionsEntry_DoNotUse::ProfileRequest_ToolOptionsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void ProfileRequest_ToolOptionsEntry_DoNotUse::MergeFrom(const ProfileRequest_ToolOptionsEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata ProfileRequest_ToolOptionsEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[2]; +} +void ProfileRequest_ToolOptionsEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void ProfileRequest::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_ProfileRequest_default_instance_._instance.get_mutable()->opts_ = const_cast< ::diplomacy::tensorflow::ProfileOptions*>( + ::diplomacy::tensorflow::ProfileOptions::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProfileRequest::kDurationMsFieldNumber; +const int ProfileRequest::kMaxEventsFieldNumber; +const int ProfileRequest::kToolsFieldNumber; +const int ProfileRequest::kToolOptionsFieldNumber; +const int ProfileRequest::kOptsFieldNumber; +const int ProfileRequest::kRepositoryRootFieldNumber; +const int ProfileRequest::kSessionIdFieldNumber; +const int ProfileRequest::kHostNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProfileRequest::ProfileRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProfileRequest) +} +ProfileRequest::ProfileRequest(const ProfileRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + tools_(from.tools_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + tool_options_.MergeFrom(from.tool_options_); + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.repository_root().size() > 0) { + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.session_id().size() > 0) { + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.host_name().size() > 0) { + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } + if (from.has_opts()) { + opts_ = new ::diplomacy::tensorflow::ProfileOptions(*from.opts_); + } else { + opts_ = NULL; + } + ::memcpy(&duration_ms_, &from.duration_ms_, + static_cast(reinterpret_cast(&max_events_) - + reinterpret_cast(&duration_ms_)) + sizeof(max_events_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProfileRequest) +} + +void ProfileRequest::SharedCtor() { + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&opts_, 0, static_cast( + reinterpret_cast(&max_events_) - + reinterpret_cast(&opts_)) + sizeof(max_events_)); +} + +ProfileRequest::~ProfileRequest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProfileRequest) + SharedDtor(); +} + +void ProfileRequest::SharedDtor() { + repository_root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + host_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete opts_; +} + +void ProfileRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProfileRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProfileRequest& ProfileRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileRequest.base); + return *internal_default_instance(); +} + + +void ProfileRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProfileRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tools_.Clear(); + tool_options_.Clear(); + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && opts_ != NULL) { + delete opts_; + } + opts_ = NULL; + ::memset(&duration_ms_, 0, static_cast( + reinterpret_cast(&max_events_) - + reinterpret_cast(&duration_ms_)) + sizeof(max_events_)); + _internal_metadata_.Clear(); +} + +bool ProfileRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProfileRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // uint64 duration_ms = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &duration_ms_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 max_events = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &max_events_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated string tools = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_tools())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tools(this->tools_size() - 1).data(), + static_cast(this->tools(this->tools_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileRequest.tools")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.ProfileOptions opts = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_opts())); + } else { + goto handle_unusual; + } + break; + } + + // string repository_root = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_repository_root())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileRequest.repository_root")); + } else { + goto handle_unusual; + } + break; + } + + // string session_id = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_session_id())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileRequest.session_id")); + } else { + goto handle_unusual; + } + break; + } + + // string host_name = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_host_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileRequest.host_name")); + } else { + goto handle_unusual; + } + break; + } + + // map tool_options = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + ProfileRequest_ToolOptionsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + ProfileRequest_ToolOptionsEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::ToolRequestOptions, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions > > parser(&tool_options_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileRequest.ToolOptionsEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProfileRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProfileRequest) + return false; +#undef DO_ +} + +void ProfileRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProfileRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 duration_ms = 1; + if (this->duration_ms() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->duration_ms(), output); + } + + // uint64 max_events = 2; + if (this->max_events() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->max_events(), output); + } + + // repeated string tools = 3; + for (int i = 0, n = this->tools_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tools(i).data(), static_cast(this->tools(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.tools"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->tools(i), output); + } + + // .diplomacy.tensorflow.ProfileOptions opts = 4; + if (this->has_opts()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_opts(), output); + } + + // string repository_root = 5; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.repository_root"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->repository_root(), output); + } + + // string session_id = 6; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.session_id"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->session_id(), output); + } + + // string host_name = 7; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.host_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->host_name(), output); + } + + // map tool_options = 8; + if (!this->tool_options().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.ToolOptionsEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->tool_options().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->tool_options().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::const_iterator + it = this->tool_options().begin(); + it != this->tool_options().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(tool_options_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *entry, output); + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::const_iterator + it = this->tool_options().begin(); + it != this->tool_options().end(); ++it) { + entry.reset(tool_options_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *entry, output); + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProfileRequest) +} + +::google::protobuf::uint8* ProfileRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProfileRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 duration_ms = 1; + if (this->duration_ms() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->duration_ms(), target); + } + + // uint64 max_events = 2; + if (this->max_events() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->max_events(), target); + } + + // repeated string tools = 3; + for (int i = 0, n = this->tools_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tools(i).data(), static_cast(this->tools(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.tools"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->tools(i), target); + } + + // .diplomacy.tensorflow.ProfileOptions opts = 4; + if (this->has_opts()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_opts(), deterministic, target); + } + + // string repository_root = 5; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.repository_root"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->repository_root(), target); + } + + // string session_id = 6; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.session_id"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->session_id(), target); + } + + // string host_name = 7; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.host_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->host_name(), target); + } + + // map tool_options = 8; + if (!this->tool_options().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileRequest.ToolOptionsEntry.key"); + } + }; + + if (deterministic && + this->tool_options().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->tool_options().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::const_iterator + it = this->tool_options().begin(); + it != this->tool_options().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(tool_options_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *entry, deterministic, target); +; + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::const_iterator + it = this->tool_options().begin(); + it != this->tool_options().end(); ++it) { + entry.reset(tool_options_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *entry, deterministic, target); +; + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProfileRequest) + return target; +} + +size_t ProfileRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProfileRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string tools = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->tools_size()); + for (int i = 0, n = this->tools_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->tools(i)); + } + + // map tool_options = 8; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->tool_options_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >::const_iterator + it = this->tool_options().begin(); + it != this->tool_options().end(); ++it) { + entry.reset(tool_options_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + // string repository_root = 5; + if (this->repository_root().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->repository_root()); + } + + // string session_id = 6; + if (this->session_id().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->session_id()); + } + + // string host_name = 7; + if (this->host_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->host_name()); + } + + // .diplomacy.tensorflow.ProfileOptions opts = 4; + if (this->has_opts()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *opts_); + } + + // uint64 duration_ms = 1; + if (this->duration_ms() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->duration_ms()); + } + + // uint64 max_events = 2; + if (this->max_events() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->max_events()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProfileRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProfileRequest) + GOOGLE_DCHECK_NE(&from, this); + const ProfileRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProfileRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProfileRequest) + MergeFrom(*source); + } +} + +void ProfileRequest::MergeFrom(const ProfileRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProfileRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + tools_.MergeFrom(from.tools_); + tool_options_.MergeFrom(from.tool_options_); + if (from.repository_root().size() > 0) { + + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } + if (from.session_id().size() > 0) { + + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } + if (from.host_name().size() > 0) { + + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } + if (from.has_opts()) { + mutable_opts()->::diplomacy::tensorflow::ProfileOptions::MergeFrom(from.opts()); + } + if (from.duration_ms() != 0) { + set_duration_ms(from.duration_ms()); + } + if (from.max_events() != 0) { + set_max_events(from.max_events()); + } +} + +void ProfileRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProfileRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProfileRequest::CopyFrom(const ProfileRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProfileRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProfileRequest::IsInitialized() const { + return true; +} + +void ProfileRequest::Swap(ProfileRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ProfileRequest::InternalSwap(ProfileRequest* other) { + using std::swap; + tools_.InternalSwap(CastToBase(&other->tools_)); + tool_options_.Swap(&other->tool_options_); + repository_root_.Swap(&other->repository_root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + session_id_.Swap(&other->session_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + host_name_.Swap(&other->host_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(opts_, other->opts_); + swap(duration_ms_, other->duration_ms_); + swap(max_events_, other->max_events_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProfileRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ProfileToolData::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProfileToolData::kNameFieldNumber; +const int ProfileToolData::kDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProfileToolData::ProfileToolData() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileToolData.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProfileToolData) +} +ProfileToolData::ProfileToolData(const ProfileToolData& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.data().size() > 0) { + data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProfileToolData) +} + +void ProfileToolData::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ProfileToolData::~ProfileToolData() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProfileToolData) + SharedDtor(); +} + +void ProfileToolData::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ProfileToolData::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProfileToolData::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProfileToolData& ProfileToolData::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileToolData.base); + return *internal_default_instance(); +} + + +void ProfileToolData::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProfileToolData) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool ProfileToolData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProfileToolData) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileToolData.name")); + } else { + goto handle_unusual; + } + break; + } + + // bytes data = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProfileToolData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProfileToolData) + return false; +#undef DO_ +} + +void ProfileToolData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProfileToolData) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileToolData.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // bytes data = 2; + if (this->data().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->data(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProfileToolData) +} + +::google::protobuf::uint8* ProfileToolData::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProfileToolData) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileToolData.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // bytes data = 2; + if (this->data().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 2, this->data(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProfileToolData) + return target; +} + +size_t ProfileToolData::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProfileToolData) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // bytes data = 2; + if (this->data().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->data()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProfileToolData::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProfileToolData) + GOOGLE_DCHECK_NE(&from, this); + const ProfileToolData* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProfileToolData) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProfileToolData) + MergeFrom(*source); + } +} + +void ProfileToolData::MergeFrom(const ProfileToolData& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProfileToolData) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.data().size() > 0) { + + data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_); + } +} + +void ProfileToolData::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProfileToolData) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProfileToolData::CopyFrom(const ProfileToolData& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProfileToolData) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProfileToolData::IsInitialized() const { + return true; +} + +void ProfileToolData::Swap(ProfileToolData* other) { + if (other == this) return; + InternalSwap(other); +} +void ProfileToolData::InternalSwap(ProfileToolData* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + data_.Swap(&other->data_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProfileToolData::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ProfileResponse::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_ProfileResponse_default_instance_._instance.get_mutable()->hlo_metadata_ = const_cast< ::diplomacy::tensorflow::RunMetadata*>( + ::diplomacy::tensorflow::RunMetadata::internal_default_instance()); + ::diplomacy::tensorflow::_ProfileResponse_default_instance_._instance.get_mutable()->op_profile_ = const_cast< ::diplomacy::tensorflow::tpu::op_profile::Profile*>( + ::diplomacy::tensorflow::tpu::op_profile::Profile::internal_default_instance()); +} +void ProfileResponse::clear_computation_graph() { + computation_graph_.Clear(); +} +void ProfileResponse::clear_hlo_metadata() { + if (GetArenaNoVirtual() == NULL && hlo_metadata_ != NULL) { + delete hlo_metadata_; + } + hlo_metadata_ = NULL; +} +void ProfileResponse::clear_op_profile() { + if (GetArenaNoVirtual() == NULL && op_profile_ != NULL) { + delete op_profile_; + } + op_profile_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProfileResponse::kComputationGraphFieldNumber; +const int ProfileResponse::kHloMetadataFieldNumber; +const int ProfileResponse::kEncodedTraceFieldNumber; +const int ProfileResponse::kOpProfileFieldNumber; +const int ProfileResponse::kToolDataFieldNumber; +const int ProfileResponse::kEmptyTraceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProfileResponse::ProfileResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProfileResponse) +} +ProfileResponse::ProfileResponse(const ProfileResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + computation_graph_(from.computation_graph_), + tool_data_(from.tool_data_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + encoded_trace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.encoded_trace().size() > 0) { + encoded_trace_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.encoded_trace_); + } + if (from.has_op_profile()) { + op_profile_ = new ::diplomacy::tensorflow::tpu::op_profile::Profile(*from.op_profile_); + } else { + op_profile_ = NULL; + } + if (from.has_hlo_metadata()) { + hlo_metadata_ = new ::diplomacy::tensorflow::RunMetadata(*from.hlo_metadata_); + } else { + hlo_metadata_ = NULL; + } + empty_trace_ = from.empty_trace_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProfileResponse) +} + +void ProfileResponse::SharedCtor() { + encoded_trace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&op_profile_, 0, static_cast( + reinterpret_cast(&empty_trace_) - + reinterpret_cast(&op_profile_)) + sizeof(empty_trace_)); +} + +ProfileResponse::~ProfileResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProfileResponse) + SharedDtor(); +} + +void ProfileResponse::SharedDtor() { + encoded_trace_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete op_profile_; + if (this != internal_default_instance()) delete hlo_metadata_; +} + +void ProfileResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProfileResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProfileResponse& ProfileResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileResponse.base); + return *internal_default_instance(); +} + + +void ProfileResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProfileResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + computation_graph_.Clear(); + tool_data_.Clear(); + encoded_trace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && op_profile_ != NULL) { + delete op_profile_; + } + op_profile_ = NULL; + if (GetArenaNoVirtual() == NULL && hlo_metadata_ != NULL) { + delete hlo_metadata_; + } + hlo_metadata_ = NULL; + empty_trace_ = false; + _internal_metadata_.Clear(); +} + +bool ProfileResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProfileResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.GraphDef computation_graph = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_computation_graph())); + } else { + goto handle_unusual; + } + break; + } + + // bytes encoded_trace = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_encoded_trace())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.op_profile.Profile op_profile = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_op_profile())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.RunMetadata hlo_metadata = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_hlo_metadata())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.ProfileToolData tool_data = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tool_data())); + } else { + goto handle_unusual; + } + break; + } + + // bool empty_trace = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &empty_trace_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProfileResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProfileResponse) + return false; +#undef DO_ +} + +void ProfileResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProfileResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.GraphDef computation_graph = 2; + for (unsigned int i = 0, + n = static_cast(this->computation_graph_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->computation_graph(static_cast(i)), + output); + } + + // bytes encoded_trace = 3; + if (this->encoded_trace().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->encoded_trace(), output); + } + + // .diplomacy.tensorflow.tpu.op_profile.Profile op_profile = 4; + if (this->has_op_profile()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_op_profile(), output); + } + + // .diplomacy.tensorflow.RunMetadata hlo_metadata = 5; + if (this->has_hlo_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_hlo_metadata(), output); + } + + // repeated .diplomacy.tensorflow.ProfileToolData tool_data = 6; + for (unsigned int i = 0, + n = static_cast(this->tool_data_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, + this->tool_data(static_cast(i)), + output); + } + + // bool empty_trace = 7; + if (this->empty_trace() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->empty_trace(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProfileResponse) +} + +::google::protobuf::uint8* ProfileResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProfileResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.GraphDef computation_graph = 2; + for (unsigned int i = 0, + n = static_cast(this->computation_graph_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->computation_graph(static_cast(i)), deterministic, target); + } + + // bytes encoded_trace = 3; + if (this->encoded_trace().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->encoded_trace(), target); + } + + // .diplomacy.tensorflow.tpu.op_profile.Profile op_profile = 4; + if (this->has_op_profile()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_op_profile(), deterministic, target); + } + + // .diplomacy.tensorflow.RunMetadata hlo_metadata = 5; + if (this->has_hlo_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_hlo_metadata(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.ProfileToolData tool_data = 6; + for (unsigned int i = 0, + n = static_cast(this->tool_data_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->tool_data(static_cast(i)), deterministic, target); + } + + // bool empty_trace = 7; + if (this->empty_trace() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->empty_trace(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProfileResponse) + return target; +} + +size_t ProfileResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProfileResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.GraphDef computation_graph = 2; + { + unsigned int count = static_cast(this->computation_graph_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->computation_graph(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.ProfileToolData tool_data = 6; + { + unsigned int count = static_cast(this->tool_data_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tool_data(static_cast(i))); + } + } + + // bytes encoded_trace = 3; + if (this->encoded_trace().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->encoded_trace()); + } + + // .diplomacy.tensorflow.tpu.op_profile.Profile op_profile = 4; + if (this->has_op_profile()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *op_profile_); + } + + // .diplomacy.tensorflow.RunMetadata hlo_metadata = 5; + if (this->has_hlo_metadata()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *hlo_metadata_); + } + + // bool empty_trace = 7; + if (this->empty_trace() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProfileResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProfileResponse) + GOOGLE_DCHECK_NE(&from, this); + const ProfileResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProfileResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProfileResponse) + MergeFrom(*source); + } +} + +void ProfileResponse::MergeFrom(const ProfileResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProfileResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + computation_graph_.MergeFrom(from.computation_graph_); + tool_data_.MergeFrom(from.tool_data_); + if (from.encoded_trace().size() > 0) { + + encoded_trace_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.encoded_trace_); + } + if (from.has_op_profile()) { + mutable_op_profile()->::diplomacy::tensorflow::tpu::op_profile::Profile::MergeFrom(from.op_profile()); + } + if (from.has_hlo_metadata()) { + mutable_hlo_metadata()->::diplomacy::tensorflow::RunMetadata::MergeFrom(from.hlo_metadata()); + } + if (from.empty_trace() != 0) { + set_empty_trace(from.empty_trace()); + } +} + +void ProfileResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProfileResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProfileResponse::CopyFrom(const ProfileResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProfileResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProfileResponse::IsInitialized() const { + return true; +} + +void ProfileResponse::Swap(ProfileResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ProfileResponse::InternalSwap(ProfileResponse* other) { + using std::swap; + CastToBase(&computation_graph_)->InternalSwap(CastToBase(&other->computation_graph_)); + CastToBase(&tool_data_)->InternalSwap(CastToBase(&other->tool_data_)); + encoded_trace_.Swap(&other->encoded_trace_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(op_profile_, other->op_profile_); + swap(hlo_metadata_, other->hlo_metadata_); + swap(empty_trace_, other->empty_trace_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProfileResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MonitorRequest::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MonitorRequest::kDurationMsFieldNumber; +const int MonitorRequest::kMonitoringLevelFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MonitorRequest::MonitorRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_MonitorRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MonitorRequest) +} +MonitorRequest::MonitorRequest(const MonitorRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&duration_ms_, &from.duration_ms_, + static_cast(reinterpret_cast(&monitoring_level_) - + reinterpret_cast(&duration_ms_)) + sizeof(monitoring_level_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MonitorRequest) +} + +void MonitorRequest::SharedCtor() { + ::memset(&duration_ms_, 0, static_cast( + reinterpret_cast(&monitoring_level_) - + reinterpret_cast(&duration_ms_)) + sizeof(monitoring_level_)); +} + +MonitorRequest::~MonitorRequest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MonitorRequest) + SharedDtor(); +} + +void MonitorRequest::SharedDtor() { +} + +void MonitorRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MonitorRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MonitorRequest& MonitorRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_MonitorRequest.base); + return *internal_default_instance(); +} + + +void MonitorRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MonitorRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&duration_ms_, 0, static_cast( + reinterpret_cast(&monitoring_level_) - + reinterpret_cast(&duration_ms_)) + sizeof(monitoring_level_)); + _internal_metadata_.Clear(); +} + +bool MonitorRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MonitorRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // uint64 duration_ms = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &duration_ms_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 monitoring_level = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &monitoring_level_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MonitorRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MonitorRequest) + return false; +#undef DO_ +} + +void MonitorRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MonitorRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 duration_ms = 1; + if (this->duration_ms() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->duration_ms(), output); + } + + // int32 monitoring_level = 2; + if (this->monitoring_level() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->monitoring_level(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MonitorRequest) +} + +::google::protobuf::uint8* MonitorRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MonitorRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 duration_ms = 1; + if (this->duration_ms() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->duration_ms(), target); + } + + // int32 monitoring_level = 2; + if (this->monitoring_level() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->monitoring_level(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MonitorRequest) + return target; +} + +size_t MonitorRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MonitorRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // uint64 duration_ms = 1; + if (this->duration_ms() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->duration_ms()); + } + + // int32 monitoring_level = 2; + if (this->monitoring_level() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->monitoring_level()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MonitorRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MonitorRequest) + GOOGLE_DCHECK_NE(&from, this); + const MonitorRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MonitorRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MonitorRequest) + MergeFrom(*source); + } +} + +void MonitorRequest::MergeFrom(const MonitorRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MonitorRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.duration_ms() != 0) { + set_duration_ms(from.duration_ms()); + } + if (from.monitoring_level() != 0) { + set_monitoring_level(from.monitoring_level()); + } +} + +void MonitorRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MonitorRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MonitorRequest::CopyFrom(const MonitorRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MonitorRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MonitorRequest::IsInitialized() const { + return true; +} + +void MonitorRequest::Swap(MonitorRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void MonitorRequest::InternalSwap(MonitorRequest* other) { + using std::swap; + swap(duration_ms_, other->duration_ms_); + swap(monitoring_level_, other->monitoring_level_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MonitorRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MonitorResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MonitorResponse::kDataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MonitorResponse::MonitorResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_MonitorResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MonitorResponse) +} +MonitorResponse::MonitorResponse(const MonitorResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.data().size() > 0) { + data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MonitorResponse) +} + +void MonitorResponse::SharedCtor() { + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +MonitorResponse::~MonitorResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MonitorResponse) + SharedDtor(); +} + +void MonitorResponse::SharedDtor() { + data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void MonitorResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MonitorResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MonitorResponse& MonitorResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_MonitorResponse.base); + return *internal_default_instance(); +} + + +void MonitorResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MonitorResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool MonitorResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MonitorResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_data())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->data().data(), static_cast(this->data().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MonitorResponse.data")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MonitorResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MonitorResponse) + return false; +#undef DO_ +} + +void MonitorResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MonitorResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string data = 1; + if (this->data().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->data().data(), static_cast(this->data().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MonitorResponse.data"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->data(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MonitorResponse) +} + +::google::protobuf::uint8* MonitorResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MonitorResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string data = 1; + if (this->data().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->data().data(), static_cast(this->data().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MonitorResponse.data"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->data(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MonitorResponse) + return target; +} + +size_t MonitorResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MonitorResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string data = 1; + if (this->data().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->data()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MonitorResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MonitorResponse) + GOOGLE_DCHECK_NE(&from, this); + const MonitorResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MonitorResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MonitorResponse) + MergeFrom(*source); + } +} + +void MonitorResponse::MergeFrom(const MonitorResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MonitorResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.data().size() > 0) { + + data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_); + } +} + +void MonitorResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MonitorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MonitorResponse::CopyFrom(const MonitorResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MonitorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MonitorResponse::IsInitialized() const { + return true; +} + +void MonitorResponse::Swap(MonitorResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void MonitorResponse::InternalSwap(MonitorResponse* other) { + using std::swap; + data_.Swap(&other->data_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MonitorResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileOptions* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileOptions >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileOptions >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ToolRequestOptions* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ToolRequestOptions >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ToolRequestOptions >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileRequest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileRequest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileToolData* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileToolData >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileToolData >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileResponse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MonitorRequest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MonitorRequest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::MonitorRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MonitorResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MonitorResponse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::MonitorResponse >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.h new file mode 100644 index 0000000..52bd753 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.h @@ -0,0 +1,1942 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_tensorflow/core/framework/graph.pb.h" +#include "diplomacy_tensorflow/core/protobuf/config.pb.h" +#include "diplomacy_tensorflow/contrib/tpu/profiler/op_profile.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[8]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto +namespace diplomacy { +namespace tensorflow { +class MonitorRequest; +class MonitorRequestDefaultTypeInternal; +extern MonitorRequestDefaultTypeInternal _MonitorRequest_default_instance_; +class MonitorResponse; +class MonitorResponseDefaultTypeInternal; +extern MonitorResponseDefaultTypeInternal _MonitorResponse_default_instance_; +class ProfileOptions; +class ProfileOptionsDefaultTypeInternal; +extern ProfileOptionsDefaultTypeInternal _ProfileOptions_default_instance_; +class ProfileRequest; +class ProfileRequestDefaultTypeInternal; +extern ProfileRequestDefaultTypeInternal _ProfileRequest_default_instance_; +class ProfileRequest_ToolOptionsEntry_DoNotUse; +class ProfileRequest_ToolOptionsEntry_DoNotUseDefaultTypeInternal; +extern ProfileRequest_ToolOptionsEntry_DoNotUseDefaultTypeInternal _ProfileRequest_ToolOptionsEntry_DoNotUse_default_instance_; +class ProfileResponse; +class ProfileResponseDefaultTypeInternal; +extern ProfileResponseDefaultTypeInternal _ProfileResponse_default_instance_; +class ProfileToolData; +class ProfileToolDataDefaultTypeInternal; +extern ProfileToolDataDefaultTypeInternal _ProfileToolData_default_instance_; +class ToolRequestOptions; +class ToolRequestOptionsDefaultTypeInternal; +extern ToolRequestOptionsDefaultTypeInternal _ToolRequestOptions_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::MonitorRequest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MonitorRequest>(Arena*); +template<> ::diplomacy::tensorflow::MonitorResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MonitorResponse>(Arena*); +template<> ::diplomacy::tensorflow::ProfileOptions* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileOptions>(Arena*); +template<> ::diplomacy::tensorflow::ProfileRequest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileRequest>(Arena*); +template<> ::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileRequest_ToolOptionsEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::ProfileResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileResponse>(Arena*); +template<> ::diplomacy::tensorflow::ProfileToolData* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileToolData>(Arena*); +template<> ::diplomacy::tensorflow::ToolRequestOptions* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ToolRequestOptions>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class ProfileOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProfileOptions) */ { + public: + ProfileOptions(); + virtual ~ProfileOptions(); + + ProfileOptions(const ProfileOptions& from); + + inline ProfileOptions& operator=(const ProfileOptions& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProfileOptions(ProfileOptions&& from) noexcept + : ProfileOptions() { + *this = ::std::move(from); + } + + inline ProfileOptions& operator=(ProfileOptions&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProfileOptions& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProfileOptions* internal_default_instance() { + return reinterpret_cast( + &_ProfileOptions_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(ProfileOptions* other); + friend void swap(ProfileOptions& a, ProfileOptions& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProfileOptions* New() const final { + return CreateMaybeMessage(NULL); + } + + ProfileOptions* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProfileOptions& from); + void MergeFrom(const ProfileOptions& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProfileOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // bool include_dataset_ops = 1; + void clear_include_dataset_ops(); + static const int kIncludeDatasetOpsFieldNumber = 1; + bool include_dataset_ops() const; + void set_include_dataset_ops(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProfileOptions) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool include_dataset_ops_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ToolRequestOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ToolRequestOptions) */ { + public: + ToolRequestOptions(); + virtual ~ToolRequestOptions(); + + ToolRequestOptions(const ToolRequestOptions& from); + + inline ToolRequestOptions& operator=(const ToolRequestOptions& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ToolRequestOptions(ToolRequestOptions&& from) noexcept + : ToolRequestOptions() { + *this = ::std::move(from); + } + + inline ToolRequestOptions& operator=(ToolRequestOptions&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ToolRequestOptions& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ToolRequestOptions* internal_default_instance() { + return reinterpret_cast( + &_ToolRequestOptions_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(ToolRequestOptions* other); + friend void swap(ToolRequestOptions& a, ToolRequestOptions& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ToolRequestOptions* New() const final { + return CreateMaybeMessage(NULL); + } + + ToolRequestOptions* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ToolRequestOptions& from); + void MergeFrom(const ToolRequestOptions& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ToolRequestOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string output_formats = 2; + void clear_output_formats(); + static const int kOutputFormatsFieldNumber = 2; + const ::std::string& output_formats() const; + void set_output_formats(const ::std::string& value); + #if LANG_CXX11 + void set_output_formats(::std::string&& value); + #endif + void set_output_formats(const char* value); + void set_output_formats(const char* value, size_t size); + ::std::string* mutable_output_formats(); + ::std::string* release_output_formats(); + void set_allocated_output_formats(::std::string* output_formats); + + // bool save_to_repo = 3; + void clear_save_to_repo(); + static const int kSaveToRepoFieldNumber = 3; + bool save_to_repo() const; + void set_save_to_repo(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ToolRequestOptions) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr output_formats_; + bool save_to_repo_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProfileRequest_ToolOptionsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + ProfileRequest_ToolOptionsEntry_DoNotUse(); + ProfileRequest_ToolOptionsEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const ProfileRequest_ToolOptionsEntry_DoNotUse& other); + static const ProfileRequest_ToolOptionsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_ProfileRequest_ToolOptionsEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class ProfileRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProfileRequest) */ { + public: + ProfileRequest(); + virtual ~ProfileRequest(); + + ProfileRequest(const ProfileRequest& from); + + inline ProfileRequest& operator=(const ProfileRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProfileRequest(ProfileRequest&& from) noexcept + : ProfileRequest() { + *this = ::std::move(from); + } + + inline ProfileRequest& operator=(ProfileRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProfileRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProfileRequest* internal_default_instance() { + return reinterpret_cast( + &_ProfileRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(ProfileRequest* other); + friend void swap(ProfileRequest& a, ProfileRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProfileRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ProfileRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProfileRequest& from); + void MergeFrom(const ProfileRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProfileRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // repeated string tools = 3; + int tools_size() const; + void clear_tools(); + static const int kToolsFieldNumber = 3; + const ::std::string& tools(int index) const; + ::std::string* mutable_tools(int index); + void set_tools(int index, const ::std::string& value); + #if LANG_CXX11 + void set_tools(int index, ::std::string&& value); + #endif + void set_tools(int index, const char* value); + void set_tools(int index, const char* value, size_t size); + ::std::string* add_tools(); + void add_tools(const ::std::string& value); + #if LANG_CXX11 + void add_tools(::std::string&& value); + #endif + void add_tools(const char* value); + void add_tools(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& tools() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_tools(); + + // map tool_options = 8; + int tool_options_size() const; + void clear_tool_options(); + static const int kToolOptionsFieldNumber = 8; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >& + tool_options() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >* + mutable_tool_options(); + + // string repository_root = 5; + void clear_repository_root(); + static const int kRepositoryRootFieldNumber = 5; + const ::std::string& repository_root() const; + void set_repository_root(const ::std::string& value); + #if LANG_CXX11 + void set_repository_root(::std::string&& value); + #endif + void set_repository_root(const char* value); + void set_repository_root(const char* value, size_t size); + ::std::string* mutable_repository_root(); + ::std::string* release_repository_root(); + void set_allocated_repository_root(::std::string* repository_root); + + // string session_id = 6; + void clear_session_id(); + static const int kSessionIdFieldNumber = 6; + const ::std::string& session_id() const; + void set_session_id(const ::std::string& value); + #if LANG_CXX11 + void set_session_id(::std::string&& value); + #endif + void set_session_id(const char* value); + void set_session_id(const char* value, size_t size); + ::std::string* mutable_session_id(); + ::std::string* release_session_id(); + void set_allocated_session_id(::std::string* session_id); + + // string host_name = 7; + void clear_host_name(); + static const int kHostNameFieldNumber = 7; + const ::std::string& host_name() const; + void set_host_name(const ::std::string& value); + #if LANG_CXX11 + void set_host_name(::std::string&& value); + #endif + void set_host_name(const char* value); + void set_host_name(const char* value, size_t size); + ::std::string* mutable_host_name(); + ::std::string* release_host_name(); + void set_allocated_host_name(::std::string* host_name); + + // .diplomacy.tensorflow.ProfileOptions opts = 4; + bool has_opts() const; + void clear_opts(); + static const int kOptsFieldNumber = 4; + private: + const ::diplomacy::tensorflow::ProfileOptions& _internal_opts() const; + public: + const ::diplomacy::tensorflow::ProfileOptions& opts() const; + ::diplomacy::tensorflow::ProfileOptions* release_opts(); + ::diplomacy::tensorflow::ProfileOptions* mutable_opts(); + void set_allocated_opts(::diplomacy::tensorflow::ProfileOptions* opts); + + // uint64 duration_ms = 1; + void clear_duration_ms(); + static const int kDurationMsFieldNumber = 1; + ::google::protobuf::uint64 duration_ms() const; + void set_duration_ms(::google::protobuf::uint64 value); + + // uint64 max_events = 2; + void clear_max_events(); + static const int kMaxEventsFieldNumber = 2; + ::google::protobuf::uint64 max_events() const; + void set_max_events(::google::protobuf::uint64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProfileRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::std::string> tools_; + ::google::protobuf::internal::MapField< + ProfileRequest_ToolOptionsEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::ToolRequestOptions, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > tool_options_; + ::google::protobuf::internal::ArenaStringPtr repository_root_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::google::protobuf::internal::ArenaStringPtr host_name_; + ::diplomacy::tensorflow::ProfileOptions* opts_; + ::google::protobuf::uint64 duration_ms_; + ::google::protobuf::uint64 max_events_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProfileToolData : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProfileToolData) */ { + public: + ProfileToolData(); + virtual ~ProfileToolData(); + + ProfileToolData(const ProfileToolData& from); + + inline ProfileToolData& operator=(const ProfileToolData& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProfileToolData(ProfileToolData&& from) noexcept + : ProfileToolData() { + *this = ::std::move(from); + } + + inline ProfileToolData& operator=(ProfileToolData&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProfileToolData& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProfileToolData* internal_default_instance() { + return reinterpret_cast( + &_ProfileToolData_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(ProfileToolData* other); + friend void swap(ProfileToolData& a, ProfileToolData& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProfileToolData* New() const final { + return CreateMaybeMessage(NULL); + } + + ProfileToolData* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProfileToolData& from); + void MergeFrom(const ProfileToolData& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProfileToolData* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // bytes data = 2; + void clear_data(); + static const int kDataFieldNumber = 2; + const ::std::string& data() const; + void set_data(const ::std::string& value); + #if LANG_CXX11 + void set_data(::std::string&& value); + #endif + void set_data(const char* value); + void set_data(const void* value, size_t size); + ::std::string* mutable_data(); + ::std::string* release_data(); + void set_allocated_data(::std::string* data); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProfileToolData) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProfileResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProfileResponse) */ { + public: + ProfileResponse(); + virtual ~ProfileResponse(); + + ProfileResponse(const ProfileResponse& from); + + inline ProfileResponse& operator=(const ProfileResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProfileResponse(ProfileResponse&& from) noexcept + : ProfileResponse() { + *this = ::std::move(from); + } + + inline ProfileResponse& operator=(ProfileResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProfileResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProfileResponse* internal_default_instance() { + return reinterpret_cast( + &_ProfileResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(ProfileResponse* other); + friend void swap(ProfileResponse& a, ProfileResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProfileResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + ProfileResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProfileResponse& from); + void MergeFrom(const ProfileResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProfileResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.GraphDef computation_graph = 2; + int computation_graph_size() const; + void clear_computation_graph(); + static const int kComputationGraphFieldNumber = 2; + ::diplomacy::tensorflow::GraphDef* mutable_computation_graph(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphDef >* + mutable_computation_graph(); + const ::diplomacy::tensorflow::GraphDef& computation_graph(int index) const; + ::diplomacy::tensorflow::GraphDef* add_computation_graph(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphDef >& + computation_graph() const; + + // repeated .diplomacy.tensorflow.ProfileToolData tool_data = 6; + int tool_data_size() const; + void clear_tool_data(); + static const int kToolDataFieldNumber = 6; + ::diplomacy::tensorflow::ProfileToolData* mutable_tool_data(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileToolData >* + mutable_tool_data(); + const ::diplomacy::tensorflow::ProfileToolData& tool_data(int index) const; + ::diplomacy::tensorflow::ProfileToolData* add_tool_data(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileToolData >& + tool_data() const; + + // bytes encoded_trace = 3; + void clear_encoded_trace(); + static const int kEncodedTraceFieldNumber = 3; + const ::std::string& encoded_trace() const; + void set_encoded_trace(const ::std::string& value); + #if LANG_CXX11 + void set_encoded_trace(::std::string&& value); + #endif + void set_encoded_trace(const char* value); + void set_encoded_trace(const void* value, size_t size); + ::std::string* mutable_encoded_trace(); + ::std::string* release_encoded_trace(); + void set_allocated_encoded_trace(::std::string* encoded_trace); + + // .diplomacy.tensorflow.tpu.op_profile.Profile op_profile = 4; + bool has_op_profile() const; + void clear_op_profile(); + static const int kOpProfileFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tpu::op_profile::Profile& _internal_op_profile() const; + public: + const ::diplomacy::tensorflow::tpu::op_profile::Profile& op_profile() const; + ::diplomacy::tensorflow::tpu::op_profile::Profile* release_op_profile(); + ::diplomacy::tensorflow::tpu::op_profile::Profile* mutable_op_profile(); + void set_allocated_op_profile(::diplomacy::tensorflow::tpu::op_profile::Profile* op_profile); + + // .diplomacy.tensorflow.RunMetadata hlo_metadata = 5; + bool has_hlo_metadata() const; + void clear_hlo_metadata(); + static const int kHloMetadataFieldNumber = 5; + private: + const ::diplomacy::tensorflow::RunMetadata& _internal_hlo_metadata() const; + public: + const ::diplomacy::tensorflow::RunMetadata& hlo_metadata() const; + ::diplomacy::tensorflow::RunMetadata* release_hlo_metadata(); + ::diplomacy::tensorflow::RunMetadata* mutable_hlo_metadata(); + void set_allocated_hlo_metadata(::diplomacy::tensorflow::RunMetadata* hlo_metadata); + + // bool empty_trace = 7; + void clear_empty_trace(); + static const int kEmptyTraceFieldNumber = 7; + bool empty_trace() const; + void set_empty_trace(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProfileResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphDef > computation_graph_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileToolData > tool_data_; + ::google::protobuf::internal::ArenaStringPtr encoded_trace_; + ::diplomacy::tensorflow::tpu::op_profile::Profile* op_profile_; + ::diplomacy::tensorflow::RunMetadata* hlo_metadata_; + bool empty_trace_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MonitorRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MonitorRequest) */ { + public: + MonitorRequest(); + virtual ~MonitorRequest(); + + MonitorRequest(const MonitorRequest& from); + + inline MonitorRequest& operator=(const MonitorRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MonitorRequest(MonitorRequest&& from) noexcept + : MonitorRequest() { + *this = ::std::move(from); + } + + inline MonitorRequest& operator=(MonitorRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MonitorRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MonitorRequest* internal_default_instance() { + return reinterpret_cast( + &_MonitorRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(MonitorRequest* other); + friend void swap(MonitorRequest& a, MonitorRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MonitorRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + MonitorRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MonitorRequest& from); + void MergeFrom(const MonitorRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MonitorRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // uint64 duration_ms = 1; + void clear_duration_ms(); + static const int kDurationMsFieldNumber = 1; + ::google::protobuf::uint64 duration_ms() const; + void set_duration_ms(::google::protobuf::uint64 value); + + // int32 monitoring_level = 2; + void clear_monitoring_level(); + static const int kMonitoringLevelFieldNumber = 2; + ::google::protobuf::int32 monitoring_level() const; + void set_monitoring_level(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MonitorRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint64 duration_ms_; + ::google::protobuf::int32 monitoring_level_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MonitorResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MonitorResponse) */ { + public: + MonitorResponse(); + virtual ~MonitorResponse(); + + MonitorResponse(const MonitorResponse& from); + + inline MonitorResponse& operator=(const MonitorResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MonitorResponse(MonitorResponse&& from) noexcept + : MonitorResponse() { + *this = ::std::move(from); + } + + inline MonitorResponse& operator=(MonitorResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MonitorResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MonitorResponse* internal_default_instance() { + return reinterpret_cast( + &_MonitorResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void Swap(MonitorResponse* other); + friend void swap(MonitorResponse& a, MonitorResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MonitorResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + MonitorResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MonitorResponse& from); + void MergeFrom(const MonitorResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MonitorResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string data = 1; + void clear_data(); + static const int kDataFieldNumber = 1; + const ::std::string& data() const; + void set_data(const ::std::string& value); + #if LANG_CXX11 + void set_data(::std::string&& value); + #endif + void set_data(const char* value); + void set_data(const char* value, size_t size); + ::std::string* mutable_data(); + ::std::string* release_data(); + void set_allocated_data(::std::string* data); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MonitorResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ProfileOptions + +// bool include_dataset_ops = 1; +inline void ProfileOptions::clear_include_dataset_ops() { + include_dataset_ops_ = false; +} +inline bool ProfileOptions::include_dataset_ops() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileOptions.include_dataset_ops) + return include_dataset_ops_; +} +inline void ProfileOptions::set_include_dataset_ops(bool value) { + + include_dataset_ops_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileOptions.include_dataset_ops) +} + +// ------------------------------------------------------------------- + +// ToolRequestOptions + +// string output_formats = 2; +inline void ToolRequestOptions::clear_output_formats() { + output_formats_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ToolRequestOptions::output_formats() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ToolRequestOptions.output_formats) + return output_formats_.GetNoArena(); +} +inline void ToolRequestOptions::set_output_formats(const ::std::string& value) { + + output_formats_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ToolRequestOptions.output_formats) +} +#if LANG_CXX11 +inline void ToolRequestOptions::set_output_formats(::std::string&& value) { + + output_formats_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ToolRequestOptions.output_formats) +} +#endif +inline void ToolRequestOptions::set_output_formats(const char* value) { + GOOGLE_DCHECK(value != NULL); + + output_formats_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ToolRequestOptions.output_formats) +} +inline void ToolRequestOptions::set_output_formats(const char* value, size_t size) { + + output_formats_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ToolRequestOptions.output_formats) +} +inline ::std::string* ToolRequestOptions::mutable_output_formats() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ToolRequestOptions.output_formats) + return output_formats_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ToolRequestOptions::release_output_formats() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ToolRequestOptions.output_formats) + + return output_formats_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ToolRequestOptions::set_allocated_output_formats(::std::string* output_formats) { + if (output_formats != NULL) { + + } else { + + } + output_formats_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_formats); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ToolRequestOptions.output_formats) +} + +// bool save_to_repo = 3; +inline void ToolRequestOptions::clear_save_to_repo() { + save_to_repo_ = false; +} +inline bool ToolRequestOptions::save_to_repo() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ToolRequestOptions.save_to_repo) + return save_to_repo_; +} +inline void ToolRequestOptions::set_save_to_repo(bool value) { + + save_to_repo_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ToolRequestOptions.save_to_repo) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ProfileRequest + +// uint64 duration_ms = 1; +inline void ProfileRequest::clear_duration_ms() { + duration_ms_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 ProfileRequest::duration_ms() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileRequest.duration_ms) + return duration_ms_; +} +inline void ProfileRequest::set_duration_ms(::google::protobuf::uint64 value) { + + duration_ms_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileRequest.duration_ms) +} + +// uint64 max_events = 2; +inline void ProfileRequest::clear_max_events() { + max_events_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 ProfileRequest::max_events() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileRequest.max_events) + return max_events_; +} +inline void ProfileRequest::set_max_events(::google::protobuf::uint64 value) { + + max_events_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileRequest.max_events) +} + +// repeated string tools = 3; +inline int ProfileRequest::tools_size() const { + return tools_.size(); +} +inline void ProfileRequest::clear_tools() { + tools_.Clear(); +} +inline const ::std::string& ProfileRequest::tools(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileRequest.tools) + return tools_.Get(index); +} +inline ::std::string* ProfileRequest::mutable_tools(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileRequest.tools) + return tools_.Mutable(index); +} +inline void ProfileRequest::set_tools(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileRequest.tools) + tools_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void ProfileRequest::set_tools(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileRequest.tools) + tools_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void ProfileRequest::set_tools(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + tools_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileRequest.tools) +} +inline void ProfileRequest::set_tools(int index, const char* value, size_t size) { + tools_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileRequest.tools) +} +inline ::std::string* ProfileRequest::add_tools() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.ProfileRequest.tools) + return tools_.Add(); +} +inline void ProfileRequest::add_tools(const ::std::string& value) { + tools_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ProfileRequest.tools) +} +#if LANG_CXX11 +inline void ProfileRequest::add_tools(::std::string&& value) { + tools_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ProfileRequest.tools) +} +#endif +inline void ProfileRequest::add_tools(const char* value) { + GOOGLE_DCHECK(value != NULL); + tools_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.ProfileRequest.tools) +} +inline void ProfileRequest::add_tools(const char* value, size_t size) { + tools_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.ProfileRequest.tools) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ProfileRequest::tools() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ProfileRequest.tools) + return tools_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ProfileRequest::mutable_tools() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ProfileRequest.tools) + return &tools_; +} + +// map tool_options = 8; +inline int ProfileRequest::tool_options_size() const { + return tool_options_.size(); +} +inline void ProfileRequest::clear_tool_options() { + tool_options_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >& +ProfileRequest::tool_options() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.ProfileRequest.tool_options) + return tool_options_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::ToolRequestOptions >* +ProfileRequest::mutable_tool_options() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.ProfileRequest.tool_options) + return tool_options_.MutableMap(); +} + +// .diplomacy.tensorflow.ProfileOptions opts = 4; +inline bool ProfileRequest::has_opts() const { + return this != internal_default_instance() && opts_ != NULL; +} +inline void ProfileRequest::clear_opts() { + if (GetArenaNoVirtual() == NULL && opts_ != NULL) { + delete opts_; + } + opts_ = NULL; +} +inline const ::diplomacy::tensorflow::ProfileOptions& ProfileRequest::_internal_opts() const { + return *opts_; +} +inline const ::diplomacy::tensorflow::ProfileOptions& ProfileRequest::opts() const { + const ::diplomacy::tensorflow::ProfileOptions* p = opts_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileRequest.opts) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_ProfileOptions_default_instance_); +} +inline ::diplomacy::tensorflow::ProfileOptions* ProfileRequest::release_opts() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileRequest.opts) + + ::diplomacy::tensorflow::ProfileOptions* temp = opts_; + opts_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::ProfileOptions* ProfileRequest::mutable_opts() { + + if (opts_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::ProfileOptions>(GetArenaNoVirtual()); + opts_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileRequest.opts) + return opts_; +} +inline void ProfileRequest::set_allocated_opts(::diplomacy::tensorflow::ProfileOptions* opts) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete opts_; + } + if (opts) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + opts = ::google::protobuf::internal::GetOwnedMessage( + message_arena, opts, submessage_arena); + } + + } else { + + } + opts_ = opts; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileRequest.opts) +} + +// string repository_root = 5; +inline void ProfileRequest::clear_repository_root() { + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileRequest::repository_root() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileRequest.repository_root) + return repository_root_.GetNoArena(); +} +inline void ProfileRequest::set_repository_root(const ::std::string& value) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileRequest.repository_root) +} +#if LANG_CXX11 +inline void ProfileRequest::set_repository_root(::std::string&& value) { + + repository_root_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileRequest.repository_root) +} +#endif +inline void ProfileRequest::set_repository_root(const char* value) { + GOOGLE_DCHECK(value != NULL); + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileRequest.repository_root) +} +inline void ProfileRequest::set_repository_root(const char* value, size_t size) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileRequest.repository_root) +} +inline ::std::string* ProfileRequest::mutable_repository_root() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileRequest.repository_root) + return repository_root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileRequest::release_repository_root() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileRequest.repository_root) + + return repository_root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileRequest::set_allocated_repository_root(::std::string* repository_root) { + if (repository_root != NULL) { + + } else { + + } + repository_root_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), repository_root); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileRequest.repository_root) +} + +// string session_id = 6; +inline void ProfileRequest::clear_session_id() { + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileRequest::session_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileRequest.session_id) + return session_id_.GetNoArena(); +} +inline void ProfileRequest::set_session_id(const ::std::string& value) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileRequest.session_id) +} +#if LANG_CXX11 +inline void ProfileRequest::set_session_id(::std::string&& value) { + + session_id_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileRequest.session_id) +} +#endif +inline void ProfileRequest::set_session_id(const char* value) { + GOOGLE_DCHECK(value != NULL); + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileRequest.session_id) +} +inline void ProfileRequest::set_session_id(const char* value, size_t size) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileRequest.session_id) +} +inline ::std::string* ProfileRequest::mutable_session_id() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileRequest.session_id) + return session_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileRequest::release_session_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileRequest.session_id) + + return session_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileRequest::set_allocated_session_id(::std::string* session_id) { + if (session_id != NULL) { + + } else { + + } + session_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), session_id); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileRequest.session_id) +} + +// string host_name = 7; +inline void ProfileRequest::clear_host_name() { + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileRequest::host_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileRequest.host_name) + return host_name_.GetNoArena(); +} +inline void ProfileRequest::set_host_name(const ::std::string& value) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileRequest.host_name) +} +#if LANG_CXX11 +inline void ProfileRequest::set_host_name(::std::string&& value) { + + host_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileRequest.host_name) +} +#endif +inline void ProfileRequest::set_host_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileRequest.host_name) +} +inline void ProfileRequest::set_host_name(const char* value, size_t size) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileRequest.host_name) +} +inline ::std::string* ProfileRequest::mutable_host_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileRequest.host_name) + return host_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileRequest::release_host_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileRequest.host_name) + + return host_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileRequest::set_allocated_host_name(::std::string* host_name) { + if (host_name != NULL) { + + } else { + + } + host_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileRequest.host_name) +} + +// ------------------------------------------------------------------- + +// ProfileToolData + +// string name = 1; +inline void ProfileToolData::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileToolData::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileToolData.name) + return name_.GetNoArena(); +} +inline void ProfileToolData::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileToolData.name) +} +#if LANG_CXX11 +inline void ProfileToolData::set_name(::std::string&& value) { + + name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileToolData.name) +} +#endif +inline void ProfileToolData::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileToolData.name) +} +inline void ProfileToolData::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileToolData.name) +} +inline ::std::string* ProfileToolData::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileToolData.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileToolData::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileToolData.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileToolData::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileToolData.name) +} + +// bytes data = 2; +inline void ProfileToolData::clear_data() { + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileToolData::data() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileToolData.data) + return data_.GetNoArena(); +} +inline void ProfileToolData::set_data(const ::std::string& value) { + + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileToolData.data) +} +#if LANG_CXX11 +inline void ProfileToolData::set_data(::std::string&& value) { + + data_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileToolData.data) +} +#endif +inline void ProfileToolData::set_data(const char* value) { + GOOGLE_DCHECK(value != NULL); + + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileToolData.data) +} +inline void ProfileToolData::set_data(const void* value, size_t size) { + + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileToolData.data) +} +inline ::std::string* ProfileToolData::mutable_data() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileToolData.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileToolData::release_data() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileToolData.data) + + return data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileToolData::set_allocated_data(::std::string* data) { + if (data != NULL) { + + } else { + + } + data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileToolData.data) +} + +// ------------------------------------------------------------------- + +// ProfileResponse + +// repeated .diplomacy.tensorflow.GraphDef computation_graph = 2; +inline int ProfileResponse::computation_graph_size() const { + return computation_graph_.size(); +} +inline ::diplomacy::tensorflow::GraphDef* ProfileResponse::mutable_computation_graph(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileResponse.computation_graph) + return computation_graph_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphDef >* +ProfileResponse::mutable_computation_graph() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ProfileResponse.computation_graph) + return &computation_graph_; +} +inline const ::diplomacy::tensorflow::GraphDef& ProfileResponse::computation_graph(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileResponse.computation_graph) + return computation_graph_.Get(index); +} +inline ::diplomacy::tensorflow::GraphDef* ProfileResponse::add_computation_graph() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ProfileResponse.computation_graph) + return computation_graph_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphDef >& +ProfileResponse::computation_graph() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ProfileResponse.computation_graph) + return computation_graph_; +} + +// .diplomacy.tensorflow.RunMetadata hlo_metadata = 5; +inline bool ProfileResponse::has_hlo_metadata() const { + return this != internal_default_instance() && hlo_metadata_ != NULL; +} +inline const ::diplomacy::tensorflow::RunMetadata& ProfileResponse::_internal_hlo_metadata() const { + return *hlo_metadata_; +} +inline const ::diplomacy::tensorflow::RunMetadata& ProfileResponse::hlo_metadata() const { + const ::diplomacy::tensorflow::RunMetadata* p = hlo_metadata_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileResponse.hlo_metadata) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_RunMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::RunMetadata* ProfileResponse::release_hlo_metadata() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileResponse.hlo_metadata) + + ::diplomacy::tensorflow::RunMetadata* temp = hlo_metadata_; + hlo_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::RunMetadata* ProfileResponse::mutable_hlo_metadata() { + + if (hlo_metadata_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::RunMetadata>(GetArenaNoVirtual()); + hlo_metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileResponse.hlo_metadata) + return hlo_metadata_; +} +inline void ProfileResponse::set_allocated_hlo_metadata(::diplomacy::tensorflow::RunMetadata* hlo_metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(hlo_metadata_); + } + if (hlo_metadata) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(hlo_metadata)->GetArena(); + if (message_arena != submessage_arena) { + hlo_metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, hlo_metadata, submessage_arena); + } + + } else { + + } + hlo_metadata_ = hlo_metadata; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileResponse.hlo_metadata) +} + +// bytes encoded_trace = 3; +inline void ProfileResponse::clear_encoded_trace() { + encoded_trace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileResponse::encoded_trace() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileResponse.encoded_trace) + return encoded_trace_.GetNoArena(); +} +inline void ProfileResponse::set_encoded_trace(const ::std::string& value) { + + encoded_trace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileResponse.encoded_trace) +} +#if LANG_CXX11 +inline void ProfileResponse::set_encoded_trace(::std::string&& value) { + + encoded_trace_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileResponse.encoded_trace) +} +#endif +inline void ProfileResponse::set_encoded_trace(const char* value) { + GOOGLE_DCHECK(value != NULL); + + encoded_trace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileResponse.encoded_trace) +} +inline void ProfileResponse::set_encoded_trace(const void* value, size_t size) { + + encoded_trace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileResponse.encoded_trace) +} +inline ::std::string* ProfileResponse::mutable_encoded_trace() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileResponse.encoded_trace) + return encoded_trace_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileResponse::release_encoded_trace() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileResponse.encoded_trace) + + return encoded_trace_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileResponse::set_allocated_encoded_trace(::std::string* encoded_trace) { + if (encoded_trace != NULL) { + + } else { + + } + encoded_trace_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), encoded_trace); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileResponse.encoded_trace) +} + +// .diplomacy.tensorflow.tpu.op_profile.Profile op_profile = 4; +inline bool ProfileResponse::has_op_profile() const { + return this != internal_default_instance() && op_profile_ != NULL; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Profile& ProfileResponse::_internal_op_profile() const { + return *op_profile_; +} +inline const ::diplomacy::tensorflow::tpu::op_profile::Profile& ProfileResponse::op_profile() const { + const ::diplomacy::tensorflow::tpu::op_profile::Profile* p = op_profile_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileResponse.op_profile) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::op_profile::_Profile_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::op_profile::Profile* ProfileResponse::release_op_profile() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileResponse.op_profile) + + ::diplomacy::tensorflow::tpu::op_profile::Profile* temp = op_profile_; + op_profile_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::op_profile::Profile* ProfileResponse::mutable_op_profile() { + + if (op_profile_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::op_profile::Profile>(GetArenaNoVirtual()); + op_profile_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileResponse.op_profile) + return op_profile_; +} +inline void ProfileResponse::set_allocated_op_profile(::diplomacy::tensorflow::tpu::op_profile::Profile* op_profile) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(op_profile_); + } + if (op_profile) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + op_profile = ::google::protobuf::internal::GetOwnedMessage( + message_arena, op_profile, submessage_arena); + } + + } else { + + } + op_profile_ = op_profile; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileResponse.op_profile) +} + +// repeated .diplomacy.tensorflow.ProfileToolData tool_data = 6; +inline int ProfileResponse::tool_data_size() const { + return tool_data_.size(); +} +inline void ProfileResponse::clear_tool_data() { + tool_data_.Clear(); +} +inline ::diplomacy::tensorflow::ProfileToolData* ProfileResponse::mutable_tool_data(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileResponse.tool_data) + return tool_data_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileToolData >* +ProfileResponse::mutable_tool_data() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ProfileResponse.tool_data) + return &tool_data_; +} +inline const ::diplomacy::tensorflow::ProfileToolData& ProfileResponse::tool_data(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileResponse.tool_data) + return tool_data_.Get(index); +} +inline ::diplomacy::tensorflow::ProfileToolData* ProfileResponse::add_tool_data() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ProfileResponse.tool_data) + return tool_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileToolData >& +ProfileResponse::tool_data() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ProfileResponse.tool_data) + return tool_data_; +} + +// bool empty_trace = 7; +inline void ProfileResponse::clear_empty_trace() { + empty_trace_ = false; +} +inline bool ProfileResponse::empty_trace() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileResponse.empty_trace) + return empty_trace_; +} +inline void ProfileResponse::set_empty_trace(bool value) { + + empty_trace_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileResponse.empty_trace) +} + +// ------------------------------------------------------------------- + +// MonitorRequest + +// uint64 duration_ms = 1; +inline void MonitorRequest::clear_duration_ms() { + duration_ms_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 MonitorRequest::duration_ms() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MonitorRequest.duration_ms) + return duration_ms_; +} +inline void MonitorRequest::set_duration_ms(::google::protobuf::uint64 value) { + + duration_ms_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MonitorRequest.duration_ms) +} + +// int32 monitoring_level = 2; +inline void MonitorRequest::clear_monitoring_level() { + monitoring_level_ = 0; +} +inline ::google::protobuf::int32 MonitorRequest::monitoring_level() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MonitorRequest.monitoring_level) + return monitoring_level_; +} +inline void MonitorRequest::set_monitoring_level(::google::protobuf::int32 value) { + + monitoring_level_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MonitorRequest.monitoring_level) +} + +// ------------------------------------------------------------------- + +// MonitorResponse + +// string data = 1; +inline void MonitorResponse::clear_data() { + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& MonitorResponse::data() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MonitorResponse.data) + return data_.GetNoArena(); +} +inline void MonitorResponse::set_data(const ::std::string& value) { + + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MonitorResponse.data) +} +#if LANG_CXX11 +inline void MonitorResponse::set_data(::std::string&& value) { + + data_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MonitorResponse.data) +} +#endif +inline void MonitorResponse::set_data(const char* value) { + GOOGLE_DCHECK(value != NULL); + + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MonitorResponse.data) +} +inline void MonitorResponse::set_data(const char* value, size_t size) { + + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MonitorResponse.data) +} +inline ::std::string* MonitorResponse::mutable_data() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MonitorResponse.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* MonitorResponse::release_data() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MonitorResponse.data) + + return data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MonitorResponse::set_allocated_data(::std::string* data) { + if (data != NULL) { + + } else { + + } + data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MonitorResponse.data) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.proto new file mode 100644 index 0000000..24c530d --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; +package diplomacy.tensorflow; + +import "diplomacy_tensorflow/core/framework/graph.proto"; +import "diplomacy_tensorflow/core/protobuf/config.proto"; +import "diplomacy_tensorflow/contrib/tpu/profiler/op_profile.proto"; + +// The TPUProfiler service retrieves performance information about +// the programs running on connected TPUs over a period of time. +service TPUProfiler { + // Starts a profiling session, blocks until it completes, and returns data. + rpc Profile(ProfileRequest) returns (ProfileResponse) { + } + // Collects profiling data and returns user-friendly metrics. + rpc Monitor(MonitorRequest) returns (MonitorResponse) { + } +} + +message ProfileOptions { + // We don't collect the dataset ops by default for better trace-viewer + // scalability. The caller can mannually set this field to include the ops. + bool include_dataset_ops = 1; + + // next-field: 2 +} + +message ToolRequestOptions { + // Required formats for the tool, it should be one of "json", "proto", "raw" + // etc. If not specified (backward compatible), use default format, i.e. most + // tools use json format. + string output_formats = 2; + + // Whether save the result directly to repository or pass it back to caller. + // Default to false for backward compatibilities. + bool save_to_repo = 3; +} + +message ProfileRequest { + // In future, the caller will be able to customize when profiling starts and + // stops. For now, it collects `duration_ms` milliseconds worth of data. + uint64 duration_ms = 1; + + // The maximum number of events to return. By default (value 0), return all + // events. + uint64 max_events = 2; + + // Required profiling tools name such as "input_pipeline_analyzer" etc + repeated string tools = 3; + + // Specifies the requirement for each tools. + map tool_options = 8; + + // Optional profiling options that control how a TF session will be profiled. + ProfileOptions opts = 4; + + // The place where we will dump profile data. We will normally use + // MODEL_DIR/plugin/profile/ as our repository root. + string repository_root = 5; + + // The user provided profile session identifier. + string session_id = 6; + + // The hostname of system where the profile should happen. + // We use it as identifier in part of our output filename. + string host_name = 7; + + // In future, the caller will indicate which TF session is being profiled, and + // only data relating to that program will be returned. For now, we assume + // all activity during the profiling period is relevant. + // next-field: 9 +} + +message ProfileToolData { + // The file name which this data is associated (e.g. "input_pipeline.json", + // "cluster_xxx.memory_viewer.json"). + string name = 1; + + // The data payload (likely json) for the specific tool. + bytes data = 2; +} + +message ProfileResponse { + reserved 1; // was uint64 placeholder for returning something meaningful. + // Graphs of programs executed on TPUs during the profiling period. + repeated GraphDef computation_graph = 2; + + // Performance profile that can be used to annotate HLO operations in the + // computation graph. + RunMetadata hlo_metadata = 5; + + // Encoded Trace proto message that contains metadata about the trace captured + // during the profiling period. Describes the devices and resources that + // 'trace_events' refers to. + bytes encoded_trace = 3; + + // Assembles a hierarchical performance profile based on HLOs in trace events. + // If the trace covers multiple programs, the longest-running one is analyzed. + // See op_profile.proto for the detailed semantics of the returned profile. + tpu.op_profile.Profile op_profile = 4; + + // Data payload for each required tools. + repeated ProfileToolData tool_data = 6; + + // When we write profiling data directly to repository directory, we need a + // way to figure out whether the captured trace is empty (due to idle TPU). + bool empty_trace = 7; + + // next-field: 8 +} + +message MonitorRequest { + // Duration for which to profile between each update. + uint64 duration_ms = 1; + + // Indicates the level at which we want to monitor. Currently, two levels are + // supported: + // Level 1: An ultra lightweight mode that captures only some utilization + // metrics. + // Level 2: More verbose than level 1. Collects utilization metrics, device + // information, step time information, etc. Do not use this option if the TPU + // host is being very heavily used. + int32 monitoring_level = 2; + + // next-field: 3 +} + +message MonitorResponse { + // Properly formatted string data that can be directly returned back to user. + string data = 1; + + // next-field: 2 +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.pb.cc new file mode 100644 index 0000000..f90bfe1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.pb.cc @@ -0,0 +1,2839 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto + +#include "diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_ProfileRequest; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ProfileSessionDataRequest_ParametersEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ProfileSessionInfo; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto +namespace diplomacy { +namespace tensorflow { +class NewProfileSessionRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NewProfileSessionRequest_default_instance_; +class NewProfileSessionResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NewProfileSessionResponse_default_instance_; +class EnumProfileSessionsAndToolsRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _EnumProfileSessionsAndToolsRequest_default_instance_; +class ProfileSessionInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileSessionInfo_default_instance_; +class EnumProfileSessionsAndToolsResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _EnumProfileSessionsAndToolsResponse_default_instance_; +class ProfileSessionDataRequest_ParametersEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileSessionDataRequest_ParametersEntry_DoNotUse_default_instance_; +class ProfileSessionDataRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileSessionDataRequest_default_instance_; +class ProfileSessionDataResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProfileSessionDataResponse_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto { +static void InitDefaultsNewProfileSessionRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NewProfileSessionRequest_default_instance_; + new (ptr) ::diplomacy::tensorflow::NewProfileSessionRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::NewProfileSessionRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_NewProfileSessionRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNewProfileSessionRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_2eproto::scc_info_ProfileRequest.base,}}; + +static void InitDefaultsNewProfileSessionResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NewProfileSessionResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::NewProfileSessionResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::NewProfileSessionResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_NewProfileSessionResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsNewProfileSessionResponse}, {}}; + +static void InitDefaultsEnumProfileSessionsAndToolsRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_EnumProfileSessionsAndToolsRequest_default_instance_; + new (ptr) ::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_EnumProfileSessionsAndToolsRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsEnumProfileSessionsAndToolsRequest}, {}}; + +static void InitDefaultsProfileSessionInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileSessionInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileSessionInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProfileSessionInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ProfileSessionInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsProfileSessionInfo}, {}}; + +static void InitDefaultsEnumProfileSessionsAndToolsResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_EnumProfileSessionsAndToolsResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_EnumProfileSessionsAndToolsResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsEnumProfileSessionsAndToolsResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionInfo.base,}}; + +static void InitDefaultsProfileSessionDataRequest_ParametersEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileSessionDataRequest_ParametersEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse(); + } + ::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ProfileSessionDataRequest_ParametersEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsProfileSessionDataRequest_ParametersEntry_DoNotUse}, {}}; + +static void InitDefaultsProfileSessionDataRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileSessionDataRequest_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileSessionDataRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProfileSessionDataRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ProfileSessionDataRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsProfileSessionDataRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionDataRequest_ParametersEntry_DoNotUse.base,}}; + +static void InitDefaultsProfileSessionDataResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ProfileSessionDataResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::ProfileSessionDataResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ProfileSessionDataResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ProfileSessionDataResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsProfileSessionDataResponse}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_NewProfileSessionRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_NewProfileSessionResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_EnumProfileSessionsAndToolsRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileSessionInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_EnumProfileSessionsAndToolsResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileSessionDataRequest_ParametersEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileSessionDataRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProfileSessionDataResponse.base); +} + +::google::protobuf::Metadata file_level_metadata[8]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionRequest, request_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionRequest, repository_root_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionRequest, hosts_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionRequest, session_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionResponse, error_message_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NewProfileSessionResponse, empty_trace_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest, repository_root_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionInfo, session_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionInfo, available_tools_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse, error_message_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse, sessions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest, repository_root_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest, session_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest, host_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest, tool_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataRequest, parameters_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataResponse, error_message_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataResponse, output_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ProfileSessionDataResponse, output_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::NewProfileSessionRequest)}, + { 9, -1, sizeof(::diplomacy::tensorflow::NewProfileSessionResponse)}, + { 16, -1, sizeof(::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest)}, + { 22, -1, sizeof(::diplomacy::tensorflow::ProfileSessionInfo)}, + { 29, -1, sizeof(::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse)}, + { 36, 43, sizeof(::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse)}, + { 45, -1, sizeof(::diplomacy::tensorflow::ProfileSessionDataRequest)}, + { 55, -1, sizeof(::diplomacy::tensorflow::ProfileSessionDataResponse)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_NewProfileSessionRequest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NewProfileSessionResponse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_EnumProfileSessionsAndToolsRequest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileSessionInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_EnumProfileSessionsAndToolsResponse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileSessionDataRequest_ParametersEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileSessionDataRequest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ProfileSessionDataResponse_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 8); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nEdiplomacy_tensorflow/contrib/tpu/profi" + "ler/tpu_profiler_analysis.proto\022\024diploma" + "cy.tensorflow\032request_ = const_cast< ::diplomacy::tensorflow::ProfileRequest*>( + ::diplomacy::tensorflow::ProfileRequest::internal_default_instance()); +} +void NewProfileSessionRequest::clear_request() { + if (GetArenaNoVirtual() == NULL && request_ != NULL) { + delete request_; + } + request_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NewProfileSessionRequest::kRequestFieldNumber; +const int NewProfileSessionRequest::kRepositoryRootFieldNumber; +const int NewProfileSessionRequest::kHostsFieldNumber; +const int NewProfileSessionRequest::kSessionIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NewProfileSessionRequest::NewProfileSessionRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_NewProfileSessionRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NewProfileSessionRequest) +} +NewProfileSessionRequest::NewProfileSessionRequest(const NewProfileSessionRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + hosts_(from.hosts_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.repository_root().size() > 0) { + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.session_id().size() > 0) { + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } + if (from.has_request()) { + request_ = new ::diplomacy::tensorflow::ProfileRequest(*from.request_); + } else { + request_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NewProfileSessionRequest) +} + +void NewProfileSessionRequest::SharedCtor() { + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + request_ = NULL; +} + +NewProfileSessionRequest::~NewProfileSessionRequest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NewProfileSessionRequest) + SharedDtor(); +} + +void NewProfileSessionRequest::SharedDtor() { + repository_root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete request_; +} + +void NewProfileSessionRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NewProfileSessionRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NewProfileSessionRequest& NewProfileSessionRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_NewProfileSessionRequest.base); + return *internal_default_instance(); +} + + +void NewProfileSessionRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NewProfileSessionRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + hosts_.Clear(); + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && request_ != NULL) { + delete request_; + } + request_ = NULL; + _internal_metadata_.Clear(); +} + +bool NewProfileSessionRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NewProfileSessionRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.ProfileRequest request = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_request())); + } else { + goto handle_unusual; + } + break; + } + + // string repository_root = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_repository_root())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NewProfileSessionRequest.repository_root")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string hosts = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_hosts())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->hosts(this->hosts_size() - 1).data(), + static_cast(this->hosts(this->hosts_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NewProfileSessionRequest.hosts")); + } else { + goto handle_unusual; + } + break; + } + + // string session_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_session_id())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NewProfileSessionRequest.session_id")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NewProfileSessionRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NewProfileSessionRequest) + return false; +#undef DO_ +} + +void NewProfileSessionRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NewProfileSessionRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.ProfileRequest request = 1; + if (this->has_request()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_request(), output); + } + + // string repository_root = 2; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionRequest.repository_root"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->repository_root(), output); + } + + // repeated string hosts = 3; + for (int i = 0, n = this->hosts_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->hosts(i).data(), static_cast(this->hosts(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionRequest.hosts"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->hosts(i), output); + } + + // string session_id = 4; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionRequest.session_id"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->session_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NewProfileSessionRequest) +} + +::google::protobuf::uint8* NewProfileSessionRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NewProfileSessionRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.ProfileRequest request = 1; + if (this->has_request()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_request(), deterministic, target); + } + + // string repository_root = 2; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionRequest.repository_root"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->repository_root(), target); + } + + // repeated string hosts = 3; + for (int i = 0, n = this->hosts_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->hosts(i).data(), static_cast(this->hosts(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionRequest.hosts"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->hosts(i), target); + } + + // string session_id = 4; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionRequest.session_id"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->session_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NewProfileSessionRequest) + return target; +} + +size_t NewProfileSessionRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NewProfileSessionRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string hosts = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->hosts_size()); + for (int i = 0, n = this->hosts_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->hosts(i)); + } + + // string repository_root = 2; + if (this->repository_root().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->repository_root()); + } + + // string session_id = 4; + if (this->session_id().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->session_id()); + } + + // .diplomacy.tensorflow.ProfileRequest request = 1; + if (this->has_request()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *request_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NewProfileSessionRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NewProfileSessionRequest) + GOOGLE_DCHECK_NE(&from, this); + const NewProfileSessionRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NewProfileSessionRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NewProfileSessionRequest) + MergeFrom(*source); + } +} + +void NewProfileSessionRequest::MergeFrom(const NewProfileSessionRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NewProfileSessionRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + hosts_.MergeFrom(from.hosts_); + if (from.repository_root().size() > 0) { + + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } + if (from.session_id().size() > 0) { + + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } + if (from.has_request()) { + mutable_request()->::diplomacy::tensorflow::ProfileRequest::MergeFrom(from.request()); + } +} + +void NewProfileSessionRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NewProfileSessionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NewProfileSessionRequest::CopyFrom(const NewProfileSessionRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NewProfileSessionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NewProfileSessionRequest::IsInitialized() const { + return true; +} + +void NewProfileSessionRequest::Swap(NewProfileSessionRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void NewProfileSessionRequest::InternalSwap(NewProfileSessionRequest* other) { + using std::swap; + hosts_.InternalSwap(CastToBase(&other->hosts_)); + repository_root_.Swap(&other->repository_root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + session_id_.Swap(&other->session_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(request_, other->request_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NewProfileSessionRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void NewProfileSessionResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NewProfileSessionResponse::kErrorMessageFieldNumber; +const int NewProfileSessionResponse::kEmptyTraceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NewProfileSessionResponse::NewProfileSessionResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_NewProfileSessionResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NewProfileSessionResponse) +} +NewProfileSessionResponse::NewProfileSessionResponse(const NewProfileSessionResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.error_message().size() > 0) { + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + empty_trace_ = from.empty_trace_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NewProfileSessionResponse) +} + +void NewProfileSessionResponse::SharedCtor() { + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + empty_trace_ = false; +} + +NewProfileSessionResponse::~NewProfileSessionResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NewProfileSessionResponse) + SharedDtor(); +} + +void NewProfileSessionResponse::SharedDtor() { + error_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void NewProfileSessionResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NewProfileSessionResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NewProfileSessionResponse& NewProfileSessionResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_NewProfileSessionResponse.base); + return *internal_default_instance(); +} + + +void NewProfileSessionResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NewProfileSessionResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + empty_trace_ = false; + _internal_metadata_.Clear(); +} + +bool NewProfileSessionResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NewProfileSessionResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string error_message = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_error_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NewProfileSessionResponse.error_message")); + } else { + goto handle_unusual; + } + break; + } + + // bool empty_trace = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &empty_trace_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NewProfileSessionResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NewProfileSessionResponse) + return false; +#undef DO_ +} + +void NewProfileSessionResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NewProfileSessionResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string error_message = 1; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionResponse.error_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->error_message(), output); + } + + // bool empty_trace = 2; + if (this->empty_trace() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->empty_trace(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NewProfileSessionResponse) +} + +::google::protobuf::uint8* NewProfileSessionResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NewProfileSessionResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string error_message = 1; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NewProfileSessionResponse.error_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->error_message(), target); + } + + // bool empty_trace = 2; + if (this->empty_trace() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->empty_trace(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NewProfileSessionResponse) + return target; +} + +size_t NewProfileSessionResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NewProfileSessionResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string error_message = 1; + if (this->error_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->error_message()); + } + + // bool empty_trace = 2; + if (this->empty_trace() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NewProfileSessionResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NewProfileSessionResponse) + GOOGLE_DCHECK_NE(&from, this); + const NewProfileSessionResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NewProfileSessionResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NewProfileSessionResponse) + MergeFrom(*source); + } +} + +void NewProfileSessionResponse::MergeFrom(const NewProfileSessionResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NewProfileSessionResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.error_message().size() > 0) { + + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + if (from.empty_trace() != 0) { + set_empty_trace(from.empty_trace()); + } +} + +void NewProfileSessionResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NewProfileSessionResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NewProfileSessionResponse::CopyFrom(const NewProfileSessionResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NewProfileSessionResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NewProfileSessionResponse::IsInitialized() const { + return true; +} + +void NewProfileSessionResponse::Swap(NewProfileSessionResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void NewProfileSessionResponse::InternalSwap(NewProfileSessionResponse* other) { + using std::swap; + error_message_.Swap(&other->error_message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(empty_trace_, other->empty_trace_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NewProfileSessionResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void EnumProfileSessionsAndToolsRequest::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EnumProfileSessionsAndToolsRequest::kRepositoryRootFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EnumProfileSessionsAndToolsRequest::EnumProfileSessionsAndToolsRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_EnumProfileSessionsAndToolsRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) +} +EnumProfileSessionsAndToolsRequest::EnumProfileSessionsAndToolsRequest(const EnumProfileSessionsAndToolsRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.repository_root().size() > 0) { + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) +} + +void EnumProfileSessionsAndToolsRequest::SharedCtor() { + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +EnumProfileSessionsAndToolsRequest::~EnumProfileSessionsAndToolsRequest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + SharedDtor(); +} + +void EnumProfileSessionsAndToolsRequest::SharedDtor() { + repository_root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void EnumProfileSessionsAndToolsRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* EnumProfileSessionsAndToolsRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const EnumProfileSessionsAndToolsRequest& EnumProfileSessionsAndToolsRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_EnumProfileSessionsAndToolsRequest.base); + return *internal_default_instance(); +} + + +void EnumProfileSessionsAndToolsRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool EnumProfileSessionsAndToolsRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string repository_root = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_repository_root())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + return false; +#undef DO_ +} + +void EnumProfileSessionsAndToolsRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string repository_root = 1; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->repository_root(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) +} + +::google::protobuf::uint8* EnumProfileSessionsAndToolsRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string repository_root = 1; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->repository_root(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + return target; +} + +size_t EnumProfileSessionsAndToolsRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string repository_root = 1; + if (this->repository_root().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->repository_root()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void EnumProfileSessionsAndToolsRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + GOOGLE_DCHECK_NE(&from, this); + const EnumProfileSessionsAndToolsRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + MergeFrom(*source); + } +} + +void EnumProfileSessionsAndToolsRequest::MergeFrom(const EnumProfileSessionsAndToolsRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.repository_root().size() > 0) { + + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } +} + +void EnumProfileSessionsAndToolsRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EnumProfileSessionsAndToolsRequest::CopyFrom(const EnumProfileSessionsAndToolsRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EnumProfileSessionsAndToolsRequest::IsInitialized() const { + return true; +} + +void EnumProfileSessionsAndToolsRequest::Swap(EnumProfileSessionsAndToolsRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void EnumProfileSessionsAndToolsRequest::InternalSwap(EnumProfileSessionsAndToolsRequest* other) { + using std::swap; + repository_root_.Swap(&other->repository_root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata EnumProfileSessionsAndToolsRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ProfileSessionInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProfileSessionInfo::kSessionIdFieldNumber; +const int ProfileSessionInfo::kAvailableToolsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProfileSessionInfo::ProfileSessionInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProfileSessionInfo) +} +ProfileSessionInfo::ProfileSessionInfo(const ProfileSessionInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + available_tools_(from.available_tools_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.session_id().size() > 0) { + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProfileSessionInfo) +} + +void ProfileSessionInfo::SharedCtor() { + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ProfileSessionInfo::~ProfileSessionInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProfileSessionInfo) + SharedDtor(); +} + +void ProfileSessionInfo::SharedDtor() { + session_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ProfileSessionInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProfileSessionInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProfileSessionInfo& ProfileSessionInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionInfo.base); + return *internal_default_instance(); +} + + +void ProfileSessionInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProfileSessionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + available_tools_.Clear(); + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool ProfileSessionInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProfileSessionInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string session_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_session_id())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionInfo.session_id")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string available_tools = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_available_tools())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->available_tools(this->available_tools_size() - 1).data(), + static_cast(this->available_tools(this->available_tools_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionInfo.available_tools")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProfileSessionInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProfileSessionInfo) + return false; +#undef DO_ +} + +void ProfileSessionInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProfileSessionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string session_id = 1; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionInfo.session_id"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->session_id(), output); + } + + // repeated string available_tools = 2; + for (int i = 0, n = this->available_tools_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->available_tools(i).data(), static_cast(this->available_tools(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionInfo.available_tools"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->available_tools(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProfileSessionInfo) +} + +::google::protobuf::uint8* ProfileSessionInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProfileSessionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string session_id = 1; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionInfo.session_id"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->session_id(), target); + } + + // repeated string available_tools = 2; + for (int i = 0, n = this->available_tools_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->available_tools(i).data(), static_cast(this->available_tools(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionInfo.available_tools"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(2, this->available_tools(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProfileSessionInfo) + return target; +} + +size_t ProfileSessionInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProfileSessionInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string available_tools = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->available_tools_size()); + for (int i = 0, n = this->available_tools_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->available_tools(i)); + } + + // string session_id = 1; + if (this->session_id().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->session_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProfileSessionInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProfileSessionInfo) + GOOGLE_DCHECK_NE(&from, this); + const ProfileSessionInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProfileSessionInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProfileSessionInfo) + MergeFrom(*source); + } +} + +void ProfileSessionInfo::MergeFrom(const ProfileSessionInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProfileSessionInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + available_tools_.MergeFrom(from.available_tools_); + if (from.session_id().size() > 0) { + + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } +} + +void ProfileSessionInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProfileSessionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProfileSessionInfo::CopyFrom(const ProfileSessionInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProfileSessionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProfileSessionInfo::IsInitialized() const { + return true; +} + +void ProfileSessionInfo::Swap(ProfileSessionInfo* other) { + if (other == this) return; + InternalSwap(other); +} +void ProfileSessionInfo::InternalSwap(ProfileSessionInfo* other) { + using std::swap; + available_tools_.InternalSwap(CastToBase(&other->available_tools_)); + session_id_.Swap(&other->session_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProfileSessionInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void EnumProfileSessionsAndToolsResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EnumProfileSessionsAndToolsResponse::kErrorMessageFieldNumber; +const int EnumProfileSessionsAndToolsResponse::kSessionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EnumProfileSessionsAndToolsResponse::EnumProfileSessionsAndToolsResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_EnumProfileSessionsAndToolsResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) +} +EnumProfileSessionsAndToolsResponse::EnumProfileSessionsAndToolsResponse(const EnumProfileSessionsAndToolsResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + sessions_(from.sessions_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.error_message().size() > 0) { + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) +} + +void EnumProfileSessionsAndToolsResponse::SharedCtor() { + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +EnumProfileSessionsAndToolsResponse::~EnumProfileSessionsAndToolsResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + SharedDtor(); +} + +void EnumProfileSessionsAndToolsResponse::SharedDtor() { + error_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void EnumProfileSessionsAndToolsResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* EnumProfileSessionsAndToolsResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const EnumProfileSessionsAndToolsResponse& EnumProfileSessionsAndToolsResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_EnumProfileSessionsAndToolsResponse.base); + return *internal_default_instance(); +} + + +void EnumProfileSessionsAndToolsResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + sessions_.Clear(); + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool EnumProfileSessionsAndToolsResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string error_message = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_error_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.ProfileSessionInfo sessions = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_sessions())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + return false; +#undef DO_ +} + +void EnumProfileSessionsAndToolsResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string error_message = 1; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->error_message(), output); + } + + // repeated .diplomacy.tensorflow.ProfileSessionInfo sessions = 2; + for (unsigned int i = 0, + n = static_cast(this->sessions_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->sessions(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) +} + +::google::protobuf::uint8* EnumProfileSessionsAndToolsResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string error_message = 1; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->error_message(), target); + } + + // repeated .diplomacy.tensorflow.ProfileSessionInfo sessions = 2; + for (unsigned int i = 0, + n = static_cast(this->sessions_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->sessions(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + return target; +} + +size_t EnumProfileSessionsAndToolsResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.ProfileSessionInfo sessions = 2; + { + unsigned int count = static_cast(this->sessions_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->sessions(static_cast(i))); + } + } + + // string error_message = 1; + if (this->error_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->error_message()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void EnumProfileSessionsAndToolsResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + GOOGLE_DCHECK_NE(&from, this); + const EnumProfileSessionsAndToolsResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + MergeFrom(*source); + } +} + +void EnumProfileSessionsAndToolsResponse::MergeFrom(const EnumProfileSessionsAndToolsResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + sessions_.MergeFrom(from.sessions_); + if (from.error_message().size() > 0) { + + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } +} + +void EnumProfileSessionsAndToolsResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EnumProfileSessionsAndToolsResponse::CopyFrom(const EnumProfileSessionsAndToolsResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EnumProfileSessionsAndToolsResponse::IsInitialized() const { + return true; +} + +void EnumProfileSessionsAndToolsResponse::Swap(EnumProfileSessionsAndToolsResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void EnumProfileSessionsAndToolsResponse::InternalSwap(EnumProfileSessionsAndToolsResponse* other) { + using std::swap; + CastToBase(&sessions_)->InternalSwap(CastToBase(&other->sessions_)); + error_message_.Swap(&other->error_message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata EnumProfileSessionsAndToolsResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +ProfileSessionDataRequest_ParametersEntry_DoNotUse::ProfileSessionDataRequest_ParametersEntry_DoNotUse() {} +ProfileSessionDataRequest_ParametersEntry_DoNotUse::ProfileSessionDataRequest_ParametersEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void ProfileSessionDataRequest_ParametersEntry_DoNotUse::MergeFrom(const ProfileSessionDataRequest_ParametersEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata ProfileSessionDataRequest_ParametersEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[5]; +} +void ProfileSessionDataRequest_ParametersEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void ProfileSessionDataRequest::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProfileSessionDataRequest::kRepositoryRootFieldNumber; +const int ProfileSessionDataRequest::kSessionIdFieldNumber; +const int ProfileSessionDataRequest::kHostNameFieldNumber; +const int ProfileSessionDataRequest::kToolNameFieldNumber; +const int ProfileSessionDataRequest::kParametersFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProfileSessionDataRequest::ProfileSessionDataRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionDataRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProfileSessionDataRequest) +} +ProfileSessionDataRequest::ProfileSessionDataRequest(const ProfileSessionDataRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + parameters_.MergeFrom(from.parameters_); + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.repository_root().size() > 0) { + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.session_id().size() > 0) { + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } + tool_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tool_name().size() > 0) { + tool_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tool_name_); + } + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.host_name().size() > 0) { + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProfileSessionDataRequest) +} + +void ProfileSessionDataRequest::SharedCtor() { + repository_root_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tool_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ProfileSessionDataRequest::~ProfileSessionDataRequest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProfileSessionDataRequest) + SharedDtor(); +} + +void ProfileSessionDataRequest::SharedDtor() { + repository_root_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tool_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + host_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ProfileSessionDataRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProfileSessionDataRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProfileSessionDataRequest& ProfileSessionDataRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionDataRequest.base); + return *internal_default_instance(); +} + + +void ProfileSessionDataRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProfileSessionDataRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + parameters_.Clear(); + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tool_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool ProfileSessionDataRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProfileSessionDataRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string repository_root = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_repository_root())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataRequest.repository_root")); + } else { + goto handle_unusual; + } + break; + } + + // string session_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_session_id())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataRequest.session_id")); + } else { + goto handle_unusual; + } + break; + } + + // string tool_name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tool_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tool_name().data(), static_cast(this->tool_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataRequest.tool_name")); + } else { + goto handle_unusual; + } + break; + } + + // map parameters = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + ProfileSessionDataRequest_ParametersEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + ProfileSessionDataRequest_ParametersEntry_DoNotUse, + ::std::string, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::google::protobuf::Map< ::std::string, ::std::string > > parser(¶meters_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataRequest.ParametersEntry.key")); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.value().data(), static_cast(parser.value().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataRequest.ParametersEntry.value")); + } else { + goto handle_unusual; + } + break; + } + + // string host_name = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_host_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataRequest.host_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProfileSessionDataRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProfileSessionDataRequest) + return false; +#undef DO_ +} + +void ProfileSessionDataRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProfileSessionDataRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string repository_root = 1; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.repository_root"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->repository_root(), output); + } + + // string session_id = 2; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.session_id"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->session_id(), output); + } + + // string tool_name = 3; + if (this->tool_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tool_name().data(), static_cast(this->tool_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.tool_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->tool_name(), output); + } + + // map parameters = 4; + if (!this->parameters().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.ParametersEntry.key"); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.ParametersEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->parameters().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->parameters().size()]); + typedef ::google::protobuf::Map< ::std::string, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->parameters().begin(); + it != this->parameters().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(parameters_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->parameters().begin(); + it != this->parameters().end(); ++it) { + entry.reset(parameters_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + Utf8Check::Check(&*it); + } + } + } + + // string host_name = 5; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.host_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->host_name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProfileSessionDataRequest) +} + +::google::protobuf::uint8* ProfileSessionDataRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProfileSessionDataRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string repository_root = 1; + if (this->repository_root().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->repository_root().data(), static_cast(this->repository_root().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.repository_root"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->repository_root(), target); + } + + // string session_id = 2; + if (this->session_id().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->session_id().data(), static_cast(this->session_id().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.session_id"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->session_id(), target); + } + + // string tool_name = 3; + if (this->tool_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tool_name().data(), static_cast(this->tool_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.tool_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->tool_name(), target); + } + + // map parameters = 4; + if (!this->parameters().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.ParametersEntry.key"); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.ParametersEntry.value"); + } + }; + + if (deterministic && + this->parameters().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->parameters().size()]); + typedef ::google::protobuf::Map< ::std::string, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->parameters().begin(); + it != this->parameters().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(parameters_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->parameters().begin(); + it != this->parameters().end(); ++it) { + entry.reset(parameters_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + Utf8Check::Check(&*it); + } + } + } + + // string host_name = 5; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataRequest.host_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->host_name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProfileSessionDataRequest) + return target; +} + +size_t ProfileSessionDataRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProfileSessionDataRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map parameters = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->parameters_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->parameters().begin(); + it != this->parameters().end(); ++it) { + entry.reset(parameters_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + // string repository_root = 1; + if (this->repository_root().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->repository_root()); + } + + // string session_id = 2; + if (this->session_id().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->session_id()); + } + + // string tool_name = 3; + if (this->tool_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tool_name()); + } + + // string host_name = 5; + if (this->host_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->host_name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProfileSessionDataRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProfileSessionDataRequest) + GOOGLE_DCHECK_NE(&from, this); + const ProfileSessionDataRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProfileSessionDataRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProfileSessionDataRequest) + MergeFrom(*source); + } +} + +void ProfileSessionDataRequest::MergeFrom(const ProfileSessionDataRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProfileSessionDataRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + parameters_.MergeFrom(from.parameters_); + if (from.repository_root().size() > 0) { + + repository_root_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.repository_root_); + } + if (from.session_id().size() > 0) { + + session_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.session_id_); + } + if (from.tool_name().size() > 0) { + + tool_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tool_name_); + } + if (from.host_name().size() > 0) { + + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } +} + +void ProfileSessionDataRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProfileSessionDataRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProfileSessionDataRequest::CopyFrom(const ProfileSessionDataRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProfileSessionDataRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProfileSessionDataRequest::IsInitialized() const { + return true; +} + +void ProfileSessionDataRequest::Swap(ProfileSessionDataRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ProfileSessionDataRequest::InternalSwap(ProfileSessionDataRequest* other) { + using std::swap; + parameters_.Swap(&other->parameters_); + repository_root_.Swap(&other->repository_root_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + session_id_.Swap(&other->session_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + tool_name_.Swap(&other->tool_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + host_name_.Swap(&other->host_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProfileSessionDataRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ProfileSessionDataResponse::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProfileSessionDataResponse::kErrorMessageFieldNumber; +const int ProfileSessionDataResponse::kOutputFormatFieldNumber; +const int ProfileSessionDataResponse::kOutputFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProfileSessionDataResponse::ProfileSessionDataResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionDataResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ProfileSessionDataResponse) +} +ProfileSessionDataResponse::ProfileSessionDataResponse(const ProfileSessionDataResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.error_message().size() > 0) { + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + output_format_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.output_format().size() > 0) { + output_format_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_format_); + } + output_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.output().size() > 0) { + output_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ProfileSessionDataResponse) +} + +void ProfileSessionDataResponse::SharedCtor() { + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_format_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ProfileSessionDataResponse::~ProfileSessionDataResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ProfileSessionDataResponse) + SharedDtor(); +} + +void ProfileSessionDataResponse::SharedDtor() { + error_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_format_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ProfileSessionDataResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProfileSessionDataResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProfileSessionDataResponse& ProfileSessionDataResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::scc_info_ProfileSessionDataResponse.base); + return *internal_default_instance(); +} + + +void ProfileSessionDataResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ProfileSessionDataResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +bool ProfileSessionDataResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ProfileSessionDataResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string error_message = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_error_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataResponse.error_message")); + } else { + goto handle_unusual; + } + break; + } + + // string output_format = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_output_format())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_format().data(), static_cast(this->output_format().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ProfileSessionDataResponse.output_format")); + } else { + goto handle_unusual; + } + break; + } + + // bytes output = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_output())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ProfileSessionDataResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ProfileSessionDataResponse) + return false; +#undef DO_ +} + +void ProfileSessionDataResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ProfileSessionDataResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string error_message = 1; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataResponse.error_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->error_message(), output); + } + + // string output_format = 2; + if (this->output_format().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_format().data(), static_cast(this->output_format().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataResponse.output_format"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->output_format(), output); + } + + // bytes output = 3; + if (this->output().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->output(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ProfileSessionDataResponse) +} + +::google::protobuf::uint8* ProfileSessionDataResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ProfileSessionDataResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string error_message = 1; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataResponse.error_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->error_message(), target); + } + + // string output_format = 2; + if (this->output_format().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->output_format().data(), static_cast(this->output_format().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ProfileSessionDataResponse.output_format"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->output_format(), target); + } + + // bytes output = 3; + if (this->output().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->output(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ProfileSessionDataResponse) + return target; +} + +size_t ProfileSessionDataResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ProfileSessionDataResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string error_message = 1; + if (this->error_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->error_message()); + } + + // string output_format = 2; + if (this->output_format().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->output_format()); + } + + // bytes output = 3; + if (this->output().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->output()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProfileSessionDataResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ProfileSessionDataResponse) + GOOGLE_DCHECK_NE(&from, this); + const ProfileSessionDataResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ProfileSessionDataResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ProfileSessionDataResponse) + MergeFrom(*source); + } +} + +void ProfileSessionDataResponse::MergeFrom(const ProfileSessionDataResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ProfileSessionDataResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.error_message().size() > 0) { + + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + if (from.output_format().size() > 0) { + + output_format_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_format_); + } + if (from.output().size() > 0) { + + output_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_); + } +} + +void ProfileSessionDataResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ProfileSessionDataResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProfileSessionDataResponse::CopyFrom(const ProfileSessionDataResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ProfileSessionDataResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProfileSessionDataResponse::IsInitialized() const { + return true; +} + +void ProfileSessionDataResponse::Swap(ProfileSessionDataResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ProfileSessionDataResponse::InternalSwap(ProfileSessionDataResponse* other) { + using std::swap; + error_message_.Swap(&other->error_message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + output_format_.Swap(&other->output_format_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + output_.Swap(&other->output_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProfileSessionDataResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NewProfileSessionRequest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NewProfileSessionRequest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::NewProfileSessionRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NewProfileSessionResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NewProfileSessionResponse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::NewProfileSessionResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileSessionInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileSessionInfo >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileSessionInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileSessionDataRequest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileSessionDataRequest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileSessionDataRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ProfileSessionDataResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ProfileSessionDataResponse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ProfileSessionDataResponse >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.pb.h new file mode 100644 index 0000000..a9dd6c6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.pb.h @@ -0,0 +1,2077 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[8]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto +namespace diplomacy { +namespace tensorflow { +class EnumProfileSessionsAndToolsRequest; +class EnumProfileSessionsAndToolsRequestDefaultTypeInternal; +extern EnumProfileSessionsAndToolsRequestDefaultTypeInternal _EnumProfileSessionsAndToolsRequest_default_instance_; +class EnumProfileSessionsAndToolsResponse; +class EnumProfileSessionsAndToolsResponseDefaultTypeInternal; +extern EnumProfileSessionsAndToolsResponseDefaultTypeInternal _EnumProfileSessionsAndToolsResponse_default_instance_; +class NewProfileSessionRequest; +class NewProfileSessionRequestDefaultTypeInternal; +extern NewProfileSessionRequestDefaultTypeInternal _NewProfileSessionRequest_default_instance_; +class NewProfileSessionResponse; +class NewProfileSessionResponseDefaultTypeInternal; +extern NewProfileSessionResponseDefaultTypeInternal _NewProfileSessionResponse_default_instance_; +class ProfileSessionDataRequest; +class ProfileSessionDataRequestDefaultTypeInternal; +extern ProfileSessionDataRequestDefaultTypeInternal _ProfileSessionDataRequest_default_instance_; +class ProfileSessionDataRequest_ParametersEntry_DoNotUse; +class ProfileSessionDataRequest_ParametersEntry_DoNotUseDefaultTypeInternal; +extern ProfileSessionDataRequest_ParametersEntry_DoNotUseDefaultTypeInternal _ProfileSessionDataRequest_ParametersEntry_DoNotUse_default_instance_; +class ProfileSessionDataResponse; +class ProfileSessionDataResponseDefaultTypeInternal; +extern ProfileSessionDataResponseDefaultTypeInternal _ProfileSessionDataResponse_default_instance_; +class ProfileSessionInfo; +class ProfileSessionInfoDefaultTypeInternal; +extern ProfileSessionInfoDefaultTypeInternal _ProfileSessionInfo_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::EnumProfileSessionsAndToolsRequest>(Arena*); +template<> ::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::EnumProfileSessionsAndToolsResponse>(Arena*); +template<> ::diplomacy::tensorflow::NewProfileSessionRequest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NewProfileSessionRequest>(Arena*); +template<> ::diplomacy::tensorflow::NewProfileSessionResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NewProfileSessionResponse>(Arena*); +template<> ::diplomacy::tensorflow::ProfileSessionDataRequest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileSessionDataRequest>(Arena*); +template<> ::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileSessionDataRequest_ParametersEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::ProfileSessionDataResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileSessionDataResponse>(Arena*); +template<> ::diplomacy::tensorflow::ProfileSessionInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ProfileSessionInfo>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class NewProfileSessionRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NewProfileSessionRequest) */ { + public: + NewProfileSessionRequest(); + virtual ~NewProfileSessionRequest(); + + NewProfileSessionRequest(const NewProfileSessionRequest& from); + + inline NewProfileSessionRequest& operator=(const NewProfileSessionRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NewProfileSessionRequest(NewProfileSessionRequest&& from) noexcept + : NewProfileSessionRequest() { + *this = ::std::move(from); + } + + inline NewProfileSessionRequest& operator=(NewProfileSessionRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const NewProfileSessionRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NewProfileSessionRequest* internal_default_instance() { + return reinterpret_cast( + &_NewProfileSessionRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(NewProfileSessionRequest* other); + friend void swap(NewProfileSessionRequest& a, NewProfileSessionRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NewProfileSessionRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + NewProfileSessionRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NewProfileSessionRequest& from); + void MergeFrom(const NewProfileSessionRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NewProfileSessionRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string hosts = 3; + int hosts_size() const; + void clear_hosts(); + static const int kHostsFieldNumber = 3; + const ::std::string& hosts(int index) const; + ::std::string* mutable_hosts(int index); + void set_hosts(int index, const ::std::string& value); + #if LANG_CXX11 + void set_hosts(int index, ::std::string&& value); + #endif + void set_hosts(int index, const char* value); + void set_hosts(int index, const char* value, size_t size); + ::std::string* add_hosts(); + void add_hosts(const ::std::string& value); + #if LANG_CXX11 + void add_hosts(::std::string&& value); + #endif + void add_hosts(const char* value); + void add_hosts(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& hosts() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_hosts(); + + // string repository_root = 2; + void clear_repository_root(); + static const int kRepositoryRootFieldNumber = 2; + const ::std::string& repository_root() const; + void set_repository_root(const ::std::string& value); + #if LANG_CXX11 + void set_repository_root(::std::string&& value); + #endif + void set_repository_root(const char* value); + void set_repository_root(const char* value, size_t size); + ::std::string* mutable_repository_root(); + ::std::string* release_repository_root(); + void set_allocated_repository_root(::std::string* repository_root); + + // string session_id = 4; + void clear_session_id(); + static const int kSessionIdFieldNumber = 4; + const ::std::string& session_id() const; + void set_session_id(const ::std::string& value); + #if LANG_CXX11 + void set_session_id(::std::string&& value); + #endif + void set_session_id(const char* value); + void set_session_id(const char* value, size_t size); + ::std::string* mutable_session_id(); + ::std::string* release_session_id(); + void set_allocated_session_id(::std::string* session_id); + + // .diplomacy.tensorflow.ProfileRequest request = 1; + bool has_request() const; + void clear_request(); + static const int kRequestFieldNumber = 1; + private: + const ::diplomacy::tensorflow::ProfileRequest& _internal_request() const; + public: + const ::diplomacy::tensorflow::ProfileRequest& request() const; + ::diplomacy::tensorflow::ProfileRequest* release_request(); + ::diplomacy::tensorflow::ProfileRequest* mutable_request(); + void set_allocated_request(::diplomacy::tensorflow::ProfileRequest* request); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NewProfileSessionRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::std::string> hosts_; + ::google::protobuf::internal::ArenaStringPtr repository_root_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::diplomacy::tensorflow::ProfileRequest* request_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class NewProfileSessionResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NewProfileSessionResponse) */ { + public: + NewProfileSessionResponse(); + virtual ~NewProfileSessionResponse(); + + NewProfileSessionResponse(const NewProfileSessionResponse& from); + + inline NewProfileSessionResponse& operator=(const NewProfileSessionResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NewProfileSessionResponse(NewProfileSessionResponse&& from) noexcept + : NewProfileSessionResponse() { + *this = ::std::move(from); + } + + inline NewProfileSessionResponse& operator=(NewProfileSessionResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const NewProfileSessionResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NewProfileSessionResponse* internal_default_instance() { + return reinterpret_cast( + &_NewProfileSessionResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(NewProfileSessionResponse* other); + friend void swap(NewProfileSessionResponse& a, NewProfileSessionResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NewProfileSessionResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + NewProfileSessionResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NewProfileSessionResponse& from); + void MergeFrom(const NewProfileSessionResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NewProfileSessionResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string error_message = 1; + void clear_error_message(); + static const int kErrorMessageFieldNumber = 1; + const ::std::string& error_message() const; + void set_error_message(const ::std::string& value); + #if LANG_CXX11 + void set_error_message(::std::string&& value); + #endif + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + ::std::string* mutable_error_message(); + ::std::string* release_error_message(); + void set_allocated_error_message(::std::string* error_message); + + // bool empty_trace = 2; + void clear_empty_trace(); + static const int kEmptyTraceFieldNumber = 2; + bool empty_trace() const; + void set_empty_trace(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NewProfileSessionResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + bool empty_trace_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class EnumProfileSessionsAndToolsRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) */ { + public: + EnumProfileSessionsAndToolsRequest(); + virtual ~EnumProfileSessionsAndToolsRequest(); + + EnumProfileSessionsAndToolsRequest(const EnumProfileSessionsAndToolsRequest& from); + + inline EnumProfileSessionsAndToolsRequest& operator=(const EnumProfileSessionsAndToolsRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + EnumProfileSessionsAndToolsRequest(EnumProfileSessionsAndToolsRequest&& from) noexcept + : EnumProfileSessionsAndToolsRequest() { + *this = ::std::move(from); + } + + inline EnumProfileSessionsAndToolsRequest& operator=(EnumProfileSessionsAndToolsRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const EnumProfileSessionsAndToolsRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const EnumProfileSessionsAndToolsRequest* internal_default_instance() { + return reinterpret_cast( + &_EnumProfileSessionsAndToolsRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(EnumProfileSessionsAndToolsRequest* other); + friend void swap(EnumProfileSessionsAndToolsRequest& a, EnumProfileSessionsAndToolsRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline EnumProfileSessionsAndToolsRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + EnumProfileSessionsAndToolsRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const EnumProfileSessionsAndToolsRequest& from); + void MergeFrom(const EnumProfileSessionsAndToolsRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EnumProfileSessionsAndToolsRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string repository_root = 1; + void clear_repository_root(); + static const int kRepositoryRootFieldNumber = 1; + const ::std::string& repository_root() const; + void set_repository_root(const ::std::string& value); + #if LANG_CXX11 + void set_repository_root(::std::string&& value); + #endif + void set_repository_root(const char* value); + void set_repository_root(const char* value, size_t size); + ::std::string* mutable_repository_root(); + ::std::string* release_repository_root(); + void set_allocated_repository_root(::std::string* repository_root); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr repository_root_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProfileSessionInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProfileSessionInfo) */ { + public: + ProfileSessionInfo(); + virtual ~ProfileSessionInfo(); + + ProfileSessionInfo(const ProfileSessionInfo& from); + + inline ProfileSessionInfo& operator=(const ProfileSessionInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProfileSessionInfo(ProfileSessionInfo&& from) noexcept + : ProfileSessionInfo() { + *this = ::std::move(from); + } + + inline ProfileSessionInfo& operator=(ProfileSessionInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProfileSessionInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProfileSessionInfo* internal_default_instance() { + return reinterpret_cast( + &_ProfileSessionInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(ProfileSessionInfo* other); + friend void swap(ProfileSessionInfo& a, ProfileSessionInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProfileSessionInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + ProfileSessionInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProfileSessionInfo& from); + void MergeFrom(const ProfileSessionInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProfileSessionInfo* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string available_tools = 2; + int available_tools_size() const; + void clear_available_tools(); + static const int kAvailableToolsFieldNumber = 2; + const ::std::string& available_tools(int index) const; + ::std::string* mutable_available_tools(int index); + void set_available_tools(int index, const ::std::string& value); + #if LANG_CXX11 + void set_available_tools(int index, ::std::string&& value); + #endif + void set_available_tools(int index, const char* value); + void set_available_tools(int index, const char* value, size_t size); + ::std::string* add_available_tools(); + void add_available_tools(const ::std::string& value); + #if LANG_CXX11 + void add_available_tools(::std::string&& value); + #endif + void add_available_tools(const char* value); + void add_available_tools(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& available_tools() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_available_tools(); + + // string session_id = 1; + void clear_session_id(); + static const int kSessionIdFieldNumber = 1; + const ::std::string& session_id() const; + void set_session_id(const ::std::string& value); + #if LANG_CXX11 + void set_session_id(::std::string&& value); + #endif + void set_session_id(const char* value); + void set_session_id(const char* value, size_t size); + ::std::string* mutable_session_id(); + ::std::string* release_session_id(); + void set_allocated_session_id(::std::string* session_id); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProfileSessionInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::std::string> available_tools_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class EnumProfileSessionsAndToolsResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) */ { + public: + EnumProfileSessionsAndToolsResponse(); + virtual ~EnumProfileSessionsAndToolsResponse(); + + EnumProfileSessionsAndToolsResponse(const EnumProfileSessionsAndToolsResponse& from); + + inline EnumProfileSessionsAndToolsResponse& operator=(const EnumProfileSessionsAndToolsResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + EnumProfileSessionsAndToolsResponse(EnumProfileSessionsAndToolsResponse&& from) noexcept + : EnumProfileSessionsAndToolsResponse() { + *this = ::std::move(from); + } + + inline EnumProfileSessionsAndToolsResponse& operator=(EnumProfileSessionsAndToolsResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const EnumProfileSessionsAndToolsResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const EnumProfileSessionsAndToolsResponse* internal_default_instance() { + return reinterpret_cast( + &_EnumProfileSessionsAndToolsResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(EnumProfileSessionsAndToolsResponse* other); + friend void swap(EnumProfileSessionsAndToolsResponse& a, EnumProfileSessionsAndToolsResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline EnumProfileSessionsAndToolsResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + EnumProfileSessionsAndToolsResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const EnumProfileSessionsAndToolsResponse& from); + void MergeFrom(const EnumProfileSessionsAndToolsResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EnumProfileSessionsAndToolsResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.ProfileSessionInfo sessions = 2; + int sessions_size() const; + void clear_sessions(); + static const int kSessionsFieldNumber = 2; + ::diplomacy::tensorflow::ProfileSessionInfo* mutable_sessions(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileSessionInfo >* + mutable_sessions(); + const ::diplomacy::tensorflow::ProfileSessionInfo& sessions(int index) const; + ::diplomacy::tensorflow::ProfileSessionInfo* add_sessions(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileSessionInfo >& + sessions() const; + + // string error_message = 1; + void clear_error_message(); + static const int kErrorMessageFieldNumber = 1; + const ::std::string& error_message() const; + void set_error_message(const ::std::string& value); + #if LANG_CXX11 + void set_error_message(::std::string&& value); + #endif + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + ::std::string* mutable_error_message(); + ::std::string* release_error_message(); + void set_allocated_error_message(::std::string* error_message); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileSessionInfo > sessions_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProfileSessionDataRequest_ParametersEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + ProfileSessionDataRequest_ParametersEntry_DoNotUse(); + ProfileSessionDataRequest_ParametersEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const ProfileSessionDataRequest_ParametersEntry_DoNotUse& other); + static const ProfileSessionDataRequest_ParametersEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_ProfileSessionDataRequest_ParametersEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class ProfileSessionDataRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProfileSessionDataRequest) */ { + public: + ProfileSessionDataRequest(); + virtual ~ProfileSessionDataRequest(); + + ProfileSessionDataRequest(const ProfileSessionDataRequest& from); + + inline ProfileSessionDataRequest& operator=(const ProfileSessionDataRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProfileSessionDataRequest(ProfileSessionDataRequest&& from) noexcept + : ProfileSessionDataRequest() { + *this = ::std::move(from); + } + + inline ProfileSessionDataRequest& operator=(ProfileSessionDataRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProfileSessionDataRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProfileSessionDataRequest* internal_default_instance() { + return reinterpret_cast( + &_ProfileSessionDataRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(ProfileSessionDataRequest* other); + friend void swap(ProfileSessionDataRequest& a, ProfileSessionDataRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProfileSessionDataRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + ProfileSessionDataRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProfileSessionDataRequest& from); + void MergeFrom(const ProfileSessionDataRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProfileSessionDataRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map parameters = 4; + int parameters_size() const; + void clear_parameters(); + static const int kParametersFieldNumber = 4; + const ::google::protobuf::Map< ::std::string, ::std::string >& + parameters() const; + ::google::protobuf::Map< ::std::string, ::std::string >* + mutable_parameters(); + + // string repository_root = 1; + void clear_repository_root(); + static const int kRepositoryRootFieldNumber = 1; + const ::std::string& repository_root() const; + void set_repository_root(const ::std::string& value); + #if LANG_CXX11 + void set_repository_root(::std::string&& value); + #endif + void set_repository_root(const char* value); + void set_repository_root(const char* value, size_t size); + ::std::string* mutable_repository_root(); + ::std::string* release_repository_root(); + void set_allocated_repository_root(::std::string* repository_root); + + // string session_id = 2; + void clear_session_id(); + static const int kSessionIdFieldNumber = 2; + const ::std::string& session_id() const; + void set_session_id(const ::std::string& value); + #if LANG_CXX11 + void set_session_id(::std::string&& value); + #endif + void set_session_id(const char* value); + void set_session_id(const char* value, size_t size); + ::std::string* mutable_session_id(); + ::std::string* release_session_id(); + void set_allocated_session_id(::std::string* session_id); + + // string tool_name = 3; + void clear_tool_name(); + static const int kToolNameFieldNumber = 3; + const ::std::string& tool_name() const; + void set_tool_name(const ::std::string& value); + #if LANG_CXX11 + void set_tool_name(::std::string&& value); + #endif + void set_tool_name(const char* value); + void set_tool_name(const char* value, size_t size); + ::std::string* mutable_tool_name(); + ::std::string* release_tool_name(); + void set_allocated_tool_name(::std::string* tool_name); + + // string host_name = 5; + void clear_host_name(); + static const int kHostNameFieldNumber = 5; + const ::std::string& host_name() const; + void set_host_name(const ::std::string& value); + #if LANG_CXX11 + void set_host_name(::std::string&& value); + #endif + void set_host_name(const char* value); + void set_host_name(const char* value, size_t size); + ::std::string* mutable_host_name(); + ::std::string* release_host_name(); + void set_allocated_host_name(::std::string* host_name); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProfileSessionDataRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::MapField< + ProfileSessionDataRequest_ParametersEntry_DoNotUse, + ::std::string, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 > parameters_; + ::google::protobuf::internal::ArenaStringPtr repository_root_; + ::google::protobuf::internal::ArenaStringPtr session_id_; + ::google::protobuf::internal::ArenaStringPtr tool_name_; + ::google::protobuf::internal::ArenaStringPtr host_name_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProfileSessionDataResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ProfileSessionDataResponse) */ { + public: + ProfileSessionDataResponse(); + virtual ~ProfileSessionDataResponse(); + + ProfileSessionDataResponse(const ProfileSessionDataResponse& from); + + inline ProfileSessionDataResponse& operator=(const ProfileSessionDataResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProfileSessionDataResponse(ProfileSessionDataResponse&& from) noexcept + : ProfileSessionDataResponse() { + *this = ::std::move(from); + } + + inline ProfileSessionDataResponse& operator=(ProfileSessionDataResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProfileSessionDataResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProfileSessionDataResponse* internal_default_instance() { + return reinterpret_cast( + &_ProfileSessionDataResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void Swap(ProfileSessionDataResponse* other); + friend void swap(ProfileSessionDataResponse& a, ProfileSessionDataResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProfileSessionDataResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + ProfileSessionDataResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProfileSessionDataResponse& from); + void MergeFrom(const ProfileSessionDataResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProfileSessionDataResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string error_message = 1; + void clear_error_message(); + static const int kErrorMessageFieldNumber = 1; + const ::std::string& error_message() const; + void set_error_message(const ::std::string& value); + #if LANG_CXX11 + void set_error_message(::std::string&& value); + #endif + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + ::std::string* mutable_error_message(); + ::std::string* release_error_message(); + void set_allocated_error_message(::std::string* error_message); + + // string output_format = 2; + void clear_output_format(); + static const int kOutputFormatFieldNumber = 2; + const ::std::string& output_format() const; + void set_output_format(const ::std::string& value); + #if LANG_CXX11 + void set_output_format(::std::string&& value); + #endif + void set_output_format(const char* value); + void set_output_format(const char* value, size_t size); + ::std::string* mutable_output_format(); + ::std::string* release_output_format(); + void set_allocated_output_format(::std::string* output_format); + + // bytes output = 3; + void clear_output(); + static const int kOutputFieldNumber = 3; + const ::std::string& output() const; + void set_output(const ::std::string& value); + #if LANG_CXX11 + void set_output(::std::string&& value); + #endif + void set_output(const char* value); + void set_output(const void* value, size_t size); + ::std::string* mutable_output(); + ::std::string* release_output(); + void set_allocated_output(::std::string* output); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ProfileSessionDataResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + ::google::protobuf::internal::ArenaStringPtr output_format_; + ::google::protobuf::internal::ArenaStringPtr output_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// NewProfileSessionRequest + +// .diplomacy.tensorflow.ProfileRequest request = 1; +inline bool NewProfileSessionRequest::has_request() const { + return this != internal_default_instance() && request_ != NULL; +} +inline const ::diplomacy::tensorflow::ProfileRequest& NewProfileSessionRequest::_internal_request() const { + return *request_; +} +inline const ::diplomacy::tensorflow::ProfileRequest& NewProfileSessionRequest::request() const { + const ::diplomacy::tensorflow::ProfileRequest* p = request_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NewProfileSessionRequest.request) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_ProfileRequest_default_instance_); +} +inline ::diplomacy::tensorflow::ProfileRequest* NewProfileSessionRequest::release_request() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NewProfileSessionRequest.request) + + ::diplomacy::tensorflow::ProfileRequest* temp = request_; + request_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::ProfileRequest* NewProfileSessionRequest::mutable_request() { + + if (request_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::ProfileRequest>(GetArenaNoVirtual()); + request_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NewProfileSessionRequest.request) + return request_; +} +inline void NewProfileSessionRequest::set_allocated_request(::diplomacy::tensorflow::ProfileRequest* request) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(request_); + } + if (request) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + request = ::google::protobuf::internal::GetOwnedMessage( + message_arena, request, submessage_arena); + } + + } else { + + } + request_ = request; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NewProfileSessionRequest.request) +} + +// string repository_root = 2; +inline void NewProfileSessionRequest::clear_repository_root() { + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& NewProfileSessionRequest::repository_root() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) + return repository_root_.GetNoArena(); +} +inline void NewProfileSessionRequest::set_repository_root(const ::std::string& value) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) +} +#if LANG_CXX11 +inline void NewProfileSessionRequest::set_repository_root(::std::string&& value) { + + repository_root_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) +} +#endif +inline void NewProfileSessionRequest::set_repository_root(const char* value) { + GOOGLE_DCHECK(value != NULL); + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) +} +inline void NewProfileSessionRequest::set_repository_root(const char* value, size_t size) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) +} +inline ::std::string* NewProfileSessionRequest::mutable_repository_root() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) + return repository_root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* NewProfileSessionRequest::release_repository_root() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) + + return repository_root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NewProfileSessionRequest::set_allocated_repository_root(::std::string* repository_root) { + if (repository_root != NULL) { + + } else { + + } + repository_root_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), repository_root); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NewProfileSessionRequest.repository_root) +} + +// repeated string hosts = 3; +inline int NewProfileSessionRequest::hosts_size() const { + return hosts_.size(); +} +inline void NewProfileSessionRequest::clear_hosts() { + hosts_.Clear(); +} +inline const ::std::string& NewProfileSessionRequest::hosts(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NewProfileSessionRequest.hosts) + return hosts_.Get(index); +} +inline ::std::string* NewProfileSessionRequest::mutable_hosts(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NewProfileSessionRequest.hosts) + return hosts_.Mutable(index); +} +inline void NewProfileSessionRequest::set_hosts(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NewProfileSessionRequest.hosts) + hosts_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void NewProfileSessionRequest::set_hosts(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NewProfileSessionRequest.hosts) + hosts_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void NewProfileSessionRequest::set_hosts(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + hosts_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NewProfileSessionRequest.hosts) +} +inline void NewProfileSessionRequest::set_hosts(int index, const char* value, size_t size) { + hosts_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NewProfileSessionRequest.hosts) +} +inline ::std::string* NewProfileSessionRequest::add_hosts() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.NewProfileSessionRequest.hosts) + return hosts_.Add(); +} +inline void NewProfileSessionRequest::add_hosts(const ::std::string& value) { + hosts_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NewProfileSessionRequest.hosts) +} +#if LANG_CXX11 +inline void NewProfileSessionRequest::add_hosts(::std::string&& value) { + hosts_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NewProfileSessionRequest.hosts) +} +#endif +inline void NewProfileSessionRequest::add_hosts(const char* value) { + GOOGLE_DCHECK(value != NULL); + hosts_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.NewProfileSessionRequest.hosts) +} +inline void NewProfileSessionRequest::add_hosts(const char* value, size_t size) { + hosts_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.NewProfileSessionRequest.hosts) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NewProfileSessionRequest::hosts() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.NewProfileSessionRequest.hosts) + return hosts_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NewProfileSessionRequest::mutable_hosts() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.NewProfileSessionRequest.hosts) + return &hosts_; +} + +// string session_id = 4; +inline void NewProfileSessionRequest::clear_session_id() { + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& NewProfileSessionRequest::session_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NewProfileSessionRequest.session_id) + return session_id_.GetNoArena(); +} +inline void NewProfileSessionRequest::set_session_id(const ::std::string& value) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NewProfileSessionRequest.session_id) +} +#if LANG_CXX11 +inline void NewProfileSessionRequest::set_session_id(::std::string&& value) { + + session_id_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NewProfileSessionRequest.session_id) +} +#endif +inline void NewProfileSessionRequest::set_session_id(const char* value) { + GOOGLE_DCHECK(value != NULL); + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NewProfileSessionRequest.session_id) +} +inline void NewProfileSessionRequest::set_session_id(const char* value, size_t size) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NewProfileSessionRequest.session_id) +} +inline ::std::string* NewProfileSessionRequest::mutable_session_id() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NewProfileSessionRequest.session_id) + return session_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* NewProfileSessionRequest::release_session_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NewProfileSessionRequest.session_id) + + return session_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NewProfileSessionRequest::set_allocated_session_id(::std::string* session_id) { + if (session_id != NULL) { + + } else { + + } + session_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), session_id); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NewProfileSessionRequest.session_id) +} + +// ------------------------------------------------------------------- + +// NewProfileSessionResponse + +// string error_message = 1; +inline void NewProfileSessionResponse::clear_error_message() { + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& NewProfileSessionResponse::error_message() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NewProfileSessionResponse.error_message) + return error_message_.GetNoArena(); +} +inline void NewProfileSessionResponse::set_error_message(const ::std::string& value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NewProfileSessionResponse.error_message) +} +#if LANG_CXX11 +inline void NewProfileSessionResponse::set_error_message(::std::string&& value) { + + error_message_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NewProfileSessionResponse.error_message) +} +#endif +inline void NewProfileSessionResponse::set_error_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NewProfileSessionResponse.error_message) +} +inline void NewProfileSessionResponse::set_error_message(const char* value, size_t size) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NewProfileSessionResponse.error_message) +} +inline ::std::string* NewProfileSessionResponse::mutable_error_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NewProfileSessionResponse.error_message) + return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* NewProfileSessionResponse::release_error_message() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NewProfileSessionResponse.error_message) + + return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NewProfileSessionResponse::set_allocated_error_message(::std::string* error_message) { + if (error_message != NULL) { + + } else { + + } + error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NewProfileSessionResponse.error_message) +} + +// bool empty_trace = 2; +inline void NewProfileSessionResponse::clear_empty_trace() { + empty_trace_ = false; +} +inline bool NewProfileSessionResponse::empty_trace() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NewProfileSessionResponse.empty_trace) + return empty_trace_; +} +inline void NewProfileSessionResponse::set_empty_trace(bool value) { + + empty_trace_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NewProfileSessionResponse.empty_trace) +} + +// ------------------------------------------------------------------- + +// EnumProfileSessionsAndToolsRequest + +// string repository_root = 1; +inline void EnumProfileSessionsAndToolsRequest::clear_repository_root() { + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EnumProfileSessionsAndToolsRequest::repository_root() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) + return repository_root_.GetNoArena(); +} +inline void EnumProfileSessionsAndToolsRequest::set_repository_root(const ::std::string& value) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) +} +#if LANG_CXX11 +inline void EnumProfileSessionsAndToolsRequest::set_repository_root(::std::string&& value) { + + repository_root_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) +} +#endif +inline void EnumProfileSessionsAndToolsRequest::set_repository_root(const char* value) { + GOOGLE_DCHECK(value != NULL); + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) +} +inline void EnumProfileSessionsAndToolsRequest::set_repository_root(const char* value, size_t size) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) +} +inline ::std::string* EnumProfileSessionsAndToolsRequest::mutable_repository_root() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) + return repository_root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EnumProfileSessionsAndToolsRequest::release_repository_root() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) + + return repository_root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EnumProfileSessionsAndToolsRequest::set_allocated_repository_root(::std::string* repository_root) { + if (repository_root != NULL) { + + } else { + + } + repository_root_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), repository_root); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EnumProfileSessionsAndToolsRequest.repository_root) +} + +// ------------------------------------------------------------------- + +// ProfileSessionInfo + +// string session_id = 1; +inline void ProfileSessionInfo::clear_session_id() { + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionInfo::session_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionInfo.session_id) + return session_id_.GetNoArena(); +} +inline void ProfileSessionInfo::set_session_id(const ::std::string& value) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionInfo.session_id) +} +#if LANG_CXX11 +inline void ProfileSessionInfo::set_session_id(::std::string&& value) { + + session_id_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionInfo.session_id) +} +#endif +inline void ProfileSessionInfo::set_session_id(const char* value) { + GOOGLE_DCHECK(value != NULL); + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionInfo.session_id) +} +inline void ProfileSessionInfo::set_session_id(const char* value, size_t size) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionInfo.session_id) +} +inline ::std::string* ProfileSessionInfo::mutable_session_id() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionInfo.session_id) + return session_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionInfo::release_session_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionInfo.session_id) + + return session_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionInfo::set_allocated_session_id(::std::string* session_id) { + if (session_id != NULL) { + + } else { + + } + session_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), session_id); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionInfo.session_id) +} + +// repeated string available_tools = 2; +inline int ProfileSessionInfo::available_tools_size() const { + return available_tools_.size(); +} +inline void ProfileSessionInfo::clear_available_tools() { + available_tools_.Clear(); +} +inline const ::std::string& ProfileSessionInfo::available_tools(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionInfo.available_tools) + return available_tools_.Get(index); +} +inline ::std::string* ProfileSessionInfo::mutable_available_tools(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionInfo.available_tools) + return available_tools_.Mutable(index); +} +inline void ProfileSessionInfo::set_available_tools(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionInfo.available_tools) + available_tools_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void ProfileSessionInfo::set_available_tools(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionInfo.available_tools) + available_tools_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void ProfileSessionInfo::set_available_tools(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + available_tools_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionInfo.available_tools) +} +inline void ProfileSessionInfo::set_available_tools(int index, const char* value, size_t size) { + available_tools_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionInfo.available_tools) +} +inline ::std::string* ProfileSessionInfo::add_available_tools() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.ProfileSessionInfo.available_tools) + return available_tools_.Add(); +} +inline void ProfileSessionInfo::add_available_tools(const ::std::string& value) { + available_tools_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ProfileSessionInfo.available_tools) +} +#if LANG_CXX11 +inline void ProfileSessionInfo::add_available_tools(::std::string&& value) { + available_tools_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ProfileSessionInfo.available_tools) +} +#endif +inline void ProfileSessionInfo::add_available_tools(const char* value) { + GOOGLE_DCHECK(value != NULL); + available_tools_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.ProfileSessionInfo.available_tools) +} +inline void ProfileSessionInfo::add_available_tools(const char* value, size_t size) { + available_tools_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.ProfileSessionInfo.available_tools) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ProfileSessionInfo::available_tools() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ProfileSessionInfo.available_tools) + return available_tools_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ProfileSessionInfo::mutable_available_tools() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ProfileSessionInfo.available_tools) + return &available_tools_; +} + +// ------------------------------------------------------------------- + +// EnumProfileSessionsAndToolsResponse + +// string error_message = 1; +inline void EnumProfileSessionsAndToolsResponse::clear_error_message() { + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EnumProfileSessionsAndToolsResponse::error_message() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) + return error_message_.GetNoArena(); +} +inline void EnumProfileSessionsAndToolsResponse::set_error_message(const ::std::string& value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) +} +#if LANG_CXX11 +inline void EnumProfileSessionsAndToolsResponse::set_error_message(::std::string&& value) { + + error_message_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) +} +#endif +inline void EnumProfileSessionsAndToolsResponse::set_error_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) +} +inline void EnumProfileSessionsAndToolsResponse::set_error_message(const char* value, size_t size) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) +} +inline ::std::string* EnumProfileSessionsAndToolsResponse::mutable_error_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) + return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EnumProfileSessionsAndToolsResponse::release_error_message() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) + + return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EnumProfileSessionsAndToolsResponse::set_allocated_error_message(::std::string* error_message) { + if (error_message != NULL) { + + } else { + + } + error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.error_message) +} + +// repeated .diplomacy.tensorflow.ProfileSessionInfo sessions = 2; +inline int EnumProfileSessionsAndToolsResponse::sessions_size() const { + return sessions_.size(); +} +inline void EnumProfileSessionsAndToolsResponse::clear_sessions() { + sessions_.Clear(); +} +inline ::diplomacy::tensorflow::ProfileSessionInfo* EnumProfileSessionsAndToolsResponse::mutable_sessions(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.sessions) + return sessions_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileSessionInfo >* +EnumProfileSessionsAndToolsResponse::mutable_sessions() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.sessions) + return &sessions_; +} +inline const ::diplomacy::tensorflow::ProfileSessionInfo& EnumProfileSessionsAndToolsResponse::sessions(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.sessions) + return sessions_.Get(index); +} +inline ::diplomacy::tensorflow::ProfileSessionInfo* EnumProfileSessionsAndToolsResponse::add_sessions() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.sessions) + return sessions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ProfileSessionInfo >& +EnumProfileSessionsAndToolsResponse::sessions() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.EnumProfileSessionsAndToolsResponse.sessions) + return sessions_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ProfileSessionDataRequest + +// string repository_root = 1; +inline void ProfileSessionDataRequest::clear_repository_root() { + repository_root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionDataRequest::repository_root() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) + return repository_root_.GetNoArena(); +} +inline void ProfileSessionDataRequest::set_repository_root(const ::std::string& value) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) +} +#if LANG_CXX11 +inline void ProfileSessionDataRequest::set_repository_root(::std::string&& value) { + + repository_root_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) +} +#endif +inline void ProfileSessionDataRequest::set_repository_root(const char* value) { + GOOGLE_DCHECK(value != NULL); + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) +} +inline void ProfileSessionDataRequest::set_repository_root(const char* value, size_t size) { + + repository_root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) +} +inline ::std::string* ProfileSessionDataRequest::mutable_repository_root() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) + return repository_root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionDataRequest::release_repository_root() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) + + return repository_root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionDataRequest::set_allocated_repository_root(::std::string* repository_root) { + if (repository_root != NULL) { + + } else { + + } + repository_root_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), repository_root); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionDataRequest.repository_root) +} + +// string session_id = 2; +inline void ProfileSessionDataRequest::clear_session_id() { + session_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionDataRequest::session_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) + return session_id_.GetNoArena(); +} +inline void ProfileSessionDataRequest::set_session_id(const ::std::string& value) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) +} +#if LANG_CXX11 +inline void ProfileSessionDataRequest::set_session_id(::std::string&& value) { + + session_id_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) +} +#endif +inline void ProfileSessionDataRequest::set_session_id(const char* value) { + GOOGLE_DCHECK(value != NULL); + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) +} +inline void ProfileSessionDataRequest::set_session_id(const char* value, size_t size) { + + session_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) +} +inline ::std::string* ProfileSessionDataRequest::mutable_session_id() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) + return session_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionDataRequest::release_session_id() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) + + return session_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionDataRequest::set_allocated_session_id(::std::string* session_id) { + if (session_id != NULL) { + + } else { + + } + session_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), session_id); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionDataRequest.session_id) +} + +// string host_name = 5; +inline void ProfileSessionDataRequest::clear_host_name() { + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionDataRequest::host_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) + return host_name_.GetNoArena(); +} +inline void ProfileSessionDataRequest::set_host_name(const ::std::string& value) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) +} +#if LANG_CXX11 +inline void ProfileSessionDataRequest::set_host_name(::std::string&& value) { + + host_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) +} +#endif +inline void ProfileSessionDataRequest::set_host_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) +} +inline void ProfileSessionDataRequest::set_host_name(const char* value, size_t size) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) +} +inline ::std::string* ProfileSessionDataRequest::mutable_host_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) + return host_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionDataRequest::release_host_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) + + return host_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionDataRequest::set_allocated_host_name(::std::string* host_name) { + if (host_name != NULL) { + + } else { + + } + host_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionDataRequest.host_name) +} + +// string tool_name = 3; +inline void ProfileSessionDataRequest::clear_tool_name() { + tool_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionDataRequest::tool_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) + return tool_name_.GetNoArena(); +} +inline void ProfileSessionDataRequest::set_tool_name(const ::std::string& value) { + + tool_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) +} +#if LANG_CXX11 +inline void ProfileSessionDataRequest::set_tool_name(::std::string&& value) { + + tool_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) +} +#endif +inline void ProfileSessionDataRequest::set_tool_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tool_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) +} +inline void ProfileSessionDataRequest::set_tool_name(const char* value, size_t size) { + + tool_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) +} +inline ::std::string* ProfileSessionDataRequest::mutable_tool_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) + return tool_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionDataRequest::release_tool_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) + + return tool_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionDataRequest::set_allocated_tool_name(::std::string* tool_name) { + if (tool_name != NULL) { + + } else { + + } + tool_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tool_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionDataRequest.tool_name) +} + +// map parameters = 4; +inline int ProfileSessionDataRequest::parameters_size() const { + return parameters_.size(); +} +inline void ProfileSessionDataRequest::clear_parameters() { + parameters_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::std::string >& +ProfileSessionDataRequest::parameters() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.ProfileSessionDataRequest.parameters) + return parameters_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::std::string >* +ProfileSessionDataRequest::mutable_parameters() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.ProfileSessionDataRequest.parameters) + return parameters_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// ProfileSessionDataResponse + +// string error_message = 1; +inline void ProfileSessionDataResponse::clear_error_message() { + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionDataResponse::error_message() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) + return error_message_.GetNoArena(); +} +inline void ProfileSessionDataResponse::set_error_message(const ::std::string& value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) +} +#if LANG_CXX11 +inline void ProfileSessionDataResponse::set_error_message(::std::string&& value) { + + error_message_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) +} +#endif +inline void ProfileSessionDataResponse::set_error_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) +} +inline void ProfileSessionDataResponse::set_error_message(const char* value, size_t size) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) +} +inline ::std::string* ProfileSessionDataResponse::mutable_error_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) + return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionDataResponse::release_error_message() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) + + return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionDataResponse::set_allocated_error_message(::std::string* error_message) { + if (error_message != NULL) { + + } else { + + } + error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionDataResponse.error_message) +} + +// string output_format = 2; +inline void ProfileSessionDataResponse::clear_output_format() { + output_format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionDataResponse::output_format() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) + return output_format_.GetNoArena(); +} +inline void ProfileSessionDataResponse::set_output_format(const ::std::string& value) { + + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) +} +#if LANG_CXX11 +inline void ProfileSessionDataResponse::set_output_format(::std::string&& value) { + + output_format_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) +} +#endif +inline void ProfileSessionDataResponse::set_output_format(const char* value) { + GOOGLE_DCHECK(value != NULL); + + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) +} +inline void ProfileSessionDataResponse::set_output_format(const char* value, size_t size) { + + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) +} +inline ::std::string* ProfileSessionDataResponse::mutable_output_format() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) + return output_format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionDataResponse::release_output_format() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) + + return output_format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionDataResponse::set_allocated_output_format(::std::string* output_format) { + if (output_format != NULL) { + + } else { + + } + output_format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_format); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionDataResponse.output_format) +} + +// bytes output = 3; +inline void ProfileSessionDataResponse::clear_output() { + output_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ProfileSessionDataResponse::output() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ProfileSessionDataResponse.output) + return output_.GetNoArena(); +} +inline void ProfileSessionDataResponse::set_output(const ::std::string& value) { + + output_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ProfileSessionDataResponse.output) +} +#if LANG_CXX11 +inline void ProfileSessionDataResponse::set_output(::std::string&& value) { + + output_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ProfileSessionDataResponse.output) +} +#endif +inline void ProfileSessionDataResponse::set_output(const char* value) { + GOOGLE_DCHECK(value != NULL); + + output_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ProfileSessionDataResponse.output) +} +inline void ProfileSessionDataResponse::set_output(const void* value, size_t size) { + + output_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ProfileSessionDataResponse.output) +} +inline ::std::string* ProfileSessionDataResponse::mutable_output() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ProfileSessionDataResponse.output) + return output_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ProfileSessionDataResponse::release_output() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ProfileSessionDataResponse.output) + + return output_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ProfileSessionDataResponse::set_allocated_output(::std::string* output) { + if (output != NULL) { + + } else { + + } + output_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ProfileSessionDataResponse.output) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftpu_5fprofiler_5fanalysis_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto new file mode 100644 index 0000000..254aa21 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package diplomacy.tensorflow; + +import "diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler.proto"; + +message NewProfileSessionRequest { + ProfileRequest request = 1; + string repository_root = 2; + repeated string hosts = 3; + string session_id = 4; +} + +message NewProfileSessionResponse { + // Auxiliary error_message. + string error_message = 1; + + // Whether all hosts had returned a empty trace. + bool empty_trace = 2; +} + +message EnumProfileSessionsAndToolsRequest { + string repository_root = 1; +} + +message ProfileSessionInfo { + string session_id = 1; + // Which tool data is available for consumption. + repeated string available_tools = 2; +} + +message EnumProfileSessionsAndToolsResponse { + // Auxiliary error_message. + string error_message = 1; + // If success, the returned sessions information are stored here. + repeated ProfileSessionInfo sessions = 2; +} + +message ProfileSessionDataRequest { + string repository_root = 1; + string session_id = 2; + // Which host the data is associated. if empty, data from all hosts are + // aggregated. + string host_name = 5; + // Which tool + string tool_name = 3; + // Tool's specific parameters. e.g. TraceViewer's viewport etc + map parameters = 4; +} + +message ProfileSessionDataResponse { + // Auxiliary error_message. + string error_message = 1; + + // Output format. e.g. "json" or "proto" or "blob" + string output_format = 2; + + // TODO(jiesun): figure out whether to put bytes or oneof tool specific proto. + bytes output = 3; +} +//////////////////////////////////////////////////////////////////////////////// +// TPUProfileAnalysis service provide entry point for profiling TPU and for +// serving profiled data to Tensorboard through GRPC +//////////////////////////////////////////////////////////////////////////////// +service TPUProfileAnalysis { + // Starts a profiling session, blocks until it completes. + // TPUProfileAnalysis service delegate this to TPUProfiler service. + // Populate the profiled data in repository, then return status to caller. + rpc NewSession(NewProfileSessionRequest) returns (NewProfileSessionResponse) { + } + // Enumerate existing sessions and return available profile tools. + rpc EnumSessions(EnumProfileSessionsAndToolsRequest) + returns (EnumProfileSessionsAndToolsResponse) { + } + // Retrieve specific tool's data for specific session. + rpc GetSessionToolData(ProfileSessionDataRequest) + returns (ProfileSessionDataResponse) { + } +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis_pb2.py new file mode 100644 index 0000000..8b9a21d --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis_pb2.py @@ -0,0 +1,481 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.contrib.tpu.profiler import tpu_profiler_pb2 as diplomacy__tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nEdiplomacy_tensorflow/contrib/tpu/profiler/tpu_profiler_analysis.proto\x12\x14\x64iplomacy.tensorflow\x1a + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Resource; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TraceEvent; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Device; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Device_ResourcesEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Trace_DevicesEntry_DoNotUse; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class Trace_DevicesEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Trace_DevicesEntry_DoNotUse_default_instance_; +class TraceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Trace_default_instance_; +class Device_ResourcesEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Device_ResourcesEntry_DoNotUse_default_instance_; +class DeviceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Device_default_instance_; +class ResourceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Resource_default_instance_; +class TraceEventDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TraceEvent_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto { +static void InitDefaultsTrace_DevicesEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_Trace_DevicesEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse(); + } + ::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Trace_DevicesEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTrace_DevicesEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Device.base,}}; + +static void InitDefaultsTrace() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_Trace_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::Trace(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::Trace::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_Trace = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTrace}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Trace_DevicesEntry_DoNotUse.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_TraceEvent.base,}}; + +static void InitDefaultsDevice_ResourcesEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_Device_ResourcesEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse(); + } + ::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Device_ResourcesEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDevice_ResourcesEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Resource.base,}}; + +static void InitDefaultsDevice() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_Device_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::Device(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::Device::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Device = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDevice}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Device_ResourcesEntry_DoNotUse.base,}}; + +static void InitDefaultsResource() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_Resource_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::Resource(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::Resource::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Resource = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsResource}, {}}; + +static void InitDefaultsTraceEvent() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TraceEvent_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TraceEvent(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TraceEvent::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TraceEvent = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTraceEvent}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Trace_DevicesEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_Trace.base); + ::google::protobuf::internal::InitSCC(&scc_info_Device_ResourcesEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_Device.base); + ::google::protobuf::internal::InitSCC(&scc_info_Resource.base); + ::google::protobuf::internal::InitSCC(&scc_info_TraceEvent.base); +} + +::google::protobuf::Metadata file_level_metadata[6]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Trace, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Trace, devices_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Trace, trace_events_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device, device_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Device, resources_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Resource, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Resource, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::Resource, resource_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TraceEvent, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TraceEvent, device_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TraceEvent, resource_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TraceEvent, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TraceEvent, timestamp_ps_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TraceEvent, duration_ps_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 7, sizeof(::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse)}, + { 9, -1, sizeof(::diplomacy::tensorflow::tpu::Trace)}, + { 16, 23, sizeof(::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse)}, + { 25, -1, sizeof(::diplomacy::tensorflow::tpu::Device)}, + { 33, -1, sizeof(::diplomacy::tensorflow::tpu::Resource)}, + { 40, -1, sizeof(::diplomacy::tensorflow::tpu::TraceEvent)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tpu::_Trace_DevicesEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_Trace_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_Device_ResourcesEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_Device_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_Resource_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TraceEvent_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/profiler/trace_events.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 6); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n= 1900 +const int Trace::kDevicesFieldNumber; +const int Trace::kTraceEventsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Trace::Trace() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Trace.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.Trace) +} +Trace::Trace(const Trace& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + trace_events_(from.trace_events_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + devices_.MergeFrom(from.devices_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.Trace) +} + +void Trace::SharedCtor() { +} + +Trace::~Trace() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.Trace) + SharedDtor(); +} + +void Trace::SharedDtor() { +} + +void Trace::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Trace::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Trace& Trace::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Trace.base); + return *internal_default_instance(); +} + + +void Trace::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.Trace) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + devices_.Clear(); + trace_events_.Clear(); + _internal_metadata_.Clear(); +} + +bool Trace::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.Trace) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map devices = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + Trace_DevicesEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + Trace_DevicesEntry_DoNotUse, + ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device, + ::google::protobuf::internal::WireFormatLite::TYPE_UINT32, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device > > parser(&devices_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.tpu.TraceEvent trace_events = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_trace_events())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.Trace) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.Trace) + return false; +#undef DO_ +} + +void Trace::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.Trace) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map devices = 1; + if (!this->devices().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::uint32, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (output->IsSerializationDeterministic() && + this->devices().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->devices().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::const_iterator + it = this->devices().begin(); + it != this->devices().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(devices_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::const_iterator + it = this->devices().begin(); + it != this->devices().end(); ++it) { + entry.reset(devices_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + } + } + } + + // repeated .diplomacy.tensorflow.tpu.TraceEvent trace_events = 4; + for (unsigned int i = 0, + n = static_cast(this->trace_events_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->trace_events(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.Trace) +} + +::google::protobuf::uint8* Trace::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.Trace) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map devices = 1; + if (!this->devices().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::uint32, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (deterministic && + this->devices().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->devices().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::const_iterator + it = this->devices().begin(); + it != this->devices().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(devices_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::const_iterator + it = this->devices().begin(); + it != this->devices().end(); ++it) { + entry.reset(devices_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + } + } + } + + // repeated .diplomacy.tensorflow.tpu.TraceEvent trace_events = 4; + for (unsigned int i = 0, + n = static_cast(this->trace_events_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->trace_events(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.Trace) + return target; +} + +size_t Trace::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.Trace) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map devices = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->devices_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >::const_iterator + it = this->devices().begin(); + it != this->devices().end(); ++it) { + entry.reset(devices_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + // repeated .diplomacy.tensorflow.tpu.TraceEvent trace_events = 4; + { + unsigned int count = static_cast(this->trace_events_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->trace_events(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Trace::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.Trace) + GOOGLE_DCHECK_NE(&from, this); + const Trace* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.Trace) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.Trace) + MergeFrom(*source); + } +} + +void Trace::MergeFrom(const Trace& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.Trace) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + devices_.MergeFrom(from.devices_); + trace_events_.MergeFrom(from.trace_events_); +} + +void Trace::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.Trace) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Trace::CopyFrom(const Trace& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.Trace) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Trace::IsInitialized() const { + return true; +} + +void Trace::Swap(Trace* other) { + if (other == this) return; + InternalSwap(other); +} +void Trace::InternalSwap(Trace* other) { + using std::swap; + devices_.Swap(&other->devices_); + CastToBase(&trace_events_)->InternalSwap(CastToBase(&other->trace_events_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Trace::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +Device_ResourcesEntry_DoNotUse::Device_ResourcesEntry_DoNotUse() {} +Device_ResourcesEntry_DoNotUse::Device_ResourcesEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void Device_ResourcesEntry_DoNotUse::MergeFrom(const Device_ResourcesEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata Device_ResourcesEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[2]; +} +void Device_ResourcesEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void Device::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Device::kNameFieldNumber; +const int Device::kDeviceIdFieldNumber; +const int Device::kResourcesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Device::Device() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Device.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.Device) +} +Device::Device(const Device& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + resources_.MergeFrom(from.resources_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + device_id_ = from.device_id_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.Device) +} + +void Device::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_id_ = 0u; +} + +Device::~Device() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.Device) + SharedDtor(); +} + +void Device::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Device::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Device::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Device& Device::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Device.base); + return *internal_default_instance(); +} + + +void Device::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.Device) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + resources_.Clear(); + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_id_ = 0u; + _internal_metadata_.Clear(); +} + +bool Device::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.Device) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.Device.name")); + } else { + goto handle_unusual; + } + break; + } + + // uint32 device_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &device_id_))); + } else { + goto handle_unusual; + } + break; + } + + // map resources = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + Device_ResourcesEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + Device_ResourcesEntry_DoNotUse, + ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource, + ::google::protobuf::internal::WireFormatLite::TYPE_UINT32, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource > > parser(&resources_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.Device) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.Device) + return false; +#undef DO_ +} + +void Device::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.Device) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.Device.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // uint32 device_id = 2; + if (this->device_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->device_id(), output); + } + + // map resources = 3; + if (!this->resources().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::uint32, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (output->IsSerializationDeterministic() && + this->resources().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->resources().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::const_iterator + it = this->resources().begin(); + it != this->resources().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(resources_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *entry, output); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::const_iterator + it = this->resources().begin(); + it != this->resources().end(); ++it) { + entry.reset(resources_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *entry, output); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.Device) +} + +::google::protobuf::uint8* Device::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.Device) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.Device.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // uint32 device_id = 2; + if (this->device_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->device_id(), target); + } + + // map resources = 3; + if (!this->resources().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::uint32, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + + if (deterministic && + this->resources().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->resources().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::const_iterator + it = this->resources().begin(); + it != this->resources().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(resources_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *entry, deterministic, target); +; + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::const_iterator + it = this->resources().begin(); + it != this->resources().end(); ++it) { + entry.reset(resources_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *entry, deterministic, target); +; + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.Device) + return target; +} + +size_t Device::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.Device) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map resources = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->resources_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >::const_iterator + it = this->resources().begin(); + it != this->resources().end(); ++it) { + entry.reset(resources_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // uint32 device_id = 2; + if (this->device_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->device_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Device::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.Device) + GOOGLE_DCHECK_NE(&from, this); + const Device* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.Device) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.Device) + MergeFrom(*source); + } +} + +void Device::MergeFrom(const Device& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.Device) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + resources_.MergeFrom(from.resources_); + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.device_id() != 0) { + set_device_id(from.device_id()); + } +} + +void Device::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.Device) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Device::CopyFrom(const Device& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.Device) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Device::IsInitialized() const { + return true; +} + +void Device::Swap(Device* other) { + if (other == this) return; + InternalSwap(other); +} +void Device::InternalSwap(Device* other) { + using std::swap; + resources_.Swap(&other->resources_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(device_id_, other->device_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Device::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Resource::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Resource::kNameFieldNumber; +const int Resource::kResourceIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Resource::Resource() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Resource.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.Resource) +} +Resource::Resource(const Resource& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + resource_id_ = from.resource_id_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.Resource) +} + +void Resource::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + resource_id_ = 0u; +} + +Resource::~Resource() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.Resource) + SharedDtor(); +} + +void Resource::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Resource::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Resource::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Resource& Resource::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_Resource.base); + return *internal_default_instance(); +} + + +void Resource::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.Resource) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + resource_id_ = 0u; + _internal_metadata_.Clear(); +} + +bool Resource::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.Resource) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.Resource.name")); + } else { + goto handle_unusual; + } + break; + } + + // uint32 resource_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &resource_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.Resource) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.Resource) + return false; +#undef DO_ +} + +void Resource::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.Resource) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.Resource.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // uint32 resource_id = 2; + if (this->resource_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->resource_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.Resource) +} + +::google::protobuf::uint8* Resource::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.Resource) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.Resource.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // uint32 resource_id = 2; + if (this->resource_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->resource_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.Resource) + return target; +} + +size_t Resource::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.Resource) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // uint32 resource_id = 2; + if (this->resource_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->resource_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Resource::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.Resource) + GOOGLE_DCHECK_NE(&from, this); + const Resource* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.Resource) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.Resource) + MergeFrom(*source); + } +} + +void Resource::MergeFrom(const Resource& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.Resource) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.resource_id() != 0) { + set_resource_id(from.resource_id()); + } +} + +void Resource::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.Resource) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Resource::CopyFrom(const Resource& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.Resource) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Resource::IsInitialized() const { + return true; +} + +void Resource::Swap(Resource* other) { + if (other == this) return; + InternalSwap(other); +} +void Resource::InternalSwap(Resource* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(resource_id_, other->resource_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Resource::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TraceEvent::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TraceEvent::kDeviceIdFieldNumber; +const int TraceEvent::kResourceIdFieldNumber; +const int TraceEvent::kNameFieldNumber; +const int TraceEvent::kTimestampPsFieldNumber; +const int TraceEvent::kDurationPsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TraceEvent::TraceEvent() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_TraceEvent.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TraceEvent) +} +TraceEvent::TraceEvent(const TraceEvent& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + ::memcpy(&device_id_, &from.device_id_, + static_cast(reinterpret_cast(&duration_ps_) - + reinterpret_cast(&device_id_)) + sizeof(duration_ps_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TraceEvent) +} + +void TraceEvent::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&device_id_, 0, static_cast( + reinterpret_cast(&duration_ps_) - + reinterpret_cast(&device_id_)) + sizeof(duration_ps_)); +} + +TraceEvent::~TraceEvent() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TraceEvent) + SharedDtor(); +} + +void TraceEvent::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void TraceEvent::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TraceEvent::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TraceEvent& TraceEvent::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::scc_info_TraceEvent.base); + return *internal_default_instance(); +} + + +void TraceEvent::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TraceEvent) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&device_id_, 0, static_cast( + reinterpret_cast(&duration_ps_) - + reinterpret_cast(&device_id_)) + sizeof(duration_ps_)); + _internal_metadata_.Clear(); +} + +bool TraceEvent::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TraceEvent) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // uint32 device_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &device_id_))); + } else { + goto handle_unusual; + } + break; + } + + // uint32 resource_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &resource_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.TraceEvent.name")); + } else { + goto handle_unusual; + } + break; + } + + // uint64 timestamp_ps = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, ×tamp_ps_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 duration_ps = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &duration_ps_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TraceEvent) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TraceEvent) + return false; +#undef DO_ +} + +void TraceEvent::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TraceEvent) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 device_id = 1; + if (this->device_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->device_id(), output); + } + + // uint32 resource_id = 2; + if (this->resource_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->resource_id(), output); + } + + // string name = 3; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.TraceEvent.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->name(), output); + } + + // uint64 timestamp_ps = 9; + if (this->timestamp_ps() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(9, this->timestamp_ps(), output); + } + + // uint64 duration_ps = 10; + if (this->duration_ps() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(10, this->duration_ps(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TraceEvent) +} + +::google::protobuf::uint8* TraceEvent::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TraceEvent) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 device_id = 1; + if (this->device_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->device_id(), target); + } + + // uint32 resource_id = 2; + if (this->resource_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->resource_id(), target); + } + + // string name = 3; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.TraceEvent.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->name(), target); + } + + // uint64 timestamp_ps = 9; + if (this->timestamp_ps() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(9, this->timestamp_ps(), target); + } + + // uint64 duration_ps = 10; + if (this->duration_ps() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(10, this->duration_ps(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TraceEvent) + return target; +} + +size_t TraceEvent::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TraceEvent) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 3; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // uint32 device_id = 1; + if (this->device_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->device_id()); + } + + // uint32 resource_id = 2; + if (this->resource_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->resource_id()); + } + + // uint64 timestamp_ps = 9; + if (this->timestamp_ps() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->timestamp_ps()); + } + + // uint64 duration_ps = 10; + if (this->duration_ps() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->duration_ps()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TraceEvent::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TraceEvent) + GOOGLE_DCHECK_NE(&from, this); + const TraceEvent* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TraceEvent) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TraceEvent) + MergeFrom(*source); + } +} + +void TraceEvent::MergeFrom(const TraceEvent& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TraceEvent) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.device_id() != 0) { + set_device_id(from.device_id()); + } + if (from.resource_id() != 0) { + set_resource_id(from.resource_id()); + } + if (from.timestamp_ps() != 0) { + set_timestamp_ps(from.timestamp_ps()); + } + if (from.duration_ps() != 0) { + set_duration_ps(from.duration_ps()); + } +} + +void TraceEvent::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TraceEvent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TraceEvent::CopyFrom(const TraceEvent& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TraceEvent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TraceEvent::IsInitialized() const { + return true; +} + +void TraceEvent::Swap(TraceEvent* other) { + if (other == this) return; + InternalSwap(other); +} +void TraceEvent::InternalSwap(TraceEvent* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(device_id_, other->device_id_); + swap(resource_id_, other->resource_id_); + swap(timestamp_ps_, other->timestamp_ps_); + swap(duration_ps_, other->duration_ps_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TraceEvent::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::Trace* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::Trace >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::Trace >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::Device* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::Device >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::Device >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::Resource* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::Resource >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::Resource >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TraceEvent* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TraceEvent >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TraceEvent >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events.pb.h new file mode 100644 index 0000000..bb8914d --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events.pb.h @@ -0,0 +1,1005 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/profiler/trace_events.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[6]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class Device; +class DeviceDefaultTypeInternal; +extern DeviceDefaultTypeInternal _Device_default_instance_; +class Device_ResourcesEntry_DoNotUse; +class Device_ResourcesEntry_DoNotUseDefaultTypeInternal; +extern Device_ResourcesEntry_DoNotUseDefaultTypeInternal _Device_ResourcesEntry_DoNotUse_default_instance_; +class Resource; +class ResourceDefaultTypeInternal; +extern ResourceDefaultTypeInternal _Resource_default_instance_; +class Trace; +class TraceDefaultTypeInternal; +extern TraceDefaultTypeInternal _Trace_default_instance_; +class TraceEvent; +class TraceEventDefaultTypeInternal; +extern TraceEventDefaultTypeInternal _TraceEvent_default_instance_; +class Trace_DevicesEntry_DoNotUse; +class Trace_DevicesEntry_DoNotUseDefaultTypeInternal; +extern Trace_DevicesEntry_DoNotUseDefaultTypeInternal _Trace_DevicesEntry_DoNotUse_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tpu::Device* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::Device>(Arena*); +template<> ::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::Device_ResourcesEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::tpu::Resource* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::Resource>(Arena*); +template<> ::diplomacy::tensorflow::tpu::Trace* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::Trace>(Arena*); +template<> ::diplomacy::tensorflow::tpu::TraceEvent* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TraceEvent>(Arena*); +template<> ::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::Trace_DevicesEntry_DoNotUse>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +class Trace_DevicesEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + Trace_DevicesEntry_DoNotUse(); + Trace_DevicesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const Trace_DevicesEntry_DoNotUse& other); + static const Trace_DevicesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Trace_DevicesEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class Trace : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.Trace) */ { + public: + Trace(); + virtual ~Trace(); + + Trace(const Trace& from); + + inline Trace& operator=(const Trace& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Trace(Trace&& from) noexcept + : Trace() { + *this = ::std::move(from); + } + + inline Trace& operator=(Trace&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Trace& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Trace* internal_default_instance() { + return reinterpret_cast( + &_Trace_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(Trace* other); + friend void swap(Trace& a, Trace& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Trace* New() const final { + return CreateMaybeMessage(NULL); + } + + Trace* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Trace& from); + void MergeFrom(const Trace& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Trace* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map devices = 1; + int devices_size() const; + void clear_devices(); + static const int kDevicesFieldNumber = 1; + const ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >& + devices() const; + ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >* + mutable_devices(); + + // repeated .diplomacy.tensorflow.tpu.TraceEvent trace_events = 4; + int trace_events_size() const; + void clear_trace_events(); + static const int kTraceEventsFieldNumber = 4; + ::diplomacy::tensorflow::tpu::TraceEvent* mutable_trace_events(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TraceEvent >* + mutable_trace_events(); + const ::diplomacy::tensorflow::tpu::TraceEvent& trace_events(int index) const; + ::diplomacy::tensorflow::tpu::TraceEvent* add_trace_events(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TraceEvent >& + trace_events() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.Trace) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::MapField< + Trace_DevicesEntry_DoNotUse, + ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device, + ::google::protobuf::internal::WireFormatLite::TYPE_UINT32, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > devices_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TraceEvent > trace_events_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Device_ResourcesEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + Device_ResourcesEntry_DoNotUse(); + Device_ResourcesEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const Device_ResourcesEntry_DoNotUse& other); + static const Device_ResourcesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Device_ResourcesEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class Device : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.Device) */ { + public: + Device(); + virtual ~Device(); + + Device(const Device& from); + + inline Device& operator=(const Device& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Device(Device&& from) noexcept + : Device() { + *this = ::std::move(from); + } + + inline Device& operator=(Device&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Device& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Device* internal_default_instance() { + return reinterpret_cast( + &_Device_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(Device* other); + friend void swap(Device& a, Device& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Device* New() const final { + return CreateMaybeMessage(NULL); + } + + Device* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Device& from); + void MergeFrom(const Device& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Device* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map resources = 3; + int resources_size() const; + void clear_resources(); + static const int kResourcesFieldNumber = 3; + const ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >& + resources() const; + ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >* + mutable_resources(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // uint32 device_id = 2; + void clear_device_id(); + static const int kDeviceIdFieldNumber = 2; + ::google::protobuf::uint32 device_id() const; + void set_device_id(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.Device) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::MapField< + Device_ResourcesEntry_DoNotUse, + ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource, + ::google::protobuf::internal::WireFormatLite::TYPE_UINT32, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > resources_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::uint32 device_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Resource : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.Resource) */ { + public: + Resource(); + virtual ~Resource(); + + Resource(const Resource& from); + + inline Resource& operator=(const Resource& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Resource(Resource&& from) noexcept + : Resource() { + *this = ::std::move(from); + } + + inline Resource& operator=(Resource&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Resource& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Resource* internal_default_instance() { + return reinterpret_cast( + &_Resource_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(Resource* other); + friend void swap(Resource& a, Resource& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Resource* New() const final { + return CreateMaybeMessage(NULL); + } + + Resource* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Resource& from); + void MergeFrom(const Resource& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Resource* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // uint32 resource_id = 2; + void clear_resource_id(); + static const int kResourceIdFieldNumber = 2; + ::google::protobuf::uint32 resource_id() const; + void set_resource_id(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.Resource) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::uint32 resource_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TraceEvent : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TraceEvent) */ { + public: + TraceEvent(); + virtual ~TraceEvent(); + + TraceEvent(const TraceEvent& from); + + inline TraceEvent& operator=(const TraceEvent& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TraceEvent(TraceEvent&& from) noexcept + : TraceEvent() { + *this = ::std::move(from); + } + + inline TraceEvent& operator=(TraceEvent&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TraceEvent& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TraceEvent* internal_default_instance() { + return reinterpret_cast( + &_TraceEvent_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(TraceEvent* other); + friend void swap(TraceEvent& a, TraceEvent& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TraceEvent* New() const final { + return CreateMaybeMessage(NULL); + } + + TraceEvent* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TraceEvent& from); + void MergeFrom(const TraceEvent& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TraceEvent* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 3; + void clear_name(); + static const int kNameFieldNumber = 3; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // uint32 device_id = 1; + void clear_device_id(); + static const int kDeviceIdFieldNumber = 1; + ::google::protobuf::uint32 device_id() const; + void set_device_id(::google::protobuf::uint32 value); + + // uint32 resource_id = 2; + void clear_resource_id(); + static const int kResourceIdFieldNumber = 2; + ::google::protobuf::uint32 resource_id() const; + void set_resource_id(::google::protobuf::uint32 value); + + // uint64 timestamp_ps = 9; + void clear_timestamp_ps(); + static const int kTimestampPsFieldNumber = 9; + ::google::protobuf::uint64 timestamp_ps() const; + void set_timestamp_ps(::google::protobuf::uint64 value); + + // uint64 duration_ps = 10; + void clear_duration_ps(); + static const int kDurationPsFieldNumber = 10; + ::google::protobuf::uint64 duration_ps() const; + void set_duration_ps(::google::protobuf::uint64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TraceEvent) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::uint32 device_id_; + ::google::protobuf::uint32 resource_id_; + ::google::protobuf::uint64 timestamp_ps_; + ::google::protobuf::uint64 duration_ps_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// Trace + +// map devices = 1; +inline int Trace::devices_size() const { + return devices_.size(); +} +inline void Trace::clear_devices() { + devices_.Clear(); +} +inline const ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >& +Trace::devices() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.tpu.Trace.devices) + return devices_.GetMap(); +} +inline ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Device >* +Trace::mutable_devices() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.tpu.Trace.devices) + return devices_.MutableMap(); +} + +// repeated .diplomacy.tensorflow.tpu.TraceEvent trace_events = 4; +inline int Trace::trace_events_size() const { + return trace_events_.size(); +} +inline void Trace::clear_trace_events() { + trace_events_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::TraceEvent* Trace::mutable_trace_events(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.Trace.trace_events) + return trace_events_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TraceEvent >* +Trace::mutable_trace_events() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.Trace.trace_events) + return &trace_events_; +} +inline const ::diplomacy::tensorflow::tpu::TraceEvent& Trace::trace_events(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.Trace.trace_events) + return trace_events_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::TraceEvent* Trace::add_trace_events() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.Trace.trace_events) + return trace_events_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TraceEvent >& +Trace::trace_events() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.Trace.trace_events) + return trace_events_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// Device + +// string name = 1; +inline void Device::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Device::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.Device.name) + return name_.GetNoArena(); +} +inline void Device::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.Device.name) +} +#if LANG_CXX11 +inline void Device::set_name(::std::string&& value) { + + name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.Device.name) +} +#endif +inline void Device::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.Device.name) +} +inline void Device::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.Device.name) +} +inline ::std::string* Device::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.Device.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Device::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.Device.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Device::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.Device.name) +} + +// uint32 device_id = 2; +inline void Device::clear_device_id() { + device_id_ = 0u; +} +inline ::google::protobuf::uint32 Device::device_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.Device.device_id) + return device_id_; +} +inline void Device::set_device_id(::google::protobuf::uint32 value) { + + device_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.Device.device_id) +} + +// map resources = 3; +inline int Device::resources_size() const { + return resources_.size(); +} +inline void Device::clear_resources() { + resources_.Clear(); +} +inline const ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >& +Device::resources() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.tpu.Device.resources) + return resources_.GetMap(); +} +inline ::google::protobuf::Map< ::google::protobuf::uint32, ::diplomacy::tensorflow::tpu::Resource >* +Device::mutable_resources() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.tpu.Device.resources) + return resources_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// Resource + +// string name = 1; +inline void Resource::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& Resource::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.Resource.name) + return name_.GetNoArena(); +} +inline void Resource::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.Resource.name) +} +#if LANG_CXX11 +inline void Resource::set_name(::std::string&& value) { + + name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.Resource.name) +} +#endif +inline void Resource::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.Resource.name) +} +inline void Resource::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.Resource.name) +} +inline ::std::string* Resource::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.Resource.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Resource::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.Resource.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Resource::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.Resource.name) +} + +// uint32 resource_id = 2; +inline void Resource::clear_resource_id() { + resource_id_ = 0u; +} +inline ::google::protobuf::uint32 Resource::resource_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.Resource.resource_id) + return resource_id_; +} +inline void Resource::set_resource_id(::google::protobuf::uint32 value) { + + resource_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.Resource.resource_id) +} + +// ------------------------------------------------------------------- + +// TraceEvent + +// uint32 device_id = 1; +inline void TraceEvent::clear_device_id() { + device_id_ = 0u; +} +inline ::google::protobuf::uint32 TraceEvent::device_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TraceEvent.device_id) + return device_id_; +} +inline void TraceEvent::set_device_id(::google::protobuf::uint32 value) { + + device_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TraceEvent.device_id) +} + +// uint32 resource_id = 2; +inline void TraceEvent::clear_resource_id() { + resource_id_ = 0u; +} +inline ::google::protobuf::uint32 TraceEvent::resource_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TraceEvent.resource_id) + return resource_id_; +} +inline void TraceEvent::set_resource_id(::google::protobuf::uint32 value) { + + resource_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TraceEvent.resource_id) +} + +// string name = 3; +inline void TraceEvent::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& TraceEvent::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TraceEvent.name) + return name_.GetNoArena(); +} +inline void TraceEvent::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TraceEvent.name) +} +#if LANG_CXX11 +inline void TraceEvent::set_name(::std::string&& value) { + + name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.TraceEvent.name) +} +#endif +inline void TraceEvent::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.TraceEvent.name) +} +inline void TraceEvent::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.TraceEvent.name) +} +inline ::std::string* TraceEvent::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TraceEvent.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TraceEvent::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.TraceEvent.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TraceEvent::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.TraceEvent.name) +} + +// uint64 timestamp_ps = 9; +inline void TraceEvent::clear_timestamp_ps() { + timestamp_ps_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 TraceEvent::timestamp_ps() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TraceEvent.timestamp_ps) + return timestamp_ps_; +} +inline void TraceEvent::set_timestamp_ps(::google::protobuf::uint64 value) { + + timestamp_ps_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TraceEvent.timestamp_ps) +} + +// uint64 duration_ps = 10; +inline void TraceEvent::clear_duration_ps() { + duration_ps_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 TraceEvent::duration_ps() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TraceEvent.duration_ps) + return duration_ps_; +} +inline void TraceEvent::set_duration_ps(::google::protobuf::uint64 value) { + + duration_ps_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TraceEvent.duration_ps) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fprofiler_2ftrace_5fevents_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events.proto new file mode 100644 index 0000000..eee57cc --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tpu; + +// A 'Trace' contains metadata for the individual traces of a system. +message Trace { + // The devices that this trace has information about. Maps from device_id to + // more data about the specific device. + map devices = 1; + + // All trace events capturing in the profiling period. + repeated TraceEvent trace_events = 4; +} + +// A 'device' is a physical entity in the system and is comprised of several +// resources. +message Device { + // The name of the device. + string name = 1; + + // The id of this device, unique in a single trace. + uint32 device_id = 2; + + // The resources on this device, keyed by resource_id; + map resources = 3; +} + +// A 'resource' generally is a specific computation component on a device. These +// can range from threads on CPUs to specific arithmetic units on hardware +// devices. +message Resource { + // The name of the resource. + string name = 1; + + // The id of the resource. Unique within a device. + uint32 resource_id = 2; +} + +message TraceEvent { + // The id of the device that this event occurred on. The full dataset should + // have this device present in the Trace object. + uint32 device_id = 1; + + // The id of the resource that this event occurred on. The full dataset should + // have this resource present in the Device object of the Trace object. A + // resource_id is unique on a specific device, but not necessarily within the + // trace. + uint32 resource_id = 2; + + // The name of this trace event. + string name = 3; + + // The timestamp that this event occurred at (in picos since tracing started). + uint64 timestamp_ps = 9; + + // The duration of the event in picoseconds if applicable. + // Events without duration are called instant events. + uint64 duration_ps = 10; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events_pb2.py new file mode 100644 index 0000000..83b7922 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/profiler/trace_events_pb2.py @@ -0,0 +1,341 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/profiler/trace_events.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/profiler/trace_events.proto', + package='diplomacy.tensorflow.tpu', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_HloProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class CompilationResultProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CompilationResultProto_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto { +static void InitDefaultsCompilationResultProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_CompilationResultProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::CompilationResultProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::CompilationResultProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_CompilationResultProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsCompilationResultProto}, { + &protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::scc_info_HloProto.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_CompilationResultProto.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CompilationResultProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CompilationResultProto, status_code_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CompilationResultProto, status_error_message_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CompilationResultProto, hlo_protos_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tpu::CompilationResultProto)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tpu::_CompilationResultProto_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\?diplomacy_tensorflow/contrib/tpu/proto" + "/compilation_result.proto\022\030diplomacy.ten" + "sorflow.tpu\0323diplomacy_tensorflow/compil" + "er/xla/service/hlo.proto\0324diplomacy_tens" + "orflow/core/lib/core/error_codes.proto\"\220" + "\001\n\026CompilationResultProto\0225\n\013status_code" + "\030\001 \001(\0162 .diplomacy.tensorflow.error.Code" + "\022\034\n\024status_error_message\030\002 \001(\t\022!\n\nhlo_pr" + "otos\030\003 \003(\0132\r.xla.HloProtoB\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 358); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcompiler_2fxla_2fservice_2fhlo_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +void CompilationResultProto::InitAsDefaultInstance() { +} +void CompilationResultProto::clear_hlo_protos() { + hlo_protos_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CompilationResultProto::kStatusCodeFieldNumber; +const int CompilationResultProto::kStatusErrorMessageFieldNumber; +const int CompilationResultProto::kHloProtosFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CompilationResultProto::CompilationResultProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::scc_info_CompilationResultProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.CompilationResultProto) +} +CompilationResultProto::CompilationResultProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + hlo_protos_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::scc_info_CompilationResultProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tpu.CompilationResultProto) +} +CompilationResultProto::CompilationResultProto(const CompilationResultProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + hlo_protos_(from.hlo_protos_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + status_error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.status_error_message().size() > 0) { + status_error_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.status_error_message(), + GetArenaNoVirtual()); + } + status_code_ = from.status_code_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.CompilationResultProto) +} + +void CompilationResultProto::SharedCtor() { + status_error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + status_code_ = 0; +} + +CompilationResultProto::~CompilationResultProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.CompilationResultProto) + SharedDtor(); +} + +void CompilationResultProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + status_error_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void CompilationResultProto::ArenaDtor(void* object) { + CompilationResultProto* _this = reinterpret_cast< CompilationResultProto* >(object); + (void)_this; +} +void CompilationResultProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CompilationResultProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CompilationResultProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CompilationResultProto& CompilationResultProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::scc_info_CompilationResultProto.base); + return *internal_default_instance(); +} + + +void CompilationResultProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.CompilationResultProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + hlo_protos_.Clear(); + status_error_message_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + status_code_ = 0; + _internal_metadata_.Clear(); +} + +bool CompilationResultProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.CompilationResultProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.error.Code status_code = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_status_code(static_cast< ::diplomacy::tensorflow::error::Code >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string status_error_message = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_status_error_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->status_error_message().data(), static_cast(this->status_error_message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .xla.HloProto hlo_protos = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_hlo_protos())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.CompilationResultProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.CompilationResultProto) + return false; +#undef DO_ +} + +void CompilationResultProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.CompilationResultProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.error.Code status_code = 1; + if (this->status_code() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->status_code(), output); + } + + // string status_error_message = 2; + if (this->status_error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->status_error_message().data(), static_cast(this->status_error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->status_error_message(), output); + } + + // repeated .xla.HloProto hlo_protos = 3; + for (unsigned int i = 0, + n = static_cast(this->hlo_protos_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->hlo_protos(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.CompilationResultProto) +} + +::google::protobuf::uint8* CompilationResultProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.CompilationResultProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.error.Code status_code = 1; + if (this->status_code() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->status_code(), target); + } + + // string status_error_message = 2; + if (this->status_error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->status_error_message().data(), static_cast(this->status_error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->status_error_message(), target); + } + + // repeated .xla.HloProto hlo_protos = 3; + for (unsigned int i = 0, + n = static_cast(this->hlo_protos_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->hlo_protos(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.CompilationResultProto) + return target; +} + +size_t CompilationResultProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.CompilationResultProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .xla.HloProto hlo_protos = 3; + { + unsigned int count = static_cast(this->hlo_protos_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->hlo_protos(static_cast(i))); + } + } + + // string status_error_message = 2; + if (this->status_error_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->status_error_message()); + } + + // .diplomacy.tensorflow.error.Code status_code = 1; + if (this->status_code() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->status_code()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CompilationResultProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.CompilationResultProto) + GOOGLE_DCHECK_NE(&from, this); + const CompilationResultProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.CompilationResultProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.CompilationResultProto) + MergeFrom(*source); + } +} + +void CompilationResultProto::MergeFrom(const CompilationResultProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.CompilationResultProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + hlo_protos_.MergeFrom(from.hlo_protos_); + if (from.status_error_message().size() > 0) { + set_status_error_message(from.status_error_message()); + } + if (from.status_code() != 0) { + set_status_code(from.status_code()); + } +} + +void CompilationResultProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.CompilationResultProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CompilationResultProto::CopyFrom(const CompilationResultProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.CompilationResultProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CompilationResultProto::IsInitialized() const { + return true; +} + +void CompilationResultProto::Swap(CompilationResultProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CompilationResultProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CompilationResultProto::UnsafeArenaSwap(CompilationResultProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CompilationResultProto::InternalSwap(CompilationResultProto* other) { + using std::swap; + CastToBase(&hlo_protos_)->InternalSwap(CastToBase(&other->hlo_protos_)); + status_error_message_.Swap(&other->status_error_message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(status_code_, other->status_code_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CompilationResultProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::CompilationResultProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::CompilationResultProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tpu::CompilationResultProto >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result.pb.h new file mode 100644 index 0000000..a7191b8 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result.pb.h @@ -0,0 +1,362 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/compiler/xla/service/hlo.pb.h" +#include "diplomacy_tensorflow/core/lib/core/error_codes.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class CompilationResultProto; +class CompilationResultProtoDefaultTypeInternal; +extern CompilationResultProtoDefaultTypeInternal _CompilationResultProto_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tpu::CompilationResultProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::CompilationResultProto>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +class CompilationResultProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.CompilationResultProto) */ { + public: + CompilationResultProto(); + virtual ~CompilationResultProto(); + + CompilationResultProto(const CompilationResultProto& from); + + inline CompilationResultProto& operator=(const CompilationResultProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CompilationResultProto(CompilationResultProto&& from) noexcept + : CompilationResultProto() { + *this = ::std::move(from); + } + + inline CompilationResultProto& operator=(CompilationResultProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CompilationResultProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CompilationResultProto* internal_default_instance() { + return reinterpret_cast( + &_CompilationResultProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(CompilationResultProto* other); + void Swap(CompilationResultProto* other); + friend void swap(CompilationResultProto& a, CompilationResultProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CompilationResultProto* New() const final { + return CreateMaybeMessage(NULL); + } + + CompilationResultProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CompilationResultProto& from); + void MergeFrom(const CompilationResultProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CompilationResultProto* other); + protected: + explicit CompilationResultProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .xla.HloProto hlo_protos = 3; + int hlo_protos_size() const; + void clear_hlo_protos(); + static const int kHloProtosFieldNumber = 3; + ::xla::HloProto* mutable_hlo_protos(int index); + ::google::protobuf::RepeatedPtrField< ::xla::HloProto >* + mutable_hlo_protos(); + const ::xla::HloProto& hlo_protos(int index) const; + ::xla::HloProto* add_hlo_protos(); + const ::google::protobuf::RepeatedPtrField< ::xla::HloProto >& + hlo_protos() const; + + // string status_error_message = 2; + void clear_status_error_message(); + static const int kStatusErrorMessageFieldNumber = 2; + const ::std::string& status_error_message() const; + void set_status_error_message(const ::std::string& value); + #if LANG_CXX11 + void set_status_error_message(::std::string&& value); + #endif + void set_status_error_message(const char* value); + void set_status_error_message(const char* value, size_t size); + ::std::string* mutable_status_error_message(); + ::std::string* release_status_error_message(); + void set_allocated_status_error_message(::std::string* status_error_message); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_status_error_message(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_status_error_message( + ::std::string* status_error_message); + + // .diplomacy.tensorflow.error.Code status_code = 1; + void clear_status_code(); + static const int kStatusCodeFieldNumber = 1; + ::diplomacy::tensorflow::error::Code status_code() const; + void set_status_code(::diplomacy::tensorflow::error::Code value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.CompilationResultProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::xla::HloProto > hlo_protos_; + ::google::protobuf::internal::ArenaStringPtr status_error_message_; + int status_code_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// CompilationResultProto + +// .diplomacy.tensorflow.error.Code status_code = 1; +inline void CompilationResultProto::clear_status_code() { + status_code_ = 0; +} +inline ::diplomacy::tensorflow::error::Code CompilationResultProto::status_code() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CompilationResultProto.status_code) + return static_cast< ::diplomacy::tensorflow::error::Code >(status_code_); +} +inline void CompilationResultProto::set_status_code(::diplomacy::tensorflow::error::Code value) { + + status_code_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CompilationResultProto.status_code) +} + +// string status_error_message = 2; +inline void CompilationResultProto::clear_status_error_message() { + status_error_message_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& CompilationResultProto::status_error_message() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) + return status_error_message_.Get(); +} +inline void CompilationResultProto::set_status_error_message(const ::std::string& value) { + + status_error_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) +} +#if LANG_CXX11 +inline void CompilationResultProto::set_status_error_message(::std::string&& value) { + + status_error_message_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) +} +#endif +inline void CompilationResultProto::set_status_error_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + status_error_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) +} +inline void CompilationResultProto::set_status_error_message(const char* value, + size_t size) { + + status_error_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) +} +inline ::std::string* CompilationResultProto::mutable_status_error_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) + return status_error_message_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* CompilationResultProto::release_status_error_message() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) + + return status_error_message_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void CompilationResultProto::set_allocated_status_error_message(::std::string* status_error_message) { + if (status_error_message != NULL) { + + } else { + + } + status_error_message_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), status_error_message, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) +} +inline ::std::string* CompilationResultProto::unsafe_arena_release_status_error_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return status_error_message_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void CompilationResultProto::unsafe_arena_set_allocated_status_error_message( + ::std::string* status_error_message) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (status_error_message != NULL) { + + } else { + + } + status_error_message_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + status_error_message, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message) +} + +// repeated .xla.HloProto hlo_protos = 3; +inline int CompilationResultProto::hlo_protos_size() const { + return hlo_protos_.size(); +} +inline ::xla::HloProto* CompilationResultProto::mutable_hlo_protos(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.CompilationResultProto.hlo_protos) + return hlo_protos_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::xla::HloProto >* +CompilationResultProto::mutable_hlo_protos() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.CompilationResultProto.hlo_protos) + return &hlo_protos_; +} +inline const ::xla::HloProto& CompilationResultProto::hlo_protos(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CompilationResultProto.hlo_protos) + return hlo_protos_.Get(index); +} +inline ::xla::HloProto* CompilationResultProto::add_hlo_protos() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.CompilationResultProto.hlo_protos) + return hlo_protos_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::xla::HloProto >& +CompilationResultProto::hlo_protos() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.CompilationResultProto.hlo_protos) + return hlo_protos_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2fcompilation_5fresult_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto new file mode 100644 index 0000000..9ccf6e5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +option cc_enable_arenas = true; +package diplomacy.tensorflow.tpu; + +import "diplomacy_tensorflow/compiler/xla/service/hlo.proto"; +import "diplomacy_tensorflow/core/lib/core/error_codes.proto"; + +// Describes the result of a TPU compilation. +message CompilationResultProto { + // The error message, if any, returned during compilation. + error.Code status_code = 1; + string status_error_message = 2; + + // HLO proto. + repeated xla.HloProto hlo_protos = 3; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result_pb2.py new file mode 100644 index 0000000..c01d8f5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/compilation_result_pb2.py @@ -0,0 +1,89 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.compiler.xla.service import hlo_pb2 as diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2 +from diplomacy_tensorflow.core.lib.core import error_codes_pb2 as diplomacy__tensorflow_dot_core_dot_lib_dot_core_dot_error__codes__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto', + package='diplomacy.tensorflow.tpu', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n?diplomacy_tensorflow/contrib/tpu/proto/compilation_result.proto\x12\x18\x64iplomacy.tensorflow.tpu\x1a\x33\x64iplomacy_tensorflow/compiler/xla/service/hlo.proto\x1a\x34\x64iplomacy_tensorflow/core/lib/core/error_codes.proto\"\x90\x01\n\x16\x43ompilationResultProto\x12\x35\n\x0bstatus_code\x18\x01 \x01(\x0e\x32 .diplomacy.tensorflow.error.Code\x12\x1c\n\x14status_error_message\x18\x02 \x01(\t\x12!\n\nhlo_protos\x18\x03 \x03(\x0b\x32\r.xla.HloProtoB\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_lib_dot_core_dot_error__codes__pb2.DESCRIPTOR,]) + + + + +_COMPILATIONRESULTPROTO = _descriptor.Descriptor( + name='CompilationResultProto', + full_name='diplomacy.tensorflow.tpu.CompilationResultProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='status_code', full_name='diplomacy.tensorflow.tpu.CompilationResultProto.status_code', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='status_error_message', full_name='diplomacy.tensorflow.tpu.CompilationResultProto.status_error_message', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='hlo_protos', full_name='diplomacy.tensorflow.tpu.CompilationResultProto.hlo_protos', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=201, + serialized_end=345, +) + +_COMPILATIONRESULTPROTO.fields_by_name['status_code'].enum_type = diplomacy__tensorflow_dot_core_dot_lib_dot_core_dot_error__codes__pb2._CODE +_COMPILATIONRESULTPROTO.fields_by_name['hlo_protos'].message_type = diplomacy__tensorflow_dot_compiler_dot_xla_dot_service_dot_hlo__pb2._HLOPROTO +DESCRIPTOR.message_types_by_name['CompilationResultProto'] = _COMPILATIONRESULTPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +CompilationResultProto = _reflection.GeneratedProtocolMessageType('CompilationResultProto', (_message.Message,), dict( + DESCRIPTOR = _COMPILATIONRESULTPROTO, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.compilation_result_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.CompilationResultProto) + )) +_sym_db.RegisterMessage(CompilationResultProto) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.cc new file mode 100644 index 0000000..b7c7020 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.cc @@ -0,0 +1,7031 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto + +#include "diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_AdadeltaParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_AdagradParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_AdamParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_CenteredRmsPropParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DynamicLearningRate; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FtrlParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_MdlAdagradLightParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_MomentumParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ProximalAdagradParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_RmsPropParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_StateVariableSpecification_FillWithConstant; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_StateVariableSpecification_UserDefined; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_StochasticGradientDescentParameters; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ClippingLimits; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LearningRate; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto +namespace protobuf_google_2fprotobuf_2fwrappers_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fwrappers_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FloatValue; +} // namespace protobuf_google_2fprotobuf_2fwrappers_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class ClippingLimitsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ClippingLimits_default_instance_; +class DynamicLearningRateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DynamicLearningRate_default_instance_; +class LearningRateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + float constant_; + const ::diplomacy::tensorflow::tpu::DynamicLearningRate* dynamic_; +} _LearningRate_default_instance_; +class AdagradParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AdagradParameters_default_instance_; +class StochasticGradientDescentParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _StochasticGradientDescentParameters_default_instance_; +class FtrlParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FtrlParameters_default_instance_; +class AdamParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AdamParameters_default_instance_; +class MomentumParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MomentumParameters_default_instance_; +class RmsPropParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _RmsPropParameters_default_instance_; +class CenteredRmsPropParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CenteredRmsPropParameters_default_instance_; +class MdlAdagradLightParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MdlAdagradLightParameters_default_instance_; +class AdadeltaParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AdadeltaParameters_default_instance_; +class ProximalAdagradParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ProximalAdagradParameters_default_instance_; +class OptimizationParametersDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::tpu::AdagradParameters* adagrad_; + const ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* stochastic_gradient_descent_; + const ::diplomacy::tensorflow::tpu::FtrlParameters* ftrl_; + const ::diplomacy::tensorflow::tpu::AdamParameters* adam_; + const ::diplomacy::tensorflow::tpu::MomentumParameters* momentum_; + const ::diplomacy::tensorflow::tpu::RmsPropParameters* rms_prop_; + const ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* centered_rms_prop_; + const ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* mdl_adagrad_light_; + const ::diplomacy::tensorflow::tpu::AdadeltaParameters* adadelta_; + const ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* proximal_adagrad_; +} _OptimizationParameters_default_instance_; +class StateVariableSpecification_UserDefinedDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _StateVariableSpecification_UserDefined_default_instance_; +class StateVariableSpecification_FillWithConstantDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _StateVariableSpecification_FillWithConstant_default_instance_; +class StateVariableSpecificationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* user_defined_; + const ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* fill_with_constant_; +} _StateVariableSpecification_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto { +static void InitDefaultsClippingLimits() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_ClippingLimits_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::ClippingLimits(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::ClippingLimits::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ClippingLimits = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsClippingLimits}, { + &protobuf_google_2fprotobuf_2fwrappers_2eproto::scc_info_FloatValue.base,}}; + +static void InitDefaultsDynamicLearningRate() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_DynamicLearningRate_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::DynamicLearningRate(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::DynamicLearningRate::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DynamicLearningRate = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDynamicLearningRate}, {}}; + +static void InitDefaultsLearningRate() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_LearningRate_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::LearningRate(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::LearningRate::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_LearningRate = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsLearningRate}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_DynamicLearningRate.base,}}; + +static void InitDefaultsAdagradParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_AdagradParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::AdagradParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::AdagradParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_AdagradParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAdagradParameters}, {}}; + +static void InitDefaultsStochasticGradientDescentParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_StochasticGradientDescentParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_StochasticGradientDescentParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsStochasticGradientDescentParameters}, {}}; + +static void InitDefaultsFtrlParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_FtrlParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::FtrlParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::FtrlParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_FtrlParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFtrlParameters}, {}}; + +static void InitDefaultsAdamParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_AdamParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::AdamParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::AdamParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_AdamParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAdamParameters}, {}}; + +static void InitDefaultsMomentumParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_MomentumParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::MomentumParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::MomentumParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MomentumParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMomentumParameters}, {}}; + +static void InitDefaultsRmsPropParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_RmsPropParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::RmsPropParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::RmsPropParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_RmsPropParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsRmsPropParameters}, {}}; + +static void InitDefaultsCenteredRmsPropParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_CenteredRmsPropParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CenteredRmsPropParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCenteredRmsPropParameters}, {}}; + +static void InitDefaultsMdlAdagradLightParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_MdlAdagradLightParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MdlAdagradLightParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMdlAdagradLightParameters}, {}}; + +static void InitDefaultsAdadeltaParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_AdadeltaParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::AdadeltaParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::AdadeltaParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_AdadeltaParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAdadeltaParameters}, {}}; + +static void InitDefaultsProximalAdagradParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_ProximalAdagradParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::ProximalAdagradParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::ProximalAdagradParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ProximalAdagradParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsProximalAdagradParameters}, {}}; + +static void InitDefaultsOptimizationParameters() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::OptimizationParameters(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::OptimizationParameters::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<12> scc_info_OptimizationParameters = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 12, InitDefaultsOptimizationParameters}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_LearningRate.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_ClippingLimits.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdagradParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StochasticGradientDescentParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_FtrlParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdamParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_MomentumParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_RmsPropParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_CenteredRmsPropParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_MdlAdagradLightParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdadeltaParameters.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_ProximalAdagradParameters.base,}}; + +static void InitDefaultsStateVariableSpecification_UserDefined() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_StateVariableSpecification_UserDefined_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_StateVariableSpecification_UserDefined = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsStateVariableSpecification_UserDefined}, {}}; + +static void InitDefaultsStateVariableSpecification_FillWithConstant() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_StateVariableSpecification_FillWithConstant_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_StateVariableSpecification_FillWithConstant = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsStateVariableSpecification_FillWithConstant}, {}}; + +static void InitDefaultsStateVariableSpecification() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_StateVariableSpecification_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::StateVariableSpecification(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::StateVariableSpecification::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_StateVariableSpecification = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsStateVariableSpecification}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification_UserDefined.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification_FillWithConstant.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_ClippingLimits.base); + ::google::protobuf::internal::InitSCC(&scc_info_DynamicLearningRate.base); + ::google::protobuf::internal::InitSCC(&scc_info_LearningRate.base); + ::google::protobuf::internal::InitSCC(&scc_info_AdagradParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_StochasticGradientDescentParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_FtrlParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_AdamParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_MomentumParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_RmsPropParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_CenteredRmsPropParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_MdlAdagradLightParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_AdadeltaParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_ProximalAdagradParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_OptimizationParameters.base); + ::google::protobuf::internal::InitSCC(&scc_info_StateVariableSpecification_UserDefined.base); + ::google::protobuf::internal::InitSCC(&scc_info_StateVariableSpecification_FillWithConstant.base); + ::google::protobuf::internal::InitSCC(&scc_info_StateVariableSpecification.base); +} + +::google::protobuf::Metadata file_level_metadata[17]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::ClippingLimits, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::ClippingLimits, lower_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::ClippingLimits, upper_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::DynamicLearningRate, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::LearningRate, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::LearningRate, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::tpu::LearningRateDefaultTypeInternal, constant_), + offsetof(::diplomacy::tensorflow::tpu::LearningRateDefaultTypeInternal, dynamic_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::LearningRate, learning_rate_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdagradParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdagradParameters, initial_accumulator_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::FtrlParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::FtrlParameters, l1_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::FtrlParameters, l2_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::FtrlParameters, lr_power_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::FtrlParameters, initial_accum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::FtrlParameters, initial_linear_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, beta1_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, beta2_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, epsilon_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, initial_m_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, initial_v_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, use_non_lazy_adam_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdamParameters, use_sum_inside_sqrt_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MomentumParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MomentumParameters, momentum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MomentumParameters, use_nesterov_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MomentumParameters, initial_accum_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::RmsPropParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::RmsPropParameters, rho_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::RmsPropParameters, momentum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::RmsPropParameters, epsilon_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::RmsPropParameters, initial_ms_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::RmsPropParameters, initial_mom_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters, rho_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters, momentum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters, epsilon_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters, initial_ms_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters, initial_mom_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters, initial_mg_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, l2_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, lr_power_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, min_servable_mdl_benefit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, mdl_mix_in_margin_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, mdl_benefit_rampup_coeff_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, mdl_min_weight_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, benefit_revisit_scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, max_event_benefit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, max_total_benefit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, mdl_hard_limit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, hard_limit_min_benefit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, mdl_regularize_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, initial_accumulator_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, initial_weight_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters, initial_benefit_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdadeltaParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdadeltaParameters, rho_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdadeltaParameters, epsilon_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdadeltaParameters, initial_accumulator_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::AdadeltaParameters, initial_update_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::ProximalAdagradParameters, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::ProximalAdagradParameters, l1_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::ProximalAdagradParameters, l2_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::ProximalAdagradParameters, initial_accumulator_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, learning_rate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, clipping_limits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, gradient_clipping_limits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, weight_decay_factor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, use_gradient_accumulation_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, adagrad_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, stochastic_gradient_descent_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, ftrl_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, adam_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, momentum_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, rms_prop_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, centered_rms_prop_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, mdl_adagrad_light_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, adadelta_), + offsetof(::diplomacy::tensorflow::tpu::OptimizationParametersDefaultTypeInternal, proximal_adagrad_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::OptimizationParameters, parameters_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant, initial_value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StateVariableSpecification, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StateVariableSpecification, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StateVariableSpecification, name_), + offsetof(::diplomacy::tensorflow::tpu::StateVariableSpecificationDefaultTypeInternal, user_defined_), + offsetof(::diplomacy::tensorflow::tpu::StateVariableSpecificationDefaultTypeInternal, fill_with_constant_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::StateVariableSpecification, usage_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tpu::ClippingLimits)}, + { 7, -1, sizeof(::diplomacy::tensorflow::tpu::DynamicLearningRate)}, + { 12, -1, sizeof(::diplomacy::tensorflow::tpu::LearningRate)}, + { 20, -1, sizeof(::diplomacy::tensorflow::tpu::AdagradParameters)}, + { 26, -1, sizeof(::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters)}, + { 31, -1, sizeof(::diplomacy::tensorflow::tpu::FtrlParameters)}, + { 41, -1, sizeof(::diplomacy::tensorflow::tpu::AdamParameters)}, + { 53, -1, sizeof(::diplomacy::tensorflow::tpu::MomentumParameters)}, + { 61, -1, sizeof(::diplomacy::tensorflow::tpu::RmsPropParameters)}, + { 71, -1, sizeof(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters)}, + { 82, -1, sizeof(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters)}, + { 102, -1, sizeof(::diplomacy::tensorflow::tpu::AdadeltaParameters)}, + { 111, -1, sizeof(::diplomacy::tensorflow::tpu::ProximalAdagradParameters)}, + { 119, -1, sizeof(::diplomacy::tensorflow::tpu::OptimizationParameters)}, + { 140, -1, sizeof(::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined)}, + { 145, -1, sizeof(::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant)}, + { 151, -1, sizeof(::diplomacy::tensorflow::tpu::StateVariableSpecification)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tpu::_ClippingLimits_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_DynamicLearningRate_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_LearningRate_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_AdagradParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_StochasticGradientDescentParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_FtrlParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_AdamParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_MomentumParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_RmsPropParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_CenteredRmsPropParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_MdlAdagradLightParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_AdadeltaParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_ProximalAdagradParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_StateVariableSpecification_UserDefined_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_StateVariableSpecification_FillWithConstant_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_StateVariableSpecification_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 17); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nDdiplomacy_tensorflow/contrib/tpu/proto" + "/optimization_parameters.proto\022\030diplomac" + "y.tensorflow.tpu\032\036google/protobuf/wrappe" + "rs.proto\"h\n\016ClippingLimits\022*\n\005lower\030\001 \001(" + "\0132\033.google.protobuf.FloatValue\022*\n\005upper\030" + "\002 \001(\0132\033.google.protobuf.FloatValue\"\025\n\023Dy" + "namicLearningRate\"u\n\014LearningRate\022\022\n\010con" + "stant\030\001 \001(\002H\000\022@\n\007dynamic\030\002 \001(\0132-.diploma" + "cy.tensorflow.tpu.DynamicLearningRateH\000B" + "\017\n\rlearning_rate\"0\n\021AdagradParameters\022\033\n" + "\023initial_accumulator\030\001 \001(\002\"%\n#Stochastic" + "GradientDescentParameters\"i\n\016FtrlParamet" + "ers\022\n\n\002l1\030\001 \001(\002\022\n\n\002l2\030\002 \001(\002\022\020\n\010lr_power\030" + "\003 \001(\002\022\025\n\rinitial_accum\030\004 \001(\002\022\026\n\016initial_" + "linear\030\005 \001(\002\"\235\001\n\016AdamParameters\022\r\n\005beta1" + "\030\003 \001(\002\022\r\n\005beta2\030\004 \001(\002\022\017\n\007epsilon\030\005 \001(\002\022\021" + "\n\tinitial_m\030\006 \001(\002\022\021\n\tinitial_v\030\007 \001(\002\022\031\n\021" + "use_non_lazy_adam\030\010 \001(\010\022\033\n\023use_sum_insid" + "e_sqrt\030\n \001(\010\"S\n\022MomentumParameters\022\020\n\010mo" + "mentum\030\001 \001(\002\022\024\n\014use_nesterov\030\002 \001(\010\022\025\n\rin" + "itial_accum\030\003 \001(\002\"l\n\021RmsPropParameters\022\013" + "\n\003rho\030\001 \001(\002\022\020\n\010momentum\030\002 \001(\002\022\017\n\007epsilon" + "\030\003 \001(\002\022\022\n\ninitial_ms\030\004 \001(\002\022\023\n\013initial_mo" + "m\030\005 \001(\002\"\210\001\n\031CenteredRmsPropParameters\022\013\n" + "\003rho\030\001 \001(\002\022\020\n\010momentum\030\002 \001(\002\022\017\n\007epsilon\030" + "\003 \001(\002\022\022\n\ninitial_ms\030\004 \001(\002\022\023\n\013initial_mom" + "\030\005 \001(\002\022\022\n\ninitial_mg\030\006 \001(\002\"\243\003\n\031MdlAdagra" + "dLightParameters\022\n\n\002l2\030\001 \001(\002\022\020\n\010lr_power" + "\030\002 \001(\002\022 \n\030min_servable_mdl_benefit\030\003 \001(\002" + "\022\031\n\021mdl_mix_in_margin\030\004 \001(\002\022 \n\030mdl_benef" + "it_rampup_coeff\030\005 \001(\002\022\026\n\016mdl_min_weight\030" + "\006 \001(\002\022\035\n\025benefit_revisit_scale\030\007 \001(\002\022\031\n\021" + "max_event_benefit\030\010 \001(\002\022\031\n\021max_total_ben" + "efit\030\t \001(\002\022\026\n\016mdl_hard_limit\030\n \001(\002\022\036\n\026ha" + "rd_limit_min_benefit\030\013 \001(\010\022\026\n\016mdl_regula" + "rize\030\014 \001(\010\022\033\n\023initial_accumulator\030\r \001(\002\022" + "\026\n\016initial_weight\030\016 \001(\002\022\027\n\017initial_benef" + "it\030\017 \001(\002\"g\n\022AdadeltaParameters\022\013\n\003rho\030\001 " + "\001(\002\022\017\n\007epsilon\030\002 \001(\002\022\033\n\023initial_accumula" + "tor\030\003 \001(\002\022\026\n\016initial_update\030\004 \001(\002\"P\n\031Pro" + "ximalAdagradParameters\022\n\n\002l1\030\001 \001(\002\022\n\n\002l2" + "\030\002 \001(\002\022\033\n\023initial_accumulator\030\003 \001(\002\"\216\010\n\026" + "OptimizationParameters\022=\n\rlearning_rate\030" + "\r \001(\0132&.diplomacy.tensorflow.tpu.Learnin" + "gRate\022A\n\017clipping_limits\030\002 \001(\0132(.diploma" + "cy.tensorflow.tpu.ClippingLimits\022J\n\030grad" + "ient_clipping_limits\030\007 \001(\0132(.diplomacy.t" + "ensorflow.tpu.ClippingLimits\022\033\n\023weight_d" + "ecay_factor\030\020 \001(\002\022!\n\031use_gradient_accumu" + "lation\030\017 \001(\010\022>\n\007adagrad\030\003 \001(\0132+.diplomac" + "y.tensorflow.tpu.AdagradParametersH\000\022d\n\033" + "stochastic_gradient_descent\030\004 \001(\0132=.dipl" + "omacy.tensorflow.tpu.StochasticGradientD" + "escentParametersH\000\0228\n\004ftrl\030\005 \001(\0132(.diplo" + "macy.tensorflow.tpu.FtrlParametersH\000\0228\n\004" + "adam\030\006 \001(\0132(.diplomacy.tensorflow.tpu.Ad" + "amParametersH\000\022@\n\010momentum\030\010 \001(\0132,.diplo" + "macy.tensorflow.tpu.MomentumParametersH\000" + "\022\?\n\010rms_prop\030\t \001(\0132+.diplomacy.tensorflo" + "w.tpu.RmsPropParametersH\000\022P\n\021centered_rm" + "s_prop\030\n \001(\01323.diplomacy.tensorflow.tpu." + "CenteredRmsPropParametersH\000\022P\n\021mdl_adagr" + "ad_light\030\013 \001(\01323.diplomacy.tensorflow.tp" + "u.MdlAdagradLightParametersH\000\022@\n\010adadelt" + "a\030\014 \001(\0132,.diplomacy.tensorflow.tpu.Adade" + "ltaParametersH\000\022O\n\020proximal_adagrad\030\016 \001(" + "\01323.diplomacy.tensorflow.tpu.ProximalAda" + "gradParametersH\000B\014\n\nparametersJ\004\010\001\020\002\"\254\002\n" + "\032StateVariableSpecification\022\014\n\004name\030\001 \001(" + "\t\022X\n\014user_defined\030\002 \001(\0132@.diplomacy.tens" + "orflow.tpu.StateVariableSpecification.Us" + "erDefinedH\000\022c\n\022fill_with_constant\030\003 \001(\0132" + "E.diplomacy.tensorflow.tpu.StateVariable" + "Specification.FillWithConstantH\000\032\r\n\013User" + "Defined\032)\n\020FillWithConstant\022\025\n\rinitial_v" + "alue\030\001 \001(\001B\007\n\005usageb\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 3027); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto", &protobuf_RegisterTypes); + ::protobuf_google_2fprotobuf_2fwrappers_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +void ClippingLimits::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::_ClippingLimits_default_instance_._instance.get_mutable()->lower_ = const_cast< ::google::protobuf::FloatValue*>( + ::google::protobuf::FloatValue::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_ClippingLimits_default_instance_._instance.get_mutable()->upper_ = const_cast< ::google::protobuf::FloatValue*>( + ::google::protobuf::FloatValue::internal_default_instance()); +} +void ClippingLimits::clear_lower() { + if (GetArenaNoVirtual() == NULL && lower_ != NULL) { + delete lower_; + } + lower_ = NULL; +} +void ClippingLimits::clear_upper() { + if (GetArenaNoVirtual() == NULL && upper_ != NULL) { + delete upper_; + } + upper_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ClippingLimits::kLowerFieldNumber; +const int ClippingLimits::kUpperFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ClippingLimits::ClippingLimits() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_ClippingLimits.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.ClippingLimits) +} +ClippingLimits::ClippingLimits(const ClippingLimits& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_lower()) { + lower_ = new ::google::protobuf::FloatValue(*from.lower_); + } else { + lower_ = NULL; + } + if (from.has_upper()) { + upper_ = new ::google::protobuf::FloatValue(*from.upper_); + } else { + upper_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.ClippingLimits) +} + +void ClippingLimits::SharedCtor() { + ::memset(&lower_, 0, static_cast( + reinterpret_cast(&upper_) - + reinterpret_cast(&lower_)) + sizeof(upper_)); +} + +ClippingLimits::~ClippingLimits() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.ClippingLimits) + SharedDtor(); +} + +void ClippingLimits::SharedDtor() { + if (this != internal_default_instance()) delete lower_; + if (this != internal_default_instance()) delete upper_; +} + +void ClippingLimits::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ClippingLimits::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ClippingLimits& ClippingLimits::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_ClippingLimits.base); + return *internal_default_instance(); +} + + +void ClippingLimits::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.ClippingLimits) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && lower_ != NULL) { + delete lower_; + } + lower_ = NULL; + if (GetArenaNoVirtual() == NULL && upper_ != NULL) { + delete upper_; + } + upper_ = NULL; + _internal_metadata_.Clear(); +} + +bool ClippingLimits::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.ClippingLimits) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .google.protobuf.FloatValue lower = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_lower())); + } else { + goto handle_unusual; + } + break; + } + + // .google.protobuf.FloatValue upper = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_upper())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.ClippingLimits) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.ClippingLimits) + return false; +#undef DO_ +} + +void ClippingLimits::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.ClippingLimits) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.FloatValue lower = 1; + if (this->has_lower()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_lower(), output); + } + + // .google.protobuf.FloatValue upper = 2; + if (this->has_upper()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_upper(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.ClippingLimits) +} + +::google::protobuf::uint8* ClippingLimits::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.ClippingLimits) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .google.protobuf.FloatValue lower = 1; + if (this->has_lower()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_lower(), deterministic, target); + } + + // .google.protobuf.FloatValue upper = 2; + if (this->has_upper()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_upper(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.ClippingLimits) + return target; +} + +size_t ClippingLimits::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.ClippingLimits) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .google.protobuf.FloatValue lower = 1; + if (this->has_lower()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *lower_); + } + + // .google.protobuf.FloatValue upper = 2; + if (this->has_upper()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *upper_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ClippingLimits::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.ClippingLimits) + GOOGLE_DCHECK_NE(&from, this); + const ClippingLimits* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.ClippingLimits) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.ClippingLimits) + MergeFrom(*source); + } +} + +void ClippingLimits::MergeFrom(const ClippingLimits& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.ClippingLimits) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_lower()) { + mutable_lower()->::google::protobuf::FloatValue::MergeFrom(from.lower()); + } + if (from.has_upper()) { + mutable_upper()->::google::protobuf::FloatValue::MergeFrom(from.upper()); + } +} + +void ClippingLimits::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.ClippingLimits) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ClippingLimits::CopyFrom(const ClippingLimits& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.ClippingLimits) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClippingLimits::IsInitialized() const { + return true; +} + +void ClippingLimits::Swap(ClippingLimits* other) { + if (other == this) return; + InternalSwap(other); +} +void ClippingLimits::InternalSwap(ClippingLimits* other) { + using std::swap; + swap(lower_, other->lower_); + swap(upper_, other->upper_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ClippingLimits::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DynamicLearningRate::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DynamicLearningRate::DynamicLearningRate() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_DynamicLearningRate.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.DynamicLearningRate) +} +DynamicLearningRate::DynamicLearningRate(const DynamicLearningRate& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.DynamicLearningRate) +} + +void DynamicLearningRate::SharedCtor() { +} + +DynamicLearningRate::~DynamicLearningRate() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.DynamicLearningRate) + SharedDtor(); +} + +void DynamicLearningRate::SharedDtor() { +} + +void DynamicLearningRate::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DynamicLearningRate::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DynamicLearningRate& DynamicLearningRate::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_DynamicLearningRate.base); + return *internal_default_instance(); +} + + +void DynamicLearningRate::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +bool DynamicLearningRate::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.DynamicLearningRate) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.DynamicLearningRate) + return false; +#undef DO_ +} + +void DynamicLearningRate::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.DynamicLearningRate) +} + +::google::protobuf::uint8* DynamicLearningRate::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.DynamicLearningRate) + return target; +} + +size_t DynamicLearningRate::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DynamicLearningRate::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + GOOGLE_DCHECK_NE(&from, this); + const DynamicLearningRate* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.DynamicLearningRate) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.DynamicLearningRate) + MergeFrom(*source); + } +} + +void DynamicLearningRate::MergeFrom(const DynamicLearningRate& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void DynamicLearningRate::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DynamicLearningRate::CopyFrom(const DynamicLearningRate& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.DynamicLearningRate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DynamicLearningRate::IsInitialized() const { + return true; +} + +void DynamicLearningRate::Swap(DynamicLearningRate* other) { + if (other == this) return; + InternalSwap(other); +} +void DynamicLearningRate::InternalSwap(DynamicLearningRate* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DynamicLearningRate::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LearningRate::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::_LearningRate_default_instance_.constant_ = 0; + ::diplomacy::tensorflow::tpu::_LearningRate_default_instance_.dynamic_ = const_cast< ::diplomacy::tensorflow::tpu::DynamicLearningRate*>( + ::diplomacy::tensorflow::tpu::DynamicLearningRate::internal_default_instance()); +} +void LearningRate::set_allocated_dynamic(::diplomacy::tensorflow::tpu::DynamicLearningRate* dynamic) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_learning_rate(); + if (dynamic) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + dynamic = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dynamic, submessage_arena); + } + set_has_dynamic(); + learning_rate_.dynamic_ = dynamic; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.LearningRate.dynamic) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LearningRate::kConstantFieldNumber; +const int LearningRate::kDynamicFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LearningRate::LearningRate() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_LearningRate.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.LearningRate) +} +LearningRate::LearningRate(const LearningRate& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_learning_rate(); + switch (from.learning_rate_case()) { + case kConstant: { + set_constant(from.constant()); + break; + } + case kDynamic: { + mutable_dynamic()->::diplomacy::tensorflow::tpu::DynamicLearningRate::MergeFrom(from.dynamic()); + break; + } + case LEARNING_RATE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.LearningRate) +} + +void LearningRate::SharedCtor() { + clear_has_learning_rate(); +} + +LearningRate::~LearningRate() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.LearningRate) + SharedDtor(); +} + +void LearningRate::SharedDtor() { + if (has_learning_rate()) { + clear_learning_rate(); + } +} + +void LearningRate::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LearningRate::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LearningRate& LearningRate::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_LearningRate.base); + return *internal_default_instance(); +} + + +void LearningRate::clear_learning_rate() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tpu.LearningRate) + switch (learning_rate_case()) { + case kConstant: { + // No need to clear + break; + } + case kDynamic: { + delete learning_rate_.dynamic_; + break; + } + case LEARNING_RATE_NOT_SET: { + break; + } + } + _oneof_case_[0] = LEARNING_RATE_NOT_SET; +} + + +void LearningRate::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.LearningRate) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_learning_rate(); + _internal_metadata_.Clear(); +} + +bool LearningRate::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.LearningRate) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float constant = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + clear_learning_rate(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &learning_rate_.constant_))); + set_has_constant(); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.DynamicLearningRate dynamic = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dynamic())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.LearningRate) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.LearningRate) + return false; +#undef DO_ +} + +void LearningRate::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.LearningRate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float constant = 1; + if (has_constant()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->constant(), output); + } + + // .diplomacy.tensorflow.tpu.DynamicLearningRate dynamic = 2; + if (has_dynamic()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_dynamic(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.LearningRate) +} + +::google::protobuf::uint8* LearningRate::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.LearningRate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float constant = 1; + if (has_constant()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->constant(), target); + } + + // .diplomacy.tensorflow.tpu.DynamicLearningRate dynamic = 2; + if (has_dynamic()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_dynamic(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.LearningRate) + return target; +} + +size_t LearningRate::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.LearningRate) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (learning_rate_case()) { + // float constant = 1; + case kConstant: { + total_size += 1 + 4; + break; + } + // .diplomacy.tensorflow.tpu.DynamicLearningRate dynamic = 2; + case kDynamic: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *learning_rate_.dynamic_); + break; + } + case LEARNING_RATE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LearningRate::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.LearningRate) + GOOGLE_DCHECK_NE(&from, this); + const LearningRate* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.LearningRate) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.LearningRate) + MergeFrom(*source); + } +} + +void LearningRate::MergeFrom(const LearningRate& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.LearningRate) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.learning_rate_case()) { + case kConstant: { + set_constant(from.constant()); + break; + } + case kDynamic: { + mutable_dynamic()->::diplomacy::tensorflow::tpu::DynamicLearningRate::MergeFrom(from.dynamic()); + break; + } + case LEARNING_RATE_NOT_SET: { + break; + } + } +} + +void LearningRate::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.LearningRate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LearningRate::CopyFrom(const LearningRate& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.LearningRate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LearningRate::IsInitialized() const { + return true; +} + +void LearningRate::Swap(LearningRate* other) { + if (other == this) return; + InternalSwap(other); +} +void LearningRate::InternalSwap(LearningRate* other) { + using std::swap; + swap(learning_rate_, other->learning_rate_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LearningRate::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void AdagradParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AdagradParameters::kInitialAccumulatorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AdagradParameters::AdagradParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdagradParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.AdagradParameters) +} +AdagradParameters::AdagradParameters(const AdagradParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + initial_accumulator_ = from.initial_accumulator_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.AdagradParameters) +} + +void AdagradParameters::SharedCtor() { + initial_accumulator_ = 0; +} + +AdagradParameters::~AdagradParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.AdagradParameters) + SharedDtor(); +} + +void AdagradParameters::SharedDtor() { +} + +void AdagradParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AdagradParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AdagradParameters& AdagradParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdagradParameters.base); + return *internal_default_instance(); +} + + +void AdagradParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.AdagradParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + initial_accumulator_ = 0; + _internal_metadata_.Clear(); +} + +bool AdagradParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.AdagradParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float initial_accumulator = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_accumulator_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.AdagradParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.AdagradParameters) + return false; +#undef DO_ +} + +void AdagradParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.AdagradParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float initial_accumulator = 1; + if (this->initial_accumulator() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->initial_accumulator(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.AdagradParameters) +} + +::google::protobuf::uint8* AdagradParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.AdagradParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float initial_accumulator = 1; + if (this->initial_accumulator() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->initial_accumulator(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.AdagradParameters) + return target; +} + +size_t AdagradParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.AdagradParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float initial_accumulator = 1; + if (this->initial_accumulator() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AdagradParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.AdagradParameters) + GOOGLE_DCHECK_NE(&from, this); + const AdagradParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.AdagradParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.AdagradParameters) + MergeFrom(*source); + } +} + +void AdagradParameters::MergeFrom(const AdagradParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.AdagradParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.initial_accumulator() != 0) { + set_initial_accumulator(from.initial_accumulator()); + } +} + +void AdagradParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.AdagradParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AdagradParameters::CopyFrom(const AdagradParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.AdagradParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AdagradParameters::IsInitialized() const { + return true; +} + +void AdagradParameters::Swap(AdagradParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void AdagradParameters::InternalSwap(AdagradParameters* other) { + using std::swap; + swap(initial_accumulator_, other->initial_accumulator_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AdagradParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void StochasticGradientDescentParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +StochasticGradientDescentParameters::StochasticGradientDescentParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StochasticGradientDescentParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) +} +StochasticGradientDescentParameters::StochasticGradientDescentParameters(const StochasticGradientDescentParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) +} + +void StochasticGradientDescentParameters::SharedCtor() { +} + +StochasticGradientDescentParameters::~StochasticGradientDescentParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + SharedDtor(); +} + +void StochasticGradientDescentParameters::SharedDtor() { +} + +void StochasticGradientDescentParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* StochasticGradientDescentParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const StochasticGradientDescentParameters& StochasticGradientDescentParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StochasticGradientDescentParameters.base); + return *internal_default_instance(); +} + + +void StochasticGradientDescentParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +bool StochasticGradientDescentParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + return false; +#undef DO_ +} + +void StochasticGradientDescentParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) +} + +::google::protobuf::uint8* StochasticGradientDescentParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + return target; +} + +size_t StochasticGradientDescentParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StochasticGradientDescentParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + GOOGLE_DCHECK_NE(&from, this); + const StochasticGradientDescentParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + MergeFrom(*source); + } +} + +void StochasticGradientDescentParameters::MergeFrom(const StochasticGradientDescentParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void StochasticGradientDescentParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StochasticGradientDescentParameters::CopyFrom(const StochasticGradientDescentParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StochasticGradientDescentParameters::IsInitialized() const { + return true; +} + +void StochasticGradientDescentParameters::Swap(StochasticGradientDescentParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void StochasticGradientDescentParameters::InternalSwap(StochasticGradientDescentParameters* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata StochasticGradientDescentParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FtrlParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FtrlParameters::kL1FieldNumber; +const int FtrlParameters::kL2FieldNumber; +const int FtrlParameters::kLrPowerFieldNumber; +const int FtrlParameters::kInitialAccumFieldNumber; +const int FtrlParameters::kInitialLinearFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FtrlParameters::FtrlParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_FtrlParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.FtrlParameters) +} +FtrlParameters::FtrlParameters(const FtrlParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&l1_, &from.l1_, + static_cast(reinterpret_cast(&initial_linear_) - + reinterpret_cast(&l1_)) + sizeof(initial_linear_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.FtrlParameters) +} + +void FtrlParameters::SharedCtor() { + ::memset(&l1_, 0, static_cast( + reinterpret_cast(&initial_linear_) - + reinterpret_cast(&l1_)) + sizeof(initial_linear_)); +} + +FtrlParameters::~FtrlParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.FtrlParameters) + SharedDtor(); +} + +void FtrlParameters::SharedDtor() { +} + +void FtrlParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FtrlParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FtrlParameters& FtrlParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_FtrlParameters.base); + return *internal_default_instance(); +} + + +void FtrlParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.FtrlParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&l1_, 0, static_cast( + reinterpret_cast(&initial_linear_) - + reinterpret_cast(&l1_)) + sizeof(initial_linear_)); + _internal_metadata_.Clear(); +} + +bool FtrlParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.FtrlParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float l1 = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &l1_))); + } else { + goto handle_unusual; + } + break; + } + + // float l2 = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &l2_))); + } else { + goto handle_unusual; + } + break; + } + + // float lr_power = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &lr_power_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_accum = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_accum_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_linear = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_linear_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.FtrlParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.FtrlParameters) + return false; +#undef DO_ +} + +void FtrlParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.FtrlParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l1 = 1; + if (this->l1() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->l1(), output); + } + + // float l2 = 2; + if (this->l2() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->l2(), output); + } + + // float lr_power = 3; + if (this->lr_power() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->lr_power(), output); + } + + // float initial_accum = 4; + if (this->initial_accum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->initial_accum(), output); + } + + // float initial_linear = 5; + if (this->initial_linear() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->initial_linear(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.FtrlParameters) +} + +::google::protobuf::uint8* FtrlParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.FtrlParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l1 = 1; + if (this->l1() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->l1(), target); + } + + // float l2 = 2; + if (this->l2() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->l2(), target); + } + + // float lr_power = 3; + if (this->lr_power() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->lr_power(), target); + } + + // float initial_accum = 4; + if (this->initial_accum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->initial_accum(), target); + } + + // float initial_linear = 5; + if (this->initial_linear() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->initial_linear(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.FtrlParameters) + return target; +} + +size_t FtrlParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.FtrlParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float l1 = 1; + if (this->l1() != 0) { + total_size += 1 + 4; + } + + // float l2 = 2; + if (this->l2() != 0) { + total_size += 1 + 4; + } + + // float lr_power = 3; + if (this->lr_power() != 0) { + total_size += 1 + 4; + } + + // float initial_accum = 4; + if (this->initial_accum() != 0) { + total_size += 1 + 4; + } + + // float initial_linear = 5; + if (this->initial_linear() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FtrlParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.FtrlParameters) + GOOGLE_DCHECK_NE(&from, this); + const FtrlParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.FtrlParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.FtrlParameters) + MergeFrom(*source); + } +} + +void FtrlParameters::MergeFrom(const FtrlParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.FtrlParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.l1() != 0) { + set_l1(from.l1()); + } + if (from.l2() != 0) { + set_l2(from.l2()); + } + if (from.lr_power() != 0) { + set_lr_power(from.lr_power()); + } + if (from.initial_accum() != 0) { + set_initial_accum(from.initial_accum()); + } + if (from.initial_linear() != 0) { + set_initial_linear(from.initial_linear()); + } +} + +void FtrlParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.FtrlParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FtrlParameters::CopyFrom(const FtrlParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.FtrlParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FtrlParameters::IsInitialized() const { + return true; +} + +void FtrlParameters::Swap(FtrlParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void FtrlParameters::InternalSwap(FtrlParameters* other) { + using std::swap; + swap(l1_, other->l1_); + swap(l2_, other->l2_); + swap(lr_power_, other->lr_power_); + swap(initial_accum_, other->initial_accum_); + swap(initial_linear_, other->initial_linear_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FtrlParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void AdamParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AdamParameters::kBeta1FieldNumber; +const int AdamParameters::kBeta2FieldNumber; +const int AdamParameters::kEpsilonFieldNumber; +const int AdamParameters::kInitialMFieldNumber; +const int AdamParameters::kInitialVFieldNumber; +const int AdamParameters::kUseNonLazyAdamFieldNumber; +const int AdamParameters::kUseSumInsideSqrtFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AdamParameters::AdamParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdamParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.AdamParameters) +} +AdamParameters::AdamParameters(const AdamParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&beta1_, &from.beta1_, + static_cast(reinterpret_cast(&use_sum_inside_sqrt_) - + reinterpret_cast(&beta1_)) + sizeof(use_sum_inside_sqrt_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.AdamParameters) +} + +void AdamParameters::SharedCtor() { + ::memset(&beta1_, 0, static_cast( + reinterpret_cast(&use_sum_inside_sqrt_) - + reinterpret_cast(&beta1_)) + sizeof(use_sum_inside_sqrt_)); +} + +AdamParameters::~AdamParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.AdamParameters) + SharedDtor(); +} + +void AdamParameters::SharedDtor() { +} + +void AdamParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AdamParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AdamParameters& AdamParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdamParameters.base); + return *internal_default_instance(); +} + + +void AdamParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.AdamParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&beta1_, 0, static_cast( + reinterpret_cast(&use_sum_inside_sqrt_) - + reinterpret_cast(&beta1_)) + sizeof(use_sum_inside_sqrt_)); + _internal_metadata_.Clear(); +} + +bool AdamParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.AdamParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float beta1 = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta1_))); + } else { + goto handle_unusual; + } + break; + } + + // float beta2 = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta2_))); + } else { + goto handle_unusual; + } + break; + } + + // float epsilon = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &epsilon_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_m = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_m_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_v = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_v_))); + } else { + goto handle_unusual; + } + break; + } + + // bool use_non_lazy_adam = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_non_lazy_adam_))); + } else { + goto handle_unusual; + } + break; + } + + // bool use_sum_inside_sqrt = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_sum_inside_sqrt_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.AdamParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.AdamParameters) + return false; +#undef DO_ +} + +void AdamParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.AdamParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float beta1 = 3; + if (this->beta1() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->beta1(), output); + } + + // float beta2 = 4; + if (this->beta2() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->beta2(), output); + } + + // float epsilon = 5; + if (this->epsilon() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->epsilon(), output); + } + + // float initial_m = 6; + if (this->initial_m() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->initial_m(), output); + } + + // float initial_v = 7; + if (this->initial_v() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->initial_v(), output); + } + + // bool use_non_lazy_adam = 8; + if (this->use_non_lazy_adam() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->use_non_lazy_adam(), output); + } + + // bool use_sum_inside_sqrt = 10; + if (this->use_sum_inside_sqrt() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->use_sum_inside_sqrt(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.AdamParameters) +} + +::google::protobuf::uint8* AdamParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.AdamParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float beta1 = 3; + if (this->beta1() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->beta1(), target); + } + + // float beta2 = 4; + if (this->beta2() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->beta2(), target); + } + + // float epsilon = 5; + if (this->epsilon() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->epsilon(), target); + } + + // float initial_m = 6; + if (this->initial_m() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->initial_m(), target); + } + + // float initial_v = 7; + if (this->initial_v() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->initial_v(), target); + } + + // bool use_non_lazy_adam = 8; + if (this->use_non_lazy_adam() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->use_non_lazy_adam(), target); + } + + // bool use_sum_inside_sqrt = 10; + if (this->use_sum_inside_sqrt() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->use_sum_inside_sqrt(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.AdamParameters) + return target; +} + +size_t AdamParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.AdamParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float beta1 = 3; + if (this->beta1() != 0) { + total_size += 1 + 4; + } + + // float beta2 = 4; + if (this->beta2() != 0) { + total_size += 1 + 4; + } + + // float epsilon = 5; + if (this->epsilon() != 0) { + total_size += 1 + 4; + } + + // float initial_m = 6; + if (this->initial_m() != 0) { + total_size += 1 + 4; + } + + // float initial_v = 7; + if (this->initial_v() != 0) { + total_size += 1 + 4; + } + + // bool use_non_lazy_adam = 8; + if (this->use_non_lazy_adam() != 0) { + total_size += 1 + 1; + } + + // bool use_sum_inside_sqrt = 10; + if (this->use_sum_inside_sqrt() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AdamParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.AdamParameters) + GOOGLE_DCHECK_NE(&from, this); + const AdamParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.AdamParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.AdamParameters) + MergeFrom(*source); + } +} + +void AdamParameters::MergeFrom(const AdamParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.AdamParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.beta1() != 0) { + set_beta1(from.beta1()); + } + if (from.beta2() != 0) { + set_beta2(from.beta2()); + } + if (from.epsilon() != 0) { + set_epsilon(from.epsilon()); + } + if (from.initial_m() != 0) { + set_initial_m(from.initial_m()); + } + if (from.initial_v() != 0) { + set_initial_v(from.initial_v()); + } + if (from.use_non_lazy_adam() != 0) { + set_use_non_lazy_adam(from.use_non_lazy_adam()); + } + if (from.use_sum_inside_sqrt() != 0) { + set_use_sum_inside_sqrt(from.use_sum_inside_sqrt()); + } +} + +void AdamParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.AdamParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AdamParameters::CopyFrom(const AdamParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.AdamParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AdamParameters::IsInitialized() const { + return true; +} + +void AdamParameters::Swap(AdamParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void AdamParameters::InternalSwap(AdamParameters* other) { + using std::swap; + swap(beta1_, other->beta1_); + swap(beta2_, other->beta2_); + swap(epsilon_, other->epsilon_); + swap(initial_m_, other->initial_m_); + swap(initial_v_, other->initial_v_); + swap(use_non_lazy_adam_, other->use_non_lazy_adam_); + swap(use_sum_inside_sqrt_, other->use_sum_inside_sqrt_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AdamParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MomentumParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MomentumParameters::kMomentumFieldNumber; +const int MomentumParameters::kUseNesterovFieldNumber; +const int MomentumParameters::kInitialAccumFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MomentumParameters::MomentumParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_MomentumParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.MomentumParameters) +} +MomentumParameters::MomentumParameters(const MomentumParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&momentum_, &from.momentum_, + static_cast(reinterpret_cast(&initial_accum_) - + reinterpret_cast(&momentum_)) + sizeof(initial_accum_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.MomentumParameters) +} + +void MomentumParameters::SharedCtor() { + ::memset(&momentum_, 0, static_cast( + reinterpret_cast(&initial_accum_) - + reinterpret_cast(&momentum_)) + sizeof(initial_accum_)); +} + +MomentumParameters::~MomentumParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.MomentumParameters) + SharedDtor(); +} + +void MomentumParameters::SharedDtor() { +} + +void MomentumParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MomentumParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MomentumParameters& MomentumParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_MomentumParameters.base); + return *internal_default_instance(); +} + + +void MomentumParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.MomentumParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&momentum_, 0, static_cast( + reinterpret_cast(&initial_accum_) - + reinterpret_cast(&momentum_)) + sizeof(initial_accum_)); + _internal_metadata_.Clear(); +} + +bool MomentumParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.MomentumParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float momentum = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + } else { + goto handle_unusual; + } + break; + } + + // bool use_nesterov = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_nesterov_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_accum = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_accum_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.MomentumParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.MomentumParameters) + return false; +#undef DO_ +} + +void MomentumParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.MomentumParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float momentum = 1; + if (this->momentum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->momentum(), output); + } + + // bool use_nesterov = 2; + if (this->use_nesterov() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->use_nesterov(), output); + } + + // float initial_accum = 3; + if (this->initial_accum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->initial_accum(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.MomentumParameters) +} + +::google::protobuf::uint8* MomentumParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.MomentumParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float momentum = 1; + if (this->momentum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->momentum(), target); + } + + // bool use_nesterov = 2; + if (this->use_nesterov() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->use_nesterov(), target); + } + + // float initial_accum = 3; + if (this->initial_accum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->initial_accum(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.MomentumParameters) + return target; +} + +size_t MomentumParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.MomentumParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float momentum = 1; + if (this->momentum() != 0) { + total_size += 1 + 4; + } + + // bool use_nesterov = 2; + if (this->use_nesterov() != 0) { + total_size += 1 + 1; + } + + // float initial_accum = 3; + if (this->initial_accum() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MomentumParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.MomentumParameters) + GOOGLE_DCHECK_NE(&from, this); + const MomentumParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.MomentumParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.MomentumParameters) + MergeFrom(*source); + } +} + +void MomentumParameters::MergeFrom(const MomentumParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.MomentumParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.momentum() != 0) { + set_momentum(from.momentum()); + } + if (from.use_nesterov() != 0) { + set_use_nesterov(from.use_nesterov()); + } + if (from.initial_accum() != 0) { + set_initial_accum(from.initial_accum()); + } +} + +void MomentumParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.MomentumParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MomentumParameters::CopyFrom(const MomentumParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.MomentumParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MomentumParameters::IsInitialized() const { + return true; +} + +void MomentumParameters::Swap(MomentumParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void MomentumParameters::InternalSwap(MomentumParameters* other) { + using std::swap; + swap(momentum_, other->momentum_); + swap(use_nesterov_, other->use_nesterov_); + swap(initial_accum_, other->initial_accum_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MomentumParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void RmsPropParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RmsPropParameters::kRhoFieldNumber; +const int RmsPropParameters::kMomentumFieldNumber; +const int RmsPropParameters::kEpsilonFieldNumber; +const int RmsPropParameters::kInitialMsFieldNumber; +const int RmsPropParameters::kInitialMomFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RmsPropParameters::RmsPropParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_RmsPropParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.RmsPropParameters) +} +RmsPropParameters::RmsPropParameters(const RmsPropParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&rho_, &from.rho_, + static_cast(reinterpret_cast(&initial_mom_) - + reinterpret_cast(&rho_)) + sizeof(initial_mom_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.RmsPropParameters) +} + +void RmsPropParameters::SharedCtor() { + ::memset(&rho_, 0, static_cast( + reinterpret_cast(&initial_mom_) - + reinterpret_cast(&rho_)) + sizeof(initial_mom_)); +} + +RmsPropParameters::~RmsPropParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.RmsPropParameters) + SharedDtor(); +} + +void RmsPropParameters::SharedDtor() { +} + +void RmsPropParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* RmsPropParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const RmsPropParameters& RmsPropParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_RmsPropParameters.base); + return *internal_default_instance(); +} + + +void RmsPropParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.RmsPropParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&rho_, 0, static_cast( + reinterpret_cast(&initial_mom_) - + reinterpret_cast(&rho_)) + sizeof(initial_mom_)); + _internal_metadata_.Clear(); +} + +bool RmsPropParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.RmsPropParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float rho = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rho_))); + } else { + goto handle_unusual; + } + break; + } + + // float momentum = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + } else { + goto handle_unusual; + } + break; + } + + // float epsilon = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &epsilon_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_ms = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_ms_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_mom = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_mom_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.RmsPropParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.RmsPropParameters) + return false; +#undef DO_ +} + +void RmsPropParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.RmsPropParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float rho = 1; + if (this->rho() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->rho(), output); + } + + // float momentum = 2; + if (this->momentum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->momentum(), output); + } + + // float epsilon = 3; + if (this->epsilon() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->epsilon(), output); + } + + // float initial_ms = 4; + if (this->initial_ms() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->initial_ms(), output); + } + + // float initial_mom = 5; + if (this->initial_mom() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->initial_mom(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.RmsPropParameters) +} + +::google::protobuf::uint8* RmsPropParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.RmsPropParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float rho = 1; + if (this->rho() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->rho(), target); + } + + // float momentum = 2; + if (this->momentum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->momentum(), target); + } + + // float epsilon = 3; + if (this->epsilon() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->epsilon(), target); + } + + // float initial_ms = 4; + if (this->initial_ms() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->initial_ms(), target); + } + + // float initial_mom = 5; + if (this->initial_mom() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->initial_mom(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.RmsPropParameters) + return target; +} + +size_t RmsPropParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.RmsPropParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float rho = 1; + if (this->rho() != 0) { + total_size += 1 + 4; + } + + // float momentum = 2; + if (this->momentum() != 0) { + total_size += 1 + 4; + } + + // float epsilon = 3; + if (this->epsilon() != 0) { + total_size += 1 + 4; + } + + // float initial_ms = 4; + if (this->initial_ms() != 0) { + total_size += 1 + 4; + } + + // float initial_mom = 5; + if (this->initial_mom() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void RmsPropParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.RmsPropParameters) + GOOGLE_DCHECK_NE(&from, this); + const RmsPropParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.RmsPropParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.RmsPropParameters) + MergeFrom(*source); + } +} + +void RmsPropParameters::MergeFrom(const RmsPropParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.RmsPropParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.rho() != 0) { + set_rho(from.rho()); + } + if (from.momentum() != 0) { + set_momentum(from.momentum()); + } + if (from.epsilon() != 0) { + set_epsilon(from.epsilon()); + } + if (from.initial_ms() != 0) { + set_initial_ms(from.initial_ms()); + } + if (from.initial_mom() != 0) { + set_initial_mom(from.initial_mom()); + } +} + +void RmsPropParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.RmsPropParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RmsPropParameters::CopyFrom(const RmsPropParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.RmsPropParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RmsPropParameters::IsInitialized() const { + return true; +} + +void RmsPropParameters::Swap(RmsPropParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void RmsPropParameters::InternalSwap(RmsPropParameters* other) { + using std::swap; + swap(rho_, other->rho_); + swap(momentum_, other->momentum_); + swap(epsilon_, other->epsilon_); + swap(initial_ms_, other->initial_ms_); + swap(initial_mom_, other->initial_mom_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata RmsPropParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CenteredRmsPropParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CenteredRmsPropParameters::kRhoFieldNumber; +const int CenteredRmsPropParameters::kMomentumFieldNumber; +const int CenteredRmsPropParameters::kEpsilonFieldNumber; +const int CenteredRmsPropParameters::kInitialMsFieldNumber; +const int CenteredRmsPropParameters::kInitialMomFieldNumber; +const int CenteredRmsPropParameters::kInitialMgFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CenteredRmsPropParameters::CenteredRmsPropParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_CenteredRmsPropParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) +} +CenteredRmsPropParameters::CenteredRmsPropParameters(const CenteredRmsPropParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&rho_, &from.rho_, + static_cast(reinterpret_cast(&initial_mg_) - + reinterpret_cast(&rho_)) + sizeof(initial_mg_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) +} + +void CenteredRmsPropParameters::SharedCtor() { + ::memset(&rho_, 0, static_cast( + reinterpret_cast(&initial_mg_) - + reinterpret_cast(&rho_)) + sizeof(initial_mg_)); +} + +CenteredRmsPropParameters::~CenteredRmsPropParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + SharedDtor(); +} + +void CenteredRmsPropParameters::SharedDtor() { +} + +void CenteredRmsPropParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CenteredRmsPropParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CenteredRmsPropParameters& CenteredRmsPropParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_CenteredRmsPropParameters.base); + return *internal_default_instance(); +} + + +void CenteredRmsPropParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&rho_, 0, static_cast( + reinterpret_cast(&initial_mg_) - + reinterpret_cast(&rho_)) + sizeof(initial_mg_)); + _internal_metadata_.Clear(); +} + +bool CenteredRmsPropParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float rho = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rho_))); + } else { + goto handle_unusual; + } + break; + } + + // float momentum = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + } else { + goto handle_unusual; + } + break; + } + + // float epsilon = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &epsilon_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_ms = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_ms_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_mom = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_mom_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_mg = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_mg_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + return false; +#undef DO_ +} + +void CenteredRmsPropParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float rho = 1; + if (this->rho() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->rho(), output); + } + + // float momentum = 2; + if (this->momentum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->momentum(), output); + } + + // float epsilon = 3; + if (this->epsilon() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->epsilon(), output); + } + + // float initial_ms = 4; + if (this->initial_ms() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->initial_ms(), output); + } + + // float initial_mom = 5; + if (this->initial_mom() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->initial_mom(), output); + } + + // float initial_mg = 6; + if (this->initial_mg() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->initial_mg(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) +} + +::google::protobuf::uint8* CenteredRmsPropParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float rho = 1; + if (this->rho() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->rho(), target); + } + + // float momentum = 2; + if (this->momentum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->momentum(), target); + } + + // float epsilon = 3; + if (this->epsilon() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->epsilon(), target); + } + + // float initial_ms = 4; + if (this->initial_ms() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->initial_ms(), target); + } + + // float initial_mom = 5; + if (this->initial_mom() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->initial_mom(), target); + } + + // float initial_mg = 6; + if (this->initial_mg() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->initial_mg(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + return target; +} + +size_t CenteredRmsPropParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float rho = 1; + if (this->rho() != 0) { + total_size += 1 + 4; + } + + // float momentum = 2; + if (this->momentum() != 0) { + total_size += 1 + 4; + } + + // float epsilon = 3; + if (this->epsilon() != 0) { + total_size += 1 + 4; + } + + // float initial_ms = 4; + if (this->initial_ms() != 0) { + total_size += 1 + 4; + } + + // float initial_mom = 5; + if (this->initial_mom() != 0) { + total_size += 1 + 4; + } + + // float initial_mg = 6; + if (this->initial_mg() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CenteredRmsPropParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + GOOGLE_DCHECK_NE(&from, this); + const CenteredRmsPropParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + MergeFrom(*source); + } +} + +void CenteredRmsPropParameters::MergeFrom(const CenteredRmsPropParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.rho() != 0) { + set_rho(from.rho()); + } + if (from.momentum() != 0) { + set_momentum(from.momentum()); + } + if (from.epsilon() != 0) { + set_epsilon(from.epsilon()); + } + if (from.initial_ms() != 0) { + set_initial_ms(from.initial_ms()); + } + if (from.initial_mom() != 0) { + set_initial_mom(from.initial_mom()); + } + if (from.initial_mg() != 0) { + set_initial_mg(from.initial_mg()); + } +} + +void CenteredRmsPropParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CenteredRmsPropParameters::CopyFrom(const CenteredRmsPropParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CenteredRmsPropParameters::IsInitialized() const { + return true; +} + +void CenteredRmsPropParameters::Swap(CenteredRmsPropParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void CenteredRmsPropParameters::InternalSwap(CenteredRmsPropParameters* other) { + using std::swap; + swap(rho_, other->rho_); + swap(momentum_, other->momentum_); + swap(epsilon_, other->epsilon_); + swap(initial_ms_, other->initial_ms_); + swap(initial_mom_, other->initial_mom_); + swap(initial_mg_, other->initial_mg_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CenteredRmsPropParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MdlAdagradLightParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MdlAdagradLightParameters::kL2FieldNumber; +const int MdlAdagradLightParameters::kLrPowerFieldNumber; +const int MdlAdagradLightParameters::kMinServableMdlBenefitFieldNumber; +const int MdlAdagradLightParameters::kMdlMixInMarginFieldNumber; +const int MdlAdagradLightParameters::kMdlBenefitRampupCoeffFieldNumber; +const int MdlAdagradLightParameters::kMdlMinWeightFieldNumber; +const int MdlAdagradLightParameters::kBenefitRevisitScaleFieldNumber; +const int MdlAdagradLightParameters::kMaxEventBenefitFieldNumber; +const int MdlAdagradLightParameters::kMaxTotalBenefitFieldNumber; +const int MdlAdagradLightParameters::kMdlHardLimitFieldNumber; +const int MdlAdagradLightParameters::kHardLimitMinBenefitFieldNumber; +const int MdlAdagradLightParameters::kMdlRegularizeFieldNumber; +const int MdlAdagradLightParameters::kInitialAccumulatorFieldNumber; +const int MdlAdagradLightParameters::kInitialWeightFieldNumber; +const int MdlAdagradLightParameters::kInitialBenefitFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MdlAdagradLightParameters::MdlAdagradLightParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_MdlAdagradLightParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) +} +MdlAdagradLightParameters::MdlAdagradLightParameters(const MdlAdagradLightParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&l2_, &from.l2_, + static_cast(reinterpret_cast(&initial_benefit_) - + reinterpret_cast(&l2_)) + sizeof(initial_benefit_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) +} + +void MdlAdagradLightParameters::SharedCtor() { + ::memset(&l2_, 0, static_cast( + reinterpret_cast(&initial_benefit_) - + reinterpret_cast(&l2_)) + sizeof(initial_benefit_)); +} + +MdlAdagradLightParameters::~MdlAdagradLightParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + SharedDtor(); +} + +void MdlAdagradLightParameters::SharedDtor() { +} + +void MdlAdagradLightParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MdlAdagradLightParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MdlAdagradLightParameters& MdlAdagradLightParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_MdlAdagradLightParameters.base); + return *internal_default_instance(); +} + + +void MdlAdagradLightParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&l2_, 0, static_cast( + reinterpret_cast(&initial_benefit_) - + reinterpret_cast(&l2_)) + sizeof(initial_benefit_)); + _internal_metadata_.Clear(); +} + +bool MdlAdagradLightParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float l2 = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &l2_))); + } else { + goto handle_unusual; + } + break; + } + + // float lr_power = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &lr_power_))); + } else { + goto handle_unusual; + } + break; + } + + // float min_servable_mdl_benefit = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_servable_mdl_benefit_))); + } else { + goto handle_unusual; + } + break; + } + + // float mdl_mix_in_margin = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mdl_mix_in_margin_))); + } else { + goto handle_unusual; + } + break; + } + + // float mdl_benefit_rampup_coeff = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mdl_benefit_rampup_coeff_))); + } else { + goto handle_unusual; + } + break; + } + + // float mdl_min_weight = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mdl_min_weight_))); + } else { + goto handle_unusual; + } + break; + } + + // float benefit_revisit_scale = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &benefit_revisit_scale_))); + } else { + goto handle_unusual; + } + break; + } + + // float max_event_benefit = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(69u /* 69 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_event_benefit_))); + } else { + goto handle_unusual; + } + break; + } + + // float max_total_benefit = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_total_benefit_))); + } else { + goto handle_unusual; + } + break; + } + + // float mdl_hard_limit = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(85u /* 85 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mdl_hard_limit_))); + } else { + goto handle_unusual; + } + break; + } + + // bool hard_limit_min_benefit = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &hard_limit_min_benefit_))); + } else { + goto handle_unusual; + } + break; + } + + // bool mdl_regularize = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mdl_regularize_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_accumulator = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(109u /* 109 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_accumulator_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_weight = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(117u /* 117 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_weight_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_benefit = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(125u /* 125 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_benefit_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + return false; +#undef DO_ +} + +void MdlAdagradLightParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l2 = 1; + if (this->l2() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->l2(), output); + } + + // float lr_power = 2; + if (this->lr_power() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->lr_power(), output); + } + + // float min_servable_mdl_benefit = 3; + if (this->min_servable_mdl_benefit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->min_servable_mdl_benefit(), output); + } + + // float mdl_mix_in_margin = 4; + if (this->mdl_mix_in_margin() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->mdl_mix_in_margin(), output); + } + + // float mdl_benefit_rampup_coeff = 5; + if (this->mdl_benefit_rampup_coeff() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->mdl_benefit_rampup_coeff(), output); + } + + // float mdl_min_weight = 6; + if (this->mdl_min_weight() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->mdl_min_weight(), output); + } + + // float benefit_revisit_scale = 7; + if (this->benefit_revisit_scale() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->benefit_revisit_scale(), output); + } + + // float max_event_benefit = 8; + if (this->max_event_benefit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->max_event_benefit(), output); + } + + // float max_total_benefit = 9; + if (this->max_total_benefit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->max_total_benefit(), output); + } + + // float mdl_hard_limit = 10; + if (this->mdl_hard_limit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(10, this->mdl_hard_limit(), output); + } + + // bool hard_limit_min_benefit = 11; + if (this->hard_limit_min_benefit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->hard_limit_min_benefit(), output); + } + + // bool mdl_regularize = 12; + if (this->mdl_regularize() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->mdl_regularize(), output); + } + + // float initial_accumulator = 13; + if (this->initial_accumulator() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(13, this->initial_accumulator(), output); + } + + // float initial_weight = 14; + if (this->initial_weight() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(14, this->initial_weight(), output); + } + + // float initial_benefit = 15; + if (this->initial_benefit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(15, this->initial_benefit(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) +} + +::google::protobuf::uint8* MdlAdagradLightParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l2 = 1; + if (this->l2() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->l2(), target); + } + + // float lr_power = 2; + if (this->lr_power() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->lr_power(), target); + } + + // float min_servable_mdl_benefit = 3; + if (this->min_servable_mdl_benefit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->min_servable_mdl_benefit(), target); + } + + // float mdl_mix_in_margin = 4; + if (this->mdl_mix_in_margin() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->mdl_mix_in_margin(), target); + } + + // float mdl_benefit_rampup_coeff = 5; + if (this->mdl_benefit_rampup_coeff() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->mdl_benefit_rampup_coeff(), target); + } + + // float mdl_min_weight = 6; + if (this->mdl_min_weight() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->mdl_min_weight(), target); + } + + // float benefit_revisit_scale = 7; + if (this->benefit_revisit_scale() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->benefit_revisit_scale(), target); + } + + // float max_event_benefit = 8; + if (this->max_event_benefit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->max_event_benefit(), target); + } + + // float max_total_benefit = 9; + if (this->max_total_benefit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->max_total_benefit(), target); + } + + // float mdl_hard_limit = 10; + if (this->mdl_hard_limit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(10, this->mdl_hard_limit(), target); + } + + // bool hard_limit_min_benefit = 11; + if (this->hard_limit_min_benefit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(11, this->hard_limit_min_benefit(), target); + } + + // bool mdl_regularize = 12; + if (this->mdl_regularize() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->mdl_regularize(), target); + } + + // float initial_accumulator = 13; + if (this->initial_accumulator() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(13, this->initial_accumulator(), target); + } + + // float initial_weight = 14; + if (this->initial_weight() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(14, this->initial_weight(), target); + } + + // float initial_benefit = 15; + if (this->initial_benefit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(15, this->initial_benefit(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + return target; +} + +size_t MdlAdagradLightParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float l2 = 1; + if (this->l2() != 0) { + total_size += 1 + 4; + } + + // float lr_power = 2; + if (this->lr_power() != 0) { + total_size += 1 + 4; + } + + // float min_servable_mdl_benefit = 3; + if (this->min_servable_mdl_benefit() != 0) { + total_size += 1 + 4; + } + + // float mdl_mix_in_margin = 4; + if (this->mdl_mix_in_margin() != 0) { + total_size += 1 + 4; + } + + // float mdl_benefit_rampup_coeff = 5; + if (this->mdl_benefit_rampup_coeff() != 0) { + total_size += 1 + 4; + } + + // float mdl_min_weight = 6; + if (this->mdl_min_weight() != 0) { + total_size += 1 + 4; + } + + // float benefit_revisit_scale = 7; + if (this->benefit_revisit_scale() != 0) { + total_size += 1 + 4; + } + + // float max_event_benefit = 8; + if (this->max_event_benefit() != 0) { + total_size += 1 + 4; + } + + // float max_total_benefit = 9; + if (this->max_total_benefit() != 0) { + total_size += 1 + 4; + } + + // float mdl_hard_limit = 10; + if (this->mdl_hard_limit() != 0) { + total_size += 1 + 4; + } + + // bool hard_limit_min_benefit = 11; + if (this->hard_limit_min_benefit() != 0) { + total_size += 1 + 1; + } + + // bool mdl_regularize = 12; + if (this->mdl_regularize() != 0) { + total_size += 1 + 1; + } + + // float initial_accumulator = 13; + if (this->initial_accumulator() != 0) { + total_size += 1 + 4; + } + + // float initial_weight = 14; + if (this->initial_weight() != 0) { + total_size += 1 + 4; + } + + // float initial_benefit = 15; + if (this->initial_benefit() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MdlAdagradLightParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + GOOGLE_DCHECK_NE(&from, this); + const MdlAdagradLightParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + MergeFrom(*source); + } +} + +void MdlAdagradLightParameters::MergeFrom(const MdlAdagradLightParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.l2() != 0) { + set_l2(from.l2()); + } + if (from.lr_power() != 0) { + set_lr_power(from.lr_power()); + } + if (from.min_servable_mdl_benefit() != 0) { + set_min_servable_mdl_benefit(from.min_servable_mdl_benefit()); + } + if (from.mdl_mix_in_margin() != 0) { + set_mdl_mix_in_margin(from.mdl_mix_in_margin()); + } + if (from.mdl_benefit_rampup_coeff() != 0) { + set_mdl_benefit_rampup_coeff(from.mdl_benefit_rampup_coeff()); + } + if (from.mdl_min_weight() != 0) { + set_mdl_min_weight(from.mdl_min_weight()); + } + if (from.benefit_revisit_scale() != 0) { + set_benefit_revisit_scale(from.benefit_revisit_scale()); + } + if (from.max_event_benefit() != 0) { + set_max_event_benefit(from.max_event_benefit()); + } + if (from.max_total_benefit() != 0) { + set_max_total_benefit(from.max_total_benefit()); + } + if (from.mdl_hard_limit() != 0) { + set_mdl_hard_limit(from.mdl_hard_limit()); + } + if (from.hard_limit_min_benefit() != 0) { + set_hard_limit_min_benefit(from.hard_limit_min_benefit()); + } + if (from.mdl_regularize() != 0) { + set_mdl_regularize(from.mdl_regularize()); + } + if (from.initial_accumulator() != 0) { + set_initial_accumulator(from.initial_accumulator()); + } + if (from.initial_weight() != 0) { + set_initial_weight(from.initial_weight()); + } + if (from.initial_benefit() != 0) { + set_initial_benefit(from.initial_benefit()); + } +} + +void MdlAdagradLightParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MdlAdagradLightParameters::CopyFrom(const MdlAdagradLightParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MdlAdagradLightParameters::IsInitialized() const { + return true; +} + +void MdlAdagradLightParameters::Swap(MdlAdagradLightParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void MdlAdagradLightParameters::InternalSwap(MdlAdagradLightParameters* other) { + using std::swap; + swap(l2_, other->l2_); + swap(lr_power_, other->lr_power_); + swap(min_servable_mdl_benefit_, other->min_servable_mdl_benefit_); + swap(mdl_mix_in_margin_, other->mdl_mix_in_margin_); + swap(mdl_benefit_rampup_coeff_, other->mdl_benefit_rampup_coeff_); + swap(mdl_min_weight_, other->mdl_min_weight_); + swap(benefit_revisit_scale_, other->benefit_revisit_scale_); + swap(max_event_benefit_, other->max_event_benefit_); + swap(max_total_benefit_, other->max_total_benefit_); + swap(mdl_hard_limit_, other->mdl_hard_limit_); + swap(hard_limit_min_benefit_, other->hard_limit_min_benefit_); + swap(mdl_regularize_, other->mdl_regularize_); + swap(initial_accumulator_, other->initial_accumulator_); + swap(initial_weight_, other->initial_weight_); + swap(initial_benefit_, other->initial_benefit_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MdlAdagradLightParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void AdadeltaParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AdadeltaParameters::kRhoFieldNumber; +const int AdadeltaParameters::kEpsilonFieldNumber; +const int AdadeltaParameters::kInitialAccumulatorFieldNumber; +const int AdadeltaParameters::kInitialUpdateFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AdadeltaParameters::AdadeltaParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdadeltaParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.AdadeltaParameters) +} +AdadeltaParameters::AdadeltaParameters(const AdadeltaParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&rho_, &from.rho_, + static_cast(reinterpret_cast(&initial_update_) - + reinterpret_cast(&rho_)) + sizeof(initial_update_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.AdadeltaParameters) +} + +void AdadeltaParameters::SharedCtor() { + ::memset(&rho_, 0, static_cast( + reinterpret_cast(&initial_update_) - + reinterpret_cast(&rho_)) + sizeof(initial_update_)); +} + +AdadeltaParameters::~AdadeltaParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.AdadeltaParameters) + SharedDtor(); +} + +void AdadeltaParameters::SharedDtor() { +} + +void AdadeltaParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AdadeltaParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AdadeltaParameters& AdadeltaParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_AdadeltaParameters.base); + return *internal_default_instance(); +} + + +void AdadeltaParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&rho_, 0, static_cast( + reinterpret_cast(&initial_update_) - + reinterpret_cast(&rho_)) + sizeof(initial_update_)); + _internal_metadata_.Clear(); +} + +bool AdadeltaParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float rho = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rho_))); + } else { + goto handle_unusual; + } + break; + } + + // float epsilon = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &epsilon_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_accumulator = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_accumulator_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_update = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_update_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.AdadeltaParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.AdadeltaParameters) + return false; +#undef DO_ +} + +void AdadeltaParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float rho = 1; + if (this->rho() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->rho(), output); + } + + // float epsilon = 2; + if (this->epsilon() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->epsilon(), output); + } + + // float initial_accumulator = 3; + if (this->initial_accumulator() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->initial_accumulator(), output); + } + + // float initial_update = 4; + if (this->initial_update() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->initial_update(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.AdadeltaParameters) +} + +::google::protobuf::uint8* AdadeltaParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float rho = 1; + if (this->rho() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->rho(), target); + } + + // float epsilon = 2; + if (this->epsilon() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->epsilon(), target); + } + + // float initial_accumulator = 3; + if (this->initial_accumulator() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->initial_accumulator(), target); + } + + // float initial_update = 4; + if (this->initial_update() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->initial_update(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.AdadeltaParameters) + return target; +} + +size_t AdadeltaParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float rho = 1; + if (this->rho() != 0) { + total_size += 1 + 4; + } + + // float epsilon = 2; + if (this->epsilon() != 0) { + total_size += 1 + 4; + } + + // float initial_accumulator = 3; + if (this->initial_accumulator() != 0) { + total_size += 1 + 4; + } + + // float initial_update = 4; + if (this->initial_update() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AdadeltaParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + GOOGLE_DCHECK_NE(&from, this); + const AdadeltaParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.AdadeltaParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.AdadeltaParameters) + MergeFrom(*source); + } +} + +void AdadeltaParameters::MergeFrom(const AdadeltaParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.rho() != 0) { + set_rho(from.rho()); + } + if (from.epsilon() != 0) { + set_epsilon(from.epsilon()); + } + if (from.initial_accumulator() != 0) { + set_initial_accumulator(from.initial_accumulator()); + } + if (from.initial_update() != 0) { + set_initial_update(from.initial_update()); + } +} + +void AdadeltaParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AdadeltaParameters::CopyFrom(const AdadeltaParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.AdadeltaParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AdadeltaParameters::IsInitialized() const { + return true; +} + +void AdadeltaParameters::Swap(AdadeltaParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void AdadeltaParameters::InternalSwap(AdadeltaParameters* other) { + using std::swap; + swap(rho_, other->rho_); + swap(epsilon_, other->epsilon_); + swap(initial_accumulator_, other->initial_accumulator_); + swap(initial_update_, other->initial_update_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AdadeltaParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ProximalAdagradParameters::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ProximalAdagradParameters::kL1FieldNumber; +const int ProximalAdagradParameters::kL2FieldNumber; +const int ProximalAdagradParameters::kInitialAccumulatorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ProximalAdagradParameters::ProximalAdagradParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_ProximalAdagradParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.ProximalAdagradParameters) +} +ProximalAdagradParameters::ProximalAdagradParameters(const ProximalAdagradParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&l1_, &from.l1_, + static_cast(reinterpret_cast(&initial_accumulator_) - + reinterpret_cast(&l1_)) + sizeof(initial_accumulator_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.ProximalAdagradParameters) +} + +void ProximalAdagradParameters::SharedCtor() { + ::memset(&l1_, 0, static_cast( + reinterpret_cast(&initial_accumulator_) - + reinterpret_cast(&l1_)) + sizeof(initial_accumulator_)); +} + +ProximalAdagradParameters::~ProximalAdagradParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + SharedDtor(); +} + +void ProximalAdagradParameters::SharedDtor() { +} + +void ProximalAdagradParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ProximalAdagradParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ProximalAdagradParameters& ProximalAdagradParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_ProximalAdagradParameters.base); + return *internal_default_instance(); +} + + +void ProximalAdagradParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&l1_, 0, static_cast( + reinterpret_cast(&initial_accumulator_) - + reinterpret_cast(&l1_)) + sizeof(initial_accumulator_)); + _internal_metadata_.Clear(); +} + +bool ProximalAdagradParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float l1 = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &l1_))); + } else { + goto handle_unusual; + } + break; + } + + // float l2 = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &l2_))); + } else { + goto handle_unusual; + } + break; + } + + // float initial_accumulator = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &initial_accumulator_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + return false; +#undef DO_ +} + +void ProximalAdagradParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l1 = 1; + if (this->l1() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->l1(), output); + } + + // float l2 = 2; + if (this->l2() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->l2(), output); + } + + // float initial_accumulator = 3; + if (this->initial_accumulator() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->initial_accumulator(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.ProximalAdagradParameters) +} + +::google::protobuf::uint8* ProximalAdagradParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float l1 = 1; + if (this->l1() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->l1(), target); + } + + // float l2 = 2; + if (this->l2() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->l2(), target); + } + + // float initial_accumulator = 3; + if (this->initial_accumulator() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->initial_accumulator(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + return target; +} + +size_t ProximalAdagradParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float l1 = 1; + if (this->l1() != 0) { + total_size += 1 + 4; + } + + // float l2 = 2; + if (this->l2() != 0) { + total_size += 1 + 4; + } + + // float initial_accumulator = 3; + if (this->initial_accumulator() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ProximalAdagradParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + GOOGLE_DCHECK_NE(&from, this); + const ProximalAdagradParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + MergeFrom(*source); + } +} + +void ProximalAdagradParameters::MergeFrom(const ProximalAdagradParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.l1() != 0) { + set_l1(from.l1()); + } + if (from.l2() != 0) { + set_l2(from.l2()); + } + if (from.initial_accumulator() != 0) { + set_initial_accumulator(from.initial_accumulator()); + } +} + +void ProximalAdagradParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ProximalAdagradParameters::CopyFrom(const ProximalAdagradParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ProximalAdagradParameters::IsInitialized() const { + return true; +} + +void ProximalAdagradParameters::Swap(ProximalAdagradParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void ProximalAdagradParameters::InternalSwap(ProximalAdagradParameters* other) { + using std::swap; + swap(l1_, other->l1_); + swap(l2_, other->l2_); + swap(initial_accumulator_, other->initial_accumulator_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ProximalAdagradParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OptimizationParameters::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_._instance.get_mutable()->learning_rate_ = const_cast< ::diplomacy::tensorflow::tpu::LearningRate*>( + ::diplomacy::tensorflow::tpu::LearningRate::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_._instance.get_mutable()->clipping_limits_ = const_cast< ::diplomacy::tensorflow::tpu::ClippingLimits*>( + ::diplomacy::tensorflow::tpu::ClippingLimits::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_._instance.get_mutable()->gradient_clipping_limits_ = const_cast< ::diplomacy::tensorflow::tpu::ClippingLimits*>( + ::diplomacy::tensorflow::tpu::ClippingLimits::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.adagrad_ = const_cast< ::diplomacy::tensorflow::tpu::AdagradParameters*>( + ::diplomacy::tensorflow::tpu::AdagradParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.stochastic_gradient_descent_ = const_cast< ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters*>( + ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.ftrl_ = const_cast< ::diplomacy::tensorflow::tpu::FtrlParameters*>( + ::diplomacy::tensorflow::tpu::FtrlParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.adam_ = const_cast< ::diplomacy::tensorflow::tpu::AdamParameters*>( + ::diplomacy::tensorflow::tpu::AdamParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.momentum_ = const_cast< ::diplomacy::tensorflow::tpu::MomentumParameters*>( + ::diplomacy::tensorflow::tpu::MomentumParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.rms_prop_ = const_cast< ::diplomacy::tensorflow::tpu::RmsPropParameters*>( + ::diplomacy::tensorflow::tpu::RmsPropParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.centered_rms_prop_ = const_cast< ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters*>( + ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.mdl_adagrad_light_ = const_cast< ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters*>( + ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.adadelta_ = const_cast< ::diplomacy::tensorflow::tpu::AdadeltaParameters*>( + ::diplomacy::tensorflow::tpu::AdadeltaParameters::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_.proximal_adagrad_ = const_cast< ::diplomacy::tensorflow::tpu::ProximalAdagradParameters*>( + ::diplomacy::tensorflow::tpu::ProximalAdagradParameters::internal_default_instance()); +} +void OptimizationParameters::set_allocated_adagrad(::diplomacy::tensorflow::tpu::AdagradParameters* adagrad) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (adagrad) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + adagrad = ::google::protobuf::internal::GetOwnedMessage( + message_arena, adagrad, submessage_arena); + } + set_has_adagrad(); + parameters_.adagrad_ = adagrad; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.adagrad) +} +void OptimizationParameters::set_allocated_stochastic_gradient_descent(::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* stochastic_gradient_descent) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (stochastic_gradient_descent) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + stochastic_gradient_descent = ::google::protobuf::internal::GetOwnedMessage( + message_arena, stochastic_gradient_descent, submessage_arena); + } + set_has_stochastic_gradient_descent(); + parameters_.stochastic_gradient_descent_ = stochastic_gradient_descent; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.stochastic_gradient_descent) +} +void OptimizationParameters::set_allocated_ftrl(::diplomacy::tensorflow::tpu::FtrlParameters* ftrl) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (ftrl) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + ftrl = ::google::protobuf::internal::GetOwnedMessage( + message_arena, ftrl, submessage_arena); + } + set_has_ftrl(); + parameters_.ftrl_ = ftrl; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.ftrl) +} +void OptimizationParameters::set_allocated_adam(::diplomacy::tensorflow::tpu::AdamParameters* adam) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (adam) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + adam = ::google::protobuf::internal::GetOwnedMessage( + message_arena, adam, submessage_arena); + } + set_has_adam(); + parameters_.adam_ = adam; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.adam) +} +void OptimizationParameters::set_allocated_momentum(::diplomacy::tensorflow::tpu::MomentumParameters* momentum) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (momentum) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + momentum = ::google::protobuf::internal::GetOwnedMessage( + message_arena, momentum, submessage_arena); + } + set_has_momentum(); + parameters_.momentum_ = momentum; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.momentum) +} +void OptimizationParameters::set_allocated_rms_prop(::diplomacy::tensorflow::tpu::RmsPropParameters* rms_prop) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (rms_prop) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + rms_prop = ::google::protobuf::internal::GetOwnedMessage( + message_arena, rms_prop, submessage_arena); + } + set_has_rms_prop(); + parameters_.rms_prop_ = rms_prop; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.rms_prop) +} +void OptimizationParameters::set_allocated_centered_rms_prop(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* centered_rms_prop) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (centered_rms_prop) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + centered_rms_prop = ::google::protobuf::internal::GetOwnedMessage( + message_arena, centered_rms_prop, submessage_arena); + } + set_has_centered_rms_prop(); + parameters_.centered_rms_prop_ = centered_rms_prop; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.centered_rms_prop) +} +void OptimizationParameters::set_allocated_mdl_adagrad_light(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* mdl_adagrad_light) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (mdl_adagrad_light) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + mdl_adagrad_light = ::google::protobuf::internal::GetOwnedMessage( + message_arena, mdl_adagrad_light, submessage_arena); + } + set_has_mdl_adagrad_light(); + parameters_.mdl_adagrad_light_ = mdl_adagrad_light; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.mdl_adagrad_light) +} +void OptimizationParameters::set_allocated_adadelta(::diplomacy::tensorflow::tpu::AdadeltaParameters* adadelta) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (adadelta) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + adadelta = ::google::protobuf::internal::GetOwnedMessage( + message_arena, adadelta, submessage_arena); + } + set_has_adadelta(); + parameters_.adadelta_ = adadelta; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.adadelta) +} +void OptimizationParameters::set_allocated_proximal_adagrad(::diplomacy::tensorflow::tpu::ProximalAdagradParameters* proximal_adagrad) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_parameters(); + if (proximal_adagrad) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + proximal_adagrad = ::google::protobuf::internal::GetOwnedMessage( + message_arena, proximal_adagrad, submessage_arena); + } + set_has_proximal_adagrad(); + parameters_.proximal_adagrad_ = proximal_adagrad; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.proximal_adagrad) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OptimizationParameters::kLearningRateFieldNumber; +const int OptimizationParameters::kClippingLimitsFieldNumber; +const int OptimizationParameters::kGradientClippingLimitsFieldNumber; +const int OptimizationParameters::kWeightDecayFactorFieldNumber; +const int OptimizationParameters::kUseGradientAccumulationFieldNumber; +const int OptimizationParameters::kAdagradFieldNumber; +const int OptimizationParameters::kStochasticGradientDescentFieldNumber; +const int OptimizationParameters::kFtrlFieldNumber; +const int OptimizationParameters::kAdamFieldNumber; +const int OptimizationParameters::kMomentumFieldNumber; +const int OptimizationParameters::kRmsPropFieldNumber; +const int OptimizationParameters::kCenteredRmsPropFieldNumber; +const int OptimizationParameters::kMdlAdagradLightFieldNumber; +const int OptimizationParameters::kAdadeltaFieldNumber; +const int OptimizationParameters::kProximalAdagradFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OptimizationParameters::OptimizationParameters() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_OptimizationParameters.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.OptimizationParameters) +} +OptimizationParameters::OptimizationParameters(const OptimizationParameters& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_clipping_limits()) { + clipping_limits_ = new ::diplomacy::tensorflow::tpu::ClippingLimits(*from.clipping_limits_); + } else { + clipping_limits_ = NULL; + } + if (from.has_gradient_clipping_limits()) { + gradient_clipping_limits_ = new ::diplomacy::tensorflow::tpu::ClippingLimits(*from.gradient_clipping_limits_); + } else { + gradient_clipping_limits_ = NULL; + } + if (from.has_learning_rate()) { + learning_rate_ = new ::diplomacy::tensorflow::tpu::LearningRate(*from.learning_rate_); + } else { + learning_rate_ = NULL; + } + ::memcpy(&use_gradient_accumulation_, &from.use_gradient_accumulation_, + static_cast(reinterpret_cast(&weight_decay_factor_) - + reinterpret_cast(&use_gradient_accumulation_)) + sizeof(weight_decay_factor_)); + clear_has_parameters(); + switch (from.parameters_case()) { + case kAdagrad: { + mutable_adagrad()->::diplomacy::tensorflow::tpu::AdagradParameters::MergeFrom(from.adagrad()); + break; + } + case kStochasticGradientDescent: { + mutable_stochastic_gradient_descent()->::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters::MergeFrom(from.stochastic_gradient_descent()); + break; + } + case kFtrl: { + mutable_ftrl()->::diplomacy::tensorflow::tpu::FtrlParameters::MergeFrom(from.ftrl()); + break; + } + case kAdam: { + mutable_adam()->::diplomacy::tensorflow::tpu::AdamParameters::MergeFrom(from.adam()); + break; + } + case kMomentum: { + mutable_momentum()->::diplomacy::tensorflow::tpu::MomentumParameters::MergeFrom(from.momentum()); + break; + } + case kRmsProp: { + mutable_rms_prop()->::diplomacy::tensorflow::tpu::RmsPropParameters::MergeFrom(from.rms_prop()); + break; + } + case kCenteredRmsProp: { + mutable_centered_rms_prop()->::diplomacy::tensorflow::tpu::CenteredRmsPropParameters::MergeFrom(from.centered_rms_prop()); + break; + } + case kMdlAdagradLight: { + mutable_mdl_adagrad_light()->::diplomacy::tensorflow::tpu::MdlAdagradLightParameters::MergeFrom(from.mdl_adagrad_light()); + break; + } + case kAdadelta: { + mutable_adadelta()->::diplomacy::tensorflow::tpu::AdadeltaParameters::MergeFrom(from.adadelta()); + break; + } + case kProximalAdagrad: { + mutable_proximal_adagrad()->::diplomacy::tensorflow::tpu::ProximalAdagradParameters::MergeFrom(from.proximal_adagrad()); + break; + } + case PARAMETERS_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.OptimizationParameters) +} + +void OptimizationParameters::SharedCtor() { + ::memset(&clipping_limits_, 0, static_cast( + reinterpret_cast(&weight_decay_factor_) - + reinterpret_cast(&clipping_limits_)) + sizeof(weight_decay_factor_)); + clear_has_parameters(); +} + +OptimizationParameters::~OptimizationParameters() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.OptimizationParameters) + SharedDtor(); +} + +void OptimizationParameters::SharedDtor() { + if (this != internal_default_instance()) delete clipping_limits_; + if (this != internal_default_instance()) delete gradient_clipping_limits_; + if (this != internal_default_instance()) delete learning_rate_; + if (has_parameters()) { + clear_parameters(); + } +} + +void OptimizationParameters::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OptimizationParameters::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OptimizationParameters& OptimizationParameters::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_OptimizationParameters.base); + return *internal_default_instance(); +} + + +void OptimizationParameters::clear_parameters() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tpu.OptimizationParameters) + switch (parameters_case()) { + case kAdagrad: { + delete parameters_.adagrad_; + break; + } + case kStochasticGradientDescent: { + delete parameters_.stochastic_gradient_descent_; + break; + } + case kFtrl: { + delete parameters_.ftrl_; + break; + } + case kAdam: { + delete parameters_.adam_; + break; + } + case kMomentum: { + delete parameters_.momentum_; + break; + } + case kRmsProp: { + delete parameters_.rms_prop_; + break; + } + case kCenteredRmsProp: { + delete parameters_.centered_rms_prop_; + break; + } + case kMdlAdagradLight: { + delete parameters_.mdl_adagrad_light_; + break; + } + case kAdadelta: { + delete parameters_.adadelta_; + break; + } + case kProximalAdagrad: { + delete parameters_.proximal_adagrad_; + break; + } + case PARAMETERS_NOT_SET: { + break; + } + } + _oneof_case_[0] = PARAMETERS_NOT_SET; +} + + +void OptimizationParameters::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.OptimizationParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && clipping_limits_ != NULL) { + delete clipping_limits_; + } + clipping_limits_ = NULL; + if (GetArenaNoVirtual() == NULL && gradient_clipping_limits_ != NULL) { + delete gradient_clipping_limits_; + } + gradient_clipping_limits_ = NULL; + if (GetArenaNoVirtual() == NULL && learning_rate_ != NULL) { + delete learning_rate_; + } + learning_rate_ = NULL; + ::memset(&use_gradient_accumulation_, 0, static_cast( + reinterpret_cast(&weight_decay_factor_) - + reinterpret_cast(&use_gradient_accumulation_)) + sizeof(weight_decay_factor_)); + clear_parameters(); + _internal_metadata_.Clear(); +} + +bool OptimizationParameters::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.OptimizationParameters) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tpu.ClippingLimits clipping_limits = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_clipping_limits())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.AdagradParameters adagrad = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_adagrad())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.StochasticGradientDescentParameters stochastic_gradient_descent = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_stochastic_gradient_descent())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.FtrlParameters ftrl = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_ftrl())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.AdamParameters adam = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_adam())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.ClippingLimits gradient_clipping_limits = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_gradient_clipping_limits())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.MomentumParameters momentum = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_momentum())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.RmsPropParameters rms_prop = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_rms_prop())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.CenteredRmsPropParameters centered_rms_prop = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_centered_rms_prop())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.MdlAdagradLightParameters mdl_adagrad_light = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_mdl_adagrad_light())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.AdadeltaParameters adadelta = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_adadelta())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.LearningRate learning_rate = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_learning_rate())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.ProximalAdagradParameters proximal_adagrad = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_proximal_adagrad())); + } else { + goto handle_unusual; + } + break; + } + + // bool use_gradient_accumulation = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_gradient_accumulation_))); + } else { + goto handle_unusual; + } + break; + } + + // float weight_decay_factor = 16; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(133u /* 133 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_decay_factor_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.OptimizationParameters) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.OptimizationParameters) + return false; +#undef DO_ +} + +void OptimizationParameters::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.OptimizationParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tpu.ClippingLimits clipping_limits = 2; + if (this->has_clipping_limits()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_clipping_limits(), output); + } + + // .diplomacy.tensorflow.tpu.AdagradParameters adagrad = 3; + if (has_adagrad()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_adagrad(), output); + } + + // .diplomacy.tensorflow.tpu.StochasticGradientDescentParameters stochastic_gradient_descent = 4; + if (has_stochastic_gradient_descent()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_stochastic_gradient_descent(), output); + } + + // .diplomacy.tensorflow.tpu.FtrlParameters ftrl = 5; + if (has_ftrl()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_ftrl(), output); + } + + // .diplomacy.tensorflow.tpu.AdamParameters adam = 6; + if (has_adam()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_adam(), output); + } + + // .diplomacy.tensorflow.tpu.ClippingLimits gradient_clipping_limits = 7; + if (this->has_gradient_clipping_limits()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->_internal_gradient_clipping_limits(), output); + } + + // .diplomacy.tensorflow.tpu.MomentumParameters momentum = 8; + if (has_momentum()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_momentum(), output); + } + + // .diplomacy.tensorflow.tpu.RmsPropParameters rms_prop = 9; + if (has_rms_prop()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->_internal_rms_prop(), output); + } + + // .diplomacy.tensorflow.tpu.CenteredRmsPropParameters centered_rms_prop = 10; + if (has_centered_rms_prop()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, this->_internal_centered_rms_prop(), output); + } + + // .diplomacy.tensorflow.tpu.MdlAdagradLightParameters mdl_adagrad_light = 11; + if (has_mdl_adagrad_light()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->_internal_mdl_adagrad_light(), output); + } + + // .diplomacy.tensorflow.tpu.AdadeltaParameters adadelta = 12; + if (has_adadelta()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, this->_internal_adadelta(), output); + } + + // .diplomacy.tensorflow.tpu.LearningRate learning_rate = 13; + if (this->has_learning_rate()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, this->_internal_learning_rate(), output); + } + + // .diplomacy.tensorflow.tpu.ProximalAdagradParameters proximal_adagrad = 14; + if (has_proximal_adagrad()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 14, this->_internal_proximal_adagrad(), output); + } + + // bool use_gradient_accumulation = 15; + if (this->use_gradient_accumulation() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(15, this->use_gradient_accumulation(), output); + } + + // float weight_decay_factor = 16; + if (this->weight_decay_factor() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(16, this->weight_decay_factor(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.OptimizationParameters) +} + +::google::protobuf::uint8* OptimizationParameters::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.OptimizationParameters) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tpu.ClippingLimits clipping_limits = 2; + if (this->has_clipping_limits()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_clipping_limits(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.AdagradParameters adagrad = 3; + if (has_adagrad()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_adagrad(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.StochasticGradientDescentParameters stochastic_gradient_descent = 4; + if (has_stochastic_gradient_descent()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_stochastic_gradient_descent(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.FtrlParameters ftrl = 5; + if (has_ftrl()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_ftrl(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.AdamParameters adam = 6; + if (has_adam()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_adam(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.ClippingLimits gradient_clipping_limits = 7; + if (this->has_gradient_clipping_limits()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->_internal_gradient_clipping_limits(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.MomentumParameters momentum = 8; + if (has_momentum()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_momentum(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.RmsPropParameters rms_prop = 9; + if (has_rms_prop()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 9, this->_internal_rms_prop(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.CenteredRmsPropParameters centered_rms_prop = 10; + if (has_centered_rms_prop()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 10, this->_internal_centered_rms_prop(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.MdlAdagradLightParameters mdl_adagrad_light = 11; + if (has_mdl_adagrad_light()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 11, this->_internal_mdl_adagrad_light(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.AdadeltaParameters adadelta = 12; + if (has_adadelta()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 12, this->_internal_adadelta(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.LearningRate learning_rate = 13; + if (this->has_learning_rate()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 13, this->_internal_learning_rate(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.ProximalAdagradParameters proximal_adagrad = 14; + if (has_proximal_adagrad()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 14, this->_internal_proximal_adagrad(), deterministic, target); + } + + // bool use_gradient_accumulation = 15; + if (this->use_gradient_accumulation() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(15, this->use_gradient_accumulation(), target); + } + + // float weight_decay_factor = 16; + if (this->weight_decay_factor() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(16, this->weight_decay_factor(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.OptimizationParameters) + return target; +} + +size_t OptimizationParameters::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.OptimizationParameters) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.tpu.ClippingLimits clipping_limits = 2; + if (this->has_clipping_limits()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *clipping_limits_); + } + + // .diplomacy.tensorflow.tpu.ClippingLimits gradient_clipping_limits = 7; + if (this->has_gradient_clipping_limits()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *gradient_clipping_limits_); + } + + // .diplomacy.tensorflow.tpu.LearningRate learning_rate = 13; + if (this->has_learning_rate()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *learning_rate_); + } + + // bool use_gradient_accumulation = 15; + if (this->use_gradient_accumulation() != 0) { + total_size += 1 + 1; + } + + // float weight_decay_factor = 16; + if (this->weight_decay_factor() != 0) { + total_size += 2 + 4; + } + + switch (parameters_case()) { + // .diplomacy.tensorflow.tpu.AdagradParameters adagrad = 3; + case kAdagrad: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.adagrad_); + break; + } + // .diplomacy.tensorflow.tpu.StochasticGradientDescentParameters stochastic_gradient_descent = 4; + case kStochasticGradientDescent: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.stochastic_gradient_descent_); + break; + } + // .diplomacy.tensorflow.tpu.FtrlParameters ftrl = 5; + case kFtrl: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.ftrl_); + break; + } + // .diplomacy.tensorflow.tpu.AdamParameters adam = 6; + case kAdam: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.adam_); + break; + } + // .diplomacy.tensorflow.tpu.MomentumParameters momentum = 8; + case kMomentum: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.momentum_); + break; + } + // .diplomacy.tensorflow.tpu.RmsPropParameters rms_prop = 9; + case kRmsProp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.rms_prop_); + break; + } + // .diplomacy.tensorflow.tpu.CenteredRmsPropParameters centered_rms_prop = 10; + case kCenteredRmsProp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.centered_rms_prop_); + break; + } + // .diplomacy.tensorflow.tpu.MdlAdagradLightParameters mdl_adagrad_light = 11; + case kMdlAdagradLight: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.mdl_adagrad_light_); + break; + } + // .diplomacy.tensorflow.tpu.AdadeltaParameters adadelta = 12; + case kAdadelta: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.adadelta_); + break; + } + // .diplomacy.tensorflow.tpu.ProximalAdagradParameters proximal_adagrad = 14; + case kProximalAdagrad: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *parameters_.proximal_adagrad_); + break; + } + case PARAMETERS_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OptimizationParameters::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.OptimizationParameters) + GOOGLE_DCHECK_NE(&from, this); + const OptimizationParameters* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.OptimizationParameters) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.OptimizationParameters) + MergeFrom(*source); + } +} + +void OptimizationParameters::MergeFrom(const OptimizationParameters& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.OptimizationParameters) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_clipping_limits()) { + mutable_clipping_limits()->::diplomacy::tensorflow::tpu::ClippingLimits::MergeFrom(from.clipping_limits()); + } + if (from.has_gradient_clipping_limits()) { + mutable_gradient_clipping_limits()->::diplomacy::tensorflow::tpu::ClippingLimits::MergeFrom(from.gradient_clipping_limits()); + } + if (from.has_learning_rate()) { + mutable_learning_rate()->::diplomacy::tensorflow::tpu::LearningRate::MergeFrom(from.learning_rate()); + } + if (from.use_gradient_accumulation() != 0) { + set_use_gradient_accumulation(from.use_gradient_accumulation()); + } + if (from.weight_decay_factor() != 0) { + set_weight_decay_factor(from.weight_decay_factor()); + } + switch (from.parameters_case()) { + case kAdagrad: { + mutable_adagrad()->::diplomacy::tensorflow::tpu::AdagradParameters::MergeFrom(from.adagrad()); + break; + } + case kStochasticGradientDescent: { + mutable_stochastic_gradient_descent()->::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters::MergeFrom(from.stochastic_gradient_descent()); + break; + } + case kFtrl: { + mutable_ftrl()->::diplomacy::tensorflow::tpu::FtrlParameters::MergeFrom(from.ftrl()); + break; + } + case kAdam: { + mutable_adam()->::diplomacy::tensorflow::tpu::AdamParameters::MergeFrom(from.adam()); + break; + } + case kMomentum: { + mutable_momentum()->::diplomacy::tensorflow::tpu::MomentumParameters::MergeFrom(from.momentum()); + break; + } + case kRmsProp: { + mutable_rms_prop()->::diplomacy::tensorflow::tpu::RmsPropParameters::MergeFrom(from.rms_prop()); + break; + } + case kCenteredRmsProp: { + mutable_centered_rms_prop()->::diplomacy::tensorflow::tpu::CenteredRmsPropParameters::MergeFrom(from.centered_rms_prop()); + break; + } + case kMdlAdagradLight: { + mutable_mdl_adagrad_light()->::diplomacy::tensorflow::tpu::MdlAdagradLightParameters::MergeFrom(from.mdl_adagrad_light()); + break; + } + case kAdadelta: { + mutable_adadelta()->::diplomacy::tensorflow::tpu::AdadeltaParameters::MergeFrom(from.adadelta()); + break; + } + case kProximalAdagrad: { + mutable_proximal_adagrad()->::diplomacy::tensorflow::tpu::ProximalAdagradParameters::MergeFrom(from.proximal_adagrad()); + break; + } + case PARAMETERS_NOT_SET: { + break; + } + } +} + +void OptimizationParameters::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.OptimizationParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OptimizationParameters::CopyFrom(const OptimizationParameters& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.OptimizationParameters) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OptimizationParameters::IsInitialized() const { + return true; +} + +void OptimizationParameters::Swap(OptimizationParameters* other) { + if (other == this) return; + InternalSwap(other); +} +void OptimizationParameters::InternalSwap(OptimizationParameters* other) { + using std::swap; + swap(clipping_limits_, other->clipping_limits_); + swap(gradient_clipping_limits_, other->gradient_clipping_limits_); + swap(learning_rate_, other->learning_rate_); + swap(use_gradient_accumulation_, other->use_gradient_accumulation_); + swap(weight_decay_factor_, other->weight_decay_factor_); + swap(parameters_, other->parameters_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OptimizationParameters::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void StateVariableSpecification_UserDefined::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +StateVariableSpecification_UserDefined::StateVariableSpecification_UserDefined() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification_UserDefined.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) +} +StateVariableSpecification_UserDefined::StateVariableSpecification_UserDefined(const StateVariableSpecification_UserDefined& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) +} + +void StateVariableSpecification_UserDefined::SharedCtor() { +} + +StateVariableSpecification_UserDefined::~StateVariableSpecification_UserDefined() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + SharedDtor(); +} + +void StateVariableSpecification_UserDefined::SharedDtor() { +} + +void StateVariableSpecification_UserDefined::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* StateVariableSpecification_UserDefined::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const StateVariableSpecification_UserDefined& StateVariableSpecification_UserDefined::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification_UserDefined.base); + return *internal_default_instance(); +} + + +void StateVariableSpecification_UserDefined::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +bool StateVariableSpecification_UserDefined::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + return false; +#undef DO_ +} + +void StateVariableSpecification_UserDefined::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) +} + +::google::protobuf::uint8* StateVariableSpecification_UserDefined::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + return target; +} + +size_t StateVariableSpecification_UserDefined::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StateVariableSpecification_UserDefined::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + GOOGLE_DCHECK_NE(&from, this); + const StateVariableSpecification_UserDefined* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + MergeFrom(*source); + } +} + +void StateVariableSpecification_UserDefined::MergeFrom(const StateVariableSpecification_UserDefined& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void StateVariableSpecification_UserDefined::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StateVariableSpecification_UserDefined::CopyFrom(const StateVariableSpecification_UserDefined& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StateVariableSpecification_UserDefined::IsInitialized() const { + return true; +} + +void StateVariableSpecification_UserDefined::Swap(StateVariableSpecification_UserDefined* other) { + if (other == this) return; + InternalSwap(other); +} +void StateVariableSpecification_UserDefined::InternalSwap(StateVariableSpecification_UserDefined* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata StateVariableSpecification_UserDefined::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void StateVariableSpecification_FillWithConstant::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int StateVariableSpecification_FillWithConstant::kInitialValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +StateVariableSpecification_FillWithConstant::StateVariableSpecification_FillWithConstant() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification_FillWithConstant.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) +} +StateVariableSpecification_FillWithConstant::StateVariableSpecification_FillWithConstant(const StateVariableSpecification_FillWithConstant& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + initial_value_ = from.initial_value_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) +} + +void StateVariableSpecification_FillWithConstant::SharedCtor() { + initial_value_ = 0; +} + +StateVariableSpecification_FillWithConstant::~StateVariableSpecification_FillWithConstant() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + SharedDtor(); +} + +void StateVariableSpecification_FillWithConstant::SharedDtor() { +} + +void StateVariableSpecification_FillWithConstant::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* StateVariableSpecification_FillWithConstant::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const StateVariableSpecification_FillWithConstant& StateVariableSpecification_FillWithConstant::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification_FillWithConstant.base); + return *internal_default_instance(); +} + + +void StateVariableSpecification_FillWithConstant::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + initial_value_ = 0; + _internal_metadata_.Clear(); +} + +bool StateVariableSpecification_FillWithConstant::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // double initial_value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &initial_value_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + return false; +#undef DO_ +} + +void StateVariableSpecification_FillWithConstant::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double initial_value = 1; + if (this->initial_value() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->initial_value(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) +} + +::google::protobuf::uint8* StateVariableSpecification_FillWithConstant::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double initial_value = 1; + if (this->initial_value() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->initial_value(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + return target; +} + +size_t StateVariableSpecification_FillWithConstant::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // double initial_value = 1; + if (this->initial_value() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StateVariableSpecification_FillWithConstant::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + GOOGLE_DCHECK_NE(&from, this); + const StateVariableSpecification_FillWithConstant* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + MergeFrom(*source); + } +} + +void StateVariableSpecification_FillWithConstant::MergeFrom(const StateVariableSpecification_FillWithConstant& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.initial_value() != 0) { + set_initial_value(from.initial_value()); + } +} + +void StateVariableSpecification_FillWithConstant::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StateVariableSpecification_FillWithConstant::CopyFrom(const StateVariableSpecification_FillWithConstant& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StateVariableSpecification_FillWithConstant::IsInitialized() const { + return true; +} + +void StateVariableSpecification_FillWithConstant::Swap(StateVariableSpecification_FillWithConstant* other) { + if (other == this) return; + InternalSwap(other); +} +void StateVariableSpecification_FillWithConstant::InternalSwap(StateVariableSpecification_FillWithConstant* other) { + using std::swap; + swap(initial_value_, other->initial_value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata StateVariableSpecification_FillWithConstant::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void StateVariableSpecification::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::_StateVariableSpecification_default_instance_.user_defined_ = const_cast< ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined*>( + ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined::internal_default_instance()); + ::diplomacy::tensorflow::tpu::_StateVariableSpecification_default_instance_.fill_with_constant_ = const_cast< ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant*>( + ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant::internal_default_instance()); +} +void StateVariableSpecification::set_allocated_user_defined(::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* user_defined) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_usage(); + if (user_defined) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + user_defined = ::google::protobuf::internal::GetOwnedMessage( + message_arena, user_defined, submessage_arena); + } + set_has_user_defined(); + usage_.user_defined_ = user_defined; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.StateVariableSpecification.user_defined) +} +void StateVariableSpecification::set_allocated_fill_with_constant(::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* fill_with_constant) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_usage(); + if (fill_with_constant) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + fill_with_constant = ::google::protobuf::internal::GetOwnedMessage( + message_arena, fill_with_constant, submessage_arena); + } + set_has_fill_with_constant(); + usage_.fill_with_constant_ = fill_with_constant; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.StateVariableSpecification.fill_with_constant) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int StateVariableSpecification::kNameFieldNumber; +const int StateVariableSpecification::kUserDefinedFieldNumber; +const int StateVariableSpecification::kFillWithConstantFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +StateVariableSpecification::StateVariableSpecification() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.StateVariableSpecification) +} +StateVariableSpecification::StateVariableSpecification(const StateVariableSpecification& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + clear_has_usage(); + switch (from.usage_case()) { + case kUserDefined: { + mutable_user_defined()->::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined::MergeFrom(from.user_defined()); + break; + } + case kFillWithConstant: { + mutable_fill_with_constant()->::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant::MergeFrom(from.fill_with_constant()); + break; + } + case USAGE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.StateVariableSpecification) +} + +void StateVariableSpecification::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_usage(); +} + +StateVariableSpecification::~StateVariableSpecification() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.StateVariableSpecification) + SharedDtor(); +} + +void StateVariableSpecification::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (has_usage()) { + clear_usage(); + } +} + +void StateVariableSpecification::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* StateVariableSpecification::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const StateVariableSpecification& StateVariableSpecification::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_StateVariableSpecification.base); + return *internal_default_instance(); +} + + +void StateVariableSpecification::clear_usage() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + switch (usage_case()) { + case kUserDefined: { + delete usage_.user_defined_; + break; + } + case kFillWithConstant: { + delete usage_.fill_with_constant_; + break; + } + case USAGE_NOT_SET: { + break; + } + } + _oneof_case_[0] = USAGE_NOT_SET; +} + + +void StateVariableSpecification::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_usage(); + _internal_metadata_.Clear(); +} + +bool StateVariableSpecification::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.StateVariableSpecification.name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined user_defined = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_user_defined())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant fill_with_constant = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_fill_with_constant())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.StateVariableSpecification) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.StateVariableSpecification) + return false; +#undef DO_ +} + +void StateVariableSpecification::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.StateVariableSpecification.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined user_defined = 2; + if (has_user_defined()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_user_defined(), output); + } + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant fill_with_constant = 3; + if (has_fill_with_constant()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_fill_with_constant(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.StateVariableSpecification) +} + +::google::protobuf::uint8* StateVariableSpecification::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.StateVariableSpecification.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined user_defined = 2; + if (has_user_defined()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_user_defined(), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant fill_with_constant = 3; + if (has_fill_with_constant()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_fill_with_constant(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.StateVariableSpecification) + return target; +} + +size_t StateVariableSpecification::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + switch (usage_case()) { + // .diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined user_defined = 2; + case kUserDefined: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *usage_.user_defined_); + break; + } + // .diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant fill_with_constant = 3; + case kFillWithConstant: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *usage_.fill_with_constant_); + break; + } + case USAGE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StateVariableSpecification::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + GOOGLE_DCHECK_NE(&from, this); + const StateVariableSpecification* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.StateVariableSpecification) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.StateVariableSpecification) + MergeFrom(*source); + } +} + +void StateVariableSpecification::MergeFrom(const StateVariableSpecification& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + switch (from.usage_case()) { + case kUserDefined: { + mutable_user_defined()->::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined::MergeFrom(from.user_defined()); + break; + } + case kFillWithConstant: { + mutable_fill_with_constant()->::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant::MergeFrom(from.fill_with_constant()); + break; + } + case USAGE_NOT_SET: { + break; + } + } +} + +void StateVariableSpecification::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StateVariableSpecification::CopyFrom(const StateVariableSpecification& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.StateVariableSpecification) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StateVariableSpecification::IsInitialized() const { + return true; +} + +void StateVariableSpecification::Swap(StateVariableSpecification* other) { + if (other == this) return; + InternalSwap(other); +} +void StateVariableSpecification::InternalSwap(StateVariableSpecification* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(usage_, other->usage_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata StateVariableSpecification::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::ClippingLimits* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::ClippingLimits >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::ClippingLimits >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::DynamicLearningRate* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::DynamicLearningRate >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::DynamicLearningRate >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::LearningRate* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::LearningRate >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::LearningRate >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::AdagradParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::AdagradParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::AdagradParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::FtrlParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::FtrlParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::FtrlParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::AdamParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::AdamParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::AdamParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::MomentumParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::MomentumParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::MomentumParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::RmsPropParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::RmsPropParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::RmsPropParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::AdadeltaParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::AdadeltaParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::AdadeltaParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::ProximalAdagradParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::ProximalAdagradParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::OptimizationParameters* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::OptimizationParameters >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::OptimizationParameters >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::StateVariableSpecification* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::StateVariableSpecification >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::StateVariableSpecification >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.h new file mode 100644 index 0000000..e9def88 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.h @@ -0,0 +1,4247 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[17]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class AdadeltaParameters; +class AdadeltaParametersDefaultTypeInternal; +extern AdadeltaParametersDefaultTypeInternal _AdadeltaParameters_default_instance_; +class AdagradParameters; +class AdagradParametersDefaultTypeInternal; +extern AdagradParametersDefaultTypeInternal _AdagradParameters_default_instance_; +class AdamParameters; +class AdamParametersDefaultTypeInternal; +extern AdamParametersDefaultTypeInternal _AdamParameters_default_instance_; +class CenteredRmsPropParameters; +class CenteredRmsPropParametersDefaultTypeInternal; +extern CenteredRmsPropParametersDefaultTypeInternal _CenteredRmsPropParameters_default_instance_; +class ClippingLimits; +class ClippingLimitsDefaultTypeInternal; +extern ClippingLimitsDefaultTypeInternal _ClippingLimits_default_instance_; +class DynamicLearningRate; +class DynamicLearningRateDefaultTypeInternal; +extern DynamicLearningRateDefaultTypeInternal _DynamicLearningRate_default_instance_; +class FtrlParameters; +class FtrlParametersDefaultTypeInternal; +extern FtrlParametersDefaultTypeInternal _FtrlParameters_default_instance_; +class LearningRate; +class LearningRateDefaultTypeInternal; +extern LearningRateDefaultTypeInternal _LearningRate_default_instance_; +class MdlAdagradLightParameters; +class MdlAdagradLightParametersDefaultTypeInternal; +extern MdlAdagradLightParametersDefaultTypeInternal _MdlAdagradLightParameters_default_instance_; +class MomentumParameters; +class MomentumParametersDefaultTypeInternal; +extern MomentumParametersDefaultTypeInternal _MomentumParameters_default_instance_; +class OptimizationParameters; +class OptimizationParametersDefaultTypeInternal; +extern OptimizationParametersDefaultTypeInternal _OptimizationParameters_default_instance_; +class ProximalAdagradParameters; +class ProximalAdagradParametersDefaultTypeInternal; +extern ProximalAdagradParametersDefaultTypeInternal _ProximalAdagradParameters_default_instance_; +class RmsPropParameters; +class RmsPropParametersDefaultTypeInternal; +extern RmsPropParametersDefaultTypeInternal _RmsPropParameters_default_instance_; +class StateVariableSpecification; +class StateVariableSpecificationDefaultTypeInternal; +extern StateVariableSpecificationDefaultTypeInternal _StateVariableSpecification_default_instance_; +class StateVariableSpecification_FillWithConstant; +class StateVariableSpecification_FillWithConstantDefaultTypeInternal; +extern StateVariableSpecification_FillWithConstantDefaultTypeInternal _StateVariableSpecification_FillWithConstant_default_instance_; +class StateVariableSpecification_UserDefined; +class StateVariableSpecification_UserDefinedDefaultTypeInternal; +extern StateVariableSpecification_UserDefinedDefaultTypeInternal _StateVariableSpecification_UserDefined_default_instance_; +class StochasticGradientDescentParameters; +class StochasticGradientDescentParametersDefaultTypeInternal; +extern StochasticGradientDescentParametersDefaultTypeInternal _StochasticGradientDescentParameters_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tpu::AdadeltaParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::AdadeltaParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::AdagradParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::AdagradParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::AdamParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::AdamParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::CenteredRmsPropParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::ClippingLimits* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::ClippingLimits>(Arena*); +template<> ::diplomacy::tensorflow::tpu::DynamicLearningRate* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::DynamicLearningRate>(Arena*); +template<> ::diplomacy::tensorflow::tpu::FtrlParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::FtrlParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::LearningRate* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::LearningRate>(Arena*); +template<> ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::MdlAdagradLightParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::MomentumParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::MomentumParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::OptimizationParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::OptimizationParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::ProximalAdagradParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::RmsPropParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::RmsPropParameters>(Arena*); +template<> ::diplomacy::tensorflow::tpu::StateVariableSpecification* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::StateVariableSpecification>(Arena*); +template<> ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant>(Arena*); +template<> ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined>(Arena*); +template<> ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +class ClippingLimits : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.ClippingLimits) */ { + public: + ClippingLimits(); + virtual ~ClippingLimits(); + + ClippingLimits(const ClippingLimits& from); + + inline ClippingLimits& operator=(const ClippingLimits& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ClippingLimits(ClippingLimits&& from) noexcept + : ClippingLimits() { + *this = ::std::move(from); + } + + inline ClippingLimits& operator=(ClippingLimits&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ClippingLimits& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ClippingLimits* internal_default_instance() { + return reinterpret_cast( + &_ClippingLimits_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(ClippingLimits* other); + friend void swap(ClippingLimits& a, ClippingLimits& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ClippingLimits* New() const final { + return CreateMaybeMessage(NULL); + } + + ClippingLimits* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ClippingLimits& from); + void MergeFrom(const ClippingLimits& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ClippingLimits* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .google.protobuf.FloatValue lower = 1; + bool has_lower() const; + void clear_lower(); + static const int kLowerFieldNumber = 1; + private: + const ::google::protobuf::FloatValue& _internal_lower() const; + public: + const ::google::protobuf::FloatValue& lower() const; + ::google::protobuf::FloatValue* release_lower(); + ::google::protobuf::FloatValue* mutable_lower(); + void set_allocated_lower(::google::protobuf::FloatValue* lower); + + // .google.protobuf.FloatValue upper = 2; + bool has_upper() const; + void clear_upper(); + static const int kUpperFieldNumber = 2; + private: + const ::google::protobuf::FloatValue& _internal_upper() const; + public: + const ::google::protobuf::FloatValue& upper() const; + ::google::protobuf::FloatValue* release_upper(); + ::google::protobuf::FloatValue* mutable_upper(); + void set_allocated_upper(::google::protobuf::FloatValue* upper); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.ClippingLimits) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::FloatValue* lower_; + ::google::protobuf::FloatValue* upper_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DynamicLearningRate : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.DynamicLearningRate) */ { + public: + DynamicLearningRate(); + virtual ~DynamicLearningRate(); + + DynamicLearningRate(const DynamicLearningRate& from); + + inline DynamicLearningRate& operator=(const DynamicLearningRate& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DynamicLearningRate(DynamicLearningRate&& from) noexcept + : DynamicLearningRate() { + *this = ::std::move(from); + } + + inline DynamicLearningRate& operator=(DynamicLearningRate&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DynamicLearningRate& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DynamicLearningRate* internal_default_instance() { + return reinterpret_cast( + &_DynamicLearningRate_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(DynamicLearningRate* other); + friend void swap(DynamicLearningRate& a, DynamicLearningRate& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DynamicLearningRate* New() const final { + return CreateMaybeMessage(NULL); + } + + DynamicLearningRate* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DynamicLearningRate& from); + void MergeFrom(const DynamicLearningRate& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DynamicLearningRate* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.DynamicLearningRate) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LearningRate : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.LearningRate) */ { + public: + LearningRate(); + virtual ~LearningRate(); + + LearningRate(const LearningRate& from); + + inline LearningRate& operator=(const LearningRate& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LearningRate(LearningRate&& from) noexcept + : LearningRate() { + *this = ::std::move(from); + } + + inline LearningRate& operator=(LearningRate&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const LearningRate& default_instance(); + + enum LearningRateCase { + kConstant = 1, + kDynamic = 2, + LEARNING_RATE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LearningRate* internal_default_instance() { + return reinterpret_cast( + &_LearningRate_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(LearningRate* other); + friend void swap(LearningRate& a, LearningRate& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LearningRate* New() const final { + return CreateMaybeMessage(NULL); + } + + LearningRate* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LearningRate& from); + void MergeFrom(const LearningRate& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LearningRate* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float constant = 1; + private: + bool has_constant() const; + public: + void clear_constant(); + static const int kConstantFieldNumber = 1; + float constant() const; + void set_constant(float value); + + // .diplomacy.tensorflow.tpu.DynamicLearningRate dynamic = 2; + bool has_dynamic() const; + void clear_dynamic(); + static const int kDynamicFieldNumber = 2; + private: + const ::diplomacy::tensorflow::tpu::DynamicLearningRate& _internal_dynamic() const; + public: + const ::diplomacy::tensorflow::tpu::DynamicLearningRate& dynamic() const; + ::diplomacy::tensorflow::tpu::DynamicLearningRate* release_dynamic(); + ::diplomacy::tensorflow::tpu::DynamicLearningRate* mutable_dynamic(); + void set_allocated_dynamic(::diplomacy::tensorflow::tpu::DynamicLearningRate* dynamic); + + void clear_learning_rate(); + LearningRateCase learning_rate_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.LearningRate) + private: + void set_has_constant(); + void set_has_dynamic(); + + inline bool has_learning_rate() const; + inline void clear_has_learning_rate(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + union LearningRateUnion { + LearningRateUnion() {} + float constant_; + ::diplomacy::tensorflow::tpu::DynamicLearningRate* dynamic_; + } learning_rate_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class AdagradParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.AdagradParameters) */ { + public: + AdagradParameters(); + virtual ~AdagradParameters(); + + AdagradParameters(const AdagradParameters& from); + + inline AdagradParameters& operator=(const AdagradParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AdagradParameters(AdagradParameters&& from) noexcept + : AdagradParameters() { + *this = ::std::move(from); + } + + inline AdagradParameters& operator=(AdagradParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const AdagradParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AdagradParameters* internal_default_instance() { + return reinterpret_cast( + &_AdagradParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(AdagradParameters* other); + friend void swap(AdagradParameters& a, AdagradParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AdagradParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + AdagradParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AdagradParameters& from); + void MergeFrom(const AdagradParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AdagradParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float initial_accumulator = 1; + void clear_initial_accumulator(); + static const int kInitialAccumulatorFieldNumber = 1; + float initial_accumulator() const; + void set_initial_accumulator(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.AdagradParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float initial_accumulator_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class StochasticGradientDescentParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) */ { + public: + StochasticGradientDescentParameters(); + virtual ~StochasticGradientDescentParameters(); + + StochasticGradientDescentParameters(const StochasticGradientDescentParameters& from); + + inline StochasticGradientDescentParameters& operator=(const StochasticGradientDescentParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + StochasticGradientDescentParameters(StochasticGradientDescentParameters&& from) noexcept + : StochasticGradientDescentParameters() { + *this = ::std::move(from); + } + + inline StochasticGradientDescentParameters& operator=(StochasticGradientDescentParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const StochasticGradientDescentParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StochasticGradientDescentParameters* internal_default_instance() { + return reinterpret_cast( + &_StochasticGradientDescentParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(StochasticGradientDescentParameters* other); + friend void swap(StochasticGradientDescentParameters& a, StochasticGradientDescentParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline StochasticGradientDescentParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + StochasticGradientDescentParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const StochasticGradientDescentParameters& from); + void MergeFrom(const StochasticGradientDescentParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StochasticGradientDescentParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FtrlParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.FtrlParameters) */ { + public: + FtrlParameters(); + virtual ~FtrlParameters(); + + FtrlParameters(const FtrlParameters& from); + + inline FtrlParameters& operator=(const FtrlParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FtrlParameters(FtrlParameters&& from) noexcept + : FtrlParameters() { + *this = ::std::move(from); + } + + inline FtrlParameters& operator=(FtrlParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const FtrlParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FtrlParameters* internal_default_instance() { + return reinterpret_cast( + &_FtrlParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(FtrlParameters* other); + friend void swap(FtrlParameters& a, FtrlParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FtrlParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + FtrlParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FtrlParameters& from); + void MergeFrom(const FtrlParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FtrlParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float l1 = 1; + void clear_l1(); + static const int kL1FieldNumber = 1; + float l1() const; + void set_l1(float value); + + // float l2 = 2; + void clear_l2(); + static const int kL2FieldNumber = 2; + float l2() const; + void set_l2(float value); + + // float lr_power = 3; + void clear_lr_power(); + static const int kLrPowerFieldNumber = 3; + float lr_power() const; + void set_lr_power(float value); + + // float initial_accum = 4; + void clear_initial_accum(); + static const int kInitialAccumFieldNumber = 4; + float initial_accum() const; + void set_initial_accum(float value); + + // float initial_linear = 5; + void clear_initial_linear(); + static const int kInitialLinearFieldNumber = 5; + float initial_linear() const; + void set_initial_linear(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.FtrlParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float l1_; + float l2_; + float lr_power_; + float initial_accum_; + float initial_linear_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class AdamParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.AdamParameters) */ { + public: + AdamParameters(); + virtual ~AdamParameters(); + + AdamParameters(const AdamParameters& from); + + inline AdamParameters& operator=(const AdamParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AdamParameters(AdamParameters&& from) noexcept + : AdamParameters() { + *this = ::std::move(from); + } + + inline AdamParameters& operator=(AdamParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const AdamParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AdamParameters* internal_default_instance() { + return reinterpret_cast( + &_AdamParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(AdamParameters* other); + friend void swap(AdamParameters& a, AdamParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AdamParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + AdamParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AdamParameters& from); + void MergeFrom(const AdamParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AdamParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float beta1 = 3; + void clear_beta1(); + static const int kBeta1FieldNumber = 3; + float beta1() const; + void set_beta1(float value); + + // float beta2 = 4; + void clear_beta2(); + static const int kBeta2FieldNumber = 4; + float beta2() const; + void set_beta2(float value); + + // float epsilon = 5; + void clear_epsilon(); + static const int kEpsilonFieldNumber = 5; + float epsilon() const; + void set_epsilon(float value); + + // float initial_m = 6; + void clear_initial_m(); + static const int kInitialMFieldNumber = 6; + float initial_m() const; + void set_initial_m(float value); + + // float initial_v = 7; + void clear_initial_v(); + static const int kInitialVFieldNumber = 7; + float initial_v() const; + void set_initial_v(float value); + + // bool use_non_lazy_adam = 8; + void clear_use_non_lazy_adam(); + static const int kUseNonLazyAdamFieldNumber = 8; + bool use_non_lazy_adam() const; + void set_use_non_lazy_adam(bool value); + + // bool use_sum_inside_sqrt = 10; + void clear_use_sum_inside_sqrt(); + static const int kUseSumInsideSqrtFieldNumber = 10; + bool use_sum_inside_sqrt() const; + void set_use_sum_inside_sqrt(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.AdamParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float beta1_; + float beta2_; + float epsilon_; + float initial_m_; + float initial_v_; + bool use_non_lazy_adam_; + bool use_sum_inside_sqrt_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MomentumParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.MomentumParameters) */ { + public: + MomentumParameters(); + virtual ~MomentumParameters(); + + MomentumParameters(const MomentumParameters& from); + + inline MomentumParameters& operator=(const MomentumParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MomentumParameters(MomentumParameters&& from) noexcept + : MomentumParameters() { + *this = ::std::move(from); + } + + inline MomentumParameters& operator=(MomentumParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MomentumParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MomentumParameters* internal_default_instance() { + return reinterpret_cast( + &_MomentumParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void Swap(MomentumParameters* other); + friend void swap(MomentumParameters& a, MomentumParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MomentumParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + MomentumParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MomentumParameters& from); + void MergeFrom(const MomentumParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MomentumParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float momentum = 1; + void clear_momentum(); + static const int kMomentumFieldNumber = 1; + float momentum() const; + void set_momentum(float value); + + // bool use_nesterov = 2; + void clear_use_nesterov(); + static const int kUseNesterovFieldNumber = 2; + bool use_nesterov() const; + void set_use_nesterov(bool value); + + // float initial_accum = 3; + void clear_initial_accum(); + static const int kInitialAccumFieldNumber = 3; + float initial_accum() const; + void set_initial_accum(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.MomentumParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float momentum_; + bool use_nesterov_; + float initial_accum_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class RmsPropParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.RmsPropParameters) */ { + public: + RmsPropParameters(); + virtual ~RmsPropParameters(); + + RmsPropParameters(const RmsPropParameters& from); + + inline RmsPropParameters& operator=(const RmsPropParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + RmsPropParameters(RmsPropParameters&& from) noexcept + : RmsPropParameters() { + *this = ::std::move(from); + } + + inline RmsPropParameters& operator=(RmsPropParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const RmsPropParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const RmsPropParameters* internal_default_instance() { + return reinterpret_cast( + &_RmsPropParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void Swap(RmsPropParameters* other); + friend void swap(RmsPropParameters& a, RmsPropParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline RmsPropParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + RmsPropParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const RmsPropParameters& from); + void MergeFrom(const RmsPropParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RmsPropParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float rho = 1; + void clear_rho(); + static const int kRhoFieldNumber = 1; + float rho() const; + void set_rho(float value); + + // float momentum = 2; + void clear_momentum(); + static const int kMomentumFieldNumber = 2; + float momentum() const; + void set_momentum(float value); + + // float epsilon = 3; + void clear_epsilon(); + static const int kEpsilonFieldNumber = 3; + float epsilon() const; + void set_epsilon(float value); + + // float initial_ms = 4; + void clear_initial_ms(); + static const int kInitialMsFieldNumber = 4; + float initial_ms() const; + void set_initial_ms(float value); + + // float initial_mom = 5; + void clear_initial_mom(); + static const int kInitialMomFieldNumber = 5; + float initial_mom() const; + void set_initial_mom(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.RmsPropParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float rho_; + float momentum_; + float epsilon_; + float initial_ms_; + float initial_mom_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CenteredRmsPropParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) */ { + public: + CenteredRmsPropParameters(); + virtual ~CenteredRmsPropParameters(); + + CenteredRmsPropParameters(const CenteredRmsPropParameters& from); + + inline CenteredRmsPropParameters& operator=(const CenteredRmsPropParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CenteredRmsPropParameters(CenteredRmsPropParameters&& from) noexcept + : CenteredRmsPropParameters() { + *this = ::std::move(from); + } + + inline CenteredRmsPropParameters& operator=(CenteredRmsPropParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const CenteredRmsPropParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CenteredRmsPropParameters* internal_default_instance() { + return reinterpret_cast( + &_CenteredRmsPropParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void Swap(CenteredRmsPropParameters* other); + friend void swap(CenteredRmsPropParameters& a, CenteredRmsPropParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CenteredRmsPropParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + CenteredRmsPropParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CenteredRmsPropParameters& from); + void MergeFrom(const CenteredRmsPropParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CenteredRmsPropParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float rho = 1; + void clear_rho(); + static const int kRhoFieldNumber = 1; + float rho() const; + void set_rho(float value); + + // float momentum = 2; + void clear_momentum(); + static const int kMomentumFieldNumber = 2; + float momentum() const; + void set_momentum(float value); + + // float epsilon = 3; + void clear_epsilon(); + static const int kEpsilonFieldNumber = 3; + float epsilon() const; + void set_epsilon(float value); + + // float initial_ms = 4; + void clear_initial_ms(); + static const int kInitialMsFieldNumber = 4; + float initial_ms() const; + void set_initial_ms(float value); + + // float initial_mom = 5; + void clear_initial_mom(); + static const int kInitialMomFieldNumber = 5; + float initial_mom() const; + void set_initial_mom(float value); + + // float initial_mg = 6; + void clear_initial_mg(); + static const int kInitialMgFieldNumber = 6; + float initial_mg() const; + void set_initial_mg(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float rho_; + float momentum_; + float epsilon_; + float initial_ms_; + float initial_mom_; + float initial_mg_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MdlAdagradLightParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) */ { + public: + MdlAdagradLightParameters(); + virtual ~MdlAdagradLightParameters(); + + MdlAdagradLightParameters(const MdlAdagradLightParameters& from); + + inline MdlAdagradLightParameters& operator=(const MdlAdagradLightParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MdlAdagradLightParameters(MdlAdagradLightParameters&& from) noexcept + : MdlAdagradLightParameters() { + *this = ::std::move(from); + } + + inline MdlAdagradLightParameters& operator=(MdlAdagradLightParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MdlAdagradLightParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MdlAdagradLightParameters* internal_default_instance() { + return reinterpret_cast( + &_MdlAdagradLightParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void Swap(MdlAdagradLightParameters* other); + friend void swap(MdlAdagradLightParameters& a, MdlAdagradLightParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MdlAdagradLightParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + MdlAdagradLightParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MdlAdagradLightParameters& from); + void MergeFrom(const MdlAdagradLightParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MdlAdagradLightParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float l2 = 1; + void clear_l2(); + static const int kL2FieldNumber = 1; + float l2() const; + void set_l2(float value); + + // float lr_power = 2; + void clear_lr_power(); + static const int kLrPowerFieldNumber = 2; + float lr_power() const; + void set_lr_power(float value); + + // float min_servable_mdl_benefit = 3; + void clear_min_servable_mdl_benefit(); + static const int kMinServableMdlBenefitFieldNumber = 3; + float min_servable_mdl_benefit() const; + void set_min_servable_mdl_benefit(float value); + + // float mdl_mix_in_margin = 4; + void clear_mdl_mix_in_margin(); + static const int kMdlMixInMarginFieldNumber = 4; + float mdl_mix_in_margin() const; + void set_mdl_mix_in_margin(float value); + + // float mdl_benefit_rampup_coeff = 5; + void clear_mdl_benefit_rampup_coeff(); + static const int kMdlBenefitRampupCoeffFieldNumber = 5; + float mdl_benefit_rampup_coeff() const; + void set_mdl_benefit_rampup_coeff(float value); + + // float mdl_min_weight = 6; + void clear_mdl_min_weight(); + static const int kMdlMinWeightFieldNumber = 6; + float mdl_min_weight() const; + void set_mdl_min_weight(float value); + + // float benefit_revisit_scale = 7; + void clear_benefit_revisit_scale(); + static const int kBenefitRevisitScaleFieldNumber = 7; + float benefit_revisit_scale() const; + void set_benefit_revisit_scale(float value); + + // float max_event_benefit = 8; + void clear_max_event_benefit(); + static const int kMaxEventBenefitFieldNumber = 8; + float max_event_benefit() const; + void set_max_event_benefit(float value); + + // float max_total_benefit = 9; + void clear_max_total_benefit(); + static const int kMaxTotalBenefitFieldNumber = 9; + float max_total_benefit() const; + void set_max_total_benefit(float value); + + // float mdl_hard_limit = 10; + void clear_mdl_hard_limit(); + static const int kMdlHardLimitFieldNumber = 10; + float mdl_hard_limit() const; + void set_mdl_hard_limit(float value); + + // bool hard_limit_min_benefit = 11; + void clear_hard_limit_min_benefit(); + static const int kHardLimitMinBenefitFieldNumber = 11; + bool hard_limit_min_benefit() const; + void set_hard_limit_min_benefit(bool value); + + // bool mdl_regularize = 12; + void clear_mdl_regularize(); + static const int kMdlRegularizeFieldNumber = 12; + bool mdl_regularize() const; + void set_mdl_regularize(bool value); + + // float initial_accumulator = 13; + void clear_initial_accumulator(); + static const int kInitialAccumulatorFieldNumber = 13; + float initial_accumulator() const; + void set_initial_accumulator(float value); + + // float initial_weight = 14; + void clear_initial_weight(); + static const int kInitialWeightFieldNumber = 14; + float initial_weight() const; + void set_initial_weight(float value); + + // float initial_benefit = 15; + void clear_initial_benefit(); + static const int kInitialBenefitFieldNumber = 15; + float initial_benefit() const; + void set_initial_benefit(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float l2_; + float lr_power_; + float min_servable_mdl_benefit_; + float mdl_mix_in_margin_; + float mdl_benefit_rampup_coeff_; + float mdl_min_weight_; + float benefit_revisit_scale_; + float max_event_benefit_; + float max_total_benefit_; + float mdl_hard_limit_; + bool hard_limit_min_benefit_; + bool mdl_regularize_; + float initial_accumulator_; + float initial_weight_; + float initial_benefit_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class AdadeltaParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.AdadeltaParameters) */ { + public: + AdadeltaParameters(); + virtual ~AdadeltaParameters(); + + AdadeltaParameters(const AdadeltaParameters& from); + + inline AdadeltaParameters& operator=(const AdadeltaParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AdadeltaParameters(AdadeltaParameters&& from) noexcept + : AdadeltaParameters() { + *this = ::std::move(from); + } + + inline AdadeltaParameters& operator=(AdadeltaParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const AdadeltaParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AdadeltaParameters* internal_default_instance() { + return reinterpret_cast( + &_AdadeltaParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void Swap(AdadeltaParameters* other); + friend void swap(AdadeltaParameters& a, AdadeltaParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AdadeltaParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + AdadeltaParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AdadeltaParameters& from); + void MergeFrom(const AdadeltaParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AdadeltaParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float rho = 1; + void clear_rho(); + static const int kRhoFieldNumber = 1; + float rho() const; + void set_rho(float value); + + // float epsilon = 2; + void clear_epsilon(); + static const int kEpsilonFieldNumber = 2; + float epsilon() const; + void set_epsilon(float value); + + // float initial_accumulator = 3; + void clear_initial_accumulator(); + static const int kInitialAccumulatorFieldNumber = 3; + float initial_accumulator() const; + void set_initial_accumulator(float value); + + // float initial_update = 4; + void clear_initial_update(); + static const int kInitialUpdateFieldNumber = 4; + float initial_update() const; + void set_initial_update(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.AdadeltaParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float rho_; + float epsilon_; + float initial_accumulator_; + float initial_update_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ProximalAdagradParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.ProximalAdagradParameters) */ { + public: + ProximalAdagradParameters(); + virtual ~ProximalAdagradParameters(); + + ProximalAdagradParameters(const ProximalAdagradParameters& from); + + inline ProximalAdagradParameters& operator=(const ProximalAdagradParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ProximalAdagradParameters(ProximalAdagradParameters&& from) noexcept + : ProximalAdagradParameters() { + *this = ::std::move(from); + } + + inline ProximalAdagradParameters& operator=(ProximalAdagradParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ProximalAdagradParameters& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ProximalAdagradParameters* internal_default_instance() { + return reinterpret_cast( + &_ProximalAdagradParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void Swap(ProximalAdagradParameters* other); + friend void swap(ProximalAdagradParameters& a, ProximalAdagradParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ProximalAdagradParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + ProximalAdagradParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ProximalAdagradParameters& from); + void MergeFrom(const ProximalAdagradParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ProximalAdagradParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float l1 = 1; + void clear_l1(); + static const int kL1FieldNumber = 1; + float l1() const; + void set_l1(float value); + + // float l2 = 2; + void clear_l2(); + static const int kL2FieldNumber = 2; + float l2() const; + void set_l2(float value); + + // float initial_accumulator = 3; + void clear_initial_accumulator(); + static const int kInitialAccumulatorFieldNumber = 3; + float initial_accumulator() const; + void set_initial_accumulator(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + float l1_; + float l2_; + float initial_accumulator_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OptimizationParameters : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.OptimizationParameters) */ { + public: + OptimizationParameters(); + virtual ~OptimizationParameters(); + + OptimizationParameters(const OptimizationParameters& from); + + inline OptimizationParameters& operator=(const OptimizationParameters& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OptimizationParameters(OptimizationParameters&& from) noexcept + : OptimizationParameters() { + *this = ::std::move(from); + } + + inline OptimizationParameters& operator=(OptimizationParameters&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const OptimizationParameters& default_instance(); + + enum ParametersCase { + kAdagrad = 3, + kStochasticGradientDescent = 4, + kFtrl = 5, + kAdam = 6, + kMomentum = 8, + kRmsProp = 9, + kCenteredRmsProp = 10, + kMdlAdagradLight = 11, + kAdadelta = 12, + kProximalAdagrad = 14, + PARAMETERS_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OptimizationParameters* internal_default_instance() { + return reinterpret_cast( + &_OptimizationParameters_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void Swap(OptimizationParameters* other); + friend void swap(OptimizationParameters& a, OptimizationParameters& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OptimizationParameters* New() const final { + return CreateMaybeMessage(NULL); + } + + OptimizationParameters* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OptimizationParameters& from); + void MergeFrom(const OptimizationParameters& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OptimizationParameters* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.tpu.ClippingLimits clipping_limits = 2; + bool has_clipping_limits() const; + void clear_clipping_limits(); + static const int kClippingLimitsFieldNumber = 2; + private: + const ::diplomacy::tensorflow::tpu::ClippingLimits& _internal_clipping_limits() const; + public: + const ::diplomacy::tensorflow::tpu::ClippingLimits& clipping_limits() const; + ::diplomacy::tensorflow::tpu::ClippingLimits* release_clipping_limits(); + ::diplomacy::tensorflow::tpu::ClippingLimits* mutable_clipping_limits(); + void set_allocated_clipping_limits(::diplomacy::tensorflow::tpu::ClippingLimits* clipping_limits); + + // .diplomacy.tensorflow.tpu.ClippingLimits gradient_clipping_limits = 7; + bool has_gradient_clipping_limits() const; + void clear_gradient_clipping_limits(); + static const int kGradientClippingLimitsFieldNumber = 7; + private: + const ::diplomacy::tensorflow::tpu::ClippingLimits& _internal_gradient_clipping_limits() const; + public: + const ::diplomacy::tensorflow::tpu::ClippingLimits& gradient_clipping_limits() const; + ::diplomacy::tensorflow::tpu::ClippingLimits* release_gradient_clipping_limits(); + ::diplomacy::tensorflow::tpu::ClippingLimits* mutable_gradient_clipping_limits(); + void set_allocated_gradient_clipping_limits(::diplomacy::tensorflow::tpu::ClippingLimits* gradient_clipping_limits); + + // .diplomacy.tensorflow.tpu.LearningRate learning_rate = 13; + bool has_learning_rate() const; + void clear_learning_rate(); + static const int kLearningRateFieldNumber = 13; + private: + const ::diplomacy::tensorflow::tpu::LearningRate& _internal_learning_rate() const; + public: + const ::diplomacy::tensorflow::tpu::LearningRate& learning_rate() const; + ::diplomacy::tensorflow::tpu::LearningRate* release_learning_rate(); + ::diplomacy::tensorflow::tpu::LearningRate* mutable_learning_rate(); + void set_allocated_learning_rate(::diplomacy::tensorflow::tpu::LearningRate* learning_rate); + + // bool use_gradient_accumulation = 15; + void clear_use_gradient_accumulation(); + static const int kUseGradientAccumulationFieldNumber = 15; + bool use_gradient_accumulation() const; + void set_use_gradient_accumulation(bool value); + + // float weight_decay_factor = 16; + void clear_weight_decay_factor(); + static const int kWeightDecayFactorFieldNumber = 16; + float weight_decay_factor() const; + void set_weight_decay_factor(float value); + + // .diplomacy.tensorflow.tpu.AdagradParameters adagrad = 3; + bool has_adagrad() const; + void clear_adagrad(); + static const int kAdagradFieldNumber = 3; + private: + const ::diplomacy::tensorflow::tpu::AdagradParameters& _internal_adagrad() const; + public: + const ::diplomacy::tensorflow::tpu::AdagradParameters& adagrad() const; + ::diplomacy::tensorflow::tpu::AdagradParameters* release_adagrad(); + ::diplomacy::tensorflow::tpu::AdagradParameters* mutable_adagrad(); + void set_allocated_adagrad(::diplomacy::tensorflow::tpu::AdagradParameters* adagrad); + + // .diplomacy.tensorflow.tpu.StochasticGradientDescentParameters stochastic_gradient_descent = 4; + bool has_stochastic_gradient_descent() const; + void clear_stochastic_gradient_descent(); + static const int kStochasticGradientDescentFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters& _internal_stochastic_gradient_descent() const; + public: + const ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters& stochastic_gradient_descent() const; + ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* release_stochastic_gradient_descent(); + ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* mutable_stochastic_gradient_descent(); + void set_allocated_stochastic_gradient_descent(::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* stochastic_gradient_descent); + + // .diplomacy.tensorflow.tpu.FtrlParameters ftrl = 5; + bool has_ftrl() const; + void clear_ftrl(); + static const int kFtrlFieldNumber = 5; + private: + const ::diplomacy::tensorflow::tpu::FtrlParameters& _internal_ftrl() const; + public: + const ::diplomacy::tensorflow::tpu::FtrlParameters& ftrl() const; + ::diplomacy::tensorflow::tpu::FtrlParameters* release_ftrl(); + ::diplomacy::tensorflow::tpu::FtrlParameters* mutable_ftrl(); + void set_allocated_ftrl(::diplomacy::tensorflow::tpu::FtrlParameters* ftrl); + + // .diplomacy.tensorflow.tpu.AdamParameters adam = 6; + bool has_adam() const; + void clear_adam(); + static const int kAdamFieldNumber = 6; + private: + const ::diplomacy::tensorflow::tpu::AdamParameters& _internal_adam() const; + public: + const ::diplomacy::tensorflow::tpu::AdamParameters& adam() const; + ::diplomacy::tensorflow::tpu::AdamParameters* release_adam(); + ::diplomacy::tensorflow::tpu::AdamParameters* mutable_adam(); + void set_allocated_adam(::diplomacy::tensorflow::tpu::AdamParameters* adam); + + // .diplomacy.tensorflow.tpu.MomentumParameters momentum = 8; + bool has_momentum() const; + void clear_momentum(); + static const int kMomentumFieldNumber = 8; + private: + const ::diplomacy::tensorflow::tpu::MomentumParameters& _internal_momentum() const; + public: + const ::diplomacy::tensorflow::tpu::MomentumParameters& momentum() const; + ::diplomacy::tensorflow::tpu::MomentumParameters* release_momentum(); + ::diplomacy::tensorflow::tpu::MomentumParameters* mutable_momentum(); + void set_allocated_momentum(::diplomacy::tensorflow::tpu::MomentumParameters* momentum); + + // .diplomacy.tensorflow.tpu.RmsPropParameters rms_prop = 9; + bool has_rms_prop() const; + void clear_rms_prop(); + static const int kRmsPropFieldNumber = 9; + private: + const ::diplomacy::tensorflow::tpu::RmsPropParameters& _internal_rms_prop() const; + public: + const ::diplomacy::tensorflow::tpu::RmsPropParameters& rms_prop() const; + ::diplomacy::tensorflow::tpu::RmsPropParameters* release_rms_prop(); + ::diplomacy::tensorflow::tpu::RmsPropParameters* mutable_rms_prop(); + void set_allocated_rms_prop(::diplomacy::tensorflow::tpu::RmsPropParameters* rms_prop); + + // .diplomacy.tensorflow.tpu.CenteredRmsPropParameters centered_rms_prop = 10; + bool has_centered_rms_prop() const; + void clear_centered_rms_prop(); + static const int kCenteredRmsPropFieldNumber = 10; + private: + const ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters& _internal_centered_rms_prop() const; + public: + const ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters& centered_rms_prop() const; + ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* release_centered_rms_prop(); + ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* mutable_centered_rms_prop(); + void set_allocated_centered_rms_prop(::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* centered_rms_prop); + + // .diplomacy.tensorflow.tpu.MdlAdagradLightParameters mdl_adagrad_light = 11; + bool has_mdl_adagrad_light() const; + void clear_mdl_adagrad_light(); + static const int kMdlAdagradLightFieldNumber = 11; + private: + const ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters& _internal_mdl_adagrad_light() const; + public: + const ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters& mdl_adagrad_light() const; + ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* release_mdl_adagrad_light(); + ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* mutable_mdl_adagrad_light(); + void set_allocated_mdl_adagrad_light(::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* mdl_adagrad_light); + + // .diplomacy.tensorflow.tpu.AdadeltaParameters adadelta = 12; + bool has_adadelta() const; + void clear_adadelta(); + static const int kAdadeltaFieldNumber = 12; + private: + const ::diplomacy::tensorflow::tpu::AdadeltaParameters& _internal_adadelta() const; + public: + const ::diplomacy::tensorflow::tpu::AdadeltaParameters& adadelta() const; + ::diplomacy::tensorflow::tpu::AdadeltaParameters* release_adadelta(); + ::diplomacy::tensorflow::tpu::AdadeltaParameters* mutable_adadelta(); + void set_allocated_adadelta(::diplomacy::tensorflow::tpu::AdadeltaParameters* adadelta); + + // .diplomacy.tensorflow.tpu.ProximalAdagradParameters proximal_adagrad = 14; + bool has_proximal_adagrad() const; + void clear_proximal_adagrad(); + static const int kProximalAdagradFieldNumber = 14; + private: + const ::diplomacy::tensorflow::tpu::ProximalAdagradParameters& _internal_proximal_adagrad() const; + public: + const ::diplomacy::tensorflow::tpu::ProximalAdagradParameters& proximal_adagrad() const; + ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* release_proximal_adagrad(); + ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* mutable_proximal_adagrad(); + void set_allocated_proximal_adagrad(::diplomacy::tensorflow::tpu::ProximalAdagradParameters* proximal_adagrad); + + void clear_parameters(); + ParametersCase parameters_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.OptimizationParameters) + private: + void set_has_adagrad(); + void set_has_stochastic_gradient_descent(); + void set_has_ftrl(); + void set_has_adam(); + void set_has_momentum(); + void set_has_rms_prop(); + void set_has_centered_rms_prop(); + void set_has_mdl_adagrad_light(); + void set_has_adadelta(); + void set_has_proximal_adagrad(); + + inline bool has_parameters() const; + inline void clear_has_parameters(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::diplomacy::tensorflow::tpu::ClippingLimits* clipping_limits_; + ::diplomacy::tensorflow::tpu::ClippingLimits* gradient_clipping_limits_; + ::diplomacy::tensorflow::tpu::LearningRate* learning_rate_; + bool use_gradient_accumulation_; + float weight_decay_factor_; + union ParametersUnion { + ParametersUnion() {} + ::diplomacy::tensorflow::tpu::AdagradParameters* adagrad_; + ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* stochastic_gradient_descent_; + ::diplomacy::tensorflow::tpu::FtrlParameters* ftrl_; + ::diplomacy::tensorflow::tpu::AdamParameters* adam_; + ::diplomacy::tensorflow::tpu::MomentumParameters* momentum_; + ::diplomacy::tensorflow::tpu::RmsPropParameters* rms_prop_; + ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* centered_rms_prop_; + ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* mdl_adagrad_light_; + ::diplomacy::tensorflow::tpu::AdadeltaParameters* adadelta_; + ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* proximal_adagrad_; + } parameters_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class StateVariableSpecification_UserDefined : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) */ { + public: + StateVariableSpecification_UserDefined(); + virtual ~StateVariableSpecification_UserDefined(); + + StateVariableSpecification_UserDefined(const StateVariableSpecification_UserDefined& from); + + inline StateVariableSpecification_UserDefined& operator=(const StateVariableSpecification_UserDefined& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + StateVariableSpecification_UserDefined(StateVariableSpecification_UserDefined&& from) noexcept + : StateVariableSpecification_UserDefined() { + *this = ::std::move(from); + } + + inline StateVariableSpecification_UserDefined& operator=(StateVariableSpecification_UserDefined&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const StateVariableSpecification_UserDefined& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StateVariableSpecification_UserDefined* internal_default_instance() { + return reinterpret_cast( + &_StateVariableSpecification_UserDefined_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + void Swap(StateVariableSpecification_UserDefined* other); + friend void swap(StateVariableSpecification_UserDefined& a, StateVariableSpecification_UserDefined& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline StateVariableSpecification_UserDefined* New() const final { + return CreateMaybeMessage(NULL); + } + + StateVariableSpecification_UserDefined* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const StateVariableSpecification_UserDefined& from); + void MergeFrom(const StateVariableSpecification_UserDefined& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StateVariableSpecification_UserDefined* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class StateVariableSpecification_FillWithConstant : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) */ { + public: + StateVariableSpecification_FillWithConstant(); + virtual ~StateVariableSpecification_FillWithConstant(); + + StateVariableSpecification_FillWithConstant(const StateVariableSpecification_FillWithConstant& from); + + inline StateVariableSpecification_FillWithConstant& operator=(const StateVariableSpecification_FillWithConstant& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + StateVariableSpecification_FillWithConstant(StateVariableSpecification_FillWithConstant&& from) noexcept + : StateVariableSpecification_FillWithConstant() { + *this = ::std::move(from); + } + + inline StateVariableSpecification_FillWithConstant& operator=(StateVariableSpecification_FillWithConstant&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const StateVariableSpecification_FillWithConstant& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StateVariableSpecification_FillWithConstant* internal_default_instance() { + return reinterpret_cast( + &_StateVariableSpecification_FillWithConstant_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + void Swap(StateVariableSpecification_FillWithConstant* other); + friend void swap(StateVariableSpecification_FillWithConstant& a, StateVariableSpecification_FillWithConstant& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline StateVariableSpecification_FillWithConstant* New() const final { + return CreateMaybeMessage(NULL); + } + + StateVariableSpecification_FillWithConstant* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const StateVariableSpecification_FillWithConstant& from); + void MergeFrom(const StateVariableSpecification_FillWithConstant& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StateVariableSpecification_FillWithConstant* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // double initial_value = 1; + void clear_initial_value(); + static const int kInitialValueFieldNumber = 1; + double initial_value() const; + void set_initial_value(double value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + double initial_value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class StateVariableSpecification : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.StateVariableSpecification) */ { + public: + StateVariableSpecification(); + virtual ~StateVariableSpecification(); + + StateVariableSpecification(const StateVariableSpecification& from); + + inline StateVariableSpecification& operator=(const StateVariableSpecification& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + StateVariableSpecification(StateVariableSpecification&& from) noexcept + : StateVariableSpecification() { + *this = ::std::move(from); + } + + inline StateVariableSpecification& operator=(StateVariableSpecification&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const StateVariableSpecification& default_instance(); + + enum UsageCase { + kUserDefined = 2, + kFillWithConstant = 3, + USAGE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StateVariableSpecification* internal_default_instance() { + return reinterpret_cast( + &_StateVariableSpecification_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + void Swap(StateVariableSpecification* other); + friend void swap(StateVariableSpecification& a, StateVariableSpecification& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline StateVariableSpecification* New() const final { + return CreateMaybeMessage(NULL); + } + + StateVariableSpecification* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const StateVariableSpecification& from); + void MergeFrom(const StateVariableSpecification& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StateVariableSpecification* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef StateVariableSpecification_UserDefined UserDefined; + typedef StateVariableSpecification_FillWithConstant FillWithConstant; + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined user_defined = 2; + bool has_user_defined() const; + void clear_user_defined(); + static const int kUserDefinedFieldNumber = 2; + private: + const ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined& _internal_user_defined() const; + public: + const ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined& user_defined() const; + ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* release_user_defined(); + ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* mutable_user_defined(); + void set_allocated_user_defined(::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* user_defined); + + // .diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant fill_with_constant = 3; + bool has_fill_with_constant() const; + void clear_fill_with_constant(); + static const int kFillWithConstantFieldNumber = 3; + private: + const ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant& _internal_fill_with_constant() const; + public: + const ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant& fill_with_constant() const; + ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* release_fill_with_constant(); + ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* mutable_fill_with_constant(); + void set_allocated_fill_with_constant(::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* fill_with_constant); + + void clear_usage(); + UsageCase usage_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StateVariableSpecification) + private: + void set_has_user_defined(); + void set_has_fill_with_constant(); + + inline bool has_usage() const; + inline void clear_has_usage(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr name_; + union UsageUnion { + UsageUnion() {} + ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* user_defined_; + ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* fill_with_constant_; + } usage_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ClippingLimits + +// .google.protobuf.FloatValue lower = 1; +inline bool ClippingLimits::has_lower() const { + return this != internal_default_instance() && lower_ != NULL; +} +inline const ::google::protobuf::FloatValue& ClippingLimits::_internal_lower() const { + return *lower_; +} +inline const ::google::protobuf::FloatValue& ClippingLimits::lower() const { + const ::google::protobuf::FloatValue* p = lower_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.ClippingLimits.lower) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_FloatValue_default_instance_); +} +inline ::google::protobuf::FloatValue* ClippingLimits::release_lower() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.ClippingLimits.lower) + + ::google::protobuf::FloatValue* temp = lower_; + lower_ = NULL; + return temp; +} +inline ::google::protobuf::FloatValue* ClippingLimits::mutable_lower() { + + if (lower_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::FloatValue>(GetArenaNoVirtual()); + lower_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.ClippingLimits.lower) + return lower_; +} +inline void ClippingLimits::set_allocated_lower(::google::protobuf::FloatValue* lower) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(lower_); + } + if (lower) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(lower)->GetArena(); + if (message_arena != submessage_arena) { + lower = ::google::protobuf::internal::GetOwnedMessage( + message_arena, lower, submessage_arena); + } + + } else { + + } + lower_ = lower; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.ClippingLimits.lower) +} + +// .google.protobuf.FloatValue upper = 2; +inline bool ClippingLimits::has_upper() const { + return this != internal_default_instance() && upper_ != NULL; +} +inline const ::google::protobuf::FloatValue& ClippingLimits::_internal_upper() const { + return *upper_; +} +inline const ::google::protobuf::FloatValue& ClippingLimits::upper() const { + const ::google::protobuf::FloatValue* p = upper_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.ClippingLimits.upper) + return p != NULL ? *p : *reinterpret_cast( + &::google::protobuf::_FloatValue_default_instance_); +} +inline ::google::protobuf::FloatValue* ClippingLimits::release_upper() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.ClippingLimits.upper) + + ::google::protobuf::FloatValue* temp = upper_; + upper_ = NULL; + return temp; +} +inline ::google::protobuf::FloatValue* ClippingLimits::mutable_upper() { + + if (upper_ == NULL) { + auto* p = CreateMaybeMessage<::google::protobuf::FloatValue>(GetArenaNoVirtual()); + upper_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.ClippingLimits.upper) + return upper_; +} +inline void ClippingLimits::set_allocated_upper(::google::protobuf::FloatValue* upper) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(upper_); + } + if (upper) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(upper)->GetArena(); + if (message_arena != submessage_arena) { + upper = ::google::protobuf::internal::GetOwnedMessage( + message_arena, upper, submessage_arena); + } + + } else { + + } + upper_ = upper; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.ClippingLimits.upper) +} + +// ------------------------------------------------------------------- + +// DynamicLearningRate + +// ------------------------------------------------------------------- + +// LearningRate + +// float constant = 1; +inline bool LearningRate::has_constant() const { + return learning_rate_case() == kConstant; +} +inline void LearningRate::set_has_constant() { + _oneof_case_[0] = kConstant; +} +inline void LearningRate::clear_constant() { + if (has_constant()) { + learning_rate_.constant_ = 0; + clear_has_learning_rate(); + } +} +inline float LearningRate::constant() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.LearningRate.constant) + if (has_constant()) { + return learning_rate_.constant_; + } + return 0; +} +inline void LearningRate::set_constant(float value) { + if (!has_constant()) { + clear_learning_rate(); + set_has_constant(); + } + learning_rate_.constant_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.LearningRate.constant) +} + +// .diplomacy.tensorflow.tpu.DynamicLearningRate dynamic = 2; +inline bool LearningRate::has_dynamic() const { + return learning_rate_case() == kDynamic; +} +inline void LearningRate::set_has_dynamic() { + _oneof_case_[0] = kDynamic; +} +inline void LearningRate::clear_dynamic() { + if (has_dynamic()) { + delete learning_rate_.dynamic_; + clear_has_learning_rate(); + } +} +inline const ::diplomacy::tensorflow::tpu::DynamicLearningRate& LearningRate::_internal_dynamic() const { + return *learning_rate_.dynamic_; +} +inline ::diplomacy::tensorflow::tpu::DynamicLearningRate* LearningRate::release_dynamic() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.LearningRate.dynamic) + if (has_dynamic()) { + clear_has_learning_rate(); + ::diplomacy::tensorflow::tpu::DynamicLearningRate* temp = learning_rate_.dynamic_; + learning_rate_.dynamic_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::DynamicLearningRate& LearningRate::dynamic() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.LearningRate.dynamic) + return has_dynamic() + ? *learning_rate_.dynamic_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::DynamicLearningRate*>(&::diplomacy::tensorflow::tpu::_DynamicLearningRate_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::DynamicLearningRate* LearningRate::mutable_dynamic() { + if (!has_dynamic()) { + clear_learning_rate(); + set_has_dynamic(); + learning_rate_.dynamic_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::DynamicLearningRate >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.LearningRate.dynamic) + return learning_rate_.dynamic_; +} + +inline bool LearningRate::has_learning_rate() const { + return learning_rate_case() != LEARNING_RATE_NOT_SET; +} +inline void LearningRate::clear_has_learning_rate() { + _oneof_case_[0] = LEARNING_RATE_NOT_SET; +} +inline LearningRate::LearningRateCase LearningRate::learning_rate_case() const { + return LearningRate::LearningRateCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// AdagradParameters + +// float initial_accumulator = 1; +inline void AdagradParameters::clear_initial_accumulator() { + initial_accumulator_ = 0; +} +inline float AdagradParameters::initial_accumulator() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdagradParameters.initial_accumulator) + return initial_accumulator_; +} +inline void AdagradParameters::set_initial_accumulator(float value) { + + initial_accumulator_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdagradParameters.initial_accumulator) +} + +// ------------------------------------------------------------------- + +// StochasticGradientDescentParameters + +// ------------------------------------------------------------------- + +// FtrlParameters + +// float l1 = 1; +inline void FtrlParameters::clear_l1() { + l1_ = 0; +} +inline float FtrlParameters::l1() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.FtrlParameters.l1) + return l1_; +} +inline void FtrlParameters::set_l1(float value) { + + l1_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.FtrlParameters.l1) +} + +// float l2 = 2; +inline void FtrlParameters::clear_l2() { + l2_ = 0; +} +inline float FtrlParameters::l2() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.FtrlParameters.l2) + return l2_; +} +inline void FtrlParameters::set_l2(float value) { + + l2_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.FtrlParameters.l2) +} + +// float lr_power = 3; +inline void FtrlParameters::clear_lr_power() { + lr_power_ = 0; +} +inline float FtrlParameters::lr_power() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.FtrlParameters.lr_power) + return lr_power_; +} +inline void FtrlParameters::set_lr_power(float value) { + + lr_power_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.FtrlParameters.lr_power) +} + +// float initial_accum = 4; +inline void FtrlParameters::clear_initial_accum() { + initial_accum_ = 0; +} +inline float FtrlParameters::initial_accum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.FtrlParameters.initial_accum) + return initial_accum_; +} +inline void FtrlParameters::set_initial_accum(float value) { + + initial_accum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.FtrlParameters.initial_accum) +} + +// float initial_linear = 5; +inline void FtrlParameters::clear_initial_linear() { + initial_linear_ = 0; +} +inline float FtrlParameters::initial_linear() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.FtrlParameters.initial_linear) + return initial_linear_; +} +inline void FtrlParameters::set_initial_linear(float value) { + + initial_linear_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.FtrlParameters.initial_linear) +} + +// ------------------------------------------------------------------- + +// AdamParameters + +// float beta1 = 3; +inline void AdamParameters::clear_beta1() { + beta1_ = 0; +} +inline float AdamParameters::beta1() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdamParameters.beta1) + return beta1_; +} +inline void AdamParameters::set_beta1(float value) { + + beta1_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdamParameters.beta1) +} + +// float beta2 = 4; +inline void AdamParameters::clear_beta2() { + beta2_ = 0; +} +inline float AdamParameters::beta2() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdamParameters.beta2) + return beta2_; +} +inline void AdamParameters::set_beta2(float value) { + + beta2_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdamParameters.beta2) +} + +// float epsilon = 5; +inline void AdamParameters::clear_epsilon() { + epsilon_ = 0; +} +inline float AdamParameters::epsilon() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdamParameters.epsilon) + return epsilon_; +} +inline void AdamParameters::set_epsilon(float value) { + + epsilon_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdamParameters.epsilon) +} + +// float initial_m = 6; +inline void AdamParameters::clear_initial_m() { + initial_m_ = 0; +} +inline float AdamParameters::initial_m() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdamParameters.initial_m) + return initial_m_; +} +inline void AdamParameters::set_initial_m(float value) { + + initial_m_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdamParameters.initial_m) +} + +// float initial_v = 7; +inline void AdamParameters::clear_initial_v() { + initial_v_ = 0; +} +inline float AdamParameters::initial_v() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdamParameters.initial_v) + return initial_v_; +} +inline void AdamParameters::set_initial_v(float value) { + + initial_v_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdamParameters.initial_v) +} + +// bool use_non_lazy_adam = 8; +inline void AdamParameters::clear_use_non_lazy_adam() { + use_non_lazy_adam_ = false; +} +inline bool AdamParameters::use_non_lazy_adam() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdamParameters.use_non_lazy_adam) + return use_non_lazy_adam_; +} +inline void AdamParameters::set_use_non_lazy_adam(bool value) { + + use_non_lazy_adam_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdamParameters.use_non_lazy_adam) +} + +// bool use_sum_inside_sqrt = 10; +inline void AdamParameters::clear_use_sum_inside_sqrt() { + use_sum_inside_sqrt_ = false; +} +inline bool AdamParameters::use_sum_inside_sqrt() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdamParameters.use_sum_inside_sqrt) + return use_sum_inside_sqrt_; +} +inline void AdamParameters::set_use_sum_inside_sqrt(bool value) { + + use_sum_inside_sqrt_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdamParameters.use_sum_inside_sqrt) +} + +// ------------------------------------------------------------------- + +// MomentumParameters + +// float momentum = 1; +inline void MomentumParameters::clear_momentum() { + momentum_ = 0; +} +inline float MomentumParameters::momentum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MomentumParameters.momentum) + return momentum_; +} +inline void MomentumParameters::set_momentum(float value) { + + momentum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MomentumParameters.momentum) +} + +// bool use_nesterov = 2; +inline void MomentumParameters::clear_use_nesterov() { + use_nesterov_ = false; +} +inline bool MomentumParameters::use_nesterov() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MomentumParameters.use_nesterov) + return use_nesterov_; +} +inline void MomentumParameters::set_use_nesterov(bool value) { + + use_nesterov_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MomentumParameters.use_nesterov) +} + +// float initial_accum = 3; +inline void MomentumParameters::clear_initial_accum() { + initial_accum_ = 0; +} +inline float MomentumParameters::initial_accum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MomentumParameters.initial_accum) + return initial_accum_; +} +inline void MomentumParameters::set_initial_accum(float value) { + + initial_accum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MomentumParameters.initial_accum) +} + +// ------------------------------------------------------------------- + +// RmsPropParameters + +// float rho = 1; +inline void RmsPropParameters::clear_rho() { + rho_ = 0; +} +inline float RmsPropParameters::rho() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.RmsPropParameters.rho) + return rho_; +} +inline void RmsPropParameters::set_rho(float value) { + + rho_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.RmsPropParameters.rho) +} + +// float momentum = 2; +inline void RmsPropParameters::clear_momentum() { + momentum_ = 0; +} +inline float RmsPropParameters::momentum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.RmsPropParameters.momentum) + return momentum_; +} +inline void RmsPropParameters::set_momentum(float value) { + + momentum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.RmsPropParameters.momentum) +} + +// float epsilon = 3; +inline void RmsPropParameters::clear_epsilon() { + epsilon_ = 0; +} +inline float RmsPropParameters::epsilon() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.RmsPropParameters.epsilon) + return epsilon_; +} +inline void RmsPropParameters::set_epsilon(float value) { + + epsilon_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.RmsPropParameters.epsilon) +} + +// float initial_ms = 4; +inline void RmsPropParameters::clear_initial_ms() { + initial_ms_ = 0; +} +inline float RmsPropParameters::initial_ms() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.RmsPropParameters.initial_ms) + return initial_ms_; +} +inline void RmsPropParameters::set_initial_ms(float value) { + + initial_ms_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.RmsPropParameters.initial_ms) +} + +// float initial_mom = 5; +inline void RmsPropParameters::clear_initial_mom() { + initial_mom_ = 0; +} +inline float RmsPropParameters::initial_mom() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.RmsPropParameters.initial_mom) + return initial_mom_; +} +inline void RmsPropParameters::set_initial_mom(float value) { + + initial_mom_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.RmsPropParameters.initial_mom) +} + +// ------------------------------------------------------------------- + +// CenteredRmsPropParameters + +// float rho = 1; +inline void CenteredRmsPropParameters::clear_rho() { + rho_ = 0; +} +inline float CenteredRmsPropParameters::rho() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.rho) + return rho_; +} +inline void CenteredRmsPropParameters::set_rho(float value) { + + rho_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.rho) +} + +// float momentum = 2; +inline void CenteredRmsPropParameters::clear_momentum() { + momentum_ = 0; +} +inline float CenteredRmsPropParameters::momentum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.momentum) + return momentum_; +} +inline void CenteredRmsPropParameters::set_momentum(float value) { + + momentum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.momentum) +} + +// float epsilon = 3; +inline void CenteredRmsPropParameters::clear_epsilon() { + epsilon_ = 0; +} +inline float CenteredRmsPropParameters::epsilon() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.epsilon) + return epsilon_; +} +inline void CenteredRmsPropParameters::set_epsilon(float value) { + + epsilon_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.epsilon) +} + +// float initial_ms = 4; +inline void CenteredRmsPropParameters::clear_initial_ms() { + initial_ms_ = 0; +} +inline float CenteredRmsPropParameters::initial_ms() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_ms) + return initial_ms_; +} +inline void CenteredRmsPropParameters::set_initial_ms(float value) { + + initial_ms_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_ms) +} + +// float initial_mom = 5; +inline void CenteredRmsPropParameters::clear_initial_mom() { + initial_mom_ = 0; +} +inline float CenteredRmsPropParameters::initial_mom() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_mom) + return initial_mom_; +} +inline void CenteredRmsPropParameters::set_initial_mom(float value) { + + initial_mom_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_mom) +} + +// float initial_mg = 6; +inline void CenteredRmsPropParameters::clear_initial_mg() { + initial_mg_ = 0; +} +inline float CenteredRmsPropParameters::initial_mg() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_mg) + return initial_mg_; +} +inline void CenteredRmsPropParameters::set_initial_mg(float value) { + + initial_mg_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_mg) +} + +// ------------------------------------------------------------------- + +// MdlAdagradLightParameters + +// float l2 = 1; +inline void MdlAdagradLightParameters::clear_l2() { + l2_ = 0; +} +inline float MdlAdagradLightParameters::l2() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.l2) + return l2_; +} +inline void MdlAdagradLightParameters::set_l2(float value) { + + l2_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.l2) +} + +// float lr_power = 2; +inline void MdlAdagradLightParameters::clear_lr_power() { + lr_power_ = 0; +} +inline float MdlAdagradLightParameters::lr_power() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.lr_power) + return lr_power_; +} +inline void MdlAdagradLightParameters::set_lr_power(float value) { + + lr_power_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.lr_power) +} + +// float min_servable_mdl_benefit = 3; +inline void MdlAdagradLightParameters::clear_min_servable_mdl_benefit() { + min_servable_mdl_benefit_ = 0; +} +inline float MdlAdagradLightParameters::min_servable_mdl_benefit() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.min_servable_mdl_benefit) + return min_servable_mdl_benefit_; +} +inline void MdlAdagradLightParameters::set_min_servable_mdl_benefit(float value) { + + min_servable_mdl_benefit_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.min_servable_mdl_benefit) +} + +// float mdl_mix_in_margin = 4; +inline void MdlAdagradLightParameters::clear_mdl_mix_in_margin() { + mdl_mix_in_margin_ = 0; +} +inline float MdlAdagradLightParameters::mdl_mix_in_margin() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_mix_in_margin) + return mdl_mix_in_margin_; +} +inline void MdlAdagradLightParameters::set_mdl_mix_in_margin(float value) { + + mdl_mix_in_margin_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_mix_in_margin) +} + +// float mdl_benefit_rampup_coeff = 5; +inline void MdlAdagradLightParameters::clear_mdl_benefit_rampup_coeff() { + mdl_benefit_rampup_coeff_ = 0; +} +inline float MdlAdagradLightParameters::mdl_benefit_rampup_coeff() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_benefit_rampup_coeff) + return mdl_benefit_rampup_coeff_; +} +inline void MdlAdagradLightParameters::set_mdl_benefit_rampup_coeff(float value) { + + mdl_benefit_rampup_coeff_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_benefit_rampup_coeff) +} + +// float mdl_min_weight = 6; +inline void MdlAdagradLightParameters::clear_mdl_min_weight() { + mdl_min_weight_ = 0; +} +inline float MdlAdagradLightParameters::mdl_min_weight() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_min_weight) + return mdl_min_weight_; +} +inline void MdlAdagradLightParameters::set_mdl_min_weight(float value) { + + mdl_min_weight_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_min_weight) +} + +// float benefit_revisit_scale = 7; +inline void MdlAdagradLightParameters::clear_benefit_revisit_scale() { + benefit_revisit_scale_ = 0; +} +inline float MdlAdagradLightParameters::benefit_revisit_scale() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.benefit_revisit_scale) + return benefit_revisit_scale_; +} +inline void MdlAdagradLightParameters::set_benefit_revisit_scale(float value) { + + benefit_revisit_scale_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.benefit_revisit_scale) +} + +// float max_event_benefit = 8; +inline void MdlAdagradLightParameters::clear_max_event_benefit() { + max_event_benefit_ = 0; +} +inline float MdlAdagradLightParameters::max_event_benefit() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.max_event_benefit) + return max_event_benefit_; +} +inline void MdlAdagradLightParameters::set_max_event_benefit(float value) { + + max_event_benefit_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.max_event_benefit) +} + +// float max_total_benefit = 9; +inline void MdlAdagradLightParameters::clear_max_total_benefit() { + max_total_benefit_ = 0; +} +inline float MdlAdagradLightParameters::max_total_benefit() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.max_total_benefit) + return max_total_benefit_; +} +inline void MdlAdagradLightParameters::set_max_total_benefit(float value) { + + max_total_benefit_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.max_total_benefit) +} + +// float mdl_hard_limit = 10; +inline void MdlAdagradLightParameters::clear_mdl_hard_limit() { + mdl_hard_limit_ = 0; +} +inline float MdlAdagradLightParameters::mdl_hard_limit() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_hard_limit) + return mdl_hard_limit_; +} +inline void MdlAdagradLightParameters::set_mdl_hard_limit(float value) { + + mdl_hard_limit_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_hard_limit) +} + +// bool hard_limit_min_benefit = 11; +inline void MdlAdagradLightParameters::clear_hard_limit_min_benefit() { + hard_limit_min_benefit_ = false; +} +inline bool MdlAdagradLightParameters::hard_limit_min_benefit() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.hard_limit_min_benefit) + return hard_limit_min_benefit_; +} +inline void MdlAdagradLightParameters::set_hard_limit_min_benefit(bool value) { + + hard_limit_min_benefit_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.hard_limit_min_benefit) +} + +// bool mdl_regularize = 12; +inline void MdlAdagradLightParameters::clear_mdl_regularize() { + mdl_regularize_ = false; +} +inline bool MdlAdagradLightParameters::mdl_regularize() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_regularize) + return mdl_regularize_; +} +inline void MdlAdagradLightParameters::set_mdl_regularize(bool value) { + + mdl_regularize_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_regularize) +} + +// float initial_accumulator = 13; +inline void MdlAdagradLightParameters::clear_initial_accumulator() { + initial_accumulator_ = 0; +} +inline float MdlAdagradLightParameters::initial_accumulator() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_accumulator) + return initial_accumulator_; +} +inline void MdlAdagradLightParameters::set_initial_accumulator(float value) { + + initial_accumulator_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_accumulator) +} + +// float initial_weight = 14; +inline void MdlAdagradLightParameters::clear_initial_weight() { + initial_weight_ = 0; +} +inline float MdlAdagradLightParameters::initial_weight() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_weight) + return initial_weight_; +} +inline void MdlAdagradLightParameters::set_initial_weight(float value) { + + initial_weight_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_weight) +} + +// float initial_benefit = 15; +inline void MdlAdagradLightParameters::clear_initial_benefit() { + initial_benefit_ = 0; +} +inline float MdlAdagradLightParameters::initial_benefit() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_benefit) + return initial_benefit_; +} +inline void MdlAdagradLightParameters::set_initial_benefit(float value) { + + initial_benefit_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_benefit) +} + +// ------------------------------------------------------------------- + +// AdadeltaParameters + +// float rho = 1; +inline void AdadeltaParameters::clear_rho() { + rho_ = 0; +} +inline float AdadeltaParameters::rho() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdadeltaParameters.rho) + return rho_; +} +inline void AdadeltaParameters::set_rho(float value) { + + rho_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdadeltaParameters.rho) +} + +// float epsilon = 2; +inline void AdadeltaParameters::clear_epsilon() { + epsilon_ = 0; +} +inline float AdadeltaParameters::epsilon() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdadeltaParameters.epsilon) + return epsilon_; +} +inline void AdadeltaParameters::set_epsilon(float value) { + + epsilon_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdadeltaParameters.epsilon) +} + +// float initial_accumulator = 3; +inline void AdadeltaParameters::clear_initial_accumulator() { + initial_accumulator_ = 0; +} +inline float AdadeltaParameters::initial_accumulator() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdadeltaParameters.initial_accumulator) + return initial_accumulator_; +} +inline void AdadeltaParameters::set_initial_accumulator(float value) { + + initial_accumulator_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdadeltaParameters.initial_accumulator) +} + +// float initial_update = 4; +inline void AdadeltaParameters::clear_initial_update() { + initial_update_ = 0; +} +inline float AdadeltaParameters::initial_update() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.AdadeltaParameters.initial_update) + return initial_update_; +} +inline void AdadeltaParameters::set_initial_update(float value) { + + initial_update_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.AdadeltaParameters.initial_update) +} + +// ------------------------------------------------------------------- + +// ProximalAdagradParameters + +// float l1 = 1; +inline void ProximalAdagradParameters::clear_l1() { + l1_ = 0; +} +inline float ProximalAdagradParameters::l1() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.ProximalAdagradParameters.l1) + return l1_; +} +inline void ProximalAdagradParameters::set_l1(float value) { + + l1_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.ProximalAdagradParameters.l1) +} + +// float l2 = 2; +inline void ProximalAdagradParameters::clear_l2() { + l2_ = 0; +} +inline float ProximalAdagradParameters::l2() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.ProximalAdagradParameters.l2) + return l2_; +} +inline void ProximalAdagradParameters::set_l2(float value) { + + l2_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.ProximalAdagradParameters.l2) +} + +// float initial_accumulator = 3; +inline void ProximalAdagradParameters::clear_initial_accumulator() { + initial_accumulator_ = 0; +} +inline float ProximalAdagradParameters::initial_accumulator() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.ProximalAdagradParameters.initial_accumulator) + return initial_accumulator_; +} +inline void ProximalAdagradParameters::set_initial_accumulator(float value) { + + initial_accumulator_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.ProximalAdagradParameters.initial_accumulator) +} + +// ------------------------------------------------------------------- + +// OptimizationParameters + +// .diplomacy.tensorflow.tpu.LearningRate learning_rate = 13; +inline bool OptimizationParameters::has_learning_rate() const { + return this != internal_default_instance() && learning_rate_ != NULL; +} +inline void OptimizationParameters::clear_learning_rate() { + if (GetArenaNoVirtual() == NULL && learning_rate_ != NULL) { + delete learning_rate_; + } + learning_rate_ = NULL; +} +inline const ::diplomacy::tensorflow::tpu::LearningRate& OptimizationParameters::_internal_learning_rate() const { + return *learning_rate_; +} +inline const ::diplomacy::tensorflow::tpu::LearningRate& OptimizationParameters::learning_rate() const { + const ::diplomacy::tensorflow::tpu::LearningRate* p = learning_rate_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.learning_rate) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::_LearningRate_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::LearningRate* OptimizationParameters::release_learning_rate() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.learning_rate) + + ::diplomacy::tensorflow::tpu::LearningRate* temp = learning_rate_; + learning_rate_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::LearningRate* OptimizationParameters::mutable_learning_rate() { + + if (learning_rate_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::LearningRate>(GetArenaNoVirtual()); + learning_rate_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.learning_rate) + return learning_rate_; +} +inline void OptimizationParameters::set_allocated_learning_rate(::diplomacy::tensorflow::tpu::LearningRate* learning_rate) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete learning_rate_; + } + if (learning_rate) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + learning_rate = ::google::protobuf::internal::GetOwnedMessage( + message_arena, learning_rate, submessage_arena); + } + + } else { + + } + learning_rate_ = learning_rate; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.learning_rate) +} + +// .diplomacy.tensorflow.tpu.ClippingLimits clipping_limits = 2; +inline bool OptimizationParameters::has_clipping_limits() const { + return this != internal_default_instance() && clipping_limits_ != NULL; +} +inline void OptimizationParameters::clear_clipping_limits() { + if (GetArenaNoVirtual() == NULL && clipping_limits_ != NULL) { + delete clipping_limits_; + } + clipping_limits_ = NULL; +} +inline const ::diplomacy::tensorflow::tpu::ClippingLimits& OptimizationParameters::_internal_clipping_limits() const { + return *clipping_limits_; +} +inline const ::diplomacy::tensorflow::tpu::ClippingLimits& OptimizationParameters::clipping_limits() const { + const ::diplomacy::tensorflow::tpu::ClippingLimits* p = clipping_limits_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.clipping_limits) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::_ClippingLimits_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::ClippingLimits* OptimizationParameters::release_clipping_limits() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.clipping_limits) + + ::diplomacy::tensorflow::tpu::ClippingLimits* temp = clipping_limits_; + clipping_limits_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::ClippingLimits* OptimizationParameters::mutable_clipping_limits() { + + if (clipping_limits_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::ClippingLimits>(GetArenaNoVirtual()); + clipping_limits_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.clipping_limits) + return clipping_limits_; +} +inline void OptimizationParameters::set_allocated_clipping_limits(::diplomacy::tensorflow::tpu::ClippingLimits* clipping_limits) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete clipping_limits_; + } + if (clipping_limits) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + clipping_limits = ::google::protobuf::internal::GetOwnedMessage( + message_arena, clipping_limits, submessage_arena); + } + + } else { + + } + clipping_limits_ = clipping_limits; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.clipping_limits) +} + +// .diplomacy.tensorflow.tpu.ClippingLimits gradient_clipping_limits = 7; +inline bool OptimizationParameters::has_gradient_clipping_limits() const { + return this != internal_default_instance() && gradient_clipping_limits_ != NULL; +} +inline void OptimizationParameters::clear_gradient_clipping_limits() { + if (GetArenaNoVirtual() == NULL && gradient_clipping_limits_ != NULL) { + delete gradient_clipping_limits_; + } + gradient_clipping_limits_ = NULL; +} +inline const ::diplomacy::tensorflow::tpu::ClippingLimits& OptimizationParameters::_internal_gradient_clipping_limits() const { + return *gradient_clipping_limits_; +} +inline const ::diplomacy::tensorflow::tpu::ClippingLimits& OptimizationParameters::gradient_clipping_limits() const { + const ::diplomacy::tensorflow::tpu::ClippingLimits* p = gradient_clipping_limits_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.gradient_clipping_limits) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::_ClippingLimits_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::ClippingLimits* OptimizationParameters::release_gradient_clipping_limits() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.gradient_clipping_limits) + + ::diplomacy::tensorflow::tpu::ClippingLimits* temp = gradient_clipping_limits_; + gradient_clipping_limits_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::ClippingLimits* OptimizationParameters::mutable_gradient_clipping_limits() { + + if (gradient_clipping_limits_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::ClippingLimits>(GetArenaNoVirtual()); + gradient_clipping_limits_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.gradient_clipping_limits) + return gradient_clipping_limits_; +} +inline void OptimizationParameters::set_allocated_gradient_clipping_limits(::diplomacy::tensorflow::tpu::ClippingLimits* gradient_clipping_limits) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete gradient_clipping_limits_; + } + if (gradient_clipping_limits) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + gradient_clipping_limits = ::google::protobuf::internal::GetOwnedMessage( + message_arena, gradient_clipping_limits, submessage_arena); + } + + } else { + + } + gradient_clipping_limits_ = gradient_clipping_limits; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.OptimizationParameters.gradient_clipping_limits) +} + +// float weight_decay_factor = 16; +inline void OptimizationParameters::clear_weight_decay_factor() { + weight_decay_factor_ = 0; +} +inline float OptimizationParameters::weight_decay_factor() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.weight_decay_factor) + return weight_decay_factor_; +} +inline void OptimizationParameters::set_weight_decay_factor(float value) { + + weight_decay_factor_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.OptimizationParameters.weight_decay_factor) +} + +// bool use_gradient_accumulation = 15; +inline void OptimizationParameters::clear_use_gradient_accumulation() { + use_gradient_accumulation_ = false; +} +inline bool OptimizationParameters::use_gradient_accumulation() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.use_gradient_accumulation) + return use_gradient_accumulation_; +} +inline void OptimizationParameters::set_use_gradient_accumulation(bool value) { + + use_gradient_accumulation_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.OptimizationParameters.use_gradient_accumulation) +} + +// .diplomacy.tensorflow.tpu.AdagradParameters adagrad = 3; +inline bool OptimizationParameters::has_adagrad() const { + return parameters_case() == kAdagrad; +} +inline void OptimizationParameters::set_has_adagrad() { + _oneof_case_[0] = kAdagrad; +} +inline void OptimizationParameters::clear_adagrad() { + if (has_adagrad()) { + delete parameters_.adagrad_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::AdagradParameters& OptimizationParameters::_internal_adagrad() const { + return *parameters_.adagrad_; +} +inline ::diplomacy::tensorflow::tpu::AdagradParameters* OptimizationParameters::release_adagrad() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.adagrad) + if (has_adagrad()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::AdagradParameters* temp = parameters_.adagrad_; + parameters_.adagrad_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::AdagradParameters& OptimizationParameters::adagrad() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.adagrad) + return has_adagrad() + ? *parameters_.adagrad_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::AdagradParameters*>(&::diplomacy::tensorflow::tpu::_AdagradParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::AdagradParameters* OptimizationParameters::mutable_adagrad() { + if (!has_adagrad()) { + clear_parameters(); + set_has_adagrad(); + parameters_.adagrad_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::AdagradParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.adagrad) + return parameters_.adagrad_; +} + +// .diplomacy.tensorflow.tpu.StochasticGradientDescentParameters stochastic_gradient_descent = 4; +inline bool OptimizationParameters::has_stochastic_gradient_descent() const { + return parameters_case() == kStochasticGradientDescent; +} +inline void OptimizationParameters::set_has_stochastic_gradient_descent() { + _oneof_case_[0] = kStochasticGradientDescent; +} +inline void OptimizationParameters::clear_stochastic_gradient_descent() { + if (has_stochastic_gradient_descent()) { + delete parameters_.stochastic_gradient_descent_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters& OptimizationParameters::_internal_stochastic_gradient_descent() const { + return *parameters_.stochastic_gradient_descent_; +} +inline ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* OptimizationParameters::release_stochastic_gradient_descent() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.stochastic_gradient_descent) + if (has_stochastic_gradient_descent()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* temp = parameters_.stochastic_gradient_descent_; + parameters_.stochastic_gradient_descent_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters& OptimizationParameters::stochastic_gradient_descent() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.stochastic_gradient_descent) + return has_stochastic_gradient_descent() + ? *parameters_.stochastic_gradient_descent_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters*>(&::diplomacy::tensorflow::tpu::_StochasticGradientDescentParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters* OptimizationParameters::mutable_stochastic_gradient_descent() { + if (!has_stochastic_gradient_descent()) { + clear_parameters(); + set_has_stochastic_gradient_descent(); + parameters_.stochastic_gradient_descent_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::StochasticGradientDescentParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.stochastic_gradient_descent) + return parameters_.stochastic_gradient_descent_; +} + +// .diplomacy.tensorflow.tpu.FtrlParameters ftrl = 5; +inline bool OptimizationParameters::has_ftrl() const { + return parameters_case() == kFtrl; +} +inline void OptimizationParameters::set_has_ftrl() { + _oneof_case_[0] = kFtrl; +} +inline void OptimizationParameters::clear_ftrl() { + if (has_ftrl()) { + delete parameters_.ftrl_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::FtrlParameters& OptimizationParameters::_internal_ftrl() const { + return *parameters_.ftrl_; +} +inline ::diplomacy::tensorflow::tpu::FtrlParameters* OptimizationParameters::release_ftrl() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.ftrl) + if (has_ftrl()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::FtrlParameters* temp = parameters_.ftrl_; + parameters_.ftrl_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::FtrlParameters& OptimizationParameters::ftrl() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.ftrl) + return has_ftrl() + ? *parameters_.ftrl_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::FtrlParameters*>(&::diplomacy::tensorflow::tpu::_FtrlParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::FtrlParameters* OptimizationParameters::mutable_ftrl() { + if (!has_ftrl()) { + clear_parameters(); + set_has_ftrl(); + parameters_.ftrl_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::FtrlParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.ftrl) + return parameters_.ftrl_; +} + +// .diplomacy.tensorflow.tpu.AdamParameters adam = 6; +inline bool OptimizationParameters::has_adam() const { + return parameters_case() == kAdam; +} +inline void OptimizationParameters::set_has_adam() { + _oneof_case_[0] = kAdam; +} +inline void OptimizationParameters::clear_adam() { + if (has_adam()) { + delete parameters_.adam_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::AdamParameters& OptimizationParameters::_internal_adam() const { + return *parameters_.adam_; +} +inline ::diplomacy::tensorflow::tpu::AdamParameters* OptimizationParameters::release_adam() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.adam) + if (has_adam()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::AdamParameters* temp = parameters_.adam_; + parameters_.adam_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::AdamParameters& OptimizationParameters::adam() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.adam) + return has_adam() + ? *parameters_.adam_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::AdamParameters*>(&::diplomacy::tensorflow::tpu::_AdamParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::AdamParameters* OptimizationParameters::mutable_adam() { + if (!has_adam()) { + clear_parameters(); + set_has_adam(); + parameters_.adam_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::AdamParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.adam) + return parameters_.adam_; +} + +// .diplomacy.tensorflow.tpu.MomentumParameters momentum = 8; +inline bool OptimizationParameters::has_momentum() const { + return parameters_case() == kMomentum; +} +inline void OptimizationParameters::set_has_momentum() { + _oneof_case_[0] = kMomentum; +} +inline void OptimizationParameters::clear_momentum() { + if (has_momentum()) { + delete parameters_.momentum_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::MomentumParameters& OptimizationParameters::_internal_momentum() const { + return *parameters_.momentum_; +} +inline ::diplomacy::tensorflow::tpu::MomentumParameters* OptimizationParameters::release_momentum() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.momentum) + if (has_momentum()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::MomentumParameters* temp = parameters_.momentum_; + parameters_.momentum_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::MomentumParameters& OptimizationParameters::momentum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.momentum) + return has_momentum() + ? *parameters_.momentum_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::MomentumParameters*>(&::diplomacy::tensorflow::tpu::_MomentumParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::MomentumParameters* OptimizationParameters::mutable_momentum() { + if (!has_momentum()) { + clear_parameters(); + set_has_momentum(); + parameters_.momentum_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::MomentumParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.momentum) + return parameters_.momentum_; +} + +// .diplomacy.tensorflow.tpu.RmsPropParameters rms_prop = 9; +inline bool OptimizationParameters::has_rms_prop() const { + return parameters_case() == kRmsProp; +} +inline void OptimizationParameters::set_has_rms_prop() { + _oneof_case_[0] = kRmsProp; +} +inline void OptimizationParameters::clear_rms_prop() { + if (has_rms_prop()) { + delete parameters_.rms_prop_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::RmsPropParameters& OptimizationParameters::_internal_rms_prop() const { + return *parameters_.rms_prop_; +} +inline ::diplomacy::tensorflow::tpu::RmsPropParameters* OptimizationParameters::release_rms_prop() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.rms_prop) + if (has_rms_prop()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::RmsPropParameters* temp = parameters_.rms_prop_; + parameters_.rms_prop_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::RmsPropParameters& OptimizationParameters::rms_prop() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.rms_prop) + return has_rms_prop() + ? *parameters_.rms_prop_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::RmsPropParameters*>(&::diplomacy::tensorflow::tpu::_RmsPropParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::RmsPropParameters* OptimizationParameters::mutable_rms_prop() { + if (!has_rms_prop()) { + clear_parameters(); + set_has_rms_prop(); + parameters_.rms_prop_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::RmsPropParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.rms_prop) + return parameters_.rms_prop_; +} + +// .diplomacy.tensorflow.tpu.CenteredRmsPropParameters centered_rms_prop = 10; +inline bool OptimizationParameters::has_centered_rms_prop() const { + return parameters_case() == kCenteredRmsProp; +} +inline void OptimizationParameters::set_has_centered_rms_prop() { + _oneof_case_[0] = kCenteredRmsProp; +} +inline void OptimizationParameters::clear_centered_rms_prop() { + if (has_centered_rms_prop()) { + delete parameters_.centered_rms_prop_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters& OptimizationParameters::_internal_centered_rms_prop() const { + return *parameters_.centered_rms_prop_; +} +inline ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* OptimizationParameters::release_centered_rms_prop() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.centered_rms_prop) + if (has_centered_rms_prop()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* temp = parameters_.centered_rms_prop_; + parameters_.centered_rms_prop_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters& OptimizationParameters::centered_rms_prop() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.centered_rms_prop) + return has_centered_rms_prop() + ? *parameters_.centered_rms_prop_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters*>(&::diplomacy::tensorflow::tpu::_CenteredRmsPropParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters* OptimizationParameters::mutable_centered_rms_prop() { + if (!has_centered_rms_prop()) { + clear_parameters(); + set_has_centered_rms_prop(); + parameters_.centered_rms_prop_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::CenteredRmsPropParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.centered_rms_prop) + return parameters_.centered_rms_prop_; +} + +// .diplomacy.tensorflow.tpu.MdlAdagradLightParameters mdl_adagrad_light = 11; +inline bool OptimizationParameters::has_mdl_adagrad_light() const { + return parameters_case() == kMdlAdagradLight; +} +inline void OptimizationParameters::set_has_mdl_adagrad_light() { + _oneof_case_[0] = kMdlAdagradLight; +} +inline void OptimizationParameters::clear_mdl_adagrad_light() { + if (has_mdl_adagrad_light()) { + delete parameters_.mdl_adagrad_light_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters& OptimizationParameters::_internal_mdl_adagrad_light() const { + return *parameters_.mdl_adagrad_light_; +} +inline ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* OptimizationParameters::release_mdl_adagrad_light() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.mdl_adagrad_light) + if (has_mdl_adagrad_light()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* temp = parameters_.mdl_adagrad_light_; + parameters_.mdl_adagrad_light_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters& OptimizationParameters::mdl_adagrad_light() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.mdl_adagrad_light) + return has_mdl_adagrad_light() + ? *parameters_.mdl_adagrad_light_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters*>(&::diplomacy::tensorflow::tpu::_MdlAdagradLightParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters* OptimizationParameters::mutable_mdl_adagrad_light() { + if (!has_mdl_adagrad_light()) { + clear_parameters(); + set_has_mdl_adagrad_light(); + parameters_.mdl_adagrad_light_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::MdlAdagradLightParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.mdl_adagrad_light) + return parameters_.mdl_adagrad_light_; +} + +// .diplomacy.tensorflow.tpu.AdadeltaParameters adadelta = 12; +inline bool OptimizationParameters::has_adadelta() const { + return parameters_case() == kAdadelta; +} +inline void OptimizationParameters::set_has_adadelta() { + _oneof_case_[0] = kAdadelta; +} +inline void OptimizationParameters::clear_adadelta() { + if (has_adadelta()) { + delete parameters_.adadelta_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::AdadeltaParameters& OptimizationParameters::_internal_adadelta() const { + return *parameters_.adadelta_; +} +inline ::diplomacy::tensorflow::tpu::AdadeltaParameters* OptimizationParameters::release_adadelta() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.adadelta) + if (has_adadelta()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::AdadeltaParameters* temp = parameters_.adadelta_; + parameters_.adadelta_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::AdadeltaParameters& OptimizationParameters::adadelta() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.adadelta) + return has_adadelta() + ? *parameters_.adadelta_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::AdadeltaParameters*>(&::diplomacy::tensorflow::tpu::_AdadeltaParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::AdadeltaParameters* OptimizationParameters::mutable_adadelta() { + if (!has_adadelta()) { + clear_parameters(); + set_has_adadelta(); + parameters_.adadelta_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::AdadeltaParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.adadelta) + return parameters_.adadelta_; +} + +// .diplomacy.tensorflow.tpu.ProximalAdagradParameters proximal_adagrad = 14; +inline bool OptimizationParameters::has_proximal_adagrad() const { + return parameters_case() == kProximalAdagrad; +} +inline void OptimizationParameters::set_has_proximal_adagrad() { + _oneof_case_[0] = kProximalAdagrad; +} +inline void OptimizationParameters::clear_proximal_adagrad() { + if (has_proximal_adagrad()) { + delete parameters_.proximal_adagrad_; + clear_has_parameters(); + } +} +inline const ::diplomacy::tensorflow::tpu::ProximalAdagradParameters& OptimizationParameters::_internal_proximal_adagrad() const { + return *parameters_.proximal_adagrad_; +} +inline ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* OptimizationParameters::release_proximal_adagrad() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.OptimizationParameters.proximal_adagrad) + if (has_proximal_adagrad()) { + clear_has_parameters(); + ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* temp = parameters_.proximal_adagrad_; + parameters_.proximal_adagrad_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::ProximalAdagradParameters& OptimizationParameters::proximal_adagrad() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.OptimizationParameters.proximal_adagrad) + return has_proximal_adagrad() + ? *parameters_.proximal_adagrad_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::ProximalAdagradParameters*>(&::diplomacy::tensorflow::tpu::_ProximalAdagradParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::ProximalAdagradParameters* OptimizationParameters::mutable_proximal_adagrad() { + if (!has_proximal_adagrad()) { + clear_parameters(); + set_has_proximal_adagrad(); + parameters_.proximal_adagrad_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::ProximalAdagradParameters >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.OptimizationParameters.proximal_adagrad) + return parameters_.proximal_adagrad_; +} + +inline bool OptimizationParameters::has_parameters() const { + return parameters_case() != PARAMETERS_NOT_SET; +} +inline void OptimizationParameters::clear_has_parameters() { + _oneof_case_[0] = PARAMETERS_NOT_SET; +} +inline OptimizationParameters::ParametersCase OptimizationParameters::parameters_case() const { + return OptimizationParameters::ParametersCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// StateVariableSpecification_UserDefined + +// ------------------------------------------------------------------- + +// StateVariableSpecification_FillWithConstant + +// double initial_value = 1; +inline void StateVariableSpecification_FillWithConstant::clear_initial_value() { + initial_value_ = 0; +} +inline double StateVariableSpecification_FillWithConstant::initial_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant.initial_value) + return initial_value_; +} +inline void StateVariableSpecification_FillWithConstant::set_initial_value(double value) { + + initial_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant.initial_value) +} + +// ------------------------------------------------------------------- + +// StateVariableSpecification + +// string name = 1; +inline void StateVariableSpecification::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& StateVariableSpecification::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.StateVariableSpecification.name) + return name_.GetNoArena(); +} +inline void StateVariableSpecification::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.StateVariableSpecification.name) +} +#if LANG_CXX11 +inline void StateVariableSpecification::set_name(::std::string&& value) { + + name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.StateVariableSpecification.name) +} +#endif +inline void StateVariableSpecification::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.StateVariableSpecification.name) +} +inline void StateVariableSpecification::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.StateVariableSpecification.name) +} +inline ::std::string* StateVariableSpecification::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.StateVariableSpecification.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* StateVariableSpecification::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.StateVariableSpecification.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void StateVariableSpecification::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.StateVariableSpecification.name) +} + +// .diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined user_defined = 2; +inline bool StateVariableSpecification::has_user_defined() const { + return usage_case() == kUserDefined; +} +inline void StateVariableSpecification::set_has_user_defined() { + _oneof_case_[0] = kUserDefined; +} +inline void StateVariableSpecification::clear_user_defined() { + if (has_user_defined()) { + delete usage_.user_defined_; + clear_has_usage(); + } +} +inline const ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined& StateVariableSpecification::_internal_user_defined() const { + return *usage_.user_defined_; +} +inline ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* StateVariableSpecification::release_user_defined() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.StateVariableSpecification.user_defined) + if (has_user_defined()) { + clear_has_usage(); + ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* temp = usage_.user_defined_; + usage_.user_defined_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined& StateVariableSpecification::user_defined() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.StateVariableSpecification.user_defined) + return has_user_defined() + ? *usage_.user_defined_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined*>(&::diplomacy::tensorflow::tpu::_StateVariableSpecification_UserDefined_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined* StateVariableSpecification::mutable_user_defined() { + if (!has_user_defined()) { + clear_usage(); + set_has_user_defined(); + usage_.user_defined_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::StateVariableSpecification_UserDefined >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.StateVariableSpecification.user_defined) + return usage_.user_defined_; +} + +// .diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant fill_with_constant = 3; +inline bool StateVariableSpecification::has_fill_with_constant() const { + return usage_case() == kFillWithConstant; +} +inline void StateVariableSpecification::set_has_fill_with_constant() { + _oneof_case_[0] = kFillWithConstant; +} +inline void StateVariableSpecification::clear_fill_with_constant() { + if (has_fill_with_constant()) { + delete usage_.fill_with_constant_; + clear_has_usage(); + } +} +inline const ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant& StateVariableSpecification::_internal_fill_with_constant() const { + return *usage_.fill_with_constant_; +} +inline ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* StateVariableSpecification::release_fill_with_constant() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.StateVariableSpecification.fill_with_constant) + if (has_fill_with_constant()) { + clear_has_usage(); + ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* temp = usage_.fill_with_constant_; + usage_.fill_with_constant_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant& StateVariableSpecification::fill_with_constant() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.StateVariableSpecification.fill_with_constant) + return has_fill_with_constant() + ? *usage_.fill_with_constant_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant*>(&::diplomacy::tensorflow::tpu::_StateVariableSpecification_FillWithConstant_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant* StateVariableSpecification::mutable_fill_with_constant() { + if (!has_fill_with_constant()) { + clear_usage(); + set_has_fill_with_constant(); + usage_.fill_with_constant_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::StateVariableSpecification_FillWithConstant >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.StateVariableSpecification.fill_with_constant) + return usage_.fill_with_constant_; +} + +inline bool StateVariableSpecification::has_usage() const { + return usage_case() != USAGE_NOT_SET; +} +inline void StateVariableSpecification::clear_has_usage() { + _oneof_case_[0] = USAGE_NOT_SET; +} +inline StateVariableSpecification::UsageCase StateVariableSpecification::usage_case() const { + return StateVariableSpecification::UsageCase(_oneof_case_[0]); +} +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto new file mode 100644 index 0000000..7d6df4c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto @@ -0,0 +1,211 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tpu; + +import "google/protobuf/wrappers.proto"; + +message ClippingLimits { + google.protobuf.FloatValue lower = 1; // -inf if not set + google.protobuf.FloatValue upper = 2; // +inf if not set +} + +// Get the learning rate from the parameters of the SendTPUEmbeddingGradients +// op. +message DynamicLearningRate { +} + +// Source of learning rate to use. +message LearningRate { + oneof learning_rate { + float constant = 1; + DynamicLearningRate dynamic = 2; + } +} + +// Each optimizer's parameter proto has a link to its documentation and CPU +// implementation (if available) for user reference. + +// https://www.tensorflow.org/api_docs/python/tf/train/AdagradOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L151 +message AdagradParameters { + float initial_accumulator = 1; +} + +// https://www.tensorflow.org/api_docs/python/tf/train/GradientDescentOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L423 +message StochasticGradientDescentParameters { +} + +// https://www.tensorflow.org/api_docs/python/tf/train/FtrlOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L192 +message FtrlParameters { + float l1 = 1; + float l2 = 2; + float lr_power = 3; + float initial_accum = 4; + float initial_linear = 5; +} + +// The Adam optimizer does not implement hyper-parameter update; use the dynamic +// learning rate feature instead, setting the learning rate to: +// user learning_rate * sqrt(1 - beta2^t) / (1 - beta1^t) +// Here, t is the current timestep. +// +// https://www.tensorflow.org/api_docs/python/tf/train/AdamOptimizer +// https://github.com/tensorflow/tensorflow/blob/ab51450c817674c8ff08a7ae4f8ac50cdc4bed8b/tensorflow/python/training/adam.py#L54 +// +// Note that the code by default implements the lazy version of Adam +// (https://www.tensorflow.org/api_docs/python/tf/contrib/opt/LazyAdamOptimizer) +// unless the use_non_lazy_adam parameter is set, in which case it implements +// the normal version of Adam that updates all parameters in the embedding +// table, even for entries that are not used in the current minibatch +// (https://www.tensorflow.org/api_docs/python/tf/contrib/opt/AdamOptimizer). If +// use_non_lazy_adam is enabled, use_gradient_accumulation is also required in +// order to get correct results; a warning will be printed otherwise (which may +// change to an error in the future). If use_sum_inside_sqrt is set, the Adam +// variable update formula will be changed from m / (sqrt(v) + epsilon) to +// m / sqrt(v + epsilon**2); this option improves the performance of TPU +// training and is not expected to harm model quality. +message AdamParameters { + float beta1 = 3; + float beta2 = 4; + float epsilon = 5; + float initial_m = 6; + float initial_v = 7; + bool use_non_lazy_adam = 8; + bool use_sum_inside_sqrt = 10; +} + +// https://www.tensorflow.org/api_docs/python/tf/train/MomentumOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L271 +message MomentumParameters { + float momentum = 1; + bool use_nesterov = 2; + float initial_accum = 3; +} + +// https://www.tensorflow.org/api_docs/python/tf/train/RMSPropOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L356 +message RmsPropParameters { + float rho = 1; + float momentum = 2; + float epsilon = 3; + float initial_ms = 4; + float initial_mom = 5; +} + +// https://www.tensorflow.org/api_docs/python/tf/train/RMSPropOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L372 +message CenteredRmsPropParameters { + float rho = 1; + float momentum = 2; + float epsilon = 3; + float initial_ms = 4; + float initial_mom = 5; + float initial_mg = 6; +} + +// Variant of algorithm in http://proceedings.mlr.press/v44/shamir15.pdf +message MdlAdagradLightParameters { + float l2 = 1; + float lr_power = 2; + float min_servable_mdl_benefit = 3; + float mdl_mix_in_margin = 4; + float mdl_benefit_rampup_coeff = 5; + float mdl_min_weight = 6; + float benefit_revisit_scale = 7; + float max_event_benefit = 8; + float max_total_benefit = 9; + float mdl_hard_limit = 10; + bool hard_limit_min_benefit = 11; + bool mdl_regularize = 12; + float initial_accumulator = 13; + float initial_weight = 14; + float initial_benefit = 15; +} + +// https://www.tensorflow.org/api_docs/python/tf/train/RMSPropOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L68 +message AdadeltaParameters { + float rho = 1; + float epsilon = 2; + float initial_accumulator = 3; + float initial_update = 4; +} + +// https://www.tensorflow.org/api_docs/python/tf/train/RMSPropOptimizer +// https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/core/kernels/training_ops.cc#L164 +message ProximalAdagradParameters { + float l1 = 1; + float l2 = 2; + float initial_accumulator = 3; +} + +message OptimizationParameters { + // Learning rate used for updating the embedding layer parameters. + LearningRate learning_rate = 13; + reserved 1; // Old learning rate tag. + + // Limits to which to clip the weight values after the backward pass; not + // present means no limits are applied. + ClippingLimits clipping_limits = 2; + + // Limits to which to clip the backward pass gradient before using it for + // updates; not present means no limits are applied. + ClippingLimits gradient_clipping_limits = 7; + + // Amount of weight decay to apply; see weight_decay_optimizers.py for + // details. Almost all optimizers are supported with this option (MDL Adagrad + // Light does not work, and SGD does not behave as expected if it is enabled). + // Although there is no check, users who want weight decay will probably also + // want to enable gradient accumulation as well so that the decay will happen + // once per minibatch. + float weight_decay_factor = 16; + + // Whether to use gradient accumulation (do two passes over the input + // gradients: one to accumulate them into a temporary array and another to + // apply them using the actual optimization algorithm). This feature is + // experimental -- it has not been fully verified and may cause training + // crashes and/or failures. + bool use_gradient_accumulation = 15; + + // Optimization algorithm parameters; which field is selected determines which + // algorithm to use. + oneof parameters { + AdagradParameters adagrad = 3; + StochasticGradientDescentParameters stochastic_gradient_descent = 4; + FtrlParameters ftrl = 5; + AdamParameters adam = 6; + MomentumParameters momentum = 8; + RmsPropParameters rms_prop = 9; + CenteredRmsPropParameters centered_rms_prop = 10; + MdlAdagradLightParameters mdl_adagrad_light = 11; + AdadeltaParameters adadelta = 12; + ProximalAdagradParameters proximal_adagrad = 14; + } +} + +// Specification of an optimization algorithm's state variables (both the main +// value vector and any extra accumulators, etc.). +message StateVariableSpecification { + // Parameter name for the state variable. + string name = 1; + + // A normal state variable that should be saved and restored in checkpoints + // and used as an input or output to non-debug TensorFlow ops. + message UserDefined { + } + + // A state variable that should be filled with a constant and normally hidden + // from users (used for intermediate gradients being accumulated, for + // example). + message FillWithConstant { + double initial_value = 1; + } + + // Usage type of this state variable. + oneof usage { + UserDefined user_defined = 2; + FillWithConstant fill_with_constant = 3; + } +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters_pb2.py new file mode 100644 index 0000000..7765b55 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters_pb2.py @@ -0,0 +1,1149 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto', + package='diplomacy.tensorflow.tpu', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nDdiplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto\x12\x18\x64iplomacy.tensorflow.tpu\x1a\x1egoogle/protobuf/wrappers.proto\"h\n\x0e\x43lippingLimits\x12*\n\x05lower\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.FloatValue\x12*\n\x05upper\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.FloatValue\"\x15\n\x13\x44ynamicLearningRate\"u\n\x0cLearningRate\x12\x12\n\x08\x63onstant\x18\x01 \x01(\x02H\x00\x12@\n\x07\x64ynamic\x18\x02 \x01(\x0b\x32-.diplomacy.tensorflow.tpu.DynamicLearningRateH\x00\x42\x0f\n\rlearning_rate\"0\n\x11\x41\x64\x61gradParameters\x12\x1b\n\x13initial_accumulator\x18\x01 \x01(\x02\"%\n#StochasticGradientDescentParameters\"i\n\x0e\x46trlParameters\x12\n\n\x02l1\x18\x01 \x01(\x02\x12\n\n\x02l2\x18\x02 \x01(\x02\x12\x10\n\x08lr_power\x18\x03 \x01(\x02\x12\x15\n\rinitial_accum\x18\x04 \x01(\x02\x12\x16\n\x0einitial_linear\x18\x05 \x01(\x02\"\x9d\x01\n\x0e\x41\x64\x61mParameters\x12\r\n\x05\x62\x65ta1\x18\x03 \x01(\x02\x12\r\n\x05\x62\x65ta2\x18\x04 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x05 \x01(\x02\x12\x11\n\tinitial_m\x18\x06 \x01(\x02\x12\x11\n\tinitial_v\x18\x07 \x01(\x02\x12\x19\n\x11use_non_lazy_adam\x18\x08 \x01(\x08\x12\x1b\n\x13use_sum_inside_sqrt\x18\n \x01(\x08\"S\n\x12MomentumParameters\x12\x10\n\x08momentum\x18\x01 \x01(\x02\x12\x14\n\x0cuse_nesterov\x18\x02 \x01(\x08\x12\x15\n\rinitial_accum\x18\x03 \x01(\x02\"l\n\x11RmsPropParameters\x12\x0b\n\x03rho\x18\x01 \x01(\x02\x12\x10\n\x08momentum\x18\x02 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x03 \x01(\x02\x12\x12\n\ninitial_ms\x18\x04 \x01(\x02\x12\x13\n\x0binitial_mom\x18\x05 \x01(\x02\"\x88\x01\n\x19\x43\x65nteredRmsPropParameters\x12\x0b\n\x03rho\x18\x01 \x01(\x02\x12\x10\n\x08momentum\x18\x02 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x03 \x01(\x02\x12\x12\n\ninitial_ms\x18\x04 \x01(\x02\x12\x13\n\x0binitial_mom\x18\x05 \x01(\x02\x12\x12\n\ninitial_mg\x18\x06 \x01(\x02\"\xa3\x03\n\x19MdlAdagradLightParameters\x12\n\n\x02l2\x18\x01 \x01(\x02\x12\x10\n\x08lr_power\x18\x02 \x01(\x02\x12 \n\x18min_servable_mdl_benefit\x18\x03 \x01(\x02\x12\x19\n\x11mdl_mix_in_margin\x18\x04 \x01(\x02\x12 \n\x18mdl_benefit_rampup_coeff\x18\x05 \x01(\x02\x12\x16\n\x0emdl_min_weight\x18\x06 \x01(\x02\x12\x1d\n\x15\x62\x65nefit_revisit_scale\x18\x07 \x01(\x02\x12\x19\n\x11max_event_benefit\x18\x08 \x01(\x02\x12\x19\n\x11max_total_benefit\x18\t \x01(\x02\x12\x16\n\x0emdl_hard_limit\x18\n \x01(\x02\x12\x1e\n\x16hard_limit_min_benefit\x18\x0b \x01(\x08\x12\x16\n\x0emdl_regularize\x18\x0c \x01(\x08\x12\x1b\n\x13initial_accumulator\x18\r \x01(\x02\x12\x16\n\x0einitial_weight\x18\x0e \x01(\x02\x12\x17\n\x0finitial_benefit\x18\x0f \x01(\x02\"g\n\x12\x41\x64\x61\x64\x65ltaParameters\x12\x0b\n\x03rho\x18\x01 \x01(\x02\x12\x0f\n\x07\x65psilon\x18\x02 \x01(\x02\x12\x1b\n\x13initial_accumulator\x18\x03 \x01(\x02\x12\x16\n\x0einitial_update\x18\x04 \x01(\x02\"P\n\x19ProximalAdagradParameters\x12\n\n\x02l1\x18\x01 \x01(\x02\x12\n\n\x02l2\x18\x02 \x01(\x02\x12\x1b\n\x13initial_accumulator\x18\x03 \x01(\x02\"\x8e\x08\n\x16OptimizationParameters\x12=\n\rlearning_rate\x18\r \x01(\x0b\x32&.diplomacy.tensorflow.tpu.LearningRate\x12\x41\n\x0f\x63lipping_limits\x18\x02 \x01(\x0b\x32(.diplomacy.tensorflow.tpu.ClippingLimits\x12J\n\x18gradient_clipping_limits\x18\x07 \x01(\x0b\x32(.diplomacy.tensorflow.tpu.ClippingLimits\x12\x1b\n\x13weight_decay_factor\x18\x10 \x01(\x02\x12!\n\x19use_gradient_accumulation\x18\x0f \x01(\x08\x12>\n\x07\x61\x64\x61grad\x18\x03 \x01(\x0b\x32+.diplomacy.tensorflow.tpu.AdagradParametersH\x00\x12\x64\n\x1bstochastic_gradient_descent\x18\x04 \x01(\x0b\x32=.diplomacy.tensorflow.tpu.StochasticGradientDescentParametersH\x00\x12\x38\n\x04\x66trl\x18\x05 \x01(\x0b\x32(.diplomacy.tensorflow.tpu.FtrlParametersH\x00\x12\x38\n\x04\x61\x64\x61m\x18\x06 \x01(\x0b\x32(.diplomacy.tensorflow.tpu.AdamParametersH\x00\x12@\n\x08momentum\x18\x08 \x01(\x0b\x32,.diplomacy.tensorflow.tpu.MomentumParametersH\x00\x12?\n\x08rms_prop\x18\t \x01(\x0b\x32+.diplomacy.tensorflow.tpu.RmsPropParametersH\x00\x12P\n\x11\x63\x65ntered_rms_prop\x18\n \x01(\x0b\x32\x33.diplomacy.tensorflow.tpu.CenteredRmsPropParametersH\x00\x12P\n\x11mdl_adagrad_light\x18\x0b \x01(\x0b\x32\x33.diplomacy.tensorflow.tpu.MdlAdagradLightParametersH\x00\x12@\n\x08\x61\x64\x61\x64\x65lta\x18\x0c \x01(\x0b\x32,.diplomacy.tensorflow.tpu.AdadeltaParametersH\x00\x12O\n\x10proximal_adagrad\x18\x0e \x01(\x0b\x32\x33.diplomacy.tensorflow.tpu.ProximalAdagradParametersH\x00\x42\x0c\n\nparametersJ\x04\x08\x01\x10\x02\"\xac\x02\n\x1aStateVariableSpecification\x12\x0c\n\x04name\x18\x01 \x01(\t\x12X\n\x0cuser_defined\x18\x02 \x01(\x0b\x32@.diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefinedH\x00\x12\x63\n\x12\x66ill_with_constant\x18\x03 \x01(\x0b\x32\x45.diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstantH\x00\x1a\r\n\x0bUserDefined\x1a)\n\x10\x46illWithConstant\x12\x15\n\rinitial_value\x18\x01 \x01(\x01\x42\x07\n\x05usageb\x06proto3') + , + dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,]) + + + + +_CLIPPINGLIMITS = _descriptor.Descriptor( + name='ClippingLimits', + full_name='diplomacy.tensorflow.tpu.ClippingLimits', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='lower', full_name='diplomacy.tensorflow.tpu.ClippingLimits.lower', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='upper', full_name='diplomacy.tensorflow.tpu.ClippingLimits.upper', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=130, + serialized_end=234, +) + + +_DYNAMICLEARNINGRATE = _descriptor.Descriptor( + name='DynamicLearningRate', + full_name='diplomacy.tensorflow.tpu.DynamicLearningRate', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=236, + serialized_end=257, +) + + +_LEARNINGRATE = _descriptor.Descriptor( + name='LearningRate', + full_name='diplomacy.tensorflow.tpu.LearningRate', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='constant', full_name='diplomacy.tensorflow.tpu.LearningRate.constant', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dynamic', full_name='diplomacy.tensorflow.tpu.LearningRate.dynamic', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='learning_rate', full_name='diplomacy.tensorflow.tpu.LearningRate.learning_rate', + index=0, containing_type=None, fields=[]), + ], + serialized_start=259, + serialized_end=376, +) + + +_ADAGRADPARAMETERS = _descriptor.Descriptor( + name='AdagradParameters', + full_name='diplomacy.tensorflow.tpu.AdagradParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='initial_accumulator', full_name='diplomacy.tensorflow.tpu.AdagradParameters.initial_accumulator', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=378, + serialized_end=426, +) + + +_STOCHASTICGRADIENTDESCENTPARAMETERS = _descriptor.Descriptor( + name='StochasticGradientDescentParameters', + full_name='diplomacy.tensorflow.tpu.StochasticGradientDescentParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=428, + serialized_end=465, +) + + +_FTRLPARAMETERS = _descriptor.Descriptor( + name='FtrlParameters', + full_name='diplomacy.tensorflow.tpu.FtrlParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='l1', full_name='diplomacy.tensorflow.tpu.FtrlParameters.l1', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='l2', full_name='diplomacy.tensorflow.tpu.FtrlParameters.l2', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='lr_power', full_name='diplomacy.tensorflow.tpu.FtrlParameters.lr_power', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_accum', full_name='diplomacy.tensorflow.tpu.FtrlParameters.initial_accum', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_linear', full_name='diplomacy.tensorflow.tpu.FtrlParameters.initial_linear', index=4, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=467, + serialized_end=572, +) + + +_ADAMPARAMETERS = _descriptor.Descriptor( + name='AdamParameters', + full_name='diplomacy.tensorflow.tpu.AdamParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='beta1', full_name='diplomacy.tensorflow.tpu.AdamParameters.beta1', index=0, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='beta2', full_name='diplomacy.tensorflow.tpu.AdamParameters.beta2', index=1, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='epsilon', full_name='diplomacy.tensorflow.tpu.AdamParameters.epsilon', index=2, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_m', full_name='diplomacy.tensorflow.tpu.AdamParameters.initial_m', index=3, + number=6, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_v', full_name='diplomacy.tensorflow.tpu.AdamParameters.initial_v', index=4, + number=7, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='use_non_lazy_adam', full_name='diplomacy.tensorflow.tpu.AdamParameters.use_non_lazy_adam', index=5, + number=8, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='use_sum_inside_sqrt', full_name='diplomacy.tensorflow.tpu.AdamParameters.use_sum_inside_sqrt', index=6, + number=10, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=575, + serialized_end=732, +) + + +_MOMENTUMPARAMETERS = _descriptor.Descriptor( + name='MomentumParameters', + full_name='diplomacy.tensorflow.tpu.MomentumParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='momentum', full_name='diplomacy.tensorflow.tpu.MomentumParameters.momentum', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='use_nesterov', full_name='diplomacy.tensorflow.tpu.MomentumParameters.use_nesterov', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_accum', full_name='diplomacy.tensorflow.tpu.MomentumParameters.initial_accum', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=734, + serialized_end=817, +) + + +_RMSPROPPARAMETERS = _descriptor.Descriptor( + name='RmsPropParameters', + full_name='diplomacy.tensorflow.tpu.RmsPropParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='rho', full_name='diplomacy.tensorflow.tpu.RmsPropParameters.rho', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='momentum', full_name='diplomacy.tensorflow.tpu.RmsPropParameters.momentum', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='epsilon', full_name='diplomacy.tensorflow.tpu.RmsPropParameters.epsilon', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_ms', full_name='diplomacy.tensorflow.tpu.RmsPropParameters.initial_ms', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_mom', full_name='diplomacy.tensorflow.tpu.RmsPropParameters.initial_mom', index=4, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=819, + serialized_end=927, +) + + +_CENTEREDRMSPROPPARAMETERS = _descriptor.Descriptor( + name='CenteredRmsPropParameters', + full_name='diplomacy.tensorflow.tpu.CenteredRmsPropParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='rho', full_name='diplomacy.tensorflow.tpu.CenteredRmsPropParameters.rho', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='momentum', full_name='diplomacy.tensorflow.tpu.CenteredRmsPropParameters.momentum', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='epsilon', full_name='diplomacy.tensorflow.tpu.CenteredRmsPropParameters.epsilon', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_ms', full_name='diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_ms', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_mom', full_name='diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_mom', index=4, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_mg', full_name='diplomacy.tensorflow.tpu.CenteredRmsPropParameters.initial_mg', index=5, + number=6, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=930, + serialized_end=1066, +) + + +_MDLADAGRADLIGHTPARAMETERS = _descriptor.Descriptor( + name='MdlAdagradLightParameters', + full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='l2', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.l2', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='lr_power', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.lr_power', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_servable_mdl_benefit', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.min_servable_mdl_benefit', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mdl_mix_in_margin', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_mix_in_margin', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mdl_benefit_rampup_coeff', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_benefit_rampup_coeff', index=4, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mdl_min_weight', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_min_weight', index=5, + number=6, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='benefit_revisit_scale', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.benefit_revisit_scale', index=6, + number=7, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_event_benefit', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.max_event_benefit', index=7, + number=8, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_total_benefit', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.max_total_benefit', index=8, + number=9, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mdl_hard_limit', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_hard_limit', index=9, + number=10, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='hard_limit_min_benefit', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.hard_limit_min_benefit', index=10, + number=11, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mdl_regularize', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.mdl_regularize', index=11, + number=12, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_accumulator', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_accumulator', index=12, + number=13, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_weight', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_weight', index=13, + number=14, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_benefit', full_name='diplomacy.tensorflow.tpu.MdlAdagradLightParameters.initial_benefit', index=14, + number=15, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1069, + serialized_end=1488, +) + + +_ADADELTAPARAMETERS = _descriptor.Descriptor( + name='AdadeltaParameters', + full_name='diplomacy.tensorflow.tpu.AdadeltaParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='rho', full_name='diplomacy.tensorflow.tpu.AdadeltaParameters.rho', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='epsilon', full_name='diplomacy.tensorflow.tpu.AdadeltaParameters.epsilon', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_accumulator', full_name='diplomacy.tensorflow.tpu.AdadeltaParameters.initial_accumulator', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_update', full_name='diplomacy.tensorflow.tpu.AdadeltaParameters.initial_update', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1490, + serialized_end=1593, +) + + +_PROXIMALADAGRADPARAMETERS = _descriptor.Descriptor( + name='ProximalAdagradParameters', + full_name='diplomacy.tensorflow.tpu.ProximalAdagradParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='l1', full_name='diplomacy.tensorflow.tpu.ProximalAdagradParameters.l1', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='l2', full_name='diplomacy.tensorflow.tpu.ProximalAdagradParameters.l2', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_accumulator', full_name='diplomacy.tensorflow.tpu.ProximalAdagradParameters.initial_accumulator', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1595, + serialized_end=1675, +) + + +_OPTIMIZATIONPARAMETERS = _descriptor.Descriptor( + name='OptimizationParameters', + full_name='diplomacy.tensorflow.tpu.OptimizationParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='learning_rate', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.learning_rate', index=0, + number=13, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='clipping_limits', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.clipping_limits', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='gradient_clipping_limits', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.gradient_clipping_limits', index=2, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='weight_decay_factor', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.weight_decay_factor', index=3, + number=16, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='use_gradient_accumulation', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.use_gradient_accumulation', index=4, + number=15, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='adagrad', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.adagrad', index=5, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='stochastic_gradient_descent', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.stochastic_gradient_descent', index=6, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='ftrl', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.ftrl', index=7, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='adam', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.adam', index=8, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='momentum', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.momentum', index=9, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rms_prop', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.rms_prop', index=10, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='centered_rms_prop', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.centered_rms_prop', index=11, + number=10, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mdl_adagrad_light', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.mdl_adagrad_light', index=12, + number=11, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='adadelta', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.adadelta', index=13, + number=12, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='proximal_adagrad', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.proximal_adagrad', index=14, + number=14, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='parameters', full_name='diplomacy.tensorflow.tpu.OptimizationParameters.parameters', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1678, + serialized_end=2716, +) + + +_STATEVARIABLESPECIFICATION_USERDEFINED = _descriptor.Descriptor( + name='UserDefined', + full_name='diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2954, + serialized_end=2967, +) + +_STATEVARIABLESPECIFICATION_FILLWITHCONSTANT = _descriptor.Descriptor( + name='FillWithConstant', + full_name='diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='initial_value', full_name='diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant.initial_value', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2969, + serialized_end=3010, +) + +_STATEVARIABLESPECIFICATION = _descriptor.Descriptor( + name='StateVariableSpecification', + full_name='diplomacy.tensorflow.tpu.StateVariableSpecification', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.tpu.StateVariableSpecification.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='user_defined', full_name='diplomacy.tensorflow.tpu.StateVariableSpecification.user_defined', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fill_with_constant', full_name='diplomacy.tensorflow.tpu.StateVariableSpecification.fill_with_constant', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_STATEVARIABLESPECIFICATION_USERDEFINED, _STATEVARIABLESPECIFICATION_FILLWITHCONSTANT, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='usage', full_name='diplomacy.tensorflow.tpu.StateVariableSpecification.usage', + index=0, containing_type=None, fields=[]), + ], + serialized_start=2719, + serialized_end=3019, +) + +_CLIPPINGLIMITS.fields_by_name['lower'].message_type = google_dot_protobuf_dot_wrappers__pb2._FLOATVALUE +_CLIPPINGLIMITS.fields_by_name['upper'].message_type = google_dot_protobuf_dot_wrappers__pb2._FLOATVALUE +_LEARNINGRATE.fields_by_name['dynamic'].message_type = _DYNAMICLEARNINGRATE +_LEARNINGRATE.oneofs_by_name['learning_rate'].fields.append( + _LEARNINGRATE.fields_by_name['constant']) +_LEARNINGRATE.fields_by_name['constant'].containing_oneof = _LEARNINGRATE.oneofs_by_name['learning_rate'] +_LEARNINGRATE.oneofs_by_name['learning_rate'].fields.append( + _LEARNINGRATE.fields_by_name['dynamic']) +_LEARNINGRATE.fields_by_name['dynamic'].containing_oneof = _LEARNINGRATE.oneofs_by_name['learning_rate'] +_OPTIMIZATIONPARAMETERS.fields_by_name['learning_rate'].message_type = _LEARNINGRATE +_OPTIMIZATIONPARAMETERS.fields_by_name['clipping_limits'].message_type = _CLIPPINGLIMITS +_OPTIMIZATIONPARAMETERS.fields_by_name['gradient_clipping_limits'].message_type = _CLIPPINGLIMITS +_OPTIMIZATIONPARAMETERS.fields_by_name['adagrad'].message_type = _ADAGRADPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['stochastic_gradient_descent'].message_type = _STOCHASTICGRADIENTDESCENTPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['ftrl'].message_type = _FTRLPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['adam'].message_type = _ADAMPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['momentum'].message_type = _MOMENTUMPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['rms_prop'].message_type = _RMSPROPPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['centered_rms_prop'].message_type = _CENTEREDRMSPROPPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['mdl_adagrad_light'].message_type = _MDLADAGRADLIGHTPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['adadelta'].message_type = _ADADELTAPARAMETERS +_OPTIMIZATIONPARAMETERS.fields_by_name['proximal_adagrad'].message_type = _PROXIMALADAGRADPARAMETERS +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['adagrad']) +_OPTIMIZATIONPARAMETERS.fields_by_name['adagrad'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['stochastic_gradient_descent']) +_OPTIMIZATIONPARAMETERS.fields_by_name['stochastic_gradient_descent'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['ftrl']) +_OPTIMIZATIONPARAMETERS.fields_by_name['ftrl'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['adam']) +_OPTIMIZATIONPARAMETERS.fields_by_name['adam'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['momentum']) +_OPTIMIZATIONPARAMETERS.fields_by_name['momentum'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['rms_prop']) +_OPTIMIZATIONPARAMETERS.fields_by_name['rms_prop'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['centered_rms_prop']) +_OPTIMIZATIONPARAMETERS.fields_by_name['centered_rms_prop'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['mdl_adagrad_light']) +_OPTIMIZATIONPARAMETERS.fields_by_name['mdl_adagrad_light'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['adadelta']) +_OPTIMIZATIONPARAMETERS.fields_by_name['adadelta'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'].fields.append( + _OPTIMIZATIONPARAMETERS.fields_by_name['proximal_adagrad']) +_OPTIMIZATIONPARAMETERS.fields_by_name['proximal_adagrad'].containing_oneof = _OPTIMIZATIONPARAMETERS.oneofs_by_name['parameters'] +_STATEVARIABLESPECIFICATION_USERDEFINED.containing_type = _STATEVARIABLESPECIFICATION +_STATEVARIABLESPECIFICATION_FILLWITHCONSTANT.containing_type = _STATEVARIABLESPECIFICATION +_STATEVARIABLESPECIFICATION.fields_by_name['user_defined'].message_type = _STATEVARIABLESPECIFICATION_USERDEFINED +_STATEVARIABLESPECIFICATION.fields_by_name['fill_with_constant'].message_type = _STATEVARIABLESPECIFICATION_FILLWITHCONSTANT +_STATEVARIABLESPECIFICATION.oneofs_by_name['usage'].fields.append( + _STATEVARIABLESPECIFICATION.fields_by_name['user_defined']) +_STATEVARIABLESPECIFICATION.fields_by_name['user_defined'].containing_oneof = _STATEVARIABLESPECIFICATION.oneofs_by_name['usage'] +_STATEVARIABLESPECIFICATION.oneofs_by_name['usage'].fields.append( + _STATEVARIABLESPECIFICATION.fields_by_name['fill_with_constant']) +_STATEVARIABLESPECIFICATION.fields_by_name['fill_with_constant'].containing_oneof = _STATEVARIABLESPECIFICATION.oneofs_by_name['usage'] +DESCRIPTOR.message_types_by_name['ClippingLimits'] = _CLIPPINGLIMITS +DESCRIPTOR.message_types_by_name['DynamicLearningRate'] = _DYNAMICLEARNINGRATE +DESCRIPTOR.message_types_by_name['LearningRate'] = _LEARNINGRATE +DESCRIPTOR.message_types_by_name['AdagradParameters'] = _ADAGRADPARAMETERS +DESCRIPTOR.message_types_by_name['StochasticGradientDescentParameters'] = _STOCHASTICGRADIENTDESCENTPARAMETERS +DESCRIPTOR.message_types_by_name['FtrlParameters'] = _FTRLPARAMETERS +DESCRIPTOR.message_types_by_name['AdamParameters'] = _ADAMPARAMETERS +DESCRIPTOR.message_types_by_name['MomentumParameters'] = _MOMENTUMPARAMETERS +DESCRIPTOR.message_types_by_name['RmsPropParameters'] = _RMSPROPPARAMETERS +DESCRIPTOR.message_types_by_name['CenteredRmsPropParameters'] = _CENTEREDRMSPROPPARAMETERS +DESCRIPTOR.message_types_by_name['MdlAdagradLightParameters'] = _MDLADAGRADLIGHTPARAMETERS +DESCRIPTOR.message_types_by_name['AdadeltaParameters'] = _ADADELTAPARAMETERS +DESCRIPTOR.message_types_by_name['ProximalAdagradParameters'] = _PROXIMALADAGRADPARAMETERS +DESCRIPTOR.message_types_by_name['OptimizationParameters'] = _OPTIMIZATIONPARAMETERS +DESCRIPTOR.message_types_by_name['StateVariableSpecification'] = _STATEVARIABLESPECIFICATION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ClippingLimits = _reflection.GeneratedProtocolMessageType('ClippingLimits', (_message.Message,), dict( + DESCRIPTOR = _CLIPPINGLIMITS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.ClippingLimits) + )) +_sym_db.RegisterMessage(ClippingLimits) + +DynamicLearningRate = _reflection.GeneratedProtocolMessageType('DynamicLearningRate', (_message.Message,), dict( + DESCRIPTOR = _DYNAMICLEARNINGRATE, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.DynamicLearningRate) + )) +_sym_db.RegisterMessage(DynamicLearningRate) + +LearningRate = _reflection.GeneratedProtocolMessageType('LearningRate', (_message.Message,), dict( + DESCRIPTOR = _LEARNINGRATE, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.LearningRate) + )) +_sym_db.RegisterMessage(LearningRate) + +AdagradParameters = _reflection.GeneratedProtocolMessageType('AdagradParameters', (_message.Message,), dict( + DESCRIPTOR = _ADAGRADPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.AdagradParameters) + )) +_sym_db.RegisterMessage(AdagradParameters) + +StochasticGradientDescentParameters = _reflection.GeneratedProtocolMessageType('StochasticGradientDescentParameters', (_message.Message,), dict( + DESCRIPTOR = _STOCHASTICGRADIENTDESCENTPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StochasticGradientDescentParameters) + )) +_sym_db.RegisterMessage(StochasticGradientDescentParameters) + +FtrlParameters = _reflection.GeneratedProtocolMessageType('FtrlParameters', (_message.Message,), dict( + DESCRIPTOR = _FTRLPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.FtrlParameters) + )) +_sym_db.RegisterMessage(FtrlParameters) + +AdamParameters = _reflection.GeneratedProtocolMessageType('AdamParameters', (_message.Message,), dict( + DESCRIPTOR = _ADAMPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.AdamParameters) + )) +_sym_db.RegisterMessage(AdamParameters) + +MomentumParameters = _reflection.GeneratedProtocolMessageType('MomentumParameters', (_message.Message,), dict( + DESCRIPTOR = _MOMENTUMPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.MomentumParameters) + )) +_sym_db.RegisterMessage(MomentumParameters) + +RmsPropParameters = _reflection.GeneratedProtocolMessageType('RmsPropParameters', (_message.Message,), dict( + DESCRIPTOR = _RMSPROPPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.RmsPropParameters) + )) +_sym_db.RegisterMessage(RmsPropParameters) + +CenteredRmsPropParameters = _reflection.GeneratedProtocolMessageType('CenteredRmsPropParameters', (_message.Message,), dict( + DESCRIPTOR = _CENTEREDRMSPROPPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.CenteredRmsPropParameters) + )) +_sym_db.RegisterMessage(CenteredRmsPropParameters) + +MdlAdagradLightParameters = _reflection.GeneratedProtocolMessageType('MdlAdagradLightParameters', (_message.Message,), dict( + DESCRIPTOR = _MDLADAGRADLIGHTPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.MdlAdagradLightParameters) + )) +_sym_db.RegisterMessage(MdlAdagradLightParameters) + +AdadeltaParameters = _reflection.GeneratedProtocolMessageType('AdadeltaParameters', (_message.Message,), dict( + DESCRIPTOR = _ADADELTAPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.AdadeltaParameters) + )) +_sym_db.RegisterMessage(AdadeltaParameters) + +ProximalAdagradParameters = _reflection.GeneratedProtocolMessageType('ProximalAdagradParameters', (_message.Message,), dict( + DESCRIPTOR = _PROXIMALADAGRADPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.ProximalAdagradParameters) + )) +_sym_db.RegisterMessage(ProximalAdagradParameters) + +OptimizationParameters = _reflection.GeneratedProtocolMessageType('OptimizationParameters', (_message.Message,), dict( + DESCRIPTOR = _OPTIMIZATIONPARAMETERS, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.OptimizationParameters) + )) +_sym_db.RegisterMessage(OptimizationParameters) + +StateVariableSpecification = _reflection.GeneratedProtocolMessageType('StateVariableSpecification', (_message.Message,), dict( + + UserDefined = _reflection.GeneratedProtocolMessageType('UserDefined', (_message.Message,), dict( + DESCRIPTOR = _STATEVARIABLESPECIFICATION_USERDEFINED, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StateVariableSpecification.UserDefined) + )) + , + + FillWithConstant = _reflection.GeneratedProtocolMessageType('FillWithConstant', (_message.Message,), dict( + DESCRIPTOR = _STATEVARIABLESPECIFICATION_FILLWITHCONSTANT, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StateVariableSpecification.FillWithConstant) + )) + , + DESCRIPTOR = _STATEVARIABLESPECIFICATION, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.optimization_parameters_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.StateVariableSpecification) + )) +_sym_db.RegisterMessage(StateVariableSpecification) +_sym_db.RegisterMessage(StateVariableSpecification.UserDefined) +_sym_db.RegisterMessage(StateVariableSpecification.FillWithConstant) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.pb.cc new file mode 100644 index 0000000..1429f7a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.pb.cc @@ -0,0 +1,559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/topology.proto + +#include "diplomacy_tensorflow/contrib/tpu/proto/topology.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class TopologyProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TopologyProto_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto { +static void InitDefaultsTopologyProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TopologyProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TopologyProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TopologyProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TopologyProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTopologyProto}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TopologyProto.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TopologyProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TopologyProto, mesh_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TopologyProto, num_tasks_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TopologyProto, num_tpu_devices_per_task_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TopologyProto, device_coordinates_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tpu::TopologyProto)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TopologyProto_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/proto/topology.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n5diplomacy_tensorflow/contrib/tpu/proto" + "/topology.proto\022\030diplomacy.tensorflow.tp" + "u\"t\n\rTopologyProto\022\022\n\nmesh_shape\030\001 \003(\005\022\021" + "\n\tnum_tasks\030\002 \001(\005\022 \n\030num_tpu_devices_per" + "_task\030\003 \001(\005\022\032\n\022device_coordinates\030\004 \003(\005B" + "\003\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 212); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tpu/proto/topology.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +void TopologyProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TopologyProto::kMeshShapeFieldNumber; +const int TopologyProto::kNumTasksFieldNumber; +const int TopologyProto::kNumTpuDevicesPerTaskFieldNumber; +const int TopologyProto::kDeviceCoordinatesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TopologyProto::TopologyProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::scc_info_TopologyProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TopologyProto) +} +TopologyProto::TopologyProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + mesh_shape_(arena), + device_coordinates_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::scc_info_TopologyProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.tpu.TopologyProto) +} +TopologyProto::TopologyProto(const TopologyProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + mesh_shape_(from.mesh_shape_), + device_coordinates_(from.device_coordinates_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&num_tasks_, &from.num_tasks_, + static_cast(reinterpret_cast(&num_tpu_devices_per_task_) - + reinterpret_cast(&num_tasks_)) + sizeof(num_tpu_devices_per_task_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TopologyProto) +} + +void TopologyProto::SharedCtor() { + ::memset(&num_tasks_, 0, static_cast( + reinterpret_cast(&num_tpu_devices_per_task_) - + reinterpret_cast(&num_tasks_)) + sizeof(num_tpu_devices_per_task_)); +} + +TopologyProto::~TopologyProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TopologyProto) + SharedDtor(); +} + +void TopologyProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TopologyProto::ArenaDtor(void* object) { + TopologyProto* _this = reinterpret_cast< TopologyProto* >(object); + (void)_this; +} +void TopologyProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TopologyProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TopologyProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TopologyProto& TopologyProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::scc_info_TopologyProto.base); + return *internal_default_instance(); +} + + +void TopologyProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TopologyProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + mesh_shape_.Clear(); + device_coordinates_.Clear(); + ::memset(&num_tasks_, 0, static_cast( + reinterpret_cast(&num_tpu_devices_per_task_) - + reinterpret_cast(&num_tasks_)) + sizeof(num_tpu_devices_per_task_)); + _internal_metadata_.Clear(); +} + +bool TopologyProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TopologyProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 mesh_shape = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_mesh_shape()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10u, input, this->mutable_mesh_shape()))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_tasks = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_tasks_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_tpu_devices_per_task = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_tpu_devices_per_task_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 device_coordinates = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_device_coordinates()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 34u, input, this->mutable_device_coordinates()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TopologyProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TopologyProto) + return false; +#undef DO_ +} + +void TopologyProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TopologyProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 mesh_shape = 1; + if (this->mesh_shape_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _mesh_shape_cached_byte_size_)); + } + for (int i = 0, n = this->mesh_shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->mesh_shape(i), output); + } + + // int32 num_tasks = 2; + if (this->num_tasks() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_tasks(), output); + } + + // int32 num_tpu_devices_per_task = 3; + if (this->num_tpu_devices_per_task() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->num_tpu_devices_per_task(), output); + } + + // repeated int32 device_coordinates = 4; + if (this->device_coordinates_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _device_coordinates_cached_byte_size_)); + } + for (int i = 0, n = this->device_coordinates_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->device_coordinates(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TopologyProto) +} + +::google::protobuf::uint8* TopologyProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TopologyProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 mesh_shape = 1; + if (this->mesh_shape_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _mesh_shape_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->mesh_shape_, target); + } + + // int32 num_tasks = 2; + if (this->num_tasks() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_tasks(), target); + } + + // int32 num_tpu_devices_per_task = 3; + if (this->num_tpu_devices_per_task() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->num_tpu_devices_per_task(), target); + } + + // repeated int32 device_coordinates = 4; + if (this->device_coordinates_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _device_coordinates_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->device_coordinates_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TopologyProto) + return target; +} + +size_t TopologyProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TopologyProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 mesh_shape = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->mesh_shape_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _mesh_shape_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int32 device_coordinates = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->device_coordinates_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _device_coordinates_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int32 num_tasks = 2; + if (this->num_tasks() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_tasks()); + } + + // int32 num_tpu_devices_per_task = 3; + if (this->num_tpu_devices_per_task() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_tpu_devices_per_task()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TopologyProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TopologyProto) + GOOGLE_DCHECK_NE(&from, this); + const TopologyProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TopologyProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TopologyProto) + MergeFrom(*source); + } +} + +void TopologyProto::MergeFrom(const TopologyProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TopologyProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + mesh_shape_.MergeFrom(from.mesh_shape_); + device_coordinates_.MergeFrom(from.device_coordinates_); + if (from.num_tasks() != 0) { + set_num_tasks(from.num_tasks()); + } + if (from.num_tpu_devices_per_task() != 0) { + set_num_tpu_devices_per_task(from.num_tpu_devices_per_task()); + } +} + +void TopologyProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TopologyProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TopologyProto::CopyFrom(const TopologyProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TopologyProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TopologyProto::IsInitialized() const { + return true; +} + +void TopologyProto::Swap(TopologyProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TopologyProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TopologyProto::UnsafeArenaSwap(TopologyProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TopologyProto::InternalSwap(TopologyProto* other) { + using std::swap; + mesh_shape_.InternalSwap(&other->mesh_shape_); + device_coordinates_.InternalSwap(&other->device_coordinates_); + swap(num_tasks_, other->num_tasks_); + swap(num_tpu_devices_per_task_, other->num_tpu_devices_per_task_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TopologyProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TopologyProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TopologyProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::tpu::TopologyProto >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.pb.h new file mode 100644 index 0000000..20536f9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.pb.h @@ -0,0 +1,330 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/topology.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class TopologyProto; +class TopologyProtoDefaultTypeInternal; +extern TopologyProtoDefaultTypeInternal _TopologyProto_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tpu::TopologyProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TopologyProto>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +class TopologyProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TopologyProto) */ { + public: + TopologyProto(); + virtual ~TopologyProto(); + + TopologyProto(const TopologyProto& from); + + inline TopologyProto& operator=(const TopologyProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TopologyProto(TopologyProto&& from) noexcept + : TopologyProto() { + *this = ::std::move(from); + } + + inline TopologyProto& operator=(TopologyProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TopologyProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TopologyProto* internal_default_instance() { + return reinterpret_cast( + &_TopologyProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TopologyProto* other); + void Swap(TopologyProto* other); + friend void swap(TopologyProto& a, TopologyProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TopologyProto* New() const final { + return CreateMaybeMessage(NULL); + } + + TopologyProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TopologyProto& from); + void MergeFrom(const TopologyProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TopologyProto* other); + protected: + explicit TopologyProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 mesh_shape = 1; + int mesh_shape_size() const; + void clear_mesh_shape(); + static const int kMeshShapeFieldNumber = 1; + ::google::protobuf::int32 mesh_shape(int index) const; + void set_mesh_shape(int index, ::google::protobuf::int32 value); + void add_mesh_shape(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + mesh_shape() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_mesh_shape(); + + // repeated int32 device_coordinates = 4; + int device_coordinates_size() const; + void clear_device_coordinates(); + static const int kDeviceCoordinatesFieldNumber = 4; + ::google::protobuf::int32 device_coordinates(int index) const; + void set_device_coordinates(int index, ::google::protobuf::int32 value); + void add_device_coordinates(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + device_coordinates() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_device_coordinates(); + + // int32 num_tasks = 2; + void clear_num_tasks(); + static const int kNumTasksFieldNumber = 2; + ::google::protobuf::int32 num_tasks() const; + void set_num_tasks(::google::protobuf::int32 value); + + // int32 num_tpu_devices_per_task = 3; + void clear_num_tpu_devices_per_task(); + static const int kNumTpuDevicesPerTaskFieldNumber = 3; + ::google::protobuf::int32 num_tpu_devices_per_task() const; + void set_num_tpu_devices_per_task(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TopologyProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > mesh_shape_; + mutable int _mesh_shape_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > device_coordinates_; + mutable int _device_coordinates_cached_byte_size_; + ::google::protobuf::int32 num_tasks_; + ::google::protobuf::int32 num_tpu_devices_per_task_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TopologyProto + +// repeated int32 mesh_shape = 1; +inline int TopologyProto::mesh_shape_size() const { + return mesh_shape_.size(); +} +inline void TopologyProto::clear_mesh_shape() { + mesh_shape_.Clear(); +} +inline ::google::protobuf::int32 TopologyProto::mesh_shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TopologyProto.mesh_shape) + return mesh_shape_.Get(index); +} +inline void TopologyProto::set_mesh_shape(int index, ::google::protobuf::int32 value) { + mesh_shape_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TopologyProto.mesh_shape) +} +inline void TopologyProto::add_mesh_shape(::google::protobuf::int32 value) { + mesh_shape_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.TopologyProto.mesh_shape) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TopologyProto::mesh_shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.TopologyProto.mesh_shape) + return mesh_shape_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TopologyProto::mutable_mesh_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.TopologyProto.mesh_shape) + return &mesh_shape_; +} + +// int32 num_tasks = 2; +inline void TopologyProto::clear_num_tasks() { + num_tasks_ = 0; +} +inline ::google::protobuf::int32 TopologyProto::num_tasks() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TopologyProto.num_tasks) + return num_tasks_; +} +inline void TopologyProto::set_num_tasks(::google::protobuf::int32 value) { + + num_tasks_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TopologyProto.num_tasks) +} + +// int32 num_tpu_devices_per_task = 3; +inline void TopologyProto::clear_num_tpu_devices_per_task() { + num_tpu_devices_per_task_ = 0; +} +inline ::google::protobuf::int32 TopologyProto::num_tpu_devices_per_task() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TopologyProto.num_tpu_devices_per_task) + return num_tpu_devices_per_task_; +} +inline void TopologyProto::set_num_tpu_devices_per_task(::google::protobuf::int32 value) { + + num_tpu_devices_per_task_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TopologyProto.num_tpu_devices_per_task) +} + +// repeated int32 device_coordinates = 4; +inline int TopologyProto::device_coordinates_size() const { + return device_coordinates_.size(); +} +inline void TopologyProto::clear_device_coordinates() { + device_coordinates_.Clear(); +} +inline ::google::protobuf::int32 TopologyProto::device_coordinates(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TopologyProto.device_coordinates) + return device_coordinates_.Get(index); +} +inline void TopologyProto::set_device_coordinates(int index, ::google::protobuf::int32 value) { + device_coordinates_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TopologyProto.device_coordinates) +} +inline void TopologyProto::add_device_coordinates(::google::protobuf::int32 value) { + device_coordinates_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.TopologyProto.device_coordinates) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TopologyProto::device_coordinates() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.TopologyProto.device_coordinates) + return device_coordinates_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TopologyProto::mutable_device_coordinates() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.TopologyProto.device_coordinates) + return &device_coordinates_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftopology_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.proto new file mode 100644 index 0000000..3b0adb5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +option cc_enable_arenas = true; + +package diplomacy.tensorflow.tpu; + +// Describes the geometry of a TPU mesh. +message TopologyProto { + // The dimensions of the TPU topology, in cores. Typically, this is a 3D + // topology [x, y, core], where the major dimensions correspond to TPU chips, + // and the minor dimension describes the number of cores on a multicore chip. + repeated int32 mesh_shape = 1; + + // Number of TensorFlow tasks in the cluster. + int32 num_tasks = 2; + + // Number of TPU devices per task. + int32 num_tpu_devices_per_task = 3; + + // A flattened rank 3 int32 array with shape + // [num_tasks, num_tpu_devices_per_task, len(mesh_shape)]. + // `tasks` is the number of tasks in the TPU cluster, `devices` is the number + // of TPU devices per task, and the minor dimension corresponds to a position + // in the TPU mesh topology. Each entry [task, device, axis] gives the + // `axis`-th coordinate in the topology of a task/device pair. + repeated int32 device_coordinates = 4; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology_pb2.py new file mode 100644 index 0000000..99627ec --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/topology_pb2.py @@ -0,0 +1,91 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/proto/topology.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/proto/topology.proto', + package='diplomacy.tensorflow.tpu', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n5diplomacy_tensorflow/contrib/tpu/proto/topology.proto\x12\x18\x64iplomacy.tensorflow.tpu\"t\n\rTopologyProto\x12\x12\n\nmesh_shape\x18\x01 \x03(\x05\x12\x11\n\tnum_tasks\x18\x02 \x01(\x05\x12 \n\x18num_tpu_devices_per_task\x18\x03 \x01(\x05\x12\x1a\n\x12\x64\x65vice_coordinates\x18\x04 \x03(\x05\x42\x03\xf8\x01\x01\x62\x06proto3') +) + + + + +_TOPOLOGYPROTO = _descriptor.Descriptor( + name='TopologyProto', + full_name='diplomacy.tensorflow.tpu.TopologyProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='mesh_shape', full_name='diplomacy.tensorflow.tpu.TopologyProto.mesh_shape', index=0, + number=1, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_tasks', full_name='diplomacy.tensorflow.tpu.TopologyProto.num_tasks', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_tpu_devices_per_task', full_name='diplomacy.tensorflow.tpu.TopologyProto.num_tpu_devices_per_task', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_coordinates', full_name='diplomacy.tensorflow.tpu.TopologyProto.device_coordinates', index=3, + number=4, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=83, + serialized_end=199, +) + +DESCRIPTOR.message_types_by_name['TopologyProto'] = _TOPOLOGYPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TopologyProto = _reflection.GeneratedProtocolMessageType('TopologyProto', (_message.Message,), dict( + DESCRIPTOR = _TOPOLOGYPROTO, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.topology_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TopologyProto) + )) +_sym_db.RegisterMessage(TopologyProto) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.pb.cc new file mode 100644 index 0000000..74f5731 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.pb.cc @@ -0,0 +1,1180 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto + +#include "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto ::google::protobuf::internal::SCCInfo<12> scc_info_OptimizationParameters; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingConfiguration_TableDescriptor; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TPUEmbeddingOutputLayout; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class TPUEmbeddingConfiguration_TableDescriptorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TPUEmbeddingConfiguration_TableDescriptor_default_instance_; +class TPUEmbeddingConfigurationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TPUEmbeddingConfiguration_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto { +static void InitDefaultsTPUEmbeddingConfiguration_TableDescriptor() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingConfiguration_TableDescriptor_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingConfiguration_TableDescriptor = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTPUEmbeddingConfiguration_TableDescriptor}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::scc_info_OptimizationParameters.base,}}; + +static void InitDefaultsTPUEmbeddingConfiguration() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingConfiguration_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TPUEmbeddingConfiguration = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTPUEmbeddingConfiguration}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::scc_info_TPUEmbeddingConfiguration_TableDescriptor.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingConfiguration_TableDescriptor.base); + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingConfiguration.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor, vocabulary_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor, dimension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor, num_features_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor, optimization_parameters_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, table_descriptor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, batch_size_per_tensor_core_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, num_hosts_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, num_tensor_cores_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, sharding_strategy_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, pipeline_execution_with_tensor_core_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration, output_layout_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor)}, + { 10, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingConfiguration_TableDescriptor_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingConfiguration_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nHdiplomacy_tensorflow/contrib/tpu/proto" + "/tpu_embedding_configuration.proto\022\030dipl" + "omacy.tensorflow.tpu\032Ddiplomacy_tensorfl" + "ow/contrib/tpu/proto/optimization_parame" + "ters.proto\032Hdiplomacy_tensorflow/contrib" + "/tpu/proto/tpu_embedding_output_layout.p" + "roto\"\237\006\n\031TPUEmbeddingConfiguration\022]\n\020ta" + "ble_descriptor\030\001 \003(\0132C.diplomacy.tensorf" + "low.tpu.TPUEmbeddingConfiguration.TableD" + "escriptor\022F\n\004mode\030\002 \001(\01628.diplomacy.tens" + "orflow.tpu.TPUEmbeddingConfiguration.Mod" + "e\022\"\n\032batch_size_per_tensor_core\030\003 \001(\005\022\021\n" + "\tnum_hosts\030\004 \001(\005\022\030\n\020num_tensor_cores\030\005 \001" + "(\005\022_\n\021sharding_strategy\030\006 \001(\0162D.diplomac" + "y.tensorflow.tpu.TPUEmbeddingConfigurati" + "on.ShardingStrategy\022+\n#pipeline_executio" + "n_with_tensor_core\030\007 \001(\010\022I\n\routput_layou" + "t\030\010 \001(\01322.diplomacy.tensorflow.tpu.TPUEm" + "beddingOutputLayout\032\264\001\n\017TableDescriptor\022" + "\014\n\004name\030\001 \001(\t\022\027\n\017vocabulary_size\030\002 \001(\005\022\021" + "\n\tdimension\030\003 \001(\005\022\024\n\014num_features\030\004 \001(\005\022" + "Q\n\027optimization_parameters\030\005 \001(\01320.diplo" + "macy.tensorflow.tpu.OptimizationParamete" + "rs\"L\n\004Mode\022\017\n\013UNSPECIFIED\020\000\022\r\n\tINFERENCE" + "\020\001\022\014\n\010TRAINING\020\002\022\026\n\022BACKWARD_PASS_ONLY\020\003" + "\",\n\020ShardingStrategy\022\017\n\013DIV_DEFAULT\020\000\022\007\n" + "\003MOD\020\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1054); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2foptimization_5fparameters_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +const ::google::protobuf::EnumDescriptor* TPUEmbeddingConfiguration_Mode_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::file_level_enum_descriptors[0]; +} +bool TPUEmbeddingConfiguration_Mode_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration::UNSPECIFIED; +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration::INFERENCE; +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration::TRAINING; +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration::BACKWARD_PASS_ONLY; +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration::Mode_MIN; +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration::Mode_MAX; +const int TPUEmbeddingConfiguration::Mode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* TPUEmbeddingConfiguration_ShardingStrategy_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::file_level_enum_descriptors[1]; +} +bool TPUEmbeddingConfiguration_ShardingStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const TPUEmbeddingConfiguration_ShardingStrategy TPUEmbeddingConfiguration::DIV_DEFAULT; +const TPUEmbeddingConfiguration_ShardingStrategy TPUEmbeddingConfiguration::MOD; +const TPUEmbeddingConfiguration_ShardingStrategy TPUEmbeddingConfiguration::ShardingStrategy_MIN; +const TPUEmbeddingConfiguration_ShardingStrategy TPUEmbeddingConfiguration::ShardingStrategy_MAX; +const int TPUEmbeddingConfiguration::ShardingStrategy_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void TPUEmbeddingConfiguration_TableDescriptor::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::_TPUEmbeddingConfiguration_TableDescriptor_default_instance_._instance.get_mutable()->optimization_parameters_ = const_cast< ::diplomacy::tensorflow::tpu::OptimizationParameters*>( + ::diplomacy::tensorflow::tpu::OptimizationParameters::internal_default_instance()); +} +void TPUEmbeddingConfiguration_TableDescriptor::clear_optimization_parameters() { + if (GetArenaNoVirtual() == NULL && optimization_parameters_ != NULL) { + delete optimization_parameters_; + } + optimization_parameters_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingConfiguration_TableDescriptor::kNameFieldNumber; +const int TPUEmbeddingConfiguration_TableDescriptor::kVocabularySizeFieldNumber; +const int TPUEmbeddingConfiguration_TableDescriptor::kDimensionFieldNumber; +const int TPUEmbeddingConfiguration_TableDescriptor::kNumFeaturesFieldNumber; +const int TPUEmbeddingConfiguration_TableDescriptor::kOptimizationParametersFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingConfiguration_TableDescriptor::TPUEmbeddingConfiguration_TableDescriptor() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::scc_info_TPUEmbeddingConfiguration_TableDescriptor.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) +} +TPUEmbeddingConfiguration_TableDescriptor::TPUEmbeddingConfiguration_TableDescriptor(const TPUEmbeddingConfiguration_TableDescriptor& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_optimization_parameters()) { + optimization_parameters_ = new ::diplomacy::tensorflow::tpu::OptimizationParameters(*from.optimization_parameters_); + } else { + optimization_parameters_ = NULL; + } + ::memcpy(&vocabulary_size_, &from.vocabulary_size_, + static_cast(reinterpret_cast(&num_features_) - + reinterpret_cast(&vocabulary_size_)) + sizeof(num_features_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) +} + +void TPUEmbeddingConfiguration_TableDescriptor::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&optimization_parameters_, 0, static_cast( + reinterpret_cast(&num_features_) - + reinterpret_cast(&optimization_parameters_)) + sizeof(num_features_)); +} + +TPUEmbeddingConfiguration_TableDescriptor::~TPUEmbeddingConfiguration_TableDescriptor() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + SharedDtor(); +} + +void TPUEmbeddingConfiguration_TableDescriptor::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete optimization_parameters_; +} + +void TPUEmbeddingConfiguration_TableDescriptor::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingConfiguration_TableDescriptor::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingConfiguration_TableDescriptor& TPUEmbeddingConfiguration_TableDescriptor::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::scc_info_TPUEmbeddingConfiguration_TableDescriptor.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingConfiguration_TableDescriptor::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && optimization_parameters_ != NULL) { + delete optimization_parameters_; + } + optimization_parameters_ = NULL; + ::memset(&vocabulary_size_, 0, static_cast( + reinterpret_cast(&num_features_) - + reinterpret_cast(&vocabulary_size_)) + sizeof(num_features_)); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingConfiguration_TableDescriptor::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name")); + } else { + goto handle_unusual; + } + break; + } + + // int32 vocabulary_size = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &vocabulary_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 dimension = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dimension_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_features = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_features_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.OptimizationParameters optimization_parameters = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_optimization_parameters())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + return false; +#undef DO_ +} + +void TPUEmbeddingConfiguration_TableDescriptor::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // int32 vocabulary_size = 2; + if (this->vocabulary_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->vocabulary_size(), output); + } + + // int32 dimension = 3; + if (this->dimension() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->dimension(), output); + } + + // int32 num_features = 4; + if (this->num_features() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->num_features(), output); + } + + // .diplomacy.tensorflow.tpu.OptimizationParameters optimization_parameters = 5; + if (this->has_optimization_parameters()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_optimization_parameters(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) +} + +::google::protobuf::uint8* TPUEmbeddingConfiguration_TableDescriptor::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // int32 vocabulary_size = 2; + if (this->vocabulary_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->vocabulary_size(), target); + } + + // int32 dimension = 3; + if (this->dimension() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->dimension(), target); + } + + // int32 num_features = 4; + if (this->num_features() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->num_features(), target); + } + + // .diplomacy.tensorflow.tpu.OptimizationParameters optimization_parameters = 5; + if (this->has_optimization_parameters()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_optimization_parameters(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + return target; +} + +size_t TPUEmbeddingConfiguration_TableDescriptor::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy.tensorflow.tpu.OptimizationParameters optimization_parameters = 5; + if (this->has_optimization_parameters()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *optimization_parameters_); + } + + // int32 vocabulary_size = 2; + if (this->vocabulary_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->vocabulary_size()); + } + + // int32 dimension = 3; + if (this->dimension() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dimension()); + } + + // int32 num_features = 4; + if (this->num_features() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_features()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingConfiguration_TableDescriptor::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingConfiguration_TableDescriptor* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + MergeFrom(*source); + } +} + +void TPUEmbeddingConfiguration_TableDescriptor::MergeFrom(const TPUEmbeddingConfiguration_TableDescriptor& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_optimization_parameters()) { + mutable_optimization_parameters()->::diplomacy::tensorflow::tpu::OptimizationParameters::MergeFrom(from.optimization_parameters()); + } + if (from.vocabulary_size() != 0) { + set_vocabulary_size(from.vocabulary_size()); + } + if (from.dimension() != 0) { + set_dimension(from.dimension()); + } + if (from.num_features() != 0) { + set_num_features(from.num_features()); + } +} + +void TPUEmbeddingConfiguration_TableDescriptor::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingConfiguration_TableDescriptor::CopyFrom(const TPUEmbeddingConfiguration_TableDescriptor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingConfiguration_TableDescriptor::IsInitialized() const { + return true; +} + +void TPUEmbeddingConfiguration_TableDescriptor::Swap(TPUEmbeddingConfiguration_TableDescriptor* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingConfiguration_TableDescriptor::InternalSwap(TPUEmbeddingConfiguration_TableDescriptor* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(optimization_parameters_, other->optimization_parameters_); + swap(vocabulary_size_, other->vocabulary_size_); + swap(dimension_, other->dimension_); + swap(num_features_, other->num_features_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingConfiguration_TableDescriptor::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TPUEmbeddingConfiguration::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::_TPUEmbeddingConfiguration_default_instance_._instance.get_mutable()->output_layout_ = const_cast< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout*>( + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout::internal_default_instance()); +} +void TPUEmbeddingConfiguration::clear_output_layout() { + if (GetArenaNoVirtual() == NULL && output_layout_ != NULL) { + delete output_layout_; + } + output_layout_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingConfiguration::kTableDescriptorFieldNumber; +const int TPUEmbeddingConfiguration::kModeFieldNumber; +const int TPUEmbeddingConfiguration::kBatchSizePerTensorCoreFieldNumber; +const int TPUEmbeddingConfiguration::kNumHostsFieldNumber; +const int TPUEmbeddingConfiguration::kNumTensorCoresFieldNumber; +const int TPUEmbeddingConfiguration::kShardingStrategyFieldNumber; +const int TPUEmbeddingConfiguration::kPipelineExecutionWithTensorCoreFieldNumber; +const int TPUEmbeddingConfiguration::kOutputLayoutFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingConfiguration::TPUEmbeddingConfiguration() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::scc_info_TPUEmbeddingConfiguration.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) +} +TPUEmbeddingConfiguration::TPUEmbeddingConfiguration(const TPUEmbeddingConfiguration& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + table_descriptor_(from.table_descriptor_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_output_layout()) { + output_layout_ = new ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout(*from.output_layout_); + } else { + output_layout_ = NULL; + } + ::memcpy(&mode_, &from.mode_, + static_cast(reinterpret_cast(&pipeline_execution_with_tensor_core_) - + reinterpret_cast(&mode_)) + sizeof(pipeline_execution_with_tensor_core_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) +} + +void TPUEmbeddingConfiguration::SharedCtor() { + ::memset(&output_layout_, 0, static_cast( + reinterpret_cast(&pipeline_execution_with_tensor_core_) - + reinterpret_cast(&output_layout_)) + sizeof(pipeline_execution_with_tensor_core_)); +} + +TPUEmbeddingConfiguration::~TPUEmbeddingConfiguration() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + SharedDtor(); +} + +void TPUEmbeddingConfiguration::SharedDtor() { + if (this != internal_default_instance()) delete output_layout_; +} + +void TPUEmbeddingConfiguration::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingConfiguration::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingConfiguration& TPUEmbeddingConfiguration::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::scc_info_TPUEmbeddingConfiguration.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingConfiguration::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + table_descriptor_.Clear(); + if (GetArenaNoVirtual() == NULL && output_layout_ != NULL) { + delete output_layout_; + } + output_layout_ = NULL; + ::memset(&mode_, 0, static_cast( + reinterpret_cast(&pipeline_execution_with_tensor_core_) - + reinterpret_cast(&mode_)) + sizeof(pipeline_execution_with_tensor_core_)); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingConfiguration::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor table_descriptor = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_table_descriptor())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode mode = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_mode(static_cast< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int32 batch_size_per_tensor_core = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &batch_size_per_tensor_core_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_hosts = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_hosts_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_tensor_cores = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_tensor_cores_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy sharding_strategy = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_sharding_strategy(static_cast< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy >(value)); + } else { + goto handle_unusual; + } + break; + } + + // bool pipeline_execution_with_tensor_core = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &pipeline_execution_with_tensor_core_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout output_layout = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_output_layout())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + return false; +#undef DO_ +} + +void TPUEmbeddingConfiguration::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor table_descriptor = 1; + for (unsigned int i = 0, + n = static_cast(this->table_descriptor_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->table_descriptor(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode mode = 2; + if (this->mode() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->mode(), output); + } + + // int32 batch_size_per_tensor_core = 3; + if (this->batch_size_per_tensor_core() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->batch_size_per_tensor_core(), output); + } + + // int32 num_hosts = 4; + if (this->num_hosts() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->num_hosts(), output); + } + + // int32 num_tensor_cores = 5; + if (this->num_tensor_cores() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->num_tensor_cores(), output); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy sharding_strategy = 6; + if (this->sharding_strategy() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->sharding_strategy(), output); + } + + // bool pipeline_execution_with_tensor_core = 7; + if (this->pipeline_execution_with_tensor_core() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->pipeline_execution_with_tensor_core(), output); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout output_layout = 8; + if (this->has_output_layout()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_output_layout(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) +} + +::google::protobuf::uint8* TPUEmbeddingConfiguration::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor table_descriptor = 1; + for (unsigned int i = 0, + n = static_cast(this->table_descriptor_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->table_descriptor(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode mode = 2; + if (this->mode() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->mode(), target); + } + + // int32 batch_size_per_tensor_core = 3; + if (this->batch_size_per_tensor_core() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->batch_size_per_tensor_core(), target); + } + + // int32 num_hosts = 4; + if (this->num_hosts() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->num_hosts(), target); + } + + // int32 num_tensor_cores = 5; + if (this->num_tensor_cores() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->num_tensor_cores(), target); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy sharding_strategy = 6; + if (this->sharding_strategy() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->sharding_strategy(), target); + } + + // bool pipeline_execution_with_tensor_core = 7; + if (this->pipeline_execution_with_tensor_core() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->pipeline_execution_with_tensor_core(), target); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout output_layout = 8; + if (this->has_output_layout()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_output_layout(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + return target; +} + +size_t TPUEmbeddingConfiguration::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor table_descriptor = 1; + { + unsigned int count = static_cast(this->table_descriptor_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->table_descriptor(static_cast(i))); + } + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout output_layout = 8; + if (this->has_output_layout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *output_layout_); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode mode = 2; + if (this->mode() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->mode()); + } + + // int32 batch_size_per_tensor_core = 3; + if (this->batch_size_per_tensor_core() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->batch_size_per_tensor_core()); + } + + // int32 num_hosts = 4; + if (this->num_hosts() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_hosts()); + } + + // int32 num_tensor_cores = 5; + if (this->num_tensor_cores() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_tensor_cores()); + } + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy sharding_strategy = 6; + if (this->sharding_strategy() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->sharding_strategy()); + } + + // bool pipeline_execution_with_tensor_core = 7; + if (this->pipeline_execution_with_tensor_core() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingConfiguration::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingConfiguration* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + MergeFrom(*source); + } +} + +void TPUEmbeddingConfiguration::MergeFrom(const TPUEmbeddingConfiguration& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + table_descriptor_.MergeFrom(from.table_descriptor_); + if (from.has_output_layout()) { + mutable_output_layout()->::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout::MergeFrom(from.output_layout()); + } + if (from.mode() != 0) { + set_mode(from.mode()); + } + if (from.batch_size_per_tensor_core() != 0) { + set_batch_size_per_tensor_core(from.batch_size_per_tensor_core()); + } + if (from.num_hosts() != 0) { + set_num_hosts(from.num_hosts()); + } + if (from.num_tensor_cores() != 0) { + set_num_tensor_cores(from.num_tensor_cores()); + } + if (from.sharding_strategy() != 0) { + set_sharding_strategy(from.sharding_strategy()); + } + if (from.pipeline_execution_with_tensor_core() != 0) { + set_pipeline_execution_with_tensor_core(from.pipeline_execution_with_tensor_core()); + } +} + +void TPUEmbeddingConfiguration::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingConfiguration::CopyFrom(const TPUEmbeddingConfiguration& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingConfiguration::IsInitialized() const { + return true; +} + +void TPUEmbeddingConfiguration::Swap(TPUEmbeddingConfiguration* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingConfiguration::InternalSwap(TPUEmbeddingConfiguration* other) { + using std::swap; + CastToBase(&table_descriptor_)->InternalSwap(CastToBase(&other->table_descriptor_)); + swap(output_layout_, other->output_layout_); + swap(mode_, other->mode_); + swap(batch_size_per_tensor_core_, other->batch_size_per_tensor_core_); + swap(num_hosts_, other->num_hosts_); + swap(num_tensor_cores_, other->num_tensor_cores_); + swap(sharding_strategy_, other->sharding_strategy_); + swap(pipeline_execution_with_tensor_core_, other->pipeline_execution_with_tensor_core_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingConfiguration::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.pb.h new file mode 100644 index 0000000..ce6447c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.pb.h @@ -0,0 +1,835 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.pb.h" +#include "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class TPUEmbeddingConfiguration; +class TPUEmbeddingConfigurationDefaultTypeInternal; +extern TPUEmbeddingConfigurationDefaultTypeInternal _TPUEmbeddingConfiguration_default_instance_; +class TPUEmbeddingConfiguration_TableDescriptor; +class TPUEmbeddingConfiguration_TableDescriptorDefaultTypeInternal; +extern TPUEmbeddingConfiguration_TableDescriptorDefaultTypeInternal _TPUEmbeddingConfiguration_TableDescriptor_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration>(Arena*); +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +enum TPUEmbeddingConfiguration_Mode { + TPUEmbeddingConfiguration_Mode_UNSPECIFIED = 0, + TPUEmbeddingConfiguration_Mode_INFERENCE = 1, + TPUEmbeddingConfiguration_Mode_TRAINING = 2, + TPUEmbeddingConfiguration_Mode_BACKWARD_PASS_ONLY = 3, + TPUEmbeddingConfiguration_Mode_TPUEmbeddingConfiguration_Mode_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + TPUEmbeddingConfiguration_Mode_TPUEmbeddingConfiguration_Mode_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool TPUEmbeddingConfiguration_Mode_IsValid(int value); +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration_Mode_Mode_MIN = TPUEmbeddingConfiguration_Mode_UNSPECIFIED; +const TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration_Mode_Mode_MAX = TPUEmbeddingConfiguration_Mode_BACKWARD_PASS_ONLY; +const int TPUEmbeddingConfiguration_Mode_Mode_ARRAYSIZE = TPUEmbeddingConfiguration_Mode_Mode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* TPUEmbeddingConfiguration_Mode_descriptor(); +inline const ::std::string& TPUEmbeddingConfiguration_Mode_Name(TPUEmbeddingConfiguration_Mode value) { + return ::google::protobuf::internal::NameOfEnum( + TPUEmbeddingConfiguration_Mode_descriptor(), value); +} +inline bool TPUEmbeddingConfiguration_Mode_Parse( + const ::std::string& name, TPUEmbeddingConfiguration_Mode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + TPUEmbeddingConfiguration_Mode_descriptor(), name, value); +} +enum TPUEmbeddingConfiguration_ShardingStrategy { + TPUEmbeddingConfiguration_ShardingStrategy_DIV_DEFAULT = 0, + TPUEmbeddingConfiguration_ShardingStrategy_MOD = 1, + TPUEmbeddingConfiguration_ShardingStrategy_TPUEmbeddingConfiguration_ShardingStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + TPUEmbeddingConfiguration_ShardingStrategy_TPUEmbeddingConfiguration_ShardingStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool TPUEmbeddingConfiguration_ShardingStrategy_IsValid(int value); +const TPUEmbeddingConfiguration_ShardingStrategy TPUEmbeddingConfiguration_ShardingStrategy_ShardingStrategy_MIN = TPUEmbeddingConfiguration_ShardingStrategy_DIV_DEFAULT; +const TPUEmbeddingConfiguration_ShardingStrategy TPUEmbeddingConfiguration_ShardingStrategy_ShardingStrategy_MAX = TPUEmbeddingConfiguration_ShardingStrategy_MOD; +const int TPUEmbeddingConfiguration_ShardingStrategy_ShardingStrategy_ARRAYSIZE = TPUEmbeddingConfiguration_ShardingStrategy_ShardingStrategy_MAX + 1; + +const ::google::protobuf::EnumDescriptor* TPUEmbeddingConfiguration_ShardingStrategy_descriptor(); +inline const ::std::string& TPUEmbeddingConfiguration_ShardingStrategy_Name(TPUEmbeddingConfiguration_ShardingStrategy value) { + return ::google::protobuf::internal::NameOfEnum( + TPUEmbeddingConfiguration_ShardingStrategy_descriptor(), value); +} +inline bool TPUEmbeddingConfiguration_ShardingStrategy_Parse( + const ::std::string& name, TPUEmbeddingConfiguration_ShardingStrategy* value) { + return ::google::protobuf::internal::ParseNamedEnum( + TPUEmbeddingConfiguration_ShardingStrategy_descriptor(), name, value); +} +// =================================================================== + +class TPUEmbeddingConfiguration_TableDescriptor : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) */ { + public: + TPUEmbeddingConfiguration_TableDescriptor(); + virtual ~TPUEmbeddingConfiguration_TableDescriptor(); + + TPUEmbeddingConfiguration_TableDescriptor(const TPUEmbeddingConfiguration_TableDescriptor& from); + + inline TPUEmbeddingConfiguration_TableDescriptor& operator=(const TPUEmbeddingConfiguration_TableDescriptor& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingConfiguration_TableDescriptor(TPUEmbeddingConfiguration_TableDescriptor&& from) noexcept + : TPUEmbeddingConfiguration_TableDescriptor() { + *this = ::std::move(from); + } + + inline TPUEmbeddingConfiguration_TableDescriptor& operator=(TPUEmbeddingConfiguration_TableDescriptor&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingConfiguration_TableDescriptor& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingConfiguration_TableDescriptor* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingConfiguration_TableDescriptor_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(TPUEmbeddingConfiguration_TableDescriptor* other); + friend void swap(TPUEmbeddingConfiguration_TableDescriptor& a, TPUEmbeddingConfiguration_TableDescriptor& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingConfiguration_TableDescriptor* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingConfiguration_TableDescriptor* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingConfiguration_TableDescriptor& from); + void MergeFrom(const TPUEmbeddingConfiguration_TableDescriptor& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingConfiguration_TableDescriptor* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // .diplomacy.tensorflow.tpu.OptimizationParameters optimization_parameters = 5; + bool has_optimization_parameters() const; + void clear_optimization_parameters(); + static const int kOptimizationParametersFieldNumber = 5; + private: + const ::diplomacy::tensorflow::tpu::OptimizationParameters& _internal_optimization_parameters() const; + public: + const ::diplomacy::tensorflow::tpu::OptimizationParameters& optimization_parameters() const; + ::diplomacy::tensorflow::tpu::OptimizationParameters* release_optimization_parameters(); + ::diplomacy::tensorflow::tpu::OptimizationParameters* mutable_optimization_parameters(); + void set_allocated_optimization_parameters(::diplomacy::tensorflow::tpu::OptimizationParameters* optimization_parameters); + + // int32 vocabulary_size = 2; + void clear_vocabulary_size(); + static const int kVocabularySizeFieldNumber = 2; + ::google::protobuf::int32 vocabulary_size() const; + void set_vocabulary_size(::google::protobuf::int32 value); + + // int32 dimension = 3; + void clear_dimension(); + static const int kDimensionFieldNumber = 3; + ::google::protobuf::int32 dimension() const; + void set_dimension(::google::protobuf::int32 value); + + // int32 num_features = 4; + void clear_num_features(); + static const int kNumFeaturesFieldNumber = 4; + ::google::protobuf::int32 num_features() const; + void set_num_features(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::diplomacy::tensorflow::tpu::OptimizationParameters* optimization_parameters_; + ::google::protobuf::int32 vocabulary_size_; + ::google::protobuf::int32 dimension_; + ::google::protobuf::int32 num_features_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TPUEmbeddingConfiguration : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) */ { + public: + TPUEmbeddingConfiguration(); + virtual ~TPUEmbeddingConfiguration(); + + TPUEmbeddingConfiguration(const TPUEmbeddingConfiguration& from); + + inline TPUEmbeddingConfiguration& operator=(const TPUEmbeddingConfiguration& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingConfiguration(TPUEmbeddingConfiguration&& from) noexcept + : TPUEmbeddingConfiguration() { + *this = ::std::move(from); + } + + inline TPUEmbeddingConfiguration& operator=(TPUEmbeddingConfiguration&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingConfiguration& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingConfiguration* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingConfiguration_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(TPUEmbeddingConfiguration* other); + friend void swap(TPUEmbeddingConfiguration& a, TPUEmbeddingConfiguration& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingConfiguration* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingConfiguration* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingConfiguration& from); + void MergeFrom(const TPUEmbeddingConfiguration& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingConfiguration* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef TPUEmbeddingConfiguration_TableDescriptor TableDescriptor; + + typedef TPUEmbeddingConfiguration_Mode Mode; + static const Mode UNSPECIFIED = + TPUEmbeddingConfiguration_Mode_UNSPECIFIED; + static const Mode INFERENCE = + TPUEmbeddingConfiguration_Mode_INFERENCE; + static const Mode TRAINING = + TPUEmbeddingConfiguration_Mode_TRAINING; + static const Mode BACKWARD_PASS_ONLY = + TPUEmbeddingConfiguration_Mode_BACKWARD_PASS_ONLY; + static inline bool Mode_IsValid(int value) { + return TPUEmbeddingConfiguration_Mode_IsValid(value); + } + static const Mode Mode_MIN = + TPUEmbeddingConfiguration_Mode_Mode_MIN; + static const Mode Mode_MAX = + TPUEmbeddingConfiguration_Mode_Mode_MAX; + static const int Mode_ARRAYSIZE = + TPUEmbeddingConfiguration_Mode_Mode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Mode_descriptor() { + return TPUEmbeddingConfiguration_Mode_descriptor(); + } + static inline const ::std::string& Mode_Name(Mode value) { + return TPUEmbeddingConfiguration_Mode_Name(value); + } + static inline bool Mode_Parse(const ::std::string& name, + Mode* value) { + return TPUEmbeddingConfiguration_Mode_Parse(name, value); + } + + typedef TPUEmbeddingConfiguration_ShardingStrategy ShardingStrategy; + static const ShardingStrategy DIV_DEFAULT = + TPUEmbeddingConfiguration_ShardingStrategy_DIV_DEFAULT; + static const ShardingStrategy MOD = + TPUEmbeddingConfiguration_ShardingStrategy_MOD; + static inline bool ShardingStrategy_IsValid(int value) { + return TPUEmbeddingConfiguration_ShardingStrategy_IsValid(value); + } + static const ShardingStrategy ShardingStrategy_MIN = + TPUEmbeddingConfiguration_ShardingStrategy_ShardingStrategy_MIN; + static const ShardingStrategy ShardingStrategy_MAX = + TPUEmbeddingConfiguration_ShardingStrategy_ShardingStrategy_MAX; + static const int ShardingStrategy_ARRAYSIZE = + TPUEmbeddingConfiguration_ShardingStrategy_ShardingStrategy_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + ShardingStrategy_descriptor() { + return TPUEmbeddingConfiguration_ShardingStrategy_descriptor(); + } + static inline const ::std::string& ShardingStrategy_Name(ShardingStrategy value) { + return TPUEmbeddingConfiguration_ShardingStrategy_Name(value); + } + static inline bool ShardingStrategy_Parse(const ::std::string& name, + ShardingStrategy* value) { + return TPUEmbeddingConfiguration_ShardingStrategy_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor table_descriptor = 1; + int table_descriptor_size() const; + void clear_table_descriptor(); + static const int kTableDescriptorFieldNumber = 1; + ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor* mutable_table_descriptor(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor >* + mutable_table_descriptor(); + const ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor& table_descriptor(int index) const; + ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor* add_table_descriptor(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor >& + table_descriptor() const; + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout output_layout = 8; + bool has_output_layout() const; + void clear_output_layout(); + static const int kOutputLayoutFieldNumber = 8; + private: + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout& _internal_output_layout() const; + public: + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout& output_layout() const; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* release_output_layout(); + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* mutable_output_layout(); + void set_allocated_output_layout(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* output_layout); + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode mode = 2; + void clear_mode(); + static const int kModeFieldNumber = 2; + ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode mode() const; + void set_mode(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode value); + + // int32 batch_size_per_tensor_core = 3; + void clear_batch_size_per_tensor_core(); + static const int kBatchSizePerTensorCoreFieldNumber = 3; + ::google::protobuf::int32 batch_size_per_tensor_core() const; + void set_batch_size_per_tensor_core(::google::protobuf::int32 value); + + // int32 num_hosts = 4; + void clear_num_hosts(); + static const int kNumHostsFieldNumber = 4; + ::google::protobuf::int32 num_hosts() const; + void set_num_hosts(::google::protobuf::int32 value); + + // int32 num_tensor_cores = 5; + void clear_num_tensor_cores(); + static const int kNumTensorCoresFieldNumber = 5; + ::google::protobuf::int32 num_tensor_cores() const; + void set_num_tensor_cores(::google::protobuf::int32 value); + + // .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy sharding_strategy = 6; + void clear_sharding_strategy(); + static const int kShardingStrategyFieldNumber = 6; + ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy sharding_strategy() const; + void set_sharding_strategy(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy value); + + // bool pipeline_execution_with_tensor_core = 7; + void clear_pipeline_execution_with_tensor_core(); + static const int kPipelineExecutionWithTensorCoreFieldNumber = 7; + bool pipeline_execution_with_tensor_core() const; + void set_pipeline_execution_with_tensor_core(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor > table_descriptor_; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* output_layout_; + int mode_; + ::google::protobuf::int32 batch_size_per_tensor_core_; + ::google::protobuf::int32 num_hosts_; + ::google::protobuf::int32 num_tensor_cores_; + int sharding_strategy_; + bool pipeline_execution_with_tensor_core_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TPUEmbeddingConfiguration_TableDescriptor + +// string name = 1; +inline void TPUEmbeddingConfiguration_TableDescriptor::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& TPUEmbeddingConfiguration_TableDescriptor::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) + return name_.GetNoArena(); +} +inline void TPUEmbeddingConfiguration_TableDescriptor::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) +} +#if LANG_CXX11 +inline void TPUEmbeddingConfiguration_TableDescriptor::set_name(::std::string&& value) { + + name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) +} +#endif +inline void TPUEmbeddingConfiguration_TableDescriptor::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) +} +inline void TPUEmbeddingConfiguration_TableDescriptor::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) +} +inline ::std::string* TPUEmbeddingConfiguration_TableDescriptor::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TPUEmbeddingConfiguration_TableDescriptor::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TPUEmbeddingConfiguration_TableDescriptor::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name) +} + +// int32 vocabulary_size = 2; +inline void TPUEmbeddingConfiguration_TableDescriptor::clear_vocabulary_size() { + vocabulary_size_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingConfiguration_TableDescriptor::vocabulary_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.vocabulary_size) + return vocabulary_size_; +} +inline void TPUEmbeddingConfiguration_TableDescriptor::set_vocabulary_size(::google::protobuf::int32 value) { + + vocabulary_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.vocabulary_size) +} + +// int32 dimension = 3; +inline void TPUEmbeddingConfiguration_TableDescriptor::clear_dimension() { + dimension_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingConfiguration_TableDescriptor::dimension() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.dimension) + return dimension_; +} +inline void TPUEmbeddingConfiguration_TableDescriptor::set_dimension(::google::protobuf::int32 value) { + + dimension_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.dimension) +} + +// int32 num_features = 4; +inline void TPUEmbeddingConfiguration_TableDescriptor::clear_num_features() { + num_features_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingConfiguration_TableDescriptor::num_features() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.num_features) + return num_features_; +} +inline void TPUEmbeddingConfiguration_TableDescriptor::set_num_features(::google::protobuf::int32 value) { + + num_features_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.num_features) +} + +// .diplomacy.tensorflow.tpu.OptimizationParameters optimization_parameters = 5; +inline bool TPUEmbeddingConfiguration_TableDescriptor::has_optimization_parameters() const { + return this != internal_default_instance() && optimization_parameters_ != NULL; +} +inline const ::diplomacy::tensorflow::tpu::OptimizationParameters& TPUEmbeddingConfiguration_TableDescriptor::_internal_optimization_parameters() const { + return *optimization_parameters_; +} +inline const ::diplomacy::tensorflow::tpu::OptimizationParameters& TPUEmbeddingConfiguration_TableDescriptor::optimization_parameters() const { + const ::diplomacy::tensorflow::tpu::OptimizationParameters* p = optimization_parameters_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.optimization_parameters) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::_OptimizationParameters_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::OptimizationParameters* TPUEmbeddingConfiguration_TableDescriptor::release_optimization_parameters() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.optimization_parameters) + + ::diplomacy::tensorflow::tpu::OptimizationParameters* temp = optimization_parameters_; + optimization_parameters_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::OptimizationParameters* TPUEmbeddingConfiguration_TableDescriptor::mutable_optimization_parameters() { + + if (optimization_parameters_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::OptimizationParameters>(GetArenaNoVirtual()); + optimization_parameters_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.optimization_parameters) + return optimization_parameters_; +} +inline void TPUEmbeddingConfiguration_TableDescriptor::set_allocated_optimization_parameters(::diplomacy::tensorflow::tpu::OptimizationParameters* optimization_parameters) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(optimization_parameters_); + } + if (optimization_parameters) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + optimization_parameters = ::google::protobuf::internal::GetOwnedMessage( + message_arena, optimization_parameters, submessage_arena); + } + + } else { + + } + optimization_parameters_ = optimization_parameters; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.optimization_parameters) +} + +// ------------------------------------------------------------------- + +// TPUEmbeddingConfiguration + +// repeated .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor table_descriptor = 1; +inline int TPUEmbeddingConfiguration::table_descriptor_size() const { + return table_descriptor_.size(); +} +inline void TPUEmbeddingConfiguration::clear_table_descriptor() { + table_descriptor_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor* TPUEmbeddingConfiguration::mutable_table_descriptor(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.table_descriptor) + return table_descriptor_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor >* +TPUEmbeddingConfiguration::mutable_table_descriptor() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.table_descriptor) + return &table_descriptor_; +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor& TPUEmbeddingConfiguration::table_descriptor(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.table_descriptor) + return table_descriptor_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor* TPUEmbeddingConfiguration::add_table_descriptor() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.table_descriptor) + return table_descriptor_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_TableDescriptor >& +TPUEmbeddingConfiguration::table_descriptor() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.table_descriptor) + return table_descriptor_; +} + +// .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode mode = 2; +inline void TPUEmbeddingConfiguration::clear_mode() { + mode_ = 0; +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode TPUEmbeddingConfiguration::mode() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.mode) + return static_cast< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode >(mode_); +} +inline void TPUEmbeddingConfiguration::set_mode(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode value) { + + mode_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.mode) +} + +// int32 batch_size_per_tensor_core = 3; +inline void TPUEmbeddingConfiguration::clear_batch_size_per_tensor_core() { + batch_size_per_tensor_core_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingConfiguration::batch_size_per_tensor_core() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.batch_size_per_tensor_core) + return batch_size_per_tensor_core_; +} +inline void TPUEmbeddingConfiguration::set_batch_size_per_tensor_core(::google::protobuf::int32 value) { + + batch_size_per_tensor_core_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.batch_size_per_tensor_core) +} + +// int32 num_hosts = 4; +inline void TPUEmbeddingConfiguration::clear_num_hosts() { + num_hosts_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingConfiguration::num_hosts() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.num_hosts) + return num_hosts_; +} +inline void TPUEmbeddingConfiguration::set_num_hosts(::google::protobuf::int32 value) { + + num_hosts_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.num_hosts) +} + +// int32 num_tensor_cores = 5; +inline void TPUEmbeddingConfiguration::clear_num_tensor_cores() { + num_tensor_cores_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingConfiguration::num_tensor_cores() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.num_tensor_cores) + return num_tensor_cores_; +} +inline void TPUEmbeddingConfiguration::set_num_tensor_cores(::google::protobuf::int32 value) { + + num_tensor_cores_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.num_tensor_cores) +} + +// .diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy sharding_strategy = 6; +inline void TPUEmbeddingConfiguration::clear_sharding_strategy() { + sharding_strategy_ = 0; +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy TPUEmbeddingConfiguration::sharding_strategy() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.sharding_strategy) + return static_cast< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy >(sharding_strategy_); +} +inline void TPUEmbeddingConfiguration::set_sharding_strategy(::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy value) { + + sharding_strategy_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.sharding_strategy) +} + +// bool pipeline_execution_with_tensor_core = 7; +inline void TPUEmbeddingConfiguration::clear_pipeline_execution_with_tensor_core() { + pipeline_execution_with_tensor_core_ = false; +} +inline bool TPUEmbeddingConfiguration::pipeline_execution_with_tensor_core() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.pipeline_execution_with_tensor_core) + return pipeline_execution_with_tensor_core_; +} +inline void TPUEmbeddingConfiguration::set_pipeline_execution_with_tensor_core(bool value) { + + pipeline_execution_with_tensor_core_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.pipeline_execution_with_tensor_core) +} + +// .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout output_layout = 8; +inline bool TPUEmbeddingConfiguration::has_output_layout() const { + return this != internal_default_instance() && output_layout_ != NULL; +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout& TPUEmbeddingConfiguration::_internal_output_layout() const { + return *output_layout_; +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout& TPUEmbeddingConfiguration::output_layout() const { + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* p = output_layout_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.output_layout) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* TPUEmbeddingConfiguration::release_output_layout() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.output_layout) + + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* temp = output_layout_; + output_layout_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* TPUEmbeddingConfiguration::mutable_output_layout() { + + if (output_layout_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout>(GetArenaNoVirtual()); + output_layout_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.output_layout) + return output_layout_; +} +inline void TPUEmbeddingConfiguration::set_allocated_output_layout(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* output_layout) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(output_layout_); + } + if (output_layout) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + output_layout = ::google::protobuf::internal::GetOwnedMessage( + message_arena, output_layout, submessage_arena); + } + + } else { + + } + output_layout_ = output_layout; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.output_layout) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode>() { + return ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_Mode_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy>() { + return ::diplomacy::tensorflow::tpu::TPUEmbeddingConfiguration_ShardingStrategy_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5fconfiguration_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto new file mode 100644 index 0000000..026a74b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tpu; + +import "diplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto"; +import "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto"; + +message TPUEmbeddingConfiguration { + // Description of the various embedding tables. + message TableDescriptor { + // Name of the table. + string name = 1; + // Size of the vocabulary (i.e., number of rows) in the table. + int32 vocabulary_size = 2; + // The embedding dimension (i.e., the width of the embedding table). + int32 dimension = 3; + // Number of features mapped to this table. + int32 num_features = 4; + // Details of the learning algorithm used to update the embedding + // parameters. + OptimizationParameters optimization_parameters = 5; + } + repeated TableDescriptor table_descriptor = 1; + + // Mode. Should the embedding layer program be run for inference (just forward + // pass), training (both forward and backward pass) or just the backward_pass. + enum Mode { + UNSPECIFIED = 0; + INFERENCE = 1; + TRAINING = 2; + BACKWARD_PASS_ONLY = 3; + } + Mode mode = 2; + + // Number of samples in each batch of embedding layer activations sent to + // the TensorCore. + int32 batch_size_per_tensor_core = 3; + + // Number of TPU hosts used for inference/training. + int32 num_hosts = 4; + + // Number of TensorCore used for inference/training. + int32 num_tensor_cores = 5; + + // Sharding strategy of the embedding tables among the hosts. + // If the sharding_strategy is "mod", each id is assigned to host + // "id % num_hosts". For instance, 13 ids are split across 5 hosts as: + // [[0, 5, 10], [1, 6, 11], [2, 7, 12], [3, 8], [4, 9]]. + // If the sharding_strategy is "div", ids are assigned to hosts in a + // contiguous manner. In this case, 13 ids are split across 5 hosts as: + // [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10], [11, 12]]. + // In both the strategies, if the id space does not evenly divide the number + // of hosts, each of the first "table_descriptor.num_ids % num_hosts" hosts + // will be assigned one more id. + // This partitioning strategy exactly follows that in the embedding_lookup + // TensorFlow function at tensorflow/python/ops/embedding_ops.py. + enum ShardingStrategy { + DIV_DEFAULT = 0; + MOD = 1; + } + ShardingStrategy sharding_strategy = 6; + + // This parameter determines if the execution of the sparse core will be + // pipelined with that of the TensorCore. This parameter only affects results + // when mode=TRAINING. If mode=INFERENCE or BACKWARD_PASS_ONLY, this parameter + // does not affect execution and hence, is a don't care value. + // + // false: The execution of the sparse core is not pipelined with that of the + // TensorCore. The forward pass of every step on the sparse core is executed + // only after the backward pass of the previous step is complete. And the + // backward pass on the sparse core is executed only after the embedding + // gradients have been computed on the TensorCore on every step. This ensures + // that the activations on every step observe the gradient updates from the + // previous step on both the sparse core and the TensorCore. + // + // true: The execution of the sparse core is pipelined with that of the + // TensorCore. The forward pass of every step on the sparse core can be + // executed after the forward pass of the previous step is complete without + // waiting for the backward pass. This improves the utilization of the sparse + // core allowing it to process step N+1 while the embedding gradients for step + // N are computed on the TensorCore. The backward pass of every step on the + // sparse core is executed directly after the forward pass for the next step + // is complete. The drawback is that embedding activations for step N+1 do not + // observe the embedding gradient updates from step N. This could affect model + // quality if step N and N+1 involve the same set of embedding IDs. However, + // since the embedding updates are sparse, this is generally not considered a + // problem. + bool pipeline_execution_with_tensor_core = 7; + + // Extended output layout information; if not provided, a compatibility mode + // will use defaults that match the old layout. Providing a value for this + // field is EXPERIMENTAL and most ways of filling it will probably break. Do + // not set it unless you know what you are doing. + TPUEmbeddingOutputLayout output_layout = 8; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration_pb2.py new file mode 100644 index 0000000..d72dbc2 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration_pb2.py @@ -0,0 +1,249 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.contrib.tpu.proto import optimization_parameters_pb2 as diplomacy__tensorflow_dot_contrib_dot_tpu_dot_proto_dot_optimization__parameters__pb2 +from diplomacy_tensorflow.contrib.tpu.proto import tpu_embedding_output_layout_pb2 as diplomacy__tensorflow_dot_contrib_dot_tpu_dot_proto_dot_tpu__embedding__output__layout__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto', + package='diplomacy.tensorflow.tpu', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nHdiplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_configuration.proto\x12\x18\x64iplomacy.tensorflow.tpu\x1a\x44\x64iplomacy_tensorflow/contrib/tpu/proto/optimization_parameters.proto\x1aHdiplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto\"\x9f\x06\n\x19TPUEmbeddingConfiguration\x12]\n\x10table_descriptor\x18\x01 \x03(\x0b\x32\x43.diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor\x12\x46\n\x04mode\x18\x02 \x01(\x0e\x32\x38.diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode\x12\"\n\x1a\x62\x61tch_size_per_tensor_core\x18\x03 \x01(\x05\x12\x11\n\tnum_hosts\x18\x04 \x01(\x05\x12\x18\n\x10num_tensor_cores\x18\x05 \x01(\x05\x12_\n\x11sharding_strategy\x18\x06 \x01(\x0e\x32\x44.diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy\x12+\n#pipeline_execution_with_tensor_core\x18\x07 \x01(\x08\x12I\n\routput_layout\x18\x08 \x01(\x0b\x32\x32.diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout\x1a\xb4\x01\n\x0fTableDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0fvocabulary_size\x18\x02 \x01(\x05\x12\x11\n\tdimension\x18\x03 \x01(\x05\x12\x14\n\x0cnum_features\x18\x04 \x01(\x05\x12Q\n\x17optimization_parameters\x18\x05 \x01(\x0b\x32\x30.diplomacy.tensorflow.tpu.OptimizationParameters\"L\n\x04Mode\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tINFERENCE\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\x12\x16\n\x12\x42\x41\x43KWARD_PASS_ONLY\x10\x03\",\n\x10ShardingStrategy\x12\x0f\n\x0b\x44IV_DEFAULT\x10\x00\x12\x07\n\x03MOD\x10\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_contrib_dot_tpu_dot_proto_dot_optimization__parameters__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_contrib_dot_tpu_dot_proto_dot_tpu__embedding__output__layout__pb2.DESCRIPTOR,]) + + + +_TPUEMBEDDINGCONFIGURATION_MODE = _descriptor.EnumDescriptor( + name='Mode', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.Mode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INFERENCE', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TRAINING', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BACKWARD_PASS_ONLY', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=924, + serialized_end=1000, +) +_sym_db.RegisterEnumDescriptor(_TPUEMBEDDINGCONFIGURATION_MODE) + +_TPUEMBEDDINGCONFIGURATION_SHARDINGSTRATEGY = _descriptor.EnumDescriptor( + name='ShardingStrategy', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.ShardingStrategy', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DIV_DEFAULT', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MOD', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1002, + serialized_end=1046, +) +_sym_db.RegisterEnumDescriptor(_TPUEMBEDDINGCONFIGURATION_SHARDINGSTRATEGY) + + +_TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR = _descriptor.Descriptor( + name='TableDescriptor', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='vocabulary_size', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.vocabulary_size', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dimension', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.dimension', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_features', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.num_features', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='optimization_parameters', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor.optimization_parameters', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=742, + serialized_end=922, +) + +_TPUEMBEDDINGCONFIGURATION = _descriptor.Descriptor( + name='TPUEmbeddingConfiguration', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='table_descriptor', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.table_descriptor', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mode', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.mode', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='batch_size_per_tensor_core', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.batch_size_per_tensor_core', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_hosts', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.num_hosts', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_tensor_cores', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.num_tensor_cores', index=4, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sharding_strategy', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.sharding_strategy', index=5, + number=6, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='pipeline_execution_with_tensor_core', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.pipeline_execution_with_tensor_core', index=6, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_layout', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.output_layout', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR, ], + enum_types=[ + _TPUEMBEDDINGCONFIGURATION_MODE, + _TPUEMBEDDINGCONFIGURATION_SHARDINGSTRATEGY, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=247, + serialized_end=1046, +) + +_TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR.fields_by_name['optimization_parameters'].message_type = diplomacy__tensorflow_dot_contrib_dot_tpu_dot_proto_dot_optimization__parameters__pb2._OPTIMIZATIONPARAMETERS +_TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR.containing_type = _TPUEMBEDDINGCONFIGURATION +_TPUEMBEDDINGCONFIGURATION.fields_by_name['table_descriptor'].message_type = _TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR +_TPUEMBEDDINGCONFIGURATION.fields_by_name['mode'].enum_type = _TPUEMBEDDINGCONFIGURATION_MODE +_TPUEMBEDDINGCONFIGURATION.fields_by_name['sharding_strategy'].enum_type = _TPUEMBEDDINGCONFIGURATION_SHARDINGSTRATEGY +_TPUEMBEDDINGCONFIGURATION.fields_by_name['output_layout'].message_type = diplomacy__tensorflow_dot_contrib_dot_tpu_dot_proto_dot_tpu__embedding__output__layout__pb2._TPUEMBEDDINGOUTPUTLAYOUT +_TPUEMBEDDINGCONFIGURATION_MODE.containing_type = _TPUEMBEDDINGCONFIGURATION +_TPUEMBEDDINGCONFIGURATION_SHARDINGSTRATEGY.containing_type = _TPUEMBEDDINGCONFIGURATION +DESCRIPTOR.message_types_by_name['TPUEmbeddingConfiguration'] = _TPUEMBEDDINGCONFIGURATION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TPUEmbeddingConfiguration = _reflection.GeneratedProtocolMessageType('TPUEmbeddingConfiguration', (_message.Message,), dict( + + TableDescriptor = _reflection.GeneratedProtocolMessageType('TableDescriptor', (_message.Message,), dict( + DESCRIPTOR = _TPUEMBEDDINGCONFIGURATION_TABLEDESCRIPTOR, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_configuration_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration.TableDescriptor) + )) + , + DESCRIPTOR = _TPUEMBEDDINGCONFIGURATION, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_configuration_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingConfiguration) + )) +_sym_db.RegisterMessage(TPUEmbeddingConfiguration) +_sym_db.RegisterMessage(TPUEmbeddingConfiguration.TableDescriptor) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.cc new file mode 100644 index 0000000..51ab826 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.cc @@ -0,0 +1,1896 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto + +#include "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TPUEmbeddingOutputLayout_OutputLocation; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TPUEmbeddingOutputLayout_TwoDOutputTensor; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingOutputLayout_EmbeddingOutputTensor; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingOutputLayout_FeatureDescriptor; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingOutputLayout_TableDescriptor; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class TPUEmbeddingOutputLayout_OutputLocationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TPUEmbeddingOutputLayout_OutputLocation_default_instance_; +class TPUEmbeddingOutputLayout_FeatureDescriptorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TPUEmbeddingOutputLayout_FeatureDescriptor_default_instance_; +class TPUEmbeddingOutputLayout_TableDescriptorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TPUEmbeddingOutputLayout_TableDescriptor_default_instance_; +class TPUEmbeddingOutputLayout_TwoDOutputTensorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TPUEmbeddingOutputLayout_TwoDOutputTensor_default_instance_; +class TPUEmbeddingOutputLayout_EmbeddingOutputTensorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* two_d_; +} _TPUEmbeddingOutputLayout_EmbeddingOutputTensor_default_instance_; +class TPUEmbeddingOutputLayoutDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TPUEmbeddingOutputLayout_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto { +static void InitDefaultsTPUEmbeddingOutputLayout_OutputLocation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_OutputLocation_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TPUEmbeddingOutputLayout_OutputLocation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTPUEmbeddingOutputLayout_OutputLocation}, {}}; + +static void InitDefaultsTPUEmbeddingOutputLayout_FeatureDescriptor() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_FeatureDescriptor_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingOutputLayout_FeatureDescriptor = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTPUEmbeddingOutputLayout_FeatureDescriptor}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_OutputLocation.base,}}; + +static void InitDefaultsTPUEmbeddingOutputLayout_TableDescriptor() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_TableDescriptor_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingOutputLayout_TableDescriptor = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTPUEmbeddingOutputLayout_TableDescriptor}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_FeatureDescriptor.base,}}; + +static void InitDefaultsTPUEmbeddingOutputLayout_TwoDOutputTensor() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_TwoDOutputTensor_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TPUEmbeddingOutputLayout_TwoDOutputTensor = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTPUEmbeddingOutputLayout_TwoDOutputTensor}, {}}; + +static void InitDefaultsTPUEmbeddingOutputLayout_EmbeddingOutputTensor() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_EmbeddingOutputTensor_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TPUEmbeddingOutputLayout_EmbeddingOutputTensor = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTPUEmbeddingOutputLayout_EmbeddingOutputTensor}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_TwoDOutputTensor.base,}}; + +static void InitDefaultsTPUEmbeddingOutputLayout() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_default_instance_; + new (ptr) ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TPUEmbeddingOutputLayout = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTPUEmbeddingOutputLayout}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_TableDescriptor.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_EmbeddingOutputTensor.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingOutputLayout_OutputLocation.base); + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingOutputLayout_FeatureDescriptor.base); + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingOutputLayout_TableDescriptor.base); + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingOutputLayout_TwoDOutputTensor.base); + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingOutputLayout_EmbeddingOutputTensor.base); + ::google::protobuf::internal::InitSCC(&scc_info_TPUEmbeddingOutputLayout.base); +} + +::google::protobuf::Metadata file_level_metadata[6]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation, tensor_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation, dim0_offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation, dim1_offset_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor, output_location_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor, feature_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor, dim0_size_per_sample_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor, dim1_size_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensorDefaultTypeInternal, two_d_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor, output_format_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout, table_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout, output_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation)}, + { 8, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor)}, + { 14, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor)}, + { 20, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor)}, + { 27, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor)}, + { 34, -1, sizeof(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_OutputLocation_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_FeatureDescriptor_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_TableDescriptor_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_TwoDOutputTensor_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_EmbeddingOutputTensor_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 6); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nHdiplomacy_tensorflow/contrib/tpu/proto" + "/tpu_embedding_output_layout.proto\022\030dipl" + "omacy.tensorflow.tpu\"\271\005\n\030TPUEmbeddingOut" + "putLayout\022Q\n\005table\030\001 \003(\0132B.diplomacy.ten" + "sorflow.tpu.TPUEmbeddingOutputLayout.Tab" + "leDescriptor\022X\n\006output\030\002 \003(\0132H.diplomacy" + ".tensorflow.tpu.TPUEmbeddingOutputLayout" + ".EmbeddingOutputTensor\032P\n\016OutputLocation" + "\022\024\n\014tensor_index\030\001 \001(\005\022\023\n\013dim0_offset\030\002 " + "\001(\005\022\023\n\013dim1_offset\030\003 \001(\005\032o\n\021FeatureDescr" + "iptor\022Z\n\017output_location\030\001 \003(\0132A.diploma" + "cy.tensorflow.tpu.TPUEmbeddingOutputLayo" + "ut.OutputLocation\032h\n\017TableDescriptor\022U\n\007" + "feature\030\001 \003(\0132D.diplomacy.tensorflow.tpu" + ".TPUEmbeddingOutputLayout.FeatureDescrip" + "tor\032C\n\020TwoDOutputTensor\022\034\n\024dim0_size_per" + "_sample\030\002 \001(\005\022\021\n\tdim1_size\030\001 \001(\005\032~\n\025Embe" + "ddingOutputTensor\022T\n\005two_d\030\004 \001(\0132C.diplo" + "macy.tensorflow.tpu.TPUEmbeddingOutputLa" + "yout.TwoDOutputTensorH\000B\017\n\routput_format" + "b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 808); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +void TPUEmbeddingOutputLayout_OutputLocation::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingOutputLayout_OutputLocation::kTensorIndexFieldNumber; +const int TPUEmbeddingOutputLayout_OutputLocation::kDim0OffsetFieldNumber; +const int TPUEmbeddingOutputLayout_OutputLocation::kDim1OffsetFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingOutputLayout_OutputLocation::TPUEmbeddingOutputLayout_OutputLocation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_OutputLocation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) +} +TPUEmbeddingOutputLayout_OutputLocation::TPUEmbeddingOutputLayout_OutputLocation(const TPUEmbeddingOutputLayout_OutputLocation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&tensor_index_, &from.tensor_index_, + static_cast(reinterpret_cast(&dim1_offset_) - + reinterpret_cast(&tensor_index_)) + sizeof(dim1_offset_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) +} + +void TPUEmbeddingOutputLayout_OutputLocation::SharedCtor() { + ::memset(&tensor_index_, 0, static_cast( + reinterpret_cast(&dim1_offset_) - + reinterpret_cast(&tensor_index_)) + sizeof(dim1_offset_)); +} + +TPUEmbeddingOutputLayout_OutputLocation::~TPUEmbeddingOutputLayout_OutputLocation() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + SharedDtor(); +} + +void TPUEmbeddingOutputLayout_OutputLocation::SharedDtor() { +} + +void TPUEmbeddingOutputLayout_OutputLocation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingOutputLayout_OutputLocation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingOutputLayout_OutputLocation& TPUEmbeddingOutputLayout_OutputLocation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_OutputLocation.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingOutputLayout_OutputLocation::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&tensor_index_, 0, static_cast( + reinterpret_cast(&dim1_offset_) - + reinterpret_cast(&tensor_index_)) + sizeof(dim1_offset_)); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingOutputLayout_OutputLocation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 tensor_index = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &tensor_index_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 dim0_offset = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dim0_offset_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 dim1_offset = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dim1_offset_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + return false; +#undef DO_ +} + +void TPUEmbeddingOutputLayout_OutputLocation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 tensor_index = 1; + if (this->tensor_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->tensor_index(), output); + } + + // int32 dim0_offset = 2; + if (this->dim0_offset() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->dim0_offset(), output); + } + + // int32 dim1_offset = 3; + if (this->dim1_offset() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->dim1_offset(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) +} + +::google::protobuf::uint8* TPUEmbeddingOutputLayout_OutputLocation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 tensor_index = 1; + if (this->tensor_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->tensor_index(), target); + } + + // int32 dim0_offset = 2; + if (this->dim0_offset() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->dim0_offset(), target); + } + + // int32 dim1_offset = 3; + if (this->dim1_offset() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->dim1_offset(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + return target; +} + +size_t TPUEmbeddingOutputLayout_OutputLocation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 tensor_index = 1; + if (this->tensor_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->tensor_index()); + } + + // int32 dim0_offset = 2; + if (this->dim0_offset() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dim0_offset()); + } + + // int32 dim1_offset = 3; + if (this->dim1_offset() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dim1_offset()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingOutputLayout_OutputLocation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingOutputLayout_OutputLocation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + MergeFrom(*source); + } +} + +void TPUEmbeddingOutputLayout_OutputLocation::MergeFrom(const TPUEmbeddingOutputLayout_OutputLocation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.tensor_index() != 0) { + set_tensor_index(from.tensor_index()); + } + if (from.dim0_offset() != 0) { + set_dim0_offset(from.dim0_offset()); + } + if (from.dim1_offset() != 0) { + set_dim1_offset(from.dim1_offset()); + } +} + +void TPUEmbeddingOutputLayout_OutputLocation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingOutputLayout_OutputLocation::CopyFrom(const TPUEmbeddingOutputLayout_OutputLocation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingOutputLayout_OutputLocation::IsInitialized() const { + return true; +} + +void TPUEmbeddingOutputLayout_OutputLocation::Swap(TPUEmbeddingOutputLayout_OutputLocation* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingOutputLayout_OutputLocation::InternalSwap(TPUEmbeddingOutputLayout_OutputLocation* other) { + using std::swap; + swap(tensor_index_, other->tensor_index_); + swap(dim0_offset_, other->dim0_offset_); + swap(dim1_offset_, other->dim1_offset_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingOutputLayout_OutputLocation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TPUEmbeddingOutputLayout_FeatureDescriptor::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingOutputLayout_FeatureDescriptor::kOutputLocationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingOutputLayout_FeatureDescriptor::TPUEmbeddingOutputLayout_FeatureDescriptor() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_FeatureDescriptor.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) +} +TPUEmbeddingOutputLayout_FeatureDescriptor::TPUEmbeddingOutputLayout_FeatureDescriptor(const TPUEmbeddingOutputLayout_FeatureDescriptor& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + output_location_(from.output_location_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::SharedCtor() { +} + +TPUEmbeddingOutputLayout_FeatureDescriptor::~TPUEmbeddingOutputLayout_FeatureDescriptor() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + SharedDtor(); +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::SharedDtor() { +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingOutputLayout_FeatureDescriptor::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingOutputLayout_FeatureDescriptor& TPUEmbeddingOutputLayout_FeatureDescriptor::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_FeatureDescriptor.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingOutputLayout_FeatureDescriptor::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + output_location_.Clear(); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingOutputLayout_FeatureDescriptor::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation output_location = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_output_location())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + return false; +#undef DO_ +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation output_location = 1; + for (unsigned int i = 0, + n = static_cast(this->output_location_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->output_location(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) +} + +::google::protobuf::uint8* TPUEmbeddingOutputLayout_FeatureDescriptor::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation output_location = 1; + for (unsigned int i = 0, + n = static_cast(this->output_location_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->output_location(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + return target; +} + +size_t TPUEmbeddingOutputLayout_FeatureDescriptor::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation output_location = 1; + { + unsigned int count = static_cast(this->output_location_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->output_location(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingOutputLayout_FeatureDescriptor* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + MergeFrom(*source); + } +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::MergeFrom(const TPUEmbeddingOutputLayout_FeatureDescriptor& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + output_location_.MergeFrom(from.output_location_); +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::CopyFrom(const TPUEmbeddingOutputLayout_FeatureDescriptor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingOutputLayout_FeatureDescriptor::IsInitialized() const { + return true; +} + +void TPUEmbeddingOutputLayout_FeatureDescriptor::Swap(TPUEmbeddingOutputLayout_FeatureDescriptor* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingOutputLayout_FeatureDescriptor::InternalSwap(TPUEmbeddingOutputLayout_FeatureDescriptor* other) { + using std::swap; + CastToBase(&output_location_)->InternalSwap(CastToBase(&other->output_location_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingOutputLayout_FeatureDescriptor::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TPUEmbeddingOutputLayout_TableDescriptor::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingOutputLayout_TableDescriptor::kFeatureFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingOutputLayout_TableDescriptor::TPUEmbeddingOutputLayout_TableDescriptor() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_TableDescriptor.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) +} +TPUEmbeddingOutputLayout_TableDescriptor::TPUEmbeddingOutputLayout_TableDescriptor(const TPUEmbeddingOutputLayout_TableDescriptor& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + feature_(from.feature_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) +} + +void TPUEmbeddingOutputLayout_TableDescriptor::SharedCtor() { +} + +TPUEmbeddingOutputLayout_TableDescriptor::~TPUEmbeddingOutputLayout_TableDescriptor() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + SharedDtor(); +} + +void TPUEmbeddingOutputLayout_TableDescriptor::SharedDtor() { +} + +void TPUEmbeddingOutputLayout_TableDescriptor::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingOutputLayout_TableDescriptor::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingOutputLayout_TableDescriptor& TPUEmbeddingOutputLayout_TableDescriptor::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_TableDescriptor.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingOutputLayout_TableDescriptor::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feature_.Clear(); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingOutputLayout_TableDescriptor::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor feature = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_feature())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + return false; +#undef DO_ +} + +void TPUEmbeddingOutputLayout_TableDescriptor::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor feature = 1; + for (unsigned int i = 0, + n = static_cast(this->feature_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->feature(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) +} + +::google::protobuf::uint8* TPUEmbeddingOutputLayout_TableDescriptor::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor feature = 1; + for (unsigned int i = 0, + n = static_cast(this->feature_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->feature(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + return target; +} + +size_t TPUEmbeddingOutputLayout_TableDescriptor::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor feature = 1; + { + unsigned int count = static_cast(this->feature_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->feature(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingOutputLayout_TableDescriptor::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingOutputLayout_TableDescriptor* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + MergeFrom(*source); + } +} + +void TPUEmbeddingOutputLayout_TableDescriptor::MergeFrom(const TPUEmbeddingOutputLayout_TableDescriptor& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feature_.MergeFrom(from.feature_); +} + +void TPUEmbeddingOutputLayout_TableDescriptor::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingOutputLayout_TableDescriptor::CopyFrom(const TPUEmbeddingOutputLayout_TableDescriptor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingOutputLayout_TableDescriptor::IsInitialized() const { + return true; +} + +void TPUEmbeddingOutputLayout_TableDescriptor::Swap(TPUEmbeddingOutputLayout_TableDescriptor* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingOutputLayout_TableDescriptor::InternalSwap(TPUEmbeddingOutputLayout_TableDescriptor* other) { + using std::swap; + CastToBase(&feature_)->InternalSwap(CastToBase(&other->feature_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingOutputLayout_TableDescriptor::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingOutputLayout_TwoDOutputTensor::kDim0SizePerSampleFieldNumber; +const int TPUEmbeddingOutputLayout_TwoDOutputTensor::kDim1SizeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingOutputLayout_TwoDOutputTensor::TPUEmbeddingOutputLayout_TwoDOutputTensor() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_TwoDOutputTensor.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) +} +TPUEmbeddingOutputLayout_TwoDOutputTensor::TPUEmbeddingOutputLayout_TwoDOutputTensor(const TPUEmbeddingOutputLayout_TwoDOutputTensor& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&dim1_size_, &from.dim1_size_, + static_cast(reinterpret_cast(&dim0_size_per_sample_) - + reinterpret_cast(&dim1_size_)) + sizeof(dim0_size_per_sample_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::SharedCtor() { + ::memset(&dim1_size_, 0, static_cast( + reinterpret_cast(&dim0_size_per_sample_) - + reinterpret_cast(&dim1_size_)) + sizeof(dim0_size_per_sample_)); +} + +TPUEmbeddingOutputLayout_TwoDOutputTensor::~TPUEmbeddingOutputLayout_TwoDOutputTensor() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + SharedDtor(); +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::SharedDtor() { +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingOutputLayout_TwoDOutputTensor::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingOutputLayout_TwoDOutputTensor& TPUEmbeddingOutputLayout_TwoDOutputTensor::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_TwoDOutputTensor.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&dim1_size_, 0, static_cast( + reinterpret_cast(&dim0_size_per_sample_) - + reinterpret_cast(&dim1_size_)) + sizeof(dim0_size_per_sample_)); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingOutputLayout_TwoDOutputTensor::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 dim1_size = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dim1_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 dim0_size_per_sample = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dim0_size_per_sample_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + return false; +#undef DO_ +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 dim1_size = 1; + if (this->dim1_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->dim1_size(), output); + } + + // int32 dim0_size_per_sample = 2; + if (this->dim0_size_per_sample() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->dim0_size_per_sample(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) +} + +::google::protobuf::uint8* TPUEmbeddingOutputLayout_TwoDOutputTensor::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 dim1_size = 1; + if (this->dim1_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->dim1_size(), target); + } + + // int32 dim0_size_per_sample = 2; + if (this->dim0_size_per_sample() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->dim0_size_per_sample(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + return target; +} + +size_t TPUEmbeddingOutputLayout_TwoDOutputTensor::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 dim1_size = 1; + if (this->dim1_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dim1_size()); + } + + // int32 dim0_size_per_sample = 2; + if (this->dim0_size_per_sample() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dim0_size_per_sample()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingOutputLayout_TwoDOutputTensor* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + MergeFrom(*source); + } +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::MergeFrom(const TPUEmbeddingOutputLayout_TwoDOutputTensor& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.dim1_size() != 0) { + set_dim1_size(from.dim1_size()); + } + if (from.dim0_size_per_sample() != 0) { + set_dim0_size_per_sample(from.dim0_size_per_sample()); + } +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::CopyFrom(const TPUEmbeddingOutputLayout_TwoDOutputTensor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingOutputLayout_TwoDOutputTensor::IsInitialized() const { + return true; +} + +void TPUEmbeddingOutputLayout_TwoDOutputTensor::Swap(TPUEmbeddingOutputLayout_TwoDOutputTensor* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingOutputLayout_TwoDOutputTensor::InternalSwap(TPUEmbeddingOutputLayout_TwoDOutputTensor* other) { + using std::swap; + swap(dim1_size_, other->dim1_size_); + swap(dim0_size_per_sample_, other->dim0_size_per_sample_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingOutputLayout_TwoDOutputTensor::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::InitAsDefaultInstance() { + ::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_EmbeddingOutputTensor_default_instance_.two_d_ = const_cast< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor*>( + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor::internal_default_instance()); +} +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::set_allocated_two_d(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* two_d) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_output_format(); + if (two_d) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + two_d = ::google::protobuf::internal::GetOwnedMessage( + message_arena, two_d, submessage_arena); + } + set_has_two_d(); + output_format_.two_d_ = two_d; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor.two_d) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingOutputLayout_EmbeddingOutputTensor::kTwoDFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingOutputLayout_EmbeddingOutputTensor::TPUEmbeddingOutputLayout_EmbeddingOutputTensor() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_EmbeddingOutputTensor.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) +} +TPUEmbeddingOutputLayout_EmbeddingOutputTensor::TPUEmbeddingOutputLayout_EmbeddingOutputTensor(const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_output_format(); + switch (from.output_format_case()) { + case kTwoD: { + mutable_two_d()->::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor::MergeFrom(from.two_d()); + break; + } + case OUTPUT_FORMAT_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::SharedCtor() { + clear_has_output_format(); +} + +TPUEmbeddingOutputLayout_EmbeddingOutputTensor::~TPUEmbeddingOutputLayout_EmbeddingOutputTensor() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + SharedDtor(); +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::SharedDtor() { + if (has_output_format()) { + clear_output_format(); + } +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingOutputLayout_EmbeddingOutputTensor::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& TPUEmbeddingOutputLayout_EmbeddingOutputTensor::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout_EmbeddingOutputTensor.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::clear_output_format() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + switch (output_format_case()) { + case kTwoD: { + delete output_format_.two_d_; + break; + } + case OUTPUT_FORMAT_NOT_SET: { + break; + } + } + _oneof_case_[0] = OUTPUT_FORMAT_NOT_SET; +} + + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_output_format(); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingOutputLayout_EmbeddingOutputTensor::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor two_d = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_two_d())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + return false; +#undef DO_ +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor two_d = 4; + if (has_two_d()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_two_d(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) +} + +::google::protobuf::uint8* TPUEmbeddingOutputLayout_EmbeddingOutputTensor::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor two_d = 4; + if (has_two_d()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_two_d(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + return target; +} + +size_t TPUEmbeddingOutputLayout_EmbeddingOutputTensor::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (output_format_case()) { + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor two_d = 4; + case kTwoD: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *output_format_.two_d_); + break; + } + case OUTPUT_FORMAT_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingOutputLayout_EmbeddingOutputTensor* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + MergeFrom(*source); + } +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::MergeFrom(const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.output_format_case()) { + case kTwoD: { + mutable_two_d()->::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor::MergeFrom(from.two_d()); + break; + } + case OUTPUT_FORMAT_NOT_SET: { + break; + } + } +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::CopyFrom(const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingOutputLayout_EmbeddingOutputTensor::IsInitialized() const { + return true; +} + +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::Swap(TPUEmbeddingOutputLayout_EmbeddingOutputTensor* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::InternalSwap(TPUEmbeddingOutputLayout_EmbeddingOutputTensor* other) { + using std::swap; + swap(output_format_, other->output_format_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingOutputLayout_EmbeddingOutputTensor::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TPUEmbeddingOutputLayout::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TPUEmbeddingOutputLayout::kTableFieldNumber; +const int TPUEmbeddingOutputLayout::kOutputFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TPUEmbeddingOutputLayout::TPUEmbeddingOutputLayout() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) +} +TPUEmbeddingOutputLayout::TPUEmbeddingOutputLayout(const TPUEmbeddingOutputLayout& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + table_(from.table_), + output_(from.output_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) +} + +void TPUEmbeddingOutputLayout::SharedCtor() { +} + +TPUEmbeddingOutputLayout::~TPUEmbeddingOutputLayout() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + SharedDtor(); +} + +void TPUEmbeddingOutputLayout::SharedDtor() { +} + +void TPUEmbeddingOutputLayout::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TPUEmbeddingOutputLayout::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TPUEmbeddingOutputLayout& TPUEmbeddingOutputLayout::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::scc_info_TPUEmbeddingOutputLayout.base); + return *internal_default_instance(); +} + + +void TPUEmbeddingOutputLayout::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + table_.Clear(); + output_.Clear(); + _internal_metadata_.Clear(); +} + +bool TPUEmbeddingOutputLayout::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor table = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_table())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor output = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_output())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + return false; +#undef DO_ +} + +void TPUEmbeddingOutputLayout::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor table = 1; + for (unsigned int i = 0, + n = static_cast(this->table_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->table(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor output = 2; + for (unsigned int i = 0, + n = static_cast(this->output_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->output(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) +} + +::google::protobuf::uint8* TPUEmbeddingOutputLayout::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor table = 1; + for (unsigned int i = 0, + n = static_cast(this->table_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->table(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor output = 2; + for (unsigned int i = 0, + n = static_cast(this->output_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->output(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + return target; +} + +size_t TPUEmbeddingOutputLayout::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor table = 1; + { + unsigned int count = static_cast(this->table_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->table(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor output = 2; + { + unsigned int count = static_cast(this->output_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->output(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TPUEmbeddingOutputLayout::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + GOOGLE_DCHECK_NE(&from, this); + const TPUEmbeddingOutputLayout* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + MergeFrom(*source); + } +} + +void TPUEmbeddingOutputLayout::MergeFrom(const TPUEmbeddingOutputLayout& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + table_.MergeFrom(from.table_); + output_.MergeFrom(from.output_); +} + +void TPUEmbeddingOutputLayout::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TPUEmbeddingOutputLayout::CopyFrom(const TPUEmbeddingOutputLayout& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TPUEmbeddingOutputLayout::IsInitialized() const { + return true; +} + +void TPUEmbeddingOutputLayout::Swap(TPUEmbeddingOutputLayout* other) { + if (other == this) return; + InternalSwap(other); +} +void TPUEmbeddingOutputLayout::InternalSwap(TPUEmbeddingOutputLayout* other) { + using std::swap; + CastToBase(&table_)->InternalSwap(CastToBase(&other->table_)); + CastToBase(&output_)->InternalSwap(CastToBase(&other->output_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TPUEmbeddingOutputLayout::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.h new file mode 100644 index 0000000..f0edb64 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.pb.h @@ -0,0 +1,1080 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[6]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tpu { +class TPUEmbeddingOutputLayout; +class TPUEmbeddingOutputLayoutDefaultTypeInternal; +extern TPUEmbeddingOutputLayoutDefaultTypeInternal _TPUEmbeddingOutputLayout_default_instance_; +class TPUEmbeddingOutputLayout_EmbeddingOutputTensor; +class TPUEmbeddingOutputLayout_EmbeddingOutputTensorDefaultTypeInternal; +extern TPUEmbeddingOutputLayout_EmbeddingOutputTensorDefaultTypeInternal _TPUEmbeddingOutputLayout_EmbeddingOutputTensor_default_instance_; +class TPUEmbeddingOutputLayout_FeatureDescriptor; +class TPUEmbeddingOutputLayout_FeatureDescriptorDefaultTypeInternal; +extern TPUEmbeddingOutputLayout_FeatureDescriptorDefaultTypeInternal _TPUEmbeddingOutputLayout_FeatureDescriptor_default_instance_; +class TPUEmbeddingOutputLayout_OutputLocation; +class TPUEmbeddingOutputLayout_OutputLocationDefaultTypeInternal; +extern TPUEmbeddingOutputLayout_OutputLocationDefaultTypeInternal _TPUEmbeddingOutputLayout_OutputLocation_default_instance_; +class TPUEmbeddingOutputLayout_TableDescriptor; +class TPUEmbeddingOutputLayout_TableDescriptorDefaultTypeInternal; +extern TPUEmbeddingOutputLayout_TableDescriptorDefaultTypeInternal _TPUEmbeddingOutputLayout_TableDescriptor_default_instance_; +class TPUEmbeddingOutputLayout_TwoDOutputTensor; +class TPUEmbeddingOutputLayout_TwoDOutputTensorDefaultTypeInternal; +extern TPUEmbeddingOutputLayout_TwoDOutputTensorDefaultTypeInternal _TPUEmbeddingOutputLayout_TwoDOutputTensor_default_instance_; +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout>(Arena*); +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor>(Arena*); +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor>(Arena*); +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation>(Arena*); +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor>(Arena*); +template<> ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* Arena::CreateMaybeMessage<::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace tpu { + +// =================================================================== + +class TPUEmbeddingOutputLayout_OutputLocation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) */ { + public: + TPUEmbeddingOutputLayout_OutputLocation(); + virtual ~TPUEmbeddingOutputLayout_OutputLocation(); + + TPUEmbeddingOutputLayout_OutputLocation(const TPUEmbeddingOutputLayout_OutputLocation& from); + + inline TPUEmbeddingOutputLayout_OutputLocation& operator=(const TPUEmbeddingOutputLayout_OutputLocation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingOutputLayout_OutputLocation(TPUEmbeddingOutputLayout_OutputLocation&& from) noexcept + : TPUEmbeddingOutputLayout_OutputLocation() { + *this = ::std::move(from); + } + + inline TPUEmbeddingOutputLayout_OutputLocation& operator=(TPUEmbeddingOutputLayout_OutputLocation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingOutputLayout_OutputLocation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingOutputLayout_OutputLocation* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingOutputLayout_OutputLocation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(TPUEmbeddingOutputLayout_OutputLocation* other); + friend void swap(TPUEmbeddingOutputLayout_OutputLocation& a, TPUEmbeddingOutputLayout_OutputLocation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingOutputLayout_OutputLocation* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingOutputLayout_OutputLocation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingOutputLayout_OutputLocation& from); + void MergeFrom(const TPUEmbeddingOutputLayout_OutputLocation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingOutputLayout_OutputLocation* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 tensor_index = 1; + void clear_tensor_index(); + static const int kTensorIndexFieldNumber = 1; + ::google::protobuf::int32 tensor_index() const; + void set_tensor_index(::google::protobuf::int32 value); + + // int32 dim0_offset = 2; + void clear_dim0_offset(); + static const int kDim0OffsetFieldNumber = 2; + ::google::protobuf::int32 dim0_offset() const; + void set_dim0_offset(::google::protobuf::int32 value); + + // int32 dim1_offset = 3; + void clear_dim1_offset(); + static const int kDim1OffsetFieldNumber = 3; + ::google::protobuf::int32 dim1_offset() const; + void set_dim1_offset(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int32 tensor_index_; + ::google::protobuf::int32 dim0_offset_; + ::google::protobuf::int32 dim1_offset_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TPUEmbeddingOutputLayout_FeatureDescriptor : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) */ { + public: + TPUEmbeddingOutputLayout_FeatureDescriptor(); + virtual ~TPUEmbeddingOutputLayout_FeatureDescriptor(); + + TPUEmbeddingOutputLayout_FeatureDescriptor(const TPUEmbeddingOutputLayout_FeatureDescriptor& from); + + inline TPUEmbeddingOutputLayout_FeatureDescriptor& operator=(const TPUEmbeddingOutputLayout_FeatureDescriptor& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingOutputLayout_FeatureDescriptor(TPUEmbeddingOutputLayout_FeatureDescriptor&& from) noexcept + : TPUEmbeddingOutputLayout_FeatureDescriptor() { + *this = ::std::move(from); + } + + inline TPUEmbeddingOutputLayout_FeatureDescriptor& operator=(TPUEmbeddingOutputLayout_FeatureDescriptor&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingOutputLayout_FeatureDescriptor& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingOutputLayout_FeatureDescriptor* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingOutputLayout_FeatureDescriptor_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(TPUEmbeddingOutputLayout_FeatureDescriptor* other); + friend void swap(TPUEmbeddingOutputLayout_FeatureDescriptor& a, TPUEmbeddingOutputLayout_FeatureDescriptor& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingOutputLayout_FeatureDescriptor* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingOutputLayout_FeatureDescriptor* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingOutputLayout_FeatureDescriptor& from); + void MergeFrom(const TPUEmbeddingOutputLayout_FeatureDescriptor& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingOutputLayout_FeatureDescriptor* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation output_location = 1; + int output_location_size() const; + void clear_output_location(); + static const int kOutputLocationFieldNumber = 1; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation* mutable_output_location(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation >* + mutable_output_location(); + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation& output_location(int index) const; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation* add_output_location(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation >& + output_location() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation > output_location_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TPUEmbeddingOutputLayout_TableDescriptor : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) */ { + public: + TPUEmbeddingOutputLayout_TableDescriptor(); + virtual ~TPUEmbeddingOutputLayout_TableDescriptor(); + + TPUEmbeddingOutputLayout_TableDescriptor(const TPUEmbeddingOutputLayout_TableDescriptor& from); + + inline TPUEmbeddingOutputLayout_TableDescriptor& operator=(const TPUEmbeddingOutputLayout_TableDescriptor& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingOutputLayout_TableDescriptor(TPUEmbeddingOutputLayout_TableDescriptor&& from) noexcept + : TPUEmbeddingOutputLayout_TableDescriptor() { + *this = ::std::move(from); + } + + inline TPUEmbeddingOutputLayout_TableDescriptor& operator=(TPUEmbeddingOutputLayout_TableDescriptor&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingOutputLayout_TableDescriptor& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingOutputLayout_TableDescriptor* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingOutputLayout_TableDescriptor_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(TPUEmbeddingOutputLayout_TableDescriptor* other); + friend void swap(TPUEmbeddingOutputLayout_TableDescriptor& a, TPUEmbeddingOutputLayout_TableDescriptor& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingOutputLayout_TableDescriptor* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingOutputLayout_TableDescriptor* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingOutputLayout_TableDescriptor& from); + void MergeFrom(const TPUEmbeddingOutputLayout_TableDescriptor& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingOutputLayout_TableDescriptor* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor feature = 1; + int feature_size() const; + void clear_feature(); + static const int kFeatureFieldNumber = 1; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor* mutable_feature(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor >* + mutable_feature(); + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor& feature(int index) const; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor* add_feature(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor >& + feature() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor > feature_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TPUEmbeddingOutputLayout_TwoDOutputTensor : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) */ { + public: + TPUEmbeddingOutputLayout_TwoDOutputTensor(); + virtual ~TPUEmbeddingOutputLayout_TwoDOutputTensor(); + + TPUEmbeddingOutputLayout_TwoDOutputTensor(const TPUEmbeddingOutputLayout_TwoDOutputTensor& from); + + inline TPUEmbeddingOutputLayout_TwoDOutputTensor& operator=(const TPUEmbeddingOutputLayout_TwoDOutputTensor& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingOutputLayout_TwoDOutputTensor(TPUEmbeddingOutputLayout_TwoDOutputTensor&& from) noexcept + : TPUEmbeddingOutputLayout_TwoDOutputTensor() { + *this = ::std::move(from); + } + + inline TPUEmbeddingOutputLayout_TwoDOutputTensor& operator=(TPUEmbeddingOutputLayout_TwoDOutputTensor&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingOutputLayout_TwoDOutputTensor& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingOutputLayout_TwoDOutputTensor* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingOutputLayout_TwoDOutputTensor_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(TPUEmbeddingOutputLayout_TwoDOutputTensor* other); + friend void swap(TPUEmbeddingOutputLayout_TwoDOutputTensor& a, TPUEmbeddingOutputLayout_TwoDOutputTensor& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingOutputLayout_TwoDOutputTensor* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingOutputLayout_TwoDOutputTensor* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingOutputLayout_TwoDOutputTensor& from); + void MergeFrom(const TPUEmbeddingOutputLayout_TwoDOutputTensor& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingOutputLayout_TwoDOutputTensor* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 dim1_size = 1; + void clear_dim1_size(); + static const int kDim1SizeFieldNumber = 1; + ::google::protobuf::int32 dim1_size() const; + void set_dim1_size(::google::protobuf::int32 value); + + // int32 dim0_size_per_sample = 2; + void clear_dim0_size_per_sample(); + static const int kDim0SizePerSampleFieldNumber = 2; + ::google::protobuf::int32 dim0_size_per_sample() const; + void set_dim0_size_per_sample(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int32 dim1_size_; + ::google::protobuf::int32 dim0_size_per_sample_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TPUEmbeddingOutputLayout_EmbeddingOutputTensor : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) */ { + public: + TPUEmbeddingOutputLayout_EmbeddingOutputTensor(); + virtual ~TPUEmbeddingOutputLayout_EmbeddingOutputTensor(); + + TPUEmbeddingOutputLayout_EmbeddingOutputTensor(const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& from); + + inline TPUEmbeddingOutputLayout_EmbeddingOutputTensor& operator=(const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingOutputLayout_EmbeddingOutputTensor(TPUEmbeddingOutputLayout_EmbeddingOutputTensor&& from) noexcept + : TPUEmbeddingOutputLayout_EmbeddingOutputTensor() { + *this = ::std::move(from); + } + + inline TPUEmbeddingOutputLayout_EmbeddingOutputTensor& operator=(TPUEmbeddingOutputLayout_EmbeddingOutputTensor&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& default_instance(); + + enum OutputFormatCase { + kTwoD = 4, + OUTPUT_FORMAT_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingOutputLayout_EmbeddingOutputTensor* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingOutputLayout_EmbeddingOutputTensor_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(TPUEmbeddingOutputLayout_EmbeddingOutputTensor* other); + friend void swap(TPUEmbeddingOutputLayout_EmbeddingOutputTensor& a, TPUEmbeddingOutputLayout_EmbeddingOutputTensor& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingOutputLayout_EmbeddingOutputTensor* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingOutputLayout_EmbeddingOutputTensor* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& from); + void MergeFrom(const TPUEmbeddingOutputLayout_EmbeddingOutputTensor& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingOutputLayout_EmbeddingOutputTensor* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor two_d = 4; + bool has_two_d() const; + void clear_two_d(); + static const int kTwoDFieldNumber = 4; + private: + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor& _internal_two_d() const; + public: + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor& two_d() const; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* release_two_d(); + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* mutable_two_d(); + void set_allocated_two_d(::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* two_d); + + void clear_output_format(); + OutputFormatCase output_format_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + private: + void set_has_two_d(); + + inline bool has_output_format() const; + inline void clear_has_output_format(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + union OutputFormatUnion { + OutputFormatUnion() {} + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* two_d_; + } output_format_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TPUEmbeddingOutputLayout : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) */ { + public: + TPUEmbeddingOutputLayout(); + virtual ~TPUEmbeddingOutputLayout(); + + TPUEmbeddingOutputLayout(const TPUEmbeddingOutputLayout& from); + + inline TPUEmbeddingOutputLayout& operator=(const TPUEmbeddingOutputLayout& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TPUEmbeddingOutputLayout(TPUEmbeddingOutputLayout&& from) noexcept + : TPUEmbeddingOutputLayout() { + *this = ::std::move(from); + } + + inline TPUEmbeddingOutputLayout& operator=(TPUEmbeddingOutputLayout&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const TPUEmbeddingOutputLayout& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TPUEmbeddingOutputLayout* internal_default_instance() { + return reinterpret_cast( + &_TPUEmbeddingOutputLayout_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void Swap(TPUEmbeddingOutputLayout* other); + friend void swap(TPUEmbeddingOutputLayout& a, TPUEmbeddingOutputLayout& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TPUEmbeddingOutputLayout* New() const final { + return CreateMaybeMessage(NULL); + } + + TPUEmbeddingOutputLayout* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TPUEmbeddingOutputLayout& from); + void MergeFrom(const TPUEmbeddingOutputLayout& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TPUEmbeddingOutputLayout* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef TPUEmbeddingOutputLayout_OutputLocation OutputLocation; + typedef TPUEmbeddingOutputLayout_FeatureDescriptor FeatureDescriptor; + typedef TPUEmbeddingOutputLayout_TableDescriptor TableDescriptor; + typedef TPUEmbeddingOutputLayout_TwoDOutputTensor TwoDOutputTensor; + typedef TPUEmbeddingOutputLayout_EmbeddingOutputTensor EmbeddingOutputTensor; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor table = 1; + int table_size() const; + void clear_table(); + static const int kTableFieldNumber = 1; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor* mutable_table(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor >* + mutable_table(); + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor& table(int index) const; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor* add_table(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor >& + table() const; + + // repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor output = 2; + int output_size() const; + void clear_output(); + static const int kOutputFieldNumber = 2; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor* mutable_output(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor >* + mutable_output(); + const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor& output(int index) const; + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor* add_output(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor >& + output() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor > table_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor > output_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TPUEmbeddingOutputLayout_OutputLocation + +// int32 tensor_index = 1; +inline void TPUEmbeddingOutputLayout_OutputLocation::clear_tensor_index() { + tensor_index_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingOutputLayout_OutputLocation::tensor_index() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.tensor_index) + return tensor_index_; +} +inline void TPUEmbeddingOutputLayout_OutputLocation::set_tensor_index(::google::protobuf::int32 value) { + + tensor_index_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.tensor_index) +} + +// int32 dim0_offset = 2; +inline void TPUEmbeddingOutputLayout_OutputLocation::clear_dim0_offset() { + dim0_offset_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingOutputLayout_OutputLocation::dim0_offset() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.dim0_offset) + return dim0_offset_; +} +inline void TPUEmbeddingOutputLayout_OutputLocation::set_dim0_offset(::google::protobuf::int32 value) { + + dim0_offset_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.dim0_offset) +} + +// int32 dim1_offset = 3; +inline void TPUEmbeddingOutputLayout_OutputLocation::clear_dim1_offset() { + dim1_offset_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingOutputLayout_OutputLocation::dim1_offset() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.dim1_offset) + return dim1_offset_; +} +inline void TPUEmbeddingOutputLayout_OutputLocation::set_dim1_offset(::google::protobuf::int32 value) { + + dim1_offset_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.dim1_offset) +} + +// ------------------------------------------------------------------- + +// TPUEmbeddingOutputLayout_FeatureDescriptor + +// repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation output_location = 1; +inline int TPUEmbeddingOutputLayout_FeatureDescriptor::output_location_size() const { + return output_location_.size(); +} +inline void TPUEmbeddingOutputLayout_FeatureDescriptor::clear_output_location() { + output_location_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation* TPUEmbeddingOutputLayout_FeatureDescriptor::mutable_output_location(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor.output_location) + return output_location_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation >* +TPUEmbeddingOutputLayout_FeatureDescriptor::mutable_output_location() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor.output_location) + return &output_location_; +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation& TPUEmbeddingOutputLayout_FeatureDescriptor::output_location(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor.output_location) + return output_location_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation* TPUEmbeddingOutputLayout_FeatureDescriptor::add_output_location() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor.output_location) + return output_location_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_OutputLocation >& +TPUEmbeddingOutputLayout_FeatureDescriptor::output_location() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor.output_location) + return output_location_; +} + +// ------------------------------------------------------------------- + +// TPUEmbeddingOutputLayout_TableDescriptor + +// repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor feature = 1; +inline int TPUEmbeddingOutputLayout_TableDescriptor::feature_size() const { + return feature_.size(); +} +inline void TPUEmbeddingOutputLayout_TableDescriptor::clear_feature() { + feature_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor* TPUEmbeddingOutputLayout_TableDescriptor::mutable_feature(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor.feature) + return feature_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor >* +TPUEmbeddingOutputLayout_TableDescriptor::mutable_feature() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor.feature) + return &feature_; +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor& TPUEmbeddingOutputLayout_TableDescriptor::feature(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor.feature) + return feature_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor* TPUEmbeddingOutputLayout_TableDescriptor::add_feature() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor.feature) + return feature_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_FeatureDescriptor >& +TPUEmbeddingOutputLayout_TableDescriptor::feature() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor.feature) + return feature_; +} + +// ------------------------------------------------------------------- + +// TPUEmbeddingOutputLayout_TwoDOutputTensor + +// int32 dim0_size_per_sample = 2; +inline void TPUEmbeddingOutputLayout_TwoDOutputTensor::clear_dim0_size_per_sample() { + dim0_size_per_sample_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingOutputLayout_TwoDOutputTensor::dim0_size_per_sample() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor.dim0_size_per_sample) + return dim0_size_per_sample_; +} +inline void TPUEmbeddingOutputLayout_TwoDOutputTensor::set_dim0_size_per_sample(::google::protobuf::int32 value) { + + dim0_size_per_sample_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor.dim0_size_per_sample) +} + +// int32 dim1_size = 1; +inline void TPUEmbeddingOutputLayout_TwoDOutputTensor::clear_dim1_size() { + dim1_size_ = 0; +} +inline ::google::protobuf::int32 TPUEmbeddingOutputLayout_TwoDOutputTensor::dim1_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor.dim1_size) + return dim1_size_; +} +inline void TPUEmbeddingOutputLayout_TwoDOutputTensor::set_dim1_size(::google::protobuf::int32 value) { + + dim1_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor.dim1_size) +} + +// ------------------------------------------------------------------- + +// TPUEmbeddingOutputLayout_EmbeddingOutputTensor + +// .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor two_d = 4; +inline bool TPUEmbeddingOutputLayout_EmbeddingOutputTensor::has_two_d() const { + return output_format_case() == kTwoD; +} +inline void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::set_has_two_d() { + _oneof_case_[0] = kTwoD; +} +inline void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::clear_two_d() { + if (has_two_d()) { + delete output_format_.two_d_; + clear_has_output_format(); + } +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor& TPUEmbeddingOutputLayout_EmbeddingOutputTensor::_internal_two_d() const { + return *output_format_.two_d_; +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* TPUEmbeddingOutputLayout_EmbeddingOutputTensor::release_two_d() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor.two_d) + if (has_two_d()) { + clear_has_output_format(); + ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* temp = output_format_.two_d_; + output_format_.two_d_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor& TPUEmbeddingOutputLayout_EmbeddingOutputTensor::two_d() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor.two_d) + return has_two_d() + ? *output_format_.two_d_ + : *reinterpret_cast< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor*>(&::diplomacy::tensorflow::tpu::_TPUEmbeddingOutputLayout_TwoDOutputTensor_default_instance_); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor* TPUEmbeddingOutputLayout_EmbeddingOutputTensor::mutable_two_d() { + if (!has_two_d()) { + clear_output_format(); + set_has_two_d(); + output_format_.two_d_ = CreateMaybeMessage< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TwoDOutputTensor >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor.two_d) + return output_format_.two_d_; +} + +inline bool TPUEmbeddingOutputLayout_EmbeddingOutputTensor::has_output_format() const { + return output_format_case() != OUTPUT_FORMAT_NOT_SET; +} +inline void TPUEmbeddingOutputLayout_EmbeddingOutputTensor::clear_has_output_format() { + _oneof_case_[0] = OUTPUT_FORMAT_NOT_SET; +} +inline TPUEmbeddingOutputLayout_EmbeddingOutputTensor::OutputFormatCase TPUEmbeddingOutputLayout_EmbeddingOutputTensor::output_format_case() const { + return TPUEmbeddingOutputLayout_EmbeddingOutputTensor::OutputFormatCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// TPUEmbeddingOutputLayout + +// repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor table = 1; +inline int TPUEmbeddingOutputLayout::table_size() const { + return table_.size(); +} +inline void TPUEmbeddingOutputLayout::clear_table() { + table_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor* TPUEmbeddingOutputLayout::mutable_table(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.table) + return table_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor >* +TPUEmbeddingOutputLayout::mutable_table() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.table) + return &table_; +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor& TPUEmbeddingOutputLayout::table(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.table) + return table_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor* TPUEmbeddingOutputLayout::add_table() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.table) + return table_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_TableDescriptor >& +TPUEmbeddingOutputLayout::table() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.table) + return table_; +} + +// repeated .diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor output = 2; +inline int TPUEmbeddingOutputLayout::output_size() const { + return output_.size(); +} +inline void TPUEmbeddingOutputLayout::clear_output() { + output_.Clear(); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor* TPUEmbeddingOutputLayout::mutable_output(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.output) + return output_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor >* +TPUEmbeddingOutputLayout::mutable_output() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.output) + return &output_; +} +inline const ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor& TPUEmbeddingOutputLayout::output(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.output) + return output_.Get(index); +} +inline ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor* TPUEmbeddingOutputLayout::add_output() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.output) + return output_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::tpu::TPUEmbeddingOutputLayout_EmbeddingOutputTensor >& +TPUEmbeddingOutputLayout::output() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.output) + return output_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tpu +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftpu_2fproto_2ftpu_5fembedding_5foutput_5flayout_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto new file mode 100644 index 0000000..1fcd623 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.tpu; + +// In the comments here, "layout" refers to the top-level EmbeddingOutputLayout +// proto contained in the TPUEmbeddingConfiguration. + +// The embedding output consists of a list of tensors, each specified by an +// EmbeddingOutputTensor proto within the EmbeddingOutputLayout (the "output" +// field). Each table and feature lookup is then placed into some number of +// particular positions within some output tensor (identified by "tensor_index" +// within OutputLocation). The tree of table lookups, feature lookups, and +// output locations is specified by the +// "table(table_id).feature(feature_id).output_location" repeated fields within +// EmbeddingOutputLayout. + +message TPUEmbeddingOutputLayout { + // Location of one copy of the feature's data. + message OutputLocation { + // Which output tensor this copy of the feature will go into. Must be + // between 0 and layout.output_size(). + int32 tensor_index = 1; + + // Offset in dimension 0 for this feature copy. Must be between 0 and + // layout.output(tensor_index).dim0_size_per_sample(). + int32 dim0_offset = 2; + + // Offset in dimension 1 for this feature copy. Must be between 0 and + // layout.output(tensor_index).dim1_size() - table width; repeated or + // partially/fully overlapping values are allowed and results in the same + // range will be summed (with the gradients replicated in the backward + // pass). + int32 dim1_offset = 3; + } + + // Description of the output placement for one feature. + message FeatureDescriptor { + // Typically, only one copy of each feature is used, but multiple are + // allowed and the same data will be copied to all of them (with the + // gradients summed in the backward pass). + repeated OutputLocation output_location = 1; + } + + // Description of the output placement for features of one table. + message TableDescriptor { + // Output locations for each feature loaded from this table. + repeated FeatureDescriptor feature = 1; + } + // Output locations for each feature of each table. + repeated TableDescriptor table = 1; + + // Data layout and shape computation information for a single output tensor. + // Any unused locations in the tensor will be filled with zeros, and + // corresponding gradients will be ignored. + + // Size and layout information for 2-D tensors. + message TwoDOutputTensor { + // Multiplier for output dimension 0 size; used to match legacy format that + // stacks features within a sample in dimension 0. + int32 dim0_size_per_sample = 2; + + // The size (in dimension 1) of this output tensor. + int32 dim1_size = 1; + } + + // Format information for a single output tensor. + message EmbeddingOutputTensor { + oneof output_format { + TwoDOutputTensor two_d = 4; + } + } + + // Shape and layout information for each tensor. + repeated EmbeddingOutputTensor output = 2; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout_pb2.py new file mode 100644 index 0000000..5515a54 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout_pb2.py @@ -0,0 +1,303 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto', + package='diplomacy.tensorflow.tpu', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\nHdiplomacy_tensorflow/contrib/tpu/proto/tpu_embedding_output_layout.proto\x12\x18\x64iplomacy.tensorflow.tpu\"\xb9\x05\n\x18TPUEmbeddingOutputLayout\x12Q\n\x05table\x18\x01 \x03(\x0b\x32\x42.diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor\x12X\n\x06output\x18\x02 \x03(\x0b\x32H.diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor\x1aP\n\x0eOutputLocation\x12\x14\n\x0ctensor_index\x18\x01 \x01(\x05\x12\x13\n\x0b\x64im0_offset\x18\x02 \x01(\x05\x12\x13\n\x0b\x64im1_offset\x18\x03 \x01(\x05\x1ao\n\x11\x46\x65\x61tureDescriptor\x12Z\n\x0foutput_location\x18\x01 \x03(\x0b\x32\x41.diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation\x1ah\n\x0fTableDescriptor\x12U\n\x07\x66\x65\x61ture\x18\x01 \x03(\x0b\x32\x44.diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor\x1a\x43\n\x10TwoDOutputTensor\x12\x1c\n\x14\x64im0_size_per_sample\x18\x02 \x01(\x05\x12\x11\n\tdim1_size\x18\x01 \x01(\x05\x1a~\n\x15\x45mbeddingOutputTensor\x12T\n\x05two_d\x18\x04 \x01(\x0b\x32\x43.diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensorH\x00\x42\x0f\n\routput_formatb\x06proto3') +) + + + + +_TPUEMBEDDINGOUTPUTLAYOUT_OUTPUTLOCATION = _descriptor.Descriptor( + name='OutputLocation', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tensor_index', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.tensor_index', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dim0_offset', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.dim0_offset', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dim1_offset', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation.dim1_offset', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=304, + serialized_end=384, +) + +_TPUEMBEDDINGOUTPUTLAYOUT_FEATUREDESCRIPTOR = _descriptor.Descriptor( + name='FeatureDescriptor', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='output_location', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor.output_location', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=386, + serialized_end=497, +) + +_TPUEMBEDDINGOUTPUTLAYOUT_TABLEDESCRIPTOR = _descriptor.Descriptor( + name='TableDescriptor', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor.feature', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=499, + serialized_end=603, +) + +_TPUEMBEDDINGOUTPUTLAYOUT_TWODOUTPUTTENSOR = _descriptor.Descriptor( + name='TwoDOutputTensor', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dim0_size_per_sample', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor.dim0_size_per_sample', index=0, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dim1_size', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor.dim1_size', index=1, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=605, + serialized_end=672, +) + +_TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR = _descriptor.Descriptor( + name='EmbeddingOutputTensor', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='two_d', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor.two_d', index=0, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='output_format', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor.output_format', + index=0, containing_type=None, fields=[]), + ], + serialized_start=674, + serialized_end=800, +) + +_TPUEMBEDDINGOUTPUTLAYOUT = _descriptor.Descriptor( + name='TPUEmbeddingOutputLayout', + full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='table', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.table', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output', full_name='diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.output', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TPUEMBEDDINGOUTPUTLAYOUT_OUTPUTLOCATION, _TPUEMBEDDINGOUTPUTLAYOUT_FEATUREDESCRIPTOR, _TPUEMBEDDINGOUTPUTLAYOUT_TABLEDESCRIPTOR, _TPUEMBEDDINGOUTPUTLAYOUT_TWODOUTPUTTENSOR, _TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=103, + serialized_end=800, +) + +_TPUEMBEDDINGOUTPUTLAYOUT_OUTPUTLOCATION.containing_type = _TPUEMBEDDINGOUTPUTLAYOUT +_TPUEMBEDDINGOUTPUTLAYOUT_FEATUREDESCRIPTOR.fields_by_name['output_location'].message_type = _TPUEMBEDDINGOUTPUTLAYOUT_OUTPUTLOCATION +_TPUEMBEDDINGOUTPUTLAYOUT_FEATUREDESCRIPTOR.containing_type = _TPUEMBEDDINGOUTPUTLAYOUT +_TPUEMBEDDINGOUTPUTLAYOUT_TABLEDESCRIPTOR.fields_by_name['feature'].message_type = _TPUEMBEDDINGOUTPUTLAYOUT_FEATUREDESCRIPTOR +_TPUEMBEDDINGOUTPUTLAYOUT_TABLEDESCRIPTOR.containing_type = _TPUEMBEDDINGOUTPUTLAYOUT +_TPUEMBEDDINGOUTPUTLAYOUT_TWODOUTPUTTENSOR.containing_type = _TPUEMBEDDINGOUTPUTLAYOUT +_TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR.fields_by_name['two_d'].message_type = _TPUEMBEDDINGOUTPUTLAYOUT_TWODOUTPUTTENSOR +_TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR.containing_type = _TPUEMBEDDINGOUTPUTLAYOUT +_TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR.oneofs_by_name['output_format'].fields.append( + _TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR.fields_by_name['two_d']) +_TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR.fields_by_name['two_d'].containing_oneof = _TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR.oneofs_by_name['output_format'] +_TPUEMBEDDINGOUTPUTLAYOUT.fields_by_name['table'].message_type = _TPUEMBEDDINGOUTPUTLAYOUT_TABLEDESCRIPTOR +_TPUEMBEDDINGOUTPUTLAYOUT.fields_by_name['output'].message_type = _TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR +DESCRIPTOR.message_types_by_name['TPUEmbeddingOutputLayout'] = _TPUEMBEDDINGOUTPUTLAYOUT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TPUEmbeddingOutputLayout = _reflection.GeneratedProtocolMessageType('TPUEmbeddingOutputLayout', (_message.Message,), dict( + + OutputLocation = _reflection.GeneratedProtocolMessageType('OutputLocation', (_message.Message,), dict( + DESCRIPTOR = _TPUEMBEDDINGOUTPUTLAYOUT_OUTPUTLOCATION, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_output_layout_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.OutputLocation) + )) + , + + FeatureDescriptor = _reflection.GeneratedProtocolMessageType('FeatureDescriptor', (_message.Message,), dict( + DESCRIPTOR = _TPUEMBEDDINGOUTPUTLAYOUT_FEATUREDESCRIPTOR, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_output_layout_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.FeatureDescriptor) + )) + , + + TableDescriptor = _reflection.GeneratedProtocolMessageType('TableDescriptor', (_message.Message,), dict( + DESCRIPTOR = _TPUEMBEDDINGOUTPUTLAYOUT_TABLEDESCRIPTOR, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_output_layout_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TableDescriptor) + )) + , + + TwoDOutputTensor = _reflection.GeneratedProtocolMessageType('TwoDOutputTensor', (_message.Message,), dict( + DESCRIPTOR = _TPUEMBEDDINGOUTPUTLAYOUT_TWODOUTPUTTENSOR, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_output_layout_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.TwoDOutputTensor) + )) + , + + EmbeddingOutputTensor = _reflection.GeneratedProtocolMessageType('EmbeddingOutputTensor', (_message.Message,), dict( + DESCRIPTOR = _TPUEMBEDDINGOUTPUTLAYOUT_EMBEDDINGOUTPUTTENSOR, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_output_layout_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + )) + , + DESCRIPTOR = _TPUEMBEDDINGOUTPUTLAYOUT, + __module__ = 'diplomacy_tensorflow.contrib.tpu.proto.tpu_embedding_output_layout_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.tpu.TPUEmbeddingOutputLayout) + )) +_sym_db.RegisterMessage(TPUEmbeddingOutputLayout) +_sym_db.RegisterMessage(TPUEmbeddingOutputLayout.OutputLocation) +_sym_db.RegisterMessage(TPUEmbeddingOutputLayout.FeatureDescriptor) +_sym_db.RegisterMessage(TPUEmbeddingOutputLayout.TableDescriptor) +_sym_db.RegisterMessage(TPUEmbeddingOutputLayout.TwoDOutputTensor) +_sym_db.RegisterMessage(TPUEmbeddingOutputLayout.EmbeddingOutputTensor) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.pb.cc new file mode 100644 index 0000000..50a4b6a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.pb.cc @@ -0,0 +1,2524 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/training/python/training/hparam.proto + +#include "diplomacy_tensorflow/contrib/training/python/training/hparam.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_BoolList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_BytesList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_FloatList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_Int64List; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_HParamDef_HparamEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_HParamDef_HParamType; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto +namespace diplomacy { +namespace tensorflow { +class HParamDef_BytesListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HParamDef_BytesList_default_instance_; +class HParamDef_FloatListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HParamDef_FloatList_default_instance_; +class HParamDef_Int64ListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HParamDef_Int64List_default_instance_; +class HParamDef_BoolListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HParamDef_BoolList_default_instance_; +class HParamDef_HParamTypeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + ::google::protobuf::int64 int64_value_; + float float_value_; + ::google::protobuf::internal::ArenaStringPtr bytes_value_; + bool bool_value_; + const ::diplomacy::tensorflow::HParamDef_Int64List* int64_list_; + const ::diplomacy::tensorflow::HParamDef_FloatList* float_list_; + const ::diplomacy::tensorflow::HParamDef_BytesList* bytes_list_; + const ::diplomacy::tensorflow::HParamDef_BoolList* bool_list_; +} _HParamDef_HParamType_default_instance_; +class HParamDef_HparamEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HParamDef_HparamEntry_DoNotUse_default_instance_; +class HParamDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HParamDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto { +static void InitDefaultsHParamDef_BytesList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HParamDef_BytesList_default_instance_; + new (ptr) ::diplomacy::tensorflow::HParamDef_BytesList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::HParamDef_BytesList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_BytesList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHParamDef_BytesList}, {}}; + +static void InitDefaultsHParamDef_FloatList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HParamDef_FloatList_default_instance_; + new (ptr) ::diplomacy::tensorflow::HParamDef_FloatList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::HParamDef_FloatList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_FloatList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHParamDef_FloatList}, {}}; + +static void InitDefaultsHParamDef_Int64List() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HParamDef_Int64List_default_instance_; + new (ptr) ::diplomacy::tensorflow::HParamDef_Int64List(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::HParamDef_Int64List::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_Int64List = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHParamDef_Int64List}, {}}; + +static void InitDefaultsHParamDef_BoolList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HParamDef_BoolList_default_instance_; + new (ptr) ::diplomacy::tensorflow::HParamDef_BoolList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::HParamDef_BoolList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HParamDef_BoolList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHParamDef_BoolList}, {}}; + +static void InitDefaultsHParamDef_HParamType() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_; + new (ptr) ::diplomacy::tensorflow::HParamDef_HParamType(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::HParamDef_HParamType::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_HParamDef_HParamType = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsHParamDef_HParamType}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_Int64List.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_FloatList.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BytesList.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BoolList.base,}}; + +static void InitDefaultsHParamDef_HparamEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HParamDef_HparamEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse(); + } + ::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HParamDef_HparamEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHParamDef_HparamEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_HParamType.base,}}; + +static void InitDefaultsHParamDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HParamDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::HParamDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::HParamDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_HParamDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsHParamDef}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_HparamEntry_DoNotUse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_HParamDef_BytesList.base); + ::google::protobuf::internal::InitSCC(&scc_info_HParamDef_FloatList.base); + ::google::protobuf::internal::InitSCC(&scc_info_HParamDef_Int64List.base); + ::google::protobuf::internal::InitSCC(&scc_info_HParamDef_BoolList.base); + ::google::protobuf::internal::InitSCC(&scc_info_HParamDef_HParamType.base); + ::google::protobuf::internal::InitSCC(&scc_info_HParamDef_HparamEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_HParamDef.base); +} + +::google::protobuf::Metadata file_level_metadata[7]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_BytesList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_BytesList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_FloatList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_FloatList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_Int64List, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_Int64List, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_BoolList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_BoolList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_HParamType, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_HParamType, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, int64_value_), + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, float_value_), + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, bytes_value_), + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, bool_value_), + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, int64_list_), + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, float_list_), + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, bytes_list_), + offsetof(::diplomacy::tensorflow::HParamDef_HParamTypeDefaultTypeInternal, bool_list_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_HParamType, kind_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HParamDef, hparam_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::HParamDef_BytesList)}, + { 6, -1, sizeof(::diplomacy::tensorflow::HParamDef_FloatList)}, + { 12, -1, sizeof(::diplomacy::tensorflow::HParamDef_Int64List)}, + { 18, -1, sizeof(::diplomacy::tensorflow::HParamDef_BoolList)}, + { 24, -1, sizeof(::diplomacy::tensorflow::HParamDef_HParamType)}, + { 38, 45, sizeof(::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse)}, + { 47, -1, sizeof(::diplomacy::tensorflow::HParamDef)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_HParamDef_BytesList_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_HParamDef_FloatList_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_HParamDef_Int64List_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_HParamDef_BoolList_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_HParamDef_HparamEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_HParamDef_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/training/python/training/hparam.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nBdiplomacy_tensorflow/contrib/training/" + "python/training/hparam.proto\022\024diplomacy." + "tensorflow\"\222\005\n\tHParamDef\022;\n\006hparam\030\001 \003(\013" + "2+.diplomacy.tensorflow.HParamDef.Hparam" + "Entry\032\032\n\tBytesList\022\r\n\005value\030\001 \003(\014\032\036\n\tFlo" + "atList\022\021\n\005value\030\001 \003(\002B\002\020\001\032\036\n\tInt64List\022\021" + "\n\005value\030\001 \003(\003B\002\020\001\032\035\n\010BoolList\022\021\n\005value\030\001" + " \003(\010B\002\020\001\032\361\002\n\nHParamType\022\025\n\013int64_value\030\001" + " \001(\003H\000\022\025\n\013float_value\030\002 \001(\002H\000\022\025\n\013bytes_v" + "alue\030\003 \001(\014H\000\022\024\n\nbool_value\030\007 \001(\010H\000\022\?\n\nin" + "t64_list\030\004 \001(\0132).diplomacy.tensorflow.HP" + "aramDef.Int64ListH\000\022\?\n\nfloat_list\030\005 \001(\0132" + ").diplomacy.tensorflow.HParamDef.FloatLi" + "stH\000\022\?\n\nbytes_list\030\006 \001(\0132).diplomacy.ten" + "sorflow.HParamDef.BytesListH\000\022=\n\tbool_li" + "st\030\010 \001(\0132(.diplomacy.tensorflow.HParamDe" + "f.BoolListH\000B\006\n\004kind\032Y\n\013HparamEntry\022\013\n\003k" + "ey\030\001 \001(\t\0229\n\005value\030\002 \001(\0132*.diplomacy.tens" + "orflow.HParamDef.HParamType:\0028\001B\003\370\001\001b\006pr" + "oto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 764); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/training/python/training/hparam.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void HParamDef_BytesList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HParamDef_BytesList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HParamDef_BytesList::HParamDef_BytesList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BytesList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.HParamDef.BytesList) +} +HParamDef_BytesList::HParamDef_BytesList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BytesList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.HParamDef.BytesList) +} +HParamDef_BytesList::HParamDef_BytesList(const HParamDef_BytesList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.HParamDef.BytesList) +} + +void HParamDef_BytesList::SharedCtor() { +} + +HParamDef_BytesList::~HParamDef_BytesList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.HParamDef.BytesList) + SharedDtor(); +} + +void HParamDef_BytesList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HParamDef_BytesList::ArenaDtor(void* object) { + HParamDef_BytesList* _this = reinterpret_cast< HParamDef_BytesList* >(object); + (void)_this; +} +void HParamDef_BytesList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HParamDef_BytesList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HParamDef_BytesList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HParamDef_BytesList& HParamDef_BytesList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BytesList.base); + return *internal_default_instance(); +} + + +void HParamDef_BytesList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.HParamDef.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool HParamDef_BytesList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.HParamDef.BytesList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated bytes value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.HParamDef.BytesList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.HParamDef.BytesList) + return false; +#undef DO_ +} + +void HParamDef_BytesList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.HParamDef.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 1, this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.HParamDef.BytesList) +} + +::google::protobuf::uint8* HParamDef_BytesList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.HParamDef.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(1, this->value(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.HParamDef.BytesList) + return target; +} + +size_t HParamDef_BytesList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.HParamDef.BytesList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated bytes value = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->value_size()); + for (int i = 0, n = this->value_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->value(i)); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HParamDef_BytesList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.HParamDef.BytesList) + GOOGLE_DCHECK_NE(&from, this); + const HParamDef_BytesList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.HParamDef.BytesList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.HParamDef.BytesList) + MergeFrom(*source); + } +} + +void HParamDef_BytesList::MergeFrom(const HParamDef_BytesList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.HParamDef.BytesList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void HParamDef_BytesList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.HParamDef.BytesList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HParamDef_BytesList::CopyFrom(const HParamDef_BytesList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.HParamDef.BytesList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HParamDef_BytesList::IsInitialized() const { + return true; +} + +void HParamDef_BytesList::Swap(HParamDef_BytesList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HParamDef_BytesList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HParamDef_BytesList::UnsafeArenaSwap(HParamDef_BytesList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HParamDef_BytesList::InternalSwap(HParamDef_BytesList* other) { + using std::swap; + value_.InternalSwap(CastToBase(&other->value_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HParamDef_BytesList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HParamDef_FloatList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HParamDef_FloatList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HParamDef_FloatList::HParamDef_FloatList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_FloatList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.HParamDef.FloatList) +} +HParamDef_FloatList::HParamDef_FloatList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_FloatList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.HParamDef.FloatList) +} +HParamDef_FloatList::HParamDef_FloatList(const HParamDef_FloatList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.HParamDef.FloatList) +} + +void HParamDef_FloatList::SharedCtor() { +} + +HParamDef_FloatList::~HParamDef_FloatList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.HParamDef.FloatList) + SharedDtor(); +} + +void HParamDef_FloatList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HParamDef_FloatList::ArenaDtor(void* object) { + HParamDef_FloatList* _this = reinterpret_cast< HParamDef_FloatList* >(object); + (void)_this; +} +void HParamDef_FloatList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HParamDef_FloatList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HParamDef_FloatList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HParamDef_FloatList& HParamDef_FloatList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_FloatList.base); + return *internal_default_instance(); +} + + +void HParamDef_FloatList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.HParamDef.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool HParamDef_FloatList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.HParamDef.FloatList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated float value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.HParamDef.FloatList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.HParamDef.FloatList) + return false; +#undef DO_ +} + +void HParamDef_FloatList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.HParamDef.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.HParamDef.FloatList) +} + +::google::protobuf::uint8* HParamDef_FloatList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.HParamDef.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.HParamDef.FloatList) + return target; +} + +size_t HParamDef_FloatList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.HParamDef.FloatList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated float value = 1 [packed = true]; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HParamDef_FloatList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.HParamDef.FloatList) + GOOGLE_DCHECK_NE(&from, this); + const HParamDef_FloatList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.HParamDef.FloatList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.HParamDef.FloatList) + MergeFrom(*source); + } +} + +void HParamDef_FloatList::MergeFrom(const HParamDef_FloatList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.HParamDef.FloatList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void HParamDef_FloatList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.HParamDef.FloatList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HParamDef_FloatList::CopyFrom(const HParamDef_FloatList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.HParamDef.FloatList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HParamDef_FloatList::IsInitialized() const { + return true; +} + +void HParamDef_FloatList::Swap(HParamDef_FloatList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HParamDef_FloatList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HParamDef_FloatList::UnsafeArenaSwap(HParamDef_FloatList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HParamDef_FloatList::InternalSwap(HParamDef_FloatList* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HParamDef_FloatList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HParamDef_Int64List::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HParamDef_Int64List::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HParamDef_Int64List::HParamDef_Int64List() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_Int64List.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.HParamDef.Int64List) +} +HParamDef_Int64List::HParamDef_Int64List(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_Int64List.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.HParamDef.Int64List) +} +HParamDef_Int64List::HParamDef_Int64List(const HParamDef_Int64List& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.HParamDef.Int64List) +} + +void HParamDef_Int64List::SharedCtor() { +} + +HParamDef_Int64List::~HParamDef_Int64List() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.HParamDef.Int64List) + SharedDtor(); +} + +void HParamDef_Int64List::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HParamDef_Int64List::ArenaDtor(void* object) { + HParamDef_Int64List* _this = reinterpret_cast< HParamDef_Int64List* >(object); + (void)_this; +} +void HParamDef_Int64List::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HParamDef_Int64List::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HParamDef_Int64List::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HParamDef_Int64List& HParamDef_Int64List::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_Int64List.base); + return *internal_default_instance(); +} + + +void HParamDef_Int64List::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.HParamDef.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool HParamDef_Int64List::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.HParamDef.Int64List) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.HParamDef.Int64List) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.HParamDef.Int64List) + return false; +#undef DO_ +} + +void HParamDef_Int64List::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.HParamDef.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + } + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.HParamDef.Int64List) +} + +::google::protobuf::uint8* HParamDef_Int64List::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.HParamDef.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.HParamDef.Int64List) + return target; +} + +size_t HParamDef_Int64List::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.HParamDef.Int64List) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 value = 1 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->value_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HParamDef_Int64List::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.HParamDef.Int64List) + GOOGLE_DCHECK_NE(&from, this); + const HParamDef_Int64List* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.HParamDef.Int64List) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.HParamDef.Int64List) + MergeFrom(*source); + } +} + +void HParamDef_Int64List::MergeFrom(const HParamDef_Int64List& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.HParamDef.Int64List) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void HParamDef_Int64List::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.HParamDef.Int64List) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HParamDef_Int64List::CopyFrom(const HParamDef_Int64List& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.HParamDef.Int64List) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HParamDef_Int64List::IsInitialized() const { + return true; +} + +void HParamDef_Int64List::Swap(HParamDef_Int64List* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HParamDef_Int64List* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HParamDef_Int64List::UnsafeArenaSwap(HParamDef_Int64List* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HParamDef_Int64List::InternalSwap(HParamDef_Int64List* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HParamDef_Int64List::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HParamDef_BoolList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HParamDef_BoolList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HParamDef_BoolList::HParamDef_BoolList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BoolList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.HParamDef.BoolList) +} +HParamDef_BoolList::HParamDef_BoolList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BoolList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.HParamDef.BoolList) +} +HParamDef_BoolList::HParamDef_BoolList(const HParamDef_BoolList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.HParamDef.BoolList) +} + +void HParamDef_BoolList::SharedCtor() { +} + +HParamDef_BoolList::~HParamDef_BoolList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.HParamDef.BoolList) + SharedDtor(); +} + +void HParamDef_BoolList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HParamDef_BoolList::ArenaDtor(void* object) { + HParamDef_BoolList* _this = reinterpret_cast< HParamDef_BoolList* >(object); + (void)_this; +} +void HParamDef_BoolList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HParamDef_BoolList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HParamDef_BoolList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HParamDef_BoolList& HParamDef_BoolList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_BoolList.base); + return *internal_default_instance(); +} + + +void HParamDef_BoolList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.HParamDef.BoolList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool HParamDef_BoolList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.HParamDef.BoolList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated bool value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.HParamDef.BoolList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.HParamDef.BoolList) + return false; +#undef DO_ +} + +void HParamDef_BoolList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.HParamDef.BoolList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bool value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteBoolArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.HParamDef.BoolList) +} + +::google::protobuf::uint8* HParamDef_BoolList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.HParamDef.BoolList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bool value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteBoolNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.HParamDef.BoolList) + return target; +} + +size_t HParamDef_BoolList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.HParamDef.BoolList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated bool value = 1 [packed = true]; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 1UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HParamDef_BoolList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.HParamDef.BoolList) + GOOGLE_DCHECK_NE(&from, this); + const HParamDef_BoolList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.HParamDef.BoolList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.HParamDef.BoolList) + MergeFrom(*source); + } +} + +void HParamDef_BoolList::MergeFrom(const HParamDef_BoolList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.HParamDef.BoolList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void HParamDef_BoolList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.HParamDef.BoolList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HParamDef_BoolList::CopyFrom(const HParamDef_BoolList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.HParamDef.BoolList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HParamDef_BoolList::IsInitialized() const { + return true; +} + +void HParamDef_BoolList::Swap(HParamDef_BoolList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HParamDef_BoolList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HParamDef_BoolList::UnsafeArenaSwap(HParamDef_BoolList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HParamDef_BoolList::InternalSwap(HParamDef_BoolList* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HParamDef_BoolList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HParamDef_HParamType::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.int64_value_ = GOOGLE_LONGLONG(0); + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.float_value_ = 0; + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.bytes_value_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.bool_value_ = false; + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.int64_list_ = const_cast< ::diplomacy::tensorflow::HParamDef_Int64List*>( + ::diplomacy::tensorflow::HParamDef_Int64List::internal_default_instance()); + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.float_list_ = const_cast< ::diplomacy::tensorflow::HParamDef_FloatList*>( + ::diplomacy::tensorflow::HParamDef_FloatList::internal_default_instance()); + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.bytes_list_ = const_cast< ::diplomacy::tensorflow::HParamDef_BytesList*>( + ::diplomacy::tensorflow::HParamDef_BytesList::internal_default_instance()); + ::diplomacy::tensorflow::_HParamDef_HParamType_default_instance_.bool_list_ = const_cast< ::diplomacy::tensorflow::HParamDef_BoolList*>( + ::diplomacy::tensorflow::HParamDef_BoolList::internal_default_instance()); +} +void HParamDef_HParamType::set_allocated_int64_list(::diplomacy::tensorflow::HParamDef_Int64List* int64_list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (int64_list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(int64_list); + if (message_arena != submessage_arena) { + int64_list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, int64_list, submessage_arena); + } + set_has_int64_list(); + kind_.int64_list_ = int64_list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.int64_list) +} +void HParamDef_HParamType::set_allocated_float_list(::diplomacy::tensorflow::HParamDef_FloatList* float_list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (float_list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(float_list); + if (message_arena != submessage_arena) { + float_list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, float_list, submessage_arena); + } + set_has_float_list(); + kind_.float_list_ = float_list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.float_list) +} +void HParamDef_HParamType::set_allocated_bytes_list(::diplomacy::tensorflow::HParamDef_BytesList* bytes_list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (bytes_list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(bytes_list); + if (message_arena != submessage_arena) { + bytes_list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, bytes_list, submessage_arena); + } + set_has_bytes_list(); + kind_.bytes_list_ = bytes_list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.bytes_list) +} +void HParamDef_HParamType::set_allocated_bool_list(::diplomacy::tensorflow::HParamDef_BoolList* bool_list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (bool_list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(bool_list); + if (message_arena != submessage_arena) { + bool_list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, bool_list, submessage_arena); + } + set_has_bool_list(); + kind_.bool_list_ = bool_list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.bool_list) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HParamDef_HParamType::kInt64ValueFieldNumber; +const int HParamDef_HParamType::kFloatValueFieldNumber; +const int HParamDef_HParamType::kBytesValueFieldNumber; +const int HParamDef_HParamType::kBoolValueFieldNumber; +const int HParamDef_HParamType::kInt64ListFieldNumber; +const int HParamDef_HParamType::kFloatListFieldNumber; +const int HParamDef_HParamType::kBytesListFieldNumber; +const int HParamDef_HParamType::kBoolListFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HParamDef_HParamType::HParamDef_HParamType() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_HParamType.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.HParamDef.HParamType) +} +HParamDef_HParamType::HParamDef_HParamType(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_HParamType.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.HParamDef.HParamType) +} +HParamDef_HParamType::HParamDef_HParamType(const HParamDef_HParamType& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_kind(); + switch (from.kind_case()) { + case kInt64Value: { + set_int64_value(from.int64_value()); + break; + } + case kFloatValue: { + set_float_value(from.float_value()); + break; + } + case kBytesValue: { + set_bytes_value(from.bytes_value()); + break; + } + case kBoolValue: { + set_bool_value(from.bool_value()); + break; + } + case kInt64List: { + mutable_int64_list()->::diplomacy::tensorflow::HParamDef_Int64List::MergeFrom(from.int64_list()); + break; + } + case kFloatList: { + mutable_float_list()->::diplomacy::tensorflow::HParamDef_FloatList::MergeFrom(from.float_list()); + break; + } + case kBytesList: { + mutable_bytes_list()->::diplomacy::tensorflow::HParamDef_BytesList::MergeFrom(from.bytes_list()); + break; + } + case kBoolList: { + mutable_bool_list()->::diplomacy::tensorflow::HParamDef_BoolList::MergeFrom(from.bool_list()); + break; + } + case KIND_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.HParamDef.HParamType) +} + +void HParamDef_HParamType::SharedCtor() { + clear_has_kind(); +} + +HParamDef_HParamType::~HParamDef_HParamType() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.HParamDef.HParamType) + SharedDtor(); +} + +void HParamDef_HParamType::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_kind()) { + clear_kind(); + } +} + +void HParamDef_HParamType::ArenaDtor(void* object) { + HParamDef_HParamType* _this = reinterpret_cast< HParamDef_HParamType* >(object); + (void)_this; +} +void HParamDef_HParamType::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HParamDef_HParamType::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HParamDef_HParamType::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HParamDef_HParamType& HParamDef_HParamType::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef_HParamType.base); + return *internal_default_instance(); +} + + +void HParamDef_HParamType::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.HParamDef.HParamType) + switch (kind_case()) { + case kInt64Value: { + // No need to clear + break; + } + case kFloatValue: { + // No need to clear + break; + } + case kBytesValue: { + kind_.bytes_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + break; + } + case kBoolValue: { + // No need to clear + break; + } + case kInt64List: { + if (GetArenaNoVirtual() == NULL) { + delete kind_.int64_list_; + } + break; + } + case kFloatList: { + if (GetArenaNoVirtual() == NULL) { + delete kind_.float_list_; + } + break; + } + case kBytesList: { + if (GetArenaNoVirtual() == NULL) { + delete kind_.bytes_list_; + } + break; + } + case kBoolList: { + if (GetArenaNoVirtual() == NULL) { + delete kind_.bool_list_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _oneof_case_[0] = KIND_NOT_SET; +} + + +void HParamDef_HParamType::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.HParamDef.HParamType) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_kind(); + _internal_metadata_.Clear(); +} + +bool HParamDef_HParamType::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.HParamDef.HParamType) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 int64_value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + clear_kind(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &kind_.int64_value_))); + set_has_int64_value(); + } else { + goto handle_unusual; + } + break; + } + + // float float_value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + clear_kind(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &kind_.float_value_))); + set_has_float_value(); + } else { + goto handle_unusual; + } + break; + } + + // bytes bytes_value = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_bytes_value())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.HParamDef.Int64List int64_list = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_int64_list())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.HParamDef.FloatList float_list = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_float_list())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.HParamDef.BytesList bytes_list = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_bytes_list())); + } else { + goto handle_unusual; + } + break; + } + + // bool bool_value = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + clear_kind(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &kind_.bool_value_))); + set_has_bool_value(); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.HParamDef.BoolList bool_list = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_bool_list())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.HParamDef.HParamType) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.HParamDef.HParamType) + return false; +#undef DO_ +} + +void HParamDef_HParamType::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.HParamDef.HParamType) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 int64_value = 1; + if (has_int64_value()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->int64_value(), output); + } + + // float float_value = 2; + if (has_float_value()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->float_value(), output); + } + + // bytes bytes_value = 3; + if (has_bytes_value()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->bytes_value(), output); + } + + // .diplomacy.tensorflow.HParamDef.Int64List int64_list = 4; + if (has_int64_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_int64_list(), output); + } + + // .diplomacy.tensorflow.HParamDef.FloatList float_list = 5; + if (has_float_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_float_list(), output); + } + + // .diplomacy.tensorflow.HParamDef.BytesList bytes_list = 6; + if (has_bytes_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_bytes_list(), output); + } + + // bool bool_value = 7; + if (has_bool_value()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->bool_value(), output); + } + + // .diplomacy.tensorflow.HParamDef.BoolList bool_list = 8; + if (has_bool_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_bool_list(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.HParamDef.HParamType) +} + +::google::protobuf::uint8* HParamDef_HParamType::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.HParamDef.HParamType) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 int64_value = 1; + if (has_int64_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->int64_value(), target); + } + + // float float_value = 2; + if (has_float_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->float_value(), target); + } + + // bytes bytes_value = 3; + if (has_bytes_value()) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->bytes_value(), target); + } + + // .diplomacy.tensorflow.HParamDef.Int64List int64_list = 4; + if (has_int64_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_int64_list(), deterministic, target); + } + + // .diplomacy.tensorflow.HParamDef.FloatList float_list = 5; + if (has_float_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_float_list(), deterministic, target); + } + + // .diplomacy.tensorflow.HParamDef.BytesList bytes_list = 6; + if (has_bytes_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_bytes_list(), deterministic, target); + } + + // bool bool_value = 7; + if (has_bool_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->bool_value(), target); + } + + // .diplomacy.tensorflow.HParamDef.BoolList bool_list = 8; + if (has_bool_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_bool_list(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.HParamDef.HParamType) + return target; +} + +size_t HParamDef_HParamType::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.HParamDef.HParamType) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (kind_case()) { + // int64 int64_value = 1; + case kInt64Value: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->int64_value()); + break; + } + // float float_value = 2; + case kFloatValue: { + total_size += 1 + 4; + break; + } + // bytes bytes_value = 3; + case kBytesValue: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->bytes_value()); + break; + } + // bool bool_value = 7; + case kBoolValue: { + total_size += 1 + 1; + break; + } + // .diplomacy.tensorflow.HParamDef.Int64List int64_list = 4; + case kInt64List: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *kind_.int64_list_); + break; + } + // .diplomacy.tensorflow.HParamDef.FloatList float_list = 5; + case kFloatList: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *kind_.float_list_); + break; + } + // .diplomacy.tensorflow.HParamDef.BytesList bytes_list = 6; + case kBytesList: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *kind_.bytes_list_); + break; + } + // .diplomacy.tensorflow.HParamDef.BoolList bool_list = 8; + case kBoolList: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *kind_.bool_list_); + break; + } + case KIND_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HParamDef_HParamType::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.HParamDef.HParamType) + GOOGLE_DCHECK_NE(&from, this); + const HParamDef_HParamType* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.HParamDef.HParamType) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.HParamDef.HParamType) + MergeFrom(*source); + } +} + +void HParamDef_HParamType::MergeFrom(const HParamDef_HParamType& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.HParamDef.HParamType) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.kind_case()) { + case kInt64Value: { + set_int64_value(from.int64_value()); + break; + } + case kFloatValue: { + set_float_value(from.float_value()); + break; + } + case kBytesValue: { + set_bytes_value(from.bytes_value()); + break; + } + case kBoolValue: { + set_bool_value(from.bool_value()); + break; + } + case kInt64List: { + mutable_int64_list()->::diplomacy::tensorflow::HParamDef_Int64List::MergeFrom(from.int64_list()); + break; + } + case kFloatList: { + mutable_float_list()->::diplomacy::tensorflow::HParamDef_FloatList::MergeFrom(from.float_list()); + break; + } + case kBytesList: { + mutable_bytes_list()->::diplomacy::tensorflow::HParamDef_BytesList::MergeFrom(from.bytes_list()); + break; + } + case kBoolList: { + mutable_bool_list()->::diplomacy::tensorflow::HParamDef_BoolList::MergeFrom(from.bool_list()); + break; + } + case KIND_NOT_SET: { + break; + } + } +} + +void HParamDef_HParamType::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.HParamDef.HParamType) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HParamDef_HParamType::CopyFrom(const HParamDef_HParamType& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.HParamDef.HParamType) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HParamDef_HParamType::IsInitialized() const { + return true; +} + +void HParamDef_HParamType::Swap(HParamDef_HParamType* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HParamDef_HParamType* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HParamDef_HParamType::UnsafeArenaSwap(HParamDef_HParamType* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HParamDef_HParamType::InternalSwap(HParamDef_HParamType* other) { + using std::swap; + swap(kind_, other->kind_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HParamDef_HParamType::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +HParamDef_HparamEntry_DoNotUse::HParamDef_HparamEntry_DoNotUse() {} +HParamDef_HparamEntry_DoNotUse::HParamDef_HparamEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void HParamDef_HparamEntry_DoNotUse::MergeFrom(const HParamDef_HparamEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata HParamDef_HparamEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[5]; +} +void HParamDef_HparamEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void HParamDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HParamDef::kHparamFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HParamDef::HParamDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.HParamDef) +} +HParamDef::HParamDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + hparam_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.HParamDef) +} +HParamDef::HParamDef(const HParamDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + hparam_.MergeFrom(from.hparam_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.HParamDef) +} + +void HParamDef::SharedCtor() { +} + +HParamDef::~HParamDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.HParamDef) + SharedDtor(); +} + +void HParamDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HParamDef::ArenaDtor(void* object) { + HParamDef* _this = reinterpret_cast< HParamDef* >(object); + (void)_this; +} +void HParamDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HParamDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HParamDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HParamDef& HParamDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::scc_info_HParamDef.base); + return *internal_default_instance(); +} + + +void HParamDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.HParamDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + hparam_.Clear(); + _internal_metadata_.Clear(); +} + +bool HParamDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.HParamDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map hparam = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + HParamDef_HparamEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + HParamDef_HparamEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType > > parser(&hparam_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.HParamDef.HparamEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.HParamDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.HParamDef) + return false; +#undef DO_ +} + +void HParamDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.HParamDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map hparam = 1; + if (!this->hparam().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.HParamDef.HparamEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->hparam().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->hparam().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::const_iterator + it = this->hparam().begin(); + it != this->hparam().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(hparam_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::const_iterator + it = this->hparam().begin(); + it != this->hparam().end(); ++it) { + entry.reset(hparam_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.HParamDef) +} + +::google::protobuf::uint8* HParamDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.HParamDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map hparam = 1; + if (!this->hparam().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.HParamDef.HparamEntry.key"); + } + }; + + if (deterministic && + this->hparam().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->hparam().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::const_iterator + it = this->hparam().begin(); + it != this->hparam().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(hparam_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::const_iterator + it = this->hparam().begin(); + it != this->hparam().end(); ++it) { + entry.reset(hparam_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.HParamDef) + return target; +} + +size_t HParamDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.HParamDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map hparam = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->hparam_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >::const_iterator + it = this->hparam().begin(); + it != this->hparam().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(hparam_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HParamDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.HParamDef) + GOOGLE_DCHECK_NE(&from, this); + const HParamDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.HParamDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.HParamDef) + MergeFrom(*source); + } +} + +void HParamDef::MergeFrom(const HParamDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.HParamDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + hparam_.MergeFrom(from.hparam_); +} + +void HParamDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.HParamDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HParamDef::CopyFrom(const HParamDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.HParamDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HParamDef::IsInitialized() const { + return true; +} + +void HParamDef::Swap(HParamDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HParamDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HParamDef::UnsafeArenaSwap(HParamDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HParamDef::InternalSwap(HParamDef* other) { + using std::swap; + hparam_.Swap(&other->hparam_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HParamDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HParamDef_BytesList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_BytesList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HParamDef_BytesList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HParamDef_FloatList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_FloatList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HParamDef_FloatList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HParamDef_Int64List* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_Int64List >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HParamDef_Int64List >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HParamDef_BoolList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_BoolList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HParamDef_BoolList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HParamDef_HParamType* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_HParamType >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HParamDef_HParamType >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HParamDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HParamDef >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.pb.h new file mode 100644 index 0000000..3338b38 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.pb.h @@ -0,0 +1,1739 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/training/python/training/hparam.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[7]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto +namespace diplomacy { +namespace tensorflow { +class HParamDef; +class HParamDefDefaultTypeInternal; +extern HParamDefDefaultTypeInternal _HParamDef_default_instance_; +class HParamDef_BoolList; +class HParamDef_BoolListDefaultTypeInternal; +extern HParamDef_BoolListDefaultTypeInternal _HParamDef_BoolList_default_instance_; +class HParamDef_BytesList; +class HParamDef_BytesListDefaultTypeInternal; +extern HParamDef_BytesListDefaultTypeInternal _HParamDef_BytesList_default_instance_; +class HParamDef_FloatList; +class HParamDef_FloatListDefaultTypeInternal; +extern HParamDef_FloatListDefaultTypeInternal _HParamDef_FloatList_default_instance_; +class HParamDef_HParamType; +class HParamDef_HParamTypeDefaultTypeInternal; +extern HParamDef_HParamTypeDefaultTypeInternal _HParamDef_HParamType_default_instance_; +class HParamDef_HparamEntry_DoNotUse; +class HParamDef_HparamEntry_DoNotUseDefaultTypeInternal; +extern HParamDef_HparamEntry_DoNotUseDefaultTypeInternal _HParamDef_HparamEntry_DoNotUse_default_instance_; +class HParamDef_Int64List; +class HParamDef_Int64ListDefaultTypeInternal; +extern HParamDef_Int64ListDefaultTypeInternal _HParamDef_Int64List_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::HParamDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HParamDef>(Arena*); +template<> ::diplomacy::tensorflow::HParamDef_BoolList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HParamDef_BoolList>(Arena*); +template<> ::diplomacy::tensorflow::HParamDef_BytesList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HParamDef_BytesList>(Arena*); +template<> ::diplomacy::tensorflow::HParamDef_FloatList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HParamDef_FloatList>(Arena*); +template<> ::diplomacy::tensorflow::HParamDef_HParamType* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HParamDef_HParamType>(Arena*); +template<> ::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HParamDef_HparamEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::HParamDef_Int64List* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HParamDef_Int64List>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class HParamDef_BytesList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.HParamDef.BytesList) */ { + public: + HParamDef_BytesList(); + virtual ~HParamDef_BytesList(); + + HParamDef_BytesList(const HParamDef_BytesList& from); + + inline HParamDef_BytesList& operator=(const HParamDef_BytesList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HParamDef_BytesList(HParamDef_BytesList&& from) noexcept + : HParamDef_BytesList() { + *this = ::std::move(from); + } + + inline HParamDef_BytesList& operator=(HParamDef_BytesList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HParamDef_BytesList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HParamDef_BytesList* internal_default_instance() { + return reinterpret_cast( + &_HParamDef_BytesList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(HParamDef_BytesList* other); + void Swap(HParamDef_BytesList* other); + friend void swap(HParamDef_BytesList& a, HParamDef_BytesList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HParamDef_BytesList* New() const final { + return CreateMaybeMessage(NULL); + } + + HParamDef_BytesList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HParamDef_BytesList& from); + void MergeFrom(const HParamDef_BytesList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HParamDef_BytesList* other); + protected: + explicit HParamDef_BytesList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bytes value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + const ::std::string& value(int index) const; + ::std::string* mutable_value(int index); + void set_value(int index, const ::std::string& value); + #if LANG_CXX11 + void set_value(int index, ::std::string&& value); + #endif + void set_value(int index, const char* value); + void set_value(int index, const void* value, size_t size); + ::std::string* add_value(); + void add_value(const ::std::string& value); + #if LANG_CXX11 + void add_value(::std::string&& value); + #endif + void add_value(const char* value); + void add_value(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& value() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.BytesList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HParamDef_FloatList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.HParamDef.FloatList) */ { + public: + HParamDef_FloatList(); + virtual ~HParamDef_FloatList(); + + HParamDef_FloatList(const HParamDef_FloatList& from); + + inline HParamDef_FloatList& operator=(const HParamDef_FloatList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HParamDef_FloatList(HParamDef_FloatList&& from) noexcept + : HParamDef_FloatList() { + *this = ::std::move(from); + } + + inline HParamDef_FloatList& operator=(HParamDef_FloatList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HParamDef_FloatList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HParamDef_FloatList* internal_default_instance() { + return reinterpret_cast( + &_HParamDef_FloatList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(HParamDef_FloatList* other); + void Swap(HParamDef_FloatList* other); + friend void swap(HParamDef_FloatList& a, HParamDef_FloatList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HParamDef_FloatList* New() const final { + return CreateMaybeMessage(NULL); + } + + HParamDef_FloatList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HParamDef_FloatList& from); + void MergeFrom(const HParamDef_FloatList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HParamDef_FloatList* other); + protected: + explicit HParamDef_FloatList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated float value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + float value(int index) const; + void set_value(int index, float value); + void add_value(float value); + const ::google::protobuf::RepeatedField< float >& + value() const; + ::google::protobuf::RepeatedField< float >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.FloatList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< float > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HParamDef_Int64List : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.HParamDef.Int64List) */ { + public: + HParamDef_Int64List(); + virtual ~HParamDef_Int64List(); + + HParamDef_Int64List(const HParamDef_Int64List& from); + + inline HParamDef_Int64List& operator=(const HParamDef_Int64List& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HParamDef_Int64List(HParamDef_Int64List&& from) noexcept + : HParamDef_Int64List() { + *this = ::std::move(from); + } + + inline HParamDef_Int64List& operator=(HParamDef_Int64List&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HParamDef_Int64List& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HParamDef_Int64List* internal_default_instance() { + return reinterpret_cast( + &_HParamDef_Int64List_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(HParamDef_Int64List* other); + void Swap(HParamDef_Int64List* other); + friend void swap(HParamDef_Int64List& a, HParamDef_Int64List& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HParamDef_Int64List* New() const final { + return CreateMaybeMessage(NULL); + } + + HParamDef_Int64List* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HParamDef_Int64List& from); + void MergeFrom(const HParamDef_Int64List& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HParamDef_Int64List* other); + protected: + explicit HParamDef_Int64List(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + ::google::protobuf::int64 value(int index) const; + void set_value(int index, ::google::protobuf::int64 value); + void add_value(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + value() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.Int64List) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HParamDef_BoolList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.HParamDef.BoolList) */ { + public: + HParamDef_BoolList(); + virtual ~HParamDef_BoolList(); + + HParamDef_BoolList(const HParamDef_BoolList& from); + + inline HParamDef_BoolList& operator=(const HParamDef_BoolList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HParamDef_BoolList(HParamDef_BoolList&& from) noexcept + : HParamDef_BoolList() { + *this = ::std::move(from); + } + + inline HParamDef_BoolList& operator=(HParamDef_BoolList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HParamDef_BoolList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HParamDef_BoolList* internal_default_instance() { + return reinterpret_cast( + &_HParamDef_BoolList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(HParamDef_BoolList* other); + void Swap(HParamDef_BoolList* other); + friend void swap(HParamDef_BoolList& a, HParamDef_BoolList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HParamDef_BoolList* New() const final { + return CreateMaybeMessage(NULL); + } + + HParamDef_BoolList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HParamDef_BoolList& from); + void MergeFrom(const HParamDef_BoolList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HParamDef_BoolList* other); + protected: + explicit HParamDef_BoolList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bool value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + bool value(int index) const; + void set_value(int index, bool value); + void add_value(bool value); + const ::google::protobuf::RepeatedField< bool >& + value() const; + ::google::protobuf::RepeatedField< bool >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.BoolList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< bool > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HParamDef_HParamType : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.HParamDef.HParamType) */ { + public: + HParamDef_HParamType(); + virtual ~HParamDef_HParamType(); + + HParamDef_HParamType(const HParamDef_HParamType& from); + + inline HParamDef_HParamType& operator=(const HParamDef_HParamType& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HParamDef_HParamType(HParamDef_HParamType&& from) noexcept + : HParamDef_HParamType() { + *this = ::std::move(from); + } + + inline HParamDef_HParamType& operator=(HParamDef_HParamType&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HParamDef_HParamType& default_instance(); + + enum KindCase { + kInt64Value = 1, + kFloatValue = 2, + kBytesValue = 3, + kBoolValue = 7, + kInt64List = 4, + kFloatList = 5, + kBytesList = 6, + kBoolList = 8, + KIND_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HParamDef_HParamType* internal_default_instance() { + return reinterpret_cast( + &_HParamDef_HParamType_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(HParamDef_HParamType* other); + void Swap(HParamDef_HParamType* other); + friend void swap(HParamDef_HParamType& a, HParamDef_HParamType& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HParamDef_HParamType* New() const final { + return CreateMaybeMessage(NULL); + } + + HParamDef_HParamType* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HParamDef_HParamType& from); + void MergeFrom(const HParamDef_HParamType& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HParamDef_HParamType* other); + protected: + explicit HParamDef_HParamType(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 int64_value = 1; + private: + bool has_int64_value() const; + public: + void clear_int64_value(); + static const int kInt64ValueFieldNumber = 1; + ::google::protobuf::int64 int64_value() const; + void set_int64_value(::google::protobuf::int64 value); + + // float float_value = 2; + private: + bool has_float_value() const; + public: + void clear_float_value(); + static const int kFloatValueFieldNumber = 2; + float float_value() const; + void set_float_value(float value); + + // bytes bytes_value = 3; + private: + bool has_bytes_value() const; + public: + void clear_bytes_value(); + static const int kBytesValueFieldNumber = 3; + const ::std::string& bytes_value() const; + void set_bytes_value(const ::std::string& value); + #if LANG_CXX11 + void set_bytes_value(::std::string&& value); + #endif + void set_bytes_value(const char* value); + void set_bytes_value(const void* value, size_t size); + ::std::string* mutable_bytes_value(); + ::std::string* release_bytes_value(); + void set_allocated_bytes_value(::std::string* bytes_value); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_bytes_value(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_bytes_value( + ::std::string* bytes_value); + + // bool bool_value = 7; + private: + bool has_bool_value() const; + public: + void clear_bool_value(); + static const int kBoolValueFieldNumber = 7; + bool bool_value() const; + void set_bool_value(bool value); + + // .diplomacy.tensorflow.HParamDef.Int64List int64_list = 4; + bool has_int64_list() const; + void clear_int64_list(); + static const int kInt64ListFieldNumber = 4; + private: + const ::diplomacy::tensorflow::HParamDef_Int64List& _internal_int64_list() const; + public: + const ::diplomacy::tensorflow::HParamDef_Int64List& int64_list() const; + ::diplomacy::tensorflow::HParamDef_Int64List* release_int64_list(); + ::diplomacy::tensorflow::HParamDef_Int64List* mutable_int64_list(); + void set_allocated_int64_list(::diplomacy::tensorflow::HParamDef_Int64List* int64_list); + void unsafe_arena_set_allocated_int64_list( + ::diplomacy::tensorflow::HParamDef_Int64List* int64_list); + ::diplomacy::tensorflow::HParamDef_Int64List* unsafe_arena_release_int64_list(); + + // .diplomacy.tensorflow.HParamDef.FloatList float_list = 5; + bool has_float_list() const; + void clear_float_list(); + static const int kFloatListFieldNumber = 5; + private: + const ::diplomacy::tensorflow::HParamDef_FloatList& _internal_float_list() const; + public: + const ::diplomacy::tensorflow::HParamDef_FloatList& float_list() const; + ::diplomacy::tensorflow::HParamDef_FloatList* release_float_list(); + ::diplomacy::tensorflow::HParamDef_FloatList* mutable_float_list(); + void set_allocated_float_list(::diplomacy::tensorflow::HParamDef_FloatList* float_list); + void unsafe_arena_set_allocated_float_list( + ::diplomacy::tensorflow::HParamDef_FloatList* float_list); + ::diplomacy::tensorflow::HParamDef_FloatList* unsafe_arena_release_float_list(); + + // .diplomacy.tensorflow.HParamDef.BytesList bytes_list = 6; + bool has_bytes_list() const; + void clear_bytes_list(); + static const int kBytesListFieldNumber = 6; + private: + const ::diplomacy::tensorflow::HParamDef_BytesList& _internal_bytes_list() const; + public: + const ::diplomacy::tensorflow::HParamDef_BytesList& bytes_list() const; + ::diplomacy::tensorflow::HParamDef_BytesList* release_bytes_list(); + ::diplomacy::tensorflow::HParamDef_BytesList* mutable_bytes_list(); + void set_allocated_bytes_list(::diplomacy::tensorflow::HParamDef_BytesList* bytes_list); + void unsafe_arena_set_allocated_bytes_list( + ::diplomacy::tensorflow::HParamDef_BytesList* bytes_list); + ::diplomacy::tensorflow::HParamDef_BytesList* unsafe_arena_release_bytes_list(); + + // .diplomacy.tensorflow.HParamDef.BoolList bool_list = 8; + bool has_bool_list() const; + void clear_bool_list(); + static const int kBoolListFieldNumber = 8; + private: + const ::diplomacy::tensorflow::HParamDef_BoolList& _internal_bool_list() const; + public: + const ::diplomacy::tensorflow::HParamDef_BoolList& bool_list() const; + ::diplomacy::tensorflow::HParamDef_BoolList* release_bool_list(); + ::diplomacy::tensorflow::HParamDef_BoolList* mutable_bool_list(); + void set_allocated_bool_list(::diplomacy::tensorflow::HParamDef_BoolList* bool_list); + void unsafe_arena_set_allocated_bool_list( + ::diplomacy::tensorflow::HParamDef_BoolList* bool_list); + ::diplomacy::tensorflow::HParamDef_BoolList* unsafe_arena_release_bool_list(); + + void clear_kind(); + KindCase kind_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.HParamType) + private: + void set_has_int64_value(); + void set_has_float_value(); + void set_has_bytes_value(); + void set_has_bool_value(); + void set_has_int64_list(); + void set_has_float_list(); + void set_has_bytes_list(); + void set_has_bool_list(); + + inline bool has_kind() const; + inline void clear_has_kind(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union KindUnion { + KindUnion() {} + ::google::protobuf::int64 int64_value_; + float float_value_; + ::google::protobuf::internal::ArenaStringPtr bytes_value_; + bool bool_value_; + ::diplomacy::tensorflow::HParamDef_Int64List* int64_list_; + ::diplomacy::tensorflow::HParamDef_FloatList* float_list_; + ::diplomacy::tensorflow::HParamDef_BytesList* bytes_list_; + ::diplomacy::tensorflow::HParamDef_BoolList* bool_list_; + } kind_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HParamDef_HparamEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + HParamDef_HparamEntry_DoNotUse(); + HParamDef_HparamEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const HParamDef_HparamEntry_DoNotUse& other); + static const HParamDef_HparamEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_HParamDef_HparamEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class HParamDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.HParamDef) */ { + public: + HParamDef(); + virtual ~HParamDef(); + + HParamDef(const HParamDef& from); + + inline HParamDef& operator=(const HParamDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HParamDef(HParamDef&& from) noexcept + : HParamDef() { + *this = ::std::move(from); + } + + inline HParamDef& operator=(HParamDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HParamDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HParamDef* internal_default_instance() { + return reinterpret_cast( + &_HParamDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(HParamDef* other); + void Swap(HParamDef* other); + friend void swap(HParamDef& a, HParamDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HParamDef* New() const final { + return CreateMaybeMessage(NULL); + } + + HParamDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HParamDef& from); + void MergeFrom(const HParamDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HParamDef* other); + protected: + explicit HParamDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef HParamDef_BytesList BytesList; + typedef HParamDef_FloatList FloatList; + typedef HParamDef_Int64List Int64List; + typedef HParamDef_BoolList BoolList; + typedef HParamDef_HParamType HParamType; + + // accessors ------------------------------------------------------- + + // map hparam = 1; + int hparam_size() const; + void clear_hparam(); + static const int kHparamFieldNumber = 1; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >& + hparam() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >* + mutable_hparam(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + HParamDef_HparamEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > hparam_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// HParamDef_BytesList + +// repeated bytes value = 1; +inline int HParamDef_BytesList::value_size() const { + return value_.size(); +} +inline void HParamDef_BytesList::clear_value() { + value_.Clear(); +} +inline const ::std::string& HParamDef_BytesList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.BytesList.value) + return value_.Get(index); +} +inline ::std::string* HParamDef_BytesList::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.HParamDef.BytesList.value) + return value_.Mutable(index); +} +inline void HParamDef_BytesList::set_value(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.BytesList.value) + value_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void HParamDef_BytesList::set_value(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.BytesList.value) + value_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void HParamDef_BytesList::set_value(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.HParamDef.BytesList.value) +} +inline void HParamDef_BytesList::set_value(int index, const void* value, size_t size) { + value_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.HParamDef.BytesList.value) +} +inline ::std::string* HParamDef_BytesList::add_value() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.HParamDef.BytesList.value) + return value_.Add(); +} +inline void HParamDef_BytesList::add_value(const ::std::string& value) { + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.HParamDef.BytesList.value) +} +#if LANG_CXX11 +inline void HParamDef_BytesList::add_value(::std::string&& value) { + value_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.HParamDef.BytesList.value) +} +#endif +inline void HParamDef_BytesList::add_value(const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.HParamDef.BytesList.value) +} +inline void HParamDef_BytesList::add_value(const void* value, size_t size) { + value_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.HParamDef.BytesList.value) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +HParamDef_BytesList::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.HParamDef.BytesList.value) + return value_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +HParamDef_BytesList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.HParamDef.BytesList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// HParamDef_FloatList + +// repeated float value = 1 [packed = true]; +inline int HParamDef_FloatList::value_size() const { + return value_.size(); +} +inline void HParamDef_FloatList::clear_value() { + value_.Clear(); +} +inline float HParamDef_FloatList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.FloatList.value) + return value_.Get(index); +} +inline void HParamDef_FloatList::set_value(int index, float value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.FloatList.value) +} +inline void HParamDef_FloatList::add_value(float value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.HParamDef.FloatList.value) +} +inline const ::google::protobuf::RepeatedField< float >& +HParamDef_FloatList::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.HParamDef.FloatList.value) + return value_; +} +inline ::google::protobuf::RepeatedField< float >* +HParamDef_FloatList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.HParamDef.FloatList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// HParamDef_Int64List + +// repeated int64 value = 1 [packed = true]; +inline int HParamDef_Int64List::value_size() const { + return value_.size(); +} +inline void HParamDef_Int64List::clear_value() { + value_.Clear(); +} +inline ::google::protobuf::int64 HParamDef_Int64List::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.Int64List.value) + return value_.Get(index); +} +inline void HParamDef_Int64List::set_value(int index, ::google::protobuf::int64 value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.Int64List.value) +} +inline void HParamDef_Int64List::add_value(::google::protobuf::int64 value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.HParamDef.Int64List.value) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +HParamDef_Int64List::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.HParamDef.Int64List.value) + return value_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +HParamDef_Int64List::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.HParamDef.Int64List.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// HParamDef_BoolList + +// repeated bool value = 1 [packed = true]; +inline int HParamDef_BoolList::value_size() const { + return value_.size(); +} +inline void HParamDef_BoolList::clear_value() { + value_.Clear(); +} +inline bool HParamDef_BoolList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.BoolList.value) + return value_.Get(index); +} +inline void HParamDef_BoolList::set_value(int index, bool value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.BoolList.value) +} +inline void HParamDef_BoolList::add_value(bool value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.HParamDef.BoolList.value) +} +inline const ::google::protobuf::RepeatedField< bool >& +HParamDef_BoolList::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.HParamDef.BoolList.value) + return value_; +} +inline ::google::protobuf::RepeatedField< bool >* +HParamDef_BoolList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.HParamDef.BoolList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// HParamDef_HParamType + +// int64 int64_value = 1; +inline bool HParamDef_HParamType::has_int64_value() const { + return kind_case() == kInt64Value; +} +inline void HParamDef_HParamType::set_has_int64_value() { + _oneof_case_[0] = kInt64Value; +} +inline void HParamDef_HParamType::clear_int64_value() { + if (has_int64_value()) { + kind_.int64_value_ = GOOGLE_LONGLONG(0); + clear_has_kind(); + } +} +inline ::google::protobuf::int64 HParamDef_HParamType::int64_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.int64_value) + if (has_int64_value()) { + return kind_.int64_value_; + } + return GOOGLE_LONGLONG(0); +} +inline void HParamDef_HParamType::set_int64_value(::google::protobuf::int64 value) { + if (!has_int64_value()) { + clear_kind(); + set_has_int64_value(); + } + kind_.int64_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.HParamType.int64_value) +} + +// float float_value = 2; +inline bool HParamDef_HParamType::has_float_value() const { + return kind_case() == kFloatValue; +} +inline void HParamDef_HParamType::set_has_float_value() { + _oneof_case_[0] = kFloatValue; +} +inline void HParamDef_HParamType::clear_float_value() { + if (has_float_value()) { + kind_.float_value_ = 0; + clear_has_kind(); + } +} +inline float HParamDef_HParamType::float_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.float_value) + if (has_float_value()) { + return kind_.float_value_; + } + return 0; +} +inline void HParamDef_HParamType::set_float_value(float value) { + if (!has_float_value()) { + clear_kind(); + set_has_float_value(); + } + kind_.float_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.HParamType.float_value) +} + +// bytes bytes_value = 3; +inline bool HParamDef_HParamType::has_bytes_value() const { + return kind_case() == kBytesValue; +} +inline void HParamDef_HParamType::set_has_bytes_value() { + _oneof_case_[0] = kBytesValue; +} +inline void HParamDef_HParamType::clear_bytes_value() { + if (has_bytes_value()) { + kind_.bytes_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_kind(); + } +} +inline const ::std::string& HParamDef_HParamType::bytes_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) + if (has_bytes_value()) { + return kind_.bytes_value_.Get(); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void HParamDef_HParamType::set_bytes_value(const ::std::string& value) { + if (!has_bytes_value()) { + clear_kind(); + set_has_bytes_value(); + kind_.bytes_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + kind_.bytes_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) +} +#if LANG_CXX11 +inline void HParamDef_HParamType::set_bytes_value(::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) + if (!has_bytes_value()) { + clear_kind(); + set_has_bytes_value(); + kind_.bytes_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + kind_.bytes_value_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) +} +#endif +inline void HParamDef_HParamType::set_bytes_value(const char* value) { + GOOGLE_DCHECK(value != NULL); + if (!has_bytes_value()) { + clear_kind(); + set_has_bytes_value(); + kind_.bytes_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + kind_.bytes_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) +} +inline void HParamDef_HParamType::set_bytes_value(const void* value, + size_t size) { + if (!has_bytes_value()) { + clear_kind(); + set_has_bytes_value(); + kind_.bytes_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + kind_.bytes_value_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) +} +inline ::std::string* HParamDef_HParamType::mutable_bytes_value() { + if (!has_bytes_value()) { + clear_kind(); + set_has_bytes_value(); + kind_.bytes_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return kind_.bytes_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) +} +inline ::std::string* HParamDef_HParamType::release_bytes_value() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) + if (has_bytes_value()) { + clear_has_kind(); + return kind_.bytes_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void HParamDef_HParamType::set_allocated_bytes_value(::std::string* bytes_value) { + if (!has_bytes_value()) { + kind_.bytes_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_kind(); + if (bytes_value != NULL) { + set_has_bytes_value(); + kind_.bytes_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), bytes_value, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) +} +inline ::std::string* HParamDef_HParamType::unsafe_arena_release_bytes_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_bytes_value()) { + clear_has_kind(); + return kind_.bytes_value_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void HParamDef_HParamType::unsafe_arena_set_allocated_bytes_value(::std::string* bytes_value) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_bytes_value()) { + kind_.bytes_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_kind(); + if (bytes_value) { + set_has_bytes_value(); + kind_.bytes_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), bytes_value, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.bytes_value) +} + +// bool bool_value = 7; +inline bool HParamDef_HParamType::has_bool_value() const { + return kind_case() == kBoolValue; +} +inline void HParamDef_HParamType::set_has_bool_value() { + _oneof_case_[0] = kBoolValue; +} +inline void HParamDef_HParamType::clear_bool_value() { + if (has_bool_value()) { + kind_.bool_value_ = false; + clear_has_kind(); + } +} +inline bool HParamDef_HParamType::bool_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.bool_value) + if (has_bool_value()) { + return kind_.bool_value_; + } + return false; +} +inline void HParamDef_HParamType::set_bool_value(bool value) { + if (!has_bool_value()) { + clear_kind(); + set_has_bool_value(); + } + kind_.bool_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HParamDef.HParamType.bool_value) +} + +// .diplomacy.tensorflow.HParamDef.Int64List int64_list = 4; +inline bool HParamDef_HParamType::has_int64_list() const { + return kind_case() == kInt64List; +} +inline void HParamDef_HParamType::set_has_int64_list() { + _oneof_case_[0] = kInt64List; +} +inline void HParamDef_HParamType::clear_int64_list() { + if (has_int64_list()) { + if (GetArenaNoVirtual() == NULL) { + delete kind_.int64_list_; + } + clear_has_kind(); + } +} +inline const ::diplomacy::tensorflow::HParamDef_Int64List& HParamDef_HParamType::_internal_int64_list() const { + return *kind_.int64_list_; +} +inline ::diplomacy::tensorflow::HParamDef_Int64List* HParamDef_HParamType::release_int64_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.HParamDef.HParamType.int64_list) + if (has_int64_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_Int64List* temp = kind_.int64_list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + kind_.int64_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::HParamDef_Int64List& HParamDef_HParamType::int64_list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.int64_list) + return has_int64_list() + ? *kind_.int64_list_ + : *reinterpret_cast< ::diplomacy::tensorflow::HParamDef_Int64List*>(&::diplomacy::tensorflow::_HParamDef_Int64List_default_instance_); +} +inline ::diplomacy::tensorflow::HParamDef_Int64List* HParamDef_HParamType::unsafe_arena_release_int64_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.HParamDef.HParamType.int64_list) + if (has_int64_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_Int64List* temp = kind_.int64_list_; + kind_.int64_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void HParamDef_HParamType::unsafe_arena_set_allocated_int64_list(::diplomacy::tensorflow::HParamDef_Int64List* int64_list) { + clear_kind(); + if (int64_list) { + set_has_int64_list(); + kind_.int64_list_ = int64_list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.int64_list) +} +inline ::diplomacy::tensorflow::HParamDef_Int64List* HParamDef_HParamType::mutable_int64_list() { + if (!has_int64_list()) { + clear_kind(); + set_has_int64_list(); + kind_.int64_list_ = CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_Int64List >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.HParamDef.HParamType.int64_list) + return kind_.int64_list_; +} + +// .diplomacy.tensorflow.HParamDef.FloatList float_list = 5; +inline bool HParamDef_HParamType::has_float_list() const { + return kind_case() == kFloatList; +} +inline void HParamDef_HParamType::set_has_float_list() { + _oneof_case_[0] = kFloatList; +} +inline void HParamDef_HParamType::clear_float_list() { + if (has_float_list()) { + if (GetArenaNoVirtual() == NULL) { + delete kind_.float_list_; + } + clear_has_kind(); + } +} +inline const ::diplomacy::tensorflow::HParamDef_FloatList& HParamDef_HParamType::_internal_float_list() const { + return *kind_.float_list_; +} +inline ::diplomacy::tensorflow::HParamDef_FloatList* HParamDef_HParamType::release_float_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.HParamDef.HParamType.float_list) + if (has_float_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_FloatList* temp = kind_.float_list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + kind_.float_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::HParamDef_FloatList& HParamDef_HParamType::float_list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.float_list) + return has_float_list() + ? *kind_.float_list_ + : *reinterpret_cast< ::diplomacy::tensorflow::HParamDef_FloatList*>(&::diplomacy::tensorflow::_HParamDef_FloatList_default_instance_); +} +inline ::diplomacy::tensorflow::HParamDef_FloatList* HParamDef_HParamType::unsafe_arena_release_float_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.HParamDef.HParamType.float_list) + if (has_float_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_FloatList* temp = kind_.float_list_; + kind_.float_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void HParamDef_HParamType::unsafe_arena_set_allocated_float_list(::diplomacy::tensorflow::HParamDef_FloatList* float_list) { + clear_kind(); + if (float_list) { + set_has_float_list(); + kind_.float_list_ = float_list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.float_list) +} +inline ::diplomacy::tensorflow::HParamDef_FloatList* HParamDef_HParamType::mutable_float_list() { + if (!has_float_list()) { + clear_kind(); + set_has_float_list(); + kind_.float_list_ = CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_FloatList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.HParamDef.HParamType.float_list) + return kind_.float_list_; +} + +// .diplomacy.tensorflow.HParamDef.BytesList bytes_list = 6; +inline bool HParamDef_HParamType::has_bytes_list() const { + return kind_case() == kBytesList; +} +inline void HParamDef_HParamType::set_has_bytes_list() { + _oneof_case_[0] = kBytesList; +} +inline void HParamDef_HParamType::clear_bytes_list() { + if (has_bytes_list()) { + if (GetArenaNoVirtual() == NULL) { + delete kind_.bytes_list_; + } + clear_has_kind(); + } +} +inline const ::diplomacy::tensorflow::HParamDef_BytesList& HParamDef_HParamType::_internal_bytes_list() const { + return *kind_.bytes_list_; +} +inline ::diplomacy::tensorflow::HParamDef_BytesList* HParamDef_HParamType::release_bytes_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.HParamDef.HParamType.bytes_list) + if (has_bytes_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_BytesList* temp = kind_.bytes_list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + kind_.bytes_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::HParamDef_BytesList& HParamDef_HParamType::bytes_list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.bytes_list) + return has_bytes_list() + ? *kind_.bytes_list_ + : *reinterpret_cast< ::diplomacy::tensorflow::HParamDef_BytesList*>(&::diplomacy::tensorflow::_HParamDef_BytesList_default_instance_); +} +inline ::diplomacy::tensorflow::HParamDef_BytesList* HParamDef_HParamType::unsafe_arena_release_bytes_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.HParamDef.HParamType.bytes_list) + if (has_bytes_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_BytesList* temp = kind_.bytes_list_; + kind_.bytes_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void HParamDef_HParamType::unsafe_arena_set_allocated_bytes_list(::diplomacy::tensorflow::HParamDef_BytesList* bytes_list) { + clear_kind(); + if (bytes_list) { + set_has_bytes_list(); + kind_.bytes_list_ = bytes_list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.bytes_list) +} +inline ::diplomacy::tensorflow::HParamDef_BytesList* HParamDef_HParamType::mutable_bytes_list() { + if (!has_bytes_list()) { + clear_kind(); + set_has_bytes_list(); + kind_.bytes_list_ = CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_BytesList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.HParamDef.HParamType.bytes_list) + return kind_.bytes_list_; +} + +// .diplomacy.tensorflow.HParamDef.BoolList bool_list = 8; +inline bool HParamDef_HParamType::has_bool_list() const { + return kind_case() == kBoolList; +} +inline void HParamDef_HParamType::set_has_bool_list() { + _oneof_case_[0] = kBoolList; +} +inline void HParamDef_HParamType::clear_bool_list() { + if (has_bool_list()) { + if (GetArenaNoVirtual() == NULL) { + delete kind_.bool_list_; + } + clear_has_kind(); + } +} +inline const ::diplomacy::tensorflow::HParamDef_BoolList& HParamDef_HParamType::_internal_bool_list() const { + return *kind_.bool_list_; +} +inline ::diplomacy::tensorflow::HParamDef_BoolList* HParamDef_HParamType::release_bool_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.HParamDef.HParamType.bool_list) + if (has_bool_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_BoolList* temp = kind_.bool_list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + kind_.bool_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::HParamDef_BoolList& HParamDef_HParamType::bool_list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HParamDef.HParamType.bool_list) + return has_bool_list() + ? *kind_.bool_list_ + : *reinterpret_cast< ::diplomacy::tensorflow::HParamDef_BoolList*>(&::diplomacy::tensorflow::_HParamDef_BoolList_default_instance_); +} +inline ::diplomacy::tensorflow::HParamDef_BoolList* HParamDef_HParamType::unsafe_arena_release_bool_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.HParamDef.HParamType.bool_list) + if (has_bool_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::HParamDef_BoolList* temp = kind_.bool_list_; + kind_.bool_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void HParamDef_HParamType::unsafe_arena_set_allocated_bool_list(::diplomacy::tensorflow::HParamDef_BoolList* bool_list) { + clear_kind(); + if (bool_list) { + set_has_bool_list(); + kind_.bool_list_ = bool_list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.HParamDef.HParamType.bool_list) +} +inline ::diplomacy::tensorflow::HParamDef_BoolList* HParamDef_HParamType::mutable_bool_list() { + if (!has_bool_list()) { + clear_kind(); + set_has_bool_list(); + kind_.bool_list_ = CreateMaybeMessage< ::diplomacy::tensorflow::HParamDef_BoolList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.HParamDef.HParamType.bool_list) + return kind_.bool_list_; +} + +inline bool HParamDef_HParamType::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void HParamDef_HParamType::clear_has_kind() { + _oneof_case_[0] = KIND_NOT_SET; +} +inline HParamDef_HParamType::KindCase HParamDef_HParamType::kind_case() const { + return HParamDef_HParamType::KindCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// HParamDef + +// map hparam = 1; +inline int HParamDef::hparam_size() const { + return hparam_.size(); +} +inline void HParamDef::clear_hparam() { + hparam_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >& +HParamDef::hparam() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.HParamDef.hparam) + return hparam_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::HParamDef_HParamType >* +HParamDef::mutable_hparam() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.HParamDef.hparam) + return hparam_.MutableMap(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2ftraining_2fpython_2ftraining_2fhparam_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.proto new file mode 100644 index 0000000..049fb8b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam.proto @@ -0,0 +1,52 @@ +// Copyright 2016 The TensorFlow Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= + +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; + +// Protocol buffer holding hyper parameters. +// Examples of hyper parameters: +// learning_rate = 0.1, +// num_hidden_units = 100, +// activations = ['relu', 'tanh'] +message HParamDef { + message BytesList { + repeated bytes value = 1; + } + message FloatList { + repeated float value = 1 [packed = true]; + } + message Int64List { + repeated int64 value = 1 [packed = true]; + } + message BoolList { + repeated bool value = 1 [packed = true]; + } + message HParamType { + oneof kind { + int64 int64_value = 1; + float float_value = 2; + bytes bytes_value = 3; + bool bool_value = 7; + Int64List int64_list = 4; + FloatList float_list = 5; + BytesList bytes_list = 6; + BoolList bool_list = 8; + } + }; + map hparam = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam_pb2.py new file mode 100644 index 0000000..1434374 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/training/python/training/hparam_pb2.py @@ -0,0 +1,397 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/training/python/training/hparam.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/training/python/training/hparam.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\nBdiplomacy_tensorflow/contrib/training/python/training/hparam.proto\x12\x14\x64iplomacy.tensorflow\"\x92\x05\n\tHParamDef\x12;\n\x06hparam\x18\x01 \x03(\x0b\x32+.diplomacy.tensorflow.HParamDef.HparamEntry\x1a\x1a\n\tBytesList\x12\r\n\x05value\x18\x01 \x03(\x0c\x1a\x1e\n\tFloatList\x12\x11\n\x05value\x18\x01 \x03(\x02\x42\x02\x10\x01\x1a\x1e\n\tInt64List\x12\x11\n\x05value\x18\x01 \x03(\x03\x42\x02\x10\x01\x1a\x1d\n\x08\x42oolList\x12\x11\n\x05value\x18\x01 \x03(\x08\x42\x02\x10\x01\x1a\xf1\x02\n\nHParamType\x12\x15\n\x0bint64_value\x18\x01 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x02H\x00\x12\x15\n\x0b\x62ytes_value\x18\x03 \x01(\x0cH\x00\x12\x14\n\nbool_value\x18\x07 \x01(\x08H\x00\x12?\n\nint64_list\x18\x04 \x01(\x0b\x32).diplomacy.tensorflow.HParamDef.Int64ListH\x00\x12?\n\nfloat_list\x18\x05 \x01(\x0b\x32).diplomacy.tensorflow.HParamDef.FloatListH\x00\x12?\n\nbytes_list\x18\x06 \x01(\x0b\x32).diplomacy.tensorflow.HParamDef.BytesListH\x00\x12=\n\tbool_list\x18\x08 \x01(\x0b\x32(.diplomacy.tensorflow.HParamDef.BoolListH\x00\x42\x06\n\x04kind\x1aY\n\x0bHparamEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.diplomacy.tensorflow.HParamDef.HParamType:\x02\x38\x01\x42\x03\xf8\x01\x01\x62\x06proto3') +) + + + + +_HPARAMDEF_BYTESLIST = _descriptor.Descriptor( + name='BytesList', + full_name='diplomacy.tensorflow.HParamDef.BytesList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.HParamDef.BytesList.value', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=167, + serialized_end=193, +) + +_HPARAMDEF_FLOATLIST = _descriptor.Descriptor( + name='FloatList', + full_name='diplomacy.tensorflow.HParamDef.FloatList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.HParamDef.FloatList.value', index=0, + number=1, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=195, + serialized_end=225, +) + +_HPARAMDEF_INT64LIST = _descriptor.Descriptor( + name='Int64List', + full_name='diplomacy.tensorflow.HParamDef.Int64List', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.HParamDef.Int64List.value', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=227, + serialized_end=257, +) + +_HPARAMDEF_BOOLLIST = _descriptor.Descriptor( + name='BoolList', + full_name='diplomacy.tensorflow.HParamDef.BoolList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.HParamDef.BoolList.value', index=0, + number=1, type=8, cpp_type=7, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=259, + serialized_end=288, +) + +_HPARAMDEF_HPARAMTYPE = _descriptor.Descriptor( + name='HParamType', + full_name='diplomacy.tensorflow.HParamDef.HParamType', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='int64_value', full_name='diplomacy.tensorflow.HParamDef.HParamType.int64_value', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='float_value', full_name='diplomacy.tensorflow.HParamDef.HParamType.float_value', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bytes_value', full_name='diplomacy.tensorflow.HParamDef.HParamType.bytes_value', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bool_value', full_name='diplomacy.tensorflow.HParamDef.HParamType.bool_value', index=3, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int64_list', full_name='diplomacy.tensorflow.HParamDef.HParamType.int64_list', index=4, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='float_list', full_name='diplomacy.tensorflow.HParamDef.HParamType.float_list', index=5, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bytes_list', full_name='diplomacy.tensorflow.HParamDef.HParamType.bytes_list', index=6, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bool_list', full_name='diplomacy.tensorflow.HParamDef.HParamType.bool_list', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='kind', full_name='diplomacy.tensorflow.HParamDef.HParamType.kind', + index=0, containing_type=None, fields=[]), + ], + serialized_start=291, + serialized_end=660, +) + +_HPARAMDEF_HPARAMENTRY = _descriptor.Descriptor( + name='HparamEntry', + full_name='diplomacy.tensorflow.HParamDef.HparamEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.HParamDef.HparamEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.HParamDef.HparamEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=662, + serialized_end=751, +) + +_HPARAMDEF = _descriptor.Descriptor( + name='HParamDef', + full_name='diplomacy.tensorflow.HParamDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='hparam', full_name='diplomacy.tensorflow.HParamDef.hparam', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_HPARAMDEF_BYTESLIST, _HPARAMDEF_FLOATLIST, _HPARAMDEF_INT64LIST, _HPARAMDEF_BOOLLIST, _HPARAMDEF_HPARAMTYPE, _HPARAMDEF_HPARAMENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=93, + serialized_end=751, +) + +_HPARAMDEF_BYTESLIST.containing_type = _HPARAMDEF +_HPARAMDEF_FLOATLIST.containing_type = _HPARAMDEF +_HPARAMDEF_INT64LIST.containing_type = _HPARAMDEF +_HPARAMDEF_BOOLLIST.containing_type = _HPARAMDEF +_HPARAMDEF_HPARAMTYPE.fields_by_name['int64_list'].message_type = _HPARAMDEF_INT64LIST +_HPARAMDEF_HPARAMTYPE.fields_by_name['float_list'].message_type = _HPARAMDEF_FLOATLIST +_HPARAMDEF_HPARAMTYPE.fields_by_name['bytes_list'].message_type = _HPARAMDEF_BYTESLIST +_HPARAMDEF_HPARAMTYPE.fields_by_name['bool_list'].message_type = _HPARAMDEF_BOOLLIST +_HPARAMDEF_HPARAMTYPE.containing_type = _HPARAMDEF +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['int64_value']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['int64_value'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['float_value']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['float_value'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['bytes_value']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['bytes_value'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['bool_value']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['bool_value'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['int64_list']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['int64_list'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['float_list']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['float_list'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['bytes_list']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['bytes_list'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'].fields.append( + _HPARAMDEF_HPARAMTYPE.fields_by_name['bool_list']) +_HPARAMDEF_HPARAMTYPE.fields_by_name['bool_list'].containing_oneof = _HPARAMDEF_HPARAMTYPE.oneofs_by_name['kind'] +_HPARAMDEF_HPARAMENTRY.fields_by_name['value'].message_type = _HPARAMDEF_HPARAMTYPE +_HPARAMDEF_HPARAMENTRY.containing_type = _HPARAMDEF +_HPARAMDEF.fields_by_name['hparam'].message_type = _HPARAMDEF_HPARAMENTRY +DESCRIPTOR.message_types_by_name['HParamDef'] = _HPARAMDEF +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +HParamDef = _reflection.GeneratedProtocolMessageType('HParamDef', (_message.Message,), dict( + + BytesList = _reflection.GeneratedProtocolMessageType('BytesList', (_message.Message,), dict( + DESCRIPTOR = _HPARAMDEF_BYTESLIST, + __module__ = 'diplomacy_tensorflow.contrib.training.python.training.hparam_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.BytesList) + )) + , + + FloatList = _reflection.GeneratedProtocolMessageType('FloatList', (_message.Message,), dict( + DESCRIPTOR = _HPARAMDEF_FLOATLIST, + __module__ = 'diplomacy_tensorflow.contrib.training.python.training.hparam_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.FloatList) + )) + , + + Int64List = _reflection.GeneratedProtocolMessageType('Int64List', (_message.Message,), dict( + DESCRIPTOR = _HPARAMDEF_INT64LIST, + __module__ = 'diplomacy_tensorflow.contrib.training.python.training.hparam_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.Int64List) + )) + , + + BoolList = _reflection.GeneratedProtocolMessageType('BoolList', (_message.Message,), dict( + DESCRIPTOR = _HPARAMDEF_BOOLLIST, + __module__ = 'diplomacy_tensorflow.contrib.training.python.training.hparam_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.BoolList) + )) + , + + HParamType = _reflection.GeneratedProtocolMessageType('HParamType', (_message.Message,), dict( + DESCRIPTOR = _HPARAMDEF_HPARAMTYPE, + __module__ = 'diplomacy_tensorflow.contrib.training.python.training.hparam_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.HParamType) + )) + , + + HparamEntry = _reflection.GeneratedProtocolMessageType('HparamEntry', (_message.Message,), dict( + DESCRIPTOR = _HPARAMDEF_HPARAMENTRY, + __module__ = 'diplomacy_tensorflow.contrib.training.python.training.hparam_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef.HparamEntry) + )) + , + DESCRIPTOR = _HPARAMDEF, + __module__ = 'diplomacy_tensorflow.contrib.training.python.training.hparam_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HParamDef) + )) +_sym_db.RegisterMessage(HParamDef) +_sym_db.RegisterMessage(HParamDef.BytesList) +_sym_db.RegisterMessage(HParamDef.FloatList) +_sym_db.RegisterMessage(HParamDef.Int64List) +_sym_db.RegisterMessage(HParamDef.BoolList) +_sym_db.RegisterMessage(HParamDef.HParamType) +_sym_db.RegisterMessage(HParamDef.HparamEntry) + + +DESCRIPTOR._options = None +_HPARAMDEF_FLOATLIST.fields_by_name['value']._options = None +_HPARAMDEF_INT64LIST.fields_by_name['value']._options = None +_HPARAMDEF_BOOLLIST.fields_by_name['value']._options = None +_HPARAMDEF_HPARAMENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.pb.cc new file mode 100644 index 0000000..364a1ea --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.pb.cc @@ -0,0 +1,1935 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/verbs/verbs_service.proto + +#include "diplomacy_tensorflow/contrib/verbs/verbs_service.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Channel; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_MemoryRegion; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto +namespace diplomacy { +namespace tensorflow { +class ChannelDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Channel_default_instance_; +class MemoryRegionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryRegion_default_instance_; +class GetRemoteAddressRequestDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GetRemoteAddressRequest_default_instance_; +class GetRemoteAddressResponseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GetRemoteAddressResponse_default_instance_; +class ErrorStatusProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ErrorStatusProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto { +static void InitDefaultsChannel() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Channel_default_instance_; + new (ptr) ::diplomacy::tensorflow::Channel(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Channel::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Channel = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsChannel}, {}}; + +static void InitDefaultsMemoryRegion() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryRegion_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryRegion(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryRegion::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MemoryRegion = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMemoryRegion}, {}}; + +static void InitDefaultsGetRemoteAddressRequest() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GetRemoteAddressRequest_default_instance_; + new (ptr) ::diplomacy::tensorflow::GetRemoteAddressRequest(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GetRemoteAddressRequest::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_GetRemoteAddressRequest = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsGetRemoteAddressRequest}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_Channel.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_MemoryRegion.base,}}; + +static void InitDefaultsGetRemoteAddressResponse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GetRemoteAddressResponse_default_instance_; + new (ptr) ::diplomacy::tensorflow::GetRemoteAddressResponse(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GetRemoteAddressResponse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_GetRemoteAddressResponse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsGetRemoteAddressResponse}, { + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_Channel.base, + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_MemoryRegion.base,}}; + +static void InitDefaultsErrorStatusProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ErrorStatusProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::ErrorStatusProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ErrorStatusProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ErrorStatusProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsErrorStatusProto}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Channel.base); + ::google::protobuf::internal::InitSCC(&scc_info_MemoryRegion.base); + ::google::protobuf::internal::InitSCC(&scc_info_GetRemoteAddressRequest.base); + ::google::protobuf::internal::InitSCC(&scc_info_GetRemoteAddressResponse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ErrorStatusProto.base); +} + +::google::protobuf::Metadata file_level_metadata[5]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Channel, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Channel, lid_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Channel, qpn_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Channel, psn_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Channel, snp_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Channel, iid_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryRegion, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryRegion, remote_addr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryRegion, rkey_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressRequest, host_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressRequest, channel_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressRequest, mr_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressResponse, host_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressResponse, channel_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GetRemoteAddressResponse, mr_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ErrorStatusProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ErrorStatusProto, error_code_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ErrorStatusProto, error_message_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ErrorStatusProto, error_details_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::Channel)}, + { 10, -1, sizeof(::diplomacy::tensorflow::MemoryRegion)}, + { 17, -1, sizeof(::diplomacy::tensorflow::GetRemoteAddressRequest)}, + { 25, -1, sizeof(::diplomacy::tensorflow::GetRemoteAddressResponse)}, + { 33, -1, sizeof(::diplomacy::tensorflow::ErrorStatusProto)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_Channel_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MemoryRegion_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GetRemoteAddressRequest_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GetRemoteAddressResponse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ErrorStatusProto_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/contrib/verbs/verbs_service.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n6diplomacy_tensorflow/contrib/verbs/ver" + "bs_service.proto\022\024diplomacy.tensorflow\"J" + "\n\007Channel\022\013\n\003lid\030\001 \001(\005\022\013\n\003qpn\030\002 \001(\005\022\013\n\003p" + "sn\030\003 \001(\005\022\013\n\003snp\030\004 \001(\004\022\013\n\003iid\030\005 \001(\004\"1\n\014Me" + "moryRegion\022\023\n\013remote_addr\030\001 \001(\004\022\014\n\004rkey\030" + "\002 \001(\r\"\214\001\n\027GetRemoteAddressRequest\022\021\n\thos" + "t_name\030\001 \001(\t\022.\n\007channel\030\002 \001(\0132\035.diplomac" + "y.tensorflow.Channel\022.\n\002mr\030\003 \003(\0132\".diplo" + "macy.tensorflow.MemoryRegion\"\215\001\n\030GetRemo" + "teAddressResponse\022\021\n\thost_name\030\001 \001(\t\022.\n\007" + "channel\030\002 \001(\0132\035.diplomacy.tensorflow.Cha" + "nnel\022.\n\002mr\030\003 \003(\0132\".diplomacy.tensorflow." + "MemoryRegion\"T\n\020ErrorStatusProto\022\022\n\nerro" + "r_code\030\001 \001(\005\022\025\n\rerror_message\030\002 \001(\t\022\025\n\re" + "rror_details\030\003 \001(\t2\201\001\n\014VerbsService\022q\n\020G" + "etRemoteAddress\022-.diplomacy.tensorflow.G" + "etRemoteAddressRequest\032..diplomacy.tenso" + "rflow.GetRemoteAddressResponseB4\n\034org.te" + "nsorflow.contrib.verbsB\022VerbsServiceProt" + "osP\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 772); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/contrib/verbs/verbs_service.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void Channel::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Channel::kLidFieldNumber; +const int Channel::kQpnFieldNumber; +const int Channel::kPsnFieldNumber; +const int Channel::kSnpFieldNumber; +const int Channel::kIidFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Channel::Channel() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_Channel.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Channel) +} +Channel::Channel(const Channel& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&lid_, &from.lid_, + static_cast(reinterpret_cast(&psn_) - + reinterpret_cast(&lid_)) + sizeof(psn_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Channel) +} + +void Channel::SharedCtor() { + ::memset(&lid_, 0, static_cast( + reinterpret_cast(&psn_) - + reinterpret_cast(&lid_)) + sizeof(psn_)); +} + +Channel::~Channel() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Channel) + SharedDtor(); +} + +void Channel::SharedDtor() { +} + +void Channel::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Channel::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Channel& Channel::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_Channel.base); + return *internal_default_instance(); +} + + +void Channel::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Channel) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&lid_, 0, static_cast( + reinterpret_cast(&psn_) - + reinterpret_cast(&lid_)) + sizeof(psn_)); + _internal_metadata_.Clear(); +} + +bool Channel::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Channel) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 lid = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lid_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 qpn = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &qpn_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 psn = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &psn_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 snp = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &snp_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 iid = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &iid_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Channel) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Channel) + return false; +#undef DO_ +} + +void Channel::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Channel) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 lid = 1; + if (this->lid() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->lid(), output); + } + + // int32 qpn = 2; + if (this->qpn() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->qpn(), output); + } + + // int32 psn = 3; + if (this->psn() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->psn(), output); + } + + // uint64 snp = 4; + if (this->snp() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->snp(), output); + } + + // uint64 iid = 5; + if (this->iid() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->iid(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Channel) +} + +::google::protobuf::uint8* Channel::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Channel) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 lid = 1; + if (this->lid() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->lid(), target); + } + + // int32 qpn = 2; + if (this->qpn() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->qpn(), target); + } + + // int32 psn = 3; + if (this->psn() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->psn(), target); + } + + // uint64 snp = 4; + if (this->snp() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->snp(), target); + } + + // uint64 iid = 5; + if (this->iid() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->iid(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Channel) + return target; +} + +size_t Channel::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Channel) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 lid = 1; + if (this->lid() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->lid()); + } + + // int32 qpn = 2; + if (this->qpn() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->qpn()); + } + + // uint64 snp = 4; + if (this->snp() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->snp()); + } + + // uint64 iid = 5; + if (this->iid() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->iid()); + } + + // int32 psn = 3; + if (this->psn() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->psn()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Channel::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Channel) + GOOGLE_DCHECK_NE(&from, this); + const Channel* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Channel) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Channel) + MergeFrom(*source); + } +} + +void Channel::MergeFrom(const Channel& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Channel) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.lid() != 0) { + set_lid(from.lid()); + } + if (from.qpn() != 0) { + set_qpn(from.qpn()); + } + if (from.snp() != 0) { + set_snp(from.snp()); + } + if (from.iid() != 0) { + set_iid(from.iid()); + } + if (from.psn() != 0) { + set_psn(from.psn()); + } +} + +void Channel::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Channel) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Channel::CopyFrom(const Channel& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Channel) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Channel::IsInitialized() const { + return true; +} + +void Channel::Swap(Channel* other) { + if (other == this) return; + InternalSwap(other); +} +void Channel::InternalSwap(Channel* other) { + using std::swap; + swap(lid_, other->lid_); + swap(qpn_, other->qpn_); + swap(snp_, other->snp_); + swap(iid_, other->iid_); + swap(psn_, other->psn_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Channel::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MemoryRegion::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryRegion::kRemoteAddrFieldNumber; +const int MemoryRegion::kRkeyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryRegion::MemoryRegion() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_MemoryRegion.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryRegion) +} +MemoryRegion::MemoryRegion(const MemoryRegion& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&remote_addr_, &from.remote_addr_, + static_cast(reinterpret_cast(&rkey_) - + reinterpret_cast(&remote_addr_)) + sizeof(rkey_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryRegion) +} + +void MemoryRegion::SharedCtor() { + ::memset(&remote_addr_, 0, static_cast( + reinterpret_cast(&rkey_) - + reinterpret_cast(&remote_addr_)) + sizeof(rkey_)); +} + +MemoryRegion::~MemoryRegion() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryRegion) + SharedDtor(); +} + +void MemoryRegion::SharedDtor() { +} + +void MemoryRegion::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryRegion::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryRegion& MemoryRegion::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_MemoryRegion.base); + return *internal_default_instance(); +} + + +void MemoryRegion::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryRegion) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&remote_addr_, 0, static_cast( + reinterpret_cast(&rkey_) - + reinterpret_cast(&remote_addr_)) + sizeof(rkey_)); + _internal_metadata_.Clear(); +} + +bool MemoryRegion::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryRegion) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // uint64 remote_addr = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &remote_addr_))); + } else { + goto handle_unusual; + } + break; + } + + // uint32 rkey = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rkey_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryRegion) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryRegion) + return false; +#undef DO_ +} + +void MemoryRegion::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryRegion) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 remote_addr = 1; + if (this->remote_addr() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->remote_addr(), output); + } + + // uint32 rkey = 2; + if (this->rkey() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->rkey(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryRegion) +} + +::google::protobuf::uint8* MemoryRegion::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryRegion) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 remote_addr = 1; + if (this->remote_addr() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->remote_addr(), target); + } + + // uint32 rkey = 2; + if (this->rkey() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->rkey(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryRegion) + return target; +} + +size_t MemoryRegion::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryRegion) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // uint64 remote_addr = 1; + if (this->remote_addr() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->remote_addr()); + } + + // uint32 rkey = 2; + if (this->rkey() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->rkey()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryRegion::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryRegion) + GOOGLE_DCHECK_NE(&from, this); + const MemoryRegion* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryRegion) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryRegion) + MergeFrom(*source); + } +} + +void MemoryRegion::MergeFrom(const MemoryRegion& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryRegion) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.remote_addr() != 0) { + set_remote_addr(from.remote_addr()); + } + if (from.rkey() != 0) { + set_rkey(from.rkey()); + } +} + +void MemoryRegion::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryRegion) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryRegion::CopyFrom(const MemoryRegion& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryRegion) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryRegion::IsInitialized() const { + return true; +} + +void MemoryRegion::Swap(MemoryRegion* other) { + if (other == this) return; + InternalSwap(other); +} +void MemoryRegion::InternalSwap(MemoryRegion* other) { + using std::swap; + swap(remote_addr_, other->remote_addr_); + swap(rkey_, other->rkey_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryRegion::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GetRemoteAddressRequest::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_GetRemoteAddressRequest_default_instance_._instance.get_mutable()->channel_ = const_cast< ::diplomacy::tensorflow::Channel*>( + ::diplomacy::tensorflow::Channel::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GetRemoteAddressRequest::kHostNameFieldNumber; +const int GetRemoteAddressRequest::kChannelFieldNumber; +const int GetRemoteAddressRequest::kMrFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GetRemoteAddressRequest::GetRemoteAddressRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_GetRemoteAddressRequest.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GetRemoteAddressRequest) +} +GetRemoteAddressRequest::GetRemoteAddressRequest(const GetRemoteAddressRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + mr_(from.mr_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.host_name().size() > 0) { + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } + if (from.has_channel()) { + channel_ = new ::diplomacy::tensorflow::Channel(*from.channel_); + } else { + channel_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GetRemoteAddressRequest) +} + +void GetRemoteAddressRequest::SharedCtor() { + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + channel_ = NULL; +} + +GetRemoteAddressRequest::~GetRemoteAddressRequest() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GetRemoteAddressRequest) + SharedDtor(); +} + +void GetRemoteAddressRequest::SharedDtor() { + host_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete channel_; +} + +void GetRemoteAddressRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GetRemoteAddressRequest::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GetRemoteAddressRequest& GetRemoteAddressRequest::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_GetRemoteAddressRequest.base); + return *internal_default_instance(); +} + + +void GetRemoteAddressRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GetRemoteAddressRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + mr_.Clear(); + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && channel_ != NULL) { + delete channel_; + } + channel_ = NULL; + _internal_metadata_.Clear(); +} + +bool GetRemoteAddressRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GetRemoteAddressRequest) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string host_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_host_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GetRemoteAddressRequest.host_name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.Channel channel = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_channel())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_mr())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GetRemoteAddressRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GetRemoteAddressRequest) + return false; +#undef DO_ +} + +void GetRemoteAddressRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GetRemoteAddressRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string host_name = 1; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GetRemoteAddressRequest.host_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->host_name(), output); + } + + // .diplomacy.tensorflow.Channel channel = 2; + if (this->has_channel()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_channel(), output); + } + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + for (unsigned int i = 0, + n = static_cast(this->mr_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->mr(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GetRemoteAddressRequest) +} + +::google::protobuf::uint8* GetRemoteAddressRequest::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GetRemoteAddressRequest) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string host_name = 1; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GetRemoteAddressRequest.host_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->host_name(), target); + } + + // .diplomacy.tensorflow.Channel channel = 2; + if (this->has_channel()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_channel(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + for (unsigned int i = 0, + n = static_cast(this->mr_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->mr(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GetRemoteAddressRequest) + return target; +} + +size_t GetRemoteAddressRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GetRemoteAddressRequest) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + { + unsigned int count = static_cast(this->mr_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->mr(static_cast(i))); + } + } + + // string host_name = 1; + if (this->host_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->host_name()); + } + + // .diplomacy.tensorflow.Channel channel = 2; + if (this->has_channel()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *channel_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetRemoteAddressRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GetRemoteAddressRequest) + GOOGLE_DCHECK_NE(&from, this); + const GetRemoteAddressRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GetRemoteAddressRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GetRemoteAddressRequest) + MergeFrom(*source); + } +} + +void GetRemoteAddressRequest::MergeFrom(const GetRemoteAddressRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GetRemoteAddressRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + mr_.MergeFrom(from.mr_); + if (from.host_name().size() > 0) { + + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } + if (from.has_channel()) { + mutable_channel()->::diplomacy::tensorflow::Channel::MergeFrom(from.channel()); + } +} + +void GetRemoteAddressRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GetRemoteAddressRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetRemoteAddressRequest::CopyFrom(const GetRemoteAddressRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GetRemoteAddressRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetRemoteAddressRequest::IsInitialized() const { + return true; +} + +void GetRemoteAddressRequest::Swap(GetRemoteAddressRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void GetRemoteAddressRequest::InternalSwap(GetRemoteAddressRequest* other) { + using std::swap; + CastToBase(&mr_)->InternalSwap(CastToBase(&other->mr_)); + host_name_.Swap(&other->host_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(channel_, other->channel_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GetRemoteAddressRequest::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GetRemoteAddressResponse::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_GetRemoteAddressResponse_default_instance_._instance.get_mutable()->channel_ = const_cast< ::diplomacy::tensorflow::Channel*>( + ::diplomacy::tensorflow::Channel::internal_default_instance()); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GetRemoteAddressResponse::kHostNameFieldNumber; +const int GetRemoteAddressResponse::kChannelFieldNumber; +const int GetRemoteAddressResponse::kMrFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GetRemoteAddressResponse::GetRemoteAddressResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_GetRemoteAddressResponse.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GetRemoteAddressResponse) +} +GetRemoteAddressResponse::GetRemoteAddressResponse(const GetRemoteAddressResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + mr_(from.mr_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.host_name().size() > 0) { + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } + if (from.has_channel()) { + channel_ = new ::diplomacy::tensorflow::Channel(*from.channel_); + } else { + channel_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GetRemoteAddressResponse) +} + +void GetRemoteAddressResponse::SharedCtor() { + host_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + channel_ = NULL; +} + +GetRemoteAddressResponse::~GetRemoteAddressResponse() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GetRemoteAddressResponse) + SharedDtor(); +} + +void GetRemoteAddressResponse::SharedDtor() { + host_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete channel_; +} + +void GetRemoteAddressResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GetRemoteAddressResponse::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GetRemoteAddressResponse& GetRemoteAddressResponse::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_GetRemoteAddressResponse.base); + return *internal_default_instance(); +} + + +void GetRemoteAddressResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GetRemoteAddressResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + mr_.Clear(); + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && channel_ != NULL) { + delete channel_; + } + channel_ = NULL; + _internal_metadata_.Clear(); +} + +bool GetRemoteAddressResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GetRemoteAddressResponse) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string host_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_host_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GetRemoteAddressResponse.host_name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.Channel channel = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_channel())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_mr())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GetRemoteAddressResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GetRemoteAddressResponse) + return false; +#undef DO_ +} + +void GetRemoteAddressResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GetRemoteAddressResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string host_name = 1; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GetRemoteAddressResponse.host_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->host_name(), output); + } + + // .diplomacy.tensorflow.Channel channel = 2; + if (this->has_channel()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_channel(), output); + } + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + for (unsigned int i = 0, + n = static_cast(this->mr_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->mr(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GetRemoteAddressResponse) +} + +::google::protobuf::uint8* GetRemoteAddressResponse::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GetRemoteAddressResponse) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string host_name = 1; + if (this->host_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_name().data(), static_cast(this->host_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GetRemoteAddressResponse.host_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->host_name(), target); + } + + // .diplomacy.tensorflow.Channel channel = 2; + if (this->has_channel()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_channel(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + for (unsigned int i = 0, + n = static_cast(this->mr_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->mr(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GetRemoteAddressResponse) + return target; +} + +size_t GetRemoteAddressResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GetRemoteAddressResponse) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + { + unsigned int count = static_cast(this->mr_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->mr(static_cast(i))); + } + } + + // string host_name = 1; + if (this->host_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->host_name()); + } + + // .diplomacy.tensorflow.Channel channel = 2; + if (this->has_channel()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *channel_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GetRemoteAddressResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GetRemoteAddressResponse) + GOOGLE_DCHECK_NE(&from, this); + const GetRemoteAddressResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GetRemoteAddressResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GetRemoteAddressResponse) + MergeFrom(*source); + } +} + +void GetRemoteAddressResponse::MergeFrom(const GetRemoteAddressResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GetRemoteAddressResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + mr_.MergeFrom(from.mr_); + if (from.host_name().size() > 0) { + + host_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_name_); + } + if (from.has_channel()) { + mutable_channel()->::diplomacy::tensorflow::Channel::MergeFrom(from.channel()); + } +} + +void GetRemoteAddressResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GetRemoteAddressResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GetRemoteAddressResponse::CopyFrom(const GetRemoteAddressResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GetRemoteAddressResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GetRemoteAddressResponse::IsInitialized() const { + return true; +} + +void GetRemoteAddressResponse::Swap(GetRemoteAddressResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void GetRemoteAddressResponse::InternalSwap(GetRemoteAddressResponse* other) { + using std::swap; + CastToBase(&mr_)->InternalSwap(CastToBase(&other->mr_)); + host_name_.Swap(&other->host_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(channel_, other->channel_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GetRemoteAddressResponse::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ErrorStatusProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ErrorStatusProto::kErrorCodeFieldNumber; +const int ErrorStatusProto::kErrorMessageFieldNumber; +const int ErrorStatusProto::kErrorDetailsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ErrorStatusProto::ErrorStatusProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_ErrorStatusProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ErrorStatusProto) +} +ErrorStatusProto::ErrorStatusProto(const ErrorStatusProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.error_message().size() > 0) { + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + error_details_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.error_details().size() > 0) { + error_details_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_details_); + } + error_code_ = from.error_code_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ErrorStatusProto) +} + +void ErrorStatusProto::SharedCtor() { + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_details_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_code_ = 0; +} + +ErrorStatusProto::~ErrorStatusProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ErrorStatusProto) + SharedDtor(); +} + +void ErrorStatusProto::SharedDtor() { + error_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_details_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ErrorStatusProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ErrorStatusProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ErrorStatusProto& ErrorStatusProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::scc_info_ErrorStatusProto.base); + return *internal_default_instance(); +} + + +void ErrorStatusProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ErrorStatusProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_details_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + error_code_ = 0; + _internal_metadata_.Clear(); +} + +bool ErrorStatusProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ErrorStatusProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 error_code = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &error_code_))); + } else { + goto handle_unusual; + } + break; + } + + // string error_message = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_error_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ErrorStatusProto.error_message")); + } else { + goto handle_unusual; + } + break; + } + + // string error_details = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_error_details())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_details().data(), static_cast(this->error_details().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ErrorStatusProto.error_details")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ErrorStatusProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ErrorStatusProto) + return false; +#undef DO_ +} + +void ErrorStatusProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ErrorStatusProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 error_code = 1; + if (this->error_code() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->error_code(), output); + } + + // string error_message = 2; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ErrorStatusProto.error_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->error_message(), output); + } + + // string error_details = 3; + if (this->error_details().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_details().data(), static_cast(this->error_details().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ErrorStatusProto.error_details"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->error_details(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ErrorStatusProto) +} + +::google::protobuf::uint8* ErrorStatusProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ErrorStatusProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 error_code = 1; + if (this->error_code() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->error_code(), target); + } + + // string error_message = 2; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), static_cast(this->error_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ErrorStatusProto.error_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->error_message(), target); + } + + // string error_details = 3; + if (this->error_details().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_details().data(), static_cast(this->error_details().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ErrorStatusProto.error_details"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->error_details(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ErrorStatusProto) + return target; +} + +size_t ErrorStatusProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ErrorStatusProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string error_message = 2; + if (this->error_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->error_message()); + } + + // string error_details = 3; + if (this->error_details().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->error_details()); + } + + // int32 error_code = 1; + if (this->error_code() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->error_code()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ErrorStatusProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ErrorStatusProto) + GOOGLE_DCHECK_NE(&from, this); + const ErrorStatusProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ErrorStatusProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ErrorStatusProto) + MergeFrom(*source); + } +} + +void ErrorStatusProto::MergeFrom(const ErrorStatusProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ErrorStatusProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.error_message().size() > 0) { + + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } + if (from.error_details().size() > 0) { + + error_details_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_details_); + } + if (from.error_code() != 0) { + set_error_code(from.error_code()); + } +} + +void ErrorStatusProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ErrorStatusProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ErrorStatusProto::CopyFrom(const ErrorStatusProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ErrorStatusProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ErrorStatusProto::IsInitialized() const { + return true; +} + +void ErrorStatusProto::Swap(ErrorStatusProto* other) { + if (other == this) return; + InternalSwap(other); +} +void ErrorStatusProto::InternalSwap(ErrorStatusProto* other) { + using std::swap; + error_message_.Swap(&other->error_message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + error_details_.Swap(&other->error_details_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(error_code_, other->error_code_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ErrorStatusProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Channel* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Channel >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::Channel >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryRegion* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryRegion >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::MemoryRegion >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GetRemoteAddressRequest* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GetRemoteAddressRequest >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::GetRemoteAddressRequest >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GetRemoteAddressResponse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GetRemoteAddressResponse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::GetRemoteAddressResponse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ErrorStatusProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ErrorStatusProto >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::ErrorStatusProto >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.pb.h new file mode 100644 index 0000000..511f82a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.pb.h @@ -0,0 +1,1265 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/contrib/verbs/verbs_service.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[5]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto +namespace diplomacy { +namespace tensorflow { +class Channel; +class ChannelDefaultTypeInternal; +extern ChannelDefaultTypeInternal _Channel_default_instance_; +class ErrorStatusProto; +class ErrorStatusProtoDefaultTypeInternal; +extern ErrorStatusProtoDefaultTypeInternal _ErrorStatusProto_default_instance_; +class GetRemoteAddressRequest; +class GetRemoteAddressRequestDefaultTypeInternal; +extern GetRemoteAddressRequestDefaultTypeInternal _GetRemoteAddressRequest_default_instance_; +class GetRemoteAddressResponse; +class GetRemoteAddressResponseDefaultTypeInternal; +extern GetRemoteAddressResponseDefaultTypeInternal _GetRemoteAddressResponse_default_instance_; +class MemoryRegion; +class MemoryRegionDefaultTypeInternal; +extern MemoryRegionDefaultTypeInternal _MemoryRegion_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::Channel* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Channel>(Arena*); +template<> ::diplomacy::tensorflow::ErrorStatusProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ErrorStatusProto>(Arena*); +template<> ::diplomacy::tensorflow::GetRemoteAddressRequest* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GetRemoteAddressRequest>(Arena*); +template<> ::diplomacy::tensorflow::GetRemoteAddressResponse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GetRemoteAddressResponse>(Arena*); +template<> ::diplomacy::tensorflow::MemoryRegion* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryRegion>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class Channel : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Channel) */ { + public: + Channel(); + virtual ~Channel(); + + Channel(const Channel& from); + + inline Channel& operator=(const Channel& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Channel(Channel&& from) noexcept + : Channel() { + *this = ::std::move(from); + } + + inline Channel& operator=(Channel&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const Channel& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Channel* internal_default_instance() { + return reinterpret_cast( + &_Channel_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Channel* other); + friend void swap(Channel& a, Channel& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Channel* New() const final { + return CreateMaybeMessage(NULL); + } + + Channel* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Channel& from); + void MergeFrom(const Channel& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Channel* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 lid = 1; + void clear_lid(); + static const int kLidFieldNumber = 1; + ::google::protobuf::int32 lid() const; + void set_lid(::google::protobuf::int32 value); + + // int32 qpn = 2; + void clear_qpn(); + static const int kQpnFieldNumber = 2; + ::google::protobuf::int32 qpn() const; + void set_qpn(::google::protobuf::int32 value); + + // uint64 snp = 4; + void clear_snp(); + static const int kSnpFieldNumber = 4; + ::google::protobuf::uint64 snp() const; + void set_snp(::google::protobuf::uint64 value); + + // uint64 iid = 5; + void clear_iid(); + static const int kIidFieldNumber = 5; + ::google::protobuf::uint64 iid() const; + void set_iid(::google::protobuf::uint64 value); + + // int32 psn = 3; + void clear_psn(); + static const int kPsnFieldNumber = 3; + ::google::protobuf::int32 psn() const; + void set_psn(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Channel) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int32 lid_; + ::google::protobuf::int32 qpn_; + ::google::protobuf::uint64 snp_; + ::google::protobuf::uint64 iid_; + ::google::protobuf::int32 psn_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MemoryRegion : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryRegion) */ { + public: + MemoryRegion(); + virtual ~MemoryRegion(); + + MemoryRegion(const MemoryRegion& from); + + inline MemoryRegion& operator=(const MemoryRegion& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryRegion(MemoryRegion&& from) noexcept + : MemoryRegion() { + *this = ::std::move(from); + } + + inline MemoryRegion& operator=(MemoryRegion&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryRegion& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryRegion* internal_default_instance() { + return reinterpret_cast( + &_MemoryRegion_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(MemoryRegion* other); + friend void swap(MemoryRegion& a, MemoryRegion& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryRegion* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryRegion* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryRegion& from); + void MergeFrom(const MemoryRegion& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryRegion* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // uint64 remote_addr = 1; + void clear_remote_addr(); + static const int kRemoteAddrFieldNumber = 1; + ::google::protobuf::uint64 remote_addr() const; + void set_remote_addr(::google::protobuf::uint64 value); + + // uint32 rkey = 2; + void clear_rkey(); + static const int kRkeyFieldNumber = 2; + ::google::protobuf::uint32 rkey() const; + void set_rkey(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryRegion) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint64 remote_addr_; + ::google::protobuf::uint32 rkey_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GetRemoteAddressRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GetRemoteAddressRequest) */ { + public: + GetRemoteAddressRequest(); + virtual ~GetRemoteAddressRequest(); + + GetRemoteAddressRequest(const GetRemoteAddressRequest& from); + + inline GetRemoteAddressRequest& operator=(const GetRemoteAddressRequest& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GetRemoteAddressRequest(GetRemoteAddressRequest&& from) noexcept + : GetRemoteAddressRequest() { + *this = ::std::move(from); + } + + inline GetRemoteAddressRequest& operator=(GetRemoteAddressRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const GetRemoteAddressRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GetRemoteAddressRequest* internal_default_instance() { + return reinterpret_cast( + &_GetRemoteAddressRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void Swap(GetRemoteAddressRequest* other); + friend void swap(GetRemoteAddressRequest& a, GetRemoteAddressRequest& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GetRemoteAddressRequest* New() const final { + return CreateMaybeMessage(NULL); + } + + GetRemoteAddressRequest* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GetRemoteAddressRequest& from); + void MergeFrom(const GetRemoteAddressRequest& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetRemoteAddressRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + int mr_size() const; + void clear_mr(); + static const int kMrFieldNumber = 3; + ::diplomacy::tensorflow::MemoryRegion* mutable_mr(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >* + mutable_mr(); + const ::diplomacy::tensorflow::MemoryRegion& mr(int index) const; + ::diplomacy::tensorflow::MemoryRegion* add_mr(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >& + mr() const; + + // string host_name = 1; + void clear_host_name(); + static const int kHostNameFieldNumber = 1; + const ::std::string& host_name() const; + void set_host_name(const ::std::string& value); + #if LANG_CXX11 + void set_host_name(::std::string&& value); + #endif + void set_host_name(const char* value); + void set_host_name(const char* value, size_t size); + ::std::string* mutable_host_name(); + ::std::string* release_host_name(); + void set_allocated_host_name(::std::string* host_name); + + // .diplomacy.tensorflow.Channel channel = 2; + bool has_channel() const; + void clear_channel(); + static const int kChannelFieldNumber = 2; + private: + const ::diplomacy::tensorflow::Channel& _internal_channel() const; + public: + const ::diplomacy::tensorflow::Channel& channel() const; + ::diplomacy::tensorflow::Channel* release_channel(); + ::diplomacy::tensorflow::Channel* mutable_channel(); + void set_allocated_channel(::diplomacy::tensorflow::Channel* channel); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GetRemoteAddressRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion > mr_; + ::google::protobuf::internal::ArenaStringPtr host_name_; + ::diplomacy::tensorflow::Channel* channel_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GetRemoteAddressResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GetRemoteAddressResponse) */ { + public: + GetRemoteAddressResponse(); + virtual ~GetRemoteAddressResponse(); + + GetRemoteAddressResponse(const GetRemoteAddressResponse& from); + + inline GetRemoteAddressResponse& operator=(const GetRemoteAddressResponse& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GetRemoteAddressResponse(GetRemoteAddressResponse&& from) noexcept + : GetRemoteAddressResponse() { + *this = ::std::move(from); + } + + inline GetRemoteAddressResponse& operator=(GetRemoteAddressResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const GetRemoteAddressResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GetRemoteAddressResponse* internal_default_instance() { + return reinterpret_cast( + &_GetRemoteAddressResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(GetRemoteAddressResponse* other); + friend void swap(GetRemoteAddressResponse& a, GetRemoteAddressResponse& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GetRemoteAddressResponse* New() const final { + return CreateMaybeMessage(NULL); + } + + GetRemoteAddressResponse* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GetRemoteAddressResponse& from); + void MergeFrom(const GetRemoteAddressResponse& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GetRemoteAddressResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.MemoryRegion mr = 3; + int mr_size() const; + void clear_mr(); + static const int kMrFieldNumber = 3; + ::diplomacy::tensorflow::MemoryRegion* mutable_mr(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >* + mutable_mr(); + const ::diplomacy::tensorflow::MemoryRegion& mr(int index) const; + ::diplomacy::tensorflow::MemoryRegion* add_mr(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >& + mr() const; + + // string host_name = 1; + void clear_host_name(); + static const int kHostNameFieldNumber = 1; + const ::std::string& host_name() const; + void set_host_name(const ::std::string& value); + #if LANG_CXX11 + void set_host_name(::std::string&& value); + #endif + void set_host_name(const char* value); + void set_host_name(const char* value, size_t size); + ::std::string* mutable_host_name(); + ::std::string* release_host_name(); + void set_allocated_host_name(::std::string* host_name); + + // .diplomacy.tensorflow.Channel channel = 2; + bool has_channel() const; + void clear_channel(); + static const int kChannelFieldNumber = 2; + private: + const ::diplomacy::tensorflow::Channel& _internal_channel() const; + public: + const ::diplomacy::tensorflow::Channel& channel() const; + ::diplomacy::tensorflow::Channel* release_channel(); + ::diplomacy::tensorflow::Channel* mutable_channel(); + void set_allocated_channel(::diplomacy::tensorflow::Channel* channel); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GetRemoteAddressResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion > mr_; + ::google::protobuf::internal::ArenaStringPtr host_name_; + ::diplomacy::tensorflow::Channel* channel_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ErrorStatusProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ErrorStatusProto) */ { + public: + ErrorStatusProto(); + virtual ~ErrorStatusProto(); + + ErrorStatusProto(const ErrorStatusProto& from); + + inline ErrorStatusProto& operator=(const ErrorStatusProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ErrorStatusProto(ErrorStatusProto&& from) noexcept + : ErrorStatusProto() { + *this = ::std::move(from); + } + + inline ErrorStatusProto& operator=(ErrorStatusProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const ErrorStatusProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ErrorStatusProto* internal_default_instance() { + return reinterpret_cast( + &_ErrorStatusProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void Swap(ErrorStatusProto* other); + friend void swap(ErrorStatusProto& a, ErrorStatusProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ErrorStatusProto* New() const final { + return CreateMaybeMessage(NULL); + } + + ErrorStatusProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ErrorStatusProto& from); + void MergeFrom(const ErrorStatusProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ErrorStatusProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string error_message = 2; + void clear_error_message(); + static const int kErrorMessageFieldNumber = 2; + const ::std::string& error_message() const; + void set_error_message(const ::std::string& value); + #if LANG_CXX11 + void set_error_message(::std::string&& value); + #endif + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + ::std::string* mutable_error_message(); + ::std::string* release_error_message(); + void set_allocated_error_message(::std::string* error_message); + + // string error_details = 3; + void clear_error_details(); + static const int kErrorDetailsFieldNumber = 3; + const ::std::string& error_details() const; + void set_error_details(const ::std::string& value); + #if LANG_CXX11 + void set_error_details(::std::string&& value); + #endif + void set_error_details(const char* value); + void set_error_details(const char* value, size_t size); + ::std::string* mutable_error_details(); + ::std::string* release_error_details(); + void set_allocated_error_details(::std::string* error_details); + + // int32 error_code = 1; + void clear_error_code(); + static const int kErrorCodeFieldNumber = 1; + ::google::protobuf::int32 error_code() const; + void set_error_code(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ErrorStatusProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + ::google::protobuf::internal::ArenaStringPtr error_details_; + ::google::protobuf::int32 error_code_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Channel + +// int32 lid = 1; +inline void Channel::clear_lid() { + lid_ = 0; +} +inline ::google::protobuf::int32 Channel::lid() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Channel.lid) + return lid_; +} +inline void Channel::set_lid(::google::protobuf::int32 value) { + + lid_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Channel.lid) +} + +// int32 qpn = 2; +inline void Channel::clear_qpn() { + qpn_ = 0; +} +inline ::google::protobuf::int32 Channel::qpn() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Channel.qpn) + return qpn_; +} +inline void Channel::set_qpn(::google::protobuf::int32 value) { + + qpn_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Channel.qpn) +} + +// int32 psn = 3; +inline void Channel::clear_psn() { + psn_ = 0; +} +inline ::google::protobuf::int32 Channel::psn() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Channel.psn) + return psn_; +} +inline void Channel::set_psn(::google::protobuf::int32 value) { + + psn_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Channel.psn) +} + +// uint64 snp = 4; +inline void Channel::clear_snp() { + snp_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 Channel::snp() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Channel.snp) + return snp_; +} +inline void Channel::set_snp(::google::protobuf::uint64 value) { + + snp_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Channel.snp) +} + +// uint64 iid = 5; +inline void Channel::clear_iid() { + iid_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 Channel::iid() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Channel.iid) + return iid_; +} +inline void Channel::set_iid(::google::protobuf::uint64 value) { + + iid_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Channel.iid) +} + +// ------------------------------------------------------------------- + +// MemoryRegion + +// uint64 remote_addr = 1; +inline void MemoryRegion::clear_remote_addr() { + remote_addr_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 MemoryRegion::remote_addr() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryRegion.remote_addr) + return remote_addr_; +} +inline void MemoryRegion::set_remote_addr(::google::protobuf::uint64 value) { + + remote_addr_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryRegion.remote_addr) +} + +// uint32 rkey = 2; +inline void MemoryRegion::clear_rkey() { + rkey_ = 0u; +} +inline ::google::protobuf::uint32 MemoryRegion::rkey() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryRegion.rkey) + return rkey_; +} +inline void MemoryRegion::set_rkey(::google::protobuf::uint32 value) { + + rkey_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryRegion.rkey) +} + +// ------------------------------------------------------------------- + +// GetRemoteAddressRequest + +// string host_name = 1; +inline void GetRemoteAddressRequest::clear_host_name() { + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& GetRemoteAddressRequest::host_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) + return host_name_.GetNoArena(); +} +inline void GetRemoteAddressRequest::set_host_name(const ::std::string& value) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) +} +#if LANG_CXX11 +inline void GetRemoteAddressRequest::set_host_name(::std::string&& value) { + + host_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) +} +#endif +inline void GetRemoteAddressRequest::set_host_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) +} +inline void GetRemoteAddressRequest::set_host_name(const char* value, size_t size) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) +} +inline ::std::string* GetRemoteAddressRequest::mutable_host_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) + return host_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* GetRemoteAddressRequest::release_host_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) + + return host_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void GetRemoteAddressRequest::set_allocated_host_name(::std::string* host_name) { + if (host_name != NULL) { + + } else { + + } + host_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GetRemoteAddressRequest.host_name) +} + +// .diplomacy.tensorflow.Channel channel = 2; +inline bool GetRemoteAddressRequest::has_channel() const { + return this != internal_default_instance() && channel_ != NULL; +} +inline void GetRemoteAddressRequest::clear_channel() { + if (GetArenaNoVirtual() == NULL && channel_ != NULL) { + delete channel_; + } + channel_ = NULL; +} +inline const ::diplomacy::tensorflow::Channel& GetRemoteAddressRequest::_internal_channel() const { + return *channel_; +} +inline const ::diplomacy::tensorflow::Channel& GetRemoteAddressRequest::channel() const { + const ::diplomacy::tensorflow::Channel* p = channel_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GetRemoteAddressRequest.channel) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_Channel_default_instance_); +} +inline ::diplomacy::tensorflow::Channel* GetRemoteAddressRequest::release_channel() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GetRemoteAddressRequest.channel) + + ::diplomacy::tensorflow::Channel* temp = channel_; + channel_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::Channel* GetRemoteAddressRequest::mutable_channel() { + + if (channel_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::Channel>(GetArenaNoVirtual()); + channel_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GetRemoteAddressRequest.channel) + return channel_; +} +inline void GetRemoteAddressRequest::set_allocated_channel(::diplomacy::tensorflow::Channel* channel) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete channel_; + } + if (channel) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + channel = ::google::protobuf::internal::GetOwnedMessage( + message_arena, channel, submessage_arena); + } + + } else { + + } + channel_ = channel; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GetRemoteAddressRequest.channel) +} + +// repeated .diplomacy.tensorflow.MemoryRegion mr = 3; +inline int GetRemoteAddressRequest::mr_size() const { + return mr_.size(); +} +inline void GetRemoteAddressRequest::clear_mr() { + mr_.Clear(); +} +inline ::diplomacy::tensorflow::MemoryRegion* GetRemoteAddressRequest::mutable_mr(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GetRemoteAddressRequest.mr) + return mr_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >* +GetRemoteAddressRequest::mutable_mr() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GetRemoteAddressRequest.mr) + return &mr_; +} +inline const ::diplomacy::tensorflow::MemoryRegion& GetRemoteAddressRequest::mr(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GetRemoteAddressRequest.mr) + return mr_.Get(index); +} +inline ::diplomacy::tensorflow::MemoryRegion* GetRemoteAddressRequest::add_mr() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GetRemoteAddressRequest.mr) + return mr_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >& +GetRemoteAddressRequest::mr() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GetRemoteAddressRequest.mr) + return mr_; +} + +// ------------------------------------------------------------------- + +// GetRemoteAddressResponse + +// string host_name = 1; +inline void GetRemoteAddressResponse::clear_host_name() { + host_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& GetRemoteAddressResponse::host_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) + return host_name_.GetNoArena(); +} +inline void GetRemoteAddressResponse::set_host_name(const ::std::string& value) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) +} +#if LANG_CXX11 +inline void GetRemoteAddressResponse::set_host_name(::std::string&& value) { + + host_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) +} +#endif +inline void GetRemoteAddressResponse::set_host_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) +} +inline void GetRemoteAddressResponse::set_host_name(const char* value, size_t size) { + + host_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) +} +inline ::std::string* GetRemoteAddressResponse::mutable_host_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) + return host_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* GetRemoteAddressResponse::release_host_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) + + return host_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void GetRemoteAddressResponse::set_allocated_host_name(::std::string* host_name) { + if (host_name != NULL) { + + } else { + + } + host_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GetRemoteAddressResponse.host_name) +} + +// .diplomacy.tensorflow.Channel channel = 2; +inline bool GetRemoteAddressResponse::has_channel() const { + return this != internal_default_instance() && channel_ != NULL; +} +inline void GetRemoteAddressResponse::clear_channel() { + if (GetArenaNoVirtual() == NULL && channel_ != NULL) { + delete channel_; + } + channel_ = NULL; +} +inline const ::diplomacy::tensorflow::Channel& GetRemoteAddressResponse::_internal_channel() const { + return *channel_; +} +inline const ::diplomacy::tensorflow::Channel& GetRemoteAddressResponse::channel() const { + const ::diplomacy::tensorflow::Channel* p = channel_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GetRemoteAddressResponse.channel) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_Channel_default_instance_); +} +inline ::diplomacy::tensorflow::Channel* GetRemoteAddressResponse::release_channel() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GetRemoteAddressResponse.channel) + + ::diplomacy::tensorflow::Channel* temp = channel_; + channel_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::Channel* GetRemoteAddressResponse::mutable_channel() { + + if (channel_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::Channel>(GetArenaNoVirtual()); + channel_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GetRemoteAddressResponse.channel) + return channel_; +} +inline void GetRemoteAddressResponse::set_allocated_channel(::diplomacy::tensorflow::Channel* channel) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete channel_; + } + if (channel) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + channel = ::google::protobuf::internal::GetOwnedMessage( + message_arena, channel, submessage_arena); + } + + } else { + + } + channel_ = channel; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GetRemoteAddressResponse.channel) +} + +// repeated .diplomacy.tensorflow.MemoryRegion mr = 3; +inline int GetRemoteAddressResponse::mr_size() const { + return mr_.size(); +} +inline void GetRemoteAddressResponse::clear_mr() { + mr_.Clear(); +} +inline ::diplomacy::tensorflow::MemoryRegion* GetRemoteAddressResponse::mutable_mr(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GetRemoteAddressResponse.mr) + return mr_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >* +GetRemoteAddressResponse::mutable_mr() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GetRemoteAddressResponse.mr) + return &mr_; +} +inline const ::diplomacy::tensorflow::MemoryRegion& GetRemoteAddressResponse::mr(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GetRemoteAddressResponse.mr) + return mr_.Get(index); +} +inline ::diplomacy::tensorflow::MemoryRegion* GetRemoteAddressResponse::add_mr() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GetRemoteAddressResponse.mr) + return mr_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::MemoryRegion >& +GetRemoteAddressResponse::mr() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GetRemoteAddressResponse.mr) + return mr_; +} + +// ------------------------------------------------------------------- + +// ErrorStatusProto + +// int32 error_code = 1; +inline void ErrorStatusProto::clear_error_code() { + error_code_ = 0; +} +inline ::google::protobuf::int32 ErrorStatusProto::error_code() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ErrorStatusProto.error_code) + return error_code_; +} +inline void ErrorStatusProto::set_error_code(::google::protobuf::int32 value) { + + error_code_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ErrorStatusProto.error_code) +} + +// string error_message = 2; +inline void ErrorStatusProto::clear_error_message() { + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ErrorStatusProto::error_message() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ErrorStatusProto.error_message) + return error_message_.GetNoArena(); +} +inline void ErrorStatusProto::set_error_message(const ::std::string& value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ErrorStatusProto.error_message) +} +#if LANG_CXX11 +inline void ErrorStatusProto::set_error_message(::std::string&& value) { + + error_message_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ErrorStatusProto.error_message) +} +#endif +inline void ErrorStatusProto::set_error_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ErrorStatusProto.error_message) +} +inline void ErrorStatusProto::set_error_message(const char* value, size_t size) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ErrorStatusProto.error_message) +} +inline ::std::string* ErrorStatusProto::mutable_error_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ErrorStatusProto.error_message) + return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ErrorStatusProto::release_error_message() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ErrorStatusProto.error_message) + + return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ErrorStatusProto::set_allocated_error_message(::std::string* error_message) { + if (error_message != NULL) { + + } else { + + } + error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ErrorStatusProto.error_message) +} + +// string error_details = 3; +inline void ErrorStatusProto::clear_error_details() { + error_details_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ErrorStatusProto::error_details() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ErrorStatusProto.error_details) + return error_details_.GetNoArena(); +} +inline void ErrorStatusProto::set_error_details(const ::std::string& value) { + + error_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ErrorStatusProto.error_details) +} +#if LANG_CXX11 +inline void ErrorStatusProto::set_error_details(::std::string&& value) { + + error_details_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ErrorStatusProto.error_details) +} +#endif +inline void ErrorStatusProto::set_error_details(const char* value) { + GOOGLE_DCHECK(value != NULL); + + error_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ErrorStatusProto.error_details) +} +inline void ErrorStatusProto::set_error_details(const char* value, size_t size) { + + error_details_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ErrorStatusProto.error_details) +} +inline ::std::string* ErrorStatusProto::mutable_error_details() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ErrorStatusProto.error_details) + return error_details_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ErrorStatusProto::release_error_details() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ErrorStatusProto.error_details) + + return error_details_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ErrorStatusProto::set_allocated_error_details(::std::string* error_details) { + if (error_details != NULL) { + + } else { + + } + error_details_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_details); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ErrorStatusProto.error_details) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcontrib_2fverbs_2fverbs_5fservice_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.proto b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.proto new file mode 100644 index 0000000..28e68ba --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service.proto @@ -0,0 +1,68 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +package diplomacy.tensorflow; +option java_outer_classname = "VerbsServiceProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.contrib.verbs"; + +//////////////////////////////////////////////////////////////////////////////// +// +// GRPC Helper messages used to exchange RDMA information. +// +//////////////////////////////////////////////////////////////////////////////// + +message Channel { + int32 lid = 1; + int32 qpn = 2; + int32 psn = 3; + uint64 snp = 4; + uint64 iid = 5; +} + +message MemoryRegion { + uint64 remote_addr = 1; + uint32 rkey = 2; +} +message GetRemoteAddressRequest { + string host_name = 1; + Channel channel = 2; + repeated MemoryRegion mr = 3; +} + +message GetRemoteAddressResponse { + string host_name = 1; + Channel channel = 2; + repeated MemoryRegion mr = 3; +} + +message ErrorStatusProto { + int32 error_code = 1; + string error_message = 2; + string error_details = 3; +} + +//////////////////////////////////////////////////////////////////////////////// +// +// VerbsService +// +//////////////////////////////////////////////////////////////////////////////// + +service VerbsService { + rpc GetRemoteAddress(GetRemoteAddressRequest) + returns (GetRemoteAddressResponse); +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service_pb2.py new file mode 100644 index 0000000..d144dfe --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/contrib/verbs/verbs_service_pb2.py @@ -0,0 +1,331 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/contrib/verbs/verbs_service.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/contrib/verbs/verbs_service.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\034org.tensorflow.contrib.verbsB\022VerbsServiceProtosP\001'), + serialized_pb=_b('\n6diplomacy_tensorflow/contrib/verbs/verbs_service.proto\x12\x14\x64iplomacy.tensorflow\"J\n\x07\x43hannel\x12\x0b\n\x03lid\x18\x01 \x01(\x05\x12\x0b\n\x03qpn\x18\x02 \x01(\x05\x12\x0b\n\x03psn\x18\x03 \x01(\x05\x12\x0b\n\x03snp\x18\x04 \x01(\x04\x12\x0b\n\x03iid\x18\x05 \x01(\x04\"1\n\x0cMemoryRegion\x12\x13\n\x0bremote_addr\x18\x01 \x01(\x04\x12\x0c\n\x04rkey\x18\x02 \x01(\r\"\x8c\x01\n\x17GetRemoteAddressRequest\x12\x11\n\thost_name\x18\x01 \x01(\t\x12.\n\x07\x63hannel\x18\x02 \x01(\x0b\x32\x1d.diplomacy.tensorflow.Channel\x12.\n\x02mr\x18\x03 \x03(\x0b\x32\".diplomacy.tensorflow.MemoryRegion\"\x8d\x01\n\x18GetRemoteAddressResponse\x12\x11\n\thost_name\x18\x01 \x01(\t\x12.\n\x07\x63hannel\x18\x02 \x01(\x0b\x32\x1d.diplomacy.tensorflow.Channel\x12.\n\x02mr\x18\x03 \x03(\x0b\x32\".diplomacy.tensorflow.MemoryRegion\"T\n\x10\x45rrorStatusProto\x12\x12\n\nerror_code\x18\x01 \x01(\x05\x12\x15\n\rerror_message\x18\x02 \x01(\t\x12\x15\n\rerror_details\x18\x03 \x01(\t2\x81\x01\n\x0cVerbsService\x12q\n\x10GetRemoteAddress\x12-.diplomacy.tensorflow.GetRemoteAddressRequest\x1a..diplomacy.tensorflow.GetRemoteAddressResponseB4\n\x1corg.tensorflow.contrib.verbsB\x12VerbsServiceProtosP\x01\x62\x06proto3') +) + + + + +_CHANNEL = _descriptor.Descriptor( + name='Channel', + full_name='diplomacy.tensorflow.Channel', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='lid', full_name='diplomacy.tensorflow.Channel.lid', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='qpn', full_name='diplomacy.tensorflow.Channel.qpn', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='psn', full_name='diplomacy.tensorflow.Channel.psn', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='snp', full_name='diplomacy.tensorflow.Channel.snp', index=3, + number=4, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='iid', full_name='diplomacy.tensorflow.Channel.iid', index=4, + number=5, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=80, + serialized_end=154, +) + + +_MEMORYREGION = _descriptor.Descriptor( + name='MemoryRegion', + full_name='diplomacy.tensorflow.MemoryRegion', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='remote_addr', full_name='diplomacy.tensorflow.MemoryRegion.remote_addr', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rkey', full_name='diplomacy.tensorflow.MemoryRegion.rkey', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=156, + serialized_end=205, +) + + +_GETREMOTEADDRESSREQUEST = _descriptor.Descriptor( + name='GetRemoteAddressRequest', + full_name='diplomacy.tensorflow.GetRemoteAddressRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='host_name', full_name='diplomacy.tensorflow.GetRemoteAddressRequest.host_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='channel', full_name='diplomacy.tensorflow.GetRemoteAddressRequest.channel', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mr', full_name='diplomacy.tensorflow.GetRemoteAddressRequest.mr', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=208, + serialized_end=348, +) + + +_GETREMOTEADDRESSRESPONSE = _descriptor.Descriptor( + name='GetRemoteAddressResponse', + full_name='diplomacy.tensorflow.GetRemoteAddressResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='host_name', full_name='diplomacy.tensorflow.GetRemoteAddressResponse.host_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='channel', full_name='diplomacy.tensorflow.GetRemoteAddressResponse.channel', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='mr', full_name='diplomacy.tensorflow.GetRemoteAddressResponse.mr', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=351, + serialized_end=492, +) + + +_ERRORSTATUSPROTO = _descriptor.Descriptor( + name='ErrorStatusProto', + full_name='diplomacy.tensorflow.ErrorStatusProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='error_code', full_name='diplomacy.tensorflow.ErrorStatusProto.error_code', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='error_message', full_name='diplomacy.tensorflow.ErrorStatusProto.error_message', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='error_details', full_name='diplomacy.tensorflow.ErrorStatusProto.error_details', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=494, + serialized_end=578, +) + +_GETREMOTEADDRESSREQUEST.fields_by_name['channel'].message_type = _CHANNEL +_GETREMOTEADDRESSREQUEST.fields_by_name['mr'].message_type = _MEMORYREGION +_GETREMOTEADDRESSRESPONSE.fields_by_name['channel'].message_type = _CHANNEL +_GETREMOTEADDRESSRESPONSE.fields_by_name['mr'].message_type = _MEMORYREGION +DESCRIPTOR.message_types_by_name['Channel'] = _CHANNEL +DESCRIPTOR.message_types_by_name['MemoryRegion'] = _MEMORYREGION +DESCRIPTOR.message_types_by_name['GetRemoteAddressRequest'] = _GETREMOTEADDRESSREQUEST +DESCRIPTOR.message_types_by_name['GetRemoteAddressResponse'] = _GETREMOTEADDRESSRESPONSE +DESCRIPTOR.message_types_by_name['ErrorStatusProto'] = _ERRORSTATUSPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Channel = _reflection.GeneratedProtocolMessageType('Channel', (_message.Message,), dict( + DESCRIPTOR = _CHANNEL, + __module__ = 'diplomacy_tensorflow.contrib.verbs.verbs_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Channel) + )) +_sym_db.RegisterMessage(Channel) + +MemoryRegion = _reflection.GeneratedProtocolMessageType('MemoryRegion', (_message.Message,), dict( + DESCRIPTOR = _MEMORYREGION, + __module__ = 'diplomacy_tensorflow.contrib.verbs.verbs_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryRegion) + )) +_sym_db.RegisterMessage(MemoryRegion) + +GetRemoteAddressRequest = _reflection.GeneratedProtocolMessageType('GetRemoteAddressRequest', (_message.Message,), dict( + DESCRIPTOR = _GETREMOTEADDRESSREQUEST, + __module__ = 'diplomacy_tensorflow.contrib.verbs.verbs_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GetRemoteAddressRequest) + )) +_sym_db.RegisterMessage(GetRemoteAddressRequest) + +GetRemoteAddressResponse = _reflection.GeneratedProtocolMessageType('GetRemoteAddressResponse', (_message.Message,), dict( + DESCRIPTOR = _GETREMOTEADDRESSRESPONSE, + __module__ = 'diplomacy_tensorflow.contrib.verbs.verbs_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GetRemoteAddressResponse) + )) +_sym_db.RegisterMessage(GetRemoteAddressResponse) + +ErrorStatusProto = _reflection.GeneratedProtocolMessageType('ErrorStatusProto', (_message.Message,), dict( + DESCRIPTOR = _ERRORSTATUSPROTO, + __module__ = 'diplomacy_tensorflow.contrib.verbs.verbs_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ErrorStatusProto) + )) +_sym_db.RegisterMessage(ErrorStatusProto) + + +DESCRIPTOR._options = None + +_VERBSSERVICE = _descriptor.ServiceDescriptor( + name='VerbsService', + full_name='diplomacy.tensorflow.VerbsService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=581, + serialized_end=710, + methods=[ + _descriptor.MethodDescriptor( + name='GetRemoteAddress', + full_name='diplomacy.tensorflow.VerbsService.GetRemoteAddress', + index=0, + containing_service=None, + input_type=_GETREMOTEADDRESSREQUEST, + output_type=_GETREMOTEADDRESSRESPONSE, + serialized_options=None, + ), +]) +_sym_db.RegisterServiceDescriptor(_VERBSSERVICE) + +DESCRIPTOR.services_by_name['VerbsService'] = _VERBSSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.pb.cc new file mode 100644 index 0000000..be58912 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.pb.cc @@ -0,0 +1,1594 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/debug/debug_service.proto + +#include "diplomacy_tensorflow/core/debug/debug_service.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_CallTraceback_OriginIdToStringEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_EventReply_DebugOpStateChange; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2ftfprof_5flog_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2ftfprof_5flog_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_CodeDef; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2ftfprof_5flog_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_OpLogProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2ftfprof_5flog_2eproto +namespace diplomacy { +namespace tensorflow { +class EventReply_DebugOpStateChangeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _EventReply_DebugOpStateChange_default_instance_; +class EventReplyDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _EventReply_default_instance_; +class CallTraceback_OriginIdToStringEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CallTraceback_OriginIdToStringEntry_DoNotUse_default_instance_; +class CallTracebackDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CallTraceback_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto { +static void InitDefaultsEventReply_DebugOpStateChange() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_EventReply_DebugOpStateChange_default_instance_; + new (ptr) ::diplomacy::tensorflow::EventReply_DebugOpStateChange(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::EventReply_DebugOpStateChange::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_EventReply_DebugOpStateChange = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsEventReply_DebugOpStateChange}, {}}; + +static void InitDefaultsEventReply() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_EventReply_default_instance_; + new (ptr) ::diplomacy::tensorflow::EventReply(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::EventReply::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_EventReply = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsEventReply}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_EventReply_DebugOpStateChange.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base,}}; + +static void InitDefaultsCallTraceback_OriginIdToStringEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_CallTraceback_OriginIdToStringEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse(); + } + ::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CallTraceback_OriginIdToStringEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCallTraceback_OriginIdToStringEntry_DoNotUse}, {}}; + +static void InitDefaultsCallTraceback() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_CallTraceback_default_instance_; + new (ptr) ::diplomacy::tensorflow::CallTraceback(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::CallTraceback::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_CallTraceback = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsCallTraceback}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2ftfprof_5flog_2eproto::scc_info_CodeDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_CallTraceback_OriginIdToStringEntry_DoNotUse.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2ftfprof_5flog_2eproto::scc_info_OpLogProto.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_EventReply_DebugOpStateChange.base); + ::google::protobuf::internal::InitSCC(&scc_info_EventReply.base); + ::google::protobuf::internal::InitSCC(&scc_info_CallTraceback_OriginIdToStringEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_CallTraceback.base); +} + +::google::protobuf::Metadata file_level_metadata[4]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply_DebugOpStateChange, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply_DebugOpStateChange, state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply_DebugOpStateChange, node_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply_DebugOpStateChange, output_slot_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply_DebugOpStateChange, debug_op_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply, debug_op_state_changes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::EventReply, tensor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback, call_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback, call_key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback, origin_stack_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback, origin_id_to_string_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback, graph_traceback_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CallTraceback, graph_version_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::EventReply_DebugOpStateChange)}, + { 9, -1, sizeof(::diplomacy::tensorflow::EventReply)}, + { 16, 23, sizeof(::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse)}, + { 25, -1, sizeof(::diplomacy::tensorflow::CallTraceback)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_EventReply_DebugOpStateChange_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_EventReply_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_CallTraceback_OriginIdToStringEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_CallTraceback_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/debug/debug_service.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n3diplomacy_tensorflow/core/debug/debug_" + "service.proto\022\024diplomacy.tensorflow\0320dip" + "lomacy_tensorflow/core/framework/tensor." + "proto\0323diplomacy_tensorflow/core/profile" + "r/tfprof_log.proto\032.diplomacy_tensorflow" + "/core/protobuf/debug.proto\032*diplomacy_te" + "nsorflow/core/util/event.proto\"\374\002\n\nEvent" + "Reply\022S\n\026debug_op_state_changes\030\001 \003(\01323." + "diplomacy.tensorflow.EventReply.DebugOpS" + "tateChange\0221\n\006tensor\030\002 \001(\0132!.diplomacy.t" + "ensorflow.TensorProto\032\345\001\n\022DebugOpStateCh" + "ange\022H\n\005state\030\001 \001(\01629.diplomacy.tensorfl" + "ow.EventReply.DebugOpStateChange.State\022\021" + "\n\tnode_name\030\002 \001(\t\022\023\n\013output_slot\030\003 \001(\005\022\020" + "\n\010debug_op\030\004 \001(\t\"K\n\005State\022\025\n\021STATE_UNSPE" + "CIFIED\020\000\022\014\n\010DISABLED\020\001\022\r\n\tREAD_ONLY\020\002\022\016\n" + "\nREAD_WRITE\020\003\"\317\003\n\rCallTraceback\022\?\n\tcall_" + "type\030\001 \001(\0162,.diplomacy.tensorflow.CallTr" + "aceback.CallType\022\020\n\010call_key\030\002 \001(\t\022:\n\014or" + "igin_stack\030\003 \001(\0132$.diplomacy.tensorflow." + "tfprof.CodeDef\022V\n\023origin_id_to_string\030\004 " + "\003(\01329.diplomacy.tensorflow.CallTraceback" + ".OriginIdToStringEntry\022@\n\017graph_tracebac" + "k\030\005 \001(\0132\'.diplomacy.tensorflow.tfprof.Op" + "LogProto\022\025\n\rgraph_version\030\006 \001(\003\0327\n\025Origi" + "nIdToStringEntry\022\013\n\003key\030\001 \001(\003\022\r\n\005value\030\002" + " \001(\t:\0028\001\"E\n\010CallType\022\017\n\013UNSPECIFIED\020\000\022\023\n" + "\017GRAPH_EXECUTION\020\001\022\023\n\017EAGER_EXECUTION\020\0022" + "\231\002\n\rEventListener\022O\n\nSendEvents\022\033.diplom" + "acy.tensorflow.Event\032 .diplomacy.tensorf" + "low.EventReply(\0010\001\022W\n\016SendTracebacks\022#.d" + "iplomacy.tensorflow.CallTraceback\032 .dipl" + "omacy.tensorflow.EventReply\022^\n\017SendSourc" + "eFiles\022).diplomacy.tensorflow.DebuggedSo" + "urceFiles\032 .diplomacy.tensorflow.EventRe" + "plyb\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1411); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/debug/debug_service.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2ftfprof_5flog_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fdebug_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2futil_2fevent_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto +namespace diplomacy { +namespace tensorflow { +const ::google::protobuf::EnumDescriptor* EventReply_DebugOpStateChange_State_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_enum_descriptors[0]; +} +bool EventReply_DebugOpStateChange_State_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange::STATE_UNSPECIFIED; +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange::DISABLED; +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange::READ_ONLY; +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange::READ_WRITE; +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange::State_MIN; +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange::State_MAX; +const int EventReply_DebugOpStateChange::State_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* CallTraceback_CallType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_enum_descriptors[1]; +} +bool CallTraceback_CallType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const CallTraceback_CallType CallTraceback::UNSPECIFIED; +const CallTraceback_CallType CallTraceback::GRAPH_EXECUTION; +const CallTraceback_CallType CallTraceback::EAGER_EXECUTION; +const CallTraceback_CallType CallTraceback::CallType_MIN; +const CallTraceback_CallType CallTraceback::CallType_MAX; +const int CallTraceback::CallType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void EventReply_DebugOpStateChange::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EventReply_DebugOpStateChange::kStateFieldNumber; +const int EventReply_DebugOpStateChange::kNodeNameFieldNumber; +const int EventReply_DebugOpStateChange::kOutputSlotFieldNumber; +const int EventReply_DebugOpStateChange::kDebugOpFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EventReply_DebugOpStateChange::EventReply_DebugOpStateChange() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_EventReply_DebugOpStateChange.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.EventReply.DebugOpStateChange) +} +EventReply_DebugOpStateChange::EventReply_DebugOpStateChange(const EventReply_DebugOpStateChange& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.node_name().size() > 0) { + node_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node_name_); + } + debug_op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.debug_op().size() > 0) { + debug_op_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.debug_op_); + } + ::memcpy(&state_, &from.state_, + static_cast(reinterpret_cast(&output_slot_) - + reinterpret_cast(&state_)) + sizeof(output_slot_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.EventReply.DebugOpStateChange) +} + +void EventReply_DebugOpStateChange::SharedCtor() { + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + debug_op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&state_, 0, static_cast( + reinterpret_cast(&output_slot_) - + reinterpret_cast(&state_)) + sizeof(output_slot_)); +} + +EventReply_DebugOpStateChange::~EventReply_DebugOpStateChange() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.EventReply.DebugOpStateChange) + SharedDtor(); +} + +void EventReply_DebugOpStateChange::SharedDtor() { + node_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + debug_op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void EventReply_DebugOpStateChange::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* EventReply_DebugOpStateChange::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const EventReply_DebugOpStateChange& EventReply_DebugOpStateChange::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_EventReply_DebugOpStateChange.base); + return *internal_default_instance(); +} + + +void EventReply_DebugOpStateChange::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + debug_op_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&state_, 0, static_cast( + reinterpret_cast(&output_slot_) - + reinterpret_cast(&state_)) + sizeof(output_slot_)); + _internal_metadata_.Clear(); +} + +bool EventReply_DebugOpStateChange::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.EventReply.DebugOpStateChange.State state = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_state(static_cast< ::diplomacy::tensorflow::EventReply_DebugOpStateChange_State >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string node_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_node_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name")); + } else { + goto handle_unusual; + } + break; + } + + // int32 output_slot = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &output_slot_))); + } else { + goto handle_unusual; + } + break; + } + + // string debug_op = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_debug_op())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->debug_op().data(), static_cast(this->debug_op().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.EventReply.DebugOpStateChange) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.EventReply.DebugOpStateChange) + return false; +#undef DO_ +} + +void EventReply_DebugOpStateChange::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.EventReply.DebugOpStateChange.State state = 1; + if (this->state() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->state(), output); + } + + // string node_name = 2; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->node_name(), output); + } + + // int32 output_slot = 3; + if (this->output_slot() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->output_slot(), output); + } + + // string debug_op = 4; + if (this->debug_op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->debug_op().data(), static_cast(this->debug_op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->debug_op(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.EventReply.DebugOpStateChange) +} + +::google::protobuf::uint8* EventReply_DebugOpStateChange::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.EventReply.DebugOpStateChange.State state = 1; + if (this->state() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->state(), target); + } + + // string node_name = 2; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->node_name(), target); + } + + // int32 output_slot = 3; + if (this->output_slot() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->output_slot(), target); + } + + // string debug_op = 4; + if (this->debug_op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->debug_op().data(), static_cast(this->debug_op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->debug_op(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.EventReply.DebugOpStateChange) + return target; +} + +size_t EventReply_DebugOpStateChange::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string node_name = 2; + if (this->node_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->node_name()); + } + + // string debug_op = 4; + if (this->debug_op().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->debug_op()); + } + + // .diplomacy.tensorflow.EventReply.DebugOpStateChange.State state = 1; + if (this->state() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->state()); + } + + // int32 output_slot = 3; + if (this->output_slot() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->output_slot()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void EventReply_DebugOpStateChange::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + GOOGLE_DCHECK_NE(&from, this); + const EventReply_DebugOpStateChange* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.EventReply.DebugOpStateChange) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.EventReply.DebugOpStateChange) + MergeFrom(*source); + } +} + +void EventReply_DebugOpStateChange::MergeFrom(const EventReply_DebugOpStateChange& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.node_name().size() > 0) { + + node_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node_name_); + } + if (from.debug_op().size() > 0) { + + debug_op_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.debug_op_); + } + if (from.state() != 0) { + set_state(from.state()); + } + if (from.output_slot() != 0) { + set_output_slot(from.output_slot()); + } +} + +void EventReply_DebugOpStateChange::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EventReply_DebugOpStateChange::CopyFrom(const EventReply_DebugOpStateChange& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.EventReply.DebugOpStateChange) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EventReply_DebugOpStateChange::IsInitialized() const { + return true; +} + +void EventReply_DebugOpStateChange::Swap(EventReply_DebugOpStateChange* other) { + if (other == this) return; + InternalSwap(other); +} +void EventReply_DebugOpStateChange::InternalSwap(EventReply_DebugOpStateChange* other) { + using std::swap; + node_name_.Swap(&other->node_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + debug_op_.Swap(&other->debug_op_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(state_, other->state_); + swap(output_slot_, other->output_slot_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata EventReply_DebugOpStateChange::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void EventReply::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_EventReply_default_instance_._instance.get_mutable()->tensor_ = const_cast< ::diplomacy::tensorflow::TensorProto*>( + ::diplomacy::tensorflow::TensorProto::internal_default_instance()); +} +void EventReply::clear_tensor() { + if (GetArenaNoVirtual() == NULL && tensor_ != NULL) { + delete tensor_; + } + tensor_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EventReply::kDebugOpStateChangesFieldNumber; +const int EventReply::kTensorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EventReply::EventReply() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_EventReply.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.EventReply) +} +EventReply::EventReply(const EventReply& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + debug_op_state_changes_(from.debug_op_state_changes_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_tensor()) { + tensor_ = new ::diplomacy::tensorflow::TensorProto(*from.tensor_); + } else { + tensor_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.EventReply) +} + +void EventReply::SharedCtor() { + tensor_ = NULL; +} + +EventReply::~EventReply() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.EventReply) + SharedDtor(); +} + +void EventReply::SharedDtor() { + if (this != internal_default_instance()) delete tensor_; +} + +void EventReply::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* EventReply::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const EventReply& EventReply::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_EventReply.base); + return *internal_default_instance(); +} + + +void EventReply::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.EventReply) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + debug_op_state_changes_.Clear(); + if (GetArenaNoVirtual() == NULL && tensor_ != NULL) { + delete tensor_; + } + tensor_ = NULL; + _internal_metadata_.Clear(); +} + +bool EventReply::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.EventReply) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.EventReply.DebugOpStateChange debug_op_state_changes = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_debug_op_state_changes())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorProto tensor = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.EventReply) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.EventReply) + return false; +#undef DO_ +} + +void EventReply::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.EventReply) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.EventReply.DebugOpStateChange debug_op_state_changes = 1; + for (unsigned int i = 0, + n = static_cast(this->debug_op_state_changes_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->debug_op_state_changes(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.TensorProto tensor = 2; + if (this->has_tensor()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_tensor(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.EventReply) +} + +::google::protobuf::uint8* EventReply::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.EventReply) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.EventReply.DebugOpStateChange debug_op_state_changes = 1; + for (unsigned int i = 0, + n = static_cast(this->debug_op_state_changes_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->debug_op_state_changes(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.TensorProto tensor = 2; + if (this->has_tensor()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_tensor(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.EventReply) + return target; +} + +size_t EventReply::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.EventReply) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.EventReply.DebugOpStateChange debug_op_state_changes = 1; + { + unsigned int count = static_cast(this->debug_op_state_changes_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->debug_op_state_changes(static_cast(i))); + } + } + + // .diplomacy.tensorflow.TensorProto tensor = 2; + if (this->has_tensor()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tensor_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void EventReply::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.EventReply) + GOOGLE_DCHECK_NE(&from, this); + const EventReply* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.EventReply) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.EventReply) + MergeFrom(*source); + } +} + +void EventReply::MergeFrom(const EventReply& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.EventReply) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + debug_op_state_changes_.MergeFrom(from.debug_op_state_changes_); + if (from.has_tensor()) { + mutable_tensor()->::diplomacy::tensorflow::TensorProto::MergeFrom(from.tensor()); + } +} + +void EventReply::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.EventReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EventReply::CopyFrom(const EventReply& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.EventReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EventReply::IsInitialized() const { + return true; +} + +void EventReply::Swap(EventReply* other) { + if (other == this) return; + InternalSwap(other); +} +void EventReply::InternalSwap(EventReply* other) { + using std::swap; + CastToBase(&debug_op_state_changes_)->InternalSwap(CastToBase(&other->debug_op_state_changes_)); + swap(tensor_, other->tensor_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata EventReply::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +CallTraceback_OriginIdToStringEntry_DoNotUse::CallTraceback_OriginIdToStringEntry_DoNotUse() {} +CallTraceback_OriginIdToStringEntry_DoNotUse::CallTraceback_OriginIdToStringEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void CallTraceback_OriginIdToStringEntry_DoNotUse::MergeFrom(const CallTraceback_OriginIdToStringEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata CallTraceback_OriginIdToStringEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_metadata[2]; +} +void CallTraceback_OriginIdToStringEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void CallTraceback::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_CallTraceback_default_instance_._instance.get_mutable()->origin_stack_ = const_cast< ::diplomacy::tensorflow::tfprof::CodeDef*>( + ::diplomacy::tensorflow::tfprof::CodeDef::internal_default_instance()); + ::diplomacy::tensorflow::_CallTraceback_default_instance_._instance.get_mutable()->graph_traceback_ = const_cast< ::diplomacy::tensorflow::tfprof::OpLogProto*>( + ::diplomacy::tensorflow::tfprof::OpLogProto::internal_default_instance()); +} +void CallTraceback::clear_origin_stack() { + if (GetArenaNoVirtual() == NULL && origin_stack_ != NULL) { + delete origin_stack_; + } + origin_stack_ = NULL; +} +void CallTraceback::clear_graph_traceback() { + if (GetArenaNoVirtual() == NULL && graph_traceback_ != NULL) { + delete graph_traceback_; + } + graph_traceback_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CallTraceback::kCallTypeFieldNumber; +const int CallTraceback::kCallKeyFieldNumber; +const int CallTraceback::kOriginStackFieldNumber; +const int CallTraceback::kOriginIdToStringFieldNumber; +const int CallTraceback::kGraphTracebackFieldNumber; +const int CallTraceback::kGraphVersionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CallTraceback::CallTraceback() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_CallTraceback.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.CallTraceback) +} +CallTraceback::CallTraceback(const CallTraceback& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + origin_id_to_string_.MergeFrom(from.origin_id_to_string_); + call_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.call_key().size() > 0) { + call_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.call_key_); + } + if (from.has_origin_stack()) { + origin_stack_ = new ::diplomacy::tensorflow::tfprof::CodeDef(*from.origin_stack_); + } else { + origin_stack_ = NULL; + } + if (from.has_graph_traceback()) { + graph_traceback_ = new ::diplomacy::tensorflow::tfprof::OpLogProto(*from.graph_traceback_); + } else { + graph_traceback_ = NULL; + } + ::memcpy(&graph_version_, &from.graph_version_, + static_cast(reinterpret_cast(&call_type_) - + reinterpret_cast(&graph_version_)) + sizeof(call_type_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.CallTraceback) +} + +void CallTraceback::SharedCtor() { + call_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&origin_stack_, 0, static_cast( + reinterpret_cast(&call_type_) - + reinterpret_cast(&origin_stack_)) + sizeof(call_type_)); +} + +CallTraceback::~CallTraceback() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.CallTraceback) + SharedDtor(); +} + +void CallTraceback::SharedDtor() { + call_key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete origin_stack_; + if (this != internal_default_instance()) delete graph_traceback_; +} + +void CallTraceback::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CallTraceback::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CallTraceback& CallTraceback::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::scc_info_CallTraceback.base); + return *internal_default_instance(); +} + + +void CallTraceback::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.CallTraceback) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + origin_id_to_string_.Clear(); + call_key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && origin_stack_ != NULL) { + delete origin_stack_; + } + origin_stack_ = NULL; + if (GetArenaNoVirtual() == NULL && graph_traceback_ != NULL) { + delete graph_traceback_; + } + graph_traceback_ = NULL; + ::memset(&graph_version_, 0, static_cast( + reinterpret_cast(&call_type_) - + reinterpret_cast(&graph_version_)) + sizeof(call_type_)); + _internal_metadata_.Clear(); +} + +bool CallTraceback::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.CallTraceback) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.CallTraceback.CallType call_type = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_call_type(static_cast< ::diplomacy::tensorflow::CallTraceback_CallType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string call_key = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_call_key())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->call_key().data(), static_cast(this->call_key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.CallTraceback.call_key")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tfprof.CodeDef origin_stack = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_origin_stack())); + } else { + goto handle_unusual; + } + break; + } + + // map origin_id_to_string = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + CallTraceback_OriginIdToStringEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + CallTraceback_OriginIdToStringEntry_DoNotUse, + ::google::protobuf::int64, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::google::protobuf::Map< ::google::protobuf::int64, ::std::string > > parser(&origin_id_to_string_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.value().data(), static_cast(parser.value().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry.value")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.tfprof.OpLogProto graph_traceback = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_graph_traceback())); + } else { + goto handle_unusual; + } + break; + } + + // int64 graph_version = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &graph_version_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.CallTraceback) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.CallTraceback) + return false; +#undef DO_ +} + +void CallTraceback::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.CallTraceback) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.CallTraceback.CallType call_type = 1; + if (this->call_type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->call_type(), output); + } + + // string call_key = 2; + if (this->call_key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->call_key().data(), static_cast(this->call_key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CallTraceback.call_key"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->call_key(), output); + } + + // .diplomacy.tensorflow.tfprof.CodeDef origin_stack = 3; + if (this->has_origin_stack()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_origin_stack(), output); + } + + // map origin_id_to_string = 4; + if (!this->origin_id_to_string().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::int64, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->origin_id_to_string().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->origin_id_to_string().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::const_iterator + it = this->origin_id_to_string().begin(); + it != this->origin_id_to_string().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(origin_id_to_string_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + Utf8Check::Check(items[static_cast(i)].second); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::const_iterator + it = this->origin_id_to_string().begin(); + it != this->origin_id_to_string().end(); ++it) { + entry.reset(origin_id_to_string_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + Utf8Check::Check(&*it); + } + } + } + + // .diplomacy.tensorflow.tfprof.OpLogProto graph_traceback = 5; + if (this->has_graph_traceback()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_graph_traceback(), output); + } + + // int64 graph_version = 6; + if (this->graph_version() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->graph_version(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.CallTraceback) +} + +::google::protobuf::uint8* CallTraceback::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.CallTraceback) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.CallTraceback.CallType call_type = 1; + if (this->call_type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->call_type(), target); + } + + // string call_key = 2; + if (this->call_key().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->call_key().data(), static_cast(this->call_key().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CallTraceback.call_key"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->call_key(), target); + } + + // .diplomacy.tensorflow.tfprof.CodeDef origin_stack = 3; + if (this->has_origin_stack()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_origin_stack(), deterministic, target); + } + + // map origin_id_to_string = 4; + if (!this->origin_id_to_string().empty()) { + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::const_pointer + ConstPtr; + typedef ::google::protobuf::internal::SortItem< ::google::protobuf::int64, ConstPtr > SortItem; + typedef ::google::protobuf::internal::CompareByFirstField Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry.value"); + } + }; + + if (deterministic && + this->origin_id_to_string().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->origin_id_to_string().size()]); + typedef ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::const_iterator + it = this->origin_id_to_string().begin(); + it != this->origin_id_to_string().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(origin_id_to_string_.NewEntryWrapper( + items[static_cast(i)].second->first, items[static_cast(i)].second->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + Utf8Check::Check(items[static_cast(i)].second); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::const_iterator + it = this->origin_id_to_string().begin(); + it != this->origin_id_to_string().end(); ++it) { + entry.reset(origin_id_to_string_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + Utf8Check::Check(&*it); + } + } + } + + // .diplomacy.tensorflow.tfprof.OpLogProto graph_traceback = 5; + if (this->has_graph_traceback()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_graph_traceback(), deterministic, target); + } + + // int64 graph_version = 6; + if (this->graph_version() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->graph_version(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.CallTraceback) + return target; +} + +size_t CallTraceback::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.CallTraceback) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map origin_id_to_string = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->origin_id_to_string_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::google::protobuf::int64, ::std::string >::const_iterator + it = this->origin_id_to_string().begin(); + it != this->origin_id_to_string().end(); ++it) { + entry.reset(origin_id_to_string_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + } + + // string call_key = 2; + if (this->call_key().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->call_key()); + } + + // .diplomacy.tensorflow.tfprof.CodeDef origin_stack = 3; + if (this->has_origin_stack()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *origin_stack_); + } + + // .diplomacy.tensorflow.tfprof.OpLogProto graph_traceback = 5; + if (this->has_graph_traceback()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *graph_traceback_); + } + + // int64 graph_version = 6; + if (this->graph_version() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->graph_version()); + } + + // .diplomacy.tensorflow.CallTraceback.CallType call_type = 1; + if (this->call_type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->call_type()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CallTraceback::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.CallTraceback) + GOOGLE_DCHECK_NE(&from, this); + const CallTraceback* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.CallTraceback) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.CallTraceback) + MergeFrom(*source); + } +} + +void CallTraceback::MergeFrom(const CallTraceback& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.CallTraceback) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + origin_id_to_string_.MergeFrom(from.origin_id_to_string_); + if (from.call_key().size() > 0) { + + call_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.call_key_); + } + if (from.has_origin_stack()) { + mutable_origin_stack()->::diplomacy::tensorflow::tfprof::CodeDef::MergeFrom(from.origin_stack()); + } + if (from.has_graph_traceback()) { + mutable_graph_traceback()->::diplomacy::tensorflow::tfprof::OpLogProto::MergeFrom(from.graph_traceback()); + } + if (from.graph_version() != 0) { + set_graph_version(from.graph_version()); + } + if (from.call_type() != 0) { + set_call_type(from.call_type()); + } +} + +void CallTraceback::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.CallTraceback) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CallTraceback::CopyFrom(const CallTraceback& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.CallTraceback) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CallTraceback::IsInitialized() const { + return true; +} + +void CallTraceback::Swap(CallTraceback* other) { + if (other == this) return; + InternalSwap(other); +} +void CallTraceback::InternalSwap(CallTraceback* other) { + using std::swap; + origin_id_to_string_.Swap(&other->origin_id_to_string_); + call_key_.Swap(&other->call_key_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(origin_stack_, other->origin_stack_); + swap(graph_traceback_, other->graph_traceback_); + swap(graph_version_, other->graph_version_); + swap(call_type_, other->call_type_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CallTraceback::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::EventReply_DebugOpStateChange* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::EventReply_DebugOpStateChange >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::EventReply_DebugOpStateChange >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::EventReply* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::EventReply >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::EventReply >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::CallTraceback* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::CallTraceback >(Arena* arena) { + return Arena::CreateInternal< ::diplomacy::tensorflow::CallTraceback >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.pb.h new file mode 100644 index 0000000..1637f68 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.pb.h @@ -0,0 +1,1101 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/debug/debug_service.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include +#include "diplomacy_tensorflow/core/framework/tensor.pb.h" +#include "diplomacy_tensorflow/core/profiler/tfprof_log.pb.h" +#include "diplomacy_tensorflow/core/protobuf/debug.pb.h" +#include "diplomacy_tensorflow/core/util/event.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto +namespace diplomacy { +namespace tensorflow { +class CallTraceback; +class CallTracebackDefaultTypeInternal; +extern CallTracebackDefaultTypeInternal _CallTraceback_default_instance_; +class CallTraceback_OriginIdToStringEntry_DoNotUse; +class CallTraceback_OriginIdToStringEntry_DoNotUseDefaultTypeInternal; +extern CallTraceback_OriginIdToStringEntry_DoNotUseDefaultTypeInternal _CallTraceback_OriginIdToStringEntry_DoNotUse_default_instance_; +class EventReply; +class EventReplyDefaultTypeInternal; +extern EventReplyDefaultTypeInternal _EventReply_default_instance_; +class EventReply_DebugOpStateChange; +class EventReply_DebugOpStateChangeDefaultTypeInternal; +extern EventReply_DebugOpStateChangeDefaultTypeInternal _EventReply_DebugOpStateChange_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::CallTraceback* Arena::CreateMaybeMessage<::diplomacy::tensorflow::CallTraceback>(Arena*); +template<> ::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::CallTraceback_OriginIdToStringEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::EventReply* Arena::CreateMaybeMessage<::diplomacy::tensorflow::EventReply>(Arena*); +template<> ::diplomacy::tensorflow::EventReply_DebugOpStateChange* Arena::CreateMaybeMessage<::diplomacy::tensorflow::EventReply_DebugOpStateChange>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +enum EventReply_DebugOpStateChange_State { + EventReply_DebugOpStateChange_State_STATE_UNSPECIFIED = 0, + EventReply_DebugOpStateChange_State_DISABLED = 1, + EventReply_DebugOpStateChange_State_READ_ONLY = 2, + EventReply_DebugOpStateChange_State_READ_WRITE = 3, + EventReply_DebugOpStateChange_State_EventReply_DebugOpStateChange_State_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + EventReply_DebugOpStateChange_State_EventReply_DebugOpStateChange_State_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool EventReply_DebugOpStateChange_State_IsValid(int value); +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange_State_State_MIN = EventReply_DebugOpStateChange_State_STATE_UNSPECIFIED; +const EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange_State_State_MAX = EventReply_DebugOpStateChange_State_READ_WRITE; +const int EventReply_DebugOpStateChange_State_State_ARRAYSIZE = EventReply_DebugOpStateChange_State_State_MAX + 1; + +const ::google::protobuf::EnumDescriptor* EventReply_DebugOpStateChange_State_descriptor(); +inline const ::std::string& EventReply_DebugOpStateChange_State_Name(EventReply_DebugOpStateChange_State value) { + return ::google::protobuf::internal::NameOfEnum( + EventReply_DebugOpStateChange_State_descriptor(), value); +} +inline bool EventReply_DebugOpStateChange_State_Parse( + const ::std::string& name, EventReply_DebugOpStateChange_State* value) { + return ::google::protobuf::internal::ParseNamedEnum( + EventReply_DebugOpStateChange_State_descriptor(), name, value); +} +enum CallTraceback_CallType { + CallTraceback_CallType_UNSPECIFIED = 0, + CallTraceback_CallType_GRAPH_EXECUTION = 1, + CallTraceback_CallType_EAGER_EXECUTION = 2, + CallTraceback_CallType_CallTraceback_CallType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + CallTraceback_CallType_CallTraceback_CallType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool CallTraceback_CallType_IsValid(int value); +const CallTraceback_CallType CallTraceback_CallType_CallType_MIN = CallTraceback_CallType_UNSPECIFIED; +const CallTraceback_CallType CallTraceback_CallType_CallType_MAX = CallTraceback_CallType_EAGER_EXECUTION; +const int CallTraceback_CallType_CallType_ARRAYSIZE = CallTraceback_CallType_CallType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* CallTraceback_CallType_descriptor(); +inline const ::std::string& CallTraceback_CallType_Name(CallTraceback_CallType value) { + return ::google::protobuf::internal::NameOfEnum( + CallTraceback_CallType_descriptor(), value); +} +inline bool CallTraceback_CallType_Parse( + const ::std::string& name, CallTraceback_CallType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + CallTraceback_CallType_descriptor(), name, value); +} +// =================================================================== + +class EventReply_DebugOpStateChange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.EventReply.DebugOpStateChange) */ { + public: + EventReply_DebugOpStateChange(); + virtual ~EventReply_DebugOpStateChange(); + + EventReply_DebugOpStateChange(const EventReply_DebugOpStateChange& from); + + inline EventReply_DebugOpStateChange& operator=(const EventReply_DebugOpStateChange& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + EventReply_DebugOpStateChange(EventReply_DebugOpStateChange&& from) noexcept + : EventReply_DebugOpStateChange() { + *this = ::std::move(from); + } + + inline EventReply_DebugOpStateChange& operator=(EventReply_DebugOpStateChange&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const EventReply_DebugOpStateChange& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const EventReply_DebugOpStateChange* internal_default_instance() { + return reinterpret_cast( + &_EventReply_DebugOpStateChange_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(EventReply_DebugOpStateChange* other); + friend void swap(EventReply_DebugOpStateChange& a, EventReply_DebugOpStateChange& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline EventReply_DebugOpStateChange* New() const final { + return CreateMaybeMessage(NULL); + } + + EventReply_DebugOpStateChange* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const EventReply_DebugOpStateChange& from); + void MergeFrom(const EventReply_DebugOpStateChange& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EventReply_DebugOpStateChange* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef EventReply_DebugOpStateChange_State State; + static const State STATE_UNSPECIFIED = + EventReply_DebugOpStateChange_State_STATE_UNSPECIFIED; + static const State DISABLED = + EventReply_DebugOpStateChange_State_DISABLED; + static const State READ_ONLY = + EventReply_DebugOpStateChange_State_READ_ONLY; + static const State READ_WRITE = + EventReply_DebugOpStateChange_State_READ_WRITE; + static inline bool State_IsValid(int value) { + return EventReply_DebugOpStateChange_State_IsValid(value); + } + static const State State_MIN = + EventReply_DebugOpStateChange_State_State_MIN; + static const State State_MAX = + EventReply_DebugOpStateChange_State_State_MAX; + static const int State_ARRAYSIZE = + EventReply_DebugOpStateChange_State_State_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + State_descriptor() { + return EventReply_DebugOpStateChange_State_descriptor(); + } + static inline const ::std::string& State_Name(State value) { + return EventReply_DebugOpStateChange_State_Name(value); + } + static inline bool State_Parse(const ::std::string& name, + State* value) { + return EventReply_DebugOpStateChange_State_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // string node_name = 2; + void clear_node_name(); + static const int kNodeNameFieldNumber = 2; + const ::std::string& node_name() const; + void set_node_name(const ::std::string& value); + #if LANG_CXX11 + void set_node_name(::std::string&& value); + #endif + void set_node_name(const char* value); + void set_node_name(const char* value, size_t size); + ::std::string* mutable_node_name(); + ::std::string* release_node_name(); + void set_allocated_node_name(::std::string* node_name); + + // string debug_op = 4; + void clear_debug_op(); + static const int kDebugOpFieldNumber = 4; + const ::std::string& debug_op() const; + void set_debug_op(const ::std::string& value); + #if LANG_CXX11 + void set_debug_op(::std::string&& value); + #endif + void set_debug_op(const char* value); + void set_debug_op(const char* value, size_t size); + ::std::string* mutable_debug_op(); + ::std::string* release_debug_op(); + void set_allocated_debug_op(::std::string* debug_op); + + // .diplomacy.tensorflow.EventReply.DebugOpStateChange.State state = 1; + void clear_state(); + static const int kStateFieldNumber = 1; + ::diplomacy::tensorflow::EventReply_DebugOpStateChange_State state() const; + void set_state(::diplomacy::tensorflow::EventReply_DebugOpStateChange_State value); + + // int32 output_slot = 3; + void clear_output_slot(); + static const int kOutputSlotFieldNumber = 3; + ::google::protobuf::int32 output_slot() const; + void set_output_slot(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EventReply.DebugOpStateChange) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr node_name_; + ::google::protobuf::internal::ArenaStringPtr debug_op_; + int state_; + ::google::protobuf::int32 output_slot_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class EventReply : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.EventReply) */ { + public: + EventReply(); + virtual ~EventReply(); + + EventReply(const EventReply& from); + + inline EventReply& operator=(const EventReply& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + EventReply(EventReply&& from) noexcept + : EventReply() { + *this = ::std::move(from); + } + + inline EventReply& operator=(EventReply&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const EventReply& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const EventReply* internal_default_instance() { + return reinterpret_cast( + &_EventReply_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(EventReply* other); + friend void swap(EventReply& a, EventReply& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline EventReply* New() const final { + return CreateMaybeMessage(NULL); + } + + EventReply* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const EventReply& from); + void MergeFrom(const EventReply& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EventReply* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef EventReply_DebugOpStateChange DebugOpStateChange; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.EventReply.DebugOpStateChange debug_op_state_changes = 1; + int debug_op_state_changes_size() const; + void clear_debug_op_state_changes(); + static const int kDebugOpStateChangesFieldNumber = 1; + ::diplomacy::tensorflow::EventReply_DebugOpStateChange* mutable_debug_op_state_changes(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EventReply_DebugOpStateChange >* + mutable_debug_op_state_changes(); + const ::diplomacy::tensorflow::EventReply_DebugOpStateChange& debug_op_state_changes(int index) const; + ::diplomacy::tensorflow::EventReply_DebugOpStateChange* add_debug_op_state_changes(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EventReply_DebugOpStateChange >& + debug_op_state_changes() const; + + // .diplomacy.tensorflow.TensorProto tensor = 2; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorProto& _internal_tensor() const; + public: + const ::diplomacy::tensorflow::TensorProto& tensor() const; + ::diplomacy::tensorflow::TensorProto* release_tensor(); + ::diplomacy::tensorflow::TensorProto* mutable_tensor(); + void set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EventReply) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EventReply_DebugOpStateChange > debug_op_state_changes_; + ::diplomacy::tensorflow::TensorProto* tensor_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CallTraceback_OriginIdToStringEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + CallTraceback_OriginIdToStringEntry_DoNotUse(); + CallTraceback_OriginIdToStringEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const CallTraceback_OriginIdToStringEntry_DoNotUse& other); + static const CallTraceback_OriginIdToStringEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_CallTraceback_OriginIdToStringEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class CallTraceback : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.CallTraceback) */ { + public: + CallTraceback(); + virtual ~CallTraceback(); + + CallTraceback(const CallTraceback& from); + + inline CallTraceback& operator=(const CallTraceback& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CallTraceback(CallTraceback&& from) noexcept + : CallTraceback() { + *this = ::std::move(from); + } + + inline CallTraceback& operator=(CallTraceback&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const CallTraceback& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CallTraceback* internal_default_instance() { + return reinterpret_cast( + &_CallTraceback_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void Swap(CallTraceback* other); + friend void swap(CallTraceback& a, CallTraceback& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CallTraceback* New() const final { + return CreateMaybeMessage(NULL); + } + + CallTraceback* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CallTraceback& from); + void MergeFrom(const CallTraceback& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CallTraceback* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + typedef CallTraceback_CallType CallType; + static const CallType UNSPECIFIED = + CallTraceback_CallType_UNSPECIFIED; + static const CallType GRAPH_EXECUTION = + CallTraceback_CallType_GRAPH_EXECUTION; + static const CallType EAGER_EXECUTION = + CallTraceback_CallType_EAGER_EXECUTION; + static inline bool CallType_IsValid(int value) { + return CallTraceback_CallType_IsValid(value); + } + static const CallType CallType_MIN = + CallTraceback_CallType_CallType_MIN; + static const CallType CallType_MAX = + CallTraceback_CallType_CallType_MAX; + static const int CallType_ARRAYSIZE = + CallTraceback_CallType_CallType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + CallType_descriptor() { + return CallTraceback_CallType_descriptor(); + } + static inline const ::std::string& CallType_Name(CallType value) { + return CallTraceback_CallType_Name(value); + } + static inline bool CallType_Parse(const ::std::string& name, + CallType* value) { + return CallTraceback_CallType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // map origin_id_to_string = 4; + int origin_id_to_string_size() const; + void clear_origin_id_to_string(); + static const int kOriginIdToStringFieldNumber = 4; + const ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >& + origin_id_to_string() const; + ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >* + mutable_origin_id_to_string(); + + // string call_key = 2; + void clear_call_key(); + static const int kCallKeyFieldNumber = 2; + const ::std::string& call_key() const; + void set_call_key(const ::std::string& value); + #if LANG_CXX11 + void set_call_key(::std::string&& value); + #endif + void set_call_key(const char* value); + void set_call_key(const char* value, size_t size); + ::std::string* mutable_call_key(); + ::std::string* release_call_key(); + void set_allocated_call_key(::std::string* call_key); + + // .diplomacy.tensorflow.tfprof.CodeDef origin_stack = 3; + bool has_origin_stack() const; + void clear_origin_stack(); + static const int kOriginStackFieldNumber = 3; + private: + const ::diplomacy::tensorflow::tfprof::CodeDef& _internal_origin_stack() const; + public: + const ::diplomacy::tensorflow::tfprof::CodeDef& origin_stack() const; + ::diplomacy::tensorflow::tfprof::CodeDef* release_origin_stack(); + ::diplomacy::tensorflow::tfprof::CodeDef* mutable_origin_stack(); + void set_allocated_origin_stack(::diplomacy::tensorflow::tfprof::CodeDef* origin_stack); + + // .diplomacy.tensorflow.tfprof.OpLogProto graph_traceback = 5; + bool has_graph_traceback() const; + void clear_graph_traceback(); + static const int kGraphTracebackFieldNumber = 5; + private: + const ::diplomacy::tensorflow::tfprof::OpLogProto& _internal_graph_traceback() const; + public: + const ::diplomacy::tensorflow::tfprof::OpLogProto& graph_traceback() const; + ::diplomacy::tensorflow::tfprof::OpLogProto* release_graph_traceback(); + ::diplomacy::tensorflow::tfprof::OpLogProto* mutable_graph_traceback(); + void set_allocated_graph_traceback(::diplomacy::tensorflow::tfprof::OpLogProto* graph_traceback); + + // int64 graph_version = 6; + void clear_graph_version(); + static const int kGraphVersionFieldNumber = 6; + ::google::protobuf::int64 graph_version() const; + void set_graph_version(::google::protobuf::int64 value); + + // .diplomacy.tensorflow.CallTraceback.CallType call_type = 1; + void clear_call_type(); + static const int kCallTypeFieldNumber = 1; + ::diplomacy::tensorflow::CallTraceback_CallType call_type() const; + void set_call_type(::diplomacy::tensorflow::CallTraceback_CallType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CallTraceback) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::MapField< + CallTraceback_OriginIdToStringEntry_DoNotUse, + ::google::protobuf::int64, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 > origin_id_to_string_; + ::google::protobuf::internal::ArenaStringPtr call_key_; + ::diplomacy::tensorflow::tfprof::CodeDef* origin_stack_; + ::diplomacy::tensorflow::tfprof::OpLogProto* graph_traceback_; + ::google::protobuf::int64 graph_version_; + int call_type_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// EventReply_DebugOpStateChange + +// .diplomacy.tensorflow.EventReply.DebugOpStateChange.State state = 1; +inline void EventReply_DebugOpStateChange::clear_state() { + state_ = 0; +} +inline ::diplomacy::tensorflow::EventReply_DebugOpStateChange_State EventReply_DebugOpStateChange::state() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EventReply.DebugOpStateChange.state) + return static_cast< ::diplomacy::tensorflow::EventReply_DebugOpStateChange_State >(state_); +} +inline void EventReply_DebugOpStateChange::set_state(::diplomacy::tensorflow::EventReply_DebugOpStateChange_State value) { + + state_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EventReply.DebugOpStateChange.state) +} + +// string node_name = 2; +inline void EventReply_DebugOpStateChange::clear_node_name() { + node_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EventReply_DebugOpStateChange::node_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) + return node_name_.GetNoArena(); +} +inline void EventReply_DebugOpStateChange::set_node_name(const ::std::string& value) { + + node_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) +} +#if LANG_CXX11 +inline void EventReply_DebugOpStateChange::set_node_name(::std::string&& value) { + + node_name_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) +} +#endif +inline void EventReply_DebugOpStateChange::set_node_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + node_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) +} +inline void EventReply_DebugOpStateChange::set_node_name(const char* value, size_t size) { + + node_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) +} +inline ::std::string* EventReply_DebugOpStateChange::mutable_node_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) + return node_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EventReply_DebugOpStateChange::release_node_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) + + return node_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EventReply_DebugOpStateChange::set_allocated_node_name(::std::string* node_name) { + if (node_name != NULL) { + + } else { + + } + node_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), node_name); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name) +} + +// int32 output_slot = 3; +inline void EventReply_DebugOpStateChange::clear_output_slot() { + output_slot_ = 0; +} +inline ::google::protobuf::int32 EventReply_DebugOpStateChange::output_slot() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EventReply.DebugOpStateChange.output_slot) + return output_slot_; +} +inline void EventReply_DebugOpStateChange::set_output_slot(::google::protobuf::int32 value) { + + output_slot_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EventReply.DebugOpStateChange.output_slot) +} + +// string debug_op = 4; +inline void EventReply_DebugOpStateChange::clear_debug_op() { + debug_op_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& EventReply_DebugOpStateChange::debug_op() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) + return debug_op_.GetNoArena(); +} +inline void EventReply_DebugOpStateChange::set_debug_op(const ::std::string& value) { + + debug_op_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) +} +#if LANG_CXX11 +inline void EventReply_DebugOpStateChange::set_debug_op(::std::string&& value) { + + debug_op_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) +} +#endif +inline void EventReply_DebugOpStateChange::set_debug_op(const char* value) { + GOOGLE_DCHECK(value != NULL); + + debug_op_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) +} +inline void EventReply_DebugOpStateChange::set_debug_op(const char* value, size_t size) { + + debug_op_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) +} +inline ::std::string* EventReply_DebugOpStateChange::mutable_debug_op() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) + return debug_op_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EventReply_DebugOpStateChange::release_debug_op() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) + + return debug_op_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EventReply_DebugOpStateChange::set_allocated_debug_op(::std::string* debug_op) { + if (debug_op != NULL) { + + } else { + + } + debug_op_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), debug_op); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op) +} + +// ------------------------------------------------------------------- + +// EventReply + +// repeated .diplomacy.tensorflow.EventReply.DebugOpStateChange debug_op_state_changes = 1; +inline int EventReply::debug_op_state_changes_size() const { + return debug_op_state_changes_.size(); +} +inline void EventReply::clear_debug_op_state_changes() { + debug_op_state_changes_.Clear(); +} +inline ::diplomacy::tensorflow::EventReply_DebugOpStateChange* EventReply::mutable_debug_op_state_changes(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EventReply.debug_op_state_changes) + return debug_op_state_changes_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EventReply_DebugOpStateChange >* +EventReply::mutable_debug_op_state_changes() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.EventReply.debug_op_state_changes) + return &debug_op_state_changes_; +} +inline const ::diplomacy::tensorflow::EventReply_DebugOpStateChange& EventReply::debug_op_state_changes(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EventReply.debug_op_state_changes) + return debug_op_state_changes_.Get(index); +} +inline ::diplomacy::tensorflow::EventReply_DebugOpStateChange* EventReply::add_debug_op_state_changes() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.EventReply.debug_op_state_changes) + return debug_op_state_changes_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::EventReply_DebugOpStateChange >& +EventReply::debug_op_state_changes() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.EventReply.debug_op_state_changes) + return debug_op_state_changes_; +} + +// .diplomacy.tensorflow.TensorProto tensor = 2; +inline bool EventReply::has_tensor() const { + return this != internal_default_instance() && tensor_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorProto& EventReply::_internal_tensor() const { + return *tensor_; +} +inline const ::diplomacy::tensorflow::TensorProto& EventReply::tensor() const { + const ::diplomacy::tensorflow::TensorProto* p = tensor_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.EventReply.tensor) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorProto* EventReply::release_tensor() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.EventReply.tensor) + + ::diplomacy::tensorflow::TensorProto* temp = tensor_; + tensor_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorProto* EventReply::mutable_tensor() { + + if (tensor_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorProto>(GetArenaNoVirtual()); + tensor_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.EventReply.tensor) + return tensor_; +} +inline void EventReply::set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_); + } + if (tensor) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor)->GetArena(); + if (message_arena != submessage_arena) { + tensor = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor, submessage_arena); + } + + } else { + + } + tensor_ = tensor; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.EventReply.tensor) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// CallTraceback + +// .diplomacy.tensorflow.CallTraceback.CallType call_type = 1; +inline void CallTraceback::clear_call_type() { + call_type_ = 0; +} +inline ::diplomacy::tensorflow::CallTraceback_CallType CallTraceback::call_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CallTraceback.call_type) + return static_cast< ::diplomacy::tensorflow::CallTraceback_CallType >(call_type_); +} +inline void CallTraceback::set_call_type(::diplomacy::tensorflow::CallTraceback_CallType value) { + + call_type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CallTraceback.call_type) +} + +// string call_key = 2; +inline void CallTraceback::clear_call_key() { + call_key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& CallTraceback::call_key() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CallTraceback.call_key) + return call_key_.GetNoArena(); +} +inline void CallTraceback::set_call_key(const ::std::string& value) { + + call_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CallTraceback.call_key) +} +#if LANG_CXX11 +inline void CallTraceback::set_call_key(::std::string&& value) { + + call_key_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.CallTraceback.call_key) +} +#endif +inline void CallTraceback::set_call_key(const char* value) { + GOOGLE_DCHECK(value != NULL); + + call_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.CallTraceback.call_key) +} +inline void CallTraceback::set_call_key(const char* value, size_t size) { + + call_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.CallTraceback.call_key) +} +inline ::std::string* CallTraceback::mutable_call_key() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CallTraceback.call_key) + return call_key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* CallTraceback::release_call_key() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.CallTraceback.call_key) + + return call_key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void CallTraceback::set_allocated_call_key(::std::string* call_key) { + if (call_key != NULL) { + + } else { + + } + call_key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), call_key); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.CallTraceback.call_key) +} + +// .diplomacy.tensorflow.tfprof.CodeDef origin_stack = 3; +inline bool CallTraceback::has_origin_stack() const { + return this != internal_default_instance() && origin_stack_ != NULL; +} +inline const ::diplomacy::tensorflow::tfprof::CodeDef& CallTraceback::_internal_origin_stack() const { + return *origin_stack_; +} +inline const ::diplomacy::tensorflow::tfprof::CodeDef& CallTraceback::origin_stack() const { + const ::diplomacy::tensorflow::tfprof::CodeDef* p = origin_stack_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CallTraceback.origin_stack) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tfprof::_CodeDef_default_instance_); +} +inline ::diplomacy::tensorflow::tfprof::CodeDef* CallTraceback::release_origin_stack() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.CallTraceback.origin_stack) + + ::diplomacy::tensorflow::tfprof::CodeDef* temp = origin_stack_; + origin_stack_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tfprof::CodeDef* CallTraceback::mutable_origin_stack() { + + if (origin_stack_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tfprof::CodeDef>(GetArenaNoVirtual()); + origin_stack_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CallTraceback.origin_stack) + return origin_stack_; +} +inline void CallTraceback::set_allocated_origin_stack(::diplomacy::tensorflow::tfprof::CodeDef* origin_stack) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(origin_stack_); + } + if (origin_stack) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + origin_stack = ::google::protobuf::internal::GetOwnedMessage( + message_arena, origin_stack, submessage_arena); + } + + } else { + + } + origin_stack_ = origin_stack; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.CallTraceback.origin_stack) +} + +// map origin_id_to_string = 4; +inline int CallTraceback::origin_id_to_string_size() const { + return origin_id_to_string_.size(); +} +inline void CallTraceback::clear_origin_id_to_string() { + origin_id_to_string_.Clear(); +} +inline const ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >& +CallTraceback::origin_id_to_string() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.CallTraceback.origin_id_to_string) + return origin_id_to_string_.GetMap(); +} +inline ::google::protobuf::Map< ::google::protobuf::int64, ::std::string >* +CallTraceback::mutable_origin_id_to_string() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.CallTraceback.origin_id_to_string) + return origin_id_to_string_.MutableMap(); +} + +// .diplomacy.tensorflow.tfprof.OpLogProto graph_traceback = 5; +inline bool CallTraceback::has_graph_traceback() const { + return this != internal_default_instance() && graph_traceback_ != NULL; +} +inline const ::diplomacy::tensorflow::tfprof::OpLogProto& CallTraceback::_internal_graph_traceback() const { + return *graph_traceback_; +} +inline const ::diplomacy::tensorflow::tfprof::OpLogProto& CallTraceback::graph_traceback() const { + const ::diplomacy::tensorflow::tfprof::OpLogProto* p = graph_traceback_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CallTraceback.graph_traceback) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::tfprof::_OpLogProto_default_instance_); +} +inline ::diplomacy::tensorflow::tfprof::OpLogProto* CallTraceback::release_graph_traceback() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.CallTraceback.graph_traceback) + + ::diplomacy::tensorflow::tfprof::OpLogProto* temp = graph_traceback_; + graph_traceback_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::tfprof::OpLogProto* CallTraceback::mutable_graph_traceback() { + + if (graph_traceback_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::tfprof::OpLogProto>(GetArenaNoVirtual()); + graph_traceback_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CallTraceback.graph_traceback) + return graph_traceback_; +} +inline void CallTraceback::set_allocated_graph_traceback(::diplomacy::tensorflow::tfprof::OpLogProto* graph_traceback) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(graph_traceback_); + } + if (graph_traceback) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + graph_traceback = ::google::protobuf::internal::GetOwnedMessage( + message_arena, graph_traceback, submessage_arena); + } + + } else { + + } + graph_traceback_ = graph_traceback; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.CallTraceback.graph_traceback) +} + +// int64 graph_version = 6; +inline void CallTraceback::clear_graph_version() { + graph_version_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CallTraceback::graph_version() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CallTraceback.graph_version) + return graph_version_; +} +inline void CallTraceback::set_graph_version(::google::protobuf::int64 value) { + + graph_version_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CallTraceback.graph_version) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::EventReply_DebugOpStateChange_State> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::EventReply_DebugOpStateChange_State>() { + return ::diplomacy::tensorflow::EventReply_DebugOpStateChange_State_descriptor(); +} +template <> struct is_proto_enum< ::diplomacy::tensorflow::CallTraceback_CallType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::CallTraceback_CallType>() { + return ::diplomacy::tensorflow::CallTraceback_CallType_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebug_5fservice_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.proto new file mode 100644 index 0000000..c29e2da --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service.proto @@ -0,0 +1,100 @@ +/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +package diplomacy.tensorflow; + +import "diplomacy_tensorflow/core/framework/tensor.proto"; +import "diplomacy_tensorflow/core/profiler/tfprof_log.proto"; +import "diplomacy_tensorflow/core/protobuf/debug.proto"; +import "diplomacy_tensorflow/core/util/event.proto"; + +// Reply message from EventListener to the client, i.e., to the source of the +// Event protocol buffers, e.g., debug ops inserted by a debugged runtime to a +// TensorFlow graph being executed. +message EventReply { + message DebugOpStateChange { + enum State { + STATE_UNSPECIFIED = 0; + DISABLED = 1; + READ_ONLY = 2; + READ_WRITE = 3; + } + + State state = 1; + string node_name = 2; + int32 output_slot = 3; + string debug_op = 4; + } + + repeated DebugOpStateChange debug_op_state_changes = 1; + + // New tensor value to override the current tensor value with. + TensorProto tensor = 2; + // TODO(cais): Make use of this field to implement overriding of tensor value + // during debugging. +} + +// Data on the traceback of a debugged call, e.g., a Session.run() call, or the +// execution of an eager operation. +message CallTraceback { + enum CallType { + UNSPECIFIED = 0; + GRAPH_EXECUTION = 1; + EAGER_EXECUTION = 2; + } + + CallType call_type = 1; + + // A key for the call. For example, for graph execution, this is a key + // consisting of the names of the fed and fetched tensors. + string call_key = 2; + + // Traceback stack for the origin of the call event. + // For graph execution, this is the stack of the Session.run() call. + // For eager execution, this is the stack of the Python line that invokes + // the execution of the eager op. + tfprof.CodeDef origin_stack = 3; + + // Keeps track of the mapping from integer IDs in `origin_stack` to actual + // string values (e.g., file paths, function names). + map origin_id_to_string = 4; + + // Traceback for the graph (if any) involved in the call. + tfprof.OpLogProto graph_traceback = 5; + + // Version of the graph in `graph_traceback` (if any). + int64 graph_version = 6; +} + +// EventListener: Receives Event protos, e.g., from debugged TensorFlow +// runtime(s). +service EventListener { + // Client(s) can use this RPC method to send the EventListener Event protos. + // The Event protos can hold information such as: + // 1) intermediate tensors from a debugged graph being executed, which can + // be sent from DebugIdentity ops configured with grpc URLs. + // 2) GraphDefs of partition graphs, which can be sent from special debug + // ops that get executed immediately after the beginning of the graph + // execution. + rpc SendEvents(stream Event) returns (stream EventReply); + + // Send the tracebacks of a TensorFlow execution call. + rpc SendTracebacks(CallTraceback) returns (EventReply); + + // Send a collection of source code files being debugged. + rpc SendSourceFiles(DebuggedSourceFiles) returns (EventReply); +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service_pb2.py new file mode 100644 index 0000000..ccb5465 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debug_service_pb2.py @@ -0,0 +1,371 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/debug/debug_service.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from diplomacy_tensorflow.core.profiler import tfprof_log_pb2 as diplomacy__tensorflow_dot_core_dot_profiler_dot_tfprof__log__pb2 +from diplomacy_tensorflow.core.protobuf import debug_pb2 as diplomacy__tensorflow_dot_core_dot_protobuf_dot_debug__pb2 +from diplomacy_tensorflow.core.util import event_pb2 as diplomacy__tensorflow_dot_core_dot_util_dot_event__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/debug/debug_service.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n3diplomacy_tensorflow/core/debug/debug_service.proto\x12\x14\x64iplomacy.tensorflow\x1a\x30\x64iplomacy_tensorflow/core/framework/tensor.proto\x1a\x33\x64iplomacy_tensorflow/core/profiler/tfprof_log.proto\x1a.diplomacy_tensorflow/core/protobuf/debug.proto\x1a*diplomacy_tensorflow/core/util/event.proto\"\xfc\x02\n\nEventReply\x12S\n\x16\x64\x65\x62ug_op_state_changes\x18\x01 \x03(\x0b\x32\x33.diplomacy.tensorflow.EventReply.DebugOpStateChange\x12\x31\n\x06tensor\x18\x02 \x01(\x0b\x32!.diplomacy.tensorflow.TensorProto\x1a\xe5\x01\n\x12\x44\x65\x62ugOpStateChange\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.diplomacy.tensorflow.EventReply.DebugOpStateChange.State\x12\x11\n\tnode_name\x18\x02 \x01(\t\x12\x13\n\x0boutput_slot\x18\x03 \x01(\x05\x12\x10\n\x08\x64\x65\x62ug_op\x18\x04 \x01(\t\"K\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\r\n\tREAD_ONLY\x10\x02\x12\x0e\n\nREAD_WRITE\x10\x03\"\xcf\x03\n\rCallTraceback\x12?\n\tcall_type\x18\x01 \x01(\x0e\x32,.diplomacy.tensorflow.CallTraceback.CallType\x12\x10\n\x08\x63\x61ll_key\x18\x02 \x01(\t\x12:\n\x0corigin_stack\x18\x03 \x01(\x0b\x32$.diplomacy.tensorflow.tfprof.CodeDef\x12V\n\x13origin_id_to_string\x18\x04 \x03(\x0b\x32\x39.diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry\x12@\n\x0fgraph_traceback\x18\x05 \x01(\x0b\x32\'.diplomacy.tensorflow.tfprof.OpLogProto\x12\x15\n\rgraph_version\x18\x06 \x01(\x03\x1a\x37\n\x15OriginIdToStringEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x08\x43\x61llType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x13\n\x0fGRAPH_EXECUTION\x10\x01\x12\x13\n\x0f\x45\x41GER_EXECUTION\x10\x02\x32\x99\x02\n\rEventListener\x12O\n\nSendEvents\x12\x1b.diplomacy.tensorflow.Event\x1a .diplomacy.tensorflow.EventReply(\x01\x30\x01\x12W\n\x0eSendTracebacks\x12#.diplomacy.tensorflow.CallTraceback\x1a .diplomacy.tensorflow.EventReply\x12^\n\x0fSendSourceFiles\x12).diplomacy.tensorflow.DebuggedSourceFiles\x1a .diplomacy.tensorflow.EventReplyb\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_profiler_dot_tfprof__log__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_util_dot_event__pb2.DESCRIPTOR,]) + + + +_EVENTREPLY_DEBUGOPSTATECHANGE_STATE = _descriptor.EnumDescriptor( + name='State', + full_name='diplomacy.tensorflow.EventReply.DebugOpStateChange.State', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='STATE_UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DISABLED', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='READ_ONLY', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='READ_WRITE', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=578, + serialized_end=653, +) +_sym_db.RegisterEnumDescriptor(_EVENTREPLY_DEBUGOPSTATECHANGE_STATE) + +_CALLTRACEBACK_CALLTYPE = _descriptor.EnumDescriptor( + name='CallType', + full_name='diplomacy.tensorflow.CallTraceback.CallType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='GRAPH_EXECUTION', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EAGER_EXECUTION', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1050, + serialized_end=1119, +) +_sym_db.RegisterEnumDescriptor(_CALLTRACEBACK_CALLTYPE) + + +_EVENTREPLY_DEBUGOPSTATECHANGE = _descriptor.Descriptor( + name='DebugOpStateChange', + full_name='diplomacy.tensorflow.EventReply.DebugOpStateChange', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='diplomacy.tensorflow.EventReply.DebugOpStateChange.state', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_name', full_name='diplomacy.tensorflow.EventReply.DebugOpStateChange.node_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_slot', full_name='diplomacy.tensorflow.EventReply.DebugOpStateChange.output_slot', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='debug_op', full_name='diplomacy.tensorflow.EventReply.DebugOpStateChange.debug_op', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _EVENTREPLY_DEBUGOPSTATECHANGE_STATE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=424, + serialized_end=653, +) + +_EVENTREPLY = _descriptor.Descriptor( + name='EventReply', + full_name='diplomacy.tensorflow.EventReply', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='debug_op_state_changes', full_name='diplomacy.tensorflow.EventReply.debug_op_state_changes', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor', full_name='diplomacy.tensorflow.EventReply.tensor', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_EVENTREPLY_DEBUGOPSTATECHANGE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=273, + serialized_end=653, +) + + +_CALLTRACEBACK_ORIGINIDTOSTRINGENTRY = _descriptor.Descriptor( + name='OriginIdToStringEntry', + full_name='diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry.key', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=993, + serialized_end=1048, +) + +_CALLTRACEBACK = _descriptor.Descriptor( + name='CallTraceback', + full_name='diplomacy.tensorflow.CallTraceback', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='call_type', full_name='diplomacy.tensorflow.CallTraceback.call_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='call_key', full_name='diplomacy.tensorflow.CallTraceback.call_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='origin_stack', full_name='diplomacy.tensorflow.CallTraceback.origin_stack', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='origin_id_to_string', full_name='diplomacy.tensorflow.CallTraceback.origin_id_to_string', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph_traceback', full_name='diplomacy.tensorflow.CallTraceback.graph_traceback', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph_version', full_name='diplomacy.tensorflow.CallTraceback.graph_version', index=5, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_CALLTRACEBACK_ORIGINIDTOSTRINGENTRY, ], + enum_types=[ + _CALLTRACEBACK_CALLTYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=656, + serialized_end=1119, +) + +_EVENTREPLY_DEBUGOPSTATECHANGE.fields_by_name['state'].enum_type = _EVENTREPLY_DEBUGOPSTATECHANGE_STATE +_EVENTREPLY_DEBUGOPSTATECHANGE.containing_type = _EVENTREPLY +_EVENTREPLY_DEBUGOPSTATECHANGE_STATE.containing_type = _EVENTREPLY_DEBUGOPSTATECHANGE +_EVENTREPLY.fields_by_name['debug_op_state_changes'].message_type = _EVENTREPLY_DEBUGOPSTATECHANGE +_EVENTREPLY.fields_by_name['tensor'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2._TENSORPROTO +_CALLTRACEBACK_ORIGINIDTOSTRINGENTRY.containing_type = _CALLTRACEBACK +_CALLTRACEBACK.fields_by_name['call_type'].enum_type = _CALLTRACEBACK_CALLTYPE +_CALLTRACEBACK.fields_by_name['origin_stack'].message_type = diplomacy__tensorflow_dot_core_dot_profiler_dot_tfprof__log__pb2._CODEDEF +_CALLTRACEBACK.fields_by_name['origin_id_to_string'].message_type = _CALLTRACEBACK_ORIGINIDTOSTRINGENTRY +_CALLTRACEBACK.fields_by_name['graph_traceback'].message_type = diplomacy__tensorflow_dot_core_dot_profiler_dot_tfprof__log__pb2._OPLOGPROTO +_CALLTRACEBACK_CALLTYPE.containing_type = _CALLTRACEBACK +DESCRIPTOR.message_types_by_name['EventReply'] = _EVENTREPLY +DESCRIPTOR.message_types_by_name['CallTraceback'] = _CALLTRACEBACK +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +EventReply = _reflection.GeneratedProtocolMessageType('EventReply', (_message.Message,), dict( + + DebugOpStateChange = _reflection.GeneratedProtocolMessageType('DebugOpStateChange', (_message.Message,), dict( + DESCRIPTOR = _EVENTREPLY_DEBUGOPSTATECHANGE, + __module__ = 'diplomacy_tensorflow.core.debug.debug_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EventReply.DebugOpStateChange) + )) + , + DESCRIPTOR = _EVENTREPLY, + __module__ = 'diplomacy_tensorflow.core.debug.debug_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.EventReply) + )) +_sym_db.RegisterMessage(EventReply) +_sym_db.RegisterMessage(EventReply.DebugOpStateChange) + +CallTraceback = _reflection.GeneratedProtocolMessageType('CallTraceback', (_message.Message,), dict( + + OriginIdToStringEntry = _reflection.GeneratedProtocolMessageType('OriginIdToStringEntry', (_message.Message,), dict( + DESCRIPTOR = _CALLTRACEBACK_ORIGINIDTOSTRINGENTRY, + __module__ = 'diplomacy_tensorflow.core.debug.debug_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CallTraceback.OriginIdToStringEntry) + )) + , + DESCRIPTOR = _CALLTRACEBACK, + __module__ = 'diplomacy_tensorflow.core.debug.debug_service_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CallTraceback) + )) +_sym_db.RegisterMessage(CallTraceback) +_sym_db.RegisterMessage(CallTraceback.OriginIdToStringEntry) + + +_CALLTRACEBACK_ORIGINIDTOSTRINGENTRY._options = None + +_EVENTLISTENER = _descriptor.ServiceDescriptor( + name='EventListener', + full_name='diplomacy.tensorflow.EventListener', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=1122, + serialized_end=1403, + methods=[ + _descriptor.MethodDescriptor( + name='SendEvents', + full_name='diplomacy.tensorflow.EventListener.SendEvents', + index=0, + containing_service=None, + input_type=diplomacy__tensorflow_dot_core_dot_util_dot_event__pb2._EVENT, + output_type=_EVENTREPLY, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='SendTracebacks', + full_name='diplomacy.tensorflow.EventListener.SendTracebacks', + index=1, + containing_service=None, + input_type=_CALLTRACEBACK, + output_type=_EVENTREPLY, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='SendSourceFiles', + full_name='diplomacy.tensorflow.EventListener.SendSourceFiles', + index=2, + containing_service=None, + input_type=diplomacy__tensorflow_dot_core_dot_protobuf_dot_debug__pb2._DEBUGGEDSOURCEFILES, + output_type=_EVENTREPLY, + serialized_options=None, + ), +]) +_sym_db.RegisterServiceDescriptor(_EVENTLISTENER) + +DESCRIPTOR.services_by_name['EventListener'] = _EVENTLISTENER + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.pb.cc new file mode 100644 index 0000000..1a92a7f --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.pb.cc @@ -0,0 +1,497 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/debug/debugger_event_metadata.proto + +#include "diplomacy_tensorflow/core/debug/debugger_event_metadata.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace third_party { +namespace tensorflow { +namespace core { +namespace debug { +class DebuggerEventMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DebuggerEventMetadata_default_instance_; +} // namespace debug +} // namespace core +} // namespace tensorflow +} // namespace third_party +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto { +static void InitDefaultsDebuggerEventMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::third_party::tensorflow::core::debug::_DebuggerEventMetadata_default_instance_; + new (ptr) ::third_party::tensorflow::core::debug::DebuggerEventMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::third_party::tensorflow::core::debug::DebuggerEventMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DebuggerEventMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDebuggerEventMetadata}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_DebuggerEventMetadata.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::third_party::tensorflow::core::debug::DebuggerEventMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::third_party::tensorflow::core::debug::DebuggerEventMetadata, device_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::third_party::tensorflow::core::debug::DebuggerEventMetadata, output_slot_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::third_party::tensorflow::core::debug::DebuggerEventMetadata, num_chunks_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::third_party::tensorflow::core::debug::DebuggerEventMetadata, chunk_index_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::third_party::tensorflow::core::debug::DebuggerEventMetadata)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::third_party::tensorflow::core::debug::_DebuggerEventMetadata_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/debug/debugger_event_metadata.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n=diplomacy_tensorflow/core/debug/debugg" + "er_event_metadata.proto\022!third_party.ten" + "sorflow.core.debug\"e\n\025DebuggerEventMetad" + "ata\022\016\n\006device\030\001 \001(\t\022\023\n\013output_slot\030\002 \001(\005" + "\022\022\n\nnum_chunks\030\003 \001(\005\022\023\n\013chunk_index\030\004 \001(" + "\005b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 209); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/debug/debugger_event_metadata.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto +namespace third_party { +namespace tensorflow { +namespace core { +namespace debug { + +// =================================================================== + +void DebuggerEventMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DebuggerEventMetadata::kDeviceFieldNumber; +const int DebuggerEventMetadata::kOutputSlotFieldNumber; +const int DebuggerEventMetadata::kNumChunksFieldNumber; +const int DebuggerEventMetadata::kChunkIndexFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DebuggerEventMetadata::DebuggerEventMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto::scc_info_DebuggerEventMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:third_party.tensorflow.core.debug.DebuggerEventMetadata) +} +DebuggerEventMetadata::DebuggerEventMetadata(const DebuggerEventMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.device().size() > 0) { + device_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device_); + } + ::memcpy(&output_slot_, &from.output_slot_, + static_cast(reinterpret_cast(&chunk_index_) - + reinterpret_cast(&output_slot_)) + sizeof(chunk_index_)); + // @@protoc_insertion_point(copy_constructor:third_party.tensorflow.core.debug.DebuggerEventMetadata) +} + +void DebuggerEventMetadata::SharedCtor() { + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&output_slot_, 0, static_cast( + reinterpret_cast(&chunk_index_) - + reinterpret_cast(&output_slot_)) + sizeof(chunk_index_)); +} + +DebuggerEventMetadata::~DebuggerEventMetadata() { + // @@protoc_insertion_point(destructor:third_party.tensorflow.core.debug.DebuggerEventMetadata) + SharedDtor(); +} + +void DebuggerEventMetadata::SharedDtor() { + device_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void DebuggerEventMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DebuggerEventMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DebuggerEventMetadata& DebuggerEventMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto::scc_info_DebuggerEventMetadata.base); + return *internal_default_instance(); +} + + +void DebuggerEventMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + device_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&output_slot_, 0, static_cast( + reinterpret_cast(&chunk_index_) - + reinterpret_cast(&output_slot_)) + sizeof(chunk_index_)); + _internal_metadata_.Clear(); +} + +bool DebuggerEventMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string device = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "third_party.tensorflow.core.debug.DebuggerEventMetadata.device")); + } else { + goto handle_unusual; + } + break; + } + + // int32 output_slot = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &output_slot_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_chunks = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_chunks_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 chunk_index = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &chunk_index_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:third_party.tensorflow.core.debug.DebuggerEventMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:third_party.tensorflow.core.debug.DebuggerEventMetadata) + return false; +#undef DO_ +} + +void DebuggerEventMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string device = 1; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "third_party.tensorflow.core.debug.DebuggerEventMetadata.device"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->device(), output); + } + + // int32 output_slot = 2; + if (this->output_slot() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->output_slot(), output); + } + + // int32 num_chunks = 3; + if (this->num_chunks() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->num_chunks(), output); + } + + // int32 chunk_index = 4; + if (this->chunk_index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->chunk_index(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:third_party.tensorflow.core.debug.DebuggerEventMetadata) +} + +::google::protobuf::uint8* DebuggerEventMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string device = 1; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "third_party.tensorflow.core.debug.DebuggerEventMetadata.device"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->device(), target); + } + + // int32 output_slot = 2; + if (this->output_slot() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->output_slot(), target); + } + + // int32 num_chunks = 3; + if (this->num_chunks() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->num_chunks(), target); + } + + // int32 chunk_index = 4; + if (this->chunk_index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->chunk_index(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:third_party.tensorflow.core.debug.DebuggerEventMetadata) + return target; +} + +size_t DebuggerEventMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string device = 1; + if (this->device().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device()); + } + + // int32 output_slot = 2; + if (this->output_slot() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->output_slot()); + } + + // int32 num_chunks = 3; + if (this->num_chunks() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_chunks()); + } + + // int32 chunk_index = 4; + if (this->chunk_index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->chunk_index()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DebuggerEventMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + GOOGLE_DCHECK_NE(&from, this); + const DebuggerEventMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:third_party.tensorflow.core.debug.DebuggerEventMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:third_party.tensorflow.core.debug.DebuggerEventMetadata) + MergeFrom(*source); + } +} + +void DebuggerEventMetadata::MergeFrom(const DebuggerEventMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.device().size() > 0) { + + device_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device_); + } + if (from.output_slot() != 0) { + set_output_slot(from.output_slot()); + } + if (from.num_chunks() != 0) { + set_num_chunks(from.num_chunks()); + } + if (from.chunk_index() != 0) { + set_chunk_index(from.chunk_index()); + } +} + +void DebuggerEventMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DebuggerEventMetadata::CopyFrom(const DebuggerEventMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:third_party.tensorflow.core.debug.DebuggerEventMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DebuggerEventMetadata::IsInitialized() const { + return true; +} + +void DebuggerEventMetadata::Swap(DebuggerEventMetadata* other) { + if (other == this) return; + InternalSwap(other); +} +void DebuggerEventMetadata::InternalSwap(DebuggerEventMetadata* other) { + using std::swap; + device_.Swap(&other->device_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(output_slot_, other->output_slot_); + swap(num_chunks_, other->num_chunks_); + swap(chunk_index_, other->chunk_index_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DebuggerEventMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace debug +} // namespace core +} // namespace tensorflow +} // namespace third_party +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::third_party::tensorflow::core::debug::DebuggerEventMetadata* Arena::CreateMaybeMessage< ::third_party::tensorflow::core::debug::DebuggerEventMetadata >(Arena* arena) { + return Arena::CreateInternal< ::third_party::tensorflow::core::debug::DebuggerEventMetadata >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.pb.h new file mode 100644 index 0000000..e78a358 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.pb.h @@ -0,0 +1,320 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/debug/debugger_event_metadata.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto +namespace third_party { +namespace tensorflow { +namespace core { +namespace debug { +class DebuggerEventMetadata; +class DebuggerEventMetadataDefaultTypeInternal; +extern DebuggerEventMetadataDefaultTypeInternal _DebuggerEventMetadata_default_instance_; +} // namespace debug +} // namespace core +} // namespace tensorflow +} // namespace third_party +namespace google { +namespace protobuf { +template<> ::third_party::tensorflow::core::debug::DebuggerEventMetadata* Arena::CreateMaybeMessage<::third_party::tensorflow::core::debug::DebuggerEventMetadata>(Arena*); +} // namespace protobuf +} // namespace google +namespace third_party { +namespace tensorflow { +namespace core { +namespace debug { + +// =================================================================== + +class DebuggerEventMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:third_party.tensorflow.core.debug.DebuggerEventMetadata) */ { + public: + DebuggerEventMetadata(); + virtual ~DebuggerEventMetadata(); + + DebuggerEventMetadata(const DebuggerEventMetadata& from); + + inline DebuggerEventMetadata& operator=(const DebuggerEventMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DebuggerEventMetadata(DebuggerEventMetadata&& from) noexcept + : DebuggerEventMetadata() { + *this = ::std::move(from); + } + + inline DebuggerEventMetadata& operator=(DebuggerEventMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor(); + static const DebuggerEventMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DebuggerEventMetadata* internal_default_instance() { + return reinterpret_cast( + &_DebuggerEventMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(DebuggerEventMetadata* other); + friend void swap(DebuggerEventMetadata& a, DebuggerEventMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DebuggerEventMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + DebuggerEventMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DebuggerEventMetadata& from); + void MergeFrom(const DebuggerEventMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DebuggerEventMetadata* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string device = 1; + void clear_device(); + static const int kDeviceFieldNumber = 1; + const ::std::string& device() const; + void set_device(const ::std::string& value); + #if LANG_CXX11 + void set_device(::std::string&& value); + #endif + void set_device(const char* value); + void set_device(const char* value, size_t size); + ::std::string* mutable_device(); + ::std::string* release_device(); + void set_allocated_device(::std::string* device); + + // int32 output_slot = 2; + void clear_output_slot(); + static const int kOutputSlotFieldNumber = 2; + ::google::protobuf::int32 output_slot() const; + void set_output_slot(::google::protobuf::int32 value); + + // int32 num_chunks = 3; + void clear_num_chunks(); + static const int kNumChunksFieldNumber = 3; + ::google::protobuf::int32 num_chunks() const; + void set_num_chunks(::google::protobuf::int32 value); + + // int32 chunk_index = 4; + void clear_chunk_index(); + static const int kChunkIndexFieldNumber = 4; + ::google::protobuf::int32 chunk_index() const; + void set_chunk_index(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:third_party.tensorflow.core.debug.DebuggerEventMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::ArenaStringPtr device_; + ::google::protobuf::int32 output_slot_; + ::google::protobuf::int32 num_chunks_; + ::google::protobuf::int32 chunk_index_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// DebuggerEventMetadata + +// string device = 1; +inline void DebuggerEventMetadata::clear_device() { + device_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& DebuggerEventMetadata::device() const { + // @@protoc_insertion_point(field_get:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) + return device_.GetNoArena(); +} +inline void DebuggerEventMetadata::set_device(const ::std::string& value) { + + device_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) +} +#if LANG_CXX11 +inline void DebuggerEventMetadata::set_device(::std::string&& value) { + + device_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) +} +#endif +inline void DebuggerEventMetadata::set_device(const char* value) { + GOOGLE_DCHECK(value != NULL); + + device_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) +} +inline void DebuggerEventMetadata::set_device(const char* value, size_t size) { + + device_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) +} +inline ::std::string* DebuggerEventMetadata::mutable_device() { + + // @@protoc_insertion_point(field_mutable:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) + return device_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DebuggerEventMetadata::release_device() { + // @@protoc_insertion_point(field_release:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) + + return device_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DebuggerEventMetadata::set_allocated_device(::std::string* device) { + if (device != NULL) { + + } else { + + } + device_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device); + // @@protoc_insertion_point(field_set_allocated:third_party.tensorflow.core.debug.DebuggerEventMetadata.device) +} + +// int32 output_slot = 2; +inline void DebuggerEventMetadata::clear_output_slot() { + output_slot_ = 0; +} +inline ::google::protobuf::int32 DebuggerEventMetadata::output_slot() const { + // @@protoc_insertion_point(field_get:third_party.tensorflow.core.debug.DebuggerEventMetadata.output_slot) + return output_slot_; +} +inline void DebuggerEventMetadata::set_output_slot(::google::protobuf::int32 value) { + + output_slot_ = value; + // @@protoc_insertion_point(field_set:third_party.tensorflow.core.debug.DebuggerEventMetadata.output_slot) +} + +// int32 num_chunks = 3; +inline void DebuggerEventMetadata::clear_num_chunks() { + num_chunks_ = 0; +} +inline ::google::protobuf::int32 DebuggerEventMetadata::num_chunks() const { + // @@protoc_insertion_point(field_get:third_party.tensorflow.core.debug.DebuggerEventMetadata.num_chunks) + return num_chunks_; +} +inline void DebuggerEventMetadata::set_num_chunks(::google::protobuf::int32 value) { + + num_chunks_ = value; + // @@protoc_insertion_point(field_set:third_party.tensorflow.core.debug.DebuggerEventMetadata.num_chunks) +} + +// int32 chunk_index = 4; +inline void DebuggerEventMetadata::clear_chunk_index() { + chunk_index_ = 0; +} +inline ::google::protobuf::int32 DebuggerEventMetadata::chunk_index() const { + // @@protoc_insertion_point(field_get:third_party.tensorflow.core.debug.DebuggerEventMetadata.chunk_index) + return chunk_index_; +} +inline void DebuggerEventMetadata::set_chunk_index(::google::protobuf::int32 value) { + + chunk_index_ = value; + // @@protoc_insertion_point(field_set:third_party.tensorflow.core.debug.DebuggerEventMetadata.chunk_index) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace debug +} // namespace core +} // namespace tensorflow +} // namespace third_party + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fdebug_2fdebugger_5fevent_5fmetadata_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.proto new file mode 100644 index 0000000..8bdedb1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package third_party.tensorflow.core.debug; + +// Encapsulates per-event data related to debugging. +message DebuggerEventMetadata { + string device = 1; + int32 output_slot = 2; + int32 num_chunks = 3; + int32 chunk_index = 4; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata_pb2.py new file mode 100644 index 0000000..e315b78 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/debug/debugger_event_metadata_pb2.py @@ -0,0 +1,90 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/debug/debugger_event_metadata.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/debug/debugger_event_metadata.proto', + package='third_party.tensorflow.core.debug', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n=diplomacy_tensorflow/core/debug/debugger_event_metadata.proto\x12!third_party.tensorflow.core.debug\"e\n\x15\x44\x65\x62uggerEventMetadata\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x13\n\x0boutput_slot\x18\x02 \x01(\x05\x12\x12\n\nnum_chunks\x18\x03 \x01(\x05\x12\x13\n\x0b\x63hunk_index\x18\x04 \x01(\x05\x62\x06proto3') +) + + + + +_DEBUGGEREVENTMETADATA = _descriptor.Descriptor( + name='DebuggerEventMetadata', + full_name='third_party.tensorflow.core.debug.DebuggerEventMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device', full_name='third_party.tensorflow.core.debug.DebuggerEventMetadata.device', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_slot', full_name='third_party.tensorflow.core.debug.DebuggerEventMetadata.output_slot', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_chunks', full_name='third_party.tensorflow.core.debug.DebuggerEventMetadata.num_chunks', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='chunk_index', full_name='third_party.tensorflow.core.debug.DebuggerEventMetadata.chunk_index', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=100, + serialized_end=201, +) + +DESCRIPTOR.message_types_by_name['DebuggerEventMetadata'] = _DEBUGGEREVENTMETADATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +DebuggerEventMetadata = _reflection.GeneratedProtocolMessageType('DebuggerEventMetadata', (_message.Message,), dict( + DESCRIPTOR = _DEBUGGEREVENTMETADATA, + __module__ = 'diplomacy_tensorflow.core.debug.debugger_event_metadata_pb2' + # @@protoc_insertion_point(class_scope:third_party.tensorflow.core.debug.DebuggerEventMetadata) + )) +_sym_db.RegisterMessage(DebuggerEventMetadata) + + +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.pb.cc new file mode 100644 index 0000000..7afcf47 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.pb.cc @@ -0,0 +1,808 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/example/example.proto + +#include "diplomacy_tensorflow/core/example/example.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_FeatureLists; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Features; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto +namespace diplomacy { +namespace tensorflow { +class ExampleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Example_default_instance_; +class SequenceExampleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SequenceExample_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto { +static void InitDefaultsExample() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Example_default_instance_; + new (ptr) ::diplomacy::tensorflow::Example(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Example::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Example = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsExample}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Features.base,}}; + +static void InitDefaultsSequenceExample() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_SequenceExample_default_instance_; + new (ptr) ::diplomacy::tensorflow::SequenceExample(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::SequenceExample::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_SequenceExample = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsSequenceExample}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Features.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureLists.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Example.base); + ::google::protobuf::internal::InitSCC(&scc_info_SequenceExample.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Example, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Example, features_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SequenceExample, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SequenceExample, context_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SequenceExample, feature_lists_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::Example)}, + { 6, -1, sizeof(::diplomacy::tensorflow::SequenceExample)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_Example_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_SequenceExample_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/example/example.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n/diplomacy_tensorflow/core/example/exam" + "ple.proto\022\024diplomacy.tensorflow\032/diploma" + "cy_tensorflow/core/example/feature.proto" + "\";\n\007Example\0220\n\010features\030\001 \001(\0132\036.diplomac" + "y.tensorflow.Features\"}\n\017SequenceExample" + "\022/\n\007context\030\001 \001(\0132\036.diplomacy.tensorflow" + ".Features\0229\n\rfeature_lists\030\002 \001(\0132\".diplo" + "macy.tensorflow.FeatureListsBi\n\026org.tens" + "orflow.exampleB\rExampleProtosP\001Z;github." + "com/tensorflow/tensorflow/tensorflow/go/" + "core/example\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 423); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/example/example.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void Example::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_Example_default_instance_._instance.get_mutable()->features_ = const_cast< ::diplomacy::tensorflow::Features*>( + ::diplomacy::tensorflow::Features::internal_default_instance()); +} +void Example::unsafe_arena_set_allocated_features( + ::diplomacy::tensorflow::Features* features) { + if (GetArenaNoVirtual() == NULL) { + delete features_; + } + features_ = features; + if (features) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Example.features) +} +void Example::clear_features() { + if (GetArenaNoVirtual() == NULL && features_ != NULL) { + delete features_; + } + features_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Example::kFeaturesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Example::Example() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::scc_info_Example.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Example) +} +Example::Example(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::scc_info_Example.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Example) +} +Example::Example(const Example& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_features()) { + features_ = new ::diplomacy::tensorflow::Features(*from.features_); + } else { + features_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Example) +} + +void Example::SharedCtor() { + features_ = NULL; +} + +Example::~Example() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Example) + SharedDtor(); +} + +void Example::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete features_; +} + +void Example::ArenaDtor(void* object) { + Example* _this = reinterpret_cast< Example* >(object); + (void)_this; +} +void Example::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Example::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Example::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Example& Example::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::scc_info_Example.base); + return *internal_default_instance(); +} + + +void Example::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Example) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && features_ != NULL) { + delete features_; + } + features_ = NULL; + _internal_metadata_.Clear(); +} + +bool Example::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Example) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.Features features = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_features())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Example) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Example) + return false; +#undef DO_ +} + +void Example::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Example) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.Features features = 1; + if (this->has_features()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_features(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Example) +} + +::google::protobuf::uint8* Example::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Example) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.Features features = 1; + if (this->has_features()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_features(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Example) + return target; +} + +size_t Example::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Example) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.Features features = 1; + if (this->has_features()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *features_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Example::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Example) + GOOGLE_DCHECK_NE(&from, this); + const Example* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Example) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Example) + MergeFrom(*source); + } +} + +void Example::MergeFrom(const Example& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Example) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_features()) { + mutable_features()->::diplomacy::tensorflow::Features::MergeFrom(from.features()); + } +} + +void Example::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Example) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Example::CopyFrom(const Example& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Example) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Example::IsInitialized() const { + return true; +} + +void Example::Swap(Example* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Example* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Example::UnsafeArenaSwap(Example* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Example::InternalSwap(Example* other) { + using std::swap; + swap(features_, other->features_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Example::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SequenceExample::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_SequenceExample_default_instance_._instance.get_mutable()->context_ = const_cast< ::diplomacy::tensorflow::Features*>( + ::diplomacy::tensorflow::Features::internal_default_instance()); + ::diplomacy::tensorflow::_SequenceExample_default_instance_._instance.get_mutable()->feature_lists_ = const_cast< ::diplomacy::tensorflow::FeatureLists*>( + ::diplomacy::tensorflow::FeatureLists::internal_default_instance()); +} +void SequenceExample::unsafe_arena_set_allocated_context( + ::diplomacy::tensorflow::Features* context) { + if (GetArenaNoVirtual() == NULL) { + delete context_; + } + context_ = context; + if (context) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SequenceExample.context) +} +void SequenceExample::clear_context() { + if (GetArenaNoVirtual() == NULL && context_ != NULL) { + delete context_; + } + context_ = NULL; +} +void SequenceExample::unsafe_arena_set_allocated_feature_lists( + ::diplomacy::tensorflow::FeatureLists* feature_lists) { + if (GetArenaNoVirtual() == NULL) { + delete feature_lists_; + } + feature_lists_ = feature_lists; + if (feature_lists) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SequenceExample.feature_lists) +} +void SequenceExample::clear_feature_lists() { + if (GetArenaNoVirtual() == NULL && feature_lists_ != NULL) { + delete feature_lists_; + } + feature_lists_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SequenceExample::kContextFieldNumber; +const int SequenceExample::kFeatureListsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SequenceExample::SequenceExample() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::scc_info_SequenceExample.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.SequenceExample) +} +SequenceExample::SequenceExample(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::scc_info_SequenceExample.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.SequenceExample) +} +SequenceExample::SequenceExample(const SequenceExample& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_context()) { + context_ = new ::diplomacy::tensorflow::Features(*from.context_); + } else { + context_ = NULL; + } + if (from.has_feature_lists()) { + feature_lists_ = new ::diplomacy::tensorflow::FeatureLists(*from.feature_lists_); + } else { + feature_lists_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.SequenceExample) +} + +void SequenceExample::SharedCtor() { + ::memset(&context_, 0, static_cast( + reinterpret_cast(&feature_lists_) - + reinterpret_cast(&context_)) + sizeof(feature_lists_)); +} + +SequenceExample::~SequenceExample() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.SequenceExample) + SharedDtor(); +} + +void SequenceExample::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete context_; + if (this != internal_default_instance()) delete feature_lists_; +} + +void SequenceExample::ArenaDtor(void* object) { + SequenceExample* _this = reinterpret_cast< SequenceExample* >(object); + (void)_this; +} +void SequenceExample::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SequenceExample::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SequenceExample::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SequenceExample& SequenceExample::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::scc_info_SequenceExample.base); + return *internal_default_instance(); +} + + +void SequenceExample::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.SequenceExample) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && context_ != NULL) { + delete context_; + } + context_ = NULL; + if (GetArenaNoVirtual() == NULL && feature_lists_ != NULL) { + delete feature_lists_; + } + feature_lists_ = NULL; + _internal_metadata_.Clear(); +} + +bool SequenceExample::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.SequenceExample) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.Features context = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_context())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.FeatureLists feature_lists = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_feature_lists())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.SequenceExample) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.SequenceExample) + return false; +#undef DO_ +} + +void SequenceExample::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.SequenceExample) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.Features context = 1; + if (this->has_context()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_context(), output); + } + + // .diplomacy.tensorflow.FeatureLists feature_lists = 2; + if (this->has_feature_lists()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_feature_lists(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.SequenceExample) +} + +::google::protobuf::uint8* SequenceExample::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.SequenceExample) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.Features context = 1; + if (this->has_context()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_context(), deterministic, target); + } + + // .diplomacy.tensorflow.FeatureLists feature_lists = 2; + if (this->has_feature_lists()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_feature_lists(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.SequenceExample) + return target; +} + +size_t SequenceExample::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.SequenceExample) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.Features context = 1; + if (this->has_context()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *context_); + } + + // .diplomacy.tensorflow.FeatureLists feature_lists = 2; + if (this->has_feature_lists()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *feature_lists_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SequenceExample::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.SequenceExample) + GOOGLE_DCHECK_NE(&from, this); + const SequenceExample* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.SequenceExample) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.SequenceExample) + MergeFrom(*source); + } +} + +void SequenceExample::MergeFrom(const SequenceExample& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.SequenceExample) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_context()) { + mutable_context()->::diplomacy::tensorflow::Features::MergeFrom(from.context()); + } + if (from.has_feature_lists()) { + mutable_feature_lists()->::diplomacy::tensorflow::FeatureLists::MergeFrom(from.feature_lists()); + } +} + +void SequenceExample::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.SequenceExample) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SequenceExample::CopyFrom(const SequenceExample& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.SequenceExample) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SequenceExample::IsInitialized() const { + return true; +} + +void SequenceExample::Swap(SequenceExample* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SequenceExample* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SequenceExample::UnsafeArenaSwap(SequenceExample* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SequenceExample::InternalSwap(SequenceExample* other) { + using std::swap; + swap(context_, other->context_); + swap(feature_lists_, other->feature_lists_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SequenceExample::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Example* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Example >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Example >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::SequenceExample* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::SequenceExample >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::SequenceExample >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.pb.h new file mode 100644 index 0000000..ccbbae6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.pb.h @@ -0,0 +1,543 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/example/example.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/example/feature.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto +namespace diplomacy { +namespace tensorflow { +class Example; +class ExampleDefaultTypeInternal; +extern ExampleDefaultTypeInternal _Example_default_instance_; +class SequenceExample; +class SequenceExampleDefaultTypeInternal; +extern SequenceExampleDefaultTypeInternal _SequenceExample_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::Example* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Example>(Arena*); +template<> ::diplomacy::tensorflow::SequenceExample* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SequenceExample>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class Example : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Example) */ { + public: + Example(); + virtual ~Example(); + + Example(const Example& from); + + inline Example& operator=(const Example& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Example(Example&& from) noexcept + : Example() { + *this = ::std::move(from); + } + + inline Example& operator=(Example&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Example& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Example* internal_default_instance() { + return reinterpret_cast( + &_Example_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(Example* other); + void Swap(Example* other); + friend void swap(Example& a, Example& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Example* New() const final { + return CreateMaybeMessage(NULL); + } + + Example* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Example& from); + void MergeFrom(const Example& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Example* other); + protected: + explicit Example(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.Features features = 1; + bool has_features() const; + void clear_features(); + static const int kFeaturesFieldNumber = 1; + private: + const ::diplomacy::tensorflow::Features& _internal_features() const; + public: + const ::diplomacy::tensorflow::Features& features() const; + ::diplomacy::tensorflow::Features* release_features(); + ::diplomacy::tensorflow::Features* mutable_features(); + void set_allocated_features(::diplomacy::tensorflow::Features* features); + void unsafe_arena_set_allocated_features( + ::diplomacy::tensorflow::Features* features); + ::diplomacy::tensorflow::Features* unsafe_arena_release_features(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Example) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::Features* features_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SequenceExample : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SequenceExample) */ { + public: + SequenceExample(); + virtual ~SequenceExample(); + + SequenceExample(const SequenceExample& from); + + inline SequenceExample& operator=(const SequenceExample& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SequenceExample(SequenceExample&& from) noexcept + : SequenceExample() { + *this = ::std::move(from); + } + + inline SequenceExample& operator=(SequenceExample&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SequenceExample& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SequenceExample* internal_default_instance() { + return reinterpret_cast( + &_SequenceExample_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(SequenceExample* other); + void Swap(SequenceExample* other); + friend void swap(SequenceExample& a, SequenceExample& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SequenceExample* New() const final { + return CreateMaybeMessage(NULL); + } + + SequenceExample* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SequenceExample& from); + void MergeFrom(const SequenceExample& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SequenceExample* other); + protected: + explicit SequenceExample(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.Features context = 1; + bool has_context() const; + void clear_context(); + static const int kContextFieldNumber = 1; + private: + const ::diplomacy::tensorflow::Features& _internal_context() const; + public: + const ::diplomacy::tensorflow::Features& context() const; + ::diplomacy::tensorflow::Features* release_context(); + ::diplomacy::tensorflow::Features* mutable_context(); + void set_allocated_context(::diplomacy::tensorflow::Features* context); + void unsafe_arena_set_allocated_context( + ::diplomacy::tensorflow::Features* context); + ::diplomacy::tensorflow::Features* unsafe_arena_release_context(); + + // .diplomacy.tensorflow.FeatureLists feature_lists = 2; + bool has_feature_lists() const; + void clear_feature_lists(); + static const int kFeatureListsFieldNumber = 2; + private: + const ::diplomacy::tensorflow::FeatureLists& _internal_feature_lists() const; + public: + const ::diplomacy::tensorflow::FeatureLists& feature_lists() const; + ::diplomacy::tensorflow::FeatureLists* release_feature_lists(); + ::diplomacy::tensorflow::FeatureLists* mutable_feature_lists(); + void set_allocated_feature_lists(::diplomacy::tensorflow::FeatureLists* feature_lists); + void unsafe_arena_set_allocated_feature_lists( + ::diplomacy::tensorflow::FeatureLists* feature_lists); + ::diplomacy::tensorflow::FeatureLists* unsafe_arena_release_feature_lists(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SequenceExample) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::Features* context_; + ::diplomacy::tensorflow::FeatureLists* feature_lists_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Example + +// .diplomacy.tensorflow.Features features = 1; +inline bool Example::has_features() const { + return this != internal_default_instance() && features_ != NULL; +} +inline const ::diplomacy::tensorflow::Features& Example::_internal_features() const { + return *features_; +} +inline const ::diplomacy::tensorflow::Features& Example::features() const { + const ::diplomacy::tensorflow::Features* p = features_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Example.features) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_Features_default_instance_); +} +inline ::diplomacy::tensorflow::Features* Example::release_features() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Example.features) + + ::diplomacy::tensorflow::Features* temp = features_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + features_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::Features* Example::unsafe_arena_release_features() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Example.features) + + ::diplomacy::tensorflow::Features* temp = features_; + features_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::Features* Example::mutable_features() { + + if (features_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::Features>(GetArenaNoVirtual()); + features_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Example.features) + return features_; +} +inline void Example::set_allocated_features(::diplomacy::tensorflow::Features* features) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(features_); + } + if (features) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(features)->GetArena(); + if (message_arena != submessage_arena) { + features = ::google::protobuf::internal::GetOwnedMessage( + message_arena, features, submessage_arena); + } + + } else { + + } + features_ = features; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Example.features) +} + +// ------------------------------------------------------------------- + +// SequenceExample + +// .diplomacy.tensorflow.Features context = 1; +inline bool SequenceExample::has_context() const { + return this != internal_default_instance() && context_ != NULL; +} +inline const ::diplomacy::tensorflow::Features& SequenceExample::_internal_context() const { + return *context_; +} +inline const ::diplomacy::tensorflow::Features& SequenceExample::context() const { + const ::diplomacy::tensorflow::Features* p = context_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SequenceExample.context) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_Features_default_instance_); +} +inline ::diplomacy::tensorflow::Features* SequenceExample::release_context() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SequenceExample.context) + + ::diplomacy::tensorflow::Features* temp = context_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + context_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::Features* SequenceExample::unsafe_arena_release_context() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SequenceExample.context) + + ::diplomacy::tensorflow::Features* temp = context_; + context_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::Features* SequenceExample::mutable_context() { + + if (context_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::Features>(GetArenaNoVirtual()); + context_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SequenceExample.context) + return context_; +} +inline void SequenceExample::set_allocated_context(::diplomacy::tensorflow::Features* context) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(context_); + } + if (context) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(context)->GetArena(); + if (message_arena != submessage_arena) { + context = ::google::protobuf::internal::GetOwnedMessage( + message_arena, context, submessage_arena); + } + + } else { + + } + context_ = context; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SequenceExample.context) +} + +// .diplomacy.tensorflow.FeatureLists feature_lists = 2; +inline bool SequenceExample::has_feature_lists() const { + return this != internal_default_instance() && feature_lists_ != NULL; +} +inline const ::diplomacy::tensorflow::FeatureLists& SequenceExample::_internal_feature_lists() const { + return *feature_lists_; +} +inline const ::diplomacy::tensorflow::FeatureLists& SequenceExample::feature_lists() const { + const ::diplomacy::tensorflow::FeatureLists* p = feature_lists_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SequenceExample.feature_lists) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_FeatureLists_default_instance_); +} +inline ::diplomacy::tensorflow::FeatureLists* SequenceExample::release_feature_lists() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SequenceExample.feature_lists) + + ::diplomacy::tensorflow::FeatureLists* temp = feature_lists_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + feature_lists_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::FeatureLists* SequenceExample::unsafe_arena_release_feature_lists() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SequenceExample.feature_lists) + + ::diplomacy::tensorflow::FeatureLists* temp = feature_lists_; + feature_lists_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::FeatureLists* SequenceExample::mutable_feature_lists() { + + if (feature_lists_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::FeatureLists>(GetArenaNoVirtual()); + feature_lists_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SequenceExample.feature_lists) + return feature_lists_; +} +inline void SequenceExample::set_allocated_feature_lists(::diplomacy::tensorflow::FeatureLists* feature_lists) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(feature_lists_); + } + if (feature_lists) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(feature_lists)->GetArena(); + if (message_arena != submessage_arena) { + feature_lists = ::google::protobuf::internal::GetOwnedMessage( + message_arena, feature_lists, submessage_arena); + } + + } else { + + } + feature_lists_ = feature_lists; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SequenceExample.feature_lists) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.proto new file mode 100644 index 0000000..12a2c3c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example.proto @@ -0,0 +1,301 @@ +// Protocol messages for describing input data Examples for machine learning +// model training or inference. +syntax = "proto3"; + +import "diplomacy_tensorflow/core/example/feature.proto"; +option cc_enable_arenas = true; +option java_outer_classname = "ExampleProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.example"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example"; +package diplomacy.tensorflow; + +// An Example is a mostly-normalized data format for storing data for +// training and inference. It contains a key-value store (features); where +// each key (string) maps to a Feature message (which is oneof packed BytesList, +// FloatList, or Int64List). This flexible and compact format allows the +// storage of large amounts of typed data, but requires that the data shape +// and use be determined by the configuration files and parsers that are used to +// read and write this format. That is, the Example is mostly *not* a +// self-describing format. In TensorFlow, Examples are read in row-major +// format, so any configuration that describes data with rank-2 or above +// should keep this in mind. For example, to store an M x N matrix of Bytes, +// the BytesList must contain M*N bytes, with M rows of N contiguous values +// each. That is, the BytesList value must store the matrix as: +// .... row 0 .... .... row 1 .... // ........... // ... row M-1 .... +// +// An Example for a movie recommendation application: +// features { +// feature { +// key: "age" +// value { float_list { +// value: 29.0 +// }} +// } +// feature { +// key: "movie" +// value { bytes_list { +// value: "The Shawshank Redemption" +// value: "Fight Club" +// }} +// } +// feature { +// key: "movie_ratings" +// value { float_list { +// value: 9.0 +// value: 9.7 +// }} +// } +// feature { +// key: "suggestion" +// value { bytes_list { +// value: "Inception" +// }} +// } +// # Note that this feature exists to be used as a label in training. +// # E.g., if training a logistic regression model to predict purchase +// # probability in our learning tool we would set the label feature to +// # "suggestion_purchased". +// feature { +// key: "suggestion_purchased" +// value { float_list { +// value: 1.0 +// }} +// } +// # Similar to "suggestion_purchased" above this feature exists to be used +// # as a label in training. +// # E.g., if training a linear regression model to predict purchase +// # price in our learning tool we would set the label feature to +// # "purchase_price". +// feature { +// key: "purchase_price" +// value { float_list { +// value: 9.99 +// }} +// } +// } +// +// A conformant Example data set obeys the following conventions: +// - If a Feature K exists in one example with data type T, it must be of +// type T in all other examples when present. It may be omitted. +// - The number of instances of Feature K list data may vary across examples, +// depending on the requirements of the model. +// - If a Feature K doesn't exist in an example, a K-specific default will be +// used, if configured. +// - If a Feature K exists in an example but contains no items, the intent +// is considered to be an empty tensor and no default will be used. + +message Example { + Features features = 1; +}; + +// A SequenceExample is an Example representing one or more sequences, and +// some context. The context contains features which apply to the entire +// example. The feature_lists contain a key, value map where each key is +// associated with a repeated set of Features (a FeatureList). +// A FeatureList thus represents the values of a feature identified by its key +// over time / frames. +// +// Below is a SequenceExample for a movie recommendation application recording a +// sequence of ratings by a user. The time-independent features ("locale", +// "age", "favorites") describing the user are part of the context. The sequence +// of movies the user rated are part of the feature_lists. For each movie in the +// sequence we have information on its name and actors and the user's rating. +// This information is recorded in three separate feature_list(s). +// In the example below there are only two movies. All three feature_list(s), +// namely "movie_ratings", "movie_names", and "actors" have a feature value for +// both movies. Note, that "actors" is itself a bytes_list with multiple +// strings per movie. +// +// context: { +// feature: { +// key : "locale" +// value: { +// bytes_list: { +// value: [ "pt_BR" ] +// } +// } +// } +// feature: { +// key : "age" +// value: { +// float_list: { +// value: [ 19.0 ] +// } +// } +// } +// feature: { +// key : "favorites" +// value: { +// bytes_list: { +// value: [ "Majesty Rose", "Savannah Outen", "One Direction" ] +// } +// } +// } +// } +// feature_lists: { +// feature_list: { +// key : "movie_ratings" +// value: { +// feature: { +// float_list: { +// value: [ 4.5 ] +// } +// } +// feature: { +// float_list: { +// value: [ 5.0 ] +// } +// } +// } +// } +// feature_list: { +// key : "movie_names" +// value: { +// feature: { +// bytes_list: { +// value: [ "The Shawshank Redemption" ] +// } +// } +// feature: { +// bytes_list: { +// value: [ "Fight Club" ] +// } +// } +// } +// } +// feature_list: { +// key : "actors" +// value: { +// feature: { +// bytes_list: { +// value: [ "Tim Robbins", "Morgan Freeman" ] +// } +// } +// feature: { +// bytes_list: { +// value: [ "Brad Pitt", "Edward Norton", "Helena Bonham Carter" ] +// } +// } +// } +// } +// } +// +// A conformant SequenceExample data set obeys the following conventions: +// +// Context: +// - All conformant context features K must obey the same conventions as +// a conformant Example's features (see above). +// Feature lists: +// - A FeatureList L may be missing in an example; it is up to the +// parser configuration to determine if this is allowed or considered +// an empty list (zero length). +// - If a FeatureList L exists, it may be empty (zero length). +// - If a FeatureList L is non-empty, all features within the FeatureList +// must have the same data type T. Even across SequenceExamples, the type T +// of the FeatureList identified by the same key must be the same. An entry +// without any values may serve as an empty feature. +// - If a FeatureList L is non-empty, it is up to the parser configuration +// to determine if all features within the FeatureList must +// have the same size. The same holds for this FeatureList across multiple +// examples. +// - For sequence modeling, e.g.: +// http://colah.github.io/posts/2015-08-Understanding-LSTMs/ +// https://github.com/tensorflow/nmt +// the feature lists represent a sequence of frames. +// In this scenario, all FeatureLists in a SequenceExample have the same +// number of Feature messages, so that the ith element in each FeatureList +// is part of the ith frame (or time step). +// Examples of conformant and non-conformant examples' FeatureLists: +// +// Conformant FeatureLists: +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0 ] } } } +// } } +// +// Non-conformant FeatureLists (mismatched types): +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { int64_list: { value: [ 5 ] } } } +// } } +// +// Conditionally conformant FeatureLists, the parser configuration determines +// if the feature sizes must match: +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0, 6.0 ] } } } +// } } +// +// Conformant pair of SequenceExample +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0 ] } } } +// } } +// and: +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0 ] } } +// feature: { float_list: { value: [ 2.0 ] } } } +// } } +// +// Conformant pair of SequenceExample +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0 ] } } } +// } } +// and: +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { } +// } } +// +// Conditionally conformant pair of SequenceExample, the parser configuration +// determines if the second feature_lists is consistent (zero-length) or +// invalid (missing "movie_ratings"): +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0 ] } } } +// } } +// and: +// feature_lists: { } +// +// Non-conformant pair of SequenceExample (mismatched types) +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0 ] } } } +// } } +// and: +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { int64_list: { value: [ 4 ] } } +// feature: { int64_list: { value: [ 5 ] } } +// feature: { int64_list: { value: [ 2 ] } } } +// } } +// +// Conditionally conformant pair of SequenceExample; the parser configuration +// determines if the feature sizes must match: +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.5 ] } } +// feature: { float_list: { value: [ 5.0 ] } } } +// } } +// and: +// feature_lists: { feature_list: { +// key: "movie_ratings" +// value: { feature: { float_list: { value: [ 4.0 ] } } +// feature: { float_list: { value: [ 5.0, 3.0 ] } } +// } } + +message SequenceExample { + Features context = 1; + FeatureLists feature_lists = 2; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.pb.cc new file mode 100644 index 0000000..2e981a3 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.pb.cc @@ -0,0 +1,1958 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/example/example_parser_configuration.proto + +#include "diplomacy_tensorflow/core/example/example_parser_configuration.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_VarLenFeatureProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ExampleParserConfiguration_FeatureMapEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_FeatureConfiguration; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_FixedLenFeatureProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class VarLenFeatureProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _VarLenFeatureProto_default_instance_; +class FixedLenFeatureProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FixedLenFeatureProto_default_instance_; +class FeatureConfigurationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::FixedLenFeatureProto* fixed_len_feature_; + const ::diplomacy::tensorflow::VarLenFeatureProto* var_len_feature_; +} _FeatureConfiguration_default_instance_; +class ExampleParserConfiguration_FeatureMapEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExampleParserConfiguration_FeatureMapEntry_DoNotUse_default_instance_; +class ExampleParserConfigurationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ExampleParserConfiguration_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto { +static void InitDefaultsVarLenFeatureProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_VarLenFeatureProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::VarLenFeatureProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::VarLenFeatureProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_VarLenFeatureProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsVarLenFeatureProto}, {}}; + +static void InitDefaultsFixedLenFeatureProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FixedLenFeatureProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::FixedLenFeatureProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::FixedLenFeatureProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_FixedLenFeatureProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFixedLenFeatureProto}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base,}}; + +static void InitDefaultsFeatureConfiguration() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FeatureConfiguration_default_instance_; + new (ptr) ::diplomacy::tensorflow::FeatureConfiguration(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::FeatureConfiguration::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_FeatureConfiguration = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFeatureConfiguration}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FixedLenFeatureProto.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_VarLenFeatureProto.base,}}; + +static void InitDefaultsExampleParserConfiguration_FeatureMapEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ExampleParserConfiguration_FeatureMapEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse(); + } + ::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ExampleParserConfiguration_FeatureMapEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsExampleParserConfiguration_FeatureMapEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FeatureConfiguration.base,}}; + +static void InitDefaultsExampleParserConfiguration() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ExampleParserConfiguration_default_instance_; + new (ptr) ::diplomacy::tensorflow::ExampleParserConfiguration(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ExampleParserConfiguration::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ExampleParserConfiguration = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsExampleParserConfiguration}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_ExampleParserConfiguration_FeatureMapEntry_DoNotUse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_VarLenFeatureProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_FixedLenFeatureProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_FeatureConfiguration.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExampleParserConfiguration_FeatureMapEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_ExampleParserConfiguration.base); +} + +::google::protobuf::Metadata file_level_metadata[5]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VarLenFeatureProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VarLenFeatureProto, dtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VarLenFeatureProto, values_output_tensor_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VarLenFeatureProto, indices_output_tensor_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VarLenFeatureProto, shapes_output_tensor_name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FixedLenFeatureProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FixedLenFeatureProto, dtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FixedLenFeatureProto, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FixedLenFeatureProto, default_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FixedLenFeatureProto, values_output_tensor_name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureConfiguration, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureConfiguration, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::FeatureConfigurationDefaultTypeInternal, fixed_len_feature_), + offsetof(::diplomacy::tensorflow::FeatureConfigurationDefaultTypeInternal, var_len_feature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureConfiguration, config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ExampleParserConfiguration, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ExampleParserConfiguration, feature_map_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::VarLenFeatureProto)}, + { 9, -1, sizeof(::diplomacy::tensorflow::FixedLenFeatureProto)}, + { 18, -1, sizeof(::diplomacy::tensorflow::FeatureConfiguration)}, + { 26, 33, sizeof(::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse)}, + { 35, -1, sizeof(::diplomacy::tensorflow::ExampleParserConfiguration)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_VarLenFeatureProto_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FixedLenFeatureProto_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FeatureConfiguration_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ExampleParserConfiguration_FeatureMapEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ExampleParserConfiguration_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/example/example_parser_configuration.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nDdiplomacy_tensorflow/core/example/exam" + "ple_parser_configuration.proto\022\024diplomac" + "y.tensorflow\0326diplomacy_tensorflow/core/" + "framework/tensor_shape.proto\0320diplomacy_" + "tensorflow/core/framework/tensor.proto\032/" + "diplomacy_tensorflow/core/framework/type" + "s.proto\"\255\001\n\022VarLenFeatureProto\022-\n\005dtype\030" + "\001 \001(\0162\036.diplomacy.tensorflow.DataType\022!\n" + "\031values_output_tensor_name\030\002 \001(\t\022\"\n\032indi" + "ces_output_tensor_name\030\003 \001(\t\022!\n\031shapes_o" + "utput_tensor_name\030\004 \001(\t\"\331\001\n\024FixedLenFeat" + "ureProto\022-\n\005dtype\030\001 \001(\0162\036.diplomacy.tens" + "orflow.DataType\0225\n\005shape\030\002 \001(\0132&.diploma" + "cy.tensorflow.TensorShapeProto\0228\n\rdefaul" + "t_value\030\003 \001(\0132!.diplomacy.tensorflow.Ten" + "sorProto\022!\n\031values_output_tensor_name\030\004 " + "\001(\t\"\256\001\n\024FeatureConfiguration\022G\n\021fixed_le" + "n_feature\030\001 \001(\0132*.diplomacy.tensorflow.F" + "ixedLenFeatureProtoH\000\022C\n\017var_len_feature" + "\030\002 \001(\0132(.diplomacy.tensorflow.VarLenFeat" + "ureProtoH\000B\010\n\006config\"\322\001\n\032ExampleParserCo" + "nfiguration\022U\n\013feature_map\030\001 \003(\0132@.diplo" + "macy.tensorflow.ExampleParserConfigurati" + "on.FeatureMapEntry\032]\n\017FeatureMapEntry\022\013\n" + "\003key\030\001 \001(\t\0229\n\005value\030\002 \001(\0132*.diplomacy.te" + "nsorflow.FeatureConfiguration:\0028\001B|\n\026org" + ".tensorflow.exampleB ExampleParserConfig" + "urationProtosP\001Z;github.com/tensorflow/t" + "ensorflow/tensorflow/go/core/example\370\001\001b" + "\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1167); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/example/example_parser_configuration.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void VarLenFeatureProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int VarLenFeatureProto::kDtypeFieldNumber; +const int VarLenFeatureProto::kValuesOutputTensorNameFieldNumber; +const int VarLenFeatureProto::kIndicesOutputTensorNameFieldNumber; +const int VarLenFeatureProto::kShapesOutputTensorNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +VarLenFeatureProto::VarLenFeatureProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_VarLenFeatureProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.VarLenFeatureProto) +} +VarLenFeatureProto::VarLenFeatureProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_VarLenFeatureProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.VarLenFeatureProto) +} +VarLenFeatureProto::VarLenFeatureProto(const VarLenFeatureProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + values_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.values_output_tensor_name().size() > 0) { + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.values_output_tensor_name(), + GetArenaNoVirtual()); + } + indices_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.indices_output_tensor_name().size() > 0) { + indices_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.indices_output_tensor_name(), + GetArenaNoVirtual()); + } + shapes_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.shapes_output_tensor_name().size() > 0) { + shapes_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.shapes_output_tensor_name(), + GetArenaNoVirtual()); + } + dtype_ = from.dtype_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.VarLenFeatureProto) +} + +void VarLenFeatureProto::SharedCtor() { + values_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + indices_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + shapes_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + dtype_ = 0; +} + +VarLenFeatureProto::~VarLenFeatureProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.VarLenFeatureProto) + SharedDtor(); +} + +void VarLenFeatureProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + values_output_tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + indices_output_tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + shapes_output_tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void VarLenFeatureProto::ArenaDtor(void* object) { + VarLenFeatureProto* _this = reinterpret_cast< VarLenFeatureProto* >(object); + (void)_this; +} +void VarLenFeatureProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void VarLenFeatureProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* VarLenFeatureProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const VarLenFeatureProto& VarLenFeatureProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_VarLenFeatureProto.base); + return *internal_default_instance(); +} + + +void VarLenFeatureProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.VarLenFeatureProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + values_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + indices_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + shapes_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + dtype_ = 0; + _internal_metadata_.Clear(); +} + +bool VarLenFeatureProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.VarLenFeatureProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.DataType dtype = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string values_output_tensor_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_values_output_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->values_output_tensor_name().data(), static_cast(this->values_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + // string indices_output_tensor_name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_indices_output_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->indices_output_tensor_name().data(), static_cast(this->indices_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + // string shapes_output_tensor_name = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_shapes_output_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->shapes_output_tensor_name().data(), static_cast(this->shapes_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.VarLenFeatureProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.VarLenFeatureProto) + return false; +#undef DO_ +} + +void VarLenFeatureProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.VarLenFeatureProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->dtype(), output); + } + + // string values_output_tensor_name = 2; + if (this->values_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->values_output_tensor_name().data(), static_cast(this->values_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->values_output_tensor_name(), output); + } + + // string indices_output_tensor_name = 3; + if (this->indices_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->indices_output_tensor_name().data(), static_cast(this->indices_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->indices_output_tensor_name(), output); + } + + // string shapes_output_tensor_name = 4; + if (this->shapes_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->shapes_output_tensor_name().data(), static_cast(this->shapes_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->shapes_output_tensor_name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.VarLenFeatureProto) +} + +::google::protobuf::uint8* VarLenFeatureProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.VarLenFeatureProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->dtype(), target); + } + + // string values_output_tensor_name = 2; + if (this->values_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->values_output_tensor_name().data(), static_cast(this->values_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->values_output_tensor_name(), target); + } + + // string indices_output_tensor_name = 3; + if (this->indices_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->indices_output_tensor_name().data(), static_cast(this->indices_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->indices_output_tensor_name(), target); + } + + // string shapes_output_tensor_name = 4; + if (this->shapes_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->shapes_output_tensor_name().data(), static_cast(this->shapes_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->shapes_output_tensor_name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.VarLenFeatureProto) + return target; +} + +size_t VarLenFeatureProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.VarLenFeatureProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string values_output_tensor_name = 2; + if (this->values_output_tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->values_output_tensor_name()); + } + + // string indices_output_tensor_name = 3; + if (this->indices_output_tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->indices_output_tensor_name()); + } + + // string shapes_output_tensor_name = 4; + if (this->shapes_output_tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->shapes_output_tensor_name()); + } + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void VarLenFeatureProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.VarLenFeatureProto) + GOOGLE_DCHECK_NE(&from, this); + const VarLenFeatureProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.VarLenFeatureProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.VarLenFeatureProto) + MergeFrom(*source); + } +} + +void VarLenFeatureProto::MergeFrom(const VarLenFeatureProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.VarLenFeatureProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.values_output_tensor_name().size() > 0) { + set_values_output_tensor_name(from.values_output_tensor_name()); + } + if (from.indices_output_tensor_name().size() > 0) { + set_indices_output_tensor_name(from.indices_output_tensor_name()); + } + if (from.shapes_output_tensor_name().size() > 0) { + set_shapes_output_tensor_name(from.shapes_output_tensor_name()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void VarLenFeatureProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.VarLenFeatureProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void VarLenFeatureProto::CopyFrom(const VarLenFeatureProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.VarLenFeatureProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool VarLenFeatureProto::IsInitialized() const { + return true; +} + +void VarLenFeatureProto::Swap(VarLenFeatureProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + VarLenFeatureProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void VarLenFeatureProto::UnsafeArenaSwap(VarLenFeatureProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void VarLenFeatureProto::InternalSwap(VarLenFeatureProto* other) { + using std::swap; + values_output_tensor_name_.Swap(&other->values_output_tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + indices_output_tensor_name_.Swap(&other->indices_output_tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + shapes_output_tensor_name_.Swap(&other->shapes_output_tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata VarLenFeatureProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FixedLenFeatureProto::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_FixedLenFeatureProto_default_instance_._instance.get_mutable()->shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); + ::diplomacy::tensorflow::_FixedLenFeatureProto_default_instance_._instance.get_mutable()->default_value_ = const_cast< ::diplomacy::tensorflow::TensorProto*>( + ::diplomacy::tensorflow::TensorProto::internal_default_instance()); +} +void FixedLenFeatureProto::unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.FixedLenFeatureProto.shape) +} +void FixedLenFeatureProto::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +void FixedLenFeatureProto::unsafe_arena_set_allocated_default_value( + ::diplomacy::tensorflow::TensorProto* default_value) { + if (GetArenaNoVirtual() == NULL) { + delete default_value_; + } + default_value_ = default_value; + if (default_value) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.FixedLenFeatureProto.default_value) +} +void FixedLenFeatureProto::clear_default_value() { + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) { + delete default_value_; + } + default_value_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FixedLenFeatureProto::kDtypeFieldNumber; +const int FixedLenFeatureProto::kShapeFieldNumber; +const int FixedLenFeatureProto::kDefaultValueFieldNumber; +const int FixedLenFeatureProto::kValuesOutputTensorNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FixedLenFeatureProto::FixedLenFeatureProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FixedLenFeatureProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.FixedLenFeatureProto) +} +FixedLenFeatureProto::FixedLenFeatureProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FixedLenFeatureProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.FixedLenFeatureProto) +} +FixedLenFeatureProto::FixedLenFeatureProto(const FixedLenFeatureProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + values_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.values_output_tensor_name().size() > 0) { + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.values_output_tensor_name(), + GetArenaNoVirtual()); + } + if (from.has_shape()) { + shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + if (from.has_default_value()) { + default_value_ = new ::diplomacy::tensorflow::TensorProto(*from.default_value_); + } else { + default_value_ = NULL; + } + dtype_ = from.dtype_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.FixedLenFeatureProto) +} + +void FixedLenFeatureProto::SharedCtor() { + values_output_tensor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&shape_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&shape_)) + sizeof(dtype_)); +} + +FixedLenFeatureProto::~FixedLenFeatureProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.FixedLenFeatureProto) + SharedDtor(); +} + +void FixedLenFeatureProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + values_output_tensor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete shape_; + if (this != internal_default_instance()) delete default_value_; +} + +void FixedLenFeatureProto::ArenaDtor(void* object) { + FixedLenFeatureProto* _this = reinterpret_cast< FixedLenFeatureProto* >(object); + (void)_this; +} +void FixedLenFeatureProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FixedLenFeatureProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FixedLenFeatureProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FixedLenFeatureProto& FixedLenFeatureProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FixedLenFeatureProto.base); + return *internal_default_instance(); +} + + +void FixedLenFeatureProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.FixedLenFeatureProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + values_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) { + delete default_value_; + } + default_value_ = NULL; + dtype_ = 0; + _internal_metadata_.Clear(); +} + +bool FixedLenFeatureProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.FixedLenFeatureProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.DataType dtype = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorProto default_value = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_default_value())); + } else { + goto handle_unusual; + } + break; + } + + // string values_output_tensor_name = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_values_output_tensor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->values_output_tensor_name().data(), static_cast(this->values_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.FixedLenFeatureProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.FixedLenFeatureProto) + return false; +#undef DO_ +} + +void FixedLenFeatureProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.FixedLenFeatureProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->dtype(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape(), output); + } + + // .diplomacy.tensorflow.TensorProto default_value = 3; + if (this->has_default_value()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_default_value(), output); + } + + // string values_output_tensor_name = 4; + if (this->values_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->values_output_tensor_name().data(), static_cast(this->values_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->values_output_tensor_name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.FixedLenFeatureProto) +} + +::google::protobuf::uint8* FixedLenFeatureProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.FixedLenFeatureProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->dtype(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape(), deterministic, target); + } + + // .diplomacy.tensorflow.TensorProto default_value = 3; + if (this->has_default_value()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_default_value(), deterministic, target); + } + + // string values_output_tensor_name = 4; + if (this->values_output_tensor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->values_output_tensor_name().data(), static_cast(this->values_output_tensor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->values_output_tensor_name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.FixedLenFeatureProto) + return target; +} + +size_t FixedLenFeatureProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.FixedLenFeatureProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string values_output_tensor_name = 4; + if (this->values_output_tensor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->values_output_tensor_name()); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // .diplomacy.tensorflow.TensorProto default_value = 3; + if (this->has_default_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *default_value_); + } + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FixedLenFeatureProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.FixedLenFeatureProto) + GOOGLE_DCHECK_NE(&from, this); + const FixedLenFeatureProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.FixedLenFeatureProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.FixedLenFeatureProto) + MergeFrom(*source); + } +} + +void FixedLenFeatureProto::MergeFrom(const FixedLenFeatureProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.FixedLenFeatureProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.values_output_tensor_name().size() > 0) { + set_values_output_tensor_name(from.values_output_tensor_name()); + } + if (from.has_shape()) { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + } + if (from.has_default_value()) { + mutable_default_value()->::diplomacy::tensorflow::TensorProto::MergeFrom(from.default_value()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void FixedLenFeatureProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.FixedLenFeatureProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FixedLenFeatureProto::CopyFrom(const FixedLenFeatureProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.FixedLenFeatureProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FixedLenFeatureProto::IsInitialized() const { + return true; +} + +void FixedLenFeatureProto::Swap(FixedLenFeatureProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FixedLenFeatureProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FixedLenFeatureProto::UnsafeArenaSwap(FixedLenFeatureProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FixedLenFeatureProto::InternalSwap(FixedLenFeatureProto* other) { + using std::swap; + values_output_tensor_name_.Swap(&other->values_output_tensor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(shape_, other->shape_); + swap(default_value_, other->default_value_); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FixedLenFeatureProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FeatureConfiguration::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_FeatureConfiguration_default_instance_.fixed_len_feature_ = const_cast< ::diplomacy::tensorflow::FixedLenFeatureProto*>( + ::diplomacy::tensorflow::FixedLenFeatureProto::internal_default_instance()); + ::diplomacy::tensorflow::_FeatureConfiguration_default_instance_.var_len_feature_ = const_cast< ::diplomacy::tensorflow::VarLenFeatureProto*>( + ::diplomacy::tensorflow::VarLenFeatureProto::internal_default_instance()); +} +void FeatureConfiguration::set_allocated_fixed_len_feature(::diplomacy::tensorflow::FixedLenFeatureProto* fixed_len_feature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_config(); + if (fixed_len_feature) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(fixed_len_feature); + if (message_arena != submessage_arena) { + fixed_len_feature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, fixed_len_feature, submessage_arena); + } + set_has_fixed_len_feature(); + config_.fixed_len_feature_ = fixed_len_feature; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.FeatureConfiguration.fixed_len_feature) +} +void FeatureConfiguration::set_allocated_var_len_feature(::diplomacy::tensorflow::VarLenFeatureProto* var_len_feature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_config(); + if (var_len_feature) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(var_len_feature); + if (message_arena != submessage_arena) { + var_len_feature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, var_len_feature, submessage_arena); + } + set_has_var_len_feature(); + config_.var_len_feature_ = var_len_feature; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.FeatureConfiguration.var_len_feature) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FeatureConfiguration::kFixedLenFeatureFieldNumber; +const int FeatureConfiguration::kVarLenFeatureFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FeatureConfiguration::FeatureConfiguration() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FeatureConfiguration.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.FeatureConfiguration) +} +FeatureConfiguration::FeatureConfiguration(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FeatureConfiguration.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.FeatureConfiguration) +} +FeatureConfiguration::FeatureConfiguration(const FeatureConfiguration& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_config(); + switch (from.config_case()) { + case kFixedLenFeature: { + mutable_fixed_len_feature()->::diplomacy::tensorflow::FixedLenFeatureProto::MergeFrom(from.fixed_len_feature()); + break; + } + case kVarLenFeature: { + mutable_var_len_feature()->::diplomacy::tensorflow::VarLenFeatureProto::MergeFrom(from.var_len_feature()); + break; + } + case CONFIG_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.FeatureConfiguration) +} + +void FeatureConfiguration::SharedCtor() { + clear_has_config(); +} + +FeatureConfiguration::~FeatureConfiguration() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.FeatureConfiguration) + SharedDtor(); +} + +void FeatureConfiguration::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_config()) { + clear_config(); + } +} + +void FeatureConfiguration::ArenaDtor(void* object) { + FeatureConfiguration* _this = reinterpret_cast< FeatureConfiguration* >(object); + (void)_this; +} +void FeatureConfiguration::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FeatureConfiguration::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FeatureConfiguration::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FeatureConfiguration& FeatureConfiguration::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_FeatureConfiguration.base); + return *internal_default_instance(); +} + + +void FeatureConfiguration::clear_config() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.FeatureConfiguration) + switch (config_case()) { + case kFixedLenFeature: { + if (GetArenaNoVirtual() == NULL) { + delete config_.fixed_len_feature_; + } + break; + } + case kVarLenFeature: { + if (GetArenaNoVirtual() == NULL) { + delete config_.var_len_feature_; + } + break; + } + case CONFIG_NOT_SET: { + break; + } + } + _oneof_case_[0] = CONFIG_NOT_SET; +} + + +void FeatureConfiguration::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.FeatureConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_config(); + _internal_metadata_.Clear(); +} + +bool FeatureConfiguration::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.FeatureConfiguration) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_fixed_len_feature())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.VarLenFeatureProto var_len_feature = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_var_len_feature())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.FeatureConfiguration) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.FeatureConfiguration) + return false; +#undef DO_ +} + +void FeatureConfiguration::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.FeatureConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + if (has_fixed_len_feature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_fixed_len_feature(), output); + } + + // .diplomacy.tensorflow.VarLenFeatureProto var_len_feature = 2; + if (has_var_len_feature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_var_len_feature(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.FeatureConfiguration) +} + +::google::protobuf::uint8* FeatureConfiguration::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.FeatureConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + if (has_fixed_len_feature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_fixed_len_feature(), deterministic, target); + } + + // .diplomacy.tensorflow.VarLenFeatureProto var_len_feature = 2; + if (has_var_len_feature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_var_len_feature(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.FeatureConfiguration) + return target; +} + +size_t FeatureConfiguration::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.FeatureConfiguration) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (config_case()) { + // .diplomacy.tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + case kFixedLenFeature: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *config_.fixed_len_feature_); + break; + } + // .diplomacy.tensorflow.VarLenFeatureProto var_len_feature = 2; + case kVarLenFeature: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *config_.var_len_feature_); + break; + } + case CONFIG_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FeatureConfiguration::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.FeatureConfiguration) + GOOGLE_DCHECK_NE(&from, this); + const FeatureConfiguration* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.FeatureConfiguration) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.FeatureConfiguration) + MergeFrom(*source); + } +} + +void FeatureConfiguration::MergeFrom(const FeatureConfiguration& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.FeatureConfiguration) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.config_case()) { + case kFixedLenFeature: { + mutable_fixed_len_feature()->::diplomacy::tensorflow::FixedLenFeatureProto::MergeFrom(from.fixed_len_feature()); + break; + } + case kVarLenFeature: { + mutable_var_len_feature()->::diplomacy::tensorflow::VarLenFeatureProto::MergeFrom(from.var_len_feature()); + break; + } + case CONFIG_NOT_SET: { + break; + } + } +} + +void FeatureConfiguration::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.FeatureConfiguration) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FeatureConfiguration::CopyFrom(const FeatureConfiguration& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.FeatureConfiguration) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FeatureConfiguration::IsInitialized() const { + return true; +} + +void FeatureConfiguration::Swap(FeatureConfiguration* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FeatureConfiguration* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FeatureConfiguration::UnsafeArenaSwap(FeatureConfiguration* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FeatureConfiguration::InternalSwap(FeatureConfiguration* other) { + using std::swap; + swap(config_, other->config_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FeatureConfiguration::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +ExampleParserConfiguration_FeatureMapEntry_DoNotUse::ExampleParserConfiguration_FeatureMapEntry_DoNotUse() {} +ExampleParserConfiguration_FeatureMapEntry_DoNotUse::ExampleParserConfiguration_FeatureMapEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void ExampleParserConfiguration_FeatureMapEntry_DoNotUse::MergeFrom(const ExampleParserConfiguration_FeatureMapEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata ExampleParserConfiguration_FeatureMapEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[3]; +} +void ExampleParserConfiguration_FeatureMapEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void ExampleParserConfiguration::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExampleParserConfiguration::kFeatureMapFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExampleParserConfiguration::ExampleParserConfiguration() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_ExampleParserConfiguration.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ExampleParserConfiguration) +} +ExampleParserConfiguration::ExampleParserConfiguration(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + feature_map_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_ExampleParserConfiguration.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ExampleParserConfiguration) +} +ExampleParserConfiguration::ExampleParserConfiguration(const ExampleParserConfiguration& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + feature_map_.MergeFrom(from.feature_map_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ExampleParserConfiguration) +} + +void ExampleParserConfiguration::SharedCtor() { +} + +ExampleParserConfiguration::~ExampleParserConfiguration() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ExampleParserConfiguration) + SharedDtor(); +} + +void ExampleParserConfiguration::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ExampleParserConfiguration::ArenaDtor(void* object) { + ExampleParserConfiguration* _this = reinterpret_cast< ExampleParserConfiguration* >(object); + (void)_this; +} +void ExampleParserConfiguration::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ExampleParserConfiguration::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ExampleParserConfiguration::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ExampleParserConfiguration& ExampleParserConfiguration::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::scc_info_ExampleParserConfiguration.base); + return *internal_default_instance(); +} + + +void ExampleParserConfiguration::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ExampleParserConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feature_map_.Clear(); + _internal_metadata_.Clear(); +} + +bool ExampleParserConfiguration::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ExampleParserConfiguration) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map feature_map = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + ExampleParserConfiguration_FeatureMapEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + ExampleParserConfiguration_FeatureMapEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::FeatureConfiguration, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration > > parser(&feature_map_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ExampleParserConfiguration) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ExampleParserConfiguration) + return false; +#undef DO_ +} + +void ExampleParserConfiguration::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ExampleParserConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map feature_map = 1; + if (!this->feature_map().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->feature_map().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->feature_map().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::const_iterator + it = this->feature_map().begin(); + it != this->feature_map().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(feature_map_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::const_iterator + it = this->feature_map().begin(); + it != this->feature_map().end(); ++it) { + entry.reset(feature_map_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ExampleParserConfiguration) +} + +::google::protobuf::uint8* ExampleParserConfiguration::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ExampleParserConfiguration) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map feature_map = 1; + if (!this->feature_map().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry.key"); + } + }; + + if (deterministic && + this->feature_map().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->feature_map().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::const_iterator + it = this->feature_map().begin(); + it != this->feature_map().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(feature_map_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::const_iterator + it = this->feature_map().begin(); + it != this->feature_map().end(); ++it) { + entry.reset(feature_map_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ExampleParserConfiguration) + return target; +} + +size_t ExampleParserConfiguration::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ExampleParserConfiguration) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map feature_map = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->feature_map_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >::const_iterator + it = this->feature_map().begin(); + it != this->feature_map().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(feature_map_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ExampleParserConfiguration::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ExampleParserConfiguration) + GOOGLE_DCHECK_NE(&from, this); + const ExampleParserConfiguration* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ExampleParserConfiguration) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ExampleParserConfiguration) + MergeFrom(*source); + } +} + +void ExampleParserConfiguration::MergeFrom(const ExampleParserConfiguration& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ExampleParserConfiguration) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feature_map_.MergeFrom(from.feature_map_); +} + +void ExampleParserConfiguration::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ExampleParserConfiguration) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExampleParserConfiguration::CopyFrom(const ExampleParserConfiguration& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ExampleParserConfiguration) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExampleParserConfiguration::IsInitialized() const { + return true; +} + +void ExampleParserConfiguration::Swap(ExampleParserConfiguration* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ExampleParserConfiguration* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ExampleParserConfiguration::UnsafeArenaSwap(ExampleParserConfiguration* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ExampleParserConfiguration::InternalSwap(ExampleParserConfiguration* other) { + using std::swap; + feature_map_.Swap(&other->feature_map_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ExampleParserConfiguration::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::VarLenFeatureProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::VarLenFeatureProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::VarLenFeatureProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FixedLenFeatureProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FixedLenFeatureProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FixedLenFeatureProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FeatureConfiguration* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FeatureConfiguration >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FeatureConfiguration >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ExampleParserConfiguration* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ExampleParserConfiguration >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ExampleParserConfiguration >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.pb.h new file mode 100644 index 0000000..6412f3b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.pb.h @@ -0,0 +1,1411 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/example/example_parser_configuration.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/tensor.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[5]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto +namespace diplomacy { +namespace tensorflow { +class ExampleParserConfiguration; +class ExampleParserConfigurationDefaultTypeInternal; +extern ExampleParserConfigurationDefaultTypeInternal _ExampleParserConfiguration_default_instance_; +class ExampleParserConfiguration_FeatureMapEntry_DoNotUse; +class ExampleParserConfiguration_FeatureMapEntry_DoNotUseDefaultTypeInternal; +extern ExampleParserConfiguration_FeatureMapEntry_DoNotUseDefaultTypeInternal _ExampleParserConfiguration_FeatureMapEntry_DoNotUse_default_instance_; +class FeatureConfiguration; +class FeatureConfigurationDefaultTypeInternal; +extern FeatureConfigurationDefaultTypeInternal _FeatureConfiguration_default_instance_; +class FixedLenFeatureProto; +class FixedLenFeatureProtoDefaultTypeInternal; +extern FixedLenFeatureProtoDefaultTypeInternal _FixedLenFeatureProto_default_instance_; +class VarLenFeatureProto; +class VarLenFeatureProtoDefaultTypeInternal; +extern VarLenFeatureProtoDefaultTypeInternal _VarLenFeatureProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::ExampleParserConfiguration* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ExampleParserConfiguration>(Arena*); +template<> ::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ExampleParserConfiguration_FeatureMapEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::FeatureConfiguration* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FeatureConfiguration>(Arena*); +template<> ::diplomacy::tensorflow::FixedLenFeatureProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FixedLenFeatureProto>(Arena*); +template<> ::diplomacy::tensorflow::VarLenFeatureProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::VarLenFeatureProto>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class VarLenFeatureProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.VarLenFeatureProto) */ { + public: + VarLenFeatureProto(); + virtual ~VarLenFeatureProto(); + + VarLenFeatureProto(const VarLenFeatureProto& from); + + inline VarLenFeatureProto& operator=(const VarLenFeatureProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + VarLenFeatureProto(VarLenFeatureProto&& from) noexcept + : VarLenFeatureProto() { + *this = ::std::move(from); + } + + inline VarLenFeatureProto& operator=(VarLenFeatureProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const VarLenFeatureProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const VarLenFeatureProto* internal_default_instance() { + return reinterpret_cast( + &_VarLenFeatureProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(VarLenFeatureProto* other); + void Swap(VarLenFeatureProto* other); + friend void swap(VarLenFeatureProto& a, VarLenFeatureProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline VarLenFeatureProto* New() const final { + return CreateMaybeMessage(NULL); + } + + VarLenFeatureProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const VarLenFeatureProto& from); + void MergeFrom(const VarLenFeatureProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(VarLenFeatureProto* other); + protected: + explicit VarLenFeatureProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string values_output_tensor_name = 2; + void clear_values_output_tensor_name(); + static const int kValuesOutputTensorNameFieldNumber = 2; + const ::std::string& values_output_tensor_name() const; + void set_values_output_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_values_output_tensor_name(::std::string&& value); + #endif + void set_values_output_tensor_name(const char* value); + void set_values_output_tensor_name(const char* value, size_t size); + ::std::string* mutable_values_output_tensor_name(); + ::std::string* release_values_output_tensor_name(); + void set_allocated_values_output_tensor_name(::std::string* values_output_tensor_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_values_output_tensor_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_values_output_tensor_name( + ::std::string* values_output_tensor_name); + + // string indices_output_tensor_name = 3; + void clear_indices_output_tensor_name(); + static const int kIndicesOutputTensorNameFieldNumber = 3; + const ::std::string& indices_output_tensor_name() const; + void set_indices_output_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_indices_output_tensor_name(::std::string&& value); + #endif + void set_indices_output_tensor_name(const char* value); + void set_indices_output_tensor_name(const char* value, size_t size); + ::std::string* mutable_indices_output_tensor_name(); + ::std::string* release_indices_output_tensor_name(); + void set_allocated_indices_output_tensor_name(::std::string* indices_output_tensor_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_indices_output_tensor_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_indices_output_tensor_name( + ::std::string* indices_output_tensor_name); + + // string shapes_output_tensor_name = 4; + void clear_shapes_output_tensor_name(); + static const int kShapesOutputTensorNameFieldNumber = 4; + const ::std::string& shapes_output_tensor_name() const; + void set_shapes_output_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_shapes_output_tensor_name(::std::string&& value); + #endif + void set_shapes_output_tensor_name(const char* value); + void set_shapes_output_tensor_name(const char* value, size_t size); + ::std::string* mutable_shapes_output_tensor_name(); + ::std::string* release_shapes_output_tensor_name(); + void set_allocated_shapes_output_tensor_name(::std::string* shapes_output_tensor_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_shapes_output_tensor_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_shapes_output_tensor_name( + ::std::string* shapes_output_tensor_name); + + // .diplomacy.tensorflow.DataType dtype = 1; + void clear_dtype(); + static const int kDtypeFieldNumber = 1; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VarLenFeatureProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr values_output_tensor_name_; + ::google::protobuf::internal::ArenaStringPtr indices_output_tensor_name_; + ::google::protobuf::internal::ArenaStringPtr shapes_output_tensor_name_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FixedLenFeatureProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.FixedLenFeatureProto) */ { + public: + FixedLenFeatureProto(); + virtual ~FixedLenFeatureProto(); + + FixedLenFeatureProto(const FixedLenFeatureProto& from); + + inline FixedLenFeatureProto& operator=(const FixedLenFeatureProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FixedLenFeatureProto(FixedLenFeatureProto&& from) noexcept + : FixedLenFeatureProto() { + *this = ::std::move(from); + } + + inline FixedLenFeatureProto& operator=(FixedLenFeatureProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FixedLenFeatureProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FixedLenFeatureProto* internal_default_instance() { + return reinterpret_cast( + &_FixedLenFeatureProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(FixedLenFeatureProto* other); + void Swap(FixedLenFeatureProto* other); + friend void swap(FixedLenFeatureProto& a, FixedLenFeatureProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FixedLenFeatureProto* New() const final { + return CreateMaybeMessage(NULL); + } + + FixedLenFeatureProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FixedLenFeatureProto& from); + void MergeFrom(const FixedLenFeatureProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FixedLenFeatureProto* other); + protected: + explicit FixedLenFeatureProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string values_output_tensor_name = 4; + void clear_values_output_tensor_name(); + static const int kValuesOutputTensorNameFieldNumber = 4; + const ::std::string& values_output_tensor_name() const; + void set_values_output_tensor_name(const ::std::string& value); + #if LANG_CXX11 + void set_values_output_tensor_name(::std::string&& value); + #endif + void set_values_output_tensor_name(const char* value); + void set_values_output_tensor_name(const char* value, size_t size); + ::std::string* mutable_values_output_tensor_name(); + ::std::string* release_values_output_tensor_name(); + void set_allocated_values_output_tensor_name(::std::string* values_output_tensor_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_values_output_tensor_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_values_output_tensor_name( + ::std::string* values_output_tensor_name); + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // .diplomacy.tensorflow.TensorProto default_value = 3; + bool has_default_value() const; + void clear_default_value(); + static const int kDefaultValueFieldNumber = 3; + private: + const ::diplomacy::tensorflow::TensorProto& _internal_default_value() const; + public: + const ::diplomacy::tensorflow::TensorProto& default_value() const; + ::diplomacy::tensorflow::TensorProto* release_default_value(); + ::diplomacy::tensorflow::TensorProto* mutable_default_value(); + void set_allocated_default_value(::diplomacy::tensorflow::TensorProto* default_value); + void unsafe_arena_set_allocated_default_value( + ::diplomacy::tensorflow::TensorProto* default_value); + ::diplomacy::tensorflow::TensorProto* unsafe_arena_release_default_value(); + + // .diplomacy.tensorflow.DataType dtype = 1; + void clear_dtype(); + static const int kDtypeFieldNumber = 1; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FixedLenFeatureProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr values_output_tensor_name_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + ::diplomacy::tensorflow::TensorProto* default_value_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FeatureConfiguration : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.FeatureConfiguration) */ { + public: + FeatureConfiguration(); + virtual ~FeatureConfiguration(); + + FeatureConfiguration(const FeatureConfiguration& from); + + inline FeatureConfiguration& operator=(const FeatureConfiguration& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FeatureConfiguration(FeatureConfiguration&& from) noexcept + : FeatureConfiguration() { + *this = ::std::move(from); + } + + inline FeatureConfiguration& operator=(FeatureConfiguration&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FeatureConfiguration& default_instance(); + + enum ConfigCase { + kFixedLenFeature = 1, + kVarLenFeature = 2, + CONFIG_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FeatureConfiguration* internal_default_instance() { + return reinterpret_cast( + &_FeatureConfiguration_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(FeatureConfiguration* other); + void Swap(FeatureConfiguration* other); + friend void swap(FeatureConfiguration& a, FeatureConfiguration& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FeatureConfiguration* New() const final { + return CreateMaybeMessage(NULL); + } + + FeatureConfiguration* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FeatureConfiguration& from); + void MergeFrom(const FeatureConfiguration& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FeatureConfiguration* other); + protected: + explicit FeatureConfiguration(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + bool has_fixed_len_feature() const; + void clear_fixed_len_feature(); + static const int kFixedLenFeatureFieldNumber = 1; + private: + const ::diplomacy::tensorflow::FixedLenFeatureProto& _internal_fixed_len_feature() const; + public: + const ::diplomacy::tensorflow::FixedLenFeatureProto& fixed_len_feature() const; + ::diplomacy::tensorflow::FixedLenFeatureProto* release_fixed_len_feature(); + ::diplomacy::tensorflow::FixedLenFeatureProto* mutable_fixed_len_feature(); + void set_allocated_fixed_len_feature(::diplomacy::tensorflow::FixedLenFeatureProto* fixed_len_feature); + void unsafe_arena_set_allocated_fixed_len_feature( + ::diplomacy::tensorflow::FixedLenFeatureProto* fixed_len_feature); + ::diplomacy::tensorflow::FixedLenFeatureProto* unsafe_arena_release_fixed_len_feature(); + + // .diplomacy.tensorflow.VarLenFeatureProto var_len_feature = 2; + bool has_var_len_feature() const; + void clear_var_len_feature(); + static const int kVarLenFeatureFieldNumber = 2; + private: + const ::diplomacy::tensorflow::VarLenFeatureProto& _internal_var_len_feature() const; + public: + const ::diplomacy::tensorflow::VarLenFeatureProto& var_len_feature() const; + ::diplomacy::tensorflow::VarLenFeatureProto* release_var_len_feature(); + ::diplomacy::tensorflow::VarLenFeatureProto* mutable_var_len_feature(); + void set_allocated_var_len_feature(::diplomacy::tensorflow::VarLenFeatureProto* var_len_feature); + void unsafe_arena_set_allocated_var_len_feature( + ::diplomacy::tensorflow::VarLenFeatureProto* var_len_feature); + ::diplomacy::tensorflow::VarLenFeatureProto* unsafe_arena_release_var_len_feature(); + + void clear_config(); + ConfigCase config_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FeatureConfiguration) + private: + void set_has_fixed_len_feature(); + void set_has_var_len_feature(); + + inline bool has_config() const; + inline void clear_has_config(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union ConfigUnion { + ConfigUnion() {} + ::diplomacy::tensorflow::FixedLenFeatureProto* fixed_len_feature_; + ::diplomacy::tensorflow::VarLenFeatureProto* var_len_feature_; + } config_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ExampleParserConfiguration_FeatureMapEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + ExampleParserConfiguration_FeatureMapEntry_DoNotUse(); + ExampleParserConfiguration_FeatureMapEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const ExampleParserConfiguration_FeatureMapEntry_DoNotUse& other); + static const ExampleParserConfiguration_FeatureMapEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_ExampleParserConfiguration_FeatureMapEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class ExampleParserConfiguration : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ExampleParserConfiguration) */ { + public: + ExampleParserConfiguration(); + virtual ~ExampleParserConfiguration(); + + ExampleParserConfiguration(const ExampleParserConfiguration& from); + + inline ExampleParserConfiguration& operator=(const ExampleParserConfiguration& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ExampleParserConfiguration(ExampleParserConfiguration&& from) noexcept + : ExampleParserConfiguration() { + *this = ::std::move(from); + } + + inline ExampleParserConfiguration& operator=(ExampleParserConfiguration&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ExampleParserConfiguration& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ExampleParserConfiguration* internal_default_instance() { + return reinterpret_cast( + &_ExampleParserConfiguration_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(ExampleParserConfiguration* other); + void Swap(ExampleParserConfiguration* other); + friend void swap(ExampleParserConfiguration& a, ExampleParserConfiguration& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ExampleParserConfiguration* New() const final { + return CreateMaybeMessage(NULL); + } + + ExampleParserConfiguration* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ExampleParserConfiguration& from); + void MergeFrom(const ExampleParserConfiguration& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ExampleParserConfiguration* other); + protected: + explicit ExampleParserConfiguration(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map feature_map = 1; + int feature_map_size() const; + void clear_feature_map(); + static const int kFeatureMapFieldNumber = 1; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >& + feature_map() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >* + mutable_feature_map(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ExampleParserConfiguration) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + ExampleParserConfiguration_FeatureMapEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::FeatureConfiguration, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > feature_map_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// VarLenFeatureProto + +// .diplomacy.tensorflow.DataType dtype = 1; +inline void VarLenFeatureProto::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType VarLenFeatureProto::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VarLenFeatureProto.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void VarLenFeatureProto::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VarLenFeatureProto.dtype) +} + +// string values_output_tensor_name = 2; +inline void VarLenFeatureProto::clear_values_output_tensor_name() { + values_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VarLenFeatureProto::values_output_tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) + return values_output_tensor_name_.Get(); +} +inline void VarLenFeatureProto::set_values_output_tensor_name(const ::std::string& value) { + + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) +} +#if LANG_CXX11 +inline void VarLenFeatureProto::set_values_output_tensor_name(::std::string&& value) { + + values_output_tensor_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) +} +#endif +inline void VarLenFeatureProto::set_values_output_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) +} +inline void VarLenFeatureProto::set_values_output_tensor_name(const char* value, + size_t size) { + + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) +} +inline ::std::string* VarLenFeatureProto::mutable_values_output_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) + return values_output_tensor_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VarLenFeatureProto::release_values_output_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) + + return values_output_tensor_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VarLenFeatureProto::set_allocated_values_output_tensor_name(::std::string* values_output_tensor_name) { + if (values_output_tensor_name != NULL) { + + } else { + + } + values_output_tensor_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), values_output_tensor_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) +} +inline ::std::string* VarLenFeatureProto::unsafe_arena_release_values_output_tensor_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return values_output_tensor_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VarLenFeatureProto::unsafe_arena_set_allocated_values_output_tensor_name( + ::std::string* values_output_tensor_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (values_output_tensor_name != NULL) { + + } else { + + } + values_output_tensor_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + values_output_tensor_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name) +} + +// string indices_output_tensor_name = 3; +inline void VarLenFeatureProto::clear_indices_output_tensor_name() { + indices_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VarLenFeatureProto::indices_output_tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) + return indices_output_tensor_name_.Get(); +} +inline void VarLenFeatureProto::set_indices_output_tensor_name(const ::std::string& value) { + + indices_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) +} +#if LANG_CXX11 +inline void VarLenFeatureProto::set_indices_output_tensor_name(::std::string&& value) { + + indices_output_tensor_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) +} +#endif +inline void VarLenFeatureProto::set_indices_output_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + indices_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) +} +inline void VarLenFeatureProto::set_indices_output_tensor_name(const char* value, + size_t size) { + + indices_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) +} +inline ::std::string* VarLenFeatureProto::mutable_indices_output_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) + return indices_output_tensor_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VarLenFeatureProto::release_indices_output_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) + + return indices_output_tensor_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VarLenFeatureProto::set_allocated_indices_output_tensor_name(::std::string* indices_output_tensor_name) { + if (indices_output_tensor_name != NULL) { + + } else { + + } + indices_output_tensor_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), indices_output_tensor_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) +} +inline ::std::string* VarLenFeatureProto::unsafe_arena_release_indices_output_tensor_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return indices_output_tensor_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VarLenFeatureProto::unsafe_arena_set_allocated_indices_output_tensor_name( + ::std::string* indices_output_tensor_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (indices_output_tensor_name != NULL) { + + } else { + + } + indices_output_tensor_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + indices_output_tensor_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name) +} + +// string shapes_output_tensor_name = 4; +inline void VarLenFeatureProto::clear_shapes_output_tensor_name() { + shapes_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VarLenFeatureProto::shapes_output_tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) + return shapes_output_tensor_name_.Get(); +} +inline void VarLenFeatureProto::set_shapes_output_tensor_name(const ::std::string& value) { + + shapes_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) +} +#if LANG_CXX11 +inline void VarLenFeatureProto::set_shapes_output_tensor_name(::std::string&& value) { + + shapes_output_tensor_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) +} +#endif +inline void VarLenFeatureProto::set_shapes_output_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + shapes_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) +} +inline void VarLenFeatureProto::set_shapes_output_tensor_name(const char* value, + size_t size) { + + shapes_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) +} +inline ::std::string* VarLenFeatureProto::mutable_shapes_output_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) + return shapes_output_tensor_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VarLenFeatureProto::release_shapes_output_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) + + return shapes_output_tensor_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VarLenFeatureProto::set_allocated_shapes_output_tensor_name(::std::string* shapes_output_tensor_name) { + if (shapes_output_tensor_name != NULL) { + + } else { + + } + shapes_output_tensor_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), shapes_output_tensor_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) +} +inline ::std::string* VarLenFeatureProto::unsafe_arena_release_shapes_output_tensor_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return shapes_output_tensor_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VarLenFeatureProto::unsafe_arena_set_allocated_shapes_output_tensor_name( + ::std::string* shapes_output_tensor_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (shapes_output_tensor_name != NULL) { + + } else { + + } + shapes_output_tensor_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + shapes_output_tensor_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name) +} + +// ------------------------------------------------------------------- + +// FixedLenFeatureProto + +// .diplomacy.tensorflow.DataType dtype = 1; +inline void FixedLenFeatureProto::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType FixedLenFeatureProto::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FixedLenFeatureProto.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void FixedLenFeatureProto::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.FixedLenFeatureProto.dtype) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 2; +inline bool FixedLenFeatureProto::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& FixedLenFeatureProto::_internal_shape() const { + return *shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& FixedLenFeatureProto::shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FixedLenFeatureProto.shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* FixedLenFeatureProto::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.FixedLenFeatureProto.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* FixedLenFeatureProto::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.FixedLenFeatureProto.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* FixedLenFeatureProto::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FixedLenFeatureProto.shape) + return shape_; +} +inline void FixedLenFeatureProto::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.FixedLenFeatureProto.shape) +} + +// .diplomacy.tensorflow.TensorProto default_value = 3; +inline bool FixedLenFeatureProto::has_default_value() const { + return this != internal_default_instance() && default_value_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorProto& FixedLenFeatureProto::_internal_default_value() const { + return *default_value_; +} +inline const ::diplomacy::tensorflow::TensorProto& FixedLenFeatureProto::default_value() const { + const ::diplomacy::tensorflow::TensorProto* p = default_value_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FixedLenFeatureProto.default_value) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorProto* FixedLenFeatureProto::release_default_value() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.FixedLenFeatureProto.default_value) + + ::diplomacy::tensorflow::TensorProto* temp = default_value_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + default_value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorProto* FixedLenFeatureProto::unsafe_arena_release_default_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.FixedLenFeatureProto.default_value) + + ::diplomacy::tensorflow::TensorProto* temp = default_value_; + default_value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorProto* FixedLenFeatureProto::mutable_default_value() { + + if (default_value_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorProto>(GetArenaNoVirtual()); + default_value_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FixedLenFeatureProto.default_value) + return default_value_; +} +inline void FixedLenFeatureProto::set_allocated_default_value(::diplomacy::tensorflow::TensorProto* default_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(default_value_); + } + if (default_value) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(default_value)->GetArena(); + if (message_arena != submessage_arena) { + default_value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, default_value, submessage_arena); + } + + } else { + + } + default_value_ = default_value; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.FixedLenFeatureProto.default_value) +} + +// string values_output_tensor_name = 4; +inline void FixedLenFeatureProto::clear_values_output_tensor_name() { + values_output_tensor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& FixedLenFeatureProto::values_output_tensor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) + return values_output_tensor_name_.Get(); +} +inline void FixedLenFeatureProto::set_values_output_tensor_name(const ::std::string& value) { + + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) +} +#if LANG_CXX11 +inline void FixedLenFeatureProto::set_values_output_tensor_name(::std::string&& value) { + + values_output_tensor_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) +} +#endif +inline void FixedLenFeatureProto::set_values_output_tensor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) +} +inline void FixedLenFeatureProto::set_values_output_tensor_name(const char* value, + size_t size) { + + values_output_tensor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) +} +inline ::std::string* FixedLenFeatureProto::mutable_values_output_tensor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) + return values_output_tensor_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FixedLenFeatureProto::release_values_output_tensor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) + + return values_output_tensor_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void FixedLenFeatureProto::set_allocated_values_output_tensor_name(::std::string* values_output_tensor_name) { + if (values_output_tensor_name != NULL) { + + } else { + + } + values_output_tensor_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), values_output_tensor_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) +} +inline ::std::string* FixedLenFeatureProto::unsafe_arena_release_values_output_tensor_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return values_output_tensor_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void FixedLenFeatureProto::unsafe_arena_set_allocated_values_output_tensor_name( + ::std::string* values_output_tensor_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (values_output_tensor_name != NULL) { + + } else { + + } + values_output_tensor_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + values_output_tensor_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name) +} + +// ------------------------------------------------------------------- + +// FeatureConfiguration + +// .diplomacy.tensorflow.FixedLenFeatureProto fixed_len_feature = 1; +inline bool FeatureConfiguration::has_fixed_len_feature() const { + return config_case() == kFixedLenFeature; +} +inline void FeatureConfiguration::set_has_fixed_len_feature() { + _oneof_case_[0] = kFixedLenFeature; +} +inline void FeatureConfiguration::clear_fixed_len_feature() { + if (has_fixed_len_feature()) { + if (GetArenaNoVirtual() == NULL) { + delete config_.fixed_len_feature_; + } + clear_has_config(); + } +} +inline const ::diplomacy::tensorflow::FixedLenFeatureProto& FeatureConfiguration::_internal_fixed_len_feature() const { + return *config_.fixed_len_feature_; +} +inline ::diplomacy::tensorflow::FixedLenFeatureProto* FeatureConfiguration::release_fixed_len_feature() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.FeatureConfiguration.fixed_len_feature) + if (has_fixed_len_feature()) { + clear_has_config(); + ::diplomacy::tensorflow::FixedLenFeatureProto* temp = config_.fixed_len_feature_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + config_.fixed_len_feature_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::FixedLenFeatureProto& FeatureConfiguration::fixed_len_feature() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FeatureConfiguration.fixed_len_feature) + return has_fixed_len_feature() + ? *config_.fixed_len_feature_ + : *reinterpret_cast< ::diplomacy::tensorflow::FixedLenFeatureProto*>(&::diplomacy::tensorflow::_FixedLenFeatureProto_default_instance_); +} +inline ::diplomacy::tensorflow::FixedLenFeatureProto* FeatureConfiguration::unsafe_arena_release_fixed_len_feature() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.FeatureConfiguration.fixed_len_feature) + if (has_fixed_len_feature()) { + clear_has_config(); + ::diplomacy::tensorflow::FixedLenFeatureProto* temp = config_.fixed_len_feature_; + config_.fixed_len_feature_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void FeatureConfiguration::unsafe_arena_set_allocated_fixed_len_feature(::diplomacy::tensorflow::FixedLenFeatureProto* fixed_len_feature) { + clear_config(); + if (fixed_len_feature) { + set_has_fixed_len_feature(); + config_.fixed_len_feature_ = fixed_len_feature; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.FeatureConfiguration.fixed_len_feature) +} +inline ::diplomacy::tensorflow::FixedLenFeatureProto* FeatureConfiguration::mutable_fixed_len_feature() { + if (!has_fixed_len_feature()) { + clear_config(); + set_has_fixed_len_feature(); + config_.fixed_len_feature_ = CreateMaybeMessage< ::diplomacy::tensorflow::FixedLenFeatureProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FeatureConfiguration.fixed_len_feature) + return config_.fixed_len_feature_; +} + +// .diplomacy.tensorflow.VarLenFeatureProto var_len_feature = 2; +inline bool FeatureConfiguration::has_var_len_feature() const { + return config_case() == kVarLenFeature; +} +inline void FeatureConfiguration::set_has_var_len_feature() { + _oneof_case_[0] = kVarLenFeature; +} +inline void FeatureConfiguration::clear_var_len_feature() { + if (has_var_len_feature()) { + if (GetArenaNoVirtual() == NULL) { + delete config_.var_len_feature_; + } + clear_has_config(); + } +} +inline const ::diplomacy::tensorflow::VarLenFeatureProto& FeatureConfiguration::_internal_var_len_feature() const { + return *config_.var_len_feature_; +} +inline ::diplomacy::tensorflow::VarLenFeatureProto* FeatureConfiguration::release_var_len_feature() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.FeatureConfiguration.var_len_feature) + if (has_var_len_feature()) { + clear_has_config(); + ::diplomacy::tensorflow::VarLenFeatureProto* temp = config_.var_len_feature_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + config_.var_len_feature_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::VarLenFeatureProto& FeatureConfiguration::var_len_feature() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FeatureConfiguration.var_len_feature) + return has_var_len_feature() + ? *config_.var_len_feature_ + : *reinterpret_cast< ::diplomacy::tensorflow::VarLenFeatureProto*>(&::diplomacy::tensorflow::_VarLenFeatureProto_default_instance_); +} +inline ::diplomacy::tensorflow::VarLenFeatureProto* FeatureConfiguration::unsafe_arena_release_var_len_feature() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.FeatureConfiguration.var_len_feature) + if (has_var_len_feature()) { + clear_has_config(); + ::diplomacy::tensorflow::VarLenFeatureProto* temp = config_.var_len_feature_; + config_.var_len_feature_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void FeatureConfiguration::unsafe_arena_set_allocated_var_len_feature(::diplomacy::tensorflow::VarLenFeatureProto* var_len_feature) { + clear_config(); + if (var_len_feature) { + set_has_var_len_feature(); + config_.var_len_feature_ = var_len_feature; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.FeatureConfiguration.var_len_feature) +} +inline ::diplomacy::tensorflow::VarLenFeatureProto* FeatureConfiguration::mutable_var_len_feature() { + if (!has_var_len_feature()) { + clear_config(); + set_has_var_len_feature(); + config_.var_len_feature_ = CreateMaybeMessage< ::diplomacy::tensorflow::VarLenFeatureProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FeatureConfiguration.var_len_feature) + return config_.var_len_feature_; +} + +inline bool FeatureConfiguration::has_config() const { + return config_case() != CONFIG_NOT_SET; +} +inline void FeatureConfiguration::clear_has_config() { + _oneof_case_[0] = CONFIG_NOT_SET; +} +inline FeatureConfiguration::ConfigCase FeatureConfiguration::config_case() const { + return FeatureConfiguration::ConfigCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ExampleParserConfiguration + +// map feature_map = 1; +inline int ExampleParserConfiguration::feature_map_size() const { + return feature_map_.size(); +} +inline void ExampleParserConfiguration::clear_feature_map() { + feature_map_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >& +ExampleParserConfiguration::feature_map() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.ExampleParserConfiguration.feature_map) + return feature_map_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureConfiguration >* +ExampleParserConfiguration::mutable_feature_map() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.ExampleParserConfiguration.feature_map) + return feature_map_.MutableMap(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2fexample_5fparser_5fconfiguration_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.proto new file mode 100644 index 0000000..befa5aa --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration.proto @@ -0,0 +1,39 @@ +// Protocol messages for describing the configuration of the ExampleParserOp. + +syntax = "proto3"; + +option cc_enable_arenas = true; +option java_outer_classname = "ExampleParserConfigurationProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.example"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example"; +package diplomacy.tensorflow; + +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/tensor.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +message VarLenFeatureProto { + tensorflow.DataType dtype = 1; + string values_output_tensor_name = 2; + string indices_output_tensor_name = 3; + string shapes_output_tensor_name = 4; +}; + +message FixedLenFeatureProto { + tensorflow.DataType dtype = 1; + tensorflow.TensorShapeProto shape = 2; + tensorflow.TensorProto default_value = 3; + string values_output_tensor_name = 4; +}; + +message FeatureConfiguration { + oneof config { + FixedLenFeatureProto fixed_len_feature = 1; + VarLenFeatureProto var_len_feature = 2; + } +}; + +message ExampleParserConfiguration { + map feature_map = 1; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration_pb2.py new file mode 100644 index 0000000..9952749 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_parser_configuration_pb2.py @@ -0,0 +1,304 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/example/example_parser_configuration.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import tensor_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/example/example_parser_configuration.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\026org.tensorflow.exampleB ExampleParserConfigurationProtosP\001Z;github.com/tensorflow/tensorflow/tensorflow/go/core/example\370\001\001'), + serialized_pb=_b('\nDdiplomacy_tensorflow/core/example/example_parser_configuration.proto\x12\x14\x64iplomacy.tensorflow\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a\x30\x64iplomacy_tensorflow/core/framework/tensor.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"\xad\x01\n\x12VarLenFeatureProto\x12-\n\x05\x64type\x18\x01 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\x12!\n\x19values_output_tensor_name\x18\x02 \x01(\t\x12\"\n\x1aindices_output_tensor_name\x18\x03 \x01(\t\x12!\n\x19shapes_output_tensor_name\x18\x04 \x01(\t\"\xd9\x01\n\x14\x46ixedLenFeatureProto\x12-\n\x05\x64type\x18\x01 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\x12\x35\n\x05shape\x18\x02 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProto\x12\x38\n\rdefault_value\x18\x03 \x01(\x0b\x32!.diplomacy.tensorflow.TensorProto\x12!\n\x19values_output_tensor_name\x18\x04 \x01(\t\"\xae\x01\n\x14\x46\x65\x61tureConfiguration\x12G\n\x11\x66ixed_len_feature\x18\x01 \x01(\x0b\x32*.diplomacy.tensorflow.FixedLenFeatureProtoH\x00\x12\x43\n\x0fvar_len_feature\x18\x02 \x01(\x0b\x32(.diplomacy.tensorflow.VarLenFeatureProtoH\x00\x42\x08\n\x06\x63onfig\"\xd2\x01\n\x1a\x45xampleParserConfiguration\x12U\n\x0b\x66\x65\x61ture_map\x18\x01 \x03(\x0b\x32@.diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry\x1a]\n\x0f\x46\x65\x61tureMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.diplomacy.tensorflow.FeatureConfiguration:\x02\x38\x01\x42|\n\x16org.tensorflow.exampleB ExampleParserConfigurationProtosP\x01Z;github.com/tensorflow/tensorflow/tensorflow/go/core/example\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + + +_VARLENFEATUREPROTO = _descriptor.Descriptor( + name='VarLenFeatureProto', + full_name='diplomacy.tensorflow.VarLenFeatureProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.VarLenFeatureProto.dtype', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='values_output_tensor_name', full_name='diplomacy.tensorflow.VarLenFeatureProto.values_output_tensor_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='indices_output_tensor_name', full_name='diplomacy.tensorflow.VarLenFeatureProto.indices_output_tensor_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shapes_output_tensor_name', full_name='diplomacy.tensorflow.VarLenFeatureProto.shapes_output_tensor_name', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=250, + serialized_end=423, +) + + +_FIXEDLENFEATUREPROTO = _descriptor.Descriptor( + name='FixedLenFeatureProto', + full_name='diplomacy.tensorflow.FixedLenFeatureProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.FixedLenFeatureProto.dtype', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.FixedLenFeatureProto.shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default_value', full_name='diplomacy.tensorflow.FixedLenFeatureProto.default_value', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='values_output_tensor_name', full_name='diplomacy.tensorflow.FixedLenFeatureProto.values_output_tensor_name', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=426, + serialized_end=643, +) + + +_FEATURECONFIGURATION = _descriptor.Descriptor( + name='FeatureConfiguration', + full_name='diplomacy.tensorflow.FeatureConfiguration', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='fixed_len_feature', full_name='diplomacy.tensorflow.FeatureConfiguration.fixed_len_feature', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='var_len_feature', full_name='diplomacy.tensorflow.FeatureConfiguration.var_len_feature', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='config', full_name='diplomacy.tensorflow.FeatureConfiguration.config', + index=0, containing_type=None, fields=[]), + ], + serialized_start=646, + serialized_end=820, +) + + +_EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY = _descriptor.Descriptor( + name='FeatureMapEntry', + full_name='diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=940, + serialized_end=1033, +) + +_EXAMPLEPARSERCONFIGURATION = _descriptor.Descriptor( + name='ExampleParserConfiguration', + full_name='diplomacy.tensorflow.ExampleParserConfiguration', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_map', full_name='diplomacy.tensorflow.ExampleParserConfiguration.feature_map', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=823, + serialized_end=1033, +) + +_VARLENFEATUREPROTO.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_FIXEDLENFEATUREPROTO.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_FIXEDLENFEATUREPROTO.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_FIXEDLENFEATUREPROTO.fields_by_name['default_value'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2._TENSORPROTO +_FEATURECONFIGURATION.fields_by_name['fixed_len_feature'].message_type = _FIXEDLENFEATUREPROTO +_FEATURECONFIGURATION.fields_by_name['var_len_feature'].message_type = _VARLENFEATUREPROTO +_FEATURECONFIGURATION.oneofs_by_name['config'].fields.append( + _FEATURECONFIGURATION.fields_by_name['fixed_len_feature']) +_FEATURECONFIGURATION.fields_by_name['fixed_len_feature'].containing_oneof = _FEATURECONFIGURATION.oneofs_by_name['config'] +_FEATURECONFIGURATION.oneofs_by_name['config'].fields.append( + _FEATURECONFIGURATION.fields_by_name['var_len_feature']) +_FEATURECONFIGURATION.fields_by_name['var_len_feature'].containing_oneof = _FEATURECONFIGURATION.oneofs_by_name['config'] +_EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY.fields_by_name['value'].message_type = _FEATURECONFIGURATION +_EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY.containing_type = _EXAMPLEPARSERCONFIGURATION +_EXAMPLEPARSERCONFIGURATION.fields_by_name['feature_map'].message_type = _EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY +DESCRIPTOR.message_types_by_name['VarLenFeatureProto'] = _VARLENFEATUREPROTO +DESCRIPTOR.message_types_by_name['FixedLenFeatureProto'] = _FIXEDLENFEATUREPROTO +DESCRIPTOR.message_types_by_name['FeatureConfiguration'] = _FEATURECONFIGURATION +DESCRIPTOR.message_types_by_name['ExampleParserConfiguration'] = _EXAMPLEPARSERCONFIGURATION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +VarLenFeatureProto = _reflection.GeneratedProtocolMessageType('VarLenFeatureProto', (_message.Message,), dict( + DESCRIPTOR = _VARLENFEATUREPROTO, + __module__ = 'diplomacy_tensorflow.core.example.example_parser_configuration_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VarLenFeatureProto) + )) +_sym_db.RegisterMessage(VarLenFeatureProto) + +FixedLenFeatureProto = _reflection.GeneratedProtocolMessageType('FixedLenFeatureProto', (_message.Message,), dict( + DESCRIPTOR = _FIXEDLENFEATUREPROTO, + __module__ = 'diplomacy_tensorflow.core.example.example_parser_configuration_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FixedLenFeatureProto) + )) +_sym_db.RegisterMessage(FixedLenFeatureProto) + +FeatureConfiguration = _reflection.GeneratedProtocolMessageType('FeatureConfiguration', (_message.Message,), dict( + DESCRIPTOR = _FEATURECONFIGURATION, + __module__ = 'diplomacy_tensorflow.core.example.example_parser_configuration_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FeatureConfiguration) + )) +_sym_db.RegisterMessage(FeatureConfiguration) + +ExampleParserConfiguration = _reflection.GeneratedProtocolMessageType('ExampleParserConfiguration', (_message.Message,), dict( + + FeatureMapEntry = _reflection.GeneratedProtocolMessageType('FeatureMapEntry', (_message.Message,), dict( + DESCRIPTOR = _EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY, + __module__ = 'diplomacy_tensorflow.core.example.example_parser_configuration_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ExampleParserConfiguration.FeatureMapEntry) + )) + , + DESCRIPTOR = _EXAMPLEPARSERCONFIGURATION, + __module__ = 'diplomacy_tensorflow.core.example.example_parser_configuration_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ExampleParserConfiguration) + )) +_sym_db.RegisterMessage(ExampleParserConfiguration) +_sym_db.RegisterMessage(ExampleParserConfiguration.FeatureMapEntry) + + +DESCRIPTOR._options = None +_EXAMPLEPARSERCONFIGURATION_FEATUREMAPENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_pb2.py new file mode 100644 index 0000000..98cba9f --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/example_pb2.py @@ -0,0 +1,121 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/example/example.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.example import feature_pb2 as diplomacy__tensorflow_dot_core_dot_example_dot_feature__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/example/example.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\026org.tensorflow.exampleB\rExampleProtosP\001Z;github.com/tensorflow/tensorflow/tensorflow/go/core/example\370\001\001'), + serialized_pb=_b('\n/diplomacy_tensorflow/core/example/example.proto\x12\x14\x64iplomacy.tensorflow\x1a/diplomacy_tensorflow/core/example/feature.proto\";\n\x07\x45xample\x12\x30\n\x08\x66\x65\x61tures\x18\x01 \x01(\x0b\x32\x1e.diplomacy.tensorflow.Features\"}\n\x0fSequenceExample\x12/\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x1e.diplomacy.tensorflow.Features\x12\x39\n\rfeature_lists\x18\x02 \x01(\x0b\x32\".diplomacy.tensorflow.FeatureListsBi\n\x16org.tensorflow.exampleB\rExampleProtosP\x01Z;github.com/tensorflow/tensorflow/tensorflow/go/core/example\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_example_dot_feature__pb2.DESCRIPTOR,]) + + + + +_EXAMPLE = _descriptor.Descriptor( + name='Example', + full_name='diplomacy.tensorflow.Example', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='features', full_name='diplomacy.tensorflow.Example.features', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=122, + serialized_end=181, +) + + +_SEQUENCEEXAMPLE = _descriptor.Descriptor( + name='SequenceExample', + full_name='diplomacy.tensorflow.SequenceExample', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='context', full_name='diplomacy.tensorflow.SequenceExample.context', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='feature_lists', full_name='diplomacy.tensorflow.SequenceExample.feature_lists', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=183, + serialized_end=308, +) + +_EXAMPLE.fields_by_name['features'].message_type = diplomacy__tensorflow_dot_core_dot_example_dot_feature__pb2._FEATURES +_SEQUENCEEXAMPLE.fields_by_name['context'].message_type = diplomacy__tensorflow_dot_core_dot_example_dot_feature__pb2._FEATURES +_SEQUENCEEXAMPLE.fields_by_name['feature_lists'].message_type = diplomacy__tensorflow_dot_core_dot_example_dot_feature__pb2._FEATURELISTS +DESCRIPTOR.message_types_by_name['Example'] = _EXAMPLE +DESCRIPTOR.message_types_by_name['SequenceExample'] = _SEQUENCEEXAMPLE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Example = _reflection.GeneratedProtocolMessageType('Example', (_message.Message,), dict( + DESCRIPTOR = _EXAMPLE, + __module__ = 'diplomacy_tensorflow.core.example.example_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Example) + )) +_sym_db.RegisterMessage(Example) + +SequenceExample = _reflection.GeneratedProtocolMessageType('SequenceExample', (_message.Message,), dict( + DESCRIPTOR = _SEQUENCEEXAMPLE, + __module__ = 'diplomacy_tensorflow.core.example.example_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SequenceExample) + )) +_sym_db.RegisterMessage(SequenceExample) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.pb.cc new file mode 100644 index 0000000..eb0b760 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.pb.cc @@ -0,0 +1,2714 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/example/feature.proto + +#include "diplomacy_tensorflow/core/example/feature.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_BytesList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FloatList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Int64List; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_FeatureList; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_FeatureLists_FeatureListEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Features_FeatureEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Feature; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto +namespace diplomacy { +namespace tensorflow { +class BytesListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BytesList_default_instance_; +class FloatListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FloatList_default_instance_; +class Int64ListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Int64List_default_instance_; +class FeatureDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::BytesList* bytes_list_; + const ::diplomacy::tensorflow::FloatList* float_list_; + const ::diplomacy::tensorflow::Int64List* int64_list_; +} _Feature_default_instance_; +class Features_FeatureEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Features_FeatureEntry_DoNotUse_default_instance_; +class FeaturesDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Features_default_instance_; +class FeatureListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FeatureList_default_instance_; +class FeatureLists_FeatureListEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FeatureLists_FeatureListEntry_DoNotUse_default_instance_; +class FeatureListsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FeatureLists_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto { +static void InitDefaultsBytesList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_BytesList_default_instance_; + new (ptr) ::diplomacy::tensorflow::BytesList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::BytesList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_BytesList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsBytesList}, {}}; + +static void InitDefaultsFloatList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FloatList_default_instance_; + new (ptr) ::diplomacy::tensorflow::FloatList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::FloatList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_FloatList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFloatList}, {}}; + +static void InitDefaultsInt64List() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Int64List_default_instance_; + new (ptr) ::diplomacy::tensorflow::Int64List(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Int64List::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Int64List = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsInt64List}, {}}; + +static void InitDefaultsFeature() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Feature_default_instance_; + new (ptr) ::diplomacy::tensorflow::Feature(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Feature::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_Feature = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsFeature}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_BytesList.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FloatList.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Int64List.base,}}; + +static void InitDefaultsFeatures_FeatureEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Features_FeatureEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse(); + } + ::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Features_FeatureEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFeatures_FeatureEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Feature.base,}}; + +static void InitDefaultsFeatures() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Features_default_instance_; + new (ptr) ::diplomacy::tensorflow::Features(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Features::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Features = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFeatures}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Features_FeatureEntry_DoNotUse.base,}}; + +static void InitDefaultsFeatureList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FeatureList_default_instance_; + new (ptr) ::diplomacy::tensorflow::FeatureList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::FeatureList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_FeatureList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFeatureList}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Feature.base,}}; + +static void InitDefaultsFeatureLists_FeatureListEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FeatureLists_FeatureListEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse(); + } + ::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_FeatureLists_FeatureListEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFeatureLists_FeatureListEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureList.base,}}; + +static void InitDefaultsFeatureLists() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FeatureLists_default_instance_; + new (ptr) ::diplomacy::tensorflow::FeatureLists(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::FeatureLists::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_FeatureLists = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFeatureLists}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureLists_FeatureListEntry_DoNotUse.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_BytesList.base); + ::google::protobuf::internal::InitSCC(&scc_info_FloatList.base); + ::google::protobuf::internal::InitSCC(&scc_info_Int64List.base); + ::google::protobuf::internal::InitSCC(&scc_info_Feature.base); + ::google::protobuf::internal::InitSCC(&scc_info_Features_FeatureEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_Features.base); + ::google::protobuf::internal::InitSCC(&scc_info_FeatureList.base); + ::google::protobuf::internal::InitSCC(&scc_info_FeatureLists_FeatureListEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_FeatureLists.base); +} + +::google::protobuf::Metadata file_level_metadata[9]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::BytesList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::BytesList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FloatList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FloatList, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Int64List, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Int64List, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Feature, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Feature, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::FeatureDefaultTypeInternal, bytes_list_), + offsetof(::diplomacy::tensorflow::FeatureDefaultTypeInternal, float_list_), + offsetof(::diplomacy::tensorflow::FeatureDefaultTypeInternal, int64_list_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Feature, kind_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Features, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Features, feature_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureList, feature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureLists, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FeatureLists, feature_list_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::BytesList)}, + { 6, -1, sizeof(::diplomacy::tensorflow::FloatList)}, + { 12, -1, sizeof(::diplomacy::tensorflow::Int64List)}, + { 18, -1, sizeof(::diplomacy::tensorflow::Feature)}, + { 27, 34, sizeof(::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse)}, + { 36, -1, sizeof(::diplomacy::tensorflow::Features)}, + { 42, -1, sizeof(::diplomacy::tensorflow::FeatureList)}, + { 48, 55, sizeof(::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse)}, + { 57, -1, sizeof(::diplomacy::tensorflow::FeatureLists)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_BytesList_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FloatList_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Int64List_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Feature_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Features_FeatureEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Features_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FeatureList_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FeatureLists_FeatureListEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FeatureLists_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/example/feature.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 9); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n/diplomacy_tensorflow/core/example/feat" + "ure.proto\022\024diplomacy.tensorflow\"\032\n\tBytes" + "List\022\r\n\005value\030\001 \003(\014\"\036\n\tFloatList\022\021\n\005valu" + "e\030\001 \003(\002B\002\020\001\"\036\n\tInt64List\022\021\n\005value\030\001 \003(\003B" + "\002\020\001\"\266\001\n\007Feature\0225\n\nbytes_list\030\001 \001(\0132\037.di" + "plomacy.tensorflow.BytesListH\000\0225\n\nfloat_" + "list\030\002 \001(\0132\037.diplomacy.tensorflow.FloatL" + "istH\000\0225\n\nint64_list\030\003 \001(\0132\037.diplomacy.te" + "nsorflow.Int64ListH\000B\006\n\004kind\"\227\001\n\010Feature" + "s\022<\n\007feature\030\001 \003(\0132+.diplomacy.tensorflo" + "w.Features.FeatureEntry\032M\n\014FeatureEntry\022" + "\013\n\003key\030\001 \001(\t\022,\n\005value\030\002 \001(\0132\035.diplomacy." + "tensorflow.Feature:\0028\001\"=\n\013FeatureList\022.\n" + "\007feature\030\001 \003(\0132\035.diplomacy.tensorflow.Fe" + "ature\"\260\001\n\014FeatureLists\022I\n\014feature_list\030\001" + " \003(\01323.diplomacy.tensorflow.FeatureLists" + ".FeatureListEntry\032U\n\020FeatureListEntry\022\013\n" + "\003key\030\001 \001(\t\0220\n\005value\030\002 \001(\0132!.diplomacy.te" + "nsorflow.FeatureList:\0028\001Bi\n\026org.tensorfl" + "ow.exampleB\rFeatureProtosP\001Z;github.com/" + "tensorflow/tensorflow/tensorflow/go/core" + "/example\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 859); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/example/feature.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void BytesList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BytesList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BytesList::BytesList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_BytesList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.BytesList) +} +BytesList::BytesList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_BytesList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.BytesList) +} +BytesList::BytesList(const BytesList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.BytesList) +} + +void BytesList::SharedCtor() { +} + +BytesList::~BytesList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.BytesList) + SharedDtor(); +} + +void BytesList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void BytesList::ArenaDtor(void* object) { + BytesList* _this = reinterpret_cast< BytesList* >(object); + (void)_this; +} +void BytesList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BytesList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BytesList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BytesList& BytesList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_BytesList.base); + return *internal_default_instance(); +} + + +void BytesList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool BytesList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.BytesList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated bytes value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.BytesList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.BytesList) + return false; +#undef DO_ +} + +void BytesList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 1, this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.BytesList) +} + +::google::protobuf::uint8* BytesList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.BytesList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes value = 1; + for (int i = 0, n = this->value_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(1, this->value(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.BytesList) + return target; +} + +size_t BytesList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.BytesList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated bytes value = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->value_size()); + for (int i = 0, n = this->value_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->value(i)); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BytesList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.BytesList) + GOOGLE_DCHECK_NE(&from, this); + const BytesList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.BytesList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.BytesList) + MergeFrom(*source); + } +} + +void BytesList::MergeFrom(const BytesList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.BytesList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void BytesList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.BytesList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BytesList::CopyFrom(const BytesList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.BytesList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BytesList::IsInitialized() const { + return true; +} + +void BytesList::Swap(BytesList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BytesList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BytesList::UnsafeArenaSwap(BytesList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BytesList::InternalSwap(BytesList* other) { + using std::swap; + value_.InternalSwap(CastToBase(&other->value_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BytesList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FloatList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FloatList::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FloatList::FloatList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FloatList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.FloatList) +} +FloatList::FloatList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FloatList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.FloatList) +} +FloatList::FloatList(const FloatList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.FloatList) +} + +void FloatList::SharedCtor() { +} + +FloatList::~FloatList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.FloatList) + SharedDtor(); +} + +void FloatList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void FloatList::ArenaDtor(void* object) { + FloatList* _this = reinterpret_cast< FloatList* >(object); + (void)_this; +} +void FloatList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FloatList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FloatList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FloatList& FloatList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FloatList.base); + return *internal_default_instance(); +} + + +void FloatList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool FloatList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.FloatList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated float value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.FloatList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.FloatList) + return false; +#undef DO_ +} + +void FloatList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.FloatList) +} + +::google::protobuf::uint8* FloatList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.FloatList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.FloatList) + return target; +} + +size_t FloatList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.FloatList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated float value = 1 [packed = true]; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FloatList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.FloatList) + GOOGLE_DCHECK_NE(&from, this); + const FloatList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.FloatList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.FloatList) + MergeFrom(*source); + } +} + +void FloatList::MergeFrom(const FloatList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.FloatList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void FloatList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.FloatList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FloatList::CopyFrom(const FloatList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.FloatList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FloatList::IsInitialized() const { + return true; +} + +void FloatList::Swap(FloatList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FloatList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FloatList::UnsafeArenaSwap(FloatList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FloatList::InternalSwap(FloatList* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FloatList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Int64List::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Int64List::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Int64List::Int64List() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Int64List.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Int64List) +} +Int64List::Int64List(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Int64List.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Int64List) +} +Int64List::Int64List(const Int64List& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Int64List) +} + +void Int64List::SharedCtor() { +} + +Int64List::~Int64List() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Int64List) + SharedDtor(); +} + +void Int64List::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Int64List::ArenaDtor(void* object) { + Int64List* _this = reinterpret_cast< Int64List* >(object); + (void)_this; +} +void Int64List::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Int64List::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Int64List::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Int64List& Int64List::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Int64List.base); + return *internal_default_instance(); +} + + +void Int64List::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool Int64List::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Int64List) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 value = 1 [packed = true]; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Int64List) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Int64List) + return false; +#undef DO_ +} + +void Int64List::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 value = 1 [packed = true]; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + } + for (int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->value(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Int64List) +} + +::google::protobuf::uint8* Int64List::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Int64List) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 value = 1 [packed = true]; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Int64List) + return target; +} + +size_t Int64List::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Int64List) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 value = 1 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->value_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Int64List::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Int64List) + GOOGLE_DCHECK_NE(&from, this); + const Int64List* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Int64List) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Int64List) + MergeFrom(*source); + } +} + +void Int64List::MergeFrom(const Int64List& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Int64List) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void Int64List::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Int64List) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Int64List::CopyFrom(const Int64List& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Int64List) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Int64List::IsInitialized() const { + return true; +} + +void Int64List::Swap(Int64List* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Int64List* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Int64List::UnsafeArenaSwap(Int64List* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Int64List::InternalSwap(Int64List* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Int64List::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Feature::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_Feature_default_instance_.bytes_list_ = const_cast< ::diplomacy::tensorflow::BytesList*>( + ::diplomacy::tensorflow::BytesList::internal_default_instance()); + ::diplomacy::tensorflow::_Feature_default_instance_.float_list_ = const_cast< ::diplomacy::tensorflow::FloatList*>( + ::diplomacy::tensorflow::FloatList::internal_default_instance()); + ::diplomacy::tensorflow::_Feature_default_instance_.int64_list_ = const_cast< ::diplomacy::tensorflow::Int64List*>( + ::diplomacy::tensorflow::Int64List::internal_default_instance()); +} +void Feature::set_allocated_bytes_list(::diplomacy::tensorflow::BytesList* bytes_list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (bytes_list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(bytes_list); + if (message_arena != submessage_arena) { + bytes_list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, bytes_list, submessage_arena); + } + set_has_bytes_list(); + kind_.bytes_list_ = bytes_list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Feature.bytes_list) +} +void Feature::set_allocated_float_list(::diplomacy::tensorflow::FloatList* float_list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (float_list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(float_list); + if (message_arena != submessage_arena) { + float_list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, float_list, submessage_arena); + } + set_has_float_list(); + kind_.float_list_ = float_list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Feature.float_list) +} +void Feature::set_allocated_int64_list(::diplomacy::tensorflow::Int64List* int64_list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_kind(); + if (int64_list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(int64_list); + if (message_arena != submessage_arena) { + int64_list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, int64_list, submessage_arena); + } + set_has_int64_list(); + kind_.int64_list_ = int64_list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Feature.int64_list) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Feature::kBytesListFieldNumber; +const int Feature::kFloatListFieldNumber; +const int Feature::kInt64ListFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Feature::Feature() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Feature.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Feature) +} +Feature::Feature(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Feature.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Feature) +} +Feature::Feature(const Feature& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_kind(); + switch (from.kind_case()) { + case kBytesList: { + mutable_bytes_list()->::diplomacy::tensorflow::BytesList::MergeFrom(from.bytes_list()); + break; + } + case kFloatList: { + mutable_float_list()->::diplomacy::tensorflow::FloatList::MergeFrom(from.float_list()); + break; + } + case kInt64List: { + mutable_int64_list()->::diplomacy::tensorflow::Int64List::MergeFrom(from.int64_list()); + break; + } + case KIND_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Feature) +} + +void Feature::SharedCtor() { + clear_has_kind(); +} + +Feature::~Feature() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Feature) + SharedDtor(); +} + +void Feature::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_kind()) { + clear_kind(); + } +} + +void Feature::ArenaDtor(void* object) { + Feature* _this = reinterpret_cast< Feature* >(object); + (void)_this; +} +void Feature::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Feature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Feature::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Feature& Feature::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Feature.base); + return *internal_default_instance(); +} + + +void Feature::clear_kind() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.Feature) + switch (kind_case()) { + case kBytesList: { + if (GetArenaNoVirtual() == NULL) { + delete kind_.bytes_list_; + } + break; + } + case kFloatList: { + if (GetArenaNoVirtual() == NULL) { + delete kind_.float_list_; + } + break; + } + case kInt64List: { + if (GetArenaNoVirtual() == NULL) { + delete kind_.int64_list_; + } + break; + } + case KIND_NOT_SET: { + break; + } + } + _oneof_case_[0] = KIND_NOT_SET; +} + + +void Feature::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Feature) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_kind(); + _internal_metadata_.Clear(); +} + +bool Feature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Feature) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.BytesList bytes_list = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_bytes_list())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.FloatList float_list = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_float_list())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.Int64List int64_list = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_int64_list())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Feature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Feature) + return false; +#undef DO_ +} + +void Feature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Feature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.BytesList bytes_list = 1; + if (has_bytes_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_bytes_list(), output); + } + + // .diplomacy.tensorflow.FloatList float_list = 2; + if (has_float_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_float_list(), output); + } + + // .diplomacy.tensorflow.Int64List int64_list = 3; + if (has_int64_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_int64_list(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Feature) +} + +::google::protobuf::uint8* Feature::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Feature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.BytesList bytes_list = 1; + if (has_bytes_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_bytes_list(), deterministic, target); + } + + // .diplomacy.tensorflow.FloatList float_list = 2; + if (has_float_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_float_list(), deterministic, target); + } + + // .diplomacy.tensorflow.Int64List int64_list = 3; + if (has_int64_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_int64_list(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Feature) + return target; +} + +size_t Feature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Feature) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (kind_case()) { + // .diplomacy.tensorflow.BytesList bytes_list = 1; + case kBytesList: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *kind_.bytes_list_); + break; + } + // .diplomacy.tensorflow.FloatList float_list = 2; + case kFloatList: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *kind_.float_list_); + break; + } + // .diplomacy.tensorflow.Int64List int64_list = 3; + case kInt64List: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *kind_.int64_list_); + break; + } + case KIND_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Feature::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Feature) + GOOGLE_DCHECK_NE(&from, this); + const Feature* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Feature) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Feature) + MergeFrom(*source); + } +} + +void Feature::MergeFrom(const Feature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Feature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.kind_case()) { + case kBytesList: { + mutable_bytes_list()->::diplomacy::tensorflow::BytesList::MergeFrom(from.bytes_list()); + break; + } + case kFloatList: { + mutable_float_list()->::diplomacy::tensorflow::FloatList::MergeFrom(from.float_list()); + break; + } + case kInt64List: { + mutable_int64_list()->::diplomacy::tensorflow::Int64List::MergeFrom(from.int64_list()); + break; + } + case KIND_NOT_SET: { + break; + } + } +} + +void Feature::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Feature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Feature::CopyFrom(const Feature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Feature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Feature::IsInitialized() const { + return true; +} + +void Feature::Swap(Feature* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Feature* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Feature::UnsafeArenaSwap(Feature* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Feature::InternalSwap(Feature* other) { + using std::swap; + swap(kind_, other->kind_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Feature::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +Features_FeatureEntry_DoNotUse::Features_FeatureEntry_DoNotUse() {} +Features_FeatureEntry_DoNotUse::Features_FeatureEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void Features_FeatureEntry_DoNotUse::MergeFrom(const Features_FeatureEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata Features_FeatureEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[4]; +} +void Features_FeatureEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void Features::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Features::kFeatureFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Features::Features() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Features.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Features) +} +Features::Features(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + feature_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Features.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Features) +} +Features::Features(const Features& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + feature_.MergeFrom(from.feature_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Features) +} + +void Features::SharedCtor() { +} + +Features::~Features() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Features) + SharedDtor(); +} + +void Features::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Features::ArenaDtor(void* object) { + Features* _this = reinterpret_cast< Features* >(object); + (void)_this; +} +void Features::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Features::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Features::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Features& Features::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_Features.base); + return *internal_default_instance(); +} + + +void Features::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Features) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feature_.Clear(); + _internal_metadata_.Clear(); +} + +bool Features::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Features) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map feature = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + Features_FeatureEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + Features_FeatureEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::Feature, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature > > parser(&feature_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.Features.FeatureEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Features) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Features) + return false; +#undef DO_ +} + +void Features::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Features) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map feature = 1; + if (!this->feature().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Features.FeatureEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->feature().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->feature().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator + it = this->feature().begin(); + it != this->feature().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(feature_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator + it = this->feature().begin(); + it != this->feature().end(); ++it) { + entry.reset(feature_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Features) +} + +::google::protobuf::uint8* Features::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Features) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map feature = 1; + if (!this->feature().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Features.FeatureEntry.key"); + } + }; + + if (deterministic && + this->feature().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->feature().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator + it = this->feature().begin(); + it != this->feature().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(feature_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator + it = this->feature().begin(); + it != this->feature().end(); ++it) { + entry.reset(feature_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Features) + return target; +} + +size_t Features::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Features) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map feature = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->feature_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator + it = this->feature().begin(); + it != this->feature().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(feature_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Features::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Features) + GOOGLE_DCHECK_NE(&from, this); + const Features* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Features) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Features) + MergeFrom(*source); + } +} + +void Features::MergeFrom(const Features& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Features) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feature_.MergeFrom(from.feature_); +} + +void Features::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Features) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Features::CopyFrom(const Features& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Features) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Features::IsInitialized() const { + return true; +} + +void Features::Swap(Features* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Features* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Features::UnsafeArenaSwap(Features* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Features::InternalSwap(Features* other) { + using std::swap; + feature_.Swap(&other->feature_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Features::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void FeatureList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FeatureList::kFeatureFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FeatureList::FeatureList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.FeatureList) +} +FeatureList::FeatureList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + feature_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.FeatureList) +} +FeatureList::FeatureList(const FeatureList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + feature_(from.feature_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.FeatureList) +} + +void FeatureList::SharedCtor() { +} + +FeatureList::~FeatureList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.FeatureList) + SharedDtor(); +} + +void FeatureList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void FeatureList::ArenaDtor(void* object) { + FeatureList* _this = reinterpret_cast< FeatureList* >(object); + (void)_this; +} +void FeatureList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FeatureList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FeatureList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FeatureList& FeatureList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureList.base); + return *internal_default_instance(); +} + + +void FeatureList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.FeatureList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feature_.Clear(); + _internal_metadata_.Clear(); +} + +bool FeatureList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.FeatureList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.Feature feature = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_feature())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.FeatureList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.FeatureList) + return false; +#undef DO_ +} + +void FeatureList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.FeatureList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.Feature feature = 1; + for (unsigned int i = 0, + n = static_cast(this->feature_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->feature(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.FeatureList) +} + +::google::protobuf::uint8* FeatureList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.FeatureList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.Feature feature = 1; + for (unsigned int i = 0, + n = static_cast(this->feature_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->feature(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.FeatureList) + return target; +} + +size_t FeatureList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.FeatureList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.Feature feature = 1; + { + unsigned int count = static_cast(this->feature_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->feature(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FeatureList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.FeatureList) + GOOGLE_DCHECK_NE(&from, this); + const FeatureList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.FeatureList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.FeatureList) + MergeFrom(*source); + } +} + +void FeatureList::MergeFrom(const FeatureList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.FeatureList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feature_.MergeFrom(from.feature_); +} + +void FeatureList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.FeatureList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FeatureList::CopyFrom(const FeatureList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.FeatureList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FeatureList::IsInitialized() const { + return true; +} + +void FeatureList::Swap(FeatureList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FeatureList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FeatureList::UnsafeArenaSwap(FeatureList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FeatureList::InternalSwap(FeatureList* other) { + using std::swap; + CastToBase(&feature_)->InternalSwap(CastToBase(&other->feature_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FeatureList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +FeatureLists_FeatureListEntry_DoNotUse::FeatureLists_FeatureListEntry_DoNotUse() {} +FeatureLists_FeatureListEntry_DoNotUse::FeatureLists_FeatureListEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void FeatureLists_FeatureListEntry_DoNotUse::MergeFrom(const FeatureLists_FeatureListEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata FeatureLists_FeatureListEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[7]; +} +void FeatureLists_FeatureListEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void FeatureLists::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FeatureLists::kFeatureListFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FeatureLists::FeatureLists() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureLists.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.FeatureLists) +} +FeatureLists::FeatureLists(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + feature_list_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureLists.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.FeatureLists) +} +FeatureLists::FeatureLists(const FeatureLists& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + feature_list_.MergeFrom(from.feature_list_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.FeatureLists) +} + +void FeatureLists::SharedCtor() { +} + +FeatureLists::~FeatureLists() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.FeatureLists) + SharedDtor(); +} + +void FeatureLists::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void FeatureLists::ArenaDtor(void* object) { + FeatureLists* _this = reinterpret_cast< FeatureLists* >(object); + (void)_this; +} +void FeatureLists::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FeatureLists::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FeatureLists::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FeatureLists& FeatureLists::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::scc_info_FeatureLists.base); + return *internal_default_instance(); +} + + +void FeatureLists::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.FeatureLists) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feature_list_.Clear(); + _internal_metadata_.Clear(); +} + +bool FeatureLists::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.FeatureLists) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map feature_list = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + FeatureLists_FeatureListEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + FeatureLists_FeatureListEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::FeatureList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList > > parser(&feature_list_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.FeatureLists.FeatureListEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.FeatureLists) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.FeatureLists) + return false; +#undef DO_ +} + +void FeatureLists::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.FeatureLists) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map feature_list = 1; + if (!this->feature_list().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FeatureLists.FeatureListEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->feature_list().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->feature_list().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator + it = this->feature_list().begin(); + it != this->feature_list().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(feature_list_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator + it = this->feature_list().begin(); + it != this->feature_list().end(); ++it) { + entry.reset(feature_list_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.FeatureLists) +} + +::google::protobuf::uint8* FeatureLists::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.FeatureLists) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map feature_list = 1; + if (!this->feature_list().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FeatureLists.FeatureListEntry.key"); + } + }; + + if (deterministic && + this->feature_list().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->feature_list().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator + it = this->feature_list().begin(); + it != this->feature_list().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(feature_list_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator + it = this->feature_list().begin(); + it != this->feature_list().end(); ++it) { + entry.reset(feature_list_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.FeatureLists) + return target; +} + +size_t FeatureLists::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.FeatureLists) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map feature_list = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->feature_list_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator + it = this->feature_list().begin(); + it != this->feature_list().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(feature_list_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FeatureLists::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.FeatureLists) + GOOGLE_DCHECK_NE(&from, this); + const FeatureLists* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.FeatureLists) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.FeatureLists) + MergeFrom(*source); + } +} + +void FeatureLists::MergeFrom(const FeatureLists& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.FeatureLists) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feature_list_.MergeFrom(from.feature_list_); +} + +void FeatureLists::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.FeatureLists) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FeatureLists::CopyFrom(const FeatureLists& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.FeatureLists) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FeatureLists::IsInitialized() const { + return true; +} + +void FeatureLists::Swap(FeatureLists* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FeatureLists* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FeatureLists::UnsafeArenaSwap(FeatureLists* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FeatureLists::InternalSwap(FeatureLists* other) { + using std::swap; + feature_list_.Swap(&other->feature_list_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FeatureLists::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::BytesList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::BytesList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::BytesList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FloatList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FloatList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FloatList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Int64List* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Int64List >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Int64List >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Feature* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Feature >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Feature >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Features* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Features >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Features >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FeatureList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FeatureList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FeatureList >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FeatureLists* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FeatureLists >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FeatureLists >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.pb.h new file mode 100644 index 0000000..1e5f2b9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.pb.h @@ -0,0 +1,1555 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/example/feature.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[9]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto +namespace diplomacy { +namespace tensorflow { +class BytesList; +class BytesListDefaultTypeInternal; +extern BytesListDefaultTypeInternal _BytesList_default_instance_; +class Feature; +class FeatureDefaultTypeInternal; +extern FeatureDefaultTypeInternal _Feature_default_instance_; +class FeatureList; +class FeatureListDefaultTypeInternal; +extern FeatureListDefaultTypeInternal _FeatureList_default_instance_; +class FeatureLists; +class FeatureListsDefaultTypeInternal; +extern FeatureListsDefaultTypeInternal _FeatureLists_default_instance_; +class FeatureLists_FeatureListEntry_DoNotUse; +class FeatureLists_FeatureListEntry_DoNotUseDefaultTypeInternal; +extern FeatureLists_FeatureListEntry_DoNotUseDefaultTypeInternal _FeatureLists_FeatureListEntry_DoNotUse_default_instance_; +class Features; +class FeaturesDefaultTypeInternal; +extern FeaturesDefaultTypeInternal _Features_default_instance_; +class Features_FeatureEntry_DoNotUse; +class Features_FeatureEntry_DoNotUseDefaultTypeInternal; +extern Features_FeatureEntry_DoNotUseDefaultTypeInternal _Features_FeatureEntry_DoNotUse_default_instance_; +class FloatList; +class FloatListDefaultTypeInternal; +extern FloatListDefaultTypeInternal _FloatList_default_instance_; +class Int64List; +class Int64ListDefaultTypeInternal; +extern Int64ListDefaultTypeInternal _Int64List_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::BytesList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::BytesList>(Arena*); +template<> ::diplomacy::tensorflow::Feature* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Feature>(Arena*); +template<> ::diplomacy::tensorflow::FeatureList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FeatureList>(Arena*); +template<> ::diplomacy::tensorflow::FeatureLists* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FeatureLists>(Arena*); +template<> ::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FeatureLists_FeatureListEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::Features* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Features>(Arena*); +template<> ::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Features_FeatureEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::FloatList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FloatList>(Arena*); +template<> ::diplomacy::tensorflow::Int64List* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Int64List>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class BytesList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.BytesList) */ { + public: + BytesList(); + virtual ~BytesList(); + + BytesList(const BytesList& from); + + inline BytesList& operator=(const BytesList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BytesList(BytesList&& from) noexcept + : BytesList() { + *this = ::std::move(from); + } + + inline BytesList& operator=(BytesList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BytesList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BytesList* internal_default_instance() { + return reinterpret_cast( + &_BytesList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(BytesList* other); + void Swap(BytesList* other); + friend void swap(BytesList& a, BytesList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BytesList* New() const final { + return CreateMaybeMessage(NULL); + } + + BytesList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BytesList& from); + void MergeFrom(const BytesList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BytesList* other); + protected: + explicit BytesList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bytes value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + const ::std::string& value(int index) const; + ::std::string* mutable_value(int index); + void set_value(int index, const ::std::string& value); + #if LANG_CXX11 + void set_value(int index, ::std::string&& value); + #endif + void set_value(int index, const char* value); + void set_value(int index, const void* value, size_t size); + ::std::string* add_value(); + void add_value(const ::std::string& value); + #if LANG_CXX11 + void add_value(::std::string&& value); + #endif + void add_value(const char* value); + void add_value(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& value() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.BytesList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FloatList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.FloatList) */ { + public: + FloatList(); + virtual ~FloatList(); + + FloatList(const FloatList& from); + + inline FloatList& operator=(const FloatList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FloatList(FloatList&& from) noexcept + : FloatList() { + *this = ::std::move(from); + } + + inline FloatList& operator=(FloatList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FloatList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FloatList* internal_default_instance() { + return reinterpret_cast( + &_FloatList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(FloatList* other); + void Swap(FloatList* other); + friend void swap(FloatList& a, FloatList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FloatList* New() const final { + return CreateMaybeMessage(NULL); + } + + FloatList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FloatList& from); + void MergeFrom(const FloatList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FloatList* other); + protected: + explicit FloatList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated float value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + float value(int index) const; + void set_value(int index, float value); + void add_value(float value); + const ::google::protobuf::RepeatedField< float >& + value() const; + ::google::protobuf::RepeatedField< float >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FloatList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< float > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Int64List : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Int64List) */ { + public: + Int64List(); + virtual ~Int64List(); + + Int64List(const Int64List& from); + + inline Int64List& operator=(const Int64List& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Int64List(Int64List&& from) noexcept + : Int64List() { + *this = ::std::move(from); + } + + inline Int64List& operator=(Int64List&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Int64List& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Int64List* internal_default_instance() { + return reinterpret_cast( + &_Int64List_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(Int64List* other); + void Swap(Int64List* other); + friend void swap(Int64List& a, Int64List& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Int64List* New() const final { + return CreateMaybeMessage(NULL); + } + + Int64List* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Int64List& from); + void MergeFrom(const Int64List& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Int64List* other); + protected: + explicit Int64List(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 value = 1 [packed = true]; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + ::google::protobuf::int64 value(int index) const; + void set_value(int index, ::google::protobuf::int64 value); + void add_value(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + value() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Int64List) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Feature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Feature) */ { + public: + Feature(); + virtual ~Feature(); + + Feature(const Feature& from); + + inline Feature& operator=(const Feature& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Feature(Feature&& from) noexcept + : Feature() { + *this = ::std::move(from); + } + + inline Feature& operator=(Feature&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Feature& default_instance(); + + enum KindCase { + kBytesList = 1, + kFloatList = 2, + kInt64List = 3, + KIND_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Feature* internal_default_instance() { + return reinterpret_cast( + &_Feature_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(Feature* other); + void Swap(Feature* other); + friend void swap(Feature& a, Feature& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Feature* New() const final { + return CreateMaybeMessage(NULL); + } + + Feature* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Feature& from); + void MergeFrom(const Feature& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Feature* other); + protected: + explicit Feature(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.BytesList bytes_list = 1; + bool has_bytes_list() const; + void clear_bytes_list(); + static const int kBytesListFieldNumber = 1; + private: + const ::diplomacy::tensorflow::BytesList& _internal_bytes_list() const; + public: + const ::diplomacy::tensorflow::BytesList& bytes_list() const; + ::diplomacy::tensorflow::BytesList* release_bytes_list(); + ::diplomacy::tensorflow::BytesList* mutable_bytes_list(); + void set_allocated_bytes_list(::diplomacy::tensorflow::BytesList* bytes_list); + void unsafe_arena_set_allocated_bytes_list( + ::diplomacy::tensorflow::BytesList* bytes_list); + ::diplomacy::tensorflow::BytesList* unsafe_arena_release_bytes_list(); + + // .diplomacy.tensorflow.FloatList float_list = 2; + bool has_float_list() const; + void clear_float_list(); + static const int kFloatListFieldNumber = 2; + private: + const ::diplomacy::tensorflow::FloatList& _internal_float_list() const; + public: + const ::diplomacy::tensorflow::FloatList& float_list() const; + ::diplomacy::tensorflow::FloatList* release_float_list(); + ::diplomacy::tensorflow::FloatList* mutable_float_list(); + void set_allocated_float_list(::diplomacy::tensorflow::FloatList* float_list); + void unsafe_arena_set_allocated_float_list( + ::diplomacy::tensorflow::FloatList* float_list); + ::diplomacy::tensorflow::FloatList* unsafe_arena_release_float_list(); + + // .diplomacy.tensorflow.Int64List int64_list = 3; + bool has_int64_list() const; + void clear_int64_list(); + static const int kInt64ListFieldNumber = 3; + private: + const ::diplomacy::tensorflow::Int64List& _internal_int64_list() const; + public: + const ::diplomacy::tensorflow::Int64List& int64_list() const; + ::diplomacy::tensorflow::Int64List* release_int64_list(); + ::diplomacy::tensorflow::Int64List* mutable_int64_list(); + void set_allocated_int64_list(::diplomacy::tensorflow::Int64List* int64_list); + void unsafe_arena_set_allocated_int64_list( + ::diplomacy::tensorflow::Int64List* int64_list); + ::diplomacy::tensorflow::Int64List* unsafe_arena_release_int64_list(); + + void clear_kind(); + KindCase kind_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Feature) + private: + void set_has_bytes_list(); + void set_has_float_list(); + void set_has_int64_list(); + + inline bool has_kind() const; + inline void clear_has_kind(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union KindUnion { + KindUnion() {} + ::diplomacy::tensorflow::BytesList* bytes_list_; + ::diplomacy::tensorflow::FloatList* float_list_; + ::diplomacy::tensorflow::Int64List* int64_list_; + } kind_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Features_FeatureEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + Features_FeatureEntry_DoNotUse(); + Features_FeatureEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const Features_FeatureEntry_DoNotUse& other); + static const Features_FeatureEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Features_FeatureEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class Features : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Features) */ { + public: + Features(); + virtual ~Features(); + + Features(const Features& from); + + inline Features& operator=(const Features& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Features(Features&& from) noexcept + : Features() { + *this = ::std::move(from); + } + + inline Features& operator=(Features&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Features& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Features* internal_default_instance() { + return reinterpret_cast( + &_Features_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(Features* other); + void Swap(Features* other); + friend void swap(Features& a, Features& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Features* New() const final { + return CreateMaybeMessage(NULL); + } + + Features* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Features& from); + void MergeFrom(const Features& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Features* other); + protected: + explicit Features(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map feature = 1; + int feature_size() const; + void clear_feature(); + static const int kFeatureFieldNumber = 1; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >& + feature() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >* + mutable_feature(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Features) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + Features_FeatureEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::Feature, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > feature_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FeatureList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.FeatureList) */ { + public: + FeatureList(); + virtual ~FeatureList(); + + FeatureList(const FeatureList& from); + + inline FeatureList& operator=(const FeatureList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FeatureList(FeatureList&& from) noexcept + : FeatureList() { + *this = ::std::move(from); + } + + inline FeatureList& operator=(FeatureList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FeatureList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FeatureList* internal_default_instance() { + return reinterpret_cast( + &_FeatureList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(FeatureList* other); + void Swap(FeatureList* other); + friend void swap(FeatureList& a, FeatureList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FeatureList* New() const final { + return CreateMaybeMessage(NULL); + } + + FeatureList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FeatureList& from); + void MergeFrom(const FeatureList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FeatureList* other); + protected: + explicit FeatureList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.Feature feature = 1; + int feature_size() const; + void clear_feature(); + static const int kFeatureFieldNumber = 1; + ::diplomacy::tensorflow::Feature* mutable_feature(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Feature >* + mutable_feature(); + const ::diplomacy::tensorflow::Feature& feature(int index) const; + ::diplomacy::tensorflow::Feature* add_feature(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Feature >& + feature() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FeatureList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Feature > feature_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FeatureLists_FeatureListEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + FeatureLists_FeatureListEntry_DoNotUse(); + FeatureLists_FeatureListEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const FeatureLists_FeatureListEntry_DoNotUse& other); + static const FeatureLists_FeatureListEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_FeatureLists_FeatureListEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class FeatureLists : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.FeatureLists) */ { + public: + FeatureLists(); + virtual ~FeatureLists(); + + FeatureLists(const FeatureLists& from); + + inline FeatureLists& operator=(const FeatureLists& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FeatureLists(FeatureLists&& from) noexcept + : FeatureLists() { + *this = ::std::move(from); + } + + inline FeatureLists& operator=(FeatureLists&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FeatureLists& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FeatureLists* internal_default_instance() { + return reinterpret_cast( + &_FeatureLists_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(FeatureLists* other); + void Swap(FeatureLists* other); + friend void swap(FeatureLists& a, FeatureLists& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FeatureLists* New() const final { + return CreateMaybeMessage(NULL); + } + + FeatureLists* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FeatureLists& from); + void MergeFrom(const FeatureLists& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FeatureLists* other); + protected: + explicit FeatureLists(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map feature_list = 1; + int feature_list_size() const; + void clear_feature_list(); + static const int kFeatureListFieldNumber = 1; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >& + feature_list() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >* + mutable_feature_list(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FeatureLists) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + FeatureLists_FeatureListEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::FeatureList, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > feature_list_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// BytesList + +// repeated bytes value = 1; +inline int BytesList::value_size() const { + return value_.size(); +} +inline void BytesList::clear_value() { + value_.Clear(); +} +inline const ::std::string& BytesList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.BytesList.value) + return value_.Get(index); +} +inline ::std::string* BytesList::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.BytesList.value) + return value_.Mutable(index); +} +inline void BytesList::set_value(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.BytesList.value) + value_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void BytesList::set_value(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.BytesList.value) + value_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void BytesList::set_value(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.BytesList.value) +} +inline void BytesList::set_value(int index, const void* value, size_t size) { + value_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.BytesList.value) +} +inline ::std::string* BytesList::add_value() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.BytesList.value) + return value_.Add(); +} +inline void BytesList::add_value(const ::std::string& value) { + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.BytesList.value) +} +#if LANG_CXX11 +inline void BytesList::add_value(::std::string&& value) { + value_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.BytesList.value) +} +#endif +inline void BytesList::add_value(const char* value) { + GOOGLE_DCHECK(value != NULL); + value_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.BytesList.value) +} +inline void BytesList::add_value(const void* value, size_t size) { + value_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.BytesList.value) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +BytesList::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.BytesList.value) + return value_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +BytesList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.BytesList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// FloatList + +// repeated float value = 1 [packed = true]; +inline int FloatList::value_size() const { + return value_.size(); +} +inline void FloatList::clear_value() { + value_.Clear(); +} +inline float FloatList::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FloatList.value) + return value_.Get(index); +} +inline void FloatList::set_value(int index, float value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.FloatList.value) +} +inline void FloatList::add_value(float value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.FloatList.value) +} +inline const ::google::protobuf::RepeatedField< float >& +FloatList::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.FloatList.value) + return value_; +} +inline ::google::protobuf::RepeatedField< float >* +FloatList::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.FloatList.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// Int64List + +// repeated int64 value = 1 [packed = true]; +inline int Int64List::value_size() const { + return value_.size(); +} +inline void Int64List::clear_value() { + value_.Clear(); +} +inline ::google::protobuf::int64 Int64List::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Int64List.value) + return value_.Get(index); +} +inline void Int64List::set_value(int index, ::google::protobuf::int64 value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Int64List.value) +} +inline void Int64List::add_value(::google::protobuf::int64 value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.Int64List.value) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +Int64List::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.Int64List.value) + return value_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +Int64List::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.Int64List.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// Feature + +// .diplomacy.tensorflow.BytesList bytes_list = 1; +inline bool Feature::has_bytes_list() const { + return kind_case() == kBytesList; +} +inline void Feature::set_has_bytes_list() { + _oneof_case_[0] = kBytesList; +} +inline void Feature::clear_bytes_list() { + if (has_bytes_list()) { + if (GetArenaNoVirtual() == NULL) { + delete kind_.bytes_list_; + } + clear_has_kind(); + } +} +inline const ::diplomacy::tensorflow::BytesList& Feature::_internal_bytes_list() const { + return *kind_.bytes_list_; +} +inline ::diplomacy::tensorflow::BytesList* Feature::release_bytes_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Feature.bytes_list) + if (has_bytes_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::BytesList* temp = kind_.bytes_list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + kind_.bytes_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::BytesList& Feature::bytes_list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Feature.bytes_list) + return has_bytes_list() + ? *kind_.bytes_list_ + : *reinterpret_cast< ::diplomacy::tensorflow::BytesList*>(&::diplomacy::tensorflow::_BytesList_default_instance_); +} +inline ::diplomacy::tensorflow::BytesList* Feature::unsafe_arena_release_bytes_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Feature.bytes_list) + if (has_bytes_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::BytesList* temp = kind_.bytes_list_; + kind_.bytes_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Feature::unsafe_arena_set_allocated_bytes_list(::diplomacy::tensorflow::BytesList* bytes_list) { + clear_kind(); + if (bytes_list) { + set_has_bytes_list(); + kind_.bytes_list_ = bytes_list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Feature.bytes_list) +} +inline ::diplomacy::tensorflow::BytesList* Feature::mutable_bytes_list() { + if (!has_bytes_list()) { + clear_kind(); + set_has_bytes_list(); + kind_.bytes_list_ = CreateMaybeMessage< ::diplomacy::tensorflow::BytesList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Feature.bytes_list) + return kind_.bytes_list_; +} + +// .diplomacy.tensorflow.FloatList float_list = 2; +inline bool Feature::has_float_list() const { + return kind_case() == kFloatList; +} +inline void Feature::set_has_float_list() { + _oneof_case_[0] = kFloatList; +} +inline void Feature::clear_float_list() { + if (has_float_list()) { + if (GetArenaNoVirtual() == NULL) { + delete kind_.float_list_; + } + clear_has_kind(); + } +} +inline const ::diplomacy::tensorflow::FloatList& Feature::_internal_float_list() const { + return *kind_.float_list_; +} +inline ::diplomacy::tensorflow::FloatList* Feature::release_float_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Feature.float_list) + if (has_float_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::FloatList* temp = kind_.float_list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + kind_.float_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::FloatList& Feature::float_list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Feature.float_list) + return has_float_list() + ? *kind_.float_list_ + : *reinterpret_cast< ::diplomacy::tensorflow::FloatList*>(&::diplomacy::tensorflow::_FloatList_default_instance_); +} +inline ::diplomacy::tensorflow::FloatList* Feature::unsafe_arena_release_float_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Feature.float_list) + if (has_float_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::FloatList* temp = kind_.float_list_; + kind_.float_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Feature::unsafe_arena_set_allocated_float_list(::diplomacy::tensorflow::FloatList* float_list) { + clear_kind(); + if (float_list) { + set_has_float_list(); + kind_.float_list_ = float_list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Feature.float_list) +} +inline ::diplomacy::tensorflow::FloatList* Feature::mutable_float_list() { + if (!has_float_list()) { + clear_kind(); + set_has_float_list(); + kind_.float_list_ = CreateMaybeMessage< ::diplomacy::tensorflow::FloatList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Feature.float_list) + return kind_.float_list_; +} + +// .diplomacy.tensorflow.Int64List int64_list = 3; +inline bool Feature::has_int64_list() const { + return kind_case() == kInt64List; +} +inline void Feature::set_has_int64_list() { + _oneof_case_[0] = kInt64List; +} +inline void Feature::clear_int64_list() { + if (has_int64_list()) { + if (GetArenaNoVirtual() == NULL) { + delete kind_.int64_list_; + } + clear_has_kind(); + } +} +inline const ::diplomacy::tensorflow::Int64List& Feature::_internal_int64_list() const { + return *kind_.int64_list_; +} +inline ::diplomacy::tensorflow::Int64List* Feature::release_int64_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Feature.int64_list) + if (has_int64_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::Int64List* temp = kind_.int64_list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + kind_.int64_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::Int64List& Feature::int64_list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Feature.int64_list) + return has_int64_list() + ? *kind_.int64_list_ + : *reinterpret_cast< ::diplomacy::tensorflow::Int64List*>(&::diplomacy::tensorflow::_Int64List_default_instance_); +} +inline ::diplomacy::tensorflow::Int64List* Feature::unsafe_arena_release_int64_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Feature.int64_list) + if (has_int64_list()) { + clear_has_kind(); + ::diplomacy::tensorflow::Int64List* temp = kind_.int64_list_; + kind_.int64_list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Feature::unsafe_arena_set_allocated_int64_list(::diplomacy::tensorflow::Int64List* int64_list) { + clear_kind(); + if (int64_list) { + set_has_int64_list(); + kind_.int64_list_ = int64_list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Feature.int64_list) +} +inline ::diplomacy::tensorflow::Int64List* Feature::mutable_int64_list() { + if (!has_int64_list()) { + clear_kind(); + set_has_int64_list(); + kind_.int64_list_ = CreateMaybeMessage< ::diplomacy::tensorflow::Int64List >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Feature.int64_list) + return kind_.int64_list_; +} + +inline bool Feature::has_kind() const { + return kind_case() != KIND_NOT_SET; +} +inline void Feature::clear_has_kind() { + _oneof_case_[0] = KIND_NOT_SET; +} +inline Feature::KindCase Feature::kind_case() const { + return Feature::KindCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// Features + +// map feature = 1; +inline int Features::feature_size() const { + return feature_.size(); +} +inline void Features::clear_feature() { + feature_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >& +Features::feature() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.Features.feature) + return feature_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >* +Features::mutable_feature() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.Features.feature) + return feature_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// FeatureList + +// repeated .diplomacy.tensorflow.Feature feature = 1; +inline int FeatureList::feature_size() const { + return feature_.size(); +} +inline void FeatureList::clear_feature() { + feature_.Clear(); +} +inline ::diplomacy::tensorflow::Feature* FeatureList::mutable_feature(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FeatureList.feature) + return feature_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Feature >* +FeatureList::mutable_feature() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.FeatureList.feature) + return &feature_; +} +inline const ::diplomacy::tensorflow::Feature& FeatureList::feature(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FeatureList.feature) + return feature_.Get(index); +} +inline ::diplomacy::tensorflow::Feature* FeatureList::add_feature() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.FeatureList.feature) + return feature_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Feature >& +FeatureList::feature() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.FeatureList.feature) + return feature_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// FeatureLists + +// map feature_list = 1; +inline int FeatureLists::feature_list_size() const { + return feature_list_.size(); +} +inline void FeatureLists::clear_feature_list() { + feature_list_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >& +FeatureLists::feature_list() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.FeatureLists.feature_list) + return feature_list_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >* +FeatureLists::mutable_feature_list() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.FeatureLists.feature_list) + return feature_list_.MutableMap(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.proto new file mode 100644 index 0000000..3c6d58e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature.proto @@ -0,0 +1,105 @@ +// Protocol messages for describing features for machine learning model +// training or inference. +// +// There are three base Feature types: +// - bytes +// - float +// - int64 +// +// A Feature contains Lists which may hold zero or more values. These +// lists are the base values BytesList, FloatList, Int64List. +// +// Features are organized into categories by name. The Features message +// contains the mapping from name to Feature. +// +// Example Features for a movie recommendation application: +// feature { +// key: "age" +// value { float_list { +// value: 29.0 +// }} +// } +// feature { +// key: "movie" +// value { bytes_list { +// value: "The Shawshank Redemption" +// value: "Fight Club" +// }} +// } +// feature { +// key: "movie_ratings" +// value { float_list { +// value: 9.0 +// value: 9.7 +// }} +// } +// feature { +// key: "suggestion" +// value { bytes_list { +// value: "Inception" +// }} +// } +// feature { +// key: "suggestion_purchased" +// value { int64_list { +// value: 1 +// }} +// } +// feature { +// key: "purchase_price" +// value { float_list { +// value: 9.99 +// }} +// } +// + +syntax = "proto3"; +option cc_enable_arenas = true; +option java_outer_classname = "FeatureProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.example"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example"; +package diplomacy.tensorflow; + +// Containers to hold repeated fundamental values. +message BytesList { + repeated bytes value = 1; +} +message FloatList { + repeated float value = 1 [packed = true]; +} +message Int64List { + repeated int64 value = 1 [packed = true]; +} + +// Containers for non-sequential data. +message Feature { + // Each feature can be exactly one kind. + oneof kind { + BytesList bytes_list = 1; + FloatList float_list = 2; + Int64List int64_list = 3; + } +}; + +message Features { + // Map from feature name to feature. + map feature = 1; +}; + +// 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. +// +message FeatureList { + repeated Feature feature = 1; +}; + +message FeatureLists { + // Map from feature name to feature list. + map feature_list = 1; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature_pb2.py new file mode 100644 index 0000000..9489980 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/example/feature_pb2.py @@ -0,0 +1,434 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/example/feature.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/example/feature.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\026org.tensorflow.exampleB\rFeatureProtosP\001Z;github.com/tensorflow/tensorflow/tensorflow/go/core/example\370\001\001'), + serialized_pb=_b('\n/diplomacy_tensorflow/core/example/feature.proto\x12\x14\x64iplomacy.tensorflow\"\x1a\n\tBytesList\x12\r\n\x05value\x18\x01 \x03(\x0c\"\x1e\n\tFloatList\x12\x11\n\x05value\x18\x01 \x03(\x02\x42\x02\x10\x01\"\x1e\n\tInt64List\x12\x11\n\x05value\x18\x01 \x03(\x03\x42\x02\x10\x01\"\xb6\x01\n\x07\x46\x65\x61ture\x12\x35\n\nbytes_list\x18\x01 \x01(\x0b\x32\x1f.diplomacy.tensorflow.BytesListH\x00\x12\x35\n\nfloat_list\x18\x02 \x01(\x0b\x32\x1f.diplomacy.tensorflow.FloatListH\x00\x12\x35\n\nint64_list\x18\x03 \x01(\x0b\x32\x1f.diplomacy.tensorflow.Int64ListH\x00\x42\x06\n\x04kind\"\x97\x01\n\x08\x46\x65\x61tures\x12<\n\x07\x66\x65\x61ture\x18\x01 \x03(\x0b\x32+.diplomacy.tensorflow.Features.FeatureEntry\x1aM\n\x0c\x46\x65\x61tureEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.diplomacy.tensorflow.Feature:\x02\x38\x01\"=\n\x0b\x46\x65\x61tureList\x12.\n\x07\x66\x65\x61ture\x18\x01 \x03(\x0b\x32\x1d.diplomacy.tensorflow.Feature\"\xb0\x01\n\x0c\x46\x65\x61tureLists\x12I\n\x0c\x66\x65\x61ture_list\x18\x01 \x03(\x0b\x32\x33.diplomacy.tensorflow.FeatureLists.FeatureListEntry\x1aU\n\x10\x46\x65\x61tureListEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x30\n\x05value\x18\x02 \x01(\x0b\x32!.diplomacy.tensorflow.FeatureList:\x02\x38\x01\x42i\n\x16org.tensorflow.exampleB\rFeatureProtosP\x01Z;github.com/tensorflow/tensorflow/tensorflow/go/core/example\xf8\x01\x01\x62\x06proto3') +) + + + + +_BYTESLIST = _descriptor.Descriptor( + name='BytesList', + full_name='diplomacy.tensorflow.BytesList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.BytesList.value', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=73, + serialized_end=99, +) + + +_FLOATLIST = _descriptor.Descriptor( + name='FloatList', + full_name='diplomacy.tensorflow.FloatList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.FloatList.value', index=0, + number=1, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=101, + serialized_end=131, +) + + +_INT64LIST = _descriptor.Descriptor( + name='Int64List', + full_name='diplomacy.tensorflow.Int64List', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.Int64List.value', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=133, + serialized_end=163, +) + + +_FEATURE = _descriptor.Descriptor( + name='Feature', + full_name='diplomacy.tensorflow.Feature', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='bytes_list', full_name='diplomacy.tensorflow.Feature.bytes_list', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='float_list', full_name='diplomacy.tensorflow.Feature.float_list', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int64_list', full_name='diplomacy.tensorflow.Feature.int64_list', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='kind', full_name='diplomacy.tensorflow.Feature.kind', + index=0, containing_type=None, fields=[]), + ], + serialized_start=166, + serialized_end=348, +) + + +_FEATURES_FEATUREENTRY = _descriptor.Descriptor( + name='FeatureEntry', + full_name='diplomacy.tensorflow.Features.FeatureEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.Features.FeatureEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.Features.FeatureEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=425, + serialized_end=502, +) + +_FEATURES = _descriptor.Descriptor( + name='Features', + full_name='diplomacy.tensorflow.Features', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature', full_name='diplomacy.tensorflow.Features.feature', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_FEATURES_FEATUREENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=351, + serialized_end=502, +) + + +_FEATURELIST = _descriptor.Descriptor( + name='FeatureList', + full_name='diplomacy.tensorflow.FeatureList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature', full_name='diplomacy.tensorflow.FeatureList.feature', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=504, + serialized_end=565, +) + + +_FEATURELISTS_FEATURELISTENTRY = _descriptor.Descriptor( + name='FeatureListEntry', + full_name='diplomacy.tensorflow.FeatureLists.FeatureListEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.FeatureLists.FeatureListEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.FeatureLists.FeatureListEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=659, + serialized_end=744, +) + +_FEATURELISTS = _descriptor.Descriptor( + name='FeatureLists', + full_name='diplomacy.tensorflow.FeatureLists', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_list', full_name='diplomacy.tensorflow.FeatureLists.feature_list', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_FEATURELISTS_FEATURELISTENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=568, + serialized_end=744, +) + +_FEATURE.fields_by_name['bytes_list'].message_type = _BYTESLIST +_FEATURE.fields_by_name['float_list'].message_type = _FLOATLIST +_FEATURE.fields_by_name['int64_list'].message_type = _INT64LIST +_FEATURE.oneofs_by_name['kind'].fields.append( + _FEATURE.fields_by_name['bytes_list']) +_FEATURE.fields_by_name['bytes_list'].containing_oneof = _FEATURE.oneofs_by_name['kind'] +_FEATURE.oneofs_by_name['kind'].fields.append( + _FEATURE.fields_by_name['float_list']) +_FEATURE.fields_by_name['float_list'].containing_oneof = _FEATURE.oneofs_by_name['kind'] +_FEATURE.oneofs_by_name['kind'].fields.append( + _FEATURE.fields_by_name['int64_list']) +_FEATURE.fields_by_name['int64_list'].containing_oneof = _FEATURE.oneofs_by_name['kind'] +_FEATURES_FEATUREENTRY.fields_by_name['value'].message_type = _FEATURE +_FEATURES_FEATUREENTRY.containing_type = _FEATURES +_FEATURES.fields_by_name['feature'].message_type = _FEATURES_FEATUREENTRY +_FEATURELIST.fields_by_name['feature'].message_type = _FEATURE +_FEATURELISTS_FEATURELISTENTRY.fields_by_name['value'].message_type = _FEATURELIST +_FEATURELISTS_FEATURELISTENTRY.containing_type = _FEATURELISTS +_FEATURELISTS.fields_by_name['feature_list'].message_type = _FEATURELISTS_FEATURELISTENTRY +DESCRIPTOR.message_types_by_name['BytesList'] = _BYTESLIST +DESCRIPTOR.message_types_by_name['FloatList'] = _FLOATLIST +DESCRIPTOR.message_types_by_name['Int64List'] = _INT64LIST +DESCRIPTOR.message_types_by_name['Feature'] = _FEATURE +DESCRIPTOR.message_types_by_name['Features'] = _FEATURES +DESCRIPTOR.message_types_by_name['FeatureList'] = _FEATURELIST +DESCRIPTOR.message_types_by_name['FeatureLists'] = _FEATURELISTS +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +BytesList = _reflection.GeneratedProtocolMessageType('BytesList', (_message.Message,), dict( + DESCRIPTOR = _BYTESLIST, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.BytesList) + )) +_sym_db.RegisterMessage(BytesList) + +FloatList = _reflection.GeneratedProtocolMessageType('FloatList', (_message.Message,), dict( + DESCRIPTOR = _FLOATLIST, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FloatList) + )) +_sym_db.RegisterMessage(FloatList) + +Int64List = _reflection.GeneratedProtocolMessageType('Int64List', (_message.Message,), dict( + DESCRIPTOR = _INT64LIST, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Int64List) + )) +_sym_db.RegisterMessage(Int64List) + +Feature = _reflection.GeneratedProtocolMessageType('Feature', (_message.Message,), dict( + DESCRIPTOR = _FEATURE, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Feature) + )) +_sym_db.RegisterMessage(Feature) + +Features = _reflection.GeneratedProtocolMessageType('Features', (_message.Message,), dict( + + FeatureEntry = _reflection.GeneratedProtocolMessageType('FeatureEntry', (_message.Message,), dict( + DESCRIPTOR = _FEATURES_FEATUREENTRY, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Features.FeatureEntry) + )) + , + DESCRIPTOR = _FEATURES, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Features) + )) +_sym_db.RegisterMessage(Features) +_sym_db.RegisterMessage(Features.FeatureEntry) + +FeatureList = _reflection.GeneratedProtocolMessageType('FeatureList', (_message.Message,), dict( + DESCRIPTOR = _FEATURELIST, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FeatureList) + )) +_sym_db.RegisterMessage(FeatureList) + +FeatureLists = _reflection.GeneratedProtocolMessageType('FeatureLists', (_message.Message,), dict( + + FeatureListEntry = _reflection.GeneratedProtocolMessageType('FeatureListEntry', (_message.Message,), dict( + DESCRIPTOR = _FEATURELISTS_FEATURELISTENTRY, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FeatureLists.FeatureListEntry) + )) + , + DESCRIPTOR = _FEATURELISTS, + __module__ = 'diplomacy_tensorflow.core.example.feature_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FeatureLists) + )) +_sym_db.RegisterMessage(FeatureLists) +_sym_db.RegisterMessage(FeatureLists.FeatureListEntry) + + +DESCRIPTOR._options = None +_FLOATLIST.fields_by_name['value']._options = None +_INT64LIST.fields_by_name['value']._options = None +_FEATURES_FEATUREENTRY._options = None +_FEATURELISTS_FEATURELISTENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.pb.cc new file mode 100644 index 0000000..5322947 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.pb.cc @@ -0,0 +1,595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/allocation_description.proto + +#include "diplomacy_tensorflow/core/framework/allocation_description.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +class AllocationDescriptionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AllocationDescription_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto { +static void InitDefaultsAllocationDescription() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_AllocationDescription_default_instance_; + new (ptr) ::diplomacy::tensorflow::AllocationDescription(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::AllocationDescription::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_AllocationDescription = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAllocationDescription}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_AllocationDescription.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationDescription, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationDescription, requested_bytes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationDescription, allocated_bytes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationDescription, allocator_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationDescription, allocation_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationDescription, has_single_reference_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationDescription, ptr_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::AllocationDescription)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_AllocationDescription_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/allocation_description.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n@diplomacy_tensorflow/core/framework/al" + "location_description.proto\022\024diplomacy.te" + "nsorflow\"\243\001\n\025AllocationDescription\022\027\n\017re" + "quested_bytes\030\001 \001(\003\022\027\n\017allocated_bytes\030\002" + " \001(\003\022\026\n\016allocator_name\030\003 \001(\t\022\025\n\rallocati" + "on_id\030\004 \001(\003\022\034\n\024has_single_reference\030\005 \001(" + "\010\022\013\n\003ptr\030\006 \001(\004B{\n\030org.tensorflow.framewo" + "rkB\033AllocationDescriptionProtosP\001Z=githu" + "b.com/tensorflow/tensorflow/tensorflow/g" + "o/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 387); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/allocation_description.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void AllocationDescription::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AllocationDescription::kRequestedBytesFieldNumber; +const int AllocationDescription::kAllocatedBytesFieldNumber; +const int AllocationDescription::kAllocatorNameFieldNumber; +const int AllocationDescription::kAllocationIdFieldNumber; +const int AllocationDescription::kHasSingleReferenceFieldNumber; +const int AllocationDescription::kPtrFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AllocationDescription::AllocationDescription() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::scc_info_AllocationDescription.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.AllocationDescription) +} +AllocationDescription::AllocationDescription(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::scc_info_AllocationDescription.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.AllocationDescription) +} +AllocationDescription::AllocationDescription(const AllocationDescription& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.allocator_name().size() > 0) { + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.allocator_name(), + GetArenaNoVirtual()); + } + ::memcpy(&requested_bytes_, &from.requested_bytes_, + static_cast(reinterpret_cast(&has_single_reference_) - + reinterpret_cast(&requested_bytes_)) + sizeof(has_single_reference_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.AllocationDescription) +} + +void AllocationDescription::SharedCtor() { + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&requested_bytes_, 0, static_cast( + reinterpret_cast(&has_single_reference_) - + reinterpret_cast(&requested_bytes_)) + sizeof(has_single_reference_)); +} + +AllocationDescription::~AllocationDescription() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.AllocationDescription) + SharedDtor(); +} + +void AllocationDescription::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + allocator_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void AllocationDescription::ArenaDtor(void* object) { + AllocationDescription* _this = reinterpret_cast< AllocationDescription* >(object); + (void)_this; +} +void AllocationDescription::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AllocationDescription::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AllocationDescription::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AllocationDescription& AllocationDescription::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::scc_info_AllocationDescription.base); + return *internal_default_instance(); +} + + +void AllocationDescription::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.AllocationDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&requested_bytes_, 0, static_cast( + reinterpret_cast(&has_single_reference_) - + reinterpret_cast(&requested_bytes_)) + sizeof(has_single_reference_)); + _internal_metadata_.Clear(); +} + +bool AllocationDescription::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.AllocationDescription) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 requested_bytes = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &requested_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 allocated_bytes = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &allocated_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + // string allocator_name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_allocator_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.AllocationDescription.allocator_name")); + } else { + goto handle_unusual; + } + break; + } + + // int64 allocation_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &allocation_id_))); + } else { + goto handle_unusual; + } + break; + } + + // bool has_single_reference = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &has_single_reference_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 ptr = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &ptr_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.AllocationDescription) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.AllocationDescription) + return false; +#undef DO_ +} + +void AllocationDescription::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.AllocationDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 requested_bytes = 1; + if (this->requested_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->requested_bytes(), output); + } + + // int64 allocated_bytes = 2; + if (this->allocated_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->allocated_bytes(), output); + } + + // string allocator_name = 3; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.AllocationDescription.allocator_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->allocator_name(), output); + } + + // int64 allocation_id = 4; + if (this->allocation_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->allocation_id(), output); + } + + // bool has_single_reference = 5; + if (this->has_single_reference() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->has_single_reference(), output); + } + + // uint64 ptr = 6; + if (this->ptr() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(6, this->ptr(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.AllocationDescription) +} + +::google::protobuf::uint8* AllocationDescription::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.AllocationDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 requested_bytes = 1; + if (this->requested_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->requested_bytes(), target); + } + + // int64 allocated_bytes = 2; + if (this->allocated_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->allocated_bytes(), target); + } + + // string allocator_name = 3; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.AllocationDescription.allocator_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->allocator_name(), target); + } + + // int64 allocation_id = 4; + if (this->allocation_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->allocation_id(), target); + } + + // bool has_single_reference = 5; + if (this->has_single_reference() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->has_single_reference(), target); + } + + // uint64 ptr = 6; + if (this->ptr() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(6, this->ptr(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.AllocationDescription) + return target; +} + +size_t AllocationDescription::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.AllocationDescription) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string allocator_name = 3; + if (this->allocator_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->allocator_name()); + } + + // int64 requested_bytes = 1; + if (this->requested_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->requested_bytes()); + } + + // int64 allocated_bytes = 2; + if (this->allocated_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->allocated_bytes()); + } + + // int64 allocation_id = 4; + if (this->allocation_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->allocation_id()); + } + + // uint64 ptr = 6; + if (this->ptr() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->ptr()); + } + + // bool has_single_reference = 5; + if (this->has_single_reference() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AllocationDescription::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.AllocationDescription) + GOOGLE_DCHECK_NE(&from, this); + const AllocationDescription* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.AllocationDescription) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.AllocationDescription) + MergeFrom(*source); + } +} + +void AllocationDescription::MergeFrom(const AllocationDescription& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.AllocationDescription) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.allocator_name().size() > 0) { + set_allocator_name(from.allocator_name()); + } + if (from.requested_bytes() != 0) { + set_requested_bytes(from.requested_bytes()); + } + if (from.allocated_bytes() != 0) { + set_allocated_bytes(from.allocated_bytes()); + } + if (from.allocation_id() != 0) { + set_allocation_id(from.allocation_id()); + } + if (from.ptr() != 0) { + set_ptr(from.ptr()); + } + if (from.has_single_reference() != 0) { + set_has_single_reference(from.has_single_reference()); + } +} + +void AllocationDescription::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.AllocationDescription) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AllocationDescription::CopyFrom(const AllocationDescription& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.AllocationDescription) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AllocationDescription::IsInitialized() const { + return true; +} + +void AllocationDescription::Swap(AllocationDescription* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AllocationDescription* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void AllocationDescription::UnsafeArenaSwap(AllocationDescription* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AllocationDescription::InternalSwap(AllocationDescription* other) { + using std::swap; + allocator_name_.Swap(&other->allocator_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(requested_bytes_, other->requested_bytes_); + swap(allocated_bytes_, other->allocated_bytes_); + swap(allocation_id_, other->allocation_id_); + swap(ptr_, other->ptr_); + swap(has_single_reference_, other->has_single_reference_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AllocationDescription::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::AllocationDescription* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::AllocationDescription >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::AllocationDescription >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.pb.h new file mode 100644 index 0000000..5ad6cc6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.pb.h @@ -0,0 +1,400 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/allocation_description.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto +namespace diplomacy { +namespace tensorflow { +class AllocationDescription; +class AllocationDescriptionDefaultTypeInternal; +extern AllocationDescriptionDefaultTypeInternal _AllocationDescription_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::AllocationDescription* Arena::CreateMaybeMessage<::diplomacy::tensorflow::AllocationDescription>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class AllocationDescription : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.AllocationDescription) */ { + public: + AllocationDescription(); + virtual ~AllocationDescription(); + + AllocationDescription(const AllocationDescription& from); + + inline AllocationDescription& operator=(const AllocationDescription& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AllocationDescription(AllocationDescription&& from) noexcept + : AllocationDescription() { + *this = ::std::move(from); + } + + inline AllocationDescription& operator=(AllocationDescription&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AllocationDescription& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AllocationDescription* internal_default_instance() { + return reinterpret_cast( + &_AllocationDescription_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(AllocationDescription* other); + void Swap(AllocationDescription* other); + friend void swap(AllocationDescription& a, AllocationDescription& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AllocationDescription* New() const final { + return CreateMaybeMessage(NULL); + } + + AllocationDescription* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AllocationDescription& from); + void MergeFrom(const AllocationDescription& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AllocationDescription* other); + protected: + explicit AllocationDescription(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string allocator_name = 3; + void clear_allocator_name(); + static const int kAllocatorNameFieldNumber = 3; + const ::std::string& allocator_name() const; + void set_allocator_name(const ::std::string& value); + #if LANG_CXX11 + void set_allocator_name(::std::string&& value); + #endif + void set_allocator_name(const char* value); + void set_allocator_name(const char* value, size_t size); + ::std::string* mutable_allocator_name(); + ::std::string* release_allocator_name(); + void set_allocated_allocator_name(::std::string* allocator_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_allocator_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name); + + // int64 requested_bytes = 1; + void clear_requested_bytes(); + static const int kRequestedBytesFieldNumber = 1; + ::google::protobuf::int64 requested_bytes() const; + void set_requested_bytes(::google::protobuf::int64 value); + + // int64 allocated_bytes = 2; + void clear_allocated_bytes(); + static const int kAllocatedBytesFieldNumber = 2; + ::google::protobuf::int64 allocated_bytes() const; + void set_allocated_bytes(::google::protobuf::int64 value); + + // int64 allocation_id = 4; + void clear_allocation_id(); + static const int kAllocationIdFieldNumber = 4; + ::google::protobuf::int64 allocation_id() const; + void set_allocation_id(::google::protobuf::int64 value); + + // uint64 ptr = 6; + void clear_ptr(); + static const int kPtrFieldNumber = 6; + ::google::protobuf::uint64 ptr() const; + void set_ptr(::google::protobuf::uint64 value); + + // bool has_single_reference = 5; + void clear_has_single_reference(); + static const int kHasSingleReferenceFieldNumber = 5; + bool has_single_reference() const; + void set_has_single_reference(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AllocationDescription) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr allocator_name_; + ::google::protobuf::int64 requested_bytes_; + ::google::protobuf::int64 allocated_bytes_; + ::google::protobuf::int64 allocation_id_; + ::google::protobuf::uint64 ptr_; + bool has_single_reference_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// AllocationDescription + +// int64 requested_bytes = 1; +inline void AllocationDescription::clear_requested_bytes() { + requested_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocationDescription::requested_bytes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationDescription.requested_bytes) + return requested_bytes_; +} +inline void AllocationDescription::set_requested_bytes(::google::protobuf::int64 value) { + + requested_bytes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationDescription.requested_bytes) +} + +// int64 allocated_bytes = 2; +inline void AllocationDescription::clear_allocated_bytes() { + allocated_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocationDescription::allocated_bytes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationDescription.allocated_bytes) + return allocated_bytes_; +} +inline void AllocationDescription::set_allocated_bytes(::google::protobuf::int64 value) { + + allocated_bytes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationDescription.allocated_bytes) +} + +// string allocator_name = 3; +inline void AllocationDescription::clear_allocator_name() { + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& AllocationDescription::allocator_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationDescription.allocator_name) + return allocator_name_.Get(); +} +inline void AllocationDescription::set_allocator_name(const ::std::string& value) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationDescription.allocator_name) +} +#if LANG_CXX11 +inline void AllocationDescription::set_allocator_name(::std::string&& value) { + + allocator_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.AllocationDescription.allocator_name) +} +#endif +inline void AllocationDescription::set_allocator_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.AllocationDescription.allocator_name) +} +inline void AllocationDescription::set_allocator_name(const char* value, + size_t size) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.AllocationDescription.allocator_name) +} +inline ::std::string* AllocationDescription::mutable_allocator_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AllocationDescription.allocator_name) + return allocator_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* AllocationDescription::release_allocator_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AllocationDescription.allocator_name) + + return allocator_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void AllocationDescription::set_allocated_allocator_name(::std::string* allocator_name) { + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), allocator_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AllocationDescription.allocator_name) +} +inline ::std::string* AllocationDescription::unsafe_arena_release_allocator_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AllocationDescription.allocator_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return allocator_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void AllocationDescription::unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + allocator_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AllocationDescription.allocator_name) +} + +// int64 allocation_id = 4; +inline void AllocationDescription::clear_allocation_id() { + allocation_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocationDescription::allocation_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationDescription.allocation_id) + return allocation_id_; +} +inline void AllocationDescription::set_allocation_id(::google::protobuf::int64 value) { + + allocation_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationDescription.allocation_id) +} + +// bool has_single_reference = 5; +inline void AllocationDescription::clear_has_single_reference() { + has_single_reference_ = false; +} +inline bool AllocationDescription::has_single_reference() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationDescription.has_single_reference) + return has_single_reference_; +} +inline void AllocationDescription::set_has_single_reference(bool value) { + + has_single_reference_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationDescription.has_single_reference) +} + +// uint64 ptr = 6; +inline void AllocationDescription::clear_ptr() { + ptr_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 AllocationDescription::ptr() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationDescription.ptr) + return ptr_; +} +inline void AllocationDescription::set_ptr(::google::protobuf::uint64 value) { + + ptr_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationDescription.ptr) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.proto new file mode 100644 index 0000000..1575464 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "AllocationDescriptionProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +message AllocationDescription { + // Total number of bytes requested + int64 requested_bytes = 1; + + // Total number of bytes allocated if known + int64 allocated_bytes = 2; + + // Name of the allocator used + string allocator_name = 3; + + // Identifier of the allocated buffer if known + int64 allocation_id = 4; + + // Set if this tensor only has one remaining reference + bool has_single_reference = 5; + + // Address of the allocation. + uint64 ptr = 6; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description_pb2.py new file mode 100644 index 0000000..61e0de0 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/allocation_description_pb2.py @@ -0,0 +1,105 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/allocation_description.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/allocation_description.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\033AllocationDescriptionProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n@diplomacy_tensorflow/core/framework/allocation_description.proto\x12\x14\x64iplomacy.tensorflow\"\xa3\x01\n\x15\x41llocationDescription\x12\x17\n\x0frequested_bytes\x18\x01 \x01(\x03\x12\x17\n\x0f\x61llocated_bytes\x18\x02 \x01(\x03\x12\x16\n\x0e\x61llocator_name\x18\x03 \x01(\t\x12\x15\n\rallocation_id\x18\x04 \x01(\x03\x12\x1c\n\x14has_single_reference\x18\x05 \x01(\x08\x12\x0b\n\x03ptr\x18\x06 \x01(\x04\x42{\n\x18org.tensorflow.frameworkB\x1b\x41llocationDescriptionProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_ALLOCATIONDESCRIPTION = _descriptor.Descriptor( + name='AllocationDescription', + full_name='diplomacy.tensorflow.AllocationDescription', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='requested_bytes', full_name='diplomacy.tensorflow.AllocationDescription.requested_bytes', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='allocated_bytes', full_name='diplomacy.tensorflow.AllocationDescription.allocated_bytes', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='allocator_name', full_name='diplomacy.tensorflow.AllocationDescription.allocator_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='allocation_id', full_name='diplomacy.tensorflow.AllocationDescription.allocation_id', index=3, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='has_single_reference', full_name='diplomacy.tensorflow.AllocationDescription.has_single_reference', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='ptr', full_name='diplomacy.tensorflow.AllocationDescription.ptr', index=5, + number=6, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=91, + serialized_end=254, +) + +DESCRIPTOR.message_types_by_name['AllocationDescription'] = _ALLOCATIONDESCRIPTION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +AllocationDescription = _reflection.GeneratedProtocolMessageType('AllocationDescription', (_message.Message,), dict( + DESCRIPTOR = _ALLOCATIONDESCRIPTION, + __module__ = 'diplomacy_tensorflow.core.framework.allocation_description_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AllocationDescription) + )) +_sym_db.RegisterMessage(AllocationDescription) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.pb.cc new file mode 100644 index 0000000..cea7a16 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.pb.cc @@ -0,0 +1,2669 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/api_def.proto + +#include "diplomacy_tensorflow/core/framework/api_def.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ApiDef_Arg; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ApiDef_Endpoint; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_ApiDef_Attr; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_ApiDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace diplomacy { +namespace tensorflow { +class ApiDef_EndpointDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ApiDef_Endpoint_default_instance_; +class ApiDef_ArgDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ApiDef_Arg_default_instance_; +class ApiDef_AttrDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ApiDef_Attr_default_instance_; +class ApiDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ApiDef_default_instance_; +class ApiDefsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ApiDefs_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto { +static void InitDefaultsApiDef_Endpoint() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ApiDef_Endpoint_default_instance_; + new (ptr) ::diplomacy::tensorflow::ApiDef_Endpoint(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ApiDef_Endpoint::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ApiDef_Endpoint = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsApiDef_Endpoint}, {}}; + +static void InitDefaultsApiDef_Arg() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ApiDef_Arg_default_instance_; + new (ptr) ::diplomacy::tensorflow::ApiDef_Arg(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ApiDef_Arg::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ApiDef_Arg = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsApiDef_Arg}, {}}; + +static void InitDefaultsApiDef_Attr() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ApiDef_Attr_default_instance_; + new (ptr) ::diplomacy::tensorflow::ApiDef_Attr(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ApiDef_Attr::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ApiDef_Attr = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsApiDef_Attr}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base,}}; + +static void InitDefaultsApiDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ApiDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::ApiDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ApiDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_ApiDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsApiDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Endpoint.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Arg.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Attr.base,}}; + +static void InitDefaultsApiDefs() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ApiDefs_default_instance_; + new (ptr) ::diplomacy::tensorflow::ApiDefs(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ApiDefs::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_ApiDefs = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsApiDefs}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_ApiDef_Endpoint.base); + ::google::protobuf::internal::InitSCC(&scc_info_ApiDef_Arg.base); + ::google::protobuf::internal::InitSCC(&scc_info_ApiDef_Attr.base); + ::google::protobuf::internal::InitSCC(&scc_info_ApiDef.base); + ::google::protobuf::internal::InitSCC(&scc_info_ApiDefs.base); +} + +::google::protobuf::Metadata file_level_metadata[5]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Endpoint, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Endpoint, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Endpoint, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Endpoint, deprecation_version_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Arg, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Arg, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Arg, rename_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Arg, description_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Attr, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Attr, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Attr, rename_to_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Attr, default_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef_Attr, description_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, graph_op_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, deprecation_message_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, deprecation_version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, visibility_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, endpoint_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, in_arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, out_arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, arg_order_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, summary_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, description_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDef, description_suffix_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDefs, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ApiDefs, op_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::ApiDef_Endpoint)}, + { 8, -1, sizeof(::diplomacy::tensorflow::ApiDef_Arg)}, + { 16, -1, sizeof(::diplomacy::tensorflow::ApiDef_Attr)}, + { 25, -1, sizeof(::diplomacy::tensorflow::ApiDef)}, + { 43, -1, sizeof(::diplomacy::tensorflow::ApiDefs)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_ApiDef_Endpoint_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ApiDef_Arg_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ApiDef_Attr_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ApiDef_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_ApiDefs_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/api_def.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n1diplomacy_tensorflow/core/framework/ap" + "i_def.proto\022\024diplomacy.tensorflow\0324diplo" + "macy_tensorflow/core/framework/attr_valu" + "e.proto\"\235\006\n\006ApiDef\022\025\n\rgraph_op_name\030\001 \001(" + "\t\022\033\n\023deprecation_message\030\014 \001(\t\022\033\n\023deprec" + "ation_version\030\r \001(\005\022;\n\nvisibility\030\002 \001(\0162" + "\'.diplomacy.tensorflow.ApiDef.Visibility" + "\0227\n\010endpoint\030\003 \003(\0132%.diplomacy.tensorflo" + "w.ApiDef.Endpoint\0220\n\006in_arg\030\004 \003(\0132 .dipl" + "omacy.tensorflow.ApiDef.Arg\0221\n\007out_arg\030\005" + " \003(\0132 .diplomacy.tensorflow.ApiDef.Arg\022\021" + "\n\targ_order\030\013 \003(\t\022/\n\004attr\030\006 \003(\0132!.diplom" + "acy.tensorflow.ApiDef.Attr\022\017\n\007summary\030\007 " + "\001(\t\022\023\n\013description\030\010 \001(\t\022\032\n\022description_" + "prefix\030\t \001(\t\022\032\n\022description_suffix\030\n \001(\t" + "\032I\n\010Endpoint\022\014\n\004name\030\001 \001(\t\022\022\n\ndeprecated" + "\030\003 \001(\010\022\033\n\023deprecation_version\030\004 \001(\005\032;\n\003A" + "rg\022\014\n\004name\030\001 \001(\t\022\021\n\trename_to\030\002 \001(\t\022\023\n\013d" + "escription\030\003 \001(\t\032t\n\004Attr\022\014\n\004name\030\001 \001(\t\022\021" + "\n\trename_to\030\002 \001(\t\0226\n\rdefault_value\030\003 \001(\013" + "2\037.diplomacy.tensorflow.AttrValue\022\023\n\013des" + "cription\030\004 \001(\t\"G\n\nVisibility\022\026\n\022DEFAULT_" + "VISIBILITY\020\000\022\013\n\007VISIBLE\020\001\022\010\n\004SKIP\020\002\022\n\n\006H" + "IDDEN\020\003\"3\n\007ApiDefs\022(\n\002op\030\001 \003(\0132\034.diploma" + "cy.tensorflow.ApiDefBl\n\030org.tensorflow.f" + "rameworkB\014ApiDefProtosP\001Z=github.com/ten" + "sorflow/tensorflow/tensorflow/go/core/fr" + "amework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1098); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/api_def.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +const ::google::protobuf::EnumDescriptor* ApiDef_Visibility_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_enum_descriptors[0]; +} +bool ApiDef_Visibility_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const ApiDef_Visibility ApiDef::DEFAULT_VISIBILITY; +const ApiDef_Visibility ApiDef::VISIBLE; +const ApiDef_Visibility ApiDef::SKIP; +const ApiDef_Visibility ApiDef::HIDDEN; +const ApiDef_Visibility ApiDef::Visibility_MIN; +const ApiDef_Visibility ApiDef::Visibility_MAX; +const int ApiDef::Visibility_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void ApiDef_Endpoint::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ApiDef_Endpoint::kNameFieldNumber; +const int ApiDef_Endpoint::kDeprecatedFieldNumber; +const int ApiDef_Endpoint::kDeprecationVersionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ApiDef_Endpoint::ApiDef_Endpoint() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Endpoint.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ApiDef.Endpoint) +} +ApiDef_Endpoint::ApiDef_Endpoint(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Endpoint.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ApiDef.Endpoint) +} +ApiDef_Endpoint::ApiDef_Endpoint(const ApiDef_Endpoint& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + ::memcpy(&deprecated_, &from.deprecated_, + static_cast(reinterpret_cast(&deprecation_version_) - + reinterpret_cast(&deprecated_)) + sizeof(deprecation_version_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ApiDef.Endpoint) +} + +void ApiDef_Endpoint::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&deprecated_, 0, static_cast( + reinterpret_cast(&deprecation_version_) - + reinterpret_cast(&deprecated_)) + sizeof(deprecation_version_)); +} + +ApiDef_Endpoint::~ApiDef_Endpoint() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ApiDef.Endpoint) + SharedDtor(); +} + +void ApiDef_Endpoint::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ApiDef_Endpoint::ArenaDtor(void* object) { + ApiDef_Endpoint* _this = reinterpret_cast< ApiDef_Endpoint* >(object); + (void)_this; +} +void ApiDef_Endpoint::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ApiDef_Endpoint::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ApiDef_Endpoint::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ApiDef_Endpoint& ApiDef_Endpoint::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Endpoint.base); + return *internal_default_instance(); +} + + +void ApiDef_Endpoint::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ApiDef.Endpoint) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&deprecated_, 0, static_cast( + reinterpret_cast(&deprecation_version_) - + reinterpret_cast(&deprecated_)) + sizeof(deprecation_version_)); + _internal_metadata_.Clear(); +} + +bool ApiDef_Endpoint::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ApiDef.Endpoint) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.Endpoint.name")); + } else { + goto handle_unusual; + } + break; + } + + // bool deprecated = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 deprecation_version = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &deprecation_version_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ApiDef.Endpoint) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ApiDef.Endpoint) + return false; +#undef DO_ +} + +void ApiDef_Endpoint::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ApiDef.Endpoint) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Endpoint.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // bool deprecated = 3; + if (this->deprecated() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), output); + } + + // int32 deprecation_version = 4; + if (this->deprecation_version() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->deprecation_version(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ApiDef.Endpoint) +} + +::google::protobuf::uint8* ApiDef_Endpoint::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ApiDef.Endpoint) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Endpoint.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // bool deprecated = 3; + if (this->deprecated() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target); + } + + // int32 deprecation_version = 4; + if (this->deprecation_version() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->deprecation_version(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ApiDef.Endpoint) + return target; +} + +size_t ApiDef_Endpoint::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ApiDef.Endpoint) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // bool deprecated = 3; + if (this->deprecated() != 0) { + total_size += 1 + 1; + } + + // int32 deprecation_version = 4; + if (this->deprecation_version() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->deprecation_version()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ApiDef_Endpoint::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ApiDef.Endpoint) + GOOGLE_DCHECK_NE(&from, this); + const ApiDef_Endpoint* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ApiDef.Endpoint) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ApiDef.Endpoint) + MergeFrom(*source); + } +} + +void ApiDef_Endpoint::MergeFrom(const ApiDef_Endpoint& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ApiDef.Endpoint) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.deprecated() != 0) { + set_deprecated(from.deprecated()); + } + if (from.deprecation_version() != 0) { + set_deprecation_version(from.deprecation_version()); + } +} + +void ApiDef_Endpoint::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ApiDef.Endpoint) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ApiDef_Endpoint::CopyFrom(const ApiDef_Endpoint& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ApiDef.Endpoint) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ApiDef_Endpoint::IsInitialized() const { + return true; +} + +void ApiDef_Endpoint::Swap(ApiDef_Endpoint* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ApiDef_Endpoint* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ApiDef_Endpoint::UnsafeArenaSwap(ApiDef_Endpoint* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ApiDef_Endpoint::InternalSwap(ApiDef_Endpoint* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(deprecated_, other->deprecated_); + swap(deprecation_version_, other->deprecation_version_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ApiDef_Endpoint::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ApiDef_Arg::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ApiDef_Arg::kNameFieldNumber; +const int ApiDef_Arg::kRenameToFieldNumber; +const int ApiDef_Arg::kDescriptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ApiDef_Arg::ApiDef_Arg() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Arg.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ApiDef.Arg) +} +ApiDef_Arg::ApiDef_Arg(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Arg.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ApiDef.Arg) +} +ApiDef_Arg::ApiDef_Arg(const ApiDef_Arg& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + rename_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.rename_to().size() > 0) { + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.rename_to(), + GetArenaNoVirtual()); + } + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description().size() > 0) { + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ApiDef.Arg) +} + +void ApiDef_Arg::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + rename_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ApiDef_Arg::~ApiDef_Arg() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ApiDef.Arg) + SharedDtor(); +} + +void ApiDef_Arg::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + rename_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ApiDef_Arg::ArenaDtor(void* object) { + ApiDef_Arg* _this = reinterpret_cast< ApiDef_Arg* >(object); + (void)_this; +} +void ApiDef_Arg::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ApiDef_Arg::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ApiDef_Arg::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ApiDef_Arg& ApiDef_Arg::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Arg.base); + return *internal_default_instance(); +} + + +void ApiDef_Arg::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ApiDef.Arg) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + rename_to_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool ApiDef_Arg::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ApiDef.Arg) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.Arg.name")); + } else { + goto handle_unusual; + } + break; + } + + // string rename_to = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_rename_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rename_to().data(), static_cast(this->rename_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.Arg.rename_to")); + } else { + goto handle_unusual; + } + break; + } + + // string description = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.Arg.description")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ApiDef.Arg) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ApiDef.Arg) + return false; +#undef DO_ +} + +void ApiDef_Arg::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ApiDef.Arg) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Arg.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string rename_to = 2; + if (this->rename_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rename_to().data(), static_cast(this->rename_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Arg.rename_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->rename_to(), output); + } + + // string description = 3; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Arg.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->description(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ApiDef.Arg) +} + +::google::protobuf::uint8* ApiDef_Arg::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ApiDef.Arg) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Arg.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string rename_to = 2; + if (this->rename_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rename_to().data(), static_cast(this->rename_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Arg.rename_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->rename_to(), target); + } + + // string description = 3; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Arg.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->description(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ApiDef.Arg) + return target; +} + +size_t ApiDef_Arg::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ApiDef.Arg) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string rename_to = 2; + if (this->rename_to().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->rename_to()); + } + + // string description = 3; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ApiDef_Arg::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ApiDef.Arg) + GOOGLE_DCHECK_NE(&from, this); + const ApiDef_Arg* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ApiDef.Arg) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ApiDef.Arg) + MergeFrom(*source); + } +} + +void ApiDef_Arg::MergeFrom(const ApiDef_Arg& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ApiDef.Arg) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.rename_to().size() > 0) { + set_rename_to(from.rename_to()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } +} + +void ApiDef_Arg::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ApiDef.Arg) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ApiDef_Arg::CopyFrom(const ApiDef_Arg& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ApiDef.Arg) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ApiDef_Arg::IsInitialized() const { + return true; +} + +void ApiDef_Arg::Swap(ApiDef_Arg* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ApiDef_Arg* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ApiDef_Arg::UnsafeArenaSwap(ApiDef_Arg* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ApiDef_Arg::InternalSwap(ApiDef_Arg* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + rename_to_.Swap(&other->rename_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_.Swap(&other->description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ApiDef_Arg::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ApiDef_Attr::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_ApiDef_Attr_default_instance_._instance.get_mutable()->default_value_ = const_cast< ::diplomacy::tensorflow::AttrValue*>( + ::diplomacy::tensorflow::AttrValue::internal_default_instance()); +} +void ApiDef_Attr::unsafe_arena_set_allocated_default_value( + ::diplomacy::tensorflow::AttrValue* default_value) { + if (GetArenaNoVirtual() == NULL) { + delete default_value_; + } + default_value_ = default_value; + if (default_value) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Attr.default_value) +} +void ApiDef_Attr::clear_default_value() { + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) { + delete default_value_; + } + default_value_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ApiDef_Attr::kNameFieldNumber; +const int ApiDef_Attr::kRenameToFieldNumber; +const int ApiDef_Attr::kDefaultValueFieldNumber; +const int ApiDef_Attr::kDescriptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ApiDef_Attr::ApiDef_Attr() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Attr.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ApiDef.Attr) +} +ApiDef_Attr::ApiDef_Attr(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Attr.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ApiDef.Attr) +} +ApiDef_Attr::ApiDef_Attr(const ApiDef_Attr& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + rename_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.rename_to().size() > 0) { + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.rename_to(), + GetArenaNoVirtual()); + } + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description().size() > 0) { + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(), + GetArenaNoVirtual()); + } + if (from.has_default_value()) { + default_value_ = new ::diplomacy::tensorflow::AttrValue(*from.default_value_); + } else { + default_value_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ApiDef.Attr) +} + +void ApiDef_Attr::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + rename_to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + default_value_ = NULL; +} + +ApiDef_Attr::~ApiDef_Attr() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ApiDef.Attr) + SharedDtor(); +} + +void ApiDef_Attr::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + rename_to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete default_value_; +} + +void ApiDef_Attr::ArenaDtor(void* object) { + ApiDef_Attr* _this = reinterpret_cast< ApiDef_Attr* >(object); + (void)_this; +} +void ApiDef_Attr::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ApiDef_Attr::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ApiDef_Attr::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ApiDef_Attr& ApiDef_Attr::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef_Attr.base); + return *internal_default_instance(); +} + + +void ApiDef_Attr::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ApiDef.Attr) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + rename_to_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) { + delete default_value_; + } + default_value_ = NULL; + _internal_metadata_.Clear(); +} + +bool ApiDef_Attr::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ApiDef.Attr) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.Attr.name")); + } else { + goto handle_unusual; + } + break; + } + + // string rename_to = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_rename_to())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rename_to().data(), static_cast(this->rename_to().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.Attr.rename_to")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_default_value())); + } else { + goto handle_unusual; + } + break; + } + + // string description = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.Attr.description")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ApiDef.Attr) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ApiDef.Attr) + return false; +#undef DO_ +} + +void ApiDef_Attr::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ApiDef.Attr) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Attr.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string rename_to = 2; + if (this->rename_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rename_to().data(), static_cast(this->rename_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Attr.rename_to"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->rename_to(), output); + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_default_value(), output); + } + + // string description = 4; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Attr.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->description(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ApiDef.Attr) +} + +::google::protobuf::uint8* ApiDef_Attr::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ApiDef.Attr) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Attr.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string rename_to = 2; + if (this->rename_to().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->rename_to().data(), static_cast(this->rename_to().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Attr.rename_to"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->rename_to(), target); + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_default_value(), deterministic, target); + } + + // string description = 4; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.Attr.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->description(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ApiDef.Attr) + return target; +} + +size_t ApiDef_Attr::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ApiDef.Attr) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string rename_to = 2; + if (this->rename_to().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->rename_to()); + } + + // string description = 4; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *default_value_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ApiDef_Attr::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ApiDef.Attr) + GOOGLE_DCHECK_NE(&from, this); + const ApiDef_Attr* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ApiDef.Attr) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ApiDef.Attr) + MergeFrom(*source); + } +} + +void ApiDef_Attr::MergeFrom(const ApiDef_Attr& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ApiDef.Attr) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.rename_to().size() > 0) { + set_rename_to(from.rename_to()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.has_default_value()) { + mutable_default_value()->::diplomacy::tensorflow::AttrValue::MergeFrom(from.default_value()); + } +} + +void ApiDef_Attr::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ApiDef.Attr) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ApiDef_Attr::CopyFrom(const ApiDef_Attr& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ApiDef.Attr) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ApiDef_Attr::IsInitialized() const { + return true; +} + +void ApiDef_Attr::Swap(ApiDef_Attr* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ApiDef_Attr* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ApiDef_Attr::UnsafeArenaSwap(ApiDef_Attr* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ApiDef_Attr::InternalSwap(ApiDef_Attr* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + rename_to_.Swap(&other->rename_to_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_.Swap(&other->description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(default_value_, other->default_value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ApiDef_Attr::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ApiDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ApiDef::kGraphOpNameFieldNumber; +const int ApiDef::kDeprecationMessageFieldNumber; +const int ApiDef::kDeprecationVersionFieldNumber; +const int ApiDef::kVisibilityFieldNumber; +const int ApiDef::kEndpointFieldNumber; +const int ApiDef::kInArgFieldNumber; +const int ApiDef::kOutArgFieldNumber; +const int ApiDef::kArgOrderFieldNumber; +const int ApiDef::kAttrFieldNumber; +const int ApiDef::kSummaryFieldNumber; +const int ApiDef::kDescriptionFieldNumber; +const int ApiDef::kDescriptionPrefixFieldNumber; +const int ApiDef::kDescriptionSuffixFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ApiDef::ApiDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ApiDef) +} +ApiDef::ApiDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + endpoint_(arena), + in_arg_(arena), + out_arg_(arena), + attr_(arena), + arg_order_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ApiDef) +} +ApiDef::ApiDef(const ApiDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + endpoint_(from.endpoint_), + in_arg_(from.in_arg_), + out_arg_(from.out_arg_), + attr_(from.attr_), + arg_order_(from.arg_order_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + graph_op_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.graph_op_name().size() > 0) { + graph_op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.graph_op_name(), + GetArenaNoVirtual()); + } + summary_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.summary().size() > 0) { + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.summary(), + GetArenaNoVirtual()); + } + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description().size() > 0) { + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(), + GetArenaNoVirtual()); + } + description_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description_prefix().size() > 0) { + description_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description_prefix(), + GetArenaNoVirtual()); + } + description_suffix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description_suffix().size() > 0) { + description_suffix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description_suffix(), + GetArenaNoVirtual()); + } + deprecation_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.deprecation_message().size() > 0) { + deprecation_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.deprecation_message(), + GetArenaNoVirtual()); + } + ::memcpy(&visibility_, &from.visibility_, + static_cast(reinterpret_cast(&deprecation_version_) - + reinterpret_cast(&visibility_)) + sizeof(deprecation_version_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ApiDef) +} + +void ApiDef::SharedCtor() { + graph_op_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + summary_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_suffix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + deprecation_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&visibility_, 0, static_cast( + reinterpret_cast(&deprecation_version_) - + reinterpret_cast(&visibility_)) + sizeof(deprecation_version_)); +} + +ApiDef::~ApiDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ApiDef) + SharedDtor(); +} + +void ApiDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + graph_op_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + summary_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_suffix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + deprecation_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ApiDef::ArenaDtor(void* object) { + ApiDef* _this = reinterpret_cast< ApiDef* >(object); + (void)_this; +} +void ApiDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ApiDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ApiDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ApiDef& ApiDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDef.base); + return *internal_default_instance(); +} + + +void ApiDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ApiDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + endpoint_.Clear(); + in_arg_.Clear(); + out_arg_.Clear(); + attr_.Clear(); + arg_order_.Clear(); + graph_op_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_suffix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + deprecation_message_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&visibility_, 0, static_cast( + reinterpret_cast(&deprecation_version_) - + reinterpret_cast(&visibility_)) + sizeof(deprecation_version_)); + _internal_metadata_.Clear(); +} + +bool ApiDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ApiDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string graph_op_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_graph_op_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_op_name().data(), static_cast(this->graph_op_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.graph_op_name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.ApiDef.Visibility visibility = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_visibility(static_cast< ::diplomacy::tensorflow::ApiDef_Visibility >(value)); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.ApiDef.Endpoint endpoint = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_endpoint())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg in_arg = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_in_arg())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg out_arg = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_out_arg())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.ApiDef.Attr attr = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_attr())); + } else { + goto handle_unusual; + } + break; + } + + // string summary = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_summary())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), static_cast(this->summary().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.summary")); + } else { + goto handle_unusual; + } + break; + } + + // string description = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.description")); + } else { + goto handle_unusual; + } + break; + } + + // string description_prefix = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description_prefix())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description_prefix().data(), static_cast(this->description_prefix().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.description_prefix")); + } else { + goto handle_unusual; + } + break; + } + + // string description_suffix = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description_suffix())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description_suffix().data(), static_cast(this->description_suffix().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.description_suffix")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string arg_order = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_arg_order())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->arg_order(this->arg_order_size() - 1).data(), + static_cast(this->arg_order(this->arg_order_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.arg_order")); + } else { + goto handle_unusual; + } + break; + } + + // string deprecation_message = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_deprecation_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->deprecation_message().data(), static_cast(this->deprecation_message().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ApiDef.deprecation_message")); + } else { + goto handle_unusual; + } + break; + } + + // int32 deprecation_version = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &deprecation_version_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ApiDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ApiDef) + return false; +#undef DO_ +} + +void ApiDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ApiDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string graph_op_name = 1; + if (this->graph_op_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_op_name().data(), static_cast(this->graph_op_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.graph_op_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->graph_op_name(), output); + } + + // .diplomacy.tensorflow.ApiDef.Visibility visibility = 2; + if (this->visibility() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->visibility(), output); + } + + // repeated .diplomacy.tensorflow.ApiDef.Endpoint endpoint = 3; + for (unsigned int i = 0, + n = static_cast(this->endpoint_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->endpoint(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg in_arg = 4; + for (unsigned int i = 0, + n = static_cast(this->in_arg_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->in_arg(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg out_arg = 5; + for (unsigned int i = 0, + n = static_cast(this->out_arg_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, + this->out_arg(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.ApiDef.Attr attr = 6; + for (unsigned int i = 0, + n = static_cast(this->attr_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, + this->attr(static_cast(i)), + output); + } + + // string summary = 7; + if (this->summary().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), static_cast(this->summary().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.summary"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->summary(), output); + } + + // string description = 8; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 8, this->description(), output); + } + + // string description_prefix = 9; + if (this->description_prefix().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description_prefix().data(), static_cast(this->description_prefix().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.description_prefix"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 9, this->description_prefix(), output); + } + + // string description_suffix = 10; + if (this->description_suffix().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description_suffix().data(), static_cast(this->description_suffix().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.description_suffix"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 10, this->description_suffix(), output); + } + + // repeated string arg_order = 11; + for (int i = 0, n = this->arg_order_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->arg_order(i).data(), static_cast(this->arg_order(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.arg_order"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 11, this->arg_order(i), output); + } + + // string deprecation_message = 12; + if (this->deprecation_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->deprecation_message().data(), static_cast(this->deprecation_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.deprecation_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 12, this->deprecation_message(), output); + } + + // int32 deprecation_version = 13; + if (this->deprecation_version() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->deprecation_version(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ApiDef) +} + +::google::protobuf::uint8* ApiDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ApiDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string graph_op_name = 1; + if (this->graph_op_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_op_name().data(), static_cast(this->graph_op_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.graph_op_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->graph_op_name(), target); + } + + // .diplomacy.tensorflow.ApiDef.Visibility visibility = 2; + if (this->visibility() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->visibility(), target); + } + + // repeated .diplomacy.tensorflow.ApiDef.Endpoint endpoint = 3; + for (unsigned int i = 0, + n = static_cast(this->endpoint_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->endpoint(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg in_arg = 4; + for (unsigned int i = 0, + n = static_cast(this->in_arg_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->in_arg(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg out_arg = 5; + for (unsigned int i = 0, + n = static_cast(this->out_arg_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->out_arg(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.ApiDef.Attr attr = 6; + for (unsigned int i = 0, + n = static_cast(this->attr_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->attr(static_cast(i)), deterministic, target); + } + + // string summary = 7; + if (this->summary().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), static_cast(this->summary().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.summary"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->summary(), target); + } + + // string description = 8; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 8, this->description(), target); + } + + // string description_prefix = 9; + if (this->description_prefix().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description_prefix().data(), static_cast(this->description_prefix().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.description_prefix"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 9, this->description_prefix(), target); + } + + // string description_suffix = 10; + if (this->description_suffix().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description_suffix().data(), static_cast(this->description_suffix().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.description_suffix"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 10, this->description_suffix(), target); + } + + // repeated string arg_order = 11; + for (int i = 0, n = this->arg_order_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->arg_order(i).data(), static_cast(this->arg_order(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.arg_order"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(11, this->arg_order(i), target); + } + + // string deprecation_message = 12; + if (this->deprecation_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->deprecation_message().data(), static_cast(this->deprecation_message().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ApiDef.deprecation_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 12, this->deprecation_message(), target); + } + + // int32 deprecation_version = 13; + if (this->deprecation_version() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->deprecation_version(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ApiDef) + return target; +} + +size_t ApiDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ApiDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.ApiDef.Endpoint endpoint = 3; + { + unsigned int count = static_cast(this->endpoint_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->endpoint(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg in_arg = 4; + { + unsigned int count = static_cast(this->in_arg_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->in_arg(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.ApiDef.Arg out_arg = 5; + { + unsigned int count = static_cast(this->out_arg_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->out_arg(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.ApiDef.Attr attr = 6; + { + unsigned int count = static_cast(this->attr_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->attr(static_cast(i))); + } + } + + // repeated string arg_order = 11; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->arg_order_size()); + for (int i = 0, n = this->arg_order_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->arg_order(i)); + } + + // string graph_op_name = 1; + if (this->graph_op_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->graph_op_name()); + } + + // string summary = 7; + if (this->summary().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->summary()); + } + + // string description = 8; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // string description_prefix = 9; + if (this->description_prefix().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description_prefix()); + } + + // string description_suffix = 10; + if (this->description_suffix().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description_suffix()); + } + + // string deprecation_message = 12; + if (this->deprecation_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->deprecation_message()); + } + + // .diplomacy.tensorflow.ApiDef.Visibility visibility = 2; + if (this->visibility() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->visibility()); + } + + // int32 deprecation_version = 13; + if (this->deprecation_version() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->deprecation_version()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ApiDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ApiDef) + GOOGLE_DCHECK_NE(&from, this); + const ApiDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ApiDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ApiDef) + MergeFrom(*source); + } +} + +void ApiDef::MergeFrom(const ApiDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ApiDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + endpoint_.MergeFrom(from.endpoint_); + in_arg_.MergeFrom(from.in_arg_); + out_arg_.MergeFrom(from.out_arg_); + attr_.MergeFrom(from.attr_); + arg_order_.MergeFrom(from.arg_order_); + if (from.graph_op_name().size() > 0) { + set_graph_op_name(from.graph_op_name()); + } + if (from.summary().size() > 0) { + set_summary(from.summary()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.description_prefix().size() > 0) { + set_description_prefix(from.description_prefix()); + } + if (from.description_suffix().size() > 0) { + set_description_suffix(from.description_suffix()); + } + if (from.deprecation_message().size() > 0) { + set_deprecation_message(from.deprecation_message()); + } + if (from.visibility() != 0) { + set_visibility(from.visibility()); + } + if (from.deprecation_version() != 0) { + set_deprecation_version(from.deprecation_version()); + } +} + +void ApiDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ApiDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ApiDef::CopyFrom(const ApiDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ApiDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ApiDef::IsInitialized() const { + return true; +} + +void ApiDef::Swap(ApiDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ApiDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ApiDef::UnsafeArenaSwap(ApiDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ApiDef::InternalSwap(ApiDef* other) { + using std::swap; + CastToBase(&endpoint_)->InternalSwap(CastToBase(&other->endpoint_)); + CastToBase(&in_arg_)->InternalSwap(CastToBase(&other->in_arg_)); + CastToBase(&out_arg_)->InternalSwap(CastToBase(&other->out_arg_)); + CastToBase(&attr_)->InternalSwap(CastToBase(&other->attr_)); + arg_order_.InternalSwap(CastToBase(&other->arg_order_)); + graph_op_name_.Swap(&other->graph_op_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + summary_.Swap(&other->summary_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_.Swap(&other->description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_prefix_.Swap(&other->description_prefix_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_suffix_.Swap(&other->description_suffix_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + deprecation_message_.Swap(&other->deprecation_message_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(visibility_, other->visibility_); + swap(deprecation_version_, other->deprecation_version_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ApiDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void ApiDefs::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ApiDefs::kOpFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ApiDefs::ApiDefs() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDefs.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ApiDefs) +} +ApiDefs::ApiDefs(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + op_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDefs.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ApiDefs) +} +ApiDefs::ApiDefs(const ApiDefs& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + op_(from.op_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ApiDefs) +} + +void ApiDefs::SharedCtor() { +} + +ApiDefs::~ApiDefs() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ApiDefs) + SharedDtor(); +} + +void ApiDefs::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void ApiDefs::ArenaDtor(void* object) { + ApiDefs* _this = reinterpret_cast< ApiDefs* >(object); + (void)_this; +} +void ApiDefs::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ApiDefs::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ApiDefs::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ApiDefs& ApiDefs::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::scc_info_ApiDefs.base); + return *internal_default_instance(); +} + + +void ApiDefs::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ApiDefs) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + op_.Clear(); + _internal_metadata_.Clear(); +} + +bool ApiDefs::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ApiDefs) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.ApiDef op = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_op())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ApiDefs) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ApiDefs) + return false; +#undef DO_ +} + +void ApiDefs::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ApiDefs) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.ApiDef op = 1; + for (unsigned int i = 0, + n = static_cast(this->op_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->op(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ApiDefs) +} + +::google::protobuf::uint8* ApiDefs::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ApiDefs) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.ApiDef op = 1; + for (unsigned int i = 0, + n = static_cast(this->op_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->op(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ApiDefs) + return target; +} + +size_t ApiDefs::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ApiDefs) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.ApiDef op = 1; + { + unsigned int count = static_cast(this->op_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->op(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ApiDefs::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ApiDefs) + GOOGLE_DCHECK_NE(&from, this); + const ApiDefs* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ApiDefs) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ApiDefs) + MergeFrom(*source); + } +} + +void ApiDefs::MergeFrom(const ApiDefs& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ApiDefs) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + op_.MergeFrom(from.op_); +} + +void ApiDefs::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ApiDefs) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ApiDefs::CopyFrom(const ApiDefs& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ApiDefs) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ApiDefs::IsInitialized() const { + return true; +} + +void ApiDefs::Swap(ApiDefs* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ApiDefs* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ApiDefs::UnsafeArenaSwap(ApiDefs* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ApiDefs::InternalSwap(ApiDefs* other) { + using std::swap; + CastToBase(&op_)->InternalSwap(CastToBase(&other->op_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ApiDefs::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ApiDef_Endpoint* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ApiDef_Endpoint >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ApiDef_Endpoint >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ApiDef_Arg* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ApiDef_Arg >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ApiDef_Arg >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ApiDef_Attr* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ApiDef_Attr >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ApiDef_Attr >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ApiDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ApiDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ApiDef >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ApiDefs* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ApiDefs >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ApiDefs >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.pb.h new file mode 100644 index 0000000..5af0e52 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.pb.h @@ -0,0 +1,2504 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/api_def.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "diplomacy_tensorflow/core/framework/attr_value.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[5]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class ApiDef; +class ApiDefDefaultTypeInternal; +extern ApiDefDefaultTypeInternal _ApiDef_default_instance_; +class ApiDef_Arg; +class ApiDef_ArgDefaultTypeInternal; +extern ApiDef_ArgDefaultTypeInternal _ApiDef_Arg_default_instance_; +class ApiDef_Attr; +class ApiDef_AttrDefaultTypeInternal; +extern ApiDef_AttrDefaultTypeInternal _ApiDef_Attr_default_instance_; +class ApiDef_Endpoint; +class ApiDef_EndpointDefaultTypeInternal; +extern ApiDef_EndpointDefaultTypeInternal _ApiDef_Endpoint_default_instance_; +class ApiDefs; +class ApiDefsDefaultTypeInternal; +extern ApiDefsDefaultTypeInternal _ApiDefs_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::ApiDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ApiDef>(Arena*); +template<> ::diplomacy::tensorflow::ApiDef_Arg* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ApiDef_Arg>(Arena*); +template<> ::diplomacy::tensorflow::ApiDef_Attr* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ApiDef_Attr>(Arena*); +template<> ::diplomacy::tensorflow::ApiDef_Endpoint* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ApiDef_Endpoint>(Arena*); +template<> ::diplomacy::tensorflow::ApiDefs* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ApiDefs>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +enum ApiDef_Visibility { + ApiDef_Visibility_DEFAULT_VISIBILITY = 0, + ApiDef_Visibility_VISIBLE = 1, + ApiDef_Visibility_SKIP = 2, + ApiDef_Visibility_HIDDEN = 3, + ApiDef_Visibility_ApiDef_Visibility_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + ApiDef_Visibility_ApiDef_Visibility_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool ApiDef_Visibility_IsValid(int value); +const ApiDef_Visibility ApiDef_Visibility_Visibility_MIN = ApiDef_Visibility_DEFAULT_VISIBILITY; +const ApiDef_Visibility ApiDef_Visibility_Visibility_MAX = ApiDef_Visibility_HIDDEN; +const int ApiDef_Visibility_Visibility_ARRAYSIZE = ApiDef_Visibility_Visibility_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ApiDef_Visibility_descriptor(); +inline const ::std::string& ApiDef_Visibility_Name(ApiDef_Visibility value) { + return ::google::protobuf::internal::NameOfEnum( + ApiDef_Visibility_descriptor(), value); +} +inline bool ApiDef_Visibility_Parse( + const ::std::string& name, ApiDef_Visibility* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ApiDef_Visibility_descriptor(), name, value); +} +// =================================================================== + +class ApiDef_Endpoint : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ApiDef.Endpoint) */ { + public: + ApiDef_Endpoint(); + virtual ~ApiDef_Endpoint(); + + ApiDef_Endpoint(const ApiDef_Endpoint& from); + + inline ApiDef_Endpoint& operator=(const ApiDef_Endpoint& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ApiDef_Endpoint(ApiDef_Endpoint&& from) noexcept + : ApiDef_Endpoint() { + *this = ::std::move(from); + } + + inline ApiDef_Endpoint& operator=(ApiDef_Endpoint&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ApiDef_Endpoint& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ApiDef_Endpoint* internal_default_instance() { + return reinterpret_cast( + &_ApiDef_Endpoint_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(ApiDef_Endpoint* other); + void Swap(ApiDef_Endpoint* other); + friend void swap(ApiDef_Endpoint& a, ApiDef_Endpoint& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ApiDef_Endpoint* New() const final { + return CreateMaybeMessage(NULL); + } + + ApiDef_Endpoint* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ApiDef_Endpoint& from); + void MergeFrom(const ApiDef_Endpoint& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ApiDef_Endpoint* other); + protected: + explicit ApiDef_Endpoint(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // bool deprecated = 3; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 3; + bool deprecated() const; + void set_deprecated(bool value); + + // int32 deprecation_version = 4; + void clear_deprecation_version(); + static const int kDeprecationVersionFieldNumber = 4; + ::google::protobuf::int32 deprecation_version() const; + void set_deprecation_version(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef.Endpoint) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + bool deprecated_; + ::google::protobuf::int32 deprecation_version_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ApiDef_Arg : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ApiDef.Arg) */ { + public: + ApiDef_Arg(); + virtual ~ApiDef_Arg(); + + ApiDef_Arg(const ApiDef_Arg& from); + + inline ApiDef_Arg& operator=(const ApiDef_Arg& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ApiDef_Arg(ApiDef_Arg&& from) noexcept + : ApiDef_Arg() { + *this = ::std::move(from); + } + + inline ApiDef_Arg& operator=(ApiDef_Arg&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ApiDef_Arg& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ApiDef_Arg* internal_default_instance() { + return reinterpret_cast( + &_ApiDef_Arg_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(ApiDef_Arg* other); + void Swap(ApiDef_Arg* other); + friend void swap(ApiDef_Arg& a, ApiDef_Arg& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ApiDef_Arg* New() const final { + return CreateMaybeMessage(NULL); + } + + ApiDef_Arg* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ApiDef_Arg& from); + void MergeFrom(const ApiDef_Arg& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ApiDef_Arg* other); + protected: + explicit ApiDef_Arg(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string rename_to = 2; + void clear_rename_to(); + static const int kRenameToFieldNumber = 2; + const ::std::string& rename_to() const; + void set_rename_to(const ::std::string& value); + #if LANG_CXX11 + void set_rename_to(::std::string&& value); + #endif + void set_rename_to(const char* value); + void set_rename_to(const char* value, size_t size); + ::std::string* mutable_rename_to(); + ::std::string* release_rename_to(); + void set_allocated_rename_to(::std::string* rename_to); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_rename_to(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_rename_to( + ::std::string* rename_to); + + // string description = 3; + void clear_description(); + static const int kDescriptionFieldNumber = 3; + const ::std::string& description() const; + void set_description(const ::std::string& value); + #if LANG_CXX11 + void set_description(::std::string&& value); + #endif + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef.Arg) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr rename_to_; + ::google::protobuf::internal::ArenaStringPtr description_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ApiDef_Attr : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ApiDef.Attr) */ { + public: + ApiDef_Attr(); + virtual ~ApiDef_Attr(); + + ApiDef_Attr(const ApiDef_Attr& from); + + inline ApiDef_Attr& operator=(const ApiDef_Attr& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ApiDef_Attr(ApiDef_Attr&& from) noexcept + : ApiDef_Attr() { + *this = ::std::move(from); + } + + inline ApiDef_Attr& operator=(ApiDef_Attr&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ApiDef_Attr& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ApiDef_Attr* internal_default_instance() { + return reinterpret_cast( + &_ApiDef_Attr_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(ApiDef_Attr* other); + void Swap(ApiDef_Attr* other); + friend void swap(ApiDef_Attr& a, ApiDef_Attr& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ApiDef_Attr* New() const final { + return CreateMaybeMessage(NULL); + } + + ApiDef_Attr* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ApiDef_Attr& from); + void MergeFrom(const ApiDef_Attr& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ApiDef_Attr* other); + protected: + explicit ApiDef_Attr(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string rename_to = 2; + void clear_rename_to(); + static const int kRenameToFieldNumber = 2; + const ::std::string& rename_to() const; + void set_rename_to(const ::std::string& value); + #if LANG_CXX11 + void set_rename_to(::std::string&& value); + #endif + void set_rename_to(const char* value); + void set_rename_to(const char* value, size_t size); + ::std::string* mutable_rename_to(); + ::std::string* release_rename_to(); + void set_allocated_rename_to(::std::string* rename_to); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_rename_to(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_rename_to( + ::std::string* rename_to); + + // string description = 4; + void clear_description(); + static const int kDescriptionFieldNumber = 4; + const ::std::string& description() const; + void set_description(const ::std::string& value); + #if LANG_CXX11 + void set_description(::std::string&& value); + #endif + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // .diplomacy.tensorflow.AttrValue default_value = 3; + bool has_default_value() const; + void clear_default_value(); + static const int kDefaultValueFieldNumber = 3; + private: + const ::diplomacy::tensorflow::AttrValue& _internal_default_value() const; + public: + const ::diplomacy::tensorflow::AttrValue& default_value() const; + ::diplomacy::tensorflow::AttrValue* release_default_value(); + ::diplomacy::tensorflow::AttrValue* mutable_default_value(); + void set_allocated_default_value(::diplomacy::tensorflow::AttrValue* default_value); + void unsafe_arena_set_allocated_default_value( + ::diplomacy::tensorflow::AttrValue* default_value); + ::diplomacy::tensorflow::AttrValue* unsafe_arena_release_default_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef.Attr) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr rename_to_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::diplomacy::tensorflow::AttrValue* default_value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ApiDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ApiDef) */ { + public: + ApiDef(); + virtual ~ApiDef(); + + ApiDef(const ApiDef& from); + + inline ApiDef& operator=(const ApiDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ApiDef(ApiDef&& from) noexcept + : ApiDef() { + *this = ::std::move(from); + } + + inline ApiDef& operator=(ApiDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ApiDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ApiDef* internal_default_instance() { + return reinterpret_cast( + &_ApiDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(ApiDef* other); + void Swap(ApiDef* other); + friend void swap(ApiDef& a, ApiDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ApiDef* New() const final { + return CreateMaybeMessage(NULL); + } + + ApiDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ApiDef& from); + void MergeFrom(const ApiDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ApiDef* other); + protected: + explicit ApiDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef ApiDef_Endpoint Endpoint; + typedef ApiDef_Arg Arg; + typedef ApiDef_Attr Attr; + + typedef ApiDef_Visibility Visibility; + static const Visibility DEFAULT_VISIBILITY = + ApiDef_Visibility_DEFAULT_VISIBILITY; + static const Visibility VISIBLE = + ApiDef_Visibility_VISIBLE; + static const Visibility SKIP = + ApiDef_Visibility_SKIP; + static const Visibility HIDDEN = + ApiDef_Visibility_HIDDEN; + static inline bool Visibility_IsValid(int value) { + return ApiDef_Visibility_IsValid(value); + } + static const Visibility Visibility_MIN = + ApiDef_Visibility_Visibility_MIN; + static const Visibility Visibility_MAX = + ApiDef_Visibility_Visibility_MAX; + static const int Visibility_ARRAYSIZE = + ApiDef_Visibility_Visibility_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Visibility_descriptor() { + return ApiDef_Visibility_descriptor(); + } + static inline const ::std::string& Visibility_Name(Visibility value) { + return ApiDef_Visibility_Name(value); + } + static inline bool Visibility_Parse(const ::std::string& name, + Visibility* value) { + return ApiDef_Visibility_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.ApiDef.Endpoint endpoint = 3; + int endpoint_size() const; + void clear_endpoint(); + static const int kEndpointFieldNumber = 3; + ::diplomacy::tensorflow::ApiDef_Endpoint* mutable_endpoint(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Endpoint >* + mutable_endpoint(); + const ::diplomacy::tensorflow::ApiDef_Endpoint& endpoint(int index) const; + ::diplomacy::tensorflow::ApiDef_Endpoint* add_endpoint(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Endpoint >& + endpoint() const; + + // repeated .diplomacy.tensorflow.ApiDef.Arg in_arg = 4; + int in_arg_size() const; + void clear_in_arg(); + static const int kInArgFieldNumber = 4; + ::diplomacy::tensorflow::ApiDef_Arg* mutable_in_arg(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >* + mutable_in_arg(); + const ::diplomacy::tensorflow::ApiDef_Arg& in_arg(int index) const; + ::diplomacy::tensorflow::ApiDef_Arg* add_in_arg(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >& + in_arg() const; + + // repeated .diplomacy.tensorflow.ApiDef.Arg out_arg = 5; + int out_arg_size() const; + void clear_out_arg(); + static const int kOutArgFieldNumber = 5; + ::diplomacy::tensorflow::ApiDef_Arg* mutable_out_arg(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >* + mutable_out_arg(); + const ::diplomacy::tensorflow::ApiDef_Arg& out_arg(int index) const; + ::diplomacy::tensorflow::ApiDef_Arg* add_out_arg(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >& + out_arg() const; + + // repeated .diplomacy.tensorflow.ApiDef.Attr attr = 6; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 6; + ::diplomacy::tensorflow::ApiDef_Attr* mutable_attr(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Attr >* + mutable_attr(); + const ::diplomacy::tensorflow::ApiDef_Attr& attr(int index) const; + ::diplomacy::tensorflow::ApiDef_Attr* add_attr(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Attr >& + attr() const; + + // repeated string arg_order = 11; + int arg_order_size() const; + void clear_arg_order(); + static const int kArgOrderFieldNumber = 11; + const ::std::string& arg_order(int index) const; + ::std::string* mutable_arg_order(int index); + void set_arg_order(int index, const ::std::string& value); + #if LANG_CXX11 + void set_arg_order(int index, ::std::string&& value); + #endif + void set_arg_order(int index, const char* value); + void set_arg_order(int index, const char* value, size_t size); + ::std::string* add_arg_order(); + void add_arg_order(const ::std::string& value); + #if LANG_CXX11 + void add_arg_order(::std::string&& value); + #endif + void add_arg_order(const char* value); + void add_arg_order(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& arg_order() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_arg_order(); + + // string graph_op_name = 1; + void clear_graph_op_name(); + static const int kGraphOpNameFieldNumber = 1; + const ::std::string& graph_op_name() const; + void set_graph_op_name(const ::std::string& value); + #if LANG_CXX11 + void set_graph_op_name(::std::string&& value); + #endif + void set_graph_op_name(const char* value); + void set_graph_op_name(const char* value, size_t size); + ::std::string* mutable_graph_op_name(); + ::std::string* release_graph_op_name(); + void set_allocated_graph_op_name(::std::string* graph_op_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_graph_op_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_graph_op_name( + ::std::string* graph_op_name); + + // string summary = 7; + void clear_summary(); + static const int kSummaryFieldNumber = 7; + const ::std::string& summary() const; + void set_summary(const ::std::string& value); + #if LANG_CXX11 + void set_summary(::std::string&& value); + #endif + void set_summary(const char* value); + void set_summary(const char* value, size_t size); + ::std::string* mutable_summary(); + ::std::string* release_summary(); + void set_allocated_summary(::std::string* summary); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_summary(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_summary( + ::std::string* summary); + + // string description = 8; + void clear_description(); + static const int kDescriptionFieldNumber = 8; + const ::std::string& description() const; + void set_description(const ::std::string& value); + #if LANG_CXX11 + void set_description(::std::string&& value); + #endif + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // string description_prefix = 9; + void clear_description_prefix(); + static const int kDescriptionPrefixFieldNumber = 9; + const ::std::string& description_prefix() const; + void set_description_prefix(const ::std::string& value); + #if LANG_CXX11 + void set_description_prefix(::std::string&& value); + #endif + void set_description_prefix(const char* value); + void set_description_prefix(const char* value, size_t size); + ::std::string* mutable_description_prefix(); + ::std::string* release_description_prefix(); + void set_allocated_description_prefix(::std::string* description_prefix); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description_prefix(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description_prefix( + ::std::string* description_prefix); + + // string description_suffix = 10; + void clear_description_suffix(); + static const int kDescriptionSuffixFieldNumber = 10; + const ::std::string& description_suffix() const; + void set_description_suffix(const ::std::string& value); + #if LANG_CXX11 + void set_description_suffix(::std::string&& value); + #endif + void set_description_suffix(const char* value); + void set_description_suffix(const char* value, size_t size); + ::std::string* mutable_description_suffix(); + ::std::string* release_description_suffix(); + void set_allocated_description_suffix(::std::string* description_suffix); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description_suffix(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description_suffix( + ::std::string* description_suffix); + + // string deprecation_message = 12; + void clear_deprecation_message(); + static const int kDeprecationMessageFieldNumber = 12; + const ::std::string& deprecation_message() const; + void set_deprecation_message(const ::std::string& value); + #if LANG_CXX11 + void set_deprecation_message(::std::string&& value); + #endif + void set_deprecation_message(const char* value); + void set_deprecation_message(const char* value, size_t size); + ::std::string* mutable_deprecation_message(); + ::std::string* release_deprecation_message(); + void set_allocated_deprecation_message(::std::string* deprecation_message); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_deprecation_message(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_deprecation_message( + ::std::string* deprecation_message); + + // .diplomacy.tensorflow.ApiDef.Visibility visibility = 2; + void clear_visibility(); + static const int kVisibilityFieldNumber = 2; + ::diplomacy::tensorflow::ApiDef_Visibility visibility() const; + void set_visibility(::diplomacy::tensorflow::ApiDef_Visibility value); + + // int32 deprecation_version = 13; + void clear_deprecation_version(); + static const int kDeprecationVersionFieldNumber = 13; + ::google::protobuf::int32 deprecation_version() const; + void set_deprecation_version(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Endpoint > endpoint_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg > in_arg_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg > out_arg_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Attr > attr_; + ::google::protobuf::RepeatedPtrField< ::std::string> arg_order_; + ::google::protobuf::internal::ArenaStringPtr graph_op_name_; + ::google::protobuf::internal::ArenaStringPtr summary_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr description_prefix_; + ::google::protobuf::internal::ArenaStringPtr description_suffix_; + ::google::protobuf::internal::ArenaStringPtr deprecation_message_; + int visibility_; + ::google::protobuf::int32 deprecation_version_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class ApiDefs : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ApiDefs) */ { + public: + ApiDefs(); + virtual ~ApiDefs(); + + ApiDefs(const ApiDefs& from); + + inline ApiDefs& operator=(const ApiDefs& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ApiDefs(ApiDefs&& from) noexcept + : ApiDefs() { + *this = ::std::move(from); + } + + inline ApiDefs& operator=(ApiDefs&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ApiDefs& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ApiDefs* internal_default_instance() { + return reinterpret_cast( + &_ApiDefs_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(ApiDefs* other); + void Swap(ApiDefs* other); + friend void swap(ApiDefs& a, ApiDefs& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ApiDefs* New() const final { + return CreateMaybeMessage(NULL); + } + + ApiDefs* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ApiDefs& from); + void MergeFrom(const ApiDefs& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ApiDefs* other); + protected: + explicit ApiDefs(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.ApiDef op = 1; + int op_size() const; + void clear_op(); + static const int kOpFieldNumber = 1; + ::diplomacy::tensorflow::ApiDef* mutable_op(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef >* + mutable_op(); + const ::diplomacy::tensorflow::ApiDef& op(int index) const; + ::diplomacy::tensorflow::ApiDef* add_op(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef >& + op() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDefs) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef > op_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ApiDef_Endpoint + +// string name = 1; +inline void ApiDef_Endpoint::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef_Endpoint::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Endpoint.name) + return name_.Get(); +} +inline void ApiDef_Endpoint::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Endpoint.name) +} +#if LANG_CXX11 +inline void ApiDef_Endpoint::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.Endpoint.name) +} +#endif +inline void ApiDef_Endpoint::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.Endpoint.name) +} +inline void ApiDef_Endpoint::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.Endpoint.name) +} +inline ::std::string* ApiDef_Endpoint::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Endpoint.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef_Endpoint::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Endpoint.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef_Endpoint::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Endpoint.name) +} +inline ::std::string* ApiDef_Endpoint::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Endpoint.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef_Endpoint::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Endpoint.name) +} + +// bool deprecated = 3; +inline void ApiDef_Endpoint::clear_deprecated() { + deprecated_ = false; +} +inline bool ApiDef_Endpoint::deprecated() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Endpoint.deprecated) + return deprecated_; +} +inline void ApiDef_Endpoint::set_deprecated(bool value) { + + deprecated_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Endpoint.deprecated) +} + +// int32 deprecation_version = 4; +inline void ApiDef_Endpoint::clear_deprecation_version() { + deprecation_version_ = 0; +} +inline ::google::protobuf::int32 ApiDef_Endpoint::deprecation_version() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Endpoint.deprecation_version) + return deprecation_version_; +} +inline void ApiDef_Endpoint::set_deprecation_version(::google::protobuf::int32 value) { + + deprecation_version_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Endpoint.deprecation_version) +} + +// ------------------------------------------------------------------- + +// ApiDef_Arg + +// string name = 1; +inline void ApiDef_Arg::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef_Arg::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Arg.name) + return name_.Get(); +} +inline void ApiDef_Arg::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Arg.name) +} +#if LANG_CXX11 +inline void ApiDef_Arg::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.Arg.name) +} +#endif +inline void ApiDef_Arg::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.Arg.name) +} +inline void ApiDef_Arg::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.Arg.name) +} +inline ::std::string* ApiDef_Arg::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Arg.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef_Arg::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Arg.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef_Arg::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Arg.name) +} +inline ::std::string* ApiDef_Arg::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Arg.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef_Arg::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Arg.name) +} + +// string rename_to = 2; +inline void ApiDef_Arg::clear_rename_to() { + rename_to_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef_Arg::rename_to() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Arg.rename_to) + return rename_to_.Get(); +} +inline void ApiDef_Arg::set_rename_to(const ::std::string& value) { + + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Arg.rename_to) +} +#if LANG_CXX11 +inline void ApiDef_Arg::set_rename_to(::std::string&& value) { + + rename_to_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.Arg.rename_to) +} +#endif +inline void ApiDef_Arg::set_rename_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.Arg.rename_to) +} +inline void ApiDef_Arg::set_rename_to(const char* value, + size_t size) { + + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.Arg.rename_to) +} +inline ::std::string* ApiDef_Arg::mutable_rename_to() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Arg.rename_to) + return rename_to_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef_Arg::release_rename_to() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Arg.rename_to) + + return rename_to_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef_Arg::set_allocated_rename_to(::std::string* rename_to) { + if (rename_to != NULL) { + + } else { + + } + rename_to_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), rename_to, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Arg.rename_to) +} +inline ::std::string* ApiDef_Arg::unsafe_arena_release_rename_to() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Arg.rename_to) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return rename_to_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef_Arg::unsafe_arena_set_allocated_rename_to( + ::std::string* rename_to) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (rename_to != NULL) { + + } else { + + } + rename_to_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + rename_to, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Arg.rename_to) +} + +// string description = 3; +inline void ApiDef_Arg::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef_Arg::description() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Arg.description) + return description_.Get(); +} +inline void ApiDef_Arg::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Arg.description) +} +#if LANG_CXX11 +inline void ApiDef_Arg::set_description(::std::string&& value) { + + description_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.Arg.description) +} +#endif +inline void ApiDef_Arg::set_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.Arg.description) +} +inline void ApiDef_Arg::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.Arg.description) +} +inline ::std::string* ApiDef_Arg::mutable_description() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Arg.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef_Arg::release_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Arg.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef_Arg::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Arg.description) +} +inline ::std::string* ApiDef_Arg::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Arg.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef_Arg::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Arg.description) +} + +// ------------------------------------------------------------------- + +// ApiDef_Attr + +// string name = 1; +inline void ApiDef_Attr::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef_Attr::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Attr.name) + return name_.Get(); +} +inline void ApiDef_Attr::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Attr.name) +} +#if LANG_CXX11 +inline void ApiDef_Attr::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.Attr.name) +} +#endif +inline void ApiDef_Attr::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.Attr.name) +} +inline void ApiDef_Attr::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.Attr.name) +} +inline ::std::string* ApiDef_Attr::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Attr.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef_Attr::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Attr.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef_Attr::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Attr.name) +} +inline ::std::string* ApiDef_Attr::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Attr.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef_Attr::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Attr.name) +} + +// string rename_to = 2; +inline void ApiDef_Attr::clear_rename_to() { + rename_to_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef_Attr::rename_to() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Attr.rename_to) + return rename_to_.Get(); +} +inline void ApiDef_Attr::set_rename_to(const ::std::string& value) { + + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Attr.rename_to) +} +#if LANG_CXX11 +inline void ApiDef_Attr::set_rename_to(::std::string&& value) { + + rename_to_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.Attr.rename_to) +} +#endif +inline void ApiDef_Attr::set_rename_to(const char* value) { + GOOGLE_DCHECK(value != NULL); + + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.Attr.rename_to) +} +inline void ApiDef_Attr::set_rename_to(const char* value, + size_t size) { + + rename_to_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.Attr.rename_to) +} +inline ::std::string* ApiDef_Attr::mutable_rename_to() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Attr.rename_to) + return rename_to_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef_Attr::release_rename_to() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Attr.rename_to) + + return rename_to_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef_Attr::set_allocated_rename_to(::std::string* rename_to) { + if (rename_to != NULL) { + + } else { + + } + rename_to_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), rename_to, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Attr.rename_to) +} +inline ::std::string* ApiDef_Attr::unsafe_arena_release_rename_to() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Attr.rename_to) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return rename_to_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef_Attr::unsafe_arena_set_allocated_rename_to( + ::std::string* rename_to) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (rename_to != NULL) { + + } else { + + } + rename_to_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + rename_to, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Attr.rename_to) +} + +// .diplomacy.tensorflow.AttrValue default_value = 3; +inline bool ApiDef_Attr::has_default_value() const { + return this != internal_default_instance() && default_value_ != NULL; +} +inline const ::diplomacy::tensorflow::AttrValue& ApiDef_Attr::_internal_default_value() const { + return *default_value_; +} +inline const ::diplomacy::tensorflow::AttrValue& ApiDef_Attr::default_value() const { + const ::diplomacy::tensorflow::AttrValue* p = default_value_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Attr.default_value) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_AttrValue_default_instance_); +} +inline ::diplomacy::tensorflow::AttrValue* ApiDef_Attr::release_default_value() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Attr.default_value) + + ::diplomacy::tensorflow::AttrValue* temp = default_value_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + default_value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* ApiDef_Attr::unsafe_arena_release_default_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Attr.default_value) + + ::diplomacy::tensorflow::AttrValue* temp = default_value_; + default_value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* ApiDef_Attr::mutable_default_value() { + + if (default_value_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::AttrValue>(GetArenaNoVirtual()); + default_value_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Attr.default_value) + return default_value_; +} +inline void ApiDef_Attr::set_allocated_default_value(::diplomacy::tensorflow::AttrValue* default_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(default_value_); + } + if (default_value) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(default_value)->GetArena(); + if (message_arena != submessage_arena) { + default_value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, default_value, submessage_arena); + } + + } else { + + } + default_value_ = default_value; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Attr.default_value) +} + +// string description = 4; +inline void ApiDef_Attr::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef_Attr::description() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.Attr.description) + return description_.Get(); +} +inline void ApiDef_Attr::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.Attr.description) +} +#if LANG_CXX11 +inline void ApiDef_Attr::set_description(::std::string&& value) { + + description_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.Attr.description) +} +#endif +inline void ApiDef_Attr::set_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.Attr.description) +} +inline void ApiDef_Attr::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.Attr.description) +} +inline ::std::string* ApiDef_Attr::mutable_description() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.Attr.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef_Attr::release_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.Attr.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef_Attr::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.Attr.description) +} +inline ::std::string* ApiDef_Attr::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.Attr.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef_Attr::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.Attr.description) +} + +// ------------------------------------------------------------------- + +// ApiDef + +// string graph_op_name = 1; +inline void ApiDef::clear_graph_op_name() { + graph_op_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef::graph_op_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.graph_op_name) + return graph_op_name_.Get(); +} +inline void ApiDef::set_graph_op_name(const ::std::string& value) { + + graph_op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.graph_op_name) +} +#if LANG_CXX11 +inline void ApiDef::set_graph_op_name(::std::string&& value) { + + graph_op_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.graph_op_name) +} +#endif +inline void ApiDef::set_graph_op_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + graph_op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.graph_op_name) +} +inline void ApiDef::set_graph_op_name(const char* value, + size_t size) { + + graph_op_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.graph_op_name) +} +inline ::std::string* ApiDef::mutable_graph_op_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.graph_op_name) + return graph_op_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef::release_graph_op_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.graph_op_name) + + return graph_op_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef::set_allocated_graph_op_name(::std::string* graph_op_name) { + if (graph_op_name != NULL) { + + } else { + + } + graph_op_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), graph_op_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.graph_op_name) +} +inline ::std::string* ApiDef::unsafe_arena_release_graph_op_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.graph_op_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return graph_op_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef::unsafe_arena_set_allocated_graph_op_name( + ::std::string* graph_op_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (graph_op_name != NULL) { + + } else { + + } + graph_op_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + graph_op_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.graph_op_name) +} + +// string deprecation_message = 12; +inline void ApiDef::clear_deprecation_message() { + deprecation_message_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef::deprecation_message() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.deprecation_message) + return deprecation_message_.Get(); +} +inline void ApiDef::set_deprecation_message(const ::std::string& value) { + + deprecation_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.deprecation_message) +} +#if LANG_CXX11 +inline void ApiDef::set_deprecation_message(::std::string&& value) { + + deprecation_message_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.deprecation_message) +} +#endif +inline void ApiDef::set_deprecation_message(const char* value) { + GOOGLE_DCHECK(value != NULL); + + deprecation_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.deprecation_message) +} +inline void ApiDef::set_deprecation_message(const char* value, + size_t size) { + + deprecation_message_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.deprecation_message) +} +inline ::std::string* ApiDef::mutable_deprecation_message() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.deprecation_message) + return deprecation_message_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef::release_deprecation_message() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.deprecation_message) + + return deprecation_message_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef::set_allocated_deprecation_message(::std::string* deprecation_message) { + if (deprecation_message != NULL) { + + } else { + + } + deprecation_message_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), deprecation_message, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.deprecation_message) +} +inline ::std::string* ApiDef::unsafe_arena_release_deprecation_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.deprecation_message) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return deprecation_message_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef::unsafe_arena_set_allocated_deprecation_message( + ::std::string* deprecation_message) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (deprecation_message != NULL) { + + } else { + + } + deprecation_message_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + deprecation_message, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.deprecation_message) +} + +// int32 deprecation_version = 13; +inline void ApiDef::clear_deprecation_version() { + deprecation_version_ = 0; +} +inline ::google::protobuf::int32 ApiDef::deprecation_version() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.deprecation_version) + return deprecation_version_; +} +inline void ApiDef::set_deprecation_version(::google::protobuf::int32 value) { + + deprecation_version_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.deprecation_version) +} + +// .diplomacy.tensorflow.ApiDef.Visibility visibility = 2; +inline void ApiDef::clear_visibility() { + visibility_ = 0; +} +inline ::diplomacy::tensorflow::ApiDef_Visibility ApiDef::visibility() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.visibility) + return static_cast< ::diplomacy::tensorflow::ApiDef_Visibility >(visibility_); +} +inline void ApiDef::set_visibility(::diplomacy::tensorflow::ApiDef_Visibility value) { + + visibility_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.visibility) +} + +// repeated .diplomacy.tensorflow.ApiDef.Endpoint endpoint = 3; +inline int ApiDef::endpoint_size() const { + return endpoint_.size(); +} +inline void ApiDef::clear_endpoint() { + endpoint_.Clear(); +} +inline ::diplomacy::tensorflow::ApiDef_Endpoint* ApiDef::mutable_endpoint(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.endpoint) + return endpoint_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Endpoint >* +ApiDef::mutable_endpoint() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ApiDef.endpoint) + return &endpoint_; +} +inline const ::diplomacy::tensorflow::ApiDef_Endpoint& ApiDef::endpoint(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.endpoint) + return endpoint_.Get(index); +} +inline ::diplomacy::tensorflow::ApiDef_Endpoint* ApiDef::add_endpoint() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ApiDef.endpoint) + return endpoint_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Endpoint >& +ApiDef::endpoint() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ApiDef.endpoint) + return endpoint_; +} + +// repeated .diplomacy.tensorflow.ApiDef.Arg in_arg = 4; +inline int ApiDef::in_arg_size() const { + return in_arg_.size(); +} +inline void ApiDef::clear_in_arg() { + in_arg_.Clear(); +} +inline ::diplomacy::tensorflow::ApiDef_Arg* ApiDef::mutable_in_arg(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.in_arg) + return in_arg_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >* +ApiDef::mutable_in_arg() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ApiDef.in_arg) + return &in_arg_; +} +inline const ::diplomacy::tensorflow::ApiDef_Arg& ApiDef::in_arg(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.in_arg) + return in_arg_.Get(index); +} +inline ::diplomacy::tensorflow::ApiDef_Arg* ApiDef::add_in_arg() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ApiDef.in_arg) + return in_arg_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >& +ApiDef::in_arg() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ApiDef.in_arg) + return in_arg_; +} + +// repeated .diplomacy.tensorflow.ApiDef.Arg out_arg = 5; +inline int ApiDef::out_arg_size() const { + return out_arg_.size(); +} +inline void ApiDef::clear_out_arg() { + out_arg_.Clear(); +} +inline ::diplomacy::tensorflow::ApiDef_Arg* ApiDef::mutable_out_arg(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.out_arg) + return out_arg_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >* +ApiDef::mutable_out_arg() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ApiDef.out_arg) + return &out_arg_; +} +inline const ::diplomacy::tensorflow::ApiDef_Arg& ApiDef::out_arg(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.out_arg) + return out_arg_.Get(index); +} +inline ::diplomacy::tensorflow::ApiDef_Arg* ApiDef::add_out_arg() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ApiDef.out_arg) + return out_arg_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Arg >& +ApiDef::out_arg() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ApiDef.out_arg) + return out_arg_; +} + +// repeated string arg_order = 11; +inline int ApiDef::arg_order_size() const { + return arg_order_.size(); +} +inline void ApiDef::clear_arg_order() { + arg_order_.Clear(); +} +inline const ::std::string& ApiDef::arg_order(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.arg_order) + return arg_order_.Get(index); +} +inline ::std::string* ApiDef::mutable_arg_order(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.arg_order) + return arg_order_.Mutable(index); +} +inline void ApiDef::set_arg_order(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.arg_order) + arg_order_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void ApiDef::set_arg_order(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.arg_order) + arg_order_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void ApiDef::set_arg_order(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + arg_order_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.arg_order) +} +inline void ApiDef::set_arg_order(int index, const char* value, size_t size) { + arg_order_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.arg_order) +} +inline ::std::string* ApiDef::add_arg_order() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.ApiDef.arg_order) + return arg_order_.Add(); +} +inline void ApiDef::add_arg_order(const ::std::string& value) { + arg_order_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ApiDef.arg_order) +} +#if LANG_CXX11 +inline void ApiDef::add_arg_order(::std::string&& value) { + arg_order_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ApiDef.arg_order) +} +#endif +inline void ApiDef::add_arg_order(const char* value) { + GOOGLE_DCHECK(value != NULL); + arg_order_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.ApiDef.arg_order) +} +inline void ApiDef::add_arg_order(const char* value, size_t size) { + arg_order_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.ApiDef.arg_order) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ApiDef::arg_order() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ApiDef.arg_order) + return arg_order_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ApiDef::mutable_arg_order() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ApiDef.arg_order) + return &arg_order_; +} + +// repeated .diplomacy.tensorflow.ApiDef.Attr attr = 6; +inline int ApiDef::attr_size() const { + return attr_.size(); +} +inline void ApiDef::clear_attr() { + attr_.Clear(); +} +inline ::diplomacy::tensorflow::ApiDef_Attr* ApiDef::mutable_attr(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.attr) + return attr_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Attr >* +ApiDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ApiDef.attr) + return &attr_; +} +inline const ::diplomacy::tensorflow::ApiDef_Attr& ApiDef::attr(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.attr) + return attr_.Get(index); +} +inline ::diplomacy::tensorflow::ApiDef_Attr* ApiDef::add_attr() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ApiDef.attr) + return attr_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef_Attr >& +ApiDef::attr() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ApiDef.attr) + return attr_; +} + +// string summary = 7; +inline void ApiDef::clear_summary() { + summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef::summary() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.summary) + return summary_.Get(); +} +inline void ApiDef::set_summary(const ::std::string& value) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.summary) +} +#if LANG_CXX11 +inline void ApiDef::set_summary(::std::string&& value) { + + summary_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.summary) +} +#endif +inline void ApiDef::set_summary(const char* value) { + GOOGLE_DCHECK(value != NULL); + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.summary) +} +inline void ApiDef::set_summary(const char* value, + size_t size) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.summary) +} +inline ::std::string* ApiDef::mutable_summary() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.summary) + return summary_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef::release_summary() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.summary) + + return summary_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef::set_allocated_summary(::std::string* summary) { + if (summary != NULL) { + + } else { + + } + summary_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), summary, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.summary) +} +inline ::std::string* ApiDef::unsafe_arena_release_summary() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.summary) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return summary_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef::unsafe_arena_set_allocated_summary( + ::std::string* summary) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (summary != NULL) { + + } else { + + } + summary_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + summary, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.summary) +} + +// string description = 8; +inline void ApiDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef::description() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.description) + return description_.Get(); +} +inline void ApiDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.description) +} +#if LANG_CXX11 +inline void ApiDef::set_description(::std::string&& value) { + + description_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.description) +} +#endif +inline void ApiDef::set_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.description) +} +inline void ApiDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.description) +} +inline ::std::string* ApiDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef::release_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.description) +} +inline ::std::string* ApiDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.description) +} + +// string description_prefix = 9; +inline void ApiDef::clear_description_prefix() { + description_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef::description_prefix() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.description_prefix) + return description_prefix_.Get(); +} +inline void ApiDef::set_description_prefix(const ::std::string& value) { + + description_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.description_prefix) +} +#if LANG_CXX11 +inline void ApiDef::set_description_prefix(::std::string&& value) { + + description_prefix_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.description_prefix) +} +#endif +inline void ApiDef::set_description_prefix(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.description_prefix) +} +inline void ApiDef::set_description_prefix(const char* value, + size_t size) { + + description_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.description_prefix) +} +inline ::std::string* ApiDef::mutable_description_prefix() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.description_prefix) + return description_prefix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef::release_description_prefix() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.description_prefix) + + return description_prefix_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef::set_allocated_description_prefix(::std::string* description_prefix) { + if (description_prefix != NULL) { + + } else { + + } + description_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description_prefix, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.description_prefix) +} +inline ::std::string* ApiDef::unsafe_arena_release_description_prefix() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.description_prefix) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef::unsafe_arena_set_allocated_description_prefix( + ::std::string* description_prefix) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description_prefix != NULL) { + + } else { + + } + description_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description_prefix, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.description_prefix) +} + +// string description_suffix = 10; +inline void ApiDef::clear_description_suffix() { + description_suffix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ApiDef::description_suffix() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDef.description_suffix) + return description_suffix_.Get(); +} +inline void ApiDef::set_description_suffix(const ::std::string& value) { + + description_suffix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ApiDef.description_suffix) +} +#if LANG_CXX11 +inline void ApiDef::set_description_suffix(::std::string&& value) { + + description_suffix_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ApiDef.description_suffix) +} +#endif +inline void ApiDef::set_description_suffix(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_suffix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ApiDef.description_suffix) +} +inline void ApiDef::set_description_suffix(const char* value, + size_t size) { + + description_suffix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ApiDef.description_suffix) +} +inline ::std::string* ApiDef::mutable_description_suffix() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDef.description_suffix) + return description_suffix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ApiDef::release_description_suffix() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ApiDef.description_suffix) + + return description_suffix_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ApiDef::set_allocated_description_suffix(::std::string* description_suffix) { + if (description_suffix != NULL) { + + } else { + + } + description_suffix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description_suffix, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ApiDef.description_suffix) +} +inline ::std::string* ApiDef::unsafe_arena_release_description_suffix() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ApiDef.description_suffix) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_suffix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ApiDef::unsafe_arena_set_allocated_description_suffix( + ::std::string* description_suffix) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description_suffix != NULL) { + + } else { + + } + description_suffix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description_suffix, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ApiDef.description_suffix) +} + +// ------------------------------------------------------------------- + +// ApiDefs + +// repeated .diplomacy.tensorflow.ApiDef op = 1; +inline int ApiDefs::op_size() const { + return op_.size(); +} +inline void ApiDefs::clear_op() { + op_.Clear(); +} +inline ::diplomacy::tensorflow::ApiDef* ApiDefs::mutable_op(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ApiDefs.op) + return op_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef >* +ApiDefs::mutable_op() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.ApiDefs.op) + return &op_; +} +inline const ::diplomacy::tensorflow::ApiDef& ApiDefs::op(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ApiDefs.op) + return op_.Get(index); +} +inline ::diplomacy::tensorflow::ApiDef* ApiDefs::add_op() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.ApiDefs.op) + return op_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ApiDef >& +ApiDefs::op() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.ApiDefs.op) + return op_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::ApiDef_Visibility> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::ApiDef_Visibility>() { + return ::diplomacy::tensorflow::ApiDef_Visibility_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fapi_5fdef_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.proto new file mode 100644 index 0000000..6d87646 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def.proto @@ -0,0 +1,136 @@ +// Defines the text format for including per-op API definition and +// overrides for client language op code generators. + +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "ApiDefProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/attr_value.proto"; + +// Used to specify and override the default API & behavior in the +// generated code for client languages, from what you would get from +// the OpDef alone. There will be a set of ApiDefs that are common +// to all client languages, and another set per client language. +// The per-client-language ApiDefs will inherit values from the +// common ApiDefs which it can either replace or modify. +// +// We separate the API definition from the OpDef so we can evolve the +// API while remaining backwards compatible when interpretting old +// graphs. Overrides go in an "api_def.pbtxt" file with a text-format +// ApiDefs message. +// +// WARNING: Be *very* careful changing the API for any existing op -- +// you can change the semantics of existing code. These changes may +// need to wait until a major release of TensorFlow to avoid breaking +// our compatibility promises. +message ApiDef { + // Name of the op (in the OpDef) to specify the API for. + string graph_op_name = 1; + // If this op is deprecated, set deprecation message to the message + // that should be logged when this op is used. + // The message should indicate alternative op to use, if any. + string deprecation_message = 12; + // Major version when the op will be deleted. For e.g. set this + // value to 2 if op API should be removed in TensorFlow 2.0 and + // deprecated in versions before that. + int32 deprecation_version = 13; + + enum Visibility { + // Normally this is "VISIBLE" unless you are inheriting a + // different value from another ApiDef. + DEFAULT_VISIBILITY = 0; + // Publicly visible in the API. + VISIBLE = 1; + // Do not include this op in the generated API. If visibility is + // set to 'SKIP', other fields are ignored for this op. + SKIP = 2; + // Hide this op by putting it into an internal namespace (or whatever + // is appropriate in the target language). + HIDDEN = 3; + } + Visibility visibility = 2; + + // If you specify any endpoint, this will replace all of the + // inherited endpoints. The first endpoint should be the + // "canonical" endpoint, and should not be deprecated (unless all + // endpoints are deprecated). + message Endpoint { + // Name should be either like "CamelCaseName" or + // "Package.CamelCaseName". Client-language-specific ApiDefs may + // use a snake_case convention instead of CamelCase. + string name = 1; + + // Set if this endpoint is deprecated. If set to true, a message suggesting + // to use a non-deprecated endpoint instead will be printed. If all + // endpoints are deprecated, set deprecation_message in ApiDef instead. + bool deprecated = 3; + + // Major version when an endpoint will be deleted. For e.g. set this + // value to 2 if endpoint should be removed in TensorFlow 2.0 and + // deprecated in versions before that. + int32 deprecation_version = 4; + } + repeated Endpoint endpoint = 3; + + message Arg { + string name = 1; + + // Change the name used to access this arg in the API from what + // is used in the GraphDef. Note that these names in `backticks` + // will also be replaced in the summary & description fields. + string rename_to = 2; + + // Note: this will replace any inherited arg doc. There is no + // current way of modifying arg descriptions (other than replacing + // them entirely) as can be done with op descriptions. + string description = 3; + } + repeated Arg in_arg = 4; + repeated Arg out_arg = 5; + // List of original in_arg names to specify new argument order. + // Length of arg_order should be either empty to keep current order + // or match size of in_arg. + repeated string arg_order = 11; + + // Description of the graph-construction-time configuration of this + // Op. That is to say, this describes the attr fields that will + // be specified in the NodeDef. + message Attr { + string name = 1; + + // Change the name used to access this attr in the API from what + // is used in the GraphDef. Note that these names in `backticks` + // will also be replaced in the summary & description fields. + string rename_to = 2; + + // Specify a new default value to use for this attr. This default + // will be used when creating new graphs, as opposed to the + // default in the OpDef, which will be used when interpreting old + // GraphDefs. + AttrValue default_value = 3; + + // Note: this will replace any inherited attr doc, there is no current + // way of modifying attr descriptions as can be done with op descriptions. + string description = 4; + } + repeated Attr attr = 6; + + // One-line human-readable description of what the Op does. + string summary = 7; + + // Additional, longer human-readable description of what the Op does. + string description = 8; + + // Modify an existing/inherited description by adding text to the beginning + // or end. + string description_prefix = 9; + string description_suffix = 10; +} + +message ApiDefs { + repeated ApiDef op = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def_pb2.py new file mode 100644 index 0000000..d7d3b47 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/api_def_pb2.py @@ -0,0 +1,400 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/api_def.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import attr_value_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/api_def.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\014ApiDefProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n1diplomacy_tensorflow/core/framework/api_def.proto\x12\x14\x64iplomacy.tensorflow\x1a\x34\x64iplomacy_tensorflow/core/framework/attr_value.proto\"\x9d\x06\n\x06\x41piDef\x12\x15\n\rgraph_op_name\x18\x01 \x01(\t\x12\x1b\n\x13\x64\x65precation_message\x18\x0c \x01(\t\x12\x1b\n\x13\x64\x65precation_version\x18\r \x01(\x05\x12;\n\nvisibility\x18\x02 \x01(\x0e\x32\'.diplomacy.tensorflow.ApiDef.Visibility\x12\x37\n\x08\x65ndpoint\x18\x03 \x03(\x0b\x32%.diplomacy.tensorflow.ApiDef.Endpoint\x12\x30\n\x06in_arg\x18\x04 \x03(\x0b\x32 .diplomacy.tensorflow.ApiDef.Arg\x12\x31\n\x07out_arg\x18\x05 \x03(\x0b\x32 .diplomacy.tensorflow.ApiDef.Arg\x12\x11\n\targ_order\x18\x0b \x03(\t\x12/\n\x04\x61ttr\x18\x06 \x03(\x0b\x32!.diplomacy.tensorflow.ApiDef.Attr\x12\x0f\n\x07summary\x18\x07 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\x12\x1a\n\x12\x64\x65scription_prefix\x18\t \x01(\t\x12\x1a\n\x12\x64\x65scription_suffix\x18\n \x01(\t\x1aI\n\x08\x45ndpoint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ndeprecated\x18\x03 \x01(\x08\x12\x1b\n\x13\x64\x65precation_version\x18\x04 \x01(\x05\x1a;\n\x03\x41rg\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\trename_to\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1at\n\x04\x41ttr\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\trename_to\x18\x02 \x01(\t\x12\x36\n\rdefault_value\x18\x03 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\"G\n\nVisibility\x12\x16\n\x12\x44\x45\x46\x41ULT_VISIBILITY\x10\x00\x12\x0b\n\x07VISIBLE\x10\x01\x12\x08\n\x04SKIP\x10\x02\x12\n\n\x06HIDDEN\x10\x03\"3\n\x07\x41piDefs\x12(\n\x02op\x18\x01 \x03(\x0b\x32\x1c.diplomacy.tensorflow.ApiDefBl\n\x18org.tensorflow.frameworkB\x0c\x41piDefProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2.DESCRIPTOR,]) + + + +_APIDEF_VISIBILITY = _descriptor.EnumDescriptor( + name='Visibility', + full_name='diplomacy.tensorflow.ApiDef.Visibility', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DEFAULT_VISIBILITY', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='VISIBLE', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SKIP', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='HIDDEN', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=856, + serialized_end=927, +) +_sym_db.RegisterEnumDescriptor(_APIDEF_VISIBILITY) + + +_APIDEF_ENDPOINT = _descriptor.Descriptor( + name='Endpoint', + full_name='diplomacy.tensorflow.ApiDef.Endpoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.ApiDef.Endpoint.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='deprecated', full_name='diplomacy.tensorflow.ApiDef.Endpoint.deprecated', index=1, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='deprecation_version', full_name='diplomacy.tensorflow.ApiDef.Endpoint.deprecation_version', index=2, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=602, + serialized_end=675, +) + +_APIDEF_ARG = _descriptor.Descriptor( + name='Arg', + full_name='diplomacy.tensorflow.ApiDef.Arg', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.ApiDef.Arg.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rename_to', full_name='diplomacy.tensorflow.ApiDef.Arg.rename_to', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='diplomacy.tensorflow.ApiDef.Arg.description', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=677, + serialized_end=736, +) + +_APIDEF_ATTR = _descriptor.Descriptor( + name='Attr', + full_name='diplomacy.tensorflow.ApiDef.Attr', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.ApiDef.Attr.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rename_to', full_name='diplomacy.tensorflow.ApiDef.Attr.rename_to', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default_value', full_name='diplomacy.tensorflow.ApiDef.Attr.default_value', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='diplomacy.tensorflow.ApiDef.Attr.description', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=738, + serialized_end=854, +) + +_APIDEF = _descriptor.Descriptor( + name='ApiDef', + full_name='diplomacy.tensorflow.ApiDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='graph_op_name', full_name='diplomacy.tensorflow.ApiDef.graph_op_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='deprecation_message', full_name='diplomacy.tensorflow.ApiDef.deprecation_message', index=1, + number=12, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='deprecation_version', full_name='diplomacy.tensorflow.ApiDef.deprecation_version', index=2, + number=13, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='visibility', full_name='diplomacy.tensorflow.ApiDef.visibility', index=3, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='endpoint', full_name='diplomacy.tensorflow.ApiDef.endpoint', index=4, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='in_arg', full_name='diplomacy.tensorflow.ApiDef.in_arg', index=5, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='out_arg', full_name='diplomacy.tensorflow.ApiDef.out_arg', index=6, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='arg_order', full_name='diplomacy.tensorflow.ApiDef.arg_order', index=7, + number=11, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attr', full_name='diplomacy.tensorflow.ApiDef.attr', index=8, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='summary', full_name='diplomacy.tensorflow.ApiDef.summary', index=9, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='diplomacy.tensorflow.ApiDef.description', index=10, + number=8, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description_prefix', full_name='diplomacy.tensorflow.ApiDef.description_prefix', index=11, + number=9, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description_suffix', full_name='diplomacy.tensorflow.ApiDef.description_suffix', index=12, + number=10, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_APIDEF_ENDPOINT, _APIDEF_ARG, _APIDEF_ATTR, ], + enum_types=[ + _APIDEF_VISIBILITY, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=130, + serialized_end=927, +) + + +_APIDEFS = _descriptor.Descriptor( + name='ApiDefs', + full_name='diplomacy.tensorflow.ApiDefs', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op', full_name='diplomacy.tensorflow.ApiDefs.op', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=929, + serialized_end=980, +) + +_APIDEF_ENDPOINT.containing_type = _APIDEF +_APIDEF_ARG.containing_type = _APIDEF +_APIDEF_ATTR.fields_by_name['default_value'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2._ATTRVALUE +_APIDEF_ATTR.containing_type = _APIDEF +_APIDEF.fields_by_name['visibility'].enum_type = _APIDEF_VISIBILITY +_APIDEF.fields_by_name['endpoint'].message_type = _APIDEF_ENDPOINT +_APIDEF.fields_by_name['in_arg'].message_type = _APIDEF_ARG +_APIDEF.fields_by_name['out_arg'].message_type = _APIDEF_ARG +_APIDEF.fields_by_name['attr'].message_type = _APIDEF_ATTR +_APIDEF_VISIBILITY.containing_type = _APIDEF +_APIDEFS.fields_by_name['op'].message_type = _APIDEF +DESCRIPTOR.message_types_by_name['ApiDef'] = _APIDEF +DESCRIPTOR.message_types_by_name['ApiDefs'] = _APIDEFS +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ApiDef = _reflection.GeneratedProtocolMessageType('ApiDef', (_message.Message,), dict( + + Endpoint = _reflection.GeneratedProtocolMessageType('Endpoint', (_message.Message,), dict( + DESCRIPTOR = _APIDEF_ENDPOINT, + __module__ = 'diplomacy_tensorflow.core.framework.api_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef.Endpoint) + )) + , + + Arg = _reflection.GeneratedProtocolMessageType('Arg', (_message.Message,), dict( + DESCRIPTOR = _APIDEF_ARG, + __module__ = 'diplomacy_tensorflow.core.framework.api_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef.Arg) + )) + , + + Attr = _reflection.GeneratedProtocolMessageType('Attr', (_message.Message,), dict( + DESCRIPTOR = _APIDEF_ATTR, + __module__ = 'diplomacy_tensorflow.core.framework.api_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef.Attr) + )) + , + DESCRIPTOR = _APIDEF, + __module__ = 'diplomacy_tensorflow.core.framework.api_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDef) + )) +_sym_db.RegisterMessage(ApiDef) +_sym_db.RegisterMessage(ApiDef.Endpoint) +_sym_db.RegisterMessage(ApiDef.Arg) +_sym_db.RegisterMessage(ApiDef.Attr) + +ApiDefs = _reflection.GeneratedProtocolMessageType('ApiDefs', (_message.Message,), dict( + DESCRIPTOR = _APIDEFS, + __module__ = 'diplomacy_tensorflow.core.framework.api_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ApiDefs) + )) +_sym_db.RegisterMessage(ApiDefs) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.pb.cc new file mode 100644 index 0000000..00602e3 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.pb.cc @@ -0,0 +1,2189 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/attr_value.proto + +#include "diplomacy_tensorflow/core/framework/attr_value.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class AttrValue_ListValueDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AttrValue_ListValue_default_instance_; +class AttrValueDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + ::google::protobuf::internal::ArenaStringPtr s_; + ::google::protobuf::int64 i_; + float f_; + bool b_; + int type_; + const ::diplomacy::tensorflow::TensorShapeProto* shape_; + const ::diplomacy::tensorflow::TensorProto* tensor_; + const ::diplomacy::tensorflow::AttrValue_ListValue* list_; + const ::diplomacy::tensorflow::NameAttrList* func_; + ::google::protobuf::internal::ArenaStringPtr placeholder_; +} _AttrValue_default_instance_; +class NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NameAttrList_AttrEntry_DoNotUse_default_instance_; +class NameAttrListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NameAttrList_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +static void InitDefaultsAttrValue() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_AttrValue_ListValue_default_instance_; + new (ptr) ::diplomacy::tensorflow::AttrValue_ListValue(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + { + void* ptr = &::diplomacy::tensorflow::_AttrValue_default_instance_; + new (ptr) ::diplomacy::tensorflow::AttrValue(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + { + void* ptr = &::diplomacy::tensorflow::_NameAttrList_AttrEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse(); + } + { + void* ptr = &::diplomacy::tensorflow::_NameAttrList_default_instance_; + new (ptr) ::diplomacy::tensorflow::NameAttrList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::AttrValue_ListValue::InitAsDefaultInstance(); + ::diplomacy::tensorflow::AttrValue::InitAsDefaultInstance(); + ::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse::InitAsDefaultInstance(); + ::diplomacy::tensorflow::NameAttrList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsAttrValue}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_AttrValue.base); +} + +::google::protobuf::Metadata file_level_metadata[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, i_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, f_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, b_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, tensor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue_ListValue, func_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, s_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, i_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, f_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, b_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, type_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, shape_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, tensor_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, list_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, func_), + offsetof(::diplomacy::tensorflow::AttrValueDefaultTypeInternal, placeholder_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AttrValue, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NameAttrList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NameAttrList, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NameAttrList, attr_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::AttrValue_ListValue)}, + { 13, -1, sizeof(::diplomacy::tensorflow::AttrValue)}, + { 29, 36, sizeof(::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse)}, + { 38, -1, sizeof(::diplomacy::tensorflow::NameAttrList)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_AttrValue_ListValue_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_AttrValue_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NameAttrList_AttrEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NameAttrList_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/attr_value.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n4diplomacy_tensorflow/core/framework/at" + "tr_value.proto\022\024diplomacy.tensorflow\0320di" + "plomacy_tensorflow/core/framework/tensor" + ".proto\0326diplomacy_tensorflow/core/framew" + "ork/tensor_shape.proto\032/diplomacy_tensor" + "flow/core/framework/types.proto\"\200\005\n\tAttr" + "Value\022\013\n\001s\030\002 \001(\014H\000\022\013\n\001i\030\003 \001(\003H\000\022\013\n\001f\030\004 \001" + "(\002H\000\022\013\n\001b\030\005 \001(\010H\000\022.\n\004type\030\006 \001(\0162\036.diplom" + "acy.tensorflow.DataTypeH\000\0227\n\005shape\030\007 \001(\013" + "2&.diplomacy.tensorflow.TensorShapeProto" + "H\000\0223\n\006tensor\030\010 \001(\0132!.diplomacy.tensorflo" + "w.TensorProtoH\000\0229\n\004list\030\001 \001(\0132).diplomac" + "y.tensorflow.AttrValue.ListValueH\000\0222\n\004fu" + "nc\030\n \001(\0132\".diplomacy.tensorflow.NameAttr" + "ListH\000\022\025\n\013placeholder\030\t \001(\tH\000\032\221\002\n\tListVa" + "lue\022\t\n\001s\030\002 \003(\014\022\r\n\001i\030\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002" + "B\002\020\001\022\r\n\001b\030\005 \003(\010B\002\020\001\0220\n\004type\030\006 \003(\0162\036.dipl" + "omacy.tensorflow.DataTypeB\002\020\001\0225\n\005shape\030\007" + " \003(\0132&.diplomacy.tensorflow.TensorShapeP" + "roto\0221\n\006tensor\030\010 \003(\0132!.diplomacy.tensorf" + "low.TensorProto\0220\n\004func\030\t \003(\0132\".diplomac" + "y.tensorflow.NameAttrListB\007\n\005value\"\246\001\n\014N" + "ameAttrList\022\014\n\004name\030\001 \001(\t\022:\n\004attr\030\002 \003(\0132" + ",.diplomacy.tensorflow.NameAttrList.Attr" + "Entry\032L\n\tAttrEntry\022\013\n\003key\030\001 \001(\t\022.\n\005value" + "\030\002 \001(\0132\037.diplomacy.tensorflow.AttrValue:" + "\0028\001Bo\n\030org.tensorflow.frameworkB\017AttrVal" + "ueProtosP\001Z=github.com/tensorflow/tensor" + "flow/tensorflow/go/core/framework\370\001\001b\006pr" + "oto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1164); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/attr_value.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void AttrValue_ListValue::InitAsDefaultInstance() { +} +void AttrValue_ListValue::clear_shape() { + shape_.Clear(); +} +void AttrValue_ListValue::clear_tensor() { + tensor_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AttrValue_ListValue::kSFieldNumber; +const int AttrValue_ListValue::kIFieldNumber; +const int AttrValue_ListValue::kFFieldNumber; +const int AttrValue_ListValue::kBFieldNumber; +const int AttrValue_ListValue::kTypeFieldNumber; +const int AttrValue_ListValue::kShapeFieldNumber; +const int AttrValue_ListValue::kTensorFieldNumber; +const int AttrValue_ListValue::kFuncFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AttrValue_ListValue::AttrValue_ListValue() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.AttrValue.ListValue) +} +AttrValue_ListValue::AttrValue_ListValue(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + s_(arena), + i_(arena), + f_(arena), + b_(arena), + type_(arena), + shape_(arena), + tensor_(arena), + func_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.AttrValue.ListValue) +} +AttrValue_ListValue::AttrValue_ListValue(const AttrValue_ListValue& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + s_(from.s_), + i_(from.i_), + f_(from.f_), + b_(from.b_), + type_(from.type_), + shape_(from.shape_), + tensor_(from.tensor_), + func_(from.func_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.AttrValue.ListValue) +} + +void AttrValue_ListValue::SharedCtor() { +} + +AttrValue_ListValue::~AttrValue_ListValue() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.AttrValue.ListValue) + SharedDtor(); +} + +void AttrValue_ListValue::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void AttrValue_ListValue::ArenaDtor(void* object) { + AttrValue_ListValue* _this = reinterpret_cast< AttrValue_ListValue* >(object); + (void)_this; +} +void AttrValue_ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AttrValue_ListValue::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AttrValue_ListValue::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AttrValue_ListValue& AttrValue_ListValue::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + return *internal_default_instance(); +} + + +void AttrValue_ListValue::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.AttrValue.ListValue) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + s_.Clear(); + i_.Clear(); + f_.Clear(); + b_.Clear(); + type_.Clear(); + shape_.Clear(); + tensor_.Clear(); + func_.Clear(); + _internal_metadata_.Clear(); +} + +bool AttrValue_ListValue::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.AttrValue.ListValue) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated bytes s = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_s())); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 i = 3 [packed = true]; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_i()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_i()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated float f = 4 [packed = true]; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_f()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 34u, input, this->mutable_f()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated bool b = 5 [packed = true]; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_b()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 42u, input, this->mutable_b()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.DataType type = 6 [packed = true]; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + ::google::protobuf::uint32 length; + DO_(input->ReadVarint32(&length)); + ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast(length)); + while (input->BytesUntilLimit() > 0) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_type(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } + input->PopLimit(limit); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_type(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.TensorShapeProto shape = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_shape())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.TensorProto tensor = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tensor())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.NameAttrList func = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_func())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.AttrValue.ListValue) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.AttrValue.ListValue) + return false; +#undef DO_ +} + +void AttrValue_ListValue::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.AttrValue.ListValue) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes s = 2; + for (int i = 0, n = this->s_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 2, this->s(i), output); + } + + // repeated int64 i = 3 [packed = true]; + if (this->i_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _i_cached_byte_size_)); + } + for (int i = 0, n = this->i_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->i(i), output); + } + + // repeated float f = 4 [packed = true]; + if (this->f_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _f_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->f().data(), this->f_size(), output); + } + + // repeated bool b = 5 [packed = true]; + if (this->b_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _b_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteBoolArray( + this->b().data(), this->b_size(), output); + } + + // repeated .diplomacy.tensorflow.DataType type = 6 [packed = true]; + if (this->type_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + output); + output->WriteVarint32( + static_cast< ::google::protobuf::uint32>(_type_cached_byte_size_)); + } + for (int i = 0, n = this->type_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag( + this->type(i), output); + } + + // repeated .diplomacy.tensorflow.TensorShapeProto shape = 7; + for (unsigned int i = 0, + n = static_cast(this->shape_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, + this->shape(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.TensorProto tensor = 8; + for (unsigned int i = 0, + n = static_cast(this->tensor_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, + this->tensor(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.NameAttrList func = 9; + for (unsigned int i = 0, + n = static_cast(this->func_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, + this->func(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.AttrValue.ListValue) +} + +::google::protobuf::uint8* AttrValue_ListValue::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.AttrValue.ListValue) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated bytes s = 2; + for (int i = 0, n = this->s_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(2, this->s(i), target); + } + + // repeated int64 i = 3 [packed = true]; + if (this->i_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _i_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->i_, target); + } + + // repeated float f = 4 [packed = true]; + if (this->f_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _f_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->f_, target); + } + + // repeated bool b = 5 [packed = true]; + if (this->b_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _b_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteBoolNoTagToArray(this->b_, target); + } + + // repeated .diplomacy.tensorflow.DataType type = 6 [packed = true]; + if (this->type_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>( + _type_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray( + this->type_, target); + } + + // repeated .diplomacy.tensorflow.TensorShapeProto shape = 7; + for (unsigned int i = 0, + n = static_cast(this->shape_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->shape(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.TensorProto tensor = 8; + for (unsigned int i = 0, + n = static_cast(this->tensor_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->tensor(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.NameAttrList func = 9; + for (unsigned int i = 0, + n = static_cast(this->func_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 9, this->func(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.AttrValue.ListValue) + return target; +} + +size_t AttrValue_ListValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.AttrValue.ListValue) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated bytes s = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->s_size()); + for (int i = 0, n = this->s_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->s(i)); + } + + // repeated int64 i = 3 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->i_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _i_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float f = 4 [packed = true]; + { + unsigned int count = static_cast(this->f_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _f_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated bool b = 5 [packed = true]; + { + unsigned int count = static_cast(this->b_size()); + size_t data_size = 1UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _b_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .diplomacy.tensorflow.DataType type = 6 [packed = true]; + { + size_t data_size = 0; + unsigned int count = static_cast(this->type_size());for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->type(static_cast(i))); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _type_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .diplomacy.tensorflow.TensorShapeProto shape = 7; + { + unsigned int count = static_cast(this->shape_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->shape(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.TensorProto tensor = 8; + { + unsigned int count = static_cast(this->tensor_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tensor(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.NameAttrList func = 9; + { + unsigned int count = static_cast(this->func_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->func(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AttrValue_ListValue::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.AttrValue.ListValue) + GOOGLE_DCHECK_NE(&from, this); + const AttrValue_ListValue* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.AttrValue.ListValue) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.AttrValue.ListValue) + MergeFrom(*source); + } +} + +void AttrValue_ListValue::MergeFrom(const AttrValue_ListValue& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.AttrValue.ListValue) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + s_.MergeFrom(from.s_); + i_.MergeFrom(from.i_); + f_.MergeFrom(from.f_); + b_.MergeFrom(from.b_); + type_.MergeFrom(from.type_); + shape_.MergeFrom(from.shape_); + tensor_.MergeFrom(from.tensor_); + func_.MergeFrom(from.func_); +} + +void AttrValue_ListValue::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.AttrValue.ListValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AttrValue_ListValue::CopyFrom(const AttrValue_ListValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.AttrValue.ListValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AttrValue_ListValue::IsInitialized() const { + return true; +} + +void AttrValue_ListValue::Swap(AttrValue_ListValue* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AttrValue_ListValue* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void AttrValue_ListValue::UnsafeArenaSwap(AttrValue_ListValue* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AttrValue_ListValue::InternalSwap(AttrValue_ListValue* other) { + using std::swap; + s_.InternalSwap(CastToBase(&other->s_)); + i_.InternalSwap(&other->i_); + f_.InternalSwap(&other->f_); + b_.InternalSwap(&other->b_); + type_.InternalSwap(&other->type_); + CastToBase(&shape_)->InternalSwap(CastToBase(&other->shape_)); + CastToBase(&tensor_)->InternalSwap(CastToBase(&other->tensor_)); + CastToBase(&func_)->InternalSwap(CastToBase(&other->func_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AttrValue_ListValue::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void AttrValue::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_AttrValue_default_instance_.s_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::diplomacy::tensorflow::_AttrValue_default_instance_.i_ = GOOGLE_LONGLONG(0); + ::diplomacy::tensorflow::_AttrValue_default_instance_.f_ = 0; + ::diplomacy::tensorflow::_AttrValue_default_instance_.b_ = false; + ::diplomacy::tensorflow::_AttrValue_default_instance_.type_ = 0; + ::diplomacy::tensorflow::_AttrValue_default_instance_.shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); + ::diplomacy::tensorflow::_AttrValue_default_instance_.tensor_ = const_cast< ::diplomacy::tensorflow::TensorProto*>( + ::diplomacy::tensorflow::TensorProto::internal_default_instance()); + ::diplomacy::tensorflow::_AttrValue_default_instance_.list_ = const_cast< ::diplomacy::tensorflow::AttrValue_ListValue*>( + ::diplomacy::tensorflow::AttrValue_ListValue::internal_default_instance()); + ::diplomacy::tensorflow::_AttrValue_default_instance_.func_ = const_cast< ::diplomacy::tensorflow::NameAttrList*>( + ::diplomacy::tensorflow::NameAttrList::internal_default_instance()); + ::diplomacy::tensorflow::_AttrValue_default_instance_.placeholder_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void AttrValue::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + set_has_shape(); + value_.shape_ = shape; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AttrValue.shape) +} +void AttrValue::clear_shape() { + if (has_shape()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.shape_; + } + clear_has_value(); + } +} +void AttrValue::set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (tensor) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor)->GetArena(); + if (message_arena != submessage_arena) { + tensor = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor, submessage_arena); + } + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AttrValue.tensor) +} +void AttrValue::clear_tensor() { + if (has_tensor()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.tensor_; + } + clear_has_value(); + } +} +void AttrValue::set_allocated_list(::diplomacy::tensorflow::AttrValue_ListValue* list) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (list) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(list); + if (message_arena != submessage_arena) { + list = ::google::protobuf::internal::GetOwnedMessage( + message_arena, list, submessage_arena); + } + set_has_list(); + value_.list_ = list; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AttrValue.list) +} +void AttrValue::set_allocated_func(::diplomacy::tensorflow::NameAttrList* func) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (func) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(func); + if (message_arena != submessage_arena) { + func = ::google::protobuf::internal::GetOwnedMessage( + message_arena, func, submessage_arena); + } + set_has_func(); + value_.func_ = func; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AttrValue.func) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AttrValue::kSFieldNumber; +const int AttrValue::kIFieldNumber; +const int AttrValue::kFFieldNumber; +const int AttrValue::kBFieldNumber; +const int AttrValue::kTypeFieldNumber; +const int AttrValue::kShapeFieldNumber; +const int AttrValue::kTensorFieldNumber; +const int AttrValue::kListFieldNumber; +const int AttrValue::kFuncFieldNumber; +const int AttrValue::kPlaceholderFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AttrValue::AttrValue() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.AttrValue) +} +AttrValue::AttrValue(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.AttrValue) +} +AttrValue::AttrValue(const AttrValue& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_value(); + switch (from.value_case()) { + case kS: { + set_s(from.s()); + break; + } + case kI: { + set_i(from.i()); + break; + } + case kF: { + set_f(from.f()); + break; + } + case kB: { + set_b(from.b()); + break; + } + case kType: { + set_type(from.type()); + break; + } + case kShape: { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + break; + } + case kTensor: { + mutable_tensor()->::diplomacy::tensorflow::TensorProto::MergeFrom(from.tensor()); + break; + } + case kList: { + mutable_list()->::diplomacy::tensorflow::AttrValue_ListValue::MergeFrom(from.list()); + break; + } + case kFunc: { + mutable_func()->::diplomacy::tensorflow::NameAttrList::MergeFrom(from.func()); + break; + } + case kPlaceholder: { + set_placeholder(from.placeholder()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.AttrValue) +} + +void AttrValue::SharedCtor() { + clear_has_value(); +} + +AttrValue::~AttrValue() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.AttrValue) + SharedDtor(); +} + +void AttrValue::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_value()) { + clear_value(); + } +} + +void AttrValue::ArenaDtor(void* object) { + AttrValue* _this = reinterpret_cast< AttrValue* >(object); + (void)_this; +} +void AttrValue::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AttrValue::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AttrValue::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AttrValue& AttrValue::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + return *internal_default_instance(); +} + + +void AttrValue::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.AttrValue) + switch (value_case()) { + case kS: { + value_.s_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + break; + } + case kI: { + // No need to clear + break; + } + case kF: { + // No need to clear + break; + } + case kB: { + // No need to clear + break; + } + case kType: { + // No need to clear + break; + } + case kShape: { + if (GetArenaNoVirtual() == NULL) { + delete value_.shape_; + } + break; + } + case kTensor: { + if (GetArenaNoVirtual() == NULL) { + delete value_.tensor_; + } + break; + } + case kList: { + if (GetArenaNoVirtual() == NULL) { + delete value_.list_; + } + break; + } + case kFunc: { + if (GetArenaNoVirtual() == NULL) { + delete value_.func_; + } + break; + } + case kPlaceholder: { + value_.placeholder_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + _oneof_case_[0] = VALUE_NOT_SET; +} + + +void AttrValue::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.AttrValue) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_value(); + _internal_metadata_.Clear(); +} + +bool AttrValue::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.AttrValue) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.AttrValue.ListValue list = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_list())); + } else { + goto handle_unusual; + } + break; + } + + // bytes s = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_s())); + } else { + goto handle_unusual; + } + break; + } + + // int64 i = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &value_.i_))); + set_has_i(); + } else { + goto handle_unusual; + } + break; + } + + // float f = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_.f_))); + set_has_f(); + } else { + goto handle_unusual; + } + break; + } + + // bool b = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &value_.b_))); + set_has_b(); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType type = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorProto tensor = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; + } + + // string placeholder = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_placeholder())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->placeholder().data(), static_cast(this->placeholder().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.AttrValue.placeholder")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.NameAttrList func = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_func())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.AttrValue) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.AttrValue) + return false; +#undef DO_ +} + +void AttrValue::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.AttrValue) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.AttrValue.ListValue list = 1; + if (has_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_list(), output); + } + + // bytes s = 2; + if (has_s()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->s(), output); + } + + // int64 i = 3; + if (has_i()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->i(), output); + } + + // float f = 4; + if (has_f()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->f(), output); + } + + // bool b = 5; + if (has_b()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->b(), output); + } + + // .diplomacy.tensorflow.DataType type = 6; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->type(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 7; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->_internal_shape(), output); + } + + // .diplomacy.tensorflow.TensorProto tensor = 8; + if (has_tensor()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_tensor(), output); + } + + // string placeholder = 9; + if (has_placeholder()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->placeholder().data(), static_cast(this->placeholder().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.AttrValue.placeholder"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 9, this->placeholder(), output); + } + + // .diplomacy.tensorflow.NameAttrList func = 10; + if (has_func()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, this->_internal_func(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.AttrValue) +} + +::google::protobuf::uint8* AttrValue::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.AttrValue) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.AttrValue.ListValue list = 1; + if (has_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_list(), deterministic, target); + } + + // bytes s = 2; + if (has_s()) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 2, this->s(), target); + } + + // int64 i = 3; + if (has_i()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->i(), target); + } + + // float f = 4; + if (has_f()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->f(), target); + } + + // bool b = 5; + if (has_b()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->b(), target); + } + + // .diplomacy.tensorflow.DataType type = 6; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->type(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 7; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->_internal_shape(), deterministic, target); + } + + // .diplomacy.tensorflow.TensorProto tensor = 8; + if (has_tensor()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_tensor(), deterministic, target); + } + + // string placeholder = 9; + if (has_placeholder()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->placeholder().data(), static_cast(this->placeholder().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.AttrValue.placeholder"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 9, this->placeholder(), target); + } + + // .diplomacy.tensorflow.NameAttrList func = 10; + if (has_func()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 10, this->_internal_func(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.AttrValue) + return target; +} + +size_t AttrValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.AttrValue) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + switch (value_case()) { + // bytes s = 2; + case kS: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->s()); + break; + } + // int64 i = 3; + case kI: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->i()); + break; + } + // float f = 4; + case kF: { + total_size += 1 + 4; + break; + } + // bool b = 5; + case kB: { + total_size += 1 + 1; + break; + } + // .diplomacy.tensorflow.DataType type = 6; + case kType: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + break; + } + // .diplomacy.tensorflow.TensorShapeProto shape = 7; + case kShape: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.shape_); + break; + } + // .diplomacy.tensorflow.TensorProto tensor = 8; + case kTensor: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.tensor_); + break; + } + // .diplomacy.tensorflow.AttrValue.ListValue list = 1; + case kList: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.list_); + break; + } + // .diplomacy.tensorflow.NameAttrList func = 10; + case kFunc: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.func_); + break; + } + // string placeholder = 9; + case kPlaceholder: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->placeholder()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AttrValue::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.AttrValue) + GOOGLE_DCHECK_NE(&from, this); + const AttrValue* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.AttrValue) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.AttrValue) + MergeFrom(*source); + } +} + +void AttrValue::MergeFrom(const AttrValue& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.AttrValue) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.value_case()) { + case kS: { + set_s(from.s()); + break; + } + case kI: { + set_i(from.i()); + break; + } + case kF: { + set_f(from.f()); + break; + } + case kB: { + set_b(from.b()); + break; + } + case kType: { + set_type(from.type()); + break; + } + case kShape: { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + break; + } + case kTensor: { + mutable_tensor()->::diplomacy::tensorflow::TensorProto::MergeFrom(from.tensor()); + break; + } + case kList: { + mutable_list()->::diplomacy::tensorflow::AttrValue_ListValue::MergeFrom(from.list()); + break; + } + case kFunc: { + mutable_func()->::diplomacy::tensorflow::NameAttrList::MergeFrom(from.func()); + break; + } + case kPlaceholder: { + set_placeholder(from.placeholder()); + break; + } + case VALUE_NOT_SET: { + break; + } + } +} + +void AttrValue::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.AttrValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AttrValue::CopyFrom(const AttrValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.AttrValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AttrValue::IsInitialized() const { + return true; +} + +void AttrValue::Swap(AttrValue* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AttrValue* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void AttrValue::UnsafeArenaSwap(AttrValue* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AttrValue::InternalSwap(AttrValue* other) { + using std::swap; + swap(value_, other->value_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AttrValue::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse() {} +NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void NameAttrList_AttrEntry_DoNotUse::MergeFrom(const NameAttrList_AttrEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata NameAttrList_AttrEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::file_level_metadata[2]; +} +void NameAttrList_AttrEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void NameAttrList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NameAttrList::kNameFieldNumber; +const int NameAttrList::kAttrFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NameAttrList::NameAttrList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NameAttrList) +} +NameAttrList::NameAttrList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + attr_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.NameAttrList) +} +NameAttrList::NameAttrList(const NameAttrList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + attr_.MergeFrom(from.attr_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NameAttrList) +} + +void NameAttrList::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +NameAttrList::~NameAttrList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NameAttrList) + SharedDtor(); +} + +void NameAttrList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void NameAttrList::ArenaDtor(void* object) { + NameAttrList* _this = reinterpret_cast< NameAttrList* >(object); + (void)_this; +} +void NameAttrList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NameAttrList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NameAttrList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NameAttrList& NameAttrList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base); + return *internal_default_instance(); +} + + +void NameAttrList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NameAttrList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + attr_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool NameAttrList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NameAttrList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NameAttrList.name")); + } else { + goto handle_unusual; + } + break; + } + + // map attr = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + NameAttrList_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + NameAttrList_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue > > parser(&attr_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NameAttrList.AttrEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NameAttrList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NameAttrList) + return false; +#undef DO_ +} + +void NameAttrList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NameAttrList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NameAttrList.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // map attr = 2; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NameAttrList.AttrEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NameAttrList) +} + +::google::protobuf::uint8* NameAttrList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NameAttrList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NameAttrList.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // map attr = 2; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NameAttrList.AttrEntry.key"); + } + }; + + if (deterministic && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NameAttrList) + return target; +} + +size_t NameAttrList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NameAttrList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map attr = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->attr_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(attr_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NameAttrList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NameAttrList) + GOOGLE_DCHECK_NE(&from, this); + const NameAttrList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NameAttrList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NameAttrList) + MergeFrom(*source); + } +} + +void NameAttrList::MergeFrom(const NameAttrList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NameAttrList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + attr_.MergeFrom(from.attr_); + if (from.name().size() > 0) { + set_name(from.name()); + } +} + +void NameAttrList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NameAttrList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NameAttrList::CopyFrom(const NameAttrList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NameAttrList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NameAttrList::IsInitialized() const { + return true; +} + +void NameAttrList::Swap(NameAttrList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NameAttrList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void NameAttrList::UnsafeArenaSwap(NameAttrList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NameAttrList::InternalSwap(NameAttrList* other) { + using std::swap; + attr_.Swap(&other->attr_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NameAttrList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::AttrValue_ListValue* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::AttrValue_ListValue >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::AttrValue_ListValue >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::AttrValue* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::AttrValue >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::AttrValue >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NameAttrList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NameAttrList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NameAttrList >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.pb.h new file mode 100644 index 0000000..52be5fb --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.pb.h @@ -0,0 +1,1818 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/attr_value.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_tensorflow/core/framework/tensor.pb.h" +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace diplomacy { +namespace tensorflow { +class AttrValue; +class AttrValueDefaultTypeInternal; +extern AttrValueDefaultTypeInternal _AttrValue_default_instance_; +class AttrValue_ListValue; +class AttrValue_ListValueDefaultTypeInternal; +extern AttrValue_ListValueDefaultTypeInternal _AttrValue_ListValue_default_instance_; +class NameAttrList; +class NameAttrListDefaultTypeInternal; +extern NameAttrListDefaultTypeInternal _NameAttrList_default_instance_; +class NameAttrList_AttrEntry_DoNotUse; +class NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal; +extern NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal _NameAttrList_AttrEntry_DoNotUse_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::AttrValue* Arena::CreateMaybeMessage<::diplomacy::tensorflow::AttrValue>(Arena*); +template<> ::diplomacy::tensorflow::AttrValue_ListValue* Arena::CreateMaybeMessage<::diplomacy::tensorflow::AttrValue_ListValue>(Arena*); +template<> ::diplomacy::tensorflow::NameAttrList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NameAttrList>(Arena*); +template<> ::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NameAttrList_AttrEntry_DoNotUse>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class AttrValue_ListValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.AttrValue.ListValue) */ { + public: + AttrValue_ListValue(); + virtual ~AttrValue_ListValue(); + + AttrValue_ListValue(const AttrValue_ListValue& from); + + inline AttrValue_ListValue& operator=(const AttrValue_ListValue& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AttrValue_ListValue(AttrValue_ListValue&& from) noexcept + : AttrValue_ListValue() { + *this = ::std::move(from); + } + + inline AttrValue_ListValue& operator=(AttrValue_ListValue&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AttrValue_ListValue& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AttrValue_ListValue* internal_default_instance() { + return reinterpret_cast( + &_AttrValue_ListValue_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(AttrValue_ListValue* other); + void Swap(AttrValue_ListValue* other); + friend void swap(AttrValue_ListValue& a, AttrValue_ListValue& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AttrValue_ListValue* New() const final { + return CreateMaybeMessage(NULL); + } + + AttrValue_ListValue* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AttrValue_ListValue& from); + void MergeFrom(const AttrValue_ListValue& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AttrValue_ListValue* other); + protected: + explicit AttrValue_ListValue(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bytes s = 2; + int s_size() const; + void clear_s(); + static const int kSFieldNumber = 2; + const ::std::string& s(int index) const; + ::std::string* mutable_s(int index); + void set_s(int index, const ::std::string& value); + #if LANG_CXX11 + void set_s(int index, ::std::string&& value); + #endif + void set_s(int index, const char* value); + void set_s(int index, const void* value, size_t size); + ::std::string* add_s(); + void add_s(const ::std::string& value); + #if LANG_CXX11 + void add_s(::std::string&& value); + #endif + void add_s(const char* value); + void add_s(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& s() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_s(); + + // repeated int64 i = 3 [packed = true]; + int i_size() const; + void clear_i(); + static const int kIFieldNumber = 3; + ::google::protobuf::int64 i(int index) const; + void set_i(int index, ::google::protobuf::int64 value); + void add_i(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + i() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_i(); + + // repeated float f = 4 [packed = true]; + int f_size() const; + void clear_f(); + static const int kFFieldNumber = 4; + float f(int index) const; + void set_f(int index, float value); + void add_f(float value); + const ::google::protobuf::RepeatedField< float >& + f() const; + ::google::protobuf::RepeatedField< float >* + mutable_f(); + + // repeated bool b = 5 [packed = true]; + int b_size() const; + void clear_b(); + static const int kBFieldNumber = 5; + bool b(int index) const; + void set_b(int index, bool value); + void add_b(bool value); + const ::google::protobuf::RepeatedField< bool >& + b() const; + ::google::protobuf::RepeatedField< bool >* + mutable_b(); + + // repeated .diplomacy.tensorflow.DataType type = 6 [packed = true]; + int type_size() const; + void clear_type(); + static const int kTypeFieldNumber = 6; + ::diplomacy::tensorflow::DataType type(int index) const; + void set_type(int index, ::diplomacy::tensorflow::DataType value); + void add_type(::diplomacy::tensorflow::DataType value); + const ::google::protobuf::RepeatedField& type() const; + ::google::protobuf::RepeatedField* mutable_type(); + + // repeated .diplomacy.tensorflow.TensorShapeProto shape = 7; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 7; + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto >* + mutable_shape(); + const ::diplomacy::tensorflow::TensorShapeProto& shape(int index) const; + ::diplomacy::tensorflow::TensorShapeProto* add_shape(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto >& + shape() const; + + // repeated .diplomacy.tensorflow.TensorProto tensor = 8; + int tensor_size() const; + void clear_tensor(); + static const int kTensorFieldNumber = 8; + ::diplomacy::tensorflow::TensorProto* mutable_tensor(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >* + mutable_tensor(); + const ::diplomacy::tensorflow::TensorProto& tensor(int index) const; + ::diplomacy::tensorflow::TensorProto* add_tensor(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >& + tensor() const; + + // repeated .diplomacy.tensorflow.NameAttrList func = 9; + int func_size() const; + void clear_func(); + static const int kFuncFieldNumber = 9; + ::diplomacy::tensorflow::NameAttrList* mutable_func(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NameAttrList >* + mutable_func(); + const ::diplomacy::tensorflow::NameAttrList& func(int index) const; + ::diplomacy::tensorflow::NameAttrList* add_func(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NameAttrList >& + func() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AttrValue.ListValue) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> s_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > i_; + mutable int _i_cached_byte_size_; + ::google::protobuf::RepeatedField< float > f_; + mutable int _f_cached_byte_size_; + ::google::protobuf::RepeatedField< bool > b_; + mutable int _b_cached_byte_size_; + ::google::protobuf::RepeatedField type_; + mutable int _type_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto > shape_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto > tensor_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NameAttrList > func_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class AttrValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.AttrValue) */ { + public: + AttrValue(); + virtual ~AttrValue(); + + AttrValue(const AttrValue& from); + + inline AttrValue& operator=(const AttrValue& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AttrValue(AttrValue&& from) noexcept + : AttrValue() { + *this = ::std::move(from); + } + + inline AttrValue& operator=(AttrValue&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AttrValue& default_instance(); + + enum ValueCase { + kS = 2, + kI = 3, + kF = 4, + kB = 5, + kType = 6, + kShape = 7, + kTensor = 8, + kList = 1, + kFunc = 10, + kPlaceholder = 9, + VALUE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AttrValue* internal_default_instance() { + return reinterpret_cast( + &_AttrValue_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(AttrValue* other); + void Swap(AttrValue* other); + friend void swap(AttrValue& a, AttrValue& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AttrValue* New() const final { + return CreateMaybeMessage(NULL); + } + + AttrValue* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AttrValue& from); + void MergeFrom(const AttrValue& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AttrValue* other); + protected: + explicit AttrValue(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef AttrValue_ListValue ListValue; + + // accessors ------------------------------------------------------- + + // bytes s = 2; + private: + bool has_s() const; + public: + void clear_s(); + static const int kSFieldNumber = 2; + const ::std::string& s() const; + void set_s(const ::std::string& value); + #if LANG_CXX11 + void set_s(::std::string&& value); + #endif + void set_s(const char* value); + void set_s(const void* value, size_t size); + ::std::string* mutable_s(); + ::std::string* release_s(); + void set_allocated_s(::std::string* s); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_s(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_s( + ::std::string* s); + + // int64 i = 3; + private: + bool has_i() const; + public: + void clear_i(); + static const int kIFieldNumber = 3; + ::google::protobuf::int64 i() const; + void set_i(::google::protobuf::int64 value); + + // float f = 4; + private: + bool has_f() const; + public: + void clear_f(); + static const int kFFieldNumber = 4; + float f() const; + void set_f(float value); + + // bool b = 5; + private: + bool has_b() const; + public: + void clear_b(); + static const int kBFieldNumber = 5; + bool b() const; + void set_b(bool value); + + // .diplomacy.tensorflow.DataType type = 6; + private: + bool has_type() const; + public: + void clear_type(); + static const int kTypeFieldNumber = 6; + ::diplomacy::tensorflow::DataType type() const; + void set_type(::diplomacy::tensorflow::DataType value); + + // .diplomacy.tensorflow.TensorShapeProto shape = 7; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 7; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // .diplomacy.tensorflow.TensorProto tensor = 8; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 8; + private: + const ::diplomacy::tensorflow::TensorProto& _internal_tensor() const; + public: + const ::diplomacy::tensorflow::TensorProto& tensor() const; + ::diplomacy::tensorflow::TensorProto* release_tensor(); + ::diplomacy::tensorflow::TensorProto* mutable_tensor(); + void set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor); + void unsafe_arena_set_allocated_tensor( + ::diplomacy::tensorflow::TensorProto* tensor); + ::diplomacy::tensorflow::TensorProto* unsafe_arena_release_tensor(); + + // .diplomacy.tensorflow.AttrValue.ListValue list = 1; + bool has_list() const; + void clear_list(); + static const int kListFieldNumber = 1; + private: + const ::diplomacy::tensorflow::AttrValue_ListValue& _internal_list() const; + public: + const ::diplomacy::tensorflow::AttrValue_ListValue& list() const; + ::diplomacy::tensorflow::AttrValue_ListValue* release_list(); + ::diplomacy::tensorflow::AttrValue_ListValue* mutable_list(); + void set_allocated_list(::diplomacy::tensorflow::AttrValue_ListValue* list); + void unsafe_arena_set_allocated_list( + ::diplomacy::tensorflow::AttrValue_ListValue* list); + ::diplomacy::tensorflow::AttrValue_ListValue* unsafe_arena_release_list(); + + // .diplomacy.tensorflow.NameAttrList func = 10; + bool has_func() const; + void clear_func(); + static const int kFuncFieldNumber = 10; + private: + const ::diplomacy::tensorflow::NameAttrList& _internal_func() const; + public: + const ::diplomacy::tensorflow::NameAttrList& func() const; + ::diplomacy::tensorflow::NameAttrList* release_func(); + ::diplomacy::tensorflow::NameAttrList* mutable_func(); + void set_allocated_func(::diplomacy::tensorflow::NameAttrList* func); + void unsafe_arena_set_allocated_func( + ::diplomacy::tensorflow::NameAttrList* func); + ::diplomacy::tensorflow::NameAttrList* unsafe_arena_release_func(); + + // string placeholder = 9; + private: + bool has_placeholder() const; + public: + void clear_placeholder(); + static const int kPlaceholderFieldNumber = 9; + const ::std::string& placeholder() const; + void set_placeholder(const ::std::string& value); + #if LANG_CXX11 + void set_placeholder(::std::string&& value); + #endif + void set_placeholder(const char* value); + void set_placeholder(const char* value, size_t size); + ::std::string* mutable_placeholder(); + ::std::string* release_placeholder(); + void set_allocated_placeholder(::std::string* placeholder); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_placeholder(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_placeholder( + ::std::string* placeholder); + + void clear_value(); + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AttrValue) + private: + void set_has_s(); + void set_has_i(); + void set_has_f(); + void set_has_b(); + void set_has_type(); + void set_has_shape(); + void set_has_tensor(); + void set_has_list(); + void set_has_func(); + void set_has_placeholder(); + + inline bool has_value() const; + inline void clear_has_value(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union ValueUnion { + ValueUnion() {} + ::google::protobuf::internal::ArenaStringPtr s_; + ::google::protobuf::int64 i_; + float f_; + bool b_; + int type_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + ::diplomacy::tensorflow::TensorProto* tensor_; + ::diplomacy::tensorflow::AttrValue_ListValue* list_; + ::diplomacy::tensorflow::NameAttrList* func_; + ::google::protobuf::internal::ArenaStringPtr placeholder_; + } value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class NameAttrList_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + NameAttrList_AttrEntry_DoNotUse(); + NameAttrList_AttrEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const NameAttrList_AttrEntry_DoNotUse& other); + static const NameAttrList_AttrEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_NameAttrList_AttrEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class NameAttrList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NameAttrList) */ { + public: + NameAttrList(); + virtual ~NameAttrList(); + + NameAttrList(const NameAttrList& from); + + inline NameAttrList& operator=(const NameAttrList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NameAttrList(NameAttrList&& from) noexcept + : NameAttrList() { + *this = ::std::move(from); + } + + inline NameAttrList& operator=(NameAttrList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NameAttrList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NameAttrList* internal_default_instance() { + return reinterpret_cast( + &_NameAttrList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(NameAttrList* other); + void Swap(NameAttrList* other); + friend void swap(NameAttrList& a, NameAttrList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NameAttrList* New() const final { + return CreateMaybeMessage(NULL); + } + + NameAttrList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NameAttrList& from); + void MergeFrom(const NameAttrList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NameAttrList* other); + protected: + explicit NameAttrList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // map attr = 2; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 2; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& + attr() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* + mutable_attr(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NameAttrList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + NameAttrList_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > attr_; + ::google::protobuf::internal::ArenaStringPtr name_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// AttrValue_ListValue + +// repeated bytes s = 2; +inline int AttrValue_ListValue::s_size() const { + return s_.size(); +} +inline void AttrValue_ListValue::clear_s() { + s_.Clear(); +} +inline const ::std::string& AttrValue_ListValue::s(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.s) + return s_.Get(index); +} +inline ::std::string* AttrValue_ListValue::mutable_s(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.ListValue.s) + return s_.Mutable(index); +} +inline void AttrValue_ListValue::set_s(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.ListValue.s) + s_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void AttrValue_ListValue::set_s(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.ListValue.s) + s_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void AttrValue_ListValue::set_s(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + s_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.AttrValue.ListValue.s) +} +inline void AttrValue_ListValue::set_s(int index, const void* value, size_t size) { + s_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.AttrValue.ListValue.s) +} +inline ::std::string* AttrValue_ListValue::add_s() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.AttrValue.ListValue.s) + return s_.Add(); +} +inline void AttrValue_ListValue::add_s(const ::std::string& value) { + s_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.s) +} +#if LANG_CXX11 +inline void AttrValue_ListValue::add_s(::std::string&& value) { + s_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.s) +} +#endif +inline void AttrValue_ListValue::add_s(const char* value) { + GOOGLE_DCHECK(value != NULL); + s_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.AttrValue.ListValue.s) +} +inline void AttrValue_ListValue::add_s(const void* value, size_t size) { + s_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.AttrValue.ListValue.s) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +AttrValue_ListValue::s() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.s) + return s_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +AttrValue_ListValue::mutable_s() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.s) + return &s_; +} + +// repeated int64 i = 3 [packed = true]; +inline int AttrValue_ListValue::i_size() const { + return i_.size(); +} +inline void AttrValue_ListValue::clear_i() { + i_.Clear(); +} +inline ::google::protobuf::int64 AttrValue_ListValue::i(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.i) + return i_.Get(index); +} +inline void AttrValue_ListValue::set_i(int index, ::google::protobuf::int64 value) { + i_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.ListValue.i) +} +inline void AttrValue_ListValue::add_i(::google::protobuf::int64 value) { + i_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.i) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +AttrValue_ListValue::i() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.i) + return i_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +AttrValue_ListValue::mutable_i() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.i) + return &i_; +} + +// repeated float f = 4 [packed = true]; +inline int AttrValue_ListValue::f_size() const { + return f_.size(); +} +inline void AttrValue_ListValue::clear_f() { + f_.Clear(); +} +inline float AttrValue_ListValue::f(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.f) + return f_.Get(index); +} +inline void AttrValue_ListValue::set_f(int index, float value) { + f_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.ListValue.f) +} +inline void AttrValue_ListValue::add_f(float value) { + f_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.f) +} +inline const ::google::protobuf::RepeatedField< float >& +AttrValue_ListValue::f() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.f) + return f_; +} +inline ::google::protobuf::RepeatedField< float >* +AttrValue_ListValue::mutable_f() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.f) + return &f_; +} + +// repeated bool b = 5 [packed = true]; +inline int AttrValue_ListValue::b_size() const { + return b_.size(); +} +inline void AttrValue_ListValue::clear_b() { + b_.Clear(); +} +inline bool AttrValue_ListValue::b(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.b) + return b_.Get(index); +} +inline void AttrValue_ListValue::set_b(int index, bool value) { + b_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.ListValue.b) +} +inline void AttrValue_ListValue::add_b(bool value) { + b_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.b) +} +inline const ::google::protobuf::RepeatedField< bool >& +AttrValue_ListValue::b() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.b) + return b_; +} +inline ::google::protobuf::RepeatedField< bool >* +AttrValue_ListValue::mutable_b() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.b) + return &b_; +} + +// repeated .diplomacy.tensorflow.DataType type = 6 [packed = true]; +inline int AttrValue_ListValue::type_size() const { + return type_.size(); +} +inline void AttrValue_ListValue::clear_type() { + type_.Clear(); +} +inline ::diplomacy::tensorflow::DataType AttrValue_ListValue::type(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.type) + return static_cast< ::diplomacy::tensorflow::DataType >(type_.Get(index)); +} +inline void AttrValue_ListValue::set_type(int index, ::diplomacy::tensorflow::DataType value) { + type_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.ListValue.type) +} +inline void AttrValue_ListValue::add_type(::diplomacy::tensorflow::DataType value) { + type_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.type) +} +inline const ::google::protobuf::RepeatedField& +AttrValue_ListValue::type() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.type) + return type_; +} +inline ::google::protobuf::RepeatedField* +AttrValue_ListValue::mutable_type() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.type) + return &type_; +} + +// repeated .diplomacy.tensorflow.TensorShapeProto shape = 7; +inline int AttrValue_ListValue::shape_size() const { + return shape_.size(); +} +inline ::diplomacy::tensorflow::TensorShapeProto* AttrValue_ListValue::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.ListValue.shape) + return shape_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto >* +AttrValue_ListValue::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.shape) + return &shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& AttrValue_ListValue::shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.shape) + return shape_.Get(index); +} +inline ::diplomacy::tensorflow::TensorShapeProto* AttrValue_ListValue::add_shape() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.shape) + return shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto >& +AttrValue_ListValue::shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.shape) + return shape_; +} + +// repeated .diplomacy.tensorflow.TensorProto tensor = 8; +inline int AttrValue_ListValue::tensor_size() const { + return tensor_.size(); +} +inline ::diplomacy::tensorflow::TensorProto* AttrValue_ListValue::mutable_tensor(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.ListValue.tensor) + return tensor_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >* +AttrValue_ListValue::mutable_tensor() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.tensor) + return &tensor_; +} +inline const ::diplomacy::tensorflow::TensorProto& AttrValue_ListValue::tensor(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.tensor) + return tensor_.Get(index); +} +inline ::diplomacy::tensorflow::TensorProto* AttrValue_ListValue::add_tensor() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.tensor) + return tensor_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >& +AttrValue_ListValue::tensor() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.tensor) + return tensor_; +} + +// repeated .diplomacy.tensorflow.NameAttrList func = 9; +inline int AttrValue_ListValue::func_size() const { + return func_.size(); +} +inline void AttrValue_ListValue::clear_func() { + func_.Clear(); +} +inline ::diplomacy::tensorflow::NameAttrList* AttrValue_ListValue::mutable_func(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.ListValue.func) + return func_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NameAttrList >* +AttrValue_ListValue::mutable_func() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AttrValue.ListValue.func) + return &func_; +} +inline const ::diplomacy::tensorflow::NameAttrList& AttrValue_ListValue::func(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.ListValue.func) + return func_.Get(index); +} +inline ::diplomacy::tensorflow::NameAttrList* AttrValue_ListValue::add_func() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AttrValue.ListValue.func) + return func_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NameAttrList >& +AttrValue_ListValue::func() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AttrValue.ListValue.func) + return func_; +} + +// ------------------------------------------------------------------- + +// AttrValue + +// bytes s = 2; +inline bool AttrValue::has_s() const { + return value_case() == kS; +} +inline void AttrValue::set_has_s() { + _oneof_case_[0] = kS; +} +inline void AttrValue::clear_s() { + if (has_s()) { + value_.s_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_value(); + } +} +inline const ::std::string& AttrValue::s() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.s) + if (has_s()) { + return value_.s_.Get(); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void AttrValue::set_s(const ::std::string& value) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.s) +} +#if LANG_CXX11 +inline void AttrValue::set_s(::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.s) + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.AttrValue.s) +} +#endif +inline void AttrValue::set_s(const char* value) { + GOOGLE_DCHECK(value != NULL); + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.AttrValue.s) +} +inline void AttrValue::set_s(const void* value, + size_t size) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.AttrValue.s) +} +inline ::std::string* AttrValue::mutable_s() { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return value_.s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.s) +} +inline ::std::string* AttrValue::release_s() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AttrValue.s) + if (has_s()) { + clear_has_value(); + return value_.s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_s(::std::string* s) { + if (!has_s()) { + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (s != NULL) { + set_has_s(); + value_.s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AttrValue.s) +} +inline ::std::string* AttrValue::unsafe_arena_release_s() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AttrValue.s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_s()) { + clear_has_value(); + return value_.s_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_s(::std::string* s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_s()) { + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (s) { + set_has_s(); + value_.s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AttrValue.s) +} + +// int64 i = 3; +inline bool AttrValue::has_i() const { + return value_case() == kI; +} +inline void AttrValue::set_has_i() { + _oneof_case_[0] = kI; +} +inline void AttrValue::clear_i() { + if (has_i()) { + value_.i_ = GOOGLE_LONGLONG(0); + clear_has_value(); + } +} +inline ::google::protobuf::int64 AttrValue::i() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.i) + if (has_i()) { + return value_.i_; + } + return GOOGLE_LONGLONG(0); +} +inline void AttrValue::set_i(::google::protobuf::int64 value) { + if (!has_i()) { + clear_value(); + set_has_i(); + } + value_.i_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.i) +} + +// float f = 4; +inline bool AttrValue::has_f() const { + return value_case() == kF; +} +inline void AttrValue::set_has_f() { + _oneof_case_[0] = kF; +} +inline void AttrValue::clear_f() { + if (has_f()) { + value_.f_ = 0; + clear_has_value(); + } +} +inline float AttrValue::f() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.f) + if (has_f()) { + return value_.f_; + } + return 0; +} +inline void AttrValue::set_f(float value) { + if (!has_f()) { + clear_value(); + set_has_f(); + } + value_.f_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.f) +} + +// bool b = 5; +inline bool AttrValue::has_b() const { + return value_case() == kB; +} +inline void AttrValue::set_has_b() { + _oneof_case_[0] = kB; +} +inline void AttrValue::clear_b() { + if (has_b()) { + value_.b_ = false; + clear_has_value(); + } +} +inline bool AttrValue::b() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.b) + if (has_b()) { + return value_.b_; + } + return false; +} +inline void AttrValue::set_b(bool value) { + if (!has_b()) { + clear_value(); + set_has_b(); + } + value_.b_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.b) +} + +// .diplomacy.tensorflow.DataType type = 6; +inline bool AttrValue::has_type() const { + return value_case() == kType; +} +inline void AttrValue::set_has_type() { + _oneof_case_[0] = kType; +} +inline void AttrValue::clear_type() { + if (has_type()) { + value_.type_ = 0; + clear_has_value(); + } +} +inline ::diplomacy::tensorflow::DataType AttrValue::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.type) + if (has_type()) { + return static_cast< ::diplomacy::tensorflow::DataType >(value_.type_); + } + return static_cast< ::diplomacy::tensorflow::DataType >(0); +} +inline void AttrValue::set_type(::diplomacy::tensorflow::DataType value) { + if (!has_type()) { + clear_value(); + set_has_type(); + } + value_.type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.type) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 7; +inline bool AttrValue::has_shape() const { + return value_case() == kShape; +} +inline void AttrValue::set_has_shape() { + _oneof_case_[0] = kShape; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& AttrValue::_internal_shape() const { + return *value_.shape_; +} +inline ::diplomacy::tensorflow::TensorShapeProto* AttrValue::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AttrValue.shape) + if (has_shape()) { + clear_has_value(); + ::diplomacy::tensorflow::TensorShapeProto* temp = value_.shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.shape_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::TensorShapeProto& AttrValue::shape() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.shape) + return has_shape() + ? *value_.shape_ + : *reinterpret_cast< ::diplomacy::tensorflow::TensorShapeProto*>(&::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* AttrValue::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AttrValue.shape) + if (has_shape()) { + clear_has_value(); + ::diplomacy::tensorflow::TensorShapeProto* temp = value_.shape_; + value_.shape_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + clear_value(); + if (shape) { + set_has_shape(); + value_.shape_ = shape; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AttrValue.shape) +} +inline ::diplomacy::tensorflow::TensorShapeProto* AttrValue::mutable_shape() { + if (!has_shape()) { + clear_value(); + set_has_shape(); + value_.shape_ = CreateMaybeMessage< ::diplomacy::tensorflow::TensorShapeProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.shape) + return value_.shape_; +} + +// .diplomacy.tensorflow.TensorProto tensor = 8; +inline bool AttrValue::has_tensor() const { + return value_case() == kTensor; +} +inline void AttrValue::set_has_tensor() { + _oneof_case_[0] = kTensor; +} +inline const ::diplomacy::tensorflow::TensorProto& AttrValue::_internal_tensor() const { + return *value_.tensor_; +} +inline ::diplomacy::tensorflow::TensorProto* AttrValue::release_tensor() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AttrValue.tensor) + if (has_tensor()) { + clear_has_value(); + ::diplomacy::tensorflow::TensorProto* temp = value_.tensor_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.tensor_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::TensorProto& AttrValue::tensor() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.tensor) + return has_tensor() + ? *value_.tensor_ + : *reinterpret_cast< ::diplomacy::tensorflow::TensorProto*>(&::diplomacy::tensorflow::_TensorProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorProto* AttrValue::unsafe_arena_release_tensor() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AttrValue.tensor) + if (has_tensor()) { + clear_has_value(); + ::diplomacy::tensorflow::TensorProto* temp = value_.tensor_; + value_.tensor_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor) { + clear_value(); + if (tensor) { + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AttrValue.tensor) +} +inline ::diplomacy::tensorflow::TensorProto* AttrValue::mutable_tensor() { + if (!has_tensor()) { + clear_value(); + set_has_tensor(); + value_.tensor_ = CreateMaybeMessage< ::diplomacy::tensorflow::TensorProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.tensor) + return value_.tensor_; +} + +// .diplomacy.tensorflow.AttrValue.ListValue list = 1; +inline bool AttrValue::has_list() const { + return value_case() == kList; +} +inline void AttrValue::set_has_list() { + _oneof_case_[0] = kList; +} +inline void AttrValue::clear_list() { + if (has_list()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.list_; + } + clear_has_value(); + } +} +inline const ::diplomacy::tensorflow::AttrValue_ListValue& AttrValue::_internal_list() const { + return *value_.list_; +} +inline ::diplomacy::tensorflow::AttrValue_ListValue* AttrValue::release_list() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AttrValue.list) + if (has_list()) { + clear_has_value(); + ::diplomacy::tensorflow::AttrValue_ListValue* temp = value_.list_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::AttrValue_ListValue& AttrValue::list() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.list) + return has_list() + ? *value_.list_ + : *reinterpret_cast< ::diplomacy::tensorflow::AttrValue_ListValue*>(&::diplomacy::tensorflow::_AttrValue_ListValue_default_instance_); +} +inline ::diplomacy::tensorflow::AttrValue_ListValue* AttrValue::unsafe_arena_release_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AttrValue.list) + if (has_list()) { + clear_has_value(); + ::diplomacy::tensorflow::AttrValue_ListValue* temp = value_.list_; + value_.list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_list(::diplomacy::tensorflow::AttrValue_ListValue* list) { + clear_value(); + if (list) { + set_has_list(); + value_.list_ = list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AttrValue.list) +} +inline ::diplomacy::tensorflow::AttrValue_ListValue* AttrValue::mutable_list() { + if (!has_list()) { + clear_value(); + set_has_list(); + value_.list_ = CreateMaybeMessage< ::diplomacy::tensorflow::AttrValue_ListValue >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.list) + return value_.list_; +} + +// .diplomacy.tensorflow.NameAttrList func = 10; +inline bool AttrValue::has_func() const { + return value_case() == kFunc; +} +inline void AttrValue::set_has_func() { + _oneof_case_[0] = kFunc; +} +inline void AttrValue::clear_func() { + if (has_func()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.func_; + } + clear_has_value(); + } +} +inline const ::diplomacy::tensorflow::NameAttrList& AttrValue::_internal_func() const { + return *value_.func_; +} +inline ::diplomacy::tensorflow::NameAttrList* AttrValue::release_func() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AttrValue.func) + if (has_func()) { + clear_has_value(); + ::diplomacy::tensorflow::NameAttrList* temp = value_.func_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.func_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::NameAttrList& AttrValue::func() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.func) + return has_func() + ? *value_.func_ + : *reinterpret_cast< ::diplomacy::tensorflow::NameAttrList*>(&::diplomacy::tensorflow::_NameAttrList_default_instance_); +} +inline ::diplomacy::tensorflow::NameAttrList* AttrValue::unsafe_arena_release_func() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AttrValue.func) + if (has_func()) { + clear_has_value(); + ::diplomacy::tensorflow::NameAttrList* temp = value_.func_; + value_.func_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_func(::diplomacy::tensorflow::NameAttrList* func) { + clear_value(); + if (func) { + set_has_func(); + value_.func_ = func; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AttrValue.func) +} +inline ::diplomacy::tensorflow::NameAttrList* AttrValue::mutable_func() { + if (!has_func()) { + clear_value(); + set_has_func(); + value_.func_ = CreateMaybeMessage< ::diplomacy::tensorflow::NameAttrList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.func) + return value_.func_; +} + +// string placeholder = 9; +inline bool AttrValue::has_placeholder() const { + return value_case() == kPlaceholder; +} +inline void AttrValue::set_has_placeholder() { + _oneof_case_[0] = kPlaceholder; +} +inline void AttrValue::clear_placeholder() { + if (has_placeholder()) { + value_.placeholder_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_value(); + } +} +inline const ::std::string& AttrValue::placeholder() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AttrValue.placeholder) + if (has_placeholder()) { + return value_.placeholder_.Get(); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void AttrValue::set_placeholder(const ::std::string& value) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.placeholder) +} +#if LANG_CXX11 +inline void AttrValue::set_placeholder(::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AttrValue.placeholder) + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.AttrValue.placeholder) +} +#endif +inline void AttrValue::set_placeholder(const char* value) { + GOOGLE_DCHECK(value != NULL); + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.AttrValue.placeholder) +} +inline void AttrValue::set_placeholder(const char* value, + size_t size) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.AttrValue.placeholder) +} +inline ::std::string* AttrValue::mutable_placeholder() { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return value_.placeholder_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AttrValue.placeholder) +} +inline ::std::string* AttrValue::release_placeholder() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AttrValue.placeholder) + if (has_placeholder()) { + clear_has_value(); + return value_.placeholder_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_placeholder(::std::string* placeholder) { + if (!has_placeholder()) { + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (placeholder != NULL) { + set_has_placeholder(); + value_.placeholder_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AttrValue.placeholder) +} +inline ::std::string* AttrValue::unsafe_arena_release_placeholder() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AttrValue.placeholder) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_placeholder()) { + clear_has_value(); + return value_.placeholder_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_placeholder(::std::string* placeholder) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_placeholder()) { + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (placeholder) { + set_has_placeholder(); + value_.placeholder_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AttrValue.placeholder) +} + +inline bool AttrValue::has_value() const { + return value_case() != VALUE_NOT_SET; +} +inline void AttrValue::clear_has_value() { + _oneof_case_[0] = VALUE_NOT_SET; +} +inline AttrValue::ValueCase AttrValue::value_case() const { + return AttrValue::ValueCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// NameAttrList + +// string name = 1; +inline void NameAttrList::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NameAttrList::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NameAttrList.name) + return name_.Get(); +} +inline void NameAttrList::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NameAttrList.name) +} +#if LANG_CXX11 +inline void NameAttrList::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NameAttrList.name) +} +#endif +inline void NameAttrList::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NameAttrList.name) +} +inline void NameAttrList::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NameAttrList.name) +} +inline ::std::string* NameAttrList::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NameAttrList.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NameAttrList::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NameAttrList.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void NameAttrList::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NameAttrList.name) +} +inline ::std::string* NameAttrList::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NameAttrList.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NameAttrList::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NameAttrList.name) +} + +// map attr = 2; +inline int NameAttrList::attr_size() const { + return attr_.size(); +} +inline void NameAttrList::clear_attr() { + attr_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& +NameAttrList::attr() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.NameAttrList.attr) + return attr_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* +NameAttrList::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.NameAttrList.attr) + return attr_.MutableMap(); +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.proto new file mode 100644 index 0000000..44f79aa --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "AttrValueProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/tensor.proto"; +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +// 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. +message AttrValue { + // LINT.IfChange + message ListValue { + repeated bytes s = 2; // "list(string)" + repeated int64 i = 3 [packed = true]; // "list(int)" + repeated float f = 4 [packed = true]; // "list(float)" + repeated bool b = 5 [packed = true]; // "list(bool)" + repeated DataType type = 6 [packed = true]; // "list(type)" + repeated TensorShapeProto shape = 7; // "list(shape)" + repeated TensorProto tensor = 8; // "list(tensor)" + repeated NameAttrList func = 9; // "list(attr)" + } + // LINT.ThenChange(https://www.tensorflow.org/code/tensorflow/c/c_api.cc) + + oneof value { + bytes s = 2; // "string" + int64 i = 3; // "int" + float f = 4; // "float" + bool b = 5; // "bool" + DataType type = 6; // "type" + TensorShapeProto shape = 7; // "shape" + TensorProto tensor = 8; // "tensor" + ListValue list = 1; // any "list(...)" + + // "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. + NameAttrList func = 10; + + // 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". + string placeholder = 9; + } +} + +// A list of attr names and their values. The whole list is attached +// with a string name. E.g., MatMul[T=float]. +message NameAttrList { + string name = 1; + map attr = 2; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value_pb2.py new file mode 100644 index 0000000..bc50627 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/attr_value_pb2.py @@ -0,0 +1,366 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/attr_value.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/attr_value.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\017AttrValueProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n4diplomacy_tensorflow/core/framework/attr_value.proto\x12\x14\x64iplomacy.tensorflow\x1a\x30\x64iplomacy_tensorflow/core/framework/tensor.proto\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"\x80\x05\n\tAttrValue\x12\x0b\n\x01s\x18\x02 \x01(\x0cH\x00\x12\x0b\n\x01i\x18\x03 \x01(\x03H\x00\x12\x0b\n\x01\x66\x18\x04 \x01(\x02H\x00\x12\x0b\n\x01\x62\x18\x05 \x01(\x08H\x00\x12.\n\x04type\x18\x06 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataTypeH\x00\x12\x37\n\x05shape\x18\x07 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProtoH\x00\x12\x33\n\x06tensor\x18\x08 \x01(\x0b\x32!.diplomacy.tensorflow.TensorProtoH\x00\x12\x39\n\x04list\x18\x01 \x01(\x0b\x32).diplomacy.tensorflow.AttrValue.ListValueH\x00\x12\x32\n\x04\x66unc\x18\n \x01(\x0b\x32\".diplomacy.tensorflow.NameAttrListH\x00\x12\x15\n\x0bplaceholder\x18\t \x01(\tH\x00\x1a\x91\x02\n\tListValue\x12\t\n\x01s\x18\x02 \x03(\x0c\x12\r\n\x01i\x18\x03 \x03(\x03\x42\x02\x10\x01\x12\r\n\x01\x66\x18\x04 \x03(\x02\x42\x02\x10\x01\x12\r\n\x01\x62\x18\x05 \x03(\x08\x42\x02\x10\x01\x12\x30\n\x04type\x18\x06 \x03(\x0e\x32\x1e.diplomacy.tensorflow.DataTypeB\x02\x10\x01\x12\x35\n\x05shape\x18\x07 \x03(\x0b\x32&.diplomacy.tensorflow.TensorShapeProto\x12\x31\n\x06tensor\x18\x08 \x03(\x0b\x32!.diplomacy.tensorflow.TensorProto\x12\x30\n\x04\x66unc\x18\t \x03(\x0b\x32\".diplomacy.tensorflow.NameAttrListB\x07\n\x05value\"\xa6\x01\n\x0cNameAttrList\x12\x0c\n\x04name\x18\x01 \x01(\t\x12:\n\x04\x61ttr\x18\x02 \x03(\x0b\x32,.diplomacy.tensorflow.NameAttrList.AttrEntry\x1aL\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue:\x02\x38\x01\x42o\n\x18org.tensorflow.frameworkB\x0f\x41ttrValueProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + + +_ATTRVALUE_LISTVALUE = _descriptor.Descriptor( + name='ListValue', + full_name='diplomacy.tensorflow.AttrValue.ListValue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='s', full_name='diplomacy.tensorflow.AttrValue.ListValue.s', index=0, + number=2, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='i', full_name='diplomacy.tensorflow.AttrValue.ListValue.i', index=1, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='f', full_name='diplomacy.tensorflow.AttrValue.ListValue.f', index=2, + number=4, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='b', full_name='diplomacy.tensorflow.AttrValue.ListValue.b', index=3, + number=5, type=8, cpp_type=7, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.AttrValue.ListValue.type', index=4, + number=6, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.AttrValue.ListValue.shape', index=5, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor', full_name='diplomacy.tensorflow.AttrValue.ListValue.tensor', index=6, + number=8, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='func', full_name='diplomacy.tensorflow.AttrValue.ListValue.func', index=7, + number=9, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=592, + serialized_end=865, +) + +_ATTRVALUE = _descriptor.Descriptor( + name='AttrValue', + full_name='diplomacy.tensorflow.AttrValue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='s', full_name='diplomacy.tensorflow.AttrValue.s', index=0, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='i', full_name='diplomacy.tensorflow.AttrValue.i', index=1, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='f', full_name='diplomacy.tensorflow.AttrValue.f', index=2, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='b', full_name='diplomacy.tensorflow.AttrValue.b', index=3, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.AttrValue.type', index=4, + number=6, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.AttrValue.shape', index=5, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor', full_name='diplomacy.tensorflow.AttrValue.tensor', index=6, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='list', full_name='diplomacy.tensorflow.AttrValue.list', index=7, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='func', full_name='diplomacy.tensorflow.AttrValue.func', index=8, + number=10, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='placeholder', full_name='diplomacy.tensorflow.AttrValue.placeholder', index=9, + number=9, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_ATTRVALUE_LISTVALUE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='value', full_name='diplomacy.tensorflow.AttrValue.value', + index=0, containing_type=None, fields=[]), + ], + serialized_start=234, + serialized_end=874, +) + + +_NAMEATTRLIST_ATTRENTRY = _descriptor.Descriptor( + name='AttrEntry', + full_name='diplomacy.tensorflow.NameAttrList.AttrEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.NameAttrList.AttrEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.NameAttrList.AttrEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=967, + serialized_end=1043, +) + +_NAMEATTRLIST = _descriptor.Descriptor( + name='NameAttrList', + full_name='diplomacy.tensorflow.NameAttrList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.NameAttrList.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attr', full_name='diplomacy.tensorflow.NameAttrList.attr', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_NAMEATTRLIST_ATTRENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=877, + serialized_end=1043, +) + +_ATTRVALUE_LISTVALUE.fields_by_name['type'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_ATTRVALUE_LISTVALUE.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_ATTRVALUE_LISTVALUE.fields_by_name['tensor'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2._TENSORPROTO +_ATTRVALUE_LISTVALUE.fields_by_name['func'].message_type = _NAMEATTRLIST +_ATTRVALUE_LISTVALUE.containing_type = _ATTRVALUE +_ATTRVALUE.fields_by_name['type'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_ATTRVALUE.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_ATTRVALUE.fields_by_name['tensor'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2._TENSORPROTO +_ATTRVALUE.fields_by_name['list'].message_type = _ATTRVALUE_LISTVALUE +_ATTRVALUE.fields_by_name['func'].message_type = _NAMEATTRLIST +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['s']) +_ATTRVALUE.fields_by_name['s'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['i']) +_ATTRVALUE.fields_by_name['i'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['f']) +_ATTRVALUE.fields_by_name['f'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['b']) +_ATTRVALUE.fields_by_name['b'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['type']) +_ATTRVALUE.fields_by_name['type'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['shape']) +_ATTRVALUE.fields_by_name['shape'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['tensor']) +_ATTRVALUE.fields_by_name['tensor'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['list']) +_ATTRVALUE.fields_by_name['list'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['func']) +_ATTRVALUE.fields_by_name['func'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_ATTRVALUE.oneofs_by_name['value'].fields.append( + _ATTRVALUE.fields_by_name['placeholder']) +_ATTRVALUE.fields_by_name['placeholder'].containing_oneof = _ATTRVALUE.oneofs_by_name['value'] +_NAMEATTRLIST_ATTRENTRY.fields_by_name['value'].message_type = _ATTRVALUE +_NAMEATTRLIST_ATTRENTRY.containing_type = _NAMEATTRLIST +_NAMEATTRLIST.fields_by_name['attr'].message_type = _NAMEATTRLIST_ATTRENTRY +DESCRIPTOR.message_types_by_name['AttrValue'] = _ATTRVALUE +DESCRIPTOR.message_types_by_name['NameAttrList'] = _NAMEATTRLIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +AttrValue = _reflection.GeneratedProtocolMessageType('AttrValue', (_message.Message,), dict( + + ListValue = _reflection.GeneratedProtocolMessageType('ListValue', (_message.Message,), dict( + DESCRIPTOR = _ATTRVALUE_LISTVALUE, + __module__ = 'diplomacy_tensorflow.core.framework.attr_value_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AttrValue.ListValue) + )) + , + DESCRIPTOR = _ATTRVALUE, + __module__ = 'diplomacy_tensorflow.core.framework.attr_value_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AttrValue) + )) +_sym_db.RegisterMessage(AttrValue) +_sym_db.RegisterMessage(AttrValue.ListValue) + +NameAttrList = _reflection.GeneratedProtocolMessageType('NameAttrList', (_message.Message,), dict( + + AttrEntry = _reflection.GeneratedProtocolMessageType('AttrEntry', (_message.Message,), dict( + DESCRIPTOR = _NAMEATTRLIST_ATTRENTRY, + __module__ = 'diplomacy_tensorflow.core.framework.attr_value_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NameAttrList.AttrEntry) + )) + , + DESCRIPTOR = _NAMEATTRLIST, + __module__ = 'diplomacy_tensorflow.core.framework.attr_value_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NameAttrList) + )) +_sym_db.RegisterMessage(NameAttrList) +_sym_db.RegisterMessage(NameAttrList.AttrEntry) + + +DESCRIPTOR._options = None +_ATTRVALUE_LISTVALUE.fields_by_name['i']._options = None +_ATTRVALUE_LISTVALUE.fields_by_name['f']._options = None +_ATTRVALUE_LISTVALUE.fields_by_name['b']._options = None +_ATTRVALUE_LISTVALUE.fields_by_name['type']._options = None +_NAMEATTRLIST_ATTRENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.pb.cc new file mode 100644 index 0000000..728e9f6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.pb.cc @@ -0,0 +1,2119 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/cost_graph.proto + +#include "diplomacy_tensorflow/core/framework/cost_graph.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_CostGraphDef_Node_InputInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_CostGraphDef_Node_OutputInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_CostGraphDef_Node; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class CostGraphDef_Node_InputInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CostGraphDef_Node_InputInfo_default_instance_; +class CostGraphDef_Node_OutputInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CostGraphDef_Node_OutputInfo_default_instance_; +class CostGraphDef_NodeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CostGraphDef_Node_default_instance_; +class CostGraphDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CostGraphDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto { +static void InitDefaultsCostGraphDef_Node_InputInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_CostGraphDef_Node_InputInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CostGraphDef_Node_InputInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCostGraphDef_Node_InputInfo}, {}}; + +static void InitDefaultsCostGraphDef_Node_OutputInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_CostGraphDef_Node_OutputInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_CostGraphDef_Node_OutputInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsCostGraphDef_Node_OutputInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base,}}; + +static void InitDefaultsCostGraphDef_Node() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_CostGraphDef_Node_default_instance_; + new (ptr) ::diplomacy::tensorflow::CostGraphDef_Node(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::CostGraphDef_Node::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_CostGraphDef_Node = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsCostGraphDef_Node}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_InputInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_OutputInfo.base,}}; + +static void InitDefaultsCostGraphDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_CostGraphDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::CostGraphDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::CostGraphDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_CostGraphDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsCostGraphDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_CostGraphDef_Node_InputInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_CostGraphDef_Node_OutputInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_CostGraphDef_Node.base); + ::google::protobuf::internal::InitSCC(&scc_info_CostGraphDef.base); +} + +::google::protobuf::Metadata file_level_metadata[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_InputInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_InputInfo, preceding_node_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_InputInfo, preceding_port_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo, alias_input_port_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo, dtype_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, device_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, input_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, output_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, temporary_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, persistent_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, host_temp_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, device_temp_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, device_persistent_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, compute_cost_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, compute_time_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, memory_time_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, is_final_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, control_input_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef_Node, inaccurate_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::CostGraphDef, node_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::CostGraphDef_Node_InputInfo)}, + { 7, -1, sizeof(::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo)}, + { 16, -1, sizeof(::diplomacy::tensorflow::CostGraphDef_Node)}, + { 37, -1, sizeof(::diplomacy::tensorflow::CostGraphDef)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_CostGraphDef_Node_InputInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_CostGraphDef_Node_OutputInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_CostGraphDef_Node_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_CostGraphDef_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/cost_graph.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n4diplomacy_tensorflow/core/framework/co" + "st_graph.proto\022\024diplomacy.tensorflow\0326di" + "plomacy_tensorflow/core/framework/tensor" + "_shape.proto\032/diplomacy_tensorflow/core/" + "framework/types.proto\"\222\006\n\014CostGraphDef\0225" + "\n\004node\030\001 \003(\0132\'.diplomacy.tensorflow.Cost" + "GraphDef.Node\032\312\005\n\004Node\022\014\n\004name\030\001 \001(\t\022\016\n\006" + "device\030\002 \001(\t\022\n\n\002id\030\003 \001(\005\022E\n\ninput_info\030\004" + " \003(\01321.diplomacy.tensorflow.CostGraphDef" + ".Node.InputInfo\022G\n\013output_info\030\005 \003(\01322.d" + "iplomacy.tensorflow.CostGraphDef.Node.Ou" + "tputInfo\022\035\n\025temporary_memory_size\030\006 \001(\003\022" + "\036\n\026persistent_memory_size\030\014 \001(\003\022!\n\025host_" + "temp_memory_size\030\n \001(\003B\002\030\001\022#\n\027device_tem" + "p_memory_size\030\013 \001(\003B\002\030\001\022)\n\035device_persis" + "tent_memory_size\030\020 \001(\003B\002\030\001\022\024\n\014compute_co" + "st\030\t \001(\003\022\024\n\014compute_time\030\016 \001(\003\022\023\n\013memory" + "_time\030\017 \001(\003\022\020\n\010is_final\030\007 \001(\010\022\025\n\rcontrol" + "_input\030\010 \003(\005\022\022\n\ninaccurate\030\021 \001(\010\032;\n\tInpu" + "tInfo\022\026\n\016preceding_node\030\001 \001(\005\022\026\n\016precedi" + "ng_port\030\002 \001(\005\032\232\001\n\nOutputInfo\022\014\n\004size\030\001 \001" + "(\003\022\030\n\020alias_input_port\030\002 \001(\003\0225\n\005shape\030\003 " + "\001(\0132&.diplomacy.tensorflow.TensorShapePr" + "oto\022-\n\005dtype\030\004 \001(\0162\036.diplomacy.tensorflo" + "w.DataTypeBo\n\030org.tensorflow.frameworkB\017" + "CostGraphProtosP\001Z=github.com/tensorflow" + "/tensorflow/tensorflow/go/core/framework" + "\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1091); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/cost_graph.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void CostGraphDef_Node_InputInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CostGraphDef_Node_InputInfo::kPrecedingNodeFieldNumber; +const int CostGraphDef_Node_InputInfo::kPrecedingPortFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CostGraphDef_Node_InputInfo::CostGraphDef_Node_InputInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_InputInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) +} +CostGraphDef_Node_InputInfo::CostGraphDef_Node_InputInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_InputInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) +} +CostGraphDef_Node_InputInfo::CostGraphDef_Node_InputInfo(const CostGraphDef_Node_InputInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&preceding_node_, &from.preceding_node_, + static_cast(reinterpret_cast(&preceding_port_) - + reinterpret_cast(&preceding_node_)) + sizeof(preceding_port_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) +} + +void CostGraphDef_Node_InputInfo::SharedCtor() { + ::memset(&preceding_node_, 0, static_cast( + reinterpret_cast(&preceding_port_) - + reinterpret_cast(&preceding_node_)) + sizeof(preceding_port_)); +} + +CostGraphDef_Node_InputInfo::~CostGraphDef_Node_InputInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + SharedDtor(); +} + +void CostGraphDef_Node_InputInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void CostGraphDef_Node_InputInfo::ArenaDtor(void* object) { + CostGraphDef_Node_InputInfo* _this = reinterpret_cast< CostGraphDef_Node_InputInfo* >(object); + (void)_this; +} +void CostGraphDef_Node_InputInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CostGraphDef_Node_InputInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CostGraphDef_Node_InputInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CostGraphDef_Node_InputInfo& CostGraphDef_Node_InputInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_InputInfo.base); + return *internal_default_instance(); +} + + +void CostGraphDef_Node_InputInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&preceding_node_, 0, static_cast( + reinterpret_cast(&preceding_port_) - + reinterpret_cast(&preceding_node_)) + sizeof(preceding_port_)); + _internal_metadata_.Clear(); +} + +bool CostGraphDef_Node_InputInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 preceding_node = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &preceding_node_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 preceding_port = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &preceding_port_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + return false; +#undef DO_ +} + +void CostGraphDef_Node_InputInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 preceding_node = 1; + if (this->preceding_node() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->preceding_node(), output); + } + + // int32 preceding_port = 2; + if (this->preceding_port() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->preceding_port(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) +} + +::google::protobuf::uint8* CostGraphDef_Node_InputInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 preceding_node = 1; + if (this->preceding_node() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->preceding_node(), target); + } + + // int32 preceding_port = 2; + if (this->preceding_port() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->preceding_port(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + return target; +} + +size_t CostGraphDef_Node_InputInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 preceding_node = 1; + if (this->preceding_node() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->preceding_node()); + } + + // int32 preceding_port = 2; + if (this->preceding_port() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->preceding_port()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CostGraphDef_Node_InputInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + GOOGLE_DCHECK_NE(&from, this); + const CostGraphDef_Node_InputInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + MergeFrom(*source); + } +} + +void CostGraphDef_Node_InputInfo::MergeFrom(const CostGraphDef_Node_InputInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.preceding_node() != 0) { + set_preceding_node(from.preceding_node()); + } + if (from.preceding_port() != 0) { + set_preceding_port(from.preceding_port()); + } +} + +void CostGraphDef_Node_InputInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CostGraphDef_Node_InputInfo::CopyFrom(const CostGraphDef_Node_InputInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CostGraphDef_Node_InputInfo::IsInitialized() const { + return true; +} + +void CostGraphDef_Node_InputInfo::Swap(CostGraphDef_Node_InputInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CostGraphDef_Node_InputInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CostGraphDef_Node_InputInfo::UnsafeArenaSwap(CostGraphDef_Node_InputInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CostGraphDef_Node_InputInfo::InternalSwap(CostGraphDef_Node_InputInfo* other) { + using std::swap; + swap(preceding_node_, other->preceding_node_); + swap(preceding_port_, other->preceding_port_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CostGraphDef_Node_InputInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CostGraphDef_Node_OutputInfo::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_CostGraphDef_Node_OutputInfo_default_instance_._instance.get_mutable()->shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); +} +void CostGraphDef_Node_OutputInfo::unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.shape) +} +void CostGraphDef_Node_OutputInfo::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CostGraphDef_Node_OutputInfo::kSizeFieldNumber; +const int CostGraphDef_Node_OutputInfo::kAliasInputPortFieldNumber; +const int CostGraphDef_Node_OutputInfo::kShapeFieldNumber; +const int CostGraphDef_Node_OutputInfo::kDtypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CostGraphDef_Node_OutputInfo::CostGraphDef_Node_OutputInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_OutputInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) +} +CostGraphDef_Node_OutputInfo::CostGraphDef_Node_OutputInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_OutputInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) +} +CostGraphDef_Node_OutputInfo::CostGraphDef_Node_OutputInfo(const CostGraphDef_Node_OutputInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape()) { + shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + ::memcpy(&size_, &from.size_, + static_cast(reinterpret_cast(&dtype_) - + reinterpret_cast(&size_)) + sizeof(dtype_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) +} + +void CostGraphDef_Node_OutputInfo::SharedCtor() { + ::memset(&shape_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&shape_)) + sizeof(dtype_)); +} + +CostGraphDef_Node_OutputInfo::~CostGraphDef_Node_OutputInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + SharedDtor(); +} + +void CostGraphDef_Node_OutputInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete shape_; +} + +void CostGraphDef_Node_OutputInfo::ArenaDtor(void* object) { + CostGraphDef_Node_OutputInfo* _this = reinterpret_cast< CostGraphDef_Node_OutputInfo* >(object); + (void)_this; +} +void CostGraphDef_Node_OutputInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CostGraphDef_Node_OutputInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CostGraphDef_Node_OutputInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CostGraphDef_Node_OutputInfo& CostGraphDef_Node_OutputInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node_OutputInfo.base); + return *internal_default_instance(); +} + + +void CostGraphDef_Node_OutputInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + ::memset(&size_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&size_)) + sizeof(dtype_)); + _internal_metadata_.Clear(); +} + +bool CostGraphDef_Node_OutputInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 size = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 alias_input_port = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &alias_input_port_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType dtype = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + return false; +#undef DO_ +} + +void CostGraphDef_Node_OutputInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 size = 1; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->size(), output); + } + + // int64 alias_input_port = 2; + if (this->alias_input_port() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->alias_input_port(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 3; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_shape(), output); + } + + // .diplomacy.tensorflow.DataType dtype = 4; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->dtype(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) +} + +::google::protobuf::uint8* CostGraphDef_Node_OutputInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 size = 1; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->size(), target); + } + + // int64 alias_input_port = 2; + if (this->alias_input_port() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->alias_input_port(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 3; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_shape(), deterministic, target); + } + + // .diplomacy.tensorflow.DataType dtype = 4; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->dtype(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + return target; +} + +size_t CostGraphDef_Node_OutputInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.TensorShapeProto shape = 3; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // int64 size = 1; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->size()); + } + + // int64 alias_input_port = 2; + if (this->alias_input_port() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->alias_input_port()); + } + + // .diplomacy.tensorflow.DataType dtype = 4; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CostGraphDef_Node_OutputInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + GOOGLE_DCHECK_NE(&from, this); + const CostGraphDef_Node_OutputInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + MergeFrom(*source); + } +} + +void CostGraphDef_Node_OutputInfo::MergeFrom(const CostGraphDef_Node_OutputInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_shape()) { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + } + if (from.size() != 0) { + set_size(from.size()); + } + if (from.alias_input_port() != 0) { + set_alias_input_port(from.alias_input_port()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void CostGraphDef_Node_OutputInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CostGraphDef_Node_OutputInfo::CopyFrom(const CostGraphDef_Node_OutputInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CostGraphDef_Node_OutputInfo::IsInitialized() const { + return true; +} + +void CostGraphDef_Node_OutputInfo::Swap(CostGraphDef_Node_OutputInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CostGraphDef_Node_OutputInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CostGraphDef_Node_OutputInfo::UnsafeArenaSwap(CostGraphDef_Node_OutputInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CostGraphDef_Node_OutputInfo::InternalSwap(CostGraphDef_Node_OutputInfo* other) { + using std::swap; + swap(shape_, other->shape_); + swap(size_, other->size_); + swap(alias_input_port_, other->alias_input_port_); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CostGraphDef_Node_OutputInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CostGraphDef_Node::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CostGraphDef_Node::kNameFieldNumber; +const int CostGraphDef_Node::kDeviceFieldNumber; +const int CostGraphDef_Node::kIdFieldNumber; +const int CostGraphDef_Node::kInputInfoFieldNumber; +const int CostGraphDef_Node::kOutputInfoFieldNumber; +const int CostGraphDef_Node::kTemporaryMemorySizeFieldNumber; +const int CostGraphDef_Node::kPersistentMemorySizeFieldNumber; +const int CostGraphDef_Node::kHostTempMemorySizeFieldNumber; +const int CostGraphDef_Node::kDeviceTempMemorySizeFieldNumber; +const int CostGraphDef_Node::kDevicePersistentMemorySizeFieldNumber; +const int CostGraphDef_Node::kComputeCostFieldNumber; +const int CostGraphDef_Node::kComputeTimeFieldNumber; +const int CostGraphDef_Node::kMemoryTimeFieldNumber; +const int CostGraphDef_Node::kIsFinalFieldNumber; +const int CostGraphDef_Node::kControlInputFieldNumber; +const int CostGraphDef_Node::kInaccurateFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CostGraphDef_Node::CostGraphDef_Node() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.CostGraphDef.Node) +} +CostGraphDef_Node::CostGraphDef_Node(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + input_info_(arena), + output_info_(arena), + control_input_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.CostGraphDef.Node) +} +CostGraphDef_Node::CostGraphDef_Node(const CostGraphDef_Node& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + input_info_(from.input_info_), + output_info_(from.output_info_), + control_input_(from.control_input_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.device().size() > 0) { + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device(), + GetArenaNoVirtual()); + } + ::memcpy(&temporary_memory_size_, &from.temporary_memory_size_, + static_cast(reinterpret_cast(&device_persistent_memory_size_) - + reinterpret_cast(&temporary_memory_size_)) + sizeof(device_persistent_memory_size_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.CostGraphDef.Node) +} + +void CostGraphDef_Node::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&temporary_memory_size_, 0, static_cast( + reinterpret_cast(&device_persistent_memory_size_) - + reinterpret_cast(&temporary_memory_size_)) + sizeof(device_persistent_memory_size_)); +} + +CostGraphDef_Node::~CostGraphDef_Node() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.CostGraphDef.Node) + SharedDtor(); +} + +void CostGraphDef_Node::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void CostGraphDef_Node::ArenaDtor(void* object) { + CostGraphDef_Node* _this = reinterpret_cast< CostGraphDef_Node* >(object); + (void)_this; +} +void CostGraphDef_Node::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CostGraphDef_Node::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CostGraphDef_Node::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CostGraphDef_Node& CostGraphDef_Node::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef_Node.base); + return *internal_default_instance(); +} + + +void CostGraphDef_Node::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.CostGraphDef.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + input_info_.Clear(); + output_info_.Clear(); + control_input_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&temporary_memory_size_, 0, static_cast( + reinterpret_cast(&device_persistent_memory_size_) - + reinterpret_cast(&temporary_memory_size_)) + sizeof(device_persistent_memory_size_)); + _internal_metadata_.Clear(); +} + +bool CostGraphDef_Node::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.CostGraphDef.Node) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.CostGraphDef.Node.name")); + } else { + goto handle_unusual; + } + break; + } + + // string device = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.CostGraphDef.Node.device")); + } else { + goto handle_unusual; + } + break; + } + + // int32 id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &id_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_input_info())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_output_info())); + } else { + goto handle_unusual; + } + break; + } + + // int64 temporary_memory_size = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &temporary_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_final = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_final_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 control_input = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_control_input()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 66u, input, this->mutable_control_input()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compute_cost = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compute_cost_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 host_temp_memory_size = 10 [deprecated = true]; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &host_temp_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 device_temp_memory_size = 11 [deprecated = true]; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_temp_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 persistent_memory_size = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &persistent_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compute_time = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compute_time_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 memory_time = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &memory_time_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 device_persistent_memory_size = 16 [deprecated = true]; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_persistent_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // bool inaccurate = 17; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &inaccurate_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.CostGraphDef.Node) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.CostGraphDef.Node) + return false; +#undef DO_ +} + +void CostGraphDef_Node::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.CostGraphDef.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CostGraphDef.Node.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string device = 2; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CostGraphDef.Node.device"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->device(), output); + } + + // int32 id = 3; + if (this->id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->id(), output); + } + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + for (unsigned int i = 0, + n = static_cast(this->input_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->input_info(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + for (unsigned int i = 0, + n = static_cast(this->output_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, + this->output_info(static_cast(i)), + output); + } + + // int64 temporary_memory_size = 6; + if (this->temporary_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->temporary_memory_size(), output); + } + + // bool is_final = 7; + if (this->is_final() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->is_final(), output); + } + + // repeated int32 control_input = 8; + if (this->control_input_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _control_input_cached_byte_size_)); + } + for (int i = 0, n = this->control_input_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->control_input(i), output); + } + + // int64 compute_cost = 9; + if (this->compute_cost() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(9, this->compute_cost(), output); + } + + // int64 host_temp_memory_size = 10 [deprecated = true]; + if (this->host_temp_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(10, this->host_temp_memory_size(), output); + } + + // int64 device_temp_memory_size = 11 [deprecated = true]; + if (this->device_temp_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(11, this->device_temp_memory_size(), output); + } + + // int64 persistent_memory_size = 12; + if (this->persistent_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(12, this->persistent_memory_size(), output); + } + + // int64 compute_time = 14; + if (this->compute_time() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(14, this->compute_time(), output); + } + + // int64 memory_time = 15; + if (this->memory_time() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(15, this->memory_time(), output); + } + + // int64 device_persistent_memory_size = 16 [deprecated = true]; + if (this->device_persistent_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(16, this->device_persistent_memory_size(), output); + } + + // bool inaccurate = 17; + if (this->inaccurate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->inaccurate(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.CostGraphDef.Node) +} + +::google::protobuf::uint8* CostGraphDef_Node::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.CostGraphDef.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CostGraphDef.Node.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string device = 2; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.CostGraphDef.Node.device"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->device(), target); + } + + // int32 id = 3; + if (this->id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->id(), target); + } + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + for (unsigned int i = 0, + n = static_cast(this->input_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->input_info(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + for (unsigned int i = 0, + n = static_cast(this->output_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->output_info(static_cast(i)), deterministic, target); + } + + // int64 temporary_memory_size = 6; + if (this->temporary_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->temporary_memory_size(), target); + } + + // bool is_final = 7; + if (this->is_final() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->is_final(), target); + } + + // repeated int32 control_input = 8; + if (this->control_input_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 8, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _control_input_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->control_input_, target); + } + + // int64 compute_cost = 9; + if (this->compute_cost() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(9, this->compute_cost(), target); + } + + // int64 host_temp_memory_size = 10 [deprecated = true]; + if (this->host_temp_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(10, this->host_temp_memory_size(), target); + } + + // int64 device_temp_memory_size = 11 [deprecated = true]; + if (this->device_temp_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(11, this->device_temp_memory_size(), target); + } + + // int64 persistent_memory_size = 12; + if (this->persistent_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(12, this->persistent_memory_size(), target); + } + + // int64 compute_time = 14; + if (this->compute_time() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(14, this->compute_time(), target); + } + + // int64 memory_time = 15; + if (this->memory_time() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(15, this->memory_time(), target); + } + + // int64 device_persistent_memory_size = 16 [deprecated = true]; + if (this->device_persistent_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(16, this->device_persistent_memory_size(), target); + } + + // bool inaccurate = 17; + if (this->inaccurate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->inaccurate(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.CostGraphDef.Node) + return target; +} + +size_t CostGraphDef_Node::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.CostGraphDef.Node) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + { + unsigned int count = static_cast(this->input_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->input_info(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + { + unsigned int count = static_cast(this->output_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->output_info(static_cast(i))); + } + } + + // repeated int32 control_input = 8; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->control_input_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _control_input_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string device = 2; + if (this->device().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device()); + } + + // int64 temporary_memory_size = 6; + if (this->temporary_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->temporary_memory_size()); + } + + // int64 compute_cost = 9; + if (this->compute_cost() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compute_cost()); + } + + // int32 id = 3; + if (this->id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->id()); + } + + // bool is_final = 7; + if (this->is_final() != 0) { + total_size += 1 + 1; + } + + // bool inaccurate = 17; + if (this->inaccurate() != 0) { + total_size += 2 + 1; + } + + // int64 host_temp_memory_size = 10 [deprecated = true]; + if (this->host_temp_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->host_temp_memory_size()); + } + + // int64 device_temp_memory_size = 11 [deprecated = true]; + if (this->device_temp_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_temp_memory_size()); + } + + // int64 persistent_memory_size = 12; + if (this->persistent_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->persistent_memory_size()); + } + + // int64 compute_time = 14; + if (this->compute_time() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compute_time()); + } + + // int64 memory_time = 15; + if (this->memory_time() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->memory_time()); + } + + // int64 device_persistent_memory_size = 16 [deprecated = true]; + if (this->device_persistent_memory_size() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_persistent_memory_size()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CostGraphDef_Node::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.CostGraphDef.Node) + GOOGLE_DCHECK_NE(&from, this); + const CostGraphDef_Node* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.CostGraphDef.Node) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.CostGraphDef.Node) + MergeFrom(*source); + } +} + +void CostGraphDef_Node::MergeFrom(const CostGraphDef_Node& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.CostGraphDef.Node) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + input_info_.MergeFrom(from.input_info_); + output_info_.MergeFrom(from.output_info_); + control_input_.MergeFrom(from.control_input_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.device().size() > 0) { + set_device(from.device()); + } + if (from.temporary_memory_size() != 0) { + set_temporary_memory_size(from.temporary_memory_size()); + } + if (from.compute_cost() != 0) { + set_compute_cost(from.compute_cost()); + } + if (from.id() != 0) { + set_id(from.id()); + } + if (from.is_final() != 0) { + set_is_final(from.is_final()); + } + if (from.inaccurate() != 0) { + set_inaccurate(from.inaccurate()); + } + if (from.host_temp_memory_size() != 0) { + set_host_temp_memory_size(from.host_temp_memory_size()); + } + if (from.device_temp_memory_size() != 0) { + set_device_temp_memory_size(from.device_temp_memory_size()); + } + if (from.persistent_memory_size() != 0) { + set_persistent_memory_size(from.persistent_memory_size()); + } + if (from.compute_time() != 0) { + set_compute_time(from.compute_time()); + } + if (from.memory_time() != 0) { + set_memory_time(from.memory_time()); + } + if (from.device_persistent_memory_size() != 0) { + set_device_persistent_memory_size(from.device_persistent_memory_size()); + } +} + +void CostGraphDef_Node::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.CostGraphDef.Node) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CostGraphDef_Node::CopyFrom(const CostGraphDef_Node& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.CostGraphDef.Node) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CostGraphDef_Node::IsInitialized() const { + return true; +} + +void CostGraphDef_Node::Swap(CostGraphDef_Node* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CostGraphDef_Node* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CostGraphDef_Node::UnsafeArenaSwap(CostGraphDef_Node* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CostGraphDef_Node::InternalSwap(CostGraphDef_Node* other) { + using std::swap; + CastToBase(&input_info_)->InternalSwap(CastToBase(&other->input_info_)); + CastToBase(&output_info_)->InternalSwap(CastToBase(&other->output_info_)); + control_input_.InternalSwap(&other->control_input_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + device_.Swap(&other->device_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(temporary_memory_size_, other->temporary_memory_size_); + swap(compute_cost_, other->compute_cost_); + swap(id_, other->id_); + swap(is_final_, other->is_final_); + swap(inaccurate_, other->inaccurate_); + swap(host_temp_memory_size_, other->host_temp_memory_size_); + swap(device_temp_memory_size_, other->device_temp_memory_size_); + swap(persistent_memory_size_, other->persistent_memory_size_); + swap(compute_time_, other->compute_time_); + swap(memory_time_, other->memory_time_); + swap(device_persistent_memory_size_, other->device_persistent_memory_size_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CostGraphDef_Node::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CostGraphDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CostGraphDef::kNodeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CostGraphDef::CostGraphDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.CostGraphDef) +} +CostGraphDef::CostGraphDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.CostGraphDef) +} +CostGraphDef::CostGraphDef(const CostGraphDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + node_(from.node_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.CostGraphDef) +} + +void CostGraphDef::SharedCtor() { +} + +CostGraphDef::~CostGraphDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.CostGraphDef) + SharedDtor(); +} + +void CostGraphDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void CostGraphDef::ArenaDtor(void* object) { + CostGraphDef* _this = reinterpret_cast< CostGraphDef* >(object); + (void)_this; +} +void CostGraphDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CostGraphDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CostGraphDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CostGraphDef& CostGraphDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::scc_info_CostGraphDef.base); + return *internal_default_instance(); +} + + +void CostGraphDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.CostGraphDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_.Clear(); + _internal_metadata_.Clear(); +} + +bool CostGraphDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.CostGraphDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.CostGraphDef.Node node = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.CostGraphDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.CostGraphDef) + return false; +#undef DO_ +} + +void CostGraphDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.CostGraphDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.CostGraphDef.Node node = 1; + for (unsigned int i = 0, + n = static_cast(this->node_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->node(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.CostGraphDef) +} + +::google::protobuf::uint8* CostGraphDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.CostGraphDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.CostGraphDef.Node node = 1; + for (unsigned int i = 0, + n = static_cast(this->node_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->node(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.CostGraphDef) + return target; +} + +size_t CostGraphDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.CostGraphDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.CostGraphDef.Node node = 1; + { + unsigned int count = static_cast(this->node_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CostGraphDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.CostGraphDef) + GOOGLE_DCHECK_NE(&from, this); + const CostGraphDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.CostGraphDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.CostGraphDef) + MergeFrom(*source); + } +} + +void CostGraphDef::MergeFrom(const CostGraphDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.CostGraphDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + node_.MergeFrom(from.node_); +} + +void CostGraphDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.CostGraphDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CostGraphDef::CopyFrom(const CostGraphDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.CostGraphDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CostGraphDef::IsInitialized() const { + return true; +} + +void CostGraphDef::Swap(CostGraphDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CostGraphDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CostGraphDef::UnsafeArenaSwap(CostGraphDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CostGraphDef::InternalSwap(CostGraphDef* other) { + using std::swap; + CastToBase(&node_)->InternalSwap(CastToBase(&other->node_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CostGraphDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::CostGraphDef_Node* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::CostGraphDef_Node >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::CostGraphDef_Node >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::CostGraphDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::CostGraphDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::CostGraphDef >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.pb.h new file mode 100644 index 0000000..fc69e98 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.pb.h @@ -0,0 +1,1348 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/cost_graph.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto +namespace diplomacy { +namespace tensorflow { +class CostGraphDef; +class CostGraphDefDefaultTypeInternal; +extern CostGraphDefDefaultTypeInternal _CostGraphDef_default_instance_; +class CostGraphDef_Node; +class CostGraphDef_NodeDefaultTypeInternal; +extern CostGraphDef_NodeDefaultTypeInternal _CostGraphDef_Node_default_instance_; +class CostGraphDef_Node_InputInfo; +class CostGraphDef_Node_InputInfoDefaultTypeInternal; +extern CostGraphDef_Node_InputInfoDefaultTypeInternal _CostGraphDef_Node_InputInfo_default_instance_; +class CostGraphDef_Node_OutputInfo; +class CostGraphDef_Node_OutputInfoDefaultTypeInternal; +extern CostGraphDef_Node_OutputInfoDefaultTypeInternal _CostGraphDef_Node_OutputInfo_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::CostGraphDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::CostGraphDef>(Arena*); +template<> ::diplomacy::tensorflow::CostGraphDef_Node* Arena::CreateMaybeMessage<::diplomacy::tensorflow::CostGraphDef_Node>(Arena*); +template<> ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::CostGraphDef_Node_InputInfo>(Arena*); +template<> ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class CostGraphDef_Node_InputInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) */ { + public: + CostGraphDef_Node_InputInfo(); + virtual ~CostGraphDef_Node_InputInfo(); + + CostGraphDef_Node_InputInfo(const CostGraphDef_Node_InputInfo& from); + + inline CostGraphDef_Node_InputInfo& operator=(const CostGraphDef_Node_InputInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CostGraphDef_Node_InputInfo(CostGraphDef_Node_InputInfo&& from) noexcept + : CostGraphDef_Node_InputInfo() { + *this = ::std::move(from); + } + + inline CostGraphDef_Node_InputInfo& operator=(CostGraphDef_Node_InputInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CostGraphDef_Node_InputInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CostGraphDef_Node_InputInfo* internal_default_instance() { + return reinterpret_cast( + &_CostGraphDef_Node_InputInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(CostGraphDef_Node_InputInfo* other); + void Swap(CostGraphDef_Node_InputInfo* other); + friend void swap(CostGraphDef_Node_InputInfo& a, CostGraphDef_Node_InputInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CostGraphDef_Node_InputInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + CostGraphDef_Node_InputInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CostGraphDef_Node_InputInfo& from); + void MergeFrom(const CostGraphDef_Node_InputInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CostGraphDef_Node_InputInfo* other); + protected: + explicit CostGraphDef_Node_InputInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 preceding_node = 1; + void clear_preceding_node(); + static const int kPrecedingNodeFieldNumber = 1; + ::google::protobuf::int32 preceding_node() const; + void set_preceding_node(::google::protobuf::int32 value); + + // int32 preceding_port = 2; + void clear_preceding_port(); + static const int kPrecedingPortFieldNumber = 2; + ::google::protobuf::int32 preceding_port() const; + void set_preceding_port(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 preceding_node_; + ::google::protobuf::int32 preceding_port_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CostGraphDef_Node_OutputInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) */ { + public: + CostGraphDef_Node_OutputInfo(); + virtual ~CostGraphDef_Node_OutputInfo(); + + CostGraphDef_Node_OutputInfo(const CostGraphDef_Node_OutputInfo& from); + + inline CostGraphDef_Node_OutputInfo& operator=(const CostGraphDef_Node_OutputInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CostGraphDef_Node_OutputInfo(CostGraphDef_Node_OutputInfo&& from) noexcept + : CostGraphDef_Node_OutputInfo() { + *this = ::std::move(from); + } + + inline CostGraphDef_Node_OutputInfo& operator=(CostGraphDef_Node_OutputInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CostGraphDef_Node_OutputInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CostGraphDef_Node_OutputInfo* internal_default_instance() { + return reinterpret_cast( + &_CostGraphDef_Node_OutputInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(CostGraphDef_Node_OutputInfo* other); + void Swap(CostGraphDef_Node_OutputInfo* other); + friend void swap(CostGraphDef_Node_OutputInfo& a, CostGraphDef_Node_OutputInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CostGraphDef_Node_OutputInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + CostGraphDef_Node_OutputInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CostGraphDef_Node_OutputInfo& from); + void MergeFrom(const CostGraphDef_Node_OutputInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CostGraphDef_Node_OutputInfo* other); + protected: + explicit CostGraphDef_Node_OutputInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.TensorShapeProto shape = 3; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 3; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // int64 size = 1; + void clear_size(); + static const int kSizeFieldNumber = 1; + ::google::protobuf::int64 size() const; + void set_size(::google::protobuf::int64 value); + + // int64 alias_input_port = 2; + void clear_alias_input_port(); + static const int kAliasInputPortFieldNumber = 2; + ::google::protobuf::int64 alias_input_port() const; + void set_alias_input_port(::google::protobuf::int64 value); + + // .diplomacy.tensorflow.DataType dtype = 4; + void clear_dtype(); + static const int kDtypeFieldNumber = 4; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + ::google::protobuf::int64 size_; + ::google::protobuf::int64 alias_input_port_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CostGraphDef_Node : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.CostGraphDef.Node) */ { + public: + CostGraphDef_Node(); + virtual ~CostGraphDef_Node(); + + CostGraphDef_Node(const CostGraphDef_Node& from); + + inline CostGraphDef_Node& operator=(const CostGraphDef_Node& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CostGraphDef_Node(CostGraphDef_Node&& from) noexcept + : CostGraphDef_Node() { + *this = ::std::move(from); + } + + inline CostGraphDef_Node& operator=(CostGraphDef_Node&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CostGraphDef_Node& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CostGraphDef_Node* internal_default_instance() { + return reinterpret_cast( + &_CostGraphDef_Node_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(CostGraphDef_Node* other); + void Swap(CostGraphDef_Node* other); + friend void swap(CostGraphDef_Node& a, CostGraphDef_Node& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CostGraphDef_Node* New() const final { + return CreateMaybeMessage(NULL); + } + + CostGraphDef_Node* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CostGraphDef_Node& from); + void MergeFrom(const CostGraphDef_Node& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CostGraphDef_Node* other); + protected: + explicit CostGraphDef_Node(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef CostGraphDef_Node_InputInfo InputInfo; + typedef CostGraphDef_Node_OutputInfo OutputInfo; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + int input_info_size() const; + void clear_input_info(); + static const int kInputInfoFieldNumber = 4; + ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo* mutable_input_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo >* + mutable_input_info(); + const ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo& input_info(int index) const; + ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo* add_input_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo >& + input_info() const; + + // repeated .diplomacy.tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + int output_info_size() const; + void clear_output_info(); + static const int kOutputInfoFieldNumber = 5; + ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo* mutable_output_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo >* + mutable_output_info(); + const ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo& output_info(int index) const; + ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo* add_output_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo >& + output_info() const; + + // repeated int32 control_input = 8; + int control_input_size() const; + void clear_control_input(); + static const int kControlInputFieldNumber = 8; + ::google::protobuf::int32 control_input(int index) const; + void set_control_input(int index, ::google::protobuf::int32 value); + void add_control_input(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + control_input() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_control_input(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string device = 2; + void clear_device(); + static const int kDeviceFieldNumber = 2; + const ::std::string& device() const; + void set_device(const ::std::string& value); + #if LANG_CXX11 + void set_device(::std::string&& value); + #endif + void set_device(const char* value); + void set_device(const char* value, size_t size); + ::std::string* mutable_device(); + ::std::string* release_device(); + void set_allocated_device(::std::string* device); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_device(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_device( + ::std::string* device); + + // int64 temporary_memory_size = 6; + void clear_temporary_memory_size(); + static const int kTemporaryMemorySizeFieldNumber = 6; + ::google::protobuf::int64 temporary_memory_size() const; + void set_temporary_memory_size(::google::protobuf::int64 value); + + // int64 compute_cost = 9; + void clear_compute_cost(); + static const int kComputeCostFieldNumber = 9; + ::google::protobuf::int64 compute_cost() const; + void set_compute_cost(::google::protobuf::int64 value); + + // int32 id = 3; + void clear_id(); + static const int kIdFieldNumber = 3; + ::google::protobuf::int32 id() const; + void set_id(::google::protobuf::int32 value); + + // bool is_final = 7; + void clear_is_final(); + static const int kIsFinalFieldNumber = 7; + bool is_final() const; + void set_is_final(bool value); + + // bool inaccurate = 17; + void clear_inaccurate(); + static const int kInaccurateFieldNumber = 17; + bool inaccurate() const; + void set_inaccurate(bool value); + + // int64 host_temp_memory_size = 10 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_host_temp_memory_size(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kHostTempMemorySizeFieldNumber = 10; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 host_temp_memory_size() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_host_temp_memory_size(::google::protobuf::int64 value); + + // int64 device_temp_memory_size = 11 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_device_temp_memory_size(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kDeviceTempMemorySizeFieldNumber = 11; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 device_temp_memory_size() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_device_temp_memory_size(::google::protobuf::int64 value); + + // int64 persistent_memory_size = 12; + void clear_persistent_memory_size(); + static const int kPersistentMemorySizeFieldNumber = 12; + ::google::protobuf::int64 persistent_memory_size() const; + void set_persistent_memory_size(::google::protobuf::int64 value); + + // int64 compute_time = 14; + void clear_compute_time(); + static const int kComputeTimeFieldNumber = 14; + ::google::protobuf::int64 compute_time() const; + void set_compute_time(::google::protobuf::int64 value); + + // int64 memory_time = 15; + void clear_memory_time(); + static const int kMemoryTimeFieldNumber = 15; + ::google::protobuf::int64 memory_time() const; + void set_memory_time(::google::protobuf::int64 value); + + // int64 device_persistent_memory_size = 16 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_device_persistent_memory_size(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kDevicePersistentMemorySizeFieldNumber = 16; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 device_persistent_memory_size() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_device_persistent_memory_size(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef.Node) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo > input_info_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo > output_info_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > control_input_; + mutable int _control_input_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr device_; + ::google::protobuf::int64 temporary_memory_size_; + ::google::protobuf::int64 compute_cost_; + ::google::protobuf::int32 id_; + bool is_final_; + bool inaccurate_; + ::google::protobuf::int64 host_temp_memory_size_; + ::google::protobuf::int64 device_temp_memory_size_; + ::google::protobuf::int64 persistent_memory_size_; + ::google::protobuf::int64 compute_time_; + ::google::protobuf::int64 memory_time_; + ::google::protobuf::int64 device_persistent_memory_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CostGraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.CostGraphDef) */ { + public: + CostGraphDef(); + virtual ~CostGraphDef(); + + CostGraphDef(const CostGraphDef& from); + + inline CostGraphDef& operator=(const CostGraphDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CostGraphDef(CostGraphDef&& from) noexcept + : CostGraphDef() { + *this = ::std::move(from); + } + + inline CostGraphDef& operator=(CostGraphDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CostGraphDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CostGraphDef* internal_default_instance() { + return reinterpret_cast( + &_CostGraphDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(CostGraphDef* other); + void Swap(CostGraphDef* other); + friend void swap(CostGraphDef& a, CostGraphDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CostGraphDef* New() const final { + return CreateMaybeMessage(NULL); + } + + CostGraphDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CostGraphDef& from); + void MergeFrom(const CostGraphDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CostGraphDef* other); + protected: + explicit CostGraphDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef CostGraphDef_Node Node; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.CostGraphDef.Node node = 1; + int node_size() const; + void clear_node(); + static const int kNodeFieldNumber = 1; + ::diplomacy::tensorflow::CostGraphDef_Node* mutable_node(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node >* + mutable_node(); + const ::diplomacy::tensorflow::CostGraphDef_Node& node(int index) const; + ::diplomacy::tensorflow::CostGraphDef_Node* add_node(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node >& + node() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node > node_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// CostGraphDef_Node_InputInfo + +// int32 preceding_node = 1; +inline void CostGraphDef_Node_InputInfo::clear_preceding_node() { + preceding_node_ = 0; +} +inline ::google::protobuf::int32 CostGraphDef_Node_InputInfo::preceding_node() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.InputInfo.preceding_node) + return preceding_node_; +} +inline void CostGraphDef_Node_InputInfo::set_preceding_node(::google::protobuf::int32 value) { + + preceding_node_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.InputInfo.preceding_node) +} + +// int32 preceding_port = 2; +inline void CostGraphDef_Node_InputInfo::clear_preceding_port() { + preceding_port_ = 0; +} +inline ::google::protobuf::int32 CostGraphDef_Node_InputInfo::preceding_port() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.InputInfo.preceding_port) + return preceding_port_; +} +inline void CostGraphDef_Node_InputInfo::set_preceding_port(::google::protobuf::int32 value) { + + preceding_port_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.InputInfo.preceding_port) +} + +// ------------------------------------------------------------------- + +// CostGraphDef_Node_OutputInfo + +// int64 size = 1; +inline void CostGraphDef_Node_OutputInfo::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node_OutputInfo::size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.size) + return size_; +} +inline void CostGraphDef_Node_OutputInfo::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.size) +} + +// int64 alias_input_port = 2; +inline void CostGraphDef_Node_OutputInfo::clear_alias_input_port() { + alias_input_port_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node_OutputInfo::alias_input_port() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.alias_input_port) + return alias_input_port_; +} +inline void CostGraphDef_Node_OutputInfo::set_alias_input_port(::google::protobuf::int64 value) { + + alias_input_port_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.alias_input_port) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 3; +inline bool CostGraphDef_Node_OutputInfo::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& CostGraphDef_Node_OutputInfo::_internal_shape() const { + return *shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& CostGraphDef_Node_OutputInfo::shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* CostGraphDef_Node_OutputInfo::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* CostGraphDef_Node_OutputInfo::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* CostGraphDef_Node_OutputInfo::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.shape) + return shape_; +} +inline void CostGraphDef_Node_OutputInfo::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.shape) +} + +// .diplomacy.tensorflow.DataType dtype = 4; +inline void CostGraphDef_Node_OutputInfo::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType CostGraphDef_Node_OutputInfo::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void CostGraphDef_Node_OutputInfo::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.dtype) +} + +// ------------------------------------------------------------------- + +// CostGraphDef_Node + +// string name = 1; +inline void CostGraphDef_Node::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& CostGraphDef_Node::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.name) + return name_.Get(); +} +inline void CostGraphDef_Node::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.name) +} +#if LANG_CXX11 +inline void CostGraphDef_Node::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.CostGraphDef.Node.name) +} +#endif +inline void CostGraphDef_Node::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.CostGraphDef.Node.name) +} +inline void CostGraphDef_Node::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.CostGraphDef.Node.name) +} +inline ::std::string* CostGraphDef_Node::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CostGraphDef.Node.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* CostGraphDef_Node::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.CostGraphDef.Node.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void CostGraphDef_Node::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.CostGraphDef.Node.name) +} +inline ::std::string* CostGraphDef_Node::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.CostGraphDef.Node.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void CostGraphDef_Node::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.CostGraphDef.Node.name) +} + +// string device = 2; +inline void CostGraphDef_Node::clear_device() { + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& CostGraphDef_Node::device() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.device) + return device_.Get(); +} +inline void CostGraphDef_Node::set_device(const ::std::string& value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.device) +} +#if LANG_CXX11 +inline void CostGraphDef_Node::set_device(::std::string&& value) { + + device_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.CostGraphDef.Node.device) +} +#endif +inline void CostGraphDef_Node::set_device(const char* value) { + GOOGLE_DCHECK(value != NULL); + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.CostGraphDef.Node.device) +} +inline void CostGraphDef_Node::set_device(const char* value, + size_t size) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.CostGraphDef.Node.device) +} +inline ::std::string* CostGraphDef_Node::mutable_device() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CostGraphDef.Node.device) + return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* CostGraphDef_Node::release_device() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.CostGraphDef.Node.device) + + return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void CostGraphDef_Node::set_allocated_device(::std::string* device) { + if (device != NULL) { + + } else { + + } + device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.CostGraphDef.Node.device) +} +inline ::std::string* CostGraphDef_Node::unsafe_arena_release_device() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.CostGraphDef.Node.device) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void CostGraphDef_Node::unsafe_arena_set_allocated_device( + ::std::string* device) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device != NULL) { + + } else { + + } + device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.CostGraphDef.Node.device) +} + +// int32 id = 3; +inline void CostGraphDef_Node::clear_id() { + id_ = 0; +} +inline ::google::protobuf::int32 CostGraphDef_Node::id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.id) + return id_; +} +inline void CostGraphDef_Node::set_id(::google::protobuf::int32 value) { + + id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.id) +} + +// repeated .diplomacy.tensorflow.CostGraphDef.Node.InputInfo input_info = 4; +inline int CostGraphDef_Node::input_info_size() const { + return input_info_.size(); +} +inline void CostGraphDef_Node::clear_input_info() { + input_info_.Clear(); +} +inline ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo* CostGraphDef_Node::mutable_input_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CostGraphDef.Node.input_info) + return input_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo >* +CostGraphDef_Node::mutable_input_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.CostGraphDef.Node.input_info) + return &input_info_; +} +inline const ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo& CostGraphDef_Node::input_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.input_info) + return input_info_.Get(index); +} +inline ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo* CostGraphDef_Node::add_input_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.CostGraphDef.Node.input_info) + return input_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_InputInfo >& +CostGraphDef_Node::input_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.CostGraphDef.Node.input_info) + return input_info_; +} + +// repeated .diplomacy.tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; +inline int CostGraphDef_Node::output_info_size() const { + return output_info_.size(); +} +inline void CostGraphDef_Node::clear_output_info() { + output_info_.Clear(); +} +inline ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo* CostGraphDef_Node::mutable_output_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CostGraphDef.Node.output_info) + return output_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo >* +CostGraphDef_Node::mutable_output_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.CostGraphDef.Node.output_info) + return &output_info_; +} +inline const ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo& CostGraphDef_Node::output_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.output_info) + return output_info_.Get(index); +} +inline ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo* CostGraphDef_Node::add_output_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.CostGraphDef.Node.output_info) + return output_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node_OutputInfo >& +CostGraphDef_Node::output_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.CostGraphDef.Node.output_info) + return output_info_; +} + +// int64 temporary_memory_size = 6; +inline void CostGraphDef_Node::clear_temporary_memory_size() { + temporary_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::temporary_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.temporary_memory_size) + return temporary_memory_size_; +} +inline void CostGraphDef_Node::set_temporary_memory_size(::google::protobuf::int64 value) { + + temporary_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.temporary_memory_size) +} + +// int64 persistent_memory_size = 12; +inline void CostGraphDef_Node::clear_persistent_memory_size() { + persistent_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::persistent_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.persistent_memory_size) + return persistent_memory_size_; +} +inline void CostGraphDef_Node::set_persistent_memory_size(::google::protobuf::int64 value) { + + persistent_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.persistent_memory_size) +} + +// int64 host_temp_memory_size = 10 [deprecated = true]; +inline void CostGraphDef_Node::clear_host_temp_memory_size() { + host_temp_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::host_temp_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.host_temp_memory_size) + return host_temp_memory_size_; +} +inline void CostGraphDef_Node::set_host_temp_memory_size(::google::protobuf::int64 value) { + + host_temp_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.host_temp_memory_size) +} + +// int64 device_temp_memory_size = 11 [deprecated = true]; +inline void CostGraphDef_Node::clear_device_temp_memory_size() { + device_temp_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::device_temp_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.device_temp_memory_size) + return device_temp_memory_size_; +} +inline void CostGraphDef_Node::set_device_temp_memory_size(::google::protobuf::int64 value) { + + device_temp_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.device_temp_memory_size) +} + +// int64 device_persistent_memory_size = 16 [deprecated = true]; +inline void CostGraphDef_Node::clear_device_persistent_memory_size() { + device_persistent_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::device_persistent_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.device_persistent_memory_size) + return device_persistent_memory_size_; +} +inline void CostGraphDef_Node::set_device_persistent_memory_size(::google::protobuf::int64 value) { + + device_persistent_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.device_persistent_memory_size) +} + +// int64 compute_cost = 9; +inline void CostGraphDef_Node::clear_compute_cost() { + compute_cost_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::compute_cost() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.compute_cost) + return compute_cost_; +} +inline void CostGraphDef_Node::set_compute_cost(::google::protobuf::int64 value) { + + compute_cost_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.compute_cost) +} + +// int64 compute_time = 14; +inline void CostGraphDef_Node::clear_compute_time() { + compute_time_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::compute_time() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.compute_time) + return compute_time_; +} +inline void CostGraphDef_Node::set_compute_time(::google::protobuf::int64 value) { + + compute_time_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.compute_time) +} + +// int64 memory_time = 15; +inline void CostGraphDef_Node::clear_memory_time() { + memory_time_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 CostGraphDef_Node::memory_time() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.memory_time) + return memory_time_; +} +inline void CostGraphDef_Node::set_memory_time(::google::protobuf::int64 value) { + + memory_time_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.memory_time) +} + +// bool is_final = 7; +inline void CostGraphDef_Node::clear_is_final() { + is_final_ = false; +} +inline bool CostGraphDef_Node::is_final() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.is_final) + return is_final_; +} +inline void CostGraphDef_Node::set_is_final(bool value) { + + is_final_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.is_final) +} + +// repeated int32 control_input = 8; +inline int CostGraphDef_Node::control_input_size() const { + return control_input_.size(); +} +inline void CostGraphDef_Node::clear_control_input() { + control_input_.Clear(); +} +inline ::google::protobuf::int32 CostGraphDef_Node::control_input(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.control_input) + return control_input_.Get(index); +} +inline void CostGraphDef_Node::set_control_input(int index, ::google::protobuf::int32 value) { + control_input_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.control_input) +} +inline void CostGraphDef_Node::add_control_input(::google::protobuf::int32 value) { + control_input_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.CostGraphDef.Node.control_input) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +CostGraphDef_Node::control_input() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.CostGraphDef.Node.control_input) + return control_input_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +CostGraphDef_Node::mutable_control_input() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.CostGraphDef.Node.control_input) + return &control_input_; +} + +// bool inaccurate = 17; +inline void CostGraphDef_Node::clear_inaccurate() { + inaccurate_ = false; +} +inline bool CostGraphDef_Node::inaccurate() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.Node.inaccurate) + return inaccurate_; +} +inline void CostGraphDef_Node::set_inaccurate(bool value) { + + inaccurate_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.CostGraphDef.Node.inaccurate) +} + +// ------------------------------------------------------------------- + +// CostGraphDef + +// repeated .diplomacy.tensorflow.CostGraphDef.Node node = 1; +inline int CostGraphDef::node_size() const { + return node_.size(); +} +inline void CostGraphDef::clear_node() { + node_.Clear(); +} +inline ::diplomacy::tensorflow::CostGraphDef_Node* CostGraphDef::mutable_node(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.CostGraphDef.node) + return node_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node >* +CostGraphDef::mutable_node() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.CostGraphDef.node) + return &node_; +} +inline const ::diplomacy::tensorflow::CostGraphDef_Node& CostGraphDef::node(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.CostGraphDef.node) + return node_.Get(index); +} +inline ::diplomacy::tensorflow::CostGraphDef_Node* CostGraphDef::add_node() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.CostGraphDef.node) + return node_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::CostGraphDef_Node >& +CostGraphDef::node() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.CostGraphDef.node) + return node_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fcost_5fgraph_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.proto new file mode 100644 index 0000000..e07ae75 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "CostGraphProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +message CostGraphDef { + message Node { + // The name of the node. Names are globally unique. + string name = 1; + + // The device of the node. Can be empty if the node is mapped to the + // default partition or partitioning hasn't been run yet. + string device = 2; + + // The id of the node. Node ids are only unique inside a partition. + int32 id = 3; + + // Inputs of this node. They must be executed before this node can be + // executed. An input is a particular output of another node, specified + // by the node id and the output index. + message InputInfo { + int32 preceding_node = 1; + int32 preceding_port = 2; + } + repeated InputInfo input_info = 4; + + // Outputs of this node. + message OutputInfo { + int64 size = 1; + // If >= 0, the output is an alias of an input. Note that an alias input + // may itself be an alias. The algorithm will therefore need to follow + // those pointers. + int64 alias_input_port = 2; + TensorShapeProto shape = 3; + DataType dtype = 4; + } + repeated OutputInfo output_info = 5; + + // Temporary memory used by this node. + int64 temporary_memory_size = 6; + + // Persistent memory used by this node. + int64 persistent_memory_size = 12; + + int64 host_temp_memory_size = 10 [deprecated = true]; + int64 device_temp_memory_size = 11 [deprecated = true]; + int64 device_persistent_memory_size = 16 [deprecated = true]; + + // Estimate of the computational cost of this node, in microseconds. + int64 compute_cost = 9; + + // Analytical estimate of the computational cost of this node, in + // microseconds. + int64 compute_time = 14; + + // Analytical estimate of the memory access cost of this node, in + // microseconds. + int64 memory_time = 15; + + // If true, the output is permanent: it can't be discarded, because this + // node is part of the "final output". Nodes may depend on final nodes. + bool is_final = 7; + + // Ids of the control inputs for this node. + repeated int32 control_input = 8; + + // Are the costs inaccurate? + bool inaccurate = 17; + } + repeated Node node = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph_pb2.py new file mode 100644 index 0000000..32604f1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/cost_graph_pb2.py @@ -0,0 +1,331 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/cost_graph.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/cost_graph.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\017CostGraphProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n4diplomacy_tensorflow/core/framework/cost_graph.proto\x12\x14\x64iplomacy.tensorflow\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"\x92\x06\n\x0c\x43ostGraphDef\x12\x35\n\x04node\x18\x01 \x03(\x0b\x32\'.diplomacy.tensorflow.CostGraphDef.Node\x1a\xca\x05\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x64\x65vice\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\x05\x12\x45\n\ninput_info\x18\x04 \x03(\x0b\x32\x31.diplomacy.tensorflow.CostGraphDef.Node.InputInfo\x12G\n\x0boutput_info\x18\x05 \x03(\x0b\x32\x32.diplomacy.tensorflow.CostGraphDef.Node.OutputInfo\x12\x1d\n\x15temporary_memory_size\x18\x06 \x01(\x03\x12\x1e\n\x16persistent_memory_size\x18\x0c \x01(\x03\x12!\n\x15host_temp_memory_size\x18\n \x01(\x03\x42\x02\x18\x01\x12#\n\x17\x64\x65vice_temp_memory_size\x18\x0b \x01(\x03\x42\x02\x18\x01\x12)\n\x1d\x64\x65vice_persistent_memory_size\x18\x10 \x01(\x03\x42\x02\x18\x01\x12\x14\n\x0c\x63ompute_cost\x18\t \x01(\x03\x12\x14\n\x0c\x63ompute_time\x18\x0e \x01(\x03\x12\x13\n\x0bmemory_time\x18\x0f \x01(\x03\x12\x10\n\x08is_final\x18\x07 \x01(\x08\x12\x15\n\rcontrol_input\x18\x08 \x03(\x05\x12\x12\n\ninaccurate\x18\x11 \x01(\x08\x1a;\n\tInputInfo\x12\x16\n\x0epreceding_node\x18\x01 \x01(\x05\x12\x16\n\x0epreceding_port\x18\x02 \x01(\x05\x1a\x9a\x01\n\nOutputInfo\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x18\n\x10\x61lias_input_port\x18\x02 \x01(\x03\x12\x35\n\x05shape\x18\x03 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProto\x12-\n\x05\x64type\x18\x04 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataTypeBo\n\x18org.tensorflow.frameworkB\x0f\x43ostGraphProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + + +_COSTGRAPHDEF_NODE_INPUTINFO = _descriptor.Descriptor( + name='InputInfo', + full_name='diplomacy.tensorflow.CostGraphDef.Node.InputInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='preceding_node', full_name='diplomacy.tensorflow.CostGraphDef.Node.InputInfo.preceding_node', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='preceding_port', full_name='diplomacy.tensorflow.CostGraphDef.Node.InputInfo.preceding_port', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=754, + serialized_end=813, +) + +_COSTGRAPHDEF_NODE_OUTPUTINFO = _descriptor.Descriptor( + name='OutputInfo', + full_name='diplomacy.tensorflow.CostGraphDef.Node.OutputInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='size', full_name='diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.size', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='alias_input_port', full_name='diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.alias_input_port', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.shape', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.CostGraphDef.Node.OutputInfo.dtype', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=816, + serialized_end=970, +) + +_COSTGRAPHDEF_NODE = _descriptor.Descriptor( + name='Node', + full_name='diplomacy.tensorflow.CostGraphDef.Node', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.CostGraphDef.Node.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device', full_name='diplomacy.tensorflow.CostGraphDef.Node.device', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='id', full_name='diplomacy.tensorflow.CostGraphDef.Node.id', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input_info', full_name='diplomacy.tensorflow.CostGraphDef.Node.input_info', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_info', full_name='diplomacy.tensorflow.CostGraphDef.Node.output_info', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='temporary_memory_size', full_name='diplomacy.tensorflow.CostGraphDef.Node.temporary_memory_size', index=5, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='persistent_memory_size', full_name='diplomacy.tensorflow.CostGraphDef.Node.persistent_memory_size', index=6, + number=12, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='host_temp_memory_size', full_name='diplomacy.tensorflow.CostGraphDef.Node.host_temp_memory_size', index=7, + number=10, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_temp_memory_size', full_name='diplomacy.tensorflow.CostGraphDef.Node.device_temp_memory_size', index=8, + number=11, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_persistent_memory_size', full_name='diplomacy.tensorflow.CostGraphDef.Node.device_persistent_memory_size', index=9, + number=16, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_cost', full_name='diplomacy.tensorflow.CostGraphDef.Node.compute_cost', index=10, + number=9, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_time', full_name='diplomacy.tensorflow.CostGraphDef.Node.compute_time', index=11, + number=14, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='memory_time', full_name='diplomacy.tensorflow.CostGraphDef.Node.memory_time', index=12, + number=15, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_final', full_name='diplomacy.tensorflow.CostGraphDef.Node.is_final', index=13, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='control_input', full_name='diplomacy.tensorflow.CostGraphDef.Node.control_input', index=14, + number=8, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inaccurate', full_name='diplomacy.tensorflow.CostGraphDef.Node.inaccurate', index=15, + number=17, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_COSTGRAPHDEF_NODE_INPUTINFO, _COSTGRAPHDEF_NODE_OUTPUTINFO, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=256, + serialized_end=970, +) + +_COSTGRAPHDEF = _descriptor.Descriptor( + name='CostGraphDef', + full_name='diplomacy.tensorflow.CostGraphDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node', full_name='diplomacy.tensorflow.CostGraphDef.node', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_COSTGRAPHDEF_NODE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=184, + serialized_end=970, +) + +_COSTGRAPHDEF_NODE_INPUTINFO.containing_type = _COSTGRAPHDEF_NODE +_COSTGRAPHDEF_NODE_OUTPUTINFO.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_COSTGRAPHDEF_NODE_OUTPUTINFO.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_COSTGRAPHDEF_NODE_OUTPUTINFO.containing_type = _COSTGRAPHDEF_NODE +_COSTGRAPHDEF_NODE.fields_by_name['input_info'].message_type = _COSTGRAPHDEF_NODE_INPUTINFO +_COSTGRAPHDEF_NODE.fields_by_name['output_info'].message_type = _COSTGRAPHDEF_NODE_OUTPUTINFO +_COSTGRAPHDEF_NODE.containing_type = _COSTGRAPHDEF +_COSTGRAPHDEF.fields_by_name['node'].message_type = _COSTGRAPHDEF_NODE +DESCRIPTOR.message_types_by_name['CostGraphDef'] = _COSTGRAPHDEF +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +CostGraphDef = _reflection.GeneratedProtocolMessageType('CostGraphDef', (_message.Message,), dict( + + Node = _reflection.GeneratedProtocolMessageType('Node', (_message.Message,), dict( + + InputInfo = _reflection.GeneratedProtocolMessageType('InputInfo', (_message.Message,), dict( + DESCRIPTOR = _COSTGRAPHDEF_NODE_INPUTINFO, + __module__ = 'diplomacy_tensorflow.core.framework.cost_graph_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef.Node.InputInfo) + )) + , + + OutputInfo = _reflection.GeneratedProtocolMessageType('OutputInfo', (_message.Message,), dict( + DESCRIPTOR = _COSTGRAPHDEF_NODE_OUTPUTINFO, + __module__ = 'diplomacy_tensorflow.core.framework.cost_graph_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef.Node.OutputInfo) + )) + , + DESCRIPTOR = _COSTGRAPHDEF_NODE, + __module__ = 'diplomacy_tensorflow.core.framework.cost_graph_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef.Node) + )) + , + DESCRIPTOR = _COSTGRAPHDEF, + __module__ = 'diplomacy_tensorflow.core.framework.cost_graph_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.CostGraphDef) + )) +_sym_db.RegisterMessage(CostGraphDef) +_sym_db.RegisterMessage(CostGraphDef.Node) +_sym_db.RegisterMessage(CostGraphDef.Node.InputInfo) +_sym_db.RegisterMessage(CostGraphDef.Node.OutputInfo) + + +DESCRIPTOR._options = None +_COSTGRAPHDEF_NODE.fields_by_name['host_temp_memory_size']._options = None +_COSTGRAPHDEF_NODE.fields_by_name['device_temp_memory_size']._options = None +_COSTGRAPHDEF_NODE.fields_by_name['device_persistent_memory_size']._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.pb.cc new file mode 100644 index 0000000..9dce2d1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.pb.cc @@ -0,0 +1,1746 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/device_attributes.proto + +#include "diplomacy_tensorflow/core/framework/device_attributes.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_InterconnectLink; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DeviceLocality; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_LocalLinks; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto +namespace diplomacy { +namespace tensorflow { +class InterconnectLinkDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _InterconnectLink_default_instance_; +class LocalLinksDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LocalLinks_default_instance_; +class DeviceLocalityDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceLocality_default_instance_; +class DeviceAttributesDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceAttributes_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto { +static void InitDefaultsInterconnectLink() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_InterconnectLink_default_instance_; + new (ptr) ::diplomacy::tensorflow::InterconnectLink(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::InterconnectLink::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_InterconnectLink = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsInterconnectLink}, {}}; + +static void InitDefaultsLocalLinks() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_LocalLinks_default_instance_; + new (ptr) ::diplomacy::tensorflow::LocalLinks(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::LocalLinks::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_LocalLinks = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsLocalLinks}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_InterconnectLink.base,}}; + +static void InitDefaultsDeviceLocality() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_DeviceLocality_default_instance_; + new (ptr) ::diplomacy::tensorflow::DeviceLocality(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::DeviceLocality::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeviceLocality = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeviceLocality}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_LocalLinks.base,}}; + +static void InitDefaultsDeviceAttributes() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_DeviceAttributes_default_instance_; + new (ptr) ::diplomacy::tensorflow::DeviceAttributes(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::DeviceAttributes::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeviceAttributes = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeviceAttributes}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_DeviceLocality.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_InterconnectLink.base); + ::google::protobuf::internal::InitSCC(&scc_info_LocalLinks.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceLocality.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceAttributes.base); +} + +::google::protobuf::Metadata file_level_metadata[4]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::InterconnectLink, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::InterconnectLink, device_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::InterconnectLink, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::InterconnectLink, strength_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::LocalLinks, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::LocalLinks, link_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceLocality, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceLocality, bus_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceLocality, numa_node_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceLocality, links_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceAttributes, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceAttributes, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceAttributes, device_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceAttributes, memory_limit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceAttributes, locality_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceAttributes, incarnation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceAttributes, physical_device_desc_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::InterconnectLink)}, + { 8, -1, sizeof(::diplomacy::tensorflow::LocalLinks)}, + { 14, -1, sizeof(::diplomacy::tensorflow::DeviceLocality)}, + { 22, -1, sizeof(::diplomacy::tensorflow::DeviceAttributes)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_InterconnectLink_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_LocalLinks_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_DeviceLocality_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_DeviceAttributes_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/device_attributes.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n;diplomacy_tensorflow/core/framework/de" + "vice_attributes.proto\022\024diplomacy.tensorf" + "low\"E\n\020InterconnectLink\022\021\n\tdevice_id\030\001 \001" + "(\005\022\014\n\004type\030\002 \001(\t\022\020\n\010strength\030\003 \001(\005\"B\n\nLo" + "calLinks\0224\n\004link\030\001 \003(\0132&.diplomacy.tenso" + "rflow.InterconnectLink\"d\n\016DeviceLocality" + "\022\016\n\006bus_id\030\001 \001(\005\022\021\n\tnuma_node\030\002 \001(\005\022/\n\005l" + "inks\030\003 \001(\0132 .diplomacy.tensorflow.LocalL" + "inks\"\266\001\n\020DeviceAttributes\022\014\n\004name\030\001 \001(\t\022" + "\023\n\013device_type\030\002 \001(\t\022\024\n\014memory_limit\030\004 \001" + "(\003\0226\n\010locality\030\005 \001(\0132$.diplomacy.tensorf" + "low.DeviceLocality\022\023\n\013incarnation\030\006 \001(\006\022" + "\034\n\024physical_device_desc\030\007 \001(\tBv\n\030org.ten" + "sorflow.frameworkB\026DeviceAttributesProto" + "sP\001Z=github.com/tensorflow/tensorflow/te" + "nsorflow/go/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 637); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/device_attributes.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void InterconnectLink::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InterconnectLink::kDeviceIdFieldNumber; +const int InterconnectLink::kTypeFieldNumber; +const int InterconnectLink::kStrengthFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InterconnectLink::InterconnectLink() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_InterconnectLink.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.InterconnectLink) +} +InterconnectLink::InterconnectLink(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_InterconnectLink.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.InterconnectLink) +} +InterconnectLink::InterconnectLink(const InterconnectLink& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.type().size() > 0) { + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type(), + GetArenaNoVirtual()); + } + ::memcpy(&device_id_, &from.device_id_, + static_cast(reinterpret_cast(&strength_) - + reinterpret_cast(&device_id_)) + sizeof(strength_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.InterconnectLink) +} + +void InterconnectLink::SharedCtor() { + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&device_id_, 0, static_cast( + reinterpret_cast(&strength_) - + reinterpret_cast(&device_id_)) + sizeof(strength_)); +} + +InterconnectLink::~InterconnectLink() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.InterconnectLink) + SharedDtor(); +} + +void InterconnectLink::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void InterconnectLink::ArenaDtor(void* object) { + InterconnectLink* _this = reinterpret_cast< InterconnectLink* >(object); + (void)_this; +} +void InterconnectLink::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void InterconnectLink::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* InterconnectLink::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const InterconnectLink& InterconnectLink::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_InterconnectLink.base); + return *internal_default_instance(); +} + + +void InterconnectLink::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.InterconnectLink) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&device_id_, 0, static_cast( + reinterpret_cast(&strength_) - + reinterpret_cast(&device_id_)) + sizeof(strength_)); + _internal_metadata_.Clear(); +} + +bool InterconnectLink::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.InterconnectLink) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 device_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), static_cast(this->type().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.InterconnectLink.type")); + } else { + goto handle_unusual; + } + break; + } + + // int32 strength = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &strength_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.InterconnectLink) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.InterconnectLink) + return false; +#undef DO_ +} + +void InterconnectLink::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.InterconnectLink) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 device_id = 1; + if (this->device_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->device_id(), output); + } + + // string type = 2; + if (this->type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), static_cast(this->type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.InterconnectLink.type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->type(), output); + } + + // int32 strength = 3; + if (this->strength() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->strength(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.InterconnectLink) +} + +::google::protobuf::uint8* InterconnectLink::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.InterconnectLink) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 device_id = 1; + if (this->device_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->device_id(), target); + } + + // string type = 2; + if (this->type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), static_cast(this->type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.InterconnectLink.type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->type(), target); + } + + // int32 strength = 3; + if (this->strength() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->strength(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.InterconnectLink) + return target; +} + +size_t InterconnectLink::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.InterconnectLink) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string type = 2; + if (this->type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + + // int32 device_id = 1; + if (this->device_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->device_id()); + } + + // int32 strength = 3; + if (this->strength() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->strength()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void InterconnectLink::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.InterconnectLink) + GOOGLE_DCHECK_NE(&from, this); + const InterconnectLink* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.InterconnectLink) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.InterconnectLink) + MergeFrom(*source); + } +} + +void InterconnectLink::MergeFrom(const InterconnectLink& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.InterconnectLink) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.type().size() > 0) { + set_type(from.type()); + } + if (from.device_id() != 0) { + set_device_id(from.device_id()); + } + if (from.strength() != 0) { + set_strength(from.strength()); + } +} + +void InterconnectLink::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.InterconnectLink) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InterconnectLink::CopyFrom(const InterconnectLink& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.InterconnectLink) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InterconnectLink::IsInitialized() const { + return true; +} + +void InterconnectLink::Swap(InterconnectLink* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + InterconnectLink* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void InterconnectLink::UnsafeArenaSwap(InterconnectLink* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void InterconnectLink::InternalSwap(InterconnectLink* other) { + using std::swap; + type_.Swap(&other->type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(device_id_, other->device_id_); + swap(strength_, other->strength_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata InterconnectLink::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LocalLinks::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LocalLinks::kLinkFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LocalLinks::LocalLinks() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_LocalLinks.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.LocalLinks) +} +LocalLinks::LocalLinks(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + link_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_LocalLinks.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.LocalLinks) +} +LocalLinks::LocalLinks(const LocalLinks& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + link_(from.link_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.LocalLinks) +} + +void LocalLinks::SharedCtor() { +} + +LocalLinks::~LocalLinks() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.LocalLinks) + SharedDtor(); +} + +void LocalLinks::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void LocalLinks::ArenaDtor(void* object) { + LocalLinks* _this = reinterpret_cast< LocalLinks* >(object); + (void)_this; +} +void LocalLinks::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LocalLinks::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LocalLinks::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LocalLinks& LocalLinks::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_LocalLinks.base); + return *internal_default_instance(); +} + + +void LocalLinks::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.LocalLinks) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + link_.Clear(); + _internal_metadata_.Clear(); +} + +bool LocalLinks::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.LocalLinks) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.InterconnectLink link = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_link())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.LocalLinks) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.LocalLinks) + return false; +#undef DO_ +} + +void LocalLinks::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.LocalLinks) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.InterconnectLink link = 1; + for (unsigned int i = 0, + n = static_cast(this->link_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->link(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.LocalLinks) +} + +::google::protobuf::uint8* LocalLinks::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.LocalLinks) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.InterconnectLink link = 1; + for (unsigned int i = 0, + n = static_cast(this->link_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->link(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.LocalLinks) + return target; +} + +size_t LocalLinks::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.LocalLinks) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.InterconnectLink link = 1; + { + unsigned int count = static_cast(this->link_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->link(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LocalLinks::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.LocalLinks) + GOOGLE_DCHECK_NE(&from, this); + const LocalLinks* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.LocalLinks) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.LocalLinks) + MergeFrom(*source); + } +} + +void LocalLinks::MergeFrom(const LocalLinks& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.LocalLinks) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + link_.MergeFrom(from.link_); +} + +void LocalLinks::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.LocalLinks) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LocalLinks::CopyFrom(const LocalLinks& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.LocalLinks) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LocalLinks::IsInitialized() const { + return true; +} + +void LocalLinks::Swap(LocalLinks* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LocalLinks* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LocalLinks::UnsafeArenaSwap(LocalLinks* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LocalLinks::InternalSwap(LocalLinks* other) { + using std::swap; + CastToBase(&link_)->InternalSwap(CastToBase(&other->link_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LocalLinks::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceLocality::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_DeviceLocality_default_instance_._instance.get_mutable()->links_ = const_cast< ::diplomacy::tensorflow::LocalLinks*>( + ::diplomacy::tensorflow::LocalLinks::internal_default_instance()); +} +void DeviceLocality::unsafe_arena_set_allocated_links( + ::diplomacy::tensorflow::LocalLinks* links) { + if (GetArenaNoVirtual() == NULL) { + delete links_; + } + links_ = links; + if (links) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.DeviceLocality.links) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceLocality::kBusIdFieldNumber; +const int DeviceLocality::kNumaNodeFieldNumber; +const int DeviceLocality::kLinksFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceLocality::DeviceLocality() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_DeviceLocality.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.DeviceLocality) +} +DeviceLocality::DeviceLocality(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_DeviceLocality.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.DeviceLocality) +} +DeviceLocality::DeviceLocality(const DeviceLocality& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_links()) { + links_ = new ::diplomacy::tensorflow::LocalLinks(*from.links_); + } else { + links_ = NULL; + } + ::memcpy(&bus_id_, &from.bus_id_, + static_cast(reinterpret_cast(&numa_node_) - + reinterpret_cast(&bus_id_)) + sizeof(numa_node_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.DeviceLocality) +} + +void DeviceLocality::SharedCtor() { + ::memset(&links_, 0, static_cast( + reinterpret_cast(&numa_node_) - + reinterpret_cast(&links_)) + sizeof(numa_node_)); +} + +DeviceLocality::~DeviceLocality() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.DeviceLocality) + SharedDtor(); +} + +void DeviceLocality::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete links_; +} + +void DeviceLocality::ArenaDtor(void* object) { + DeviceLocality* _this = reinterpret_cast< DeviceLocality* >(object); + (void)_this; +} +void DeviceLocality::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DeviceLocality::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceLocality::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceLocality& DeviceLocality::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_DeviceLocality.base); + return *internal_default_instance(); +} + + +void DeviceLocality::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.DeviceLocality) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && links_ != NULL) { + delete links_; + } + links_ = NULL; + ::memset(&bus_id_, 0, static_cast( + reinterpret_cast(&numa_node_) - + reinterpret_cast(&bus_id_)) + sizeof(numa_node_)); + _internal_metadata_.Clear(); +} + +bool DeviceLocality::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.DeviceLocality) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 bus_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &bus_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 numa_node = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &numa_node_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.LocalLinks links = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_links())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.DeviceLocality) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.DeviceLocality) + return false; +#undef DO_ +} + +void DeviceLocality::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.DeviceLocality) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 bus_id = 1; + if (this->bus_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->bus_id(), output); + } + + // int32 numa_node = 2; + if (this->numa_node() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->numa_node(), output); + } + + // .diplomacy.tensorflow.LocalLinks links = 3; + if (this->has_links()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_links(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.DeviceLocality) +} + +::google::protobuf::uint8* DeviceLocality::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.DeviceLocality) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 bus_id = 1; + if (this->bus_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->bus_id(), target); + } + + // int32 numa_node = 2; + if (this->numa_node() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->numa_node(), target); + } + + // .diplomacy.tensorflow.LocalLinks links = 3; + if (this->has_links()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_links(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.DeviceLocality) + return target; +} + +size_t DeviceLocality::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.DeviceLocality) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.LocalLinks links = 3; + if (this->has_links()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *links_); + } + + // int32 bus_id = 1; + if (this->bus_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->bus_id()); + } + + // int32 numa_node = 2; + if (this->numa_node() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->numa_node()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceLocality::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.DeviceLocality) + GOOGLE_DCHECK_NE(&from, this); + const DeviceLocality* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.DeviceLocality) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.DeviceLocality) + MergeFrom(*source); + } +} + +void DeviceLocality::MergeFrom(const DeviceLocality& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.DeviceLocality) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_links()) { + mutable_links()->::diplomacy::tensorflow::LocalLinks::MergeFrom(from.links()); + } + if (from.bus_id() != 0) { + set_bus_id(from.bus_id()); + } + if (from.numa_node() != 0) { + set_numa_node(from.numa_node()); + } +} + +void DeviceLocality::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.DeviceLocality) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceLocality::CopyFrom(const DeviceLocality& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.DeviceLocality) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceLocality::IsInitialized() const { + return true; +} + +void DeviceLocality::Swap(DeviceLocality* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DeviceLocality* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DeviceLocality::UnsafeArenaSwap(DeviceLocality* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DeviceLocality::InternalSwap(DeviceLocality* other) { + using std::swap; + swap(links_, other->links_); + swap(bus_id_, other->bus_id_); + swap(numa_node_, other->numa_node_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceLocality::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceAttributes::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_DeviceAttributes_default_instance_._instance.get_mutable()->locality_ = const_cast< ::diplomacy::tensorflow::DeviceLocality*>( + ::diplomacy::tensorflow::DeviceLocality::internal_default_instance()); +} +void DeviceAttributes::unsafe_arena_set_allocated_locality( + ::diplomacy::tensorflow::DeviceLocality* locality) { + if (GetArenaNoVirtual() == NULL) { + delete locality_; + } + locality_ = locality; + if (locality) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.DeviceAttributes.locality) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceAttributes::kNameFieldNumber; +const int DeviceAttributes::kDeviceTypeFieldNumber; +const int DeviceAttributes::kMemoryLimitFieldNumber; +const int DeviceAttributes::kLocalityFieldNumber; +const int DeviceAttributes::kIncarnationFieldNumber; +const int DeviceAttributes::kPhysicalDeviceDescFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceAttributes::DeviceAttributes() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_DeviceAttributes.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.DeviceAttributes) +} +DeviceAttributes::DeviceAttributes(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_DeviceAttributes.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.DeviceAttributes) +} +DeviceAttributes::DeviceAttributes(const DeviceAttributes& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + device_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.device_type().size() > 0) { + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device_type(), + GetArenaNoVirtual()); + } + physical_device_desc_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.physical_device_desc().size() > 0) { + physical_device_desc_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.physical_device_desc(), + GetArenaNoVirtual()); + } + if (from.has_locality()) { + locality_ = new ::diplomacy::tensorflow::DeviceLocality(*from.locality_); + } else { + locality_ = NULL; + } + ::memcpy(&memory_limit_, &from.memory_limit_, + static_cast(reinterpret_cast(&incarnation_) - + reinterpret_cast(&memory_limit_)) + sizeof(incarnation_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.DeviceAttributes) +} + +void DeviceAttributes::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + physical_device_desc_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&locality_, 0, static_cast( + reinterpret_cast(&incarnation_) - + reinterpret_cast(&locality_)) + sizeof(incarnation_)); +} + +DeviceAttributes::~DeviceAttributes() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.DeviceAttributes) + SharedDtor(); +} + +void DeviceAttributes::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + physical_device_desc_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete locality_; +} + +void DeviceAttributes::ArenaDtor(void* object) { + DeviceAttributes* _this = reinterpret_cast< DeviceAttributes* >(object); + (void)_this; +} +void DeviceAttributes::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DeviceAttributes::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceAttributes::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceAttributes& DeviceAttributes::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::scc_info_DeviceAttributes.base); + return *internal_default_instance(); +} + + +void DeviceAttributes::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.DeviceAttributes) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + device_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + physical_device_desc_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && locality_ != NULL) { + delete locality_; + } + locality_ = NULL; + ::memset(&memory_limit_, 0, static_cast( + reinterpret_cast(&incarnation_) - + reinterpret_cast(&memory_limit_)) + sizeof(incarnation_)); + _internal_metadata_.Clear(); +} + +bool DeviceAttributes::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.DeviceAttributes) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.DeviceAttributes.name")); + } else { + goto handle_unusual; + } + break; + } + + // string device_type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device_type().data(), static_cast(this->device_type().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.DeviceAttributes.device_type")); + } else { + goto handle_unusual; + } + break; + } + + // int64 memory_limit = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &memory_limit_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DeviceLocality locality = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_locality())); + } else { + goto handle_unusual; + } + break; + } + + // fixed64 incarnation = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(49u /* 49 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( + input, &incarnation_))); + } else { + goto handle_unusual; + } + break; + } + + // string physical_device_desc = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_physical_device_desc())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->physical_device_desc().data(), static_cast(this->physical_device_desc().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.DeviceAttributes.physical_device_desc")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.DeviceAttributes) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.DeviceAttributes) + return false; +#undef DO_ +} + +void DeviceAttributes::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.DeviceAttributes) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceAttributes.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string device_type = 2; + if (this->device_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device_type().data(), static_cast(this->device_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceAttributes.device_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->device_type(), output); + } + + // int64 memory_limit = 4; + if (this->memory_limit() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->memory_limit(), output); + } + + // .diplomacy.tensorflow.DeviceLocality locality = 5; + if (this->has_locality()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_locality(), output); + } + + // fixed64 incarnation = 6; + if (this->incarnation() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFixed64(6, this->incarnation(), output); + } + + // string physical_device_desc = 7; + if (this->physical_device_desc().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->physical_device_desc().data(), static_cast(this->physical_device_desc().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceAttributes.physical_device_desc"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->physical_device_desc(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.DeviceAttributes) +} + +::google::protobuf::uint8* DeviceAttributes::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.DeviceAttributes) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceAttributes.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string device_type = 2; + if (this->device_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device_type().data(), static_cast(this->device_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceAttributes.device_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->device_type(), target); + } + + // int64 memory_limit = 4; + if (this->memory_limit() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->memory_limit(), target); + } + + // .diplomacy.tensorflow.DeviceLocality locality = 5; + if (this->has_locality()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_locality(), deterministic, target); + } + + // fixed64 incarnation = 6; + if (this->incarnation() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(6, this->incarnation(), target); + } + + // string physical_device_desc = 7; + if (this->physical_device_desc().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->physical_device_desc().data(), static_cast(this->physical_device_desc().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceAttributes.physical_device_desc"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->physical_device_desc(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.DeviceAttributes) + return target; +} + +size_t DeviceAttributes::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.DeviceAttributes) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string device_type = 2; + if (this->device_type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device_type()); + } + + // string physical_device_desc = 7; + if (this->physical_device_desc().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->physical_device_desc()); + } + + // .diplomacy.tensorflow.DeviceLocality locality = 5; + if (this->has_locality()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *locality_); + } + + // int64 memory_limit = 4; + if (this->memory_limit() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->memory_limit()); + } + + // fixed64 incarnation = 6; + if (this->incarnation() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceAttributes::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.DeviceAttributes) + GOOGLE_DCHECK_NE(&from, this); + const DeviceAttributes* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.DeviceAttributes) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.DeviceAttributes) + MergeFrom(*source); + } +} + +void DeviceAttributes::MergeFrom(const DeviceAttributes& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.DeviceAttributes) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.device_type().size() > 0) { + set_device_type(from.device_type()); + } + if (from.physical_device_desc().size() > 0) { + set_physical_device_desc(from.physical_device_desc()); + } + if (from.has_locality()) { + mutable_locality()->::diplomacy::tensorflow::DeviceLocality::MergeFrom(from.locality()); + } + if (from.memory_limit() != 0) { + set_memory_limit(from.memory_limit()); + } + if (from.incarnation() != 0) { + set_incarnation(from.incarnation()); + } +} + +void DeviceAttributes::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.DeviceAttributes) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceAttributes::CopyFrom(const DeviceAttributes& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.DeviceAttributes) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceAttributes::IsInitialized() const { + return true; +} + +void DeviceAttributes::Swap(DeviceAttributes* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DeviceAttributes* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DeviceAttributes::UnsafeArenaSwap(DeviceAttributes* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DeviceAttributes::InternalSwap(DeviceAttributes* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + device_type_.Swap(&other->device_type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + physical_device_desc_.Swap(&other->physical_device_desc_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(locality_, other->locality_); + swap(memory_limit_, other->memory_limit_); + swap(incarnation_, other->incarnation_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceAttributes::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::InterconnectLink* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::InterconnectLink >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::InterconnectLink >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::LocalLinks* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::LocalLinks >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::LocalLinks >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::DeviceLocality* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::DeviceLocality >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::DeviceLocality >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::DeviceAttributes* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::DeviceAttributes >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::DeviceAttributes >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.pb.h new file mode 100644 index 0000000..07e3039 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.pb.h @@ -0,0 +1,1286 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/device_attributes.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[4]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto +namespace diplomacy { +namespace tensorflow { +class DeviceAttributes; +class DeviceAttributesDefaultTypeInternal; +extern DeviceAttributesDefaultTypeInternal _DeviceAttributes_default_instance_; +class DeviceLocality; +class DeviceLocalityDefaultTypeInternal; +extern DeviceLocalityDefaultTypeInternal _DeviceLocality_default_instance_; +class InterconnectLink; +class InterconnectLinkDefaultTypeInternal; +extern InterconnectLinkDefaultTypeInternal _InterconnectLink_default_instance_; +class LocalLinks; +class LocalLinksDefaultTypeInternal; +extern LocalLinksDefaultTypeInternal _LocalLinks_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::DeviceAttributes* Arena::CreateMaybeMessage<::diplomacy::tensorflow::DeviceAttributes>(Arena*); +template<> ::diplomacy::tensorflow::DeviceLocality* Arena::CreateMaybeMessage<::diplomacy::tensorflow::DeviceLocality>(Arena*); +template<> ::diplomacy::tensorflow::InterconnectLink* Arena::CreateMaybeMessage<::diplomacy::tensorflow::InterconnectLink>(Arena*); +template<> ::diplomacy::tensorflow::LocalLinks* Arena::CreateMaybeMessage<::diplomacy::tensorflow::LocalLinks>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class InterconnectLink : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.InterconnectLink) */ { + public: + InterconnectLink(); + virtual ~InterconnectLink(); + + InterconnectLink(const InterconnectLink& from); + + inline InterconnectLink& operator=(const InterconnectLink& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + InterconnectLink(InterconnectLink&& from) noexcept + : InterconnectLink() { + *this = ::std::move(from); + } + + inline InterconnectLink& operator=(InterconnectLink&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const InterconnectLink& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const InterconnectLink* internal_default_instance() { + return reinterpret_cast( + &_InterconnectLink_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(InterconnectLink* other); + void Swap(InterconnectLink* other); + friend void swap(InterconnectLink& a, InterconnectLink& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline InterconnectLink* New() const final { + return CreateMaybeMessage(NULL); + } + + InterconnectLink* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const InterconnectLink& from); + void MergeFrom(const InterconnectLink& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(InterconnectLink* other); + protected: + explicit InterconnectLink(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string type = 2; + void clear_type(); + static const int kTypeFieldNumber = 2; + const ::std::string& type() const; + void set_type(const ::std::string& value); + #if LANG_CXX11 + void set_type(::std::string&& value); + #endif + void set_type(const char* value); + void set_type(const char* value, size_t size); + ::std::string* mutable_type(); + ::std::string* release_type(); + void set_allocated_type(::std::string* type); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_type(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_type( + ::std::string* type); + + // int32 device_id = 1; + void clear_device_id(); + static const int kDeviceIdFieldNumber = 1; + ::google::protobuf::int32 device_id() const; + void set_device_id(::google::protobuf::int32 value); + + // int32 strength = 3; + void clear_strength(); + static const int kStrengthFieldNumber = 3; + ::google::protobuf::int32 strength() const; + void set_strength(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.InterconnectLink) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::int32 device_id_; + ::google::protobuf::int32 strength_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LocalLinks : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.LocalLinks) */ { + public: + LocalLinks(); + virtual ~LocalLinks(); + + LocalLinks(const LocalLinks& from); + + inline LocalLinks& operator=(const LocalLinks& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LocalLinks(LocalLinks&& from) noexcept + : LocalLinks() { + *this = ::std::move(from); + } + + inline LocalLinks& operator=(LocalLinks&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LocalLinks& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LocalLinks* internal_default_instance() { + return reinterpret_cast( + &_LocalLinks_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(LocalLinks* other); + void Swap(LocalLinks* other); + friend void swap(LocalLinks& a, LocalLinks& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LocalLinks* New() const final { + return CreateMaybeMessage(NULL); + } + + LocalLinks* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LocalLinks& from); + void MergeFrom(const LocalLinks& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LocalLinks* other); + protected: + explicit LocalLinks(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.InterconnectLink link = 1; + int link_size() const; + void clear_link(); + static const int kLinkFieldNumber = 1; + ::diplomacy::tensorflow::InterconnectLink* mutable_link(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::InterconnectLink >* + mutable_link(); + const ::diplomacy::tensorflow::InterconnectLink& link(int index) const; + ::diplomacy::tensorflow::InterconnectLink* add_link(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::InterconnectLink >& + link() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.LocalLinks) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::InterconnectLink > link_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceLocality : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.DeviceLocality) */ { + public: + DeviceLocality(); + virtual ~DeviceLocality(); + + DeviceLocality(const DeviceLocality& from); + + inline DeviceLocality& operator=(const DeviceLocality& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceLocality(DeviceLocality&& from) noexcept + : DeviceLocality() { + *this = ::std::move(from); + } + + inline DeviceLocality& operator=(DeviceLocality&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceLocality& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceLocality* internal_default_instance() { + return reinterpret_cast( + &_DeviceLocality_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(DeviceLocality* other); + void Swap(DeviceLocality* other); + friend void swap(DeviceLocality& a, DeviceLocality& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceLocality* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceLocality* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceLocality& from); + void MergeFrom(const DeviceLocality& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceLocality* other); + protected: + explicit DeviceLocality(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.LocalLinks links = 3; + bool has_links() const; + void clear_links(); + static const int kLinksFieldNumber = 3; + private: + const ::diplomacy::tensorflow::LocalLinks& _internal_links() const; + public: + const ::diplomacy::tensorflow::LocalLinks& links() const; + ::diplomacy::tensorflow::LocalLinks* release_links(); + ::diplomacy::tensorflow::LocalLinks* mutable_links(); + void set_allocated_links(::diplomacy::tensorflow::LocalLinks* links); + void unsafe_arena_set_allocated_links( + ::diplomacy::tensorflow::LocalLinks* links); + ::diplomacy::tensorflow::LocalLinks* unsafe_arena_release_links(); + + // int32 bus_id = 1; + void clear_bus_id(); + static const int kBusIdFieldNumber = 1; + ::google::protobuf::int32 bus_id() const; + void set_bus_id(::google::protobuf::int32 value); + + // int32 numa_node = 2; + void clear_numa_node(); + static const int kNumaNodeFieldNumber = 2; + ::google::protobuf::int32 numa_node() const; + void set_numa_node(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.DeviceLocality) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::LocalLinks* links_; + ::google::protobuf::int32 bus_id_; + ::google::protobuf::int32 numa_node_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceAttributes : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.DeviceAttributes) */ { + public: + DeviceAttributes(); + virtual ~DeviceAttributes(); + + DeviceAttributes(const DeviceAttributes& from); + + inline DeviceAttributes& operator=(const DeviceAttributes& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceAttributes(DeviceAttributes&& from) noexcept + : DeviceAttributes() { + *this = ::std::move(from); + } + + inline DeviceAttributes& operator=(DeviceAttributes&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceAttributes& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceAttributes* internal_default_instance() { + return reinterpret_cast( + &_DeviceAttributes_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(DeviceAttributes* other); + void Swap(DeviceAttributes* other); + friend void swap(DeviceAttributes& a, DeviceAttributes& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceAttributes* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceAttributes* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceAttributes& from); + void MergeFrom(const DeviceAttributes& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceAttributes* other); + protected: + explicit DeviceAttributes(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string device_type = 2; + void clear_device_type(); + static const int kDeviceTypeFieldNumber = 2; + const ::std::string& device_type() const; + void set_device_type(const ::std::string& value); + #if LANG_CXX11 + void set_device_type(::std::string&& value); + #endif + void set_device_type(const char* value); + void set_device_type(const char* value, size_t size); + ::std::string* mutable_device_type(); + ::std::string* release_device_type(); + void set_allocated_device_type(::std::string* device_type); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_device_type(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_device_type( + ::std::string* device_type); + + // string physical_device_desc = 7; + void clear_physical_device_desc(); + static const int kPhysicalDeviceDescFieldNumber = 7; + const ::std::string& physical_device_desc() const; + void set_physical_device_desc(const ::std::string& value); + #if LANG_CXX11 + void set_physical_device_desc(::std::string&& value); + #endif + void set_physical_device_desc(const char* value); + void set_physical_device_desc(const char* value, size_t size); + ::std::string* mutable_physical_device_desc(); + ::std::string* release_physical_device_desc(); + void set_allocated_physical_device_desc(::std::string* physical_device_desc); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_physical_device_desc(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_physical_device_desc( + ::std::string* physical_device_desc); + + // .diplomacy.tensorflow.DeviceLocality locality = 5; + bool has_locality() const; + void clear_locality(); + static const int kLocalityFieldNumber = 5; + private: + const ::diplomacy::tensorflow::DeviceLocality& _internal_locality() const; + public: + const ::diplomacy::tensorflow::DeviceLocality& locality() const; + ::diplomacy::tensorflow::DeviceLocality* release_locality(); + ::diplomacy::tensorflow::DeviceLocality* mutable_locality(); + void set_allocated_locality(::diplomacy::tensorflow::DeviceLocality* locality); + void unsafe_arena_set_allocated_locality( + ::diplomacy::tensorflow::DeviceLocality* locality); + ::diplomacy::tensorflow::DeviceLocality* unsafe_arena_release_locality(); + + // int64 memory_limit = 4; + void clear_memory_limit(); + static const int kMemoryLimitFieldNumber = 4; + ::google::protobuf::int64 memory_limit() const; + void set_memory_limit(::google::protobuf::int64 value); + + // fixed64 incarnation = 6; + void clear_incarnation(); + static const int kIncarnationFieldNumber = 6; + ::google::protobuf::uint64 incarnation() const; + void set_incarnation(::google::protobuf::uint64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.DeviceAttributes) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr device_type_; + ::google::protobuf::internal::ArenaStringPtr physical_device_desc_; + ::diplomacy::tensorflow::DeviceLocality* locality_; + ::google::protobuf::int64 memory_limit_; + ::google::protobuf::uint64 incarnation_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// InterconnectLink + +// int32 device_id = 1; +inline void InterconnectLink::clear_device_id() { + device_id_ = 0; +} +inline ::google::protobuf::int32 InterconnectLink::device_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.InterconnectLink.device_id) + return device_id_; +} +inline void InterconnectLink::set_device_id(::google::protobuf::int32 value) { + + device_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.InterconnectLink.device_id) +} + +// string type = 2; +inline void InterconnectLink::clear_type() { + type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& InterconnectLink::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.InterconnectLink.type) + return type_.Get(); +} +inline void InterconnectLink::set_type(const ::std::string& value) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.InterconnectLink.type) +} +#if LANG_CXX11 +inline void InterconnectLink::set_type(::std::string&& value) { + + type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.InterconnectLink.type) +} +#endif +inline void InterconnectLink::set_type(const char* value) { + GOOGLE_DCHECK(value != NULL); + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.InterconnectLink.type) +} +inline void InterconnectLink::set_type(const char* value, + size_t size) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.InterconnectLink.type) +} +inline ::std::string* InterconnectLink::mutable_type() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.InterconnectLink.type) + return type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* InterconnectLink::release_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.InterconnectLink.type) + + return type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void InterconnectLink::set_allocated_type(::std::string* type) { + if (type != NULL) { + + } else { + + } + type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.InterconnectLink.type) +} +inline ::std::string* InterconnectLink::unsafe_arena_release_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.InterconnectLink.type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void InterconnectLink::unsafe_arena_set_allocated_type( + ::std::string* type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type != NULL) { + + } else { + + } + type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.InterconnectLink.type) +} + +// int32 strength = 3; +inline void InterconnectLink::clear_strength() { + strength_ = 0; +} +inline ::google::protobuf::int32 InterconnectLink::strength() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.InterconnectLink.strength) + return strength_; +} +inline void InterconnectLink::set_strength(::google::protobuf::int32 value) { + + strength_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.InterconnectLink.strength) +} + +// ------------------------------------------------------------------- + +// LocalLinks + +// repeated .diplomacy.tensorflow.InterconnectLink link = 1; +inline int LocalLinks::link_size() const { + return link_.size(); +} +inline void LocalLinks::clear_link() { + link_.Clear(); +} +inline ::diplomacy::tensorflow::InterconnectLink* LocalLinks::mutable_link(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.LocalLinks.link) + return link_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::InterconnectLink >* +LocalLinks::mutable_link() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.LocalLinks.link) + return &link_; +} +inline const ::diplomacy::tensorflow::InterconnectLink& LocalLinks::link(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.LocalLinks.link) + return link_.Get(index); +} +inline ::diplomacy::tensorflow::InterconnectLink* LocalLinks::add_link() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.LocalLinks.link) + return link_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::InterconnectLink >& +LocalLinks::link() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.LocalLinks.link) + return link_; +} + +// ------------------------------------------------------------------- + +// DeviceLocality + +// int32 bus_id = 1; +inline void DeviceLocality::clear_bus_id() { + bus_id_ = 0; +} +inline ::google::protobuf::int32 DeviceLocality::bus_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceLocality.bus_id) + return bus_id_; +} +inline void DeviceLocality::set_bus_id(::google::protobuf::int32 value) { + + bus_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceLocality.bus_id) +} + +// int32 numa_node = 2; +inline void DeviceLocality::clear_numa_node() { + numa_node_ = 0; +} +inline ::google::protobuf::int32 DeviceLocality::numa_node() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceLocality.numa_node) + return numa_node_; +} +inline void DeviceLocality::set_numa_node(::google::protobuf::int32 value) { + + numa_node_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceLocality.numa_node) +} + +// .diplomacy.tensorflow.LocalLinks links = 3; +inline bool DeviceLocality::has_links() const { + return this != internal_default_instance() && links_ != NULL; +} +inline void DeviceLocality::clear_links() { + if (GetArenaNoVirtual() == NULL && links_ != NULL) { + delete links_; + } + links_ = NULL; +} +inline const ::diplomacy::tensorflow::LocalLinks& DeviceLocality::_internal_links() const { + return *links_; +} +inline const ::diplomacy::tensorflow::LocalLinks& DeviceLocality::links() const { + const ::diplomacy::tensorflow::LocalLinks* p = links_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceLocality.links) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_LocalLinks_default_instance_); +} +inline ::diplomacy::tensorflow::LocalLinks* DeviceLocality::release_links() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.DeviceLocality.links) + + ::diplomacy::tensorflow::LocalLinks* temp = links_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + links_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::LocalLinks* DeviceLocality::unsafe_arena_release_links() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.DeviceLocality.links) + + ::diplomacy::tensorflow::LocalLinks* temp = links_; + links_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::LocalLinks* DeviceLocality::mutable_links() { + + if (links_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::LocalLinks>(GetArenaNoVirtual()); + links_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.DeviceLocality.links) + return links_; +} +inline void DeviceLocality::set_allocated_links(::diplomacy::tensorflow::LocalLinks* links) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete links_; + } + if (links) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(links); + if (message_arena != submessage_arena) { + links = ::google::protobuf::internal::GetOwnedMessage( + message_arena, links, submessage_arena); + } + + } else { + + } + links_ = links; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.DeviceLocality.links) +} + +// ------------------------------------------------------------------- + +// DeviceAttributes + +// string name = 1; +inline void DeviceAttributes::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& DeviceAttributes::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceAttributes.name) + return name_.Get(); +} +inline void DeviceAttributes::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceAttributes.name) +} +#if LANG_CXX11 +inline void DeviceAttributes::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.DeviceAttributes.name) +} +#endif +inline void DeviceAttributes::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.DeviceAttributes.name) +} +inline void DeviceAttributes::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.DeviceAttributes.name) +} +inline ::std::string* DeviceAttributes::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.DeviceAttributes.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* DeviceAttributes::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.DeviceAttributes.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void DeviceAttributes::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.DeviceAttributes.name) +} +inline ::std::string* DeviceAttributes::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.DeviceAttributes.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void DeviceAttributes::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.DeviceAttributes.name) +} + +// string device_type = 2; +inline void DeviceAttributes::clear_device_type() { + device_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& DeviceAttributes::device_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceAttributes.device_type) + return device_type_.Get(); +} +inline void DeviceAttributes::set_device_type(const ::std::string& value) { + + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceAttributes.device_type) +} +#if LANG_CXX11 +inline void DeviceAttributes::set_device_type(::std::string&& value) { + + device_type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.DeviceAttributes.device_type) +} +#endif +inline void DeviceAttributes::set_device_type(const char* value) { + GOOGLE_DCHECK(value != NULL); + + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.DeviceAttributes.device_type) +} +inline void DeviceAttributes::set_device_type(const char* value, + size_t size) { + + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.DeviceAttributes.device_type) +} +inline ::std::string* DeviceAttributes::mutable_device_type() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.DeviceAttributes.device_type) + return device_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* DeviceAttributes::release_device_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.DeviceAttributes.device_type) + + return device_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void DeviceAttributes::set_allocated_device_type(::std::string* device_type) { + if (device_type != NULL) { + + } else { + + } + device_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device_type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.DeviceAttributes.device_type) +} +inline ::std::string* DeviceAttributes::unsafe_arena_release_device_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.DeviceAttributes.device_type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void DeviceAttributes::unsafe_arena_set_allocated_device_type( + ::std::string* device_type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device_type != NULL) { + + } else { + + } + device_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device_type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.DeviceAttributes.device_type) +} + +// int64 memory_limit = 4; +inline void DeviceAttributes::clear_memory_limit() { + memory_limit_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 DeviceAttributes::memory_limit() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceAttributes.memory_limit) + return memory_limit_; +} +inline void DeviceAttributes::set_memory_limit(::google::protobuf::int64 value) { + + memory_limit_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceAttributes.memory_limit) +} + +// .diplomacy.tensorflow.DeviceLocality locality = 5; +inline bool DeviceAttributes::has_locality() const { + return this != internal_default_instance() && locality_ != NULL; +} +inline void DeviceAttributes::clear_locality() { + if (GetArenaNoVirtual() == NULL && locality_ != NULL) { + delete locality_; + } + locality_ = NULL; +} +inline const ::diplomacy::tensorflow::DeviceLocality& DeviceAttributes::_internal_locality() const { + return *locality_; +} +inline const ::diplomacy::tensorflow::DeviceLocality& DeviceAttributes::locality() const { + const ::diplomacy::tensorflow::DeviceLocality* p = locality_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceAttributes.locality) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_DeviceLocality_default_instance_); +} +inline ::diplomacy::tensorflow::DeviceLocality* DeviceAttributes::release_locality() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.DeviceAttributes.locality) + + ::diplomacy::tensorflow::DeviceLocality* temp = locality_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + locality_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::DeviceLocality* DeviceAttributes::unsafe_arena_release_locality() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.DeviceAttributes.locality) + + ::diplomacy::tensorflow::DeviceLocality* temp = locality_; + locality_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::DeviceLocality* DeviceAttributes::mutable_locality() { + + if (locality_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::DeviceLocality>(GetArenaNoVirtual()); + locality_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.DeviceAttributes.locality) + return locality_; +} +inline void DeviceAttributes::set_allocated_locality(::diplomacy::tensorflow::DeviceLocality* locality) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete locality_; + } + if (locality) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(locality); + if (message_arena != submessage_arena) { + locality = ::google::protobuf::internal::GetOwnedMessage( + message_arena, locality, submessage_arena); + } + + } else { + + } + locality_ = locality; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.DeviceAttributes.locality) +} + +// fixed64 incarnation = 6; +inline void DeviceAttributes::clear_incarnation() { + incarnation_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 DeviceAttributes::incarnation() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceAttributes.incarnation) + return incarnation_; +} +inline void DeviceAttributes::set_incarnation(::google::protobuf::uint64 value) { + + incarnation_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceAttributes.incarnation) +} + +// string physical_device_desc = 7; +inline void DeviceAttributes::clear_physical_device_desc() { + physical_device_desc_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& DeviceAttributes::physical_device_desc() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) + return physical_device_desc_.Get(); +} +inline void DeviceAttributes::set_physical_device_desc(const ::std::string& value) { + + physical_device_desc_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) +} +#if LANG_CXX11 +inline void DeviceAttributes::set_physical_device_desc(::std::string&& value) { + + physical_device_desc_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) +} +#endif +inline void DeviceAttributes::set_physical_device_desc(const char* value) { + GOOGLE_DCHECK(value != NULL); + + physical_device_desc_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) +} +inline void DeviceAttributes::set_physical_device_desc(const char* value, + size_t size) { + + physical_device_desc_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) +} +inline ::std::string* DeviceAttributes::mutable_physical_device_desc() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) + return physical_device_desc_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* DeviceAttributes::release_physical_device_desc() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) + + return physical_device_desc_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void DeviceAttributes::set_allocated_physical_device_desc(::std::string* physical_device_desc) { + if (physical_device_desc != NULL) { + + } else { + + } + physical_device_desc_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), physical_device_desc, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) +} +inline ::std::string* DeviceAttributes::unsafe_arena_release_physical_device_desc() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return physical_device_desc_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void DeviceAttributes::unsafe_arena_set_allocated_physical_device_desc( + ::std::string* physical_device_desc) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (physical_device_desc != NULL) { + + } else { + + } + physical_device_desc_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + physical_device_desc, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.DeviceAttributes.physical_device_desc) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.proto new file mode 100644 index 0000000..8f2023c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "DeviceAttributesProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +message InterconnectLink { + int32 device_id = 1; + string type = 2; + int32 strength = 3; +}; + +message LocalLinks { + repeated InterconnectLink link = 1; +}; + +message DeviceLocality { + // Optional bus locality of device. Default value of 0 means + // no specific locality. Specific localities are indexed from 1. + int32 bus_id = 1; + + // Optional NUMA locality of device. + int32 numa_node = 2; + + // Optional local interconnect links to other devices. + LocalLinks links = 3; +}; + +message DeviceAttributes { + // Fully specified name of the device within a cluster. + string name = 1; + + // String representation of device_type. + string device_type = 2; + + // Memory capacity of device in bytes. + int64 memory_limit = 4; + + // Platform-specific data about device that may be useful + // for supporting efficient data transfers. + DeviceLocality locality = 5; + + // A device is assigned a global unique number each time it is + // initialized. "incarnation" should never be 0. + fixed64 incarnation = 6; + + // String representation of the physical device that this device maps to. + string physical_device_desc = 7; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes_pb2.py new file mode 100644 index 0000000..11b29b5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/device_attributes_pb2.py @@ -0,0 +1,253 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/device_attributes.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/device_attributes.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\026DeviceAttributesProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n;diplomacy_tensorflow/core/framework/device_attributes.proto\x12\x14\x64iplomacy.tensorflow\"E\n\x10InterconnectLink\x12\x11\n\tdevice_id\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08strength\x18\x03 \x01(\x05\"B\n\nLocalLinks\x12\x34\n\x04link\x18\x01 \x03(\x0b\x32&.diplomacy.tensorflow.InterconnectLink\"d\n\x0e\x44\x65viceLocality\x12\x0e\n\x06\x62us_id\x18\x01 \x01(\x05\x12\x11\n\tnuma_node\x18\x02 \x01(\x05\x12/\n\x05links\x18\x03 \x01(\x0b\x32 .diplomacy.tensorflow.LocalLinks\"\xb6\x01\n\x10\x44\x65viceAttributes\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12\x14\n\x0cmemory_limit\x18\x04 \x01(\x03\x12\x36\n\x08locality\x18\x05 \x01(\x0b\x32$.diplomacy.tensorflow.DeviceLocality\x12\x13\n\x0bincarnation\x18\x06 \x01(\x06\x12\x1c\n\x14physical_device_desc\x18\x07 \x01(\tBv\n\x18org.tensorflow.frameworkB\x16\x44\x65viceAttributesProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_INTERCONNECTLINK = _descriptor.Descriptor( + name='InterconnectLink', + full_name='diplomacy.tensorflow.InterconnectLink', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device_id', full_name='diplomacy.tensorflow.InterconnectLink.device_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.InterconnectLink.type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='strength', full_name='diplomacy.tensorflow.InterconnectLink.strength', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=85, + serialized_end=154, +) + + +_LOCALLINKS = _descriptor.Descriptor( + name='LocalLinks', + full_name='diplomacy.tensorflow.LocalLinks', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='link', full_name='diplomacy.tensorflow.LocalLinks.link', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=156, + serialized_end=222, +) + + +_DEVICELOCALITY = _descriptor.Descriptor( + name='DeviceLocality', + full_name='diplomacy.tensorflow.DeviceLocality', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='bus_id', full_name='diplomacy.tensorflow.DeviceLocality.bus_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='numa_node', full_name='diplomacy.tensorflow.DeviceLocality.numa_node', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='links', full_name='diplomacy.tensorflow.DeviceLocality.links', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=224, + serialized_end=324, +) + + +_DEVICEATTRIBUTES = _descriptor.Descriptor( + name='DeviceAttributes', + full_name='diplomacy.tensorflow.DeviceAttributes', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.DeviceAttributes.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_type', full_name='diplomacy.tensorflow.DeviceAttributes.device_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='memory_limit', full_name='diplomacy.tensorflow.DeviceAttributes.memory_limit', index=2, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='locality', full_name='diplomacy.tensorflow.DeviceAttributes.locality', index=3, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='incarnation', full_name='diplomacy.tensorflow.DeviceAttributes.incarnation', index=4, + number=6, type=6, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='physical_device_desc', full_name='diplomacy.tensorflow.DeviceAttributes.physical_device_desc', index=5, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=327, + serialized_end=509, +) + +_LOCALLINKS.fields_by_name['link'].message_type = _INTERCONNECTLINK +_DEVICELOCALITY.fields_by_name['links'].message_type = _LOCALLINKS +_DEVICEATTRIBUTES.fields_by_name['locality'].message_type = _DEVICELOCALITY +DESCRIPTOR.message_types_by_name['InterconnectLink'] = _INTERCONNECTLINK +DESCRIPTOR.message_types_by_name['LocalLinks'] = _LOCALLINKS +DESCRIPTOR.message_types_by_name['DeviceLocality'] = _DEVICELOCALITY +DESCRIPTOR.message_types_by_name['DeviceAttributes'] = _DEVICEATTRIBUTES +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +InterconnectLink = _reflection.GeneratedProtocolMessageType('InterconnectLink', (_message.Message,), dict( + DESCRIPTOR = _INTERCONNECTLINK, + __module__ = 'diplomacy_tensorflow.core.framework.device_attributes_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.InterconnectLink) + )) +_sym_db.RegisterMessage(InterconnectLink) + +LocalLinks = _reflection.GeneratedProtocolMessageType('LocalLinks', (_message.Message,), dict( + DESCRIPTOR = _LOCALLINKS, + __module__ = 'diplomacy_tensorflow.core.framework.device_attributes_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.LocalLinks) + )) +_sym_db.RegisterMessage(LocalLinks) + +DeviceLocality = _reflection.GeneratedProtocolMessageType('DeviceLocality', (_message.Message,), dict( + DESCRIPTOR = _DEVICELOCALITY, + __module__ = 'diplomacy_tensorflow.core.framework.device_attributes_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.DeviceLocality) + )) +_sym_db.RegisterMessage(DeviceLocality) + +DeviceAttributes = _reflection.GeneratedProtocolMessageType('DeviceAttributes', (_message.Message,), dict( + DESCRIPTOR = _DEVICEATTRIBUTES, + __module__ = 'diplomacy_tensorflow.core.framework.device_attributes_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.DeviceAttributes) + )) +_sym_db.RegisterMessage(DeviceAttributes) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.pb.cc new file mode 100644 index 0000000..ef4ebb9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.pb.cc @@ -0,0 +1,1645 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/function.proto + +#include "diplomacy_tensorflow/core/framework/function.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FunctionDef_RetEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GradientDef; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_FunctionDef_AttrEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_FunctionDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_NodeDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_OpDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class FunctionDefLibraryDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FunctionDefLibrary_default_instance_; +class FunctionDef_AttrEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FunctionDef_AttrEntry_DoNotUse_default_instance_; +class FunctionDef_RetEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FunctionDef_RetEntry_DoNotUse_default_instance_; +class FunctionDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _FunctionDef_default_instance_; +class GradientDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GradientDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto { +static void InitDefaultsFunctionDefLibrary() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FunctionDefLibrary_default_instance_; + new (ptr) ::diplomacy::tensorflow::FunctionDefLibrary(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::FunctionDefLibrary::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_FunctionDefLibrary = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFunctionDefLibrary}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_GradientDef.base,}}; + +static void InitDefaultsFunctionDef_AttrEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FunctionDef_AttrEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse(); + } + ::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_FunctionDef_AttrEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFunctionDef_AttrEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base,}}; + +static void InitDefaultsFunctionDef_RetEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FunctionDef_RetEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse(); + } + ::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_FunctionDef_RetEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFunctionDef_RetEntry_DoNotUse}, {}}; + +static void InitDefaultsFunctionDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_FunctionDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::FunctionDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::FunctionDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_FunctionDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsFunctionDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDef_AttrEntry_DoNotUse.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDef_RetEntry_DoNotUse.base,}}; + +static void InitDefaultsGradientDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GradientDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::GradientDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GradientDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GradientDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGradientDef}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_FunctionDefLibrary.base); + ::google::protobuf::internal::InitSCC(&scc_info_FunctionDef_AttrEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_FunctionDef_RetEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_FunctionDef.base); + ::google::protobuf::internal::InitSCC(&scc_info_GradientDef.base); +} + +::google::protobuf::Metadata file_level_metadata[5]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDefLibrary, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDefLibrary, function_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDefLibrary, gradient_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse, value_), + 0, + 1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef, signature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef, attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef, node_def_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::FunctionDef, ret_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GradientDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GradientDef, function_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GradientDef, gradient_func_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::FunctionDefLibrary)}, + { 7, 14, sizeof(::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse)}, + { 16, 23, sizeof(::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse)}, + { 25, -1, sizeof(::diplomacy::tensorflow::FunctionDef)}, + { 34, -1, sizeof(::diplomacy::tensorflow::GradientDef)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_FunctionDefLibrary_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FunctionDef_AttrEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FunctionDef_RetEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_FunctionDef_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GradientDef_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/function.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n2diplomacy_tensorflow/core/framework/fu" + "nction.proto\022\024diplomacy.tensorflow\0324dipl" + "omacy_tensorflow/core/framework/attr_val" + "ue.proto\0322diplomacy_tensorflow/core/fram" + "ework/node_def.proto\0320diplomacy_tensorfl" + "ow/core/framework/op_def.proto\"~\n\022Functi" + "onDefLibrary\0223\n\010function\030\001 \003(\0132!.diploma" + "cy.tensorflow.FunctionDef\0223\n\010gradient\030\002 " + "\003(\0132!.diplomacy.tensorflow.GradientDef\"\342" + "\002\n\013FunctionDef\022.\n\tsignature\030\001 \001(\0132\033.dipl" + "omacy.tensorflow.OpDef\0229\n\004attr\030\005 \003(\0132+.d" + "iplomacy.tensorflow.FunctionDef.AttrEntr" + "y\022/\n\010node_def\030\003 \003(\0132\035.diplomacy.tensorfl" + "ow.NodeDef\0227\n\003ret\030\004 \003(\0132*.diplomacy.tens" + "orflow.FunctionDef.RetEntry\032L\n\tAttrEntry" + "\022\013\n\003key\030\001 \001(\t\022.\n\005value\030\002 \001(\0132\037.diplomacy" + ".tensorflow.AttrValue:\0028\001\032*\n\010RetEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001J\004\010\002\020\003\";\n\013G" + "radientDef\022\025\n\rfunction_name\030\001 \001(\t\022\025\n\rgra" + "dient_func\030\002 \001(\tBn\n\030org.tensorflow.frame" + "workB\016FunctionProtosP\001Z=github.com/tenso" + "rflow/tensorflow/tensorflow/go/core/fram" + "ework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 896); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/function.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void FunctionDefLibrary::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FunctionDefLibrary::kFunctionFieldNumber; +const int FunctionDefLibrary::kGradientFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FunctionDefLibrary::FunctionDefLibrary() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDefLibrary.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.FunctionDefLibrary) +} +FunctionDefLibrary::FunctionDefLibrary(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + function_(arena), + gradient_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDefLibrary.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.FunctionDefLibrary) +} +FunctionDefLibrary::FunctionDefLibrary(const FunctionDefLibrary& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + function_(from.function_), + gradient_(from.gradient_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.FunctionDefLibrary) +} + +void FunctionDefLibrary::SharedCtor() { +} + +FunctionDefLibrary::~FunctionDefLibrary() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.FunctionDefLibrary) + SharedDtor(); +} + +void FunctionDefLibrary::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void FunctionDefLibrary::ArenaDtor(void* object) { + FunctionDefLibrary* _this = reinterpret_cast< FunctionDefLibrary* >(object); + (void)_this; +} +void FunctionDefLibrary::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FunctionDefLibrary::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FunctionDefLibrary::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FunctionDefLibrary& FunctionDefLibrary::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDefLibrary.base); + return *internal_default_instance(); +} + + +void FunctionDefLibrary::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.FunctionDefLibrary) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + function_.Clear(); + gradient_.Clear(); + _internal_metadata_.Clear(); +} + +bool FunctionDefLibrary::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.FunctionDefLibrary) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.FunctionDef function = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_function())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.GradientDef gradient = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_gradient())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.FunctionDefLibrary) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.FunctionDefLibrary) + return false; +#undef DO_ +} + +void FunctionDefLibrary::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.FunctionDefLibrary) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.FunctionDef function = 1; + for (unsigned int i = 0, + n = static_cast(this->function_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->function(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.GradientDef gradient = 2; + for (unsigned int i = 0, + n = static_cast(this->gradient_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->gradient(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.FunctionDefLibrary) +} + +::google::protobuf::uint8* FunctionDefLibrary::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.FunctionDefLibrary) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.FunctionDef function = 1; + for (unsigned int i = 0, + n = static_cast(this->function_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->function(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.GradientDef gradient = 2; + for (unsigned int i = 0, + n = static_cast(this->gradient_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->gradient(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.FunctionDefLibrary) + return target; +} + +size_t FunctionDefLibrary::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.FunctionDefLibrary) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.FunctionDef function = 1; + { + unsigned int count = static_cast(this->function_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->function(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.GradientDef gradient = 2; + { + unsigned int count = static_cast(this->gradient_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->gradient(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FunctionDefLibrary::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.FunctionDefLibrary) + GOOGLE_DCHECK_NE(&from, this); + const FunctionDefLibrary* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.FunctionDefLibrary) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.FunctionDefLibrary) + MergeFrom(*source); + } +} + +void FunctionDefLibrary::MergeFrom(const FunctionDefLibrary& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.FunctionDefLibrary) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + function_.MergeFrom(from.function_); + gradient_.MergeFrom(from.gradient_); +} + +void FunctionDefLibrary::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.FunctionDefLibrary) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FunctionDefLibrary::CopyFrom(const FunctionDefLibrary& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.FunctionDefLibrary) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FunctionDefLibrary::IsInitialized() const { + return true; +} + +void FunctionDefLibrary::Swap(FunctionDefLibrary* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FunctionDefLibrary* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FunctionDefLibrary::UnsafeArenaSwap(FunctionDefLibrary* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FunctionDefLibrary::InternalSwap(FunctionDefLibrary* other) { + using std::swap; + CastToBase(&function_)->InternalSwap(CastToBase(&other->function_)); + CastToBase(&gradient_)->InternalSwap(CastToBase(&other->gradient_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FunctionDefLibrary::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +FunctionDef_AttrEntry_DoNotUse::FunctionDef_AttrEntry_DoNotUse() {} +FunctionDef_AttrEntry_DoNotUse::FunctionDef_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void FunctionDef_AttrEntry_DoNotUse::MergeFrom(const FunctionDef_AttrEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata FunctionDef_AttrEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[1]; +} +void FunctionDef_AttrEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +FunctionDef_RetEntry_DoNotUse::FunctionDef_RetEntry_DoNotUse() {} +FunctionDef_RetEntry_DoNotUse::FunctionDef_RetEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void FunctionDef_RetEntry_DoNotUse::MergeFrom(const FunctionDef_RetEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata FunctionDef_RetEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[2]; +} +void FunctionDef_RetEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void FunctionDef::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_FunctionDef_default_instance_._instance.get_mutable()->signature_ = const_cast< ::diplomacy::tensorflow::OpDef*>( + ::diplomacy::tensorflow::OpDef::internal_default_instance()); +} +void FunctionDef::unsafe_arena_set_allocated_signature( + ::diplomacy::tensorflow::OpDef* signature) { + if (GetArenaNoVirtual() == NULL) { + delete signature_; + } + signature_ = signature; + if (signature) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.FunctionDef.signature) +} +void FunctionDef::clear_signature() { + if (GetArenaNoVirtual() == NULL && signature_ != NULL) { + delete signature_; + } + signature_ = NULL; +} +void FunctionDef::clear_attr() { + attr_.Clear(); +} +void FunctionDef::clear_node_def() { + node_def_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FunctionDef::kSignatureFieldNumber; +const int FunctionDef::kAttrFieldNumber; +const int FunctionDef::kNodeDefFieldNumber; +const int FunctionDef::kRetFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FunctionDef::FunctionDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.FunctionDef) +} +FunctionDef::FunctionDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_def_(arena), + ret_(arena), + attr_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.FunctionDef) +} +FunctionDef::FunctionDef(const FunctionDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + node_def_(from.node_def_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ret_.MergeFrom(from.ret_); + attr_.MergeFrom(from.attr_); + if (from.has_signature()) { + signature_ = new ::diplomacy::tensorflow::OpDef(*from.signature_); + } else { + signature_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.FunctionDef) +} + +void FunctionDef::SharedCtor() { + signature_ = NULL; +} + +FunctionDef::~FunctionDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.FunctionDef) + SharedDtor(); +} + +void FunctionDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete signature_; +} + +void FunctionDef::ArenaDtor(void* object) { + FunctionDef* _this = reinterpret_cast< FunctionDef* >(object); + (void)_this; +} +void FunctionDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FunctionDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* FunctionDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const FunctionDef& FunctionDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDef.base); + return *internal_default_instance(); +} + + +void FunctionDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.FunctionDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_def_.Clear(); + ret_.Clear(); + attr_.Clear(); + if (GetArenaNoVirtual() == NULL && signature_ != NULL) { + delete signature_; + } + signature_ = NULL; + _internal_metadata_.Clear(); +} + +bool FunctionDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.FunctionDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.OpDef signature = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_signature())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.NodeDef node_def = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node_def())); + } else { + goto handle_unusual; + } + break; + } + + // map ret = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + FunctionDef_RetEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + FunctionDef_RetEntry_DoNotUse, + ::std::string, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::google::protobuf::Map< ::std::string, ::std::string > > parser(&ret_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.FunctionDef.RetEntry.key")); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.value().data(), static_cast(parser.value().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.FunctionDef.RetEntry.value")); + } else { + goto handle_unusual; + } + break; + } + + // map attr = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + FunctionDef_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + FunctionDef_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue > > parser(&attr_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.FunctionDef.AttrEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.FunctionDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.FunctionDef) + return false; +#undef DO_ +} + +void FunctionDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.FunctionDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.OpDef signature = 1; + if (this->has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_signature(), output); + } + + // repeated .diplomacy.tensorflow.NodeDef node_def = 3; + for (unsigned int i = 0, + n = static_cast(this->node_def_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->node_def(static_cast(i)), + output); + } + + // map ret = 4; + if (!this->ret().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FunctionDef.RetEntry.key"); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FunctionDef.RetEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->ret().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->ret().size()]); + typedef ::google::protobuf::Map< ::std::string, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->ret().begin(); + it != this->ret().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(ret_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->ret().begin(); + it != this->ret().end(); ++it) { + entry.reset(ret_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FunctionDef.AttrEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.FunctionDef) +} + +::google::protobuf::uint8* FunctionDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.FunctionDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.OpDef signature = 1; + if (this->has_signature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_signature(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.NodeDef node_def = 3; + for (unsigned int i = 0, + n = static_cast(this->node_def_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->node_def(static_cast(i)), deterministic, target); + } + + // map ret = 4; + if (!this->ret().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FunctionDef.RetEntry.key"); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->second.data(), static_cast(p->second.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FunctionDef.RetEntry.value"); + } + }; + + if (deterministic && + this->ret().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->ret().size()]); + typedef ::google::protobuf::Map< ::std::string, ::std::string >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->ret().begin(); + it != this->ret().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(ret_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->ret().begin(); + it != this->ret().end(); ++it) { + entry.reset(ret_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.FunctionDef.AttrEntry.key"); + } + }; + + if (deterministic && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.FunctionDef) + return target; +} + +size_t FunctionDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.FunctionDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.NodeDef node_def = 3; + { + unsigned int count = static_cast(this->node_def_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node_def(static_cast(i))); + } + } + + // map ret = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->ret_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::std::string >::const_iterator + it = this->ret().begin(); + it != this->ret().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(ret_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // map attr = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->attr_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(attr_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // .diplomacy.tensorflow.OpDef signature = 1; + if (this->has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *signature_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void FunctionDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.FunctionDef) + GOOGLE_DCHECK_NE(&from, this); + const FunctionDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.FunctionDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.FunctionDef) + MergeFrom(*source); + } +} + +void FunctionDef::MergeFrom(const FunctionDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.FunctionDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + node_def_.MergeFrom(from.node_def_); + ret_.MergeFrom(from.ret_); + attr_.MergeFrom(from.attr_); + if (from.has_signature()) { + mutable_signature()->::diplomacy::tensorflow::OpDef::MergeFrom(from.signature()); + } +} + +void FunctionDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.FunctionDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FunctionDef::CopyFrom(const FunctionDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.FunctionDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FunctionDef::IsInitialized() const { + return true; +} + +void FunctionDef::Swap(FunctionDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FunctionDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void FunctionDef::UnsafeArenaSwap(FunctionDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FunctionDef::InternalSwap(FunctionDef* other) { + using std::swap; + CastToBase(&node_def_)->InternalSwap(CastToBase(&other->node_def_)); + ret_.Swap(&other->ret_); + attr_.Swap(&other->attr_); + swap(signature_, other->signature_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata FunctionDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GradientDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GradientDef::kFunctionNameFieldNumber; +const int GradientDef::kGradientFuncFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GradientDef::GradientDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_GradientDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GradientDef) +} +GradientDef::GradientDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_GradientDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GradientDef) +} +GradientDef::GradientDef(const GradientDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + function_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.function_name().size() > 0) { + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.function_name(), + GetArenaNoVirtual()); + } + gradient_func_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.gradient_func().size() > 0) { + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.gradient_func(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GradientDef) +} + +void GradientDef::SharedCtor() { + function_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + gradient_func_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +GradientDef::~GradientDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GradientDef) + SharedDtor(); +} + +void GradientDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + function_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + gradient_func_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void GradientDef::ArenaDtor(void* object) { + GradientDef* _this = reinterpret_cast< GradientDef* >(object); + (void)_this; +} +void GradientDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GradientDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GradientDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GradientDef& GradientDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_GradientDef.base); + return *internal_default_instance(); +} + + +void GradientDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GradientDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool GradientDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GradientDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string function_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_function_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->function_name().data(), static_cast(this->function_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GradientDef.function_name")); + } else { + goto handle_unusual; + } + break; + } + + // string gradient_func = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_gradient_func())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->gradient_func().data(), static_cast(this->gradient_func().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GradientDef.gradient_func")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GradientDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GradientDef) + return false; +#undef DO_ +} + +void GradientDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GradientDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string function_name = 1; + if (this->function_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->function_name().data(), static_cast(this->function_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GradientDef.function_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->function_name(), output); + } + + // string gradient_func = 2; + if (this->gradient_func().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->gradient_func().data(), static_cast(this->gradient_func().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GradientDef.gradient_func"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->gradient_func(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GradientDef) +} + +::google::protobuf::uint8* GradientDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GradientDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string function_name = 1; + if (this->function_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->function_name().data(), static_cast(this->function_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GradientDef.function_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->function_name(), target); + } + + // string gradient_func = 2; + if (this->gradient_func().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->gradient_func().data(), static_cast(this->gradient_func().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GradientDef.gradient_func"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->gradient_func(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GradientDef) + return target; +} + +size_t GradientDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GradientDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string function_name = 1; + if (this->function_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->function_name()); + } + + // string gradient_func = 2; + if (this->gradient_func().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->gradient_func()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GradientDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GradientDef) + GOOGLE_DCHECK_NE(&from, this); + const GradientDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GradientDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GradientDef) + MergeFrom(*source); + } +} + +void GradientDef::MergeFrom(const GradientDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GradientDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.function_name().size() > 0) { + set_function_name(from.function_name()); + } + if (from.gradient_func().size() > 0) { + set_gradient_func(from.gradient_func()); + } +} + +void GradientDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GradientDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GradientDef::CopyFrom(const GradientDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GradientDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GradientDef::IsInitialized() const { + return true; +} + +void GradientDef::Swap(GradientDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GradientDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GradientDef::UnsafeArenaSwap(GradientDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GradientDef::InternalSwap(GradientDef* other) { + using std::swap; + function_name_.Swap(&other->function_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + gradient_func_.Swap(&other->gradient_func_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GradientDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FunctionDefLibrary* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FunctionDefLibrary >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FunctionDefLibrary >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::FunctionDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FunctionDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::FunctionDef >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GradientDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GradientDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GradientDef >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.pb.h new file mode 100644 index 0000000..7743d69 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.pb.h @@ -0,0 +1,965 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/function.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_tensorflow/core/framework/attr_value.pb.h" +#include "diplomacy_tensorflow/core/framework/node_def.pb.h" +#include "diplomacy_tensorflow/core/framework/op_def.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[5]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto +namespace diplomacy { +namespace tensorflow { +class FunctionDef; +class FunctionDefDefaultTypeInternal; +extern FunctionDefDefaultTypeInternal _FunctionDef_default_instance_; +class FunctionDefLibrary; +class FunctionDefLibraryDefaultTypeInternal; +extern FunctionDefLibraryDefaultTypeInternal _FunctionDefLibrary_default_instance_; +class FunctionDef_AttrEntry_DoNotUse; +class FunctionDef_AttrEntry_DoNotUseDefaultTypeInternal; +extern FunctionDef_AttrEntry_DoNotUseDefaultTypeInternal _FunctionDef_AttrEntry_DoNotUse_default_instance_; +class FunctionDef_RetEntry_DoNotUse; +class FunctionDef_RetEntry_DoNotUseDefaultTypeInternal; +extern FunctionDef_RetEntry_DoNotUseDefaultTypeInternal _FunctionDef_RetEntry_DoNotUse_default_instance_; +class GradientDef; +class GradientDefDefaultTypeInternal; +extern GradientDefDefaultTypeInternal _GradientDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::FunctionDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FunctionDef>(Arena*); +template<> ::diplomacy::tensorflow::FunctionDefLibrary* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FunctionDefLibrary>(Arena*); +template<> ::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FunctionDef_AttrEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::FunctionDef_RetEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::GradientDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GradientDef>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class FunctionDefLibrary : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.FunctionDefLibrary) */ { + public: + FunctionDefLibrary(); + virtual ~FunctionDefLibrary(); + + FunctionDefLibrary(const FunctionDefLibrary& from); + + inline FunctionDefLibrary& operator=(const FunctionDefLibrary& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FunctionDefLibrary(FunctionDefLibrary&& from) noexcept + : FunctionDefLibrary() { + *this = ::std::move(from); + } + + inline FunctionDefLibrary& operator=(FunctionDefLibrary&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FunctionDefLibrary& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FunctionDefLibrary* internal_default_instance() { + return reinterpret_cast( + &_FunctionDefLibrary_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(FunctionDefLibrary* other); + void Swap(FunctionDefLibrary* other); + friend void swap(FunctionDefLibrary& a, FunctionDefLibrary& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FunctionDefLibrary* New() const final { + return CreateMaybeMessage(NULL); + } + + FunctionDefLibrary* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FunctionDefLibrary& from); + void MergeFrom(const FunctionDefLibrary& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FunctionDefLibrary* other); + protected: + explicit FunctionDefLibrary(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.FunctionDef function = 1; + int function_size() const; + void clear_function(); + static const int kFunctionFieldNumber = 1; + ::diplomacy::tensorflow::FunctionDef* mutable_function(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::FunctionDef >* + mutable_function(); + const ::diplomacy::tensorflow::FunctionDef& function(int index) const; + ::diplomacy::tensorflow::FunctionDef* add_function(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::FunctionDef >& + function() const; + + // repeated .diplomacy.tensorflow.GradientDef gradient = 2; + int gradient_size() const; + void clear_gradient(); + static const int kGradientFieldNumber = 2; + ::diplomacy::tensorflow::GradientDef* mutable_gradient(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GradientDef >* + mutable_gradient(); + const ::diplomacy::tensorflow::GradientDef& gradient(int index) const; + ::diplomacy::tensorflow::GradientDef* add_gradient(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GradientDef >& + gradient() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FunctionDefLibrary) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::FunctionDef > function_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GradientDef > gradient_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class FunctionDef_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + FunctionDef_AttrEntry_DoNotUse(); + FunctionDef_AttrEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const FunctionDef_AttrEntry_DoNotUse& other); + static const FunctionDef_AttrEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_FunctionDef_AttrEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class FunctionDef_RetEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + FunctionDef_RetEntry_DoNotUse(); + FunctionDef_RetEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const FunctionDef_RetEntry_DoNotUse& other); + static const FunctionDef_RetEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_FunctionDef_RetEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class FunctionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.FunctionDef) */ { + public: + FunctionDef(); + virtual ~FunctionDef(); + + FunctionDef(const FunctionDef& from); + + inline FunctionDef& operator=(const FunctionDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + FunctionDef(FunctionDef&& from) noexcept + : FunctionDef() { + *this = ::std::move(from); + } + + inline FunctionDef& operator=(FunctionDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FunctionDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const FunctionDef* internal_default_instance() { + return reinterpret_cast( + &_FunctionDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(FunctionDef* other); + void Swap(FunctionDef* other); + friend void swap(FunctionDef& a, FunctionDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline FunctionDef* New() const final { + return CreateMaybeMessage(NULL); + } + + FunctionDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const FunctionDef& from); + void MergeFrom(const FunctionDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FunctionDef* other); + protected: + explicit FunctionDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.NodeDef node_def = 3; + int node_def_size() const; + void clear_node_def(); + static const int kNodeDefFieldNumber = 3; + ::diplomacy::tensorflow::NodeDef* mutable_node_def(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >* + mutable_node_def(); + const ::diplomacy::tensorflow::NodeDef& node_def(int index) const; + ::diplomacy::tensorflow::NodeDef* add_node_def(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >& + node_def() const; + + // map ret = 4; + int ret_size() const; + void clear_ret(); + static const int kRetFieldNumber = 4; + const ::google::protobuf::Map< ::std::string, ::std::string >& + ret() const; + ::google::protobuf::Map< ::std::string, ::std::string >* + mutable_ret(); + + // map attr = 5; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 5; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& + attr() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* + mutable_attr(); + + // .diplomacy.tensorflow.OpDef signature = 1; + bool has_signature() const; + void clear_signature(); + static const int kSignatureFieldNumber = 1; + private: + const ::diplomacy::tensorflow::OpDef& _internal_signature() const; + public: + const ::diplomacy::tensorflow::OpDef& signature() const; + ::diplomacy::tensorflow::OpDef* release_signature(); + ::diplomacy::tensorflow::OpDef* mutable_signature(); + void set_allocated_signature(::diplomacy::tensorflow::OpDef* signature); + void unsafe_arena_set_allocated_signature( + ::diplomacy::tensorflow::OpDef* signature); + ::diplomacy::tensorflow::OpDef* unsafe_arena_release_signature(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FunctionDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef > node_def_; + ::google::protobuf::internal::MapField< + FunctionDef_RetEntry_DoNotUse, + ::std::string, ::std::string, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + 0 > ret_; + ::google::protobuf::internal::MapField< + FunctionDef_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > attr_; + ::diplomacy::tensorflow::OpDef* signature_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GradientDef) */ { + public: + GradientDef(); + virtual ~GradientDef(); + + GradientDef(const GradientDef& from); + + inline GradientDef& operator=(const GradientDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GradientDef(GradientDef&& from) noexcept + : GradientDef() { + *this = ::std::move(from); + } + + inline GradientDef& operator=(GradientDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GradientDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GradientDef* internal_default_instance() { + return reinterpret_cast( + &_GradientDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(GradientDef* other); + void Swap(GradientDef* other); + friend void swap(GradientDef& a, GradientDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GradientDef* New() const final { + return CreateMaybeMessage(NULL); + } + + GradientDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GradientDef& from); + void MergeFrom(const GradientDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GradientDef* other); + protected: + explicit GradientDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string function_name = 1; + void clear_function_name(); + static const int kFunctionNameFieldNumber = 1; + const ::std::string& function_name() const; + void set_function_name(const ::std::string& value); + #if LANG_CXX11 + void set_function_name(::std::string&& value); + #endif + void set_function_name(const char* value); + void set_function_name(const char* value, size_t size); + ::std::string* mutable_function_name(); + ::std::string* release_function_name(); + void set_allocated_function_name(::std::string* function_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_function_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_function_name( + ::std::string* function_name); + + // string gradient_func = 2; + void clear_gradient_func(); + static const int kGradientFuncFieldNumber = 2; + const ::std::string& gradient_func() const; + void set_gradient_func(const ::std::string& value); + #if LANG_CXX11 + void set_gradient_func(::std::string&& value); + #endif + void set_gradient_func(const char* value); + void set_gradient_func(const char* value, size_t size); + ::std::string* mutable_gradient_func(); + ::std::string* release_gradient_func(); + void set_allocated_gradient_func(::std::string* gradient_func); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_gradient_func(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_gradient_func( + ::std::string* gradient_func); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GradientDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr function_name_; + ::google::protobuf::internal::ArenaStringPtr gradient_func_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// FunctionDefLibrary + +// repeated .diplomacy.tensorflow.FunctionDef function = 1; +inline int FunctionDefLibrary::function_size() const { + return function_.size(); +} +inline void FunctionDefLibrary::clear_function() { + function_.Clear(); +} +inline ::diplomacy::tensorflow::FunctionDef* FunctionDefLibrary::mutable_function(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FunctionDefLibrary.function) + return function_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::FunctionDef >* +FunctionDefLibrary::mutable_function() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.FunctionDefLibrary.function) + return &function_; +} +inline const ::diplomacy::tensorflow::FunctionDef& FunctionDefLibrary::function(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FunctionDefLibrary.function) + return function_.Get(index); +} +inline ::diplomacy::tensorflow::FunctionDef* FunctionDefLibrary::add_function() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.FunctionDefLibrary.function) + return function_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::FunctionDef >& +FunctionDefLibrary::function() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.FunctionDefLibrary.function) + return function_; +} + +// repeated .diplomacy.tensorflow.GradientDef gradient = 2; +inline int FunctionDefLibrary::gradient_size() const { + return gradient_.size(); +} +inline void FunctionDefLibrary::clear_gradient() { + gradient_.Clear(); +} +inline ::diplomacy::tensorflow::GradientDef* FunctionDefLibrary::mutable_gradient(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FunctionDefLibrary.gradient) + return gradient_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GradientDef >* +FunctionDefLibrary::mutable_gradient() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.FunctionDefLibrary.gradient) + return &gradient_; +} +inline const ::diplomacy::tensorflow::GradientDef& FunctionDefLibrary::gradient(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FunctionDefLibrary.gradient) + return gradient_.Get(index); +} +inline ::diplomacy::tensorflow::GradientDef* FunctionDefLibrary::add_gradient() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.FunctionDefLibrary.gradient) + return gradient_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GradientDef >& +FunctionDefLibrary::gradient() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.FunctionDefLibrary.gradient) + return gradient_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// FunctionDef + +// .diplomacy.tensorflow.OpDef signature = 1; +inline bool FunctionDef::has_signature() const { + return this != internal_default_instance() && signature_ != NULL; +} +inline const ::diplomacy::tensorflow::OpDef& FunctionDef::_internal_signature() const { + return *signature_; +} +inline const ::diplomacy::tensorflow::OpDef& FunctionDef::signature() const { + const ::diplomacy::tensorflow::OpDef* p = signature_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FunctionDef.signature) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_OpDef_default_instance_); +} +inline ::diplomacy::tensorflow::OpDef* FunctionDef::release_signature() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.FunctionDef.signature) + + ::diplomacy::tensorflow::OpDef* temp = signature_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + signature_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpDef* FunctionDef::unsafe_arena_release_signature() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.FunctionDef.signature) + + ::diplomacy::tensorflow::OpDef* temp = signature_; + signature_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpDef* FunctionDef::mutable_signature() { + + if (signature_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::OpDef>(GetArenaNoVirtual()); + signature_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FunctionDef.signature) + return signature_; +} +inline void FunctionDef::set_allocated_signature(::diplomacy::tensorflow::OpDef* signature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(signature_); + } + if (signature) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(signature)->GetArena(); + if (message_arena != submessage_arena) { + signature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, signature, submessage_arena); + } + + } else { + + } + signature_ = signature; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.FunctionDef.signature) +} + +// map attr = 5; +inline int FunctionDef::attr_size() const { + return attr_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& +FunctionDef::attr() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.FunctionDef.attr) + return attr_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* +FunctionDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.FunctionDef.attr) + return attr_.MutableMap(); +} + +// repeated .diplomacy.tensorflow.NodeDef node_def = 3; +inline int FunctionDef::node_def_size() const { + return node_def_.size(); +} +inline ::diplomacy::tensorflow::NodeDef* FunctionDef::mutable_node_def(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.FunctionDef.node_def) + return node_def_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >* +FunctionDef::mutable_node_def() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.FunctionDef.node_def) + return &node_def_; +} +inline const ::diplomacy::tensorflow::NodeDef& FunctionDef::node_def(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.FunctionDef.node_def) + return node_def_.Get(index); +} +inline ::diplomacy::tensorflow::NodeDef* FunctionDef::add_node_def() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.FunctionDef.node_def) + return node_def_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >& +FunctionDef::node_def() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.FunctionDef.node_def) + return node_def_; +} + +// map ret = 4; +inline int FunctionDef::ret_size() const { + return ret_.size(); +} +inline void FunctionDef::clear_ret() { + ret_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::std::string >& +FunctionDef::ret() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.FunctionDef.ret) + return ret_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::std::string >* +FunctionDef::mutable_ret() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.FunctionDef.ret) + return ret_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// GradientDef + +// string function_name = 1; +inline void GradientDef::clear_function_name() { + function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GradientDef::function_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GradientDef.function_name) + return function_name_.Get(); +} +inline void GradientDef::set_function_name(const ::std::string& value) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GradientDef.function_name) +} +#if LANG_CXX11 +inline void GradientDef::set_function_name(::std::string&& value) { + + function_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GradientDef.function_name) +} +#endif +inline void GradientDef::set_function_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GradientDef.function_name) +} +inline void GradientDef::set_function_name(const char* value, + size_t size) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GradientDef.function_name) +} +inline ::std::string* GradientDef::mutable_function_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GradientDef.function_name) + return function_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GradientDef::release_function_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GradientDef.function_name) + + return function_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GradientDef::set_allocated_function_name(::std::string* function_name) { + if (function_name != NULL) { + + } else { + + } + function_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), function_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GradientDef.function_name) +} +inline ::std::string* GradientDef::unsafe_arena_release_function_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GradientDef.function_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return function_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GradientDef::unsafe_arena_set_allocated_function_name( + ::std::string* function_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (function_name != NULL) { + + } else { + + } + function_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + function_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GradientDef.function_name) +} + +// string gradient_func = 2; +inline void GradientDef::clear_gradient_func() { + gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GradientDef::gradient_func() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GradientDef.gradient_func) + return gradient_func_.Get(); +} +inline void GradientDef::set_gradient_func(const ::std::string& value) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GradientDef.gradient_func) +} +#if LANG_CXX11 +inline void GradientDef::set_gradient_func(::std::string&& value) { + + gradient_func_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GradientDef.gradient_func) +} +#endif +inline void GradientDef::set_gradient_func(const char* value) { + GOOGLE_DCHECK(value != NULL); + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GradientDef.gradient_func) +} +inline void GradientDef::set_gradient_func(const char* value, + size_t size) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GradientDef.gradient_func) +} +inline ::std::string* GradientDef::mutable_gradient_func() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GradientDef.gradient_func) + return gradient_func_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GradientDef::release_gradient_func() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GradientDef.gradient_func) + + return gradient_func_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GradientDef::set_allocated_gradient_func(::std::string* gradient_func) { + if (gradient_func != NULL) { + + } else { + + } + gradient_func_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), gradient_func, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GradientDef.gradient_func) +} +inline ::std::string* GradientDef::unsafe_arena_release_gradient_func() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GradientDef.gradient_func) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return gradient_func_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GradientDef::unsafe_arena_set_allocated_gradient_func( + ::std::string* gradient_func) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (gradient_func != NULL) { + + } else { + + } + gradient_func_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + gradient_func, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GradientDef.gradient_func) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.proto new file mode 100644 index 0000000..dbad1f1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function.proto @@ -0,0 +1,102 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "FunctionProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/attr_value.proto"; +import "diplomacy_tensorflow/core/framework/node_def.proto"; +import "diplomacy_tensorflow/core/framework/op_def.proto"; + +// A library is a set of named functions. +message FunctionDefLibrary { + repeated FunctionDef function = 1; + repeated GradientDef gradient = 2; +} + +// 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. +message FunctionDef { + // The definition of the function's name, arguments, return values, + // attrs etc. + OpDef signature = 1; + + // Attributes specific to this function definition. + map attr = 5; + + // NOTE: field id 2 deleted on Jan 11, 2017, GraphDef version 21. + reserved 2; + + // In both of the following fields, there is the need to specify an + // output that is used as either the input to another node (in + // `node_def`) or as a return value of the function (in `ret`). + // Unlike the NodeDefs in GraphDef, we need to be able to specify a + // list in some cases (instead of just single outputs). Also, we + // need to be able to deal with lists of unknown length (so the + // output index may not be known at function definition time). So + // we use the following format instead: + // * "fun_in" where "fun_in" is the name of a function input arg in + // the `signature` field above. This represents that input, whether + // it is a single tensor or a list. + // * "fun_in:0" gives the first element of a function input arg (a + // non-list input is considered a list of length 1 for these + // purposes). + // * "node:out" where "node" is the name of a node in `node_def` and + // "out" is the name one of its op's output arguments (the name + // comes from the OpDef of the node's op). This represents that + // node's output, whether it is a single tensor or a list. + // Note: We enforce that an op's output arguments are never + // renamed in the backwards-compatibility test. + // * "node:out:0" gives the first element of a node output arg (a + // non-list output is considered a list of length 1 for these + // purposes). + // + // NOT CURRENTLY SUPPORTED (but may be in the future): + // * "node:out:-1" gives last element in a node output list + // * "node:out:1:" gives a list with all but the first element in a + // node output list + // * "node:out::-1" gives a list with all but the last element in a + // node output list + + // The body of the function. Unlike the NodeDefs in a GraphDef, attrs + // may have values of type `placeholder` and the `input` field uses + // the "output" format above. + + // 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. + repeated NodeDef node_def = 3; + + // A mapping from the output arg names from `signature` to the + // outputs from `node_def` that should be returned by the function. + map ret = 4; +} + +// 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. +message GradientDef { + string function_name = 1; // The function name. + string gradient_func = 2; // The gradient function's name. +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function_pb2.py new file mode 100644 index 0000000..7194803 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/function_pb2.py @@ -0,0 +1,288 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/function.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import attr_value_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from diplomacy_tensorflow.core.framework import node_def_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_node__def__pb2 +from diplomacy_tensorflow.core.framework import op_def_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_op__def__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/function.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\016FunctionProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n2diplomacy_tensorflow/core/framework/function.proto\x12\x14\x64iplomacy.tensorflow\x1a\x34\x64iplomacy_tensorflow/core/framework/attr_value.proto\x1a\x32\x64iplomacy_tensorflow/core/framework/node_def.proto\x1a\x30\x64iplomacy_tensorflow/core/framework/op_def.proto\"~\n\x12\x46unctionDefLibrary\x12\x33\n\x08\x66unction\x18\x01 \x03(\x0b\x32!.diplomacy.tensorflow.FunctionDef\x12\x33\n\x08gradient\x18\x02 \x03(\x0b\x32!.diplomacy.tensorflow.GradientDef\"\xe2\x02\n\x0b\x46unctionDef\x12.\n\tsignature\x18\x01 \x01(\x0b\x32\x1b.diplomacy.tensorflow.OpDef\x12\x39\n\x04\x61ttr\x18\x05 \x03(\x0b\x32+.diplomacy.tensorflow.FunctionDef.AttrEntry\x12/\n\x08node_def\x18\x03 \x03(\x0b\x32\x1d.diplomacy.tensorflow.NodeDef\x12\x37\n\x03ret\x18\x04 \x03(\x0b\x32*.diplomacy.tensorflow.FunctionDef.RetEntry\x1aL\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue:\x02\x38\x01\x1a*\n\x08RetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x02\x10\x03\";\n\x0bGradientDef\x12\x15\n\rfunction_name\x18\x01 \x01(\t\x12\x15\n\rgradient_func\x18\x02 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0e\x46unctionProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_node__def__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_op__def__pb2.DESCRIPTOR,]) + + + + +_FUNCTIONDEFLIBRARY = _descriptor.Descriptor( + name='FunctionDefLibrary', + full_name='diplomacy.tensorflow.FunctionDefLibrary', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='function', full_name='diplomacy.tensorflow.FunctionDefLibrary.function', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='gradient', full_name='diplomacy.tensorflow.FunctionDefLibrary.gradient', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=232, + serialized_end=358, +) + + +_FUNCTIONDEF_ATTRENTRY = _descriptor.Descriptor( + name='AttrEntry', + full_name='diplomacy.tensorflow.FunctionDef.AttrEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.FunctionDef.AttrEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.FunctionDef.AttrEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=589, + serialized_end=665, +) + +_FUNCTIONDEF_RETENTRY = _descriptor.Descriptor( + name='RetEntry', + full_name='diplomacy.tensorflow.FunctionDef.RetEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.FunctionDef.RetEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.FunctionDef.RetEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=667, + serialized_end=709, +) + +_FUNCTIONDEF = _descriptor.Descriptor( + name='FunctionDef', + full_name='diplomacy.tensorflow.FunctionDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='signature', full_name='diplomacy.tensorflow.FunctionDef.signature', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attr', full_name='diplomacy.tensorflow.FunctionDef.attr', index=1, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_def', full_name='diplomacy.tensorflow.FunctionDef.node_def', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='ret', full_name='diplomacy.tensorflow.FunctionDef.ret', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_FUNCTIONDEF_ATTRENTRY, _FUNCTIONDEF_RETENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=361, + serialized_end=715, +) + + +_GRADIENTDEF = _descriptor.Descriptor( + name='GradientDef', + full_name='diplomacy.tensorflow.GradientDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='function_name', full_name='diplomacy.tensorflow.GradientDef.function_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='gradient_func', full_name='diplomacy.tensorflow.GradientDef.gradient_func', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=717, + serialized_end=776, +) + +_FUNCTIONDEFLIBRARY.fields_by_name['function'].message_type = _FUNCTIONDEF +_FUNCTIONDEFLIBRARY.fields_by_name['gradient'].message_type = _GRADIENTDEF +_FUNCTIONDEF_ATTRENTRY.fields_by_name['value'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2._ATTRVALUE +_FUNCTIONDEF_ATTRENTRY.containing_type = _FUNCTIONDEF +_FUNCTIONDEF_RETENTRY.containing_type = _FUNCTIONDEF +_FUNCTIONDEF.fields_by_name['signature'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_op__def__pb2._OPDEF +_FUNCTIONDEF.fields_by_name['attr'].message_type = _FUNCTIONDEF_ATTRENTRY +_FUNCTIONDEF.fields_by_name['node_def'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_node__def__pb2._NODEDEF +_FUNCTIONDEF.fields_by_name['ret'].message_type = _FUNCTIONDEF_RETENTRY +DESCRIPTOR.message_types_by_name['FunctionDefLibrary'] = _FUNCTIONDEFLIBRARY +DESCRIPTOR.message_types_by_name['FunctionDef'] = _FUNCTIONDEF +DESCRIPTOR.message_types_by_name['GradientDef'] = _GRADIENTDEF +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +FunctionDefLibrary = _reflection.GeneratedProtocolMessageType('FunctionDefLibrary', (_message.Message,), dict( + DESCRIPTOR = _FUNCTIONDEFLIBRARY, + __module__ = 'diplomacy_tensorflow.core.framework.function_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FunctionDefLibrary) + )) +_sym_db.RegisterMessage(FunctionDefLibrary) + +FunctionDef = _reflection.GeneratedProtocolMessageType('FunctionDef', (_message.Message,), dict( + + AttrEntry = _reflection.GeneratedProtocolMessageType('AttrEntry', (_message.Message,), dict( + DESCRIPTOR = _FUNCTIONDEF_ATTRENTRY, + __module__ = 'diplomacy_tensorflow.core.framework.function_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FunctionDef.AttrEntry) + )) + , + + RetEntry = _reflection.GeneratedProtocolMessageType('RetEntry', (_message.Message,), dict( + DESCRIPTOR = _FUNCTIONDEF_RETENTRY, + __module__ = 'diplomacy_tensorflow.core.framework.function_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FunctionDef.RetEntry) + )) + , + DESCRIPTOR = _FUNCTIONDEF, + __module__ = 'diplomacy_tensorflow.core.framework.function_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.FunctionDef) + )) +_sym_db.RegisterMessage(FunctionDef) +_sym_db.RegisterMessage(FunctionDef.AttrEntry) +_sym_db.RegisterMessage(FunctionDef.RetEntry) + +GradientDef = _reflection.GeneratedProtocolMessageType('GradientDef', (_message.Message,), dict( + DESCRIPTOR = _GRADIENTDEF, + __module__ = 'diplomacy_tensorflow.core.framework.function_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GradientDef) + )) +_sym_db.RegisterMessage(GradientDef) + + +DESCRIPTOR._options = None +_FUNCTIONDEF_ATTRENTRY._options = None +_FUNCTIONDEF_RETENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.pb.cc new file mode 100644 index 0000000..fc527d0 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.pb.cc @@ -0,0 +1,593 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/graph.proto + +#include "diplomacy_tensorflow/core/framework/graph.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_FunctionDefLibrary; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_NodeDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_VersionDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto +namespace diplomacy { +namespace tensorflow { +class GraphDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto { +static void InitDefaultsGraphDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_GraphDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsGraphDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::scc_info_VersionDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::scc_info_FunctionDefLibrary.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_GraphDef.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphDef, node_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphDef, versions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphDef, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphDef, library_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::GraphDef)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_GraphDef_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/graph.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n/diplomacy_tensorflow/core/framework/gr" + "aph.proto\022\024diplomacy.tensorflow\0322diploma" + "cy_tensorflow/core/framework/node_def.pr" + "oto\0322diplomacy_tensorflow/core/framework" + "/function.proto\0322diplomacy_tensorflow/co" + "re/framework/versions.proto\"\273\001\n\010GraphDef" + "\022+\n\004node\030\001 \003(\0132\035.diplomacy.tensorflow.No" + "deDef\0222\n\010versions\030\004 \001(\0132 .diplomacy.tens" + "orflow.VersionDef\022\023\n\007version\030\003 \001(\005B\002\030\001\0229" + "\n\007library\030\002 \001(\0132(.diplomacy.tensorflow.F" + "unctionDefLibraryBk\n\030org.tensorflow.fram" + "eworkB\013GraphProtosP\001Z=github.com/tensorf" + "low/tensorflow/tensorflow/go/core/framew" + "ork\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 534); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/graph.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ffunction_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void GraphDef::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_GraphDef_default_instance_._instance.get_mutable()->versions_ = const_cast< ::diplomacy::tensorflow::VersionDef*>( + ::diplomacy::tensorflow::VersionDef::internal_default_instance()); + ::diplomacy::tensorflow::_GraphDef_default_instance_._instance.get_mutable()->library_ = const_cast< ::diplomacy::tensorflow::FunctionDefLibrary*>( + ::diplomacy::tensorflow::FunctionDefLibrary::internal_default_instance()); +} +void GraphDef::clear_node() { + node_.Clear(); +} +void GraphDef::unsafe_arena_set_allocated_versions( + ::diplomacy::tensorflow::VersionDef* versions) { + if (GetArenaNoVirtual() == NULL) { + delete versions_; + } + versions_ = versions; + if (versions) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphDef.versions) +} +void GraphDef::clear_versions() { + if (GetArenaNoVirtual() == NULL && versions_ != NULL) { + delete versions_; + } + versions_ = NULL; +} +void GraphDef::unsafe_arena_set_allocated_library( + ::diplomacy::tensorflow::FunctionDefLibrary* library) { + if (GetArenaNoVirtual() == NULL) { + delete library_; + } + library_ = library; + if (library) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphDef.library) +} +void GraphDef::clear_library() { + if (GetArenaNoVirtual() == NULL && library_ != NULL) { + delete library_; + } + library_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphDef::kNodeFieldNumber; +const int GraphDef::kVersionsFieldNumber; +const int GraphDef::kVersionFieldNumber; +const int GraphDef::kLibraryFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphDef::GraphDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::scc_info_GraphDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphDef) +} +GraphDef::GraphDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::scc_info_GraphDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphDef) +} +GraphDef::GraphDef(const GraphDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + node_(from.node_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_library()) { + library_ = new ::diplomacy::tensorflow::FunctionDefLibrary(*from.library_); + } else { + library_ = NULL; + } + if (from.has_versions()) { + versions_ = new ::diplomacy::tensorflow::VersionDef(*from.versions_); + } else { + versions_ = NULL; + } + version_ = from.version_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphDef) +} + +void GraphDef::SharedCtor() { + ::memset(&library_, 0, static_cast( + reinterpret_cast(&version_) - + reinterpret_cast(&library_)) + sizeof(version_)); +} + +GraphDef::~GraphDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphDef) + SharedDtor(); +} + +void GraphDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete library_; + if (this != internal_default_instance()) delete versions_; +} + +void GraphDef::ArenaDtor(void* object) { + GraphDef* _this = reinterpret_cast< GraphDef* >(object); + (void)_this; +} +void GraphDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphDef& GraphDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::scc_info_GraphDef.base); + return *internal_default_instance(); +} + + +void GraphDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_.Clear(); + if (GetArenaNoVirtual() == NULL && library_ != NULL) { + delete library_; + } + library_ = NULL; + if (GetArenaNoVirtual() == NULL && versions_ != NULL) { + delete versions_; + } + versions_ = NULL; + version_ = 0; + _internal_metadata_.Clear(); +} + +bool GraphDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.NodeDef node = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.FunctionDefLibrary library = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_library())); + } else { + goto handle_unusual; + } + break; + } + + // int32 version = 3 [deprecated = true]; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &version_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.VersionDef versions = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_versions())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphDef) + return false; +#undef DO_ +} + +void GraphDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.NodeDef node = 1; + for (unsigned int i = 0, + n = static_cast(this->node_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->node(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.FunctionDefLibrary library = 2; + if (this->has_library()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_library(), output); + } + + // int32 version = 3 [deprecated = true]; + if (this->version() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version(), output); + } + + // .diplomacy.tensorflow.VersionDef versions = 4; + if (this->has_versions()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_versions(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphDef) +} + +::google::protobuf::uint8* GraphDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.NodeDef node = 1; + for (unsigned int i = 0, + n = static_cast(this->node_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->node(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.FunctionDefLibrary library = 2; + if (this->has_library()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_library(), deterministic, target); + } + + // int32 version = 3 [deprecated = true]; + if (this->version() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version(), target); + } + + // .diplomacy.tensorflow.VersionDef versions = 4; + if (this->has_versions()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_versions(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphDef) + return target; +} + +size_t GraphDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.NodeDef node = 1; + { + unsigned int count = static_cast(this->node_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node(static_cast(i))); + } + } + + // .diplomacy.tensorflow.FunctionDefLibrary library = 2; + if (this->has_library()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *library_); + } + + // .diplomacy.tensorflow.VersionDef versions = 4; + if (this->has_versions()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *versions_); + } + + // int32 version = 3 [deprecated = true]; + if (this->version() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->version()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphDef) + GOOGLE_DCHECK_NE(&from, this); + const GraphDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphDef) + MergeFrom(*source); + } +} + +void GraphDef::MergeFrom(const GraphDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + node_.MergeFrom(from.node_); + if (from.has_library()) { + mutable_library()->::diplomacy::tensorflow::FunctionDefLibrary::MergeFrom(from.library()); + } + if (from.has_versions()) { + mutable_versions()->::diplomacy::tensorflow::VersionDef::MergeFrom(from.versions()); + } + if (from.version() != 0) { + set_version(from.version()); + } +} + +void GraphDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphDef::CopyFrom(const GraphDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphDef::IsInitialized() const { + return true; +} + +void GraphDef::Swap(GraphDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphDef::UnsafeArenaSwap(GraphDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphDef::InternalSwap(GraphDef* other) { + using std::swap; + CastToBase(&node_)->InternalSwap(CastToBase(&other->node_)); + swap(library_, other->library_); + swap(versions_, other->versions_); + swap(version_, other->version_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphDef >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.pb.h new file mode 100644 index 0000000..40a5c18 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.pb.h @@ -0,0 +1,410 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/graph.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/node_def.pb.h" +#include "diplomacy_tensorflow/core/framework/function.pb.h" +#include "diplomacy_tensorflow/core/framework/versions.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto +namespace diplomacy { +namespace tensorflow { +class GraphDef; +class GraphDefDefaultTypeInternal; +extern GraphDefDefaultTypeInternal _GraphDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::GraphDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphDef>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphDef) */ { + public: + GraphDef(); + virtual ~GraphDef(); + + GraphDef(const GraphDef& from); + + inline GraphDef& operator=(const GraphDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphDef(GraphDef&& from) noexcept + : GraphDef() { + *this = ::std::move(from); + } + + inline GraphDef& operator=(GraphDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphDef* internal_default_instance() { + return reinterpret_cast( + &_GraphDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(GraphDef* other); + void Swap(GraphDef* other); + friend void swap(GraphDef& a, GraphDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphDef* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphDef& from); + void MergeFrom(const GraphDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphDef* other); + protected: + explicit GraphDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.NodeDef node = 1; + int node_size() const; + void clear_node(); + static const int kNodeFieldNumber = 1; + ::diplomacy::tensorflow::NodeDef* mutable_node(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >* + mutable_node(); + const ::diplomacy::tensorflow::NodeDef& node(int index) const; + ::diplomacy::tensorflow::NodeDef* add_node(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >& + node() const; + + // .diplomacy.tensorflow.FunctionDefLibrary library = 2; + bool has_library() const; + void clear_library(); + static const int kLibraryFieldNumber = 2; + private: + const ::diplomacy::tensorflow::FunctionDefLibrary& _internal_library() const; + public: + const ::diplomacy::tensorflow::FunctionDefLibrary& library() const; + ::diplomacy::tensorflow::FunctionDefLibrary* release_library(); + ::diplomacy::tensorflow::FunctionDefLibrary* mutable_library(); + void set_allocated_library(::diplomacy::tensorflow::FunctionDefLibrary* library); + void unsafe_arena_set_allocated_library( + ::diplomacy::tensorflow::FunctionDefLibrary* library); + ::diplomacy::tensorflow::FunctionDefLibrary* unsafe_arena_release_library(); + + // .diplomacy.tensorflow.VersionDef versions = 4; + bool has_versions() const; + void clear_versions(); + static const int kVersionsFieldNumber = 4; + private: + const ::diplomacy::tensorflow::VersionDef& _internal_versions() const; + public: + const ::diplomacy::tensorflow::VersionDef& versions() const; + ::diplomacy::tensorflow::VersionDef* release_versions(); + ::diplomacy::tensorflow::VersionDef* mutable_versions(); + void set_allocated_versions(::diplomacy::tensorflow::VersionDef* versions); + void unsafe_arena_set_allocated_versions( + ::diplomacy::tensorflow::VersionDef* versions); + ::diplomacy::tensorflow::VersionDef* unsafe_arena_release_versions(); + + // int32 version = 3 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_version(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kVersionFieldNumber = 3; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int32 version() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_version(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef > node_; + ::diplomacy::tensorflow::FunctionDefLibrary* library_; + ::diplomacy::tensorflow::VersionDef* versions_; + ::google::protobuf::int32 version_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// GraphDef + +// repeated .diplomacy.tensorflow.NodeDef node = 1; +inline int GraphDef::node_size() const { + return node_.size(); +} +inline ::diplomacy::tensorflow::NodeDef* GraphDef::mutable_node(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphDef.node) + return node_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >* +GraphDef::mutable_node() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphDef.node) + return &node_; +} +inline const ::diplomacy::tensorflow::NodeDef& GraphDef::node(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphDef.node) + return node_.Get(index); +} +inline ::diplomacy::tensorflow::NodeDef* GraphDef::add_node() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphDef.node) + return node_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeDef >& +GraphDef::node() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphDef.node) + return node_; +} + +// .diplomacy.tensorflow.VersionDef versions = 4; +inline bool GraphDef::has_versions() const { + return this != internal_default_instance() && versions_ != NULL; +} +inline const ::diplomacy::tensorflow::VersionDef& GraphDef::_internal_versions() const { + return *versions_; +} +inline const ::diplomacy::tensorflow::VersionDef& GraphDef::versions() const { + const ::diplomacy::tensorflow::VersionDef* p = versions_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphDef.versions) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_VersionDef_default_instance_); +} +inline ::diplomacy::tensorflow::VersionDef* GraphDef::release_versions() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphDef.versions) + + ::diplomacy::tensorflow::VersionDef* temp = versions_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + versions_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::VersionDef* GraphDef::unsafe_arena_release_versions() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphDef.versions) + + ::diplomacy::tensorflow::VersionDef* temp = versions_; + versions_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::VersionDef* GraphDef::mutable_versions() { + + if (versions_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::VersionDef>(GetArenaNoVirtual()); + versions_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphDef.versions) + return versions_; +} +inline void GraphDef::set_allocated_versions(::diplomacy::tensorflow::VersionDef* versions) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(versions_); + } + if (versions) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(versions)->GetArena(); + if (message_arena != submessage_arena) { + versions = ::google::protobuf::internal::GetOwnedMessage( + message_arena, versions, submessage_arena); + } + + } else { + + } + versions_ = versions; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphDef.versions) +} + +// int32 version = 3 [deprecated = true]; +inline void GraphDef::clear_version() { + version_ = 0; +} +inline ::google::protobuf::int32 GraphDef::version() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphDef.version) + return version_; +} +inline void GraphDef::set_version(::google::protobuf::int32 value) { + + version_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphDef.version) +} + +// .diplomacy.tensorflow.FunctionDefLibrary library = 2; +inline bool GraphDef::has_library() const { + return this != internal_default_instance() && library_ != NULL; +} +inline const ::diplomacy::tensorflow::FunctionDefLibrary& GraphDef::_internal_library() const { + return *library_; +} +inline const ::diplomacy::tensorflow::FunctionDefLibrary& GraphDef::library() const { + const ::diplomacy::tensorflow::FunctionDefLibrary* p = library_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphDef.library) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_FunctionDefLibrary_default_instance_); +} +inline ::diplomacy::tensorflow::FunctionDefLibrary* GraphDef::release_library() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphDef.library) + + ::diplomacy::tensorflow::FunctionDefLibrary* temp = library_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + library_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::FunctionDefLibrary* GraphDef::unsafe_arena_release_library() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphDef.library) + + ::diplomacy::tensorflow::FunctionDefLibrary* temp = library_; + library_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::FunctionDefLibrary* GraphDef::mutable_library() { + + if (library_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::FunctionDefLibrary>(GetArenaNoVirtual()); + library_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphDef.library) + return library_; +} +inline void GraphDef::set_allocated_library(::diplomacy::tensorflow::FunctionDefLibrary* library) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(library_); + } + if (library) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(library)->GetArena(); + if (message_arena != submessage_arena) { + library = ::google::protobuf::internal::GetOwnedMessage( + message_arena, library, submessage_arena); + } + + } else { + + } + library_ = library; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphDef.library) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.proto new file mode 100644 index 0000000..73291b9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "GraphProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/node_def.proto"; +import "diplomacy_tensorflow/core/framework/function.proto"; +import "diplomacy_tensorflow/core/framework/versions.proto"; + +// Represents the graph of operations +message GraphDef { + repeated NodeDef node = 1; + + // 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. + VersionDef versions = 4; + + // Deprecated single version field; use versions above instead. Since all + // GraphDef changes before "versions" was introduced were forward + // compatible, this field is entirely ignored. + int32 version = 3 [deprecated = true]; + + // 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 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. + FunctionDefLibrary library = 2; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_pb2.py new file mode 100644 index 0000000..4981c93 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_pb2.py @@ -0,0 +1,99 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/graph.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import node_def_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_node__def__pb2 +from diplomacy_tensorflow.core.framework import function_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_function__pb2 +from diplomacy_tensorflow.core.framework import versions_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_versions__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/graph.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\013GraphProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n/diplomacy_tensorflow/core/framework/graph.proto\x12\x14\x64iplomacy.tensorflow\x1a\x32\x64iplomacy_tensorflow/core/framework/node_def.proto\x1a\x32\x64iplomacy_tensorflow/core/framework/function.proto\x1a\x32\x64iplomacy_tensorflow/core/framework/versions.proto\"\xbb\x01\n\x08GraphDef\x12+\n\x04node\x18\x01 \x03(\x0b\x32\x1d.diplomacy.tensorflow.NodeDef\x12\x32\n\x08versions\x18\x04 \x01(\x0b\x32 .diplomacy.tensorflow.VersionDef\x12\x13\n\x07version\x18\x03 \x01(\x05\x42\x02\x18\x01\x12\x39\n\x07library\x18\x02 \x01(\x0b\x32(.diplomacy.tensorflow.FunctionDefLibraryBk\n\x18org.tensorflow.frameworkB\x0bGraphProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_node__def__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_function__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_versions__pb2.DESCRIPTOR,]) + + + + +_GRAPHDEF = _descriptor.Descriptor( + name='GraphDef', + full_name='diplomacy.tensorflow.GraphDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node', full_name='diplomacy.tensorflow.GraphDef.node', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='versions', full_name='diplomacy.tensorflow.GraphDef.versions', index=1, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='version', full_name='diplomacy.tensorflow.GraphDef.version', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='library', full_name='diplomacy.tensorflow.GraphDef.library', index=3, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=230, + serialized_end=417, +) + +_GRAPHDEF.fields_by_name['node'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_node__def__pb2._NODEDEF +_GRAPHDEF.fields_by_name['versions'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_versions__pb2._VERSIONDEF +_GRAPHDEF.fields_by_name['library'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_function__pb2._FUNCTIONDEFLIBRARY +DESCRIPTOR.message_types_by_name['GraphDef'] = _GRAPHDEF +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +GraphDef = _reflection.GeneratedProtocolMessageType('GraphDef', (_message.Message,), dict( + DESCRIPTOR = _GRAPHDEF, + __module__ = 'diplomacy_tensorflow.core.framework.graph_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphDef) + )) +_sym_db.RegisterMessage(GraphDef) + + +DESCRIPTOR._options = None +_GRAPHDEF.fields_by_name['version']._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.pb.cc new file mode 100644 index 0000000..53059fb --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.pb.cc @@ -0,0 +1,3625 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/graph_transfer_info.proto + +#include "diplomacy_tensorflow/core/framework/graph_transfer_info.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferConstNodeInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferGraphInputNodeInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferGraphOutputNodeInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferNodeInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferNodeInput; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferNodeOutputInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_GraphTransferNodeInputInfo; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto +namespace diplomacy { +namespace tensorflow { +class GraphTransferNodeInputDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferNodeInput_default_instance_; +class GraphTransferNodeInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferNodeInfo_default_instance_; +class GraphTransferConstNodeInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferConstNodeInfo_default_instance_; +class GraphTransferNodeInputInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferNodeInputInfo_default_instance_; +class GraphTransferNodeOutputInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferNodeOutputInfo_default_instance_; +class GraphTransferGraphInputNodeInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferGraphInputNodeInfo_default_instance_; +class GraphTransferGraphOutputNodeInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferGraphOutputNodeInfo_default_instance_; +class GraphTransferInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GraphTransferInfo_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto { +static void InitDefaultsGraphTransferNodeInput() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferNodeInput_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferNodeInput(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferNodeInput::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferNodeInput = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGraphTransferNodeInput}, {}}; + +static void InitDefaultsGraphTransferNodeInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferNodeInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferNodeInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferNodeInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferNodeInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGraphTransferNodeInfo}, {}}; + +static void InitDefaultsGraphTransferConstNodeInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferConstNodeInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferConstNodeInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferConstNodeInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferConstNodeInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGraphTransferConstNodeInfo}, {}}; + +static void InitDefaultsGraphTransferNodeInputInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferNodeInputInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferNodeInputInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferNodeInputInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_GraphTransferNodeInputInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsGraphTransferNodeInputInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInput.base,}}; + +static void InitDefaultsGraphTransferNodeOutputInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferNodeOutputInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferNodeOutputInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferNodeOutputInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferNodeOutputInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGraphTransferNodeOutputInfo}, {}}; + +static void InitDefaultsGraphTransferGraphInputNodeInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferGraphInputNodeInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferGraphInputNodeInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGraphTransferGraphInputNodeInfo}, {}}; + +static void InitDefaultsGraphTransferGraphOutputNodeInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferGraphOutputNodeInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GraphTransferGraphOutputNodeInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGraphTransferGraphOutputNodeInfo}, {}}; + +static void InitDefaultsGraphTransferInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_GraphTransferInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::GraphTransferInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::GraphTransferInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<6> scc_info_GraphTransferInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 6, InitDefaultsGraphTransferInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferConstNodeInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInputInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeOutputInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphInputNodeInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphOutputNodeInfo.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferNodeInput.base); + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferNodeInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferConstNodeInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferNodeInputInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferNodeOutputInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferGraphInputNodeInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferGraphOutputNodeInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_GraphTransferInfo.base); +} + +::google::protobuf::Metadata file_level_metadata[8]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInput, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInput, node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInput, output_port_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, type_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, soc_op_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, padding_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, input_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInfo, output_count_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferConstNodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferConstNodeInfo, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferConstNodeInfo, node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferConstNodeInfo, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferConstNodeInfo, data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferConstNodeInfo, dtype_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInputInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInputInfo, node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeInputInfo, node_input_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeOutputInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeOutputInfo, node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferNodeOutputInfo, max_byte_size_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo, dtype_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo, dtype_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, node_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, const_node_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, node_input_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, node_output_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, graph_input_node_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, graph_output_node_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::GraphTransferInfo, destination_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::GraphTransferNodeInput)}, + { 7, -1, sizeof(::diplomacy::tensorflow::GraphTransferNodeInfo)}, + { 19, -1, sizeof(::diplomacy::tensorflow::GraphTransferConstNodeInfo)}, + { 29, -1, sizeof(::diplomacy::tensorflow::GraphTransferNodeInputInfo)}, + { 36, -1, sizeof(::diplomacy::tensorflow::GraphTransferNodeOutputInfo)}, + { 43, -1, sizeof(::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo)}, + { 51, -1, sizeof(::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo)}, + { 59, -1, sizeof(::diplomacy::tensorflow::GraphTransferInfo)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferNodeInput_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferNodeInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferConstNodeInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferNodeInputInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferNodeOutputInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferGraphInputNodeInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferGraphOutputNodeInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_GraphTransferInfo_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/graph_transfer_info.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 8); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n=diplomacy_tensorflow/core/framework/gr" + "aph_transfer_info.proto\022\024diplomacy.tenso" + "rflow\032/diplomacy_tensorflow/core/framewo" + "rk/types.proto\">\n\026GraphTransferNodeInput" + "\022\017\n\007node_id\030\001 \001(\005\022\023\n\013output_port\030\002 \001(\005\"\233" + "\001\n\025GraphTransferNodeInfo\022\014\n\004name\030\001 \001(\t\022\017" + "\n\007node_id\030\002 \001(\005\022\021\n\ttype_name\030\003 \001(\t\022\021\n\tso" + "c_op_id\030\004 \001(\005\022\022\n\npadding_id\030\005 \001(\005\022\023\n\013inp" + "ut_count\030\006 \001(\005\022\024\n\014output_count\030\007 \001(\005\"\207\001\n" + "\032GraphTransferConstNodeInfo\022\014\n\004name\030\001 \001(" + "\t\022\017\n\007node_id\030\002 \001(\005\022\r\n\005shape\030\003 \003(\003\022\014\n\004dat" + "a\030\004 \001(\014\022-\n\005dtype\030\005 \001(\0162\036.diplomacy.tenso" + "rflow.DataType\"o\n\032GraphTransferNodeInput" + "Info\022\017\n\007node_id\030\001 \001(\005\022@\n\nnode_input\030\002 \003(" + "\0132,.diplomacy.tensorflow.GraphTransferNo" + "deInput\"E\n\033GraphTransferNodeOutputInfo\022\017" + "\n\007node_id\030\001 \001(\005\022\025\n\rmax_byte_size\030\002 \003(\005\"m" + "\n\037GraphTransferGraphInputNodeInfo\022\014\n\004nam" + "e\030\001 \001(\t\022\r\n\005shape\030\002 \003(\003\022-\n\005dtype\030\003 \001(\0162\036." + "diplomacy.tensorflow.DataType\"n\n GraphTr" + "ansferGraphOutputNodeInfo\022\014\n\004name\030\001 \001(\t\022" + "\r\n\005shape\030\002 \003(\003\022-\n\005dtype\030\003 \001(\0162\036.diplomac" + "y.tensorflow.DataType\"\323\004\n\021GraphTransferI" + "nfo\022>\n\tnode_info\030\001 \003(\0132+.diplomacy.tenso" + "rflow.GraphTransferNodeInfo\022I\n\017const_nod" + "e_info\030\002 \003(\01320.diplomacy.tensorflow.Grap" + "hTransferConstNodeInfo\022I\n\017node_input_inf" + "o\030\003 \003(\01320.diplomacy.tensorflow.GraphTran" + "sferNodeInputInfo\022K\n\020node_output_info\030\004 " + "\003(\01321.diplomacy.tensorflow.GraphTransfer" + "NodeOutputInfo\022T\n\025graph_input_node_info\030" + "\005 \003(\01325.diplomacy.tensorflow.GraphTransf" + "erGraphInputNodeInfo\022V\n\026graph_output_nod" + "e_info\030\006 \003(\01326.diplomacy.tensorflow.Grap" + "hTransferGraphOutputNodeInfo\022H\n\013destinat" + "ion\030\007 \001(\01623.diplomacy.tensorflow.GraphTr" + "ansferInfo.Destination\"#\n\013Destination\022\007\n" + "\003NOP\020\000\022\013\n\007HEXAGON\020\001Bv\n\030org.tensorflow.fr" + "ameworkB\026GraphTransferInfoProtoP\001Z=githu" + "b.com/tensorflow/tensorflow/tensorflow/g" + "o/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1627); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/graph_transfer_info.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto +namespace diplomacy { +namespace tensorflow { +const ::google::protobuf::EnumDescriptor* GraphTransferInfo_Destination_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_enum_descriptors[0]; +} +bool GraphTransferInfo_Destination_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const GraphTransferInfo_Destination GraphTransferInfo::NOP; +const GraphTransferInfo_Destination GraphTransferInfo::HEXAGON; +const GraphTransferInfo_Destination GraphTransferInfo::Destination_MIN; +const GraphTransferInfo_Destination GraphTransferInfo::Destination_MAX; +const int GraphTransferInfo::Destination_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void GraphTransferNodeInput::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferNodeInput::kNodeIdFieldNumber; +const int GraphTransferNodeInput::kOutputPortFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferNodeInput::GraphTransferNodeInput() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInput.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferNodeInput) +} +GraphTransferNodeInput::GraphTransferNodeInput(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInput.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferNodeInput) +} +GraphTransferNodeInput::GraphTransferNodeInput(const GraphTransferNodeInput& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&node_id_, &from.node_id_, + static_cast(reinterpret_cast(&output_port_) - + reinterpret_cast(&node_id_)) + sizeof(output_port_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferNodeInput) +} + +void GraphTransferNodeInput::SharedCtor() { + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&output_port_) - + reinterpret_cast(&node_id_)) + sizeof(output_port_)); +} + +GraphTransferNodeInput::~GraphTransferNodeInput() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferNodeInput) + SharedDtor(); +} + +void GraphTransferNodeInput::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GraphTransferNodeInput::ArenaDtor(void* object) { + GraphTransferNodeInput* _this = reinterpret_cast< GraphTransferNodeInput* >(object); + (void)_this; +} +void GraphTransferNodeInput::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferNodeInput::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferNodeInput::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferNodeInput& GraphTransferNodeInput::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInput.base); + return *internal_default_instance(); +} + + +void GraphTransferNodeInput::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferNodeInput) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&output_port_) - + reinterpret_cast(&node_id_)) + sizeof(output_port_)); + _internal_metadata_.Clear(); +} + +bool GraphTransferNodeInput::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferNodeInput) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 node_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &node_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 output_port = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &output_port_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferNodeInput) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferNodeInput) + return false; +#undef DO_ +} + +void GraphTransferNodeInput::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferNodeInput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 node_id = 1; + if (this->node_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->node_id(), output); + } + + // int32 output_port = 2; + if (this->output_port() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->output_port(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferNodeInput) +} + +::google::protobuf::uint8* GraphTransferNodeInput::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferNodeInput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 node_id = 1; + if (this->node_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->node_id(), target); + } + + // int32 output_port = 2; + if (this->output_port() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->output_port(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferNodeInput) + return target; +} + +size_t GraphTransferNodeInput::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferNodeInput) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 node_id = 1; + if (this->node_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->node_id()); + } + + // int32 output_port = 2; + if (this->output_port() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->output_port()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferNodeInput::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferNodeInput) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferNodeInput* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferNodeInput) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferNodeInput) + MergeFrom(*source); + } +} + +void GraphTransferNodeInput::MergeFrom(const GraphTransferNodeInput& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferNodeInput) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.node_id() != 0) { + set_node_id(from.node_id()); + } + if (from.output_port() != 0) { + set_output_port(from.output_port()); + } +} + +void GraphTransferNodeInput::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferNodeInput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferNodeInput::CopyFrom(const GraphTransferNodeInput& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferNodeInput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferNodeInput::IsInitialized() const { + return true; +} + +void GraphTransferNodeInput::Swap(GraphTransferNodeInput* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferNodeInput* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferNodeInput::UnsafeArenaSwap(GraphTransferNodeInput* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferNodeInput::InternalSwap(GraphTransferNodeInput* other) { + using std::swap; + swap(node_id_, other->node_id_); + swap(output_port_, other->output_port_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferNodeInput::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GraphTransferNodeInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferNodeInfo::kNameFieldNumber; +const int GraphTransferNodeInfo::kNodeIdFieldNumber; +const int GraphTransferNodeInfo::kTypeNameFieldNumber; +const int GraphTransferNodeInfo::kSocOpIdFieldNumber; +const int GraphTransferNodeInfo::kPaddingIdFieldNumber; +const int GraphTransferNodeInfo::kInputCountFieldNumber; +const int GraphTransferNodeInfo::kOutputCountFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferNodeInfo::GraphTransferNodeInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferNodeInfo) +} +GraphTransferNodeInfo::GraphTransferNodeInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferNodeInfo) +} +GraphTransferNodeInfo::GraphTransferNodeInfo(const GraphTransferNodeInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.type_name().size() > 0) { + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name(), + GetArenaNoVirtual()); + } + ::memcpy(&node_id_, &from.node_id_, + static_cast(reinterpret_cast(&output_count_) - + reinterpret_cast(&node_id_)) + sizeof(output_count_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferNodeInfo) +} + +void GraphTransferNodeInfo::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&output_count_) - + reinterpret_cast(&node_id_)) + sizeof(output_count_)); +} + +GraphTransferNodeInfo::~GraphTransferNodeInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferNodeInfo) + SharedDtor(); +} + +void GraphTransferNodeInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void GraphTransferNodeInfo::ArenaDtor(void* object) { + GraphTransferNodeInfo* _this = reinterpret_cast< GraphTransferNodeInfo* >(object); + (void)_this; +} +void GraphTransferNodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferNodeInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferNodeInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferNodeInfo& GraphTransferNodeInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInfo.base); + return *internal_default_instance(); +} + + +void GraphTransferNodeInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&output_count_) - + reinterpret_cast(&node_id_)) + sizeof(output_count_)); + _internal_metadata_.Clear(); +} + +bool GraphTransferNodeInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferNodeInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GraphTransferNodeInfo.name")); + } else { + goto handle_unusual; + } + break; + } + + // int32 node_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &node_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string type_name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GraphTransferNodeInfo.type_name")); + } else { + goto handle_unusual; + } + break; + } + + // int32 soc_op_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &soc_op_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 padding_id = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &padding_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 input_count = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &input_count_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 output_count = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &output_count_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferNodeInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferNodeInfo) + return false; +#undef DO_ +} + +void GraphTransferNodeInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferNodeInfo.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // int32 node_id = 2; + if (this->node_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->node_id(), output); + } + + // string type_name = 3; + if (this->type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferNodeInfo.type_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->type_name(), output); + } + + // int32 soc_op_id = 4; + if (this->soc_op_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->soc_op_id(), output); + } + + // int32 padding_id = 5; + if (this->padding_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->padding_id(), output); + } + + // int32 input_count = 6; + if (this->input_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->input_count(), output); + } + + // int32 output_count = 7; + if (this->output_count() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->output_count(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferNodeInfo) +} + +::google::protobuf::uint8* GraphTransferNodeInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferNodeInfo.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // int32 node_id = 2; + if (this->node_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->node_id(), target); + } + + // string type_name = 3; + if (this->type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferNodeInfo.type_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->type_name(), target); + } + + // int32 soc_op_id = 4; + if (this->soc_op_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->soc_op_id(), target); + } + + // int32 padding_id = 5; + if (this->padding_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->padding_id(), target); + } + + // int32 input_count = 6; + if (this->input_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->input_count(), target); + } + + // int32 output_count = 7; + if (this->output_count() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->output_count(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferNodeInfo) + return target; +} + +size_t GraphTransferNodeInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferNodeInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string type_name = 3; + if (this->type_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_name()); + } + + // int32 node_id = 2; + if (this->node_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->node_id()); + } + + // int32 soc_op_id = 4; + if (this->soc_op_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->soc_op_id()); + } + + // int32 padding_id = 5; + if (this->padding_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->padding_id()); + } + + // int32 input_count = 6; + if (this->input_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->input_count()); + } + + // int32 output_count = 7; + if (this->output_count() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->output_count()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferNodeInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferNodeInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferNodeInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferNodeInfo) + MergeFrom(*source); + } +} + +void GraphTransferNodeInfo::MergeFrom(const GraphTransferNodeInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.type_name().size() > 0) { + set_type_name(from.type_name()); + } + if (from.node_id() != 0) { + set_node_id(from.node_id()); + } + if (from.soc_op_id() != 0) { + set_soc_op_id(from.soc_op_id()); + } + if (from.padding_id() != 0) { + set_padding_id(from.padding_id()); + } + if (from.input_count() != 0) { + set_input_count(from.input_count()); + } + if (from.output_count() != 0) { + set_output_count(from.output_count()); + } +} + +void GraphTransferNodeInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferNodeInfo::CopyFrom(const GraphTransferNodeInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferNodeInfo::IsInitialized() const { + return true; +} + +void GraphTransferNodeInfo::Swap(GraphTransferNodeInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferNodeInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferNodeInfo::UnsafeArenaSwap(GraphTransferNodeInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferNodeInfo::InternalSwap(GraphTransferNodeInfo* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + type_name_.Swap(&other->type_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(node_id_, other->node_id_); + swap(soc_op_id_, other->soc_op_id_); + swap(padding_id_, other->padding_id_); + swap(input_count_, other->input_count_); + swap(output_count_, other->output_count_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferNodeInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GraphTransferConstNodeInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferConstNodeInfo::kNameFieldNumber; +const int GraphTransferConstNodeInfo::kNodeIdFieldNumber; +const int GraphTransferConstNodeInfo::kShapeFieldNumber; +const int GraphTransferConstNodeInfo::kDataFieldNumber; +const int GraphTransferConstNodeInfo::kDtypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferConstNodeInfo::GraphTransferConstNodeInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferConstNodeInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferConstNodeInfo) +} +GraphTransferConstNodeInfo::GraphTransferConstNodeInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + shape_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferConstNodeInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferConstNodeInfo) +} +GraphTransferConstNodeInfo::GraphTransferConstNodeInfo(const GraphTransferConstNodeInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + shape_(from.shape_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.data().size() > 0) { + data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data(), + GetArenaNoVirtual()); + } + ::memcpy(&node_id_, &from.node_id_, + static_cast(reinterpret_cast(&dtype_) - + reinterpret_cast(&node_id_)) + sizeof(dtype_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferConstNodeInfo) +} + +void GraphTransferConstNodeInfo::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&node_id_)) + sizeof(dtype_)); +} + +GraphTransferConstNodeInfo::~GraphTransferConstNodeInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferConstNodeInfo) + SharedDtor(); +} + +void GraphTransferConstNodeInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void GraphTransferConstNodeInfo::ArenaDtor(void* object) { + GraphTransferConstNodeInfo* _this = reinterpret_cast< GraphTransferConstNodeInfo* >(object); + (void)_this; +} +void GraphTransferConstNodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferConstNodeInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferConstNodeInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferConstNodeInfo& GraphTransferConstNodeInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferConstNodeInfo.base); + return *internal_default_instance(); +} + + +void GraphTransferConstNodeInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + shape_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + data_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&node_id_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&node_id_)) + sizeof(dtype_)); + _internal_metadata_.Clear(); +} + +bool GraphTransferConstNodeInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GraphTransferConstNodeInfo.name")); + } else { + goto handle_unusual; + } + break; + } + + // int32 node_id = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &node_id_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 shape = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_shape()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_shape()))); + } else { + goto handle_unusual; + } + break; + } + + // bytes data = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType dtype = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferConstNodeInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferConstNodeInfo) + return false; +#undef DO_ +} + +void GraphTransferConstNodeInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferConstNodeInfo.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // int32 node_id = 2; + if (this->node_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->node_id(), output); + } + + // repeated int64 shape = 3; + if (this->shape_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _shape_cached_byte_size_)); + } + for (int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->shape(i), output); + } + + // bytes data = 4; + if (this->data().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->data(), output); + } + + // .diplomacy.tensorflow.DataType dtype = 5; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->dtype(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferConstNodeInfo) +} + +::google::protobuf::uint8* GraphTransferConstNodeInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferConstNodeInfo.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // int32 node_id = 2; + if (this->node_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->node_id(), target); + } + + // repeated int64 shape = 3; + if (this->shape_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _shape_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->shape_, target); + } + + // bytes data = 4; + if (this->data().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->data(), target); + } + + // .diplomacy.tensorflow.DataType dtype = 5; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->dtype(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferConstNodeInfo) + return target; +} + +size_t GraphTransferConstNodeInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 shape = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->shape_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _shape_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // bytes data = 4; + if (this->data().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->data()); + } + + // int32 node_id = 2; + if (this->node_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->node_id()); + } + + // .diplomacy.tensorflow.DataType dtype = 5; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferConstNodeInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferConstNodeInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferConstNodeInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferConstNodeInfo) + MergeFrom(*source); + } +} + +void GraphTransferConstNodeInfo::MergeFrom(const GraphTransferConstNodeInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + shape_.MergeFrom(from.shape_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.data().size() > 0) { + set_data(from.data()); + } + if (from.node_id() != 0) { + set_node_id(from.node_id()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void GraphTransferConstNodeInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferConstNodeInfo::CopyFrom(const GraphTransferConstNodeInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferConstNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferConstNodeInfo::IsInitialized() const { + return true; +} + +void GraphTransferConstNodeInfo::Swap(GraphTransferConstNodeInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferConstNodeInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferConstNodeInfo::UnsafeArenaSwap(GraphTransferConstNodeInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferConstNodeInfo::InternalSwap(GraphTransferConstNodeInfo* other) { + using std::swap; + shape_.InternalSwap(&other->shape_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + data_.Swap(&other->data_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(node_id_, other->node_id_); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferConstNodeInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GraphTransferNodeInputInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferNodeInputInfo::kNodeIdFieldNumber; +const int GraphTransferNodeInputInfo::kNodeInputFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferNodeInputInfo::GraphTransferNodeInputInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInputInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferNodeInputInfo) +} +GraphTransferNodeInputInfo::GraphTransferNodeInputInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_input_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInputInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferNodeInputInfo) +} +GraphTransferNodeInputInfo::GraphTransferNodeInputInfo(const GraphTransferNodeInputInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + node_input_(from.node_input_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + node_id_ = from.node_id_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferNodeInputInfo) +} + +void GraphTransferNodeInputInfo::SharedCtor() { + node_id_ = 0; +} + +GraphTransferNodeInputInfo::~GraphTransferNodeInputInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferNodeInputInfo) + SharedDtor(); +} + +void GraphTransferNodeInputInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GraphTransferNodeInputInfo::ArenaDtor(void* object) { + GraphTransferNodeInputInfo* _this = reinterpret_cast< GraphTransferNodeInputInfo* >(object); + (void)_this; +} +void GraphTransferNodeInputInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferNodeInputInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferNodeInputInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferNodeInputInfo& GraphTransferNodeInputInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeInputInfo.base); + return *internal_default_instance(); +} + + +void GraphTransferNodeInputInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_input_.Clear(); + node_id_ = 0; + _internal_metadata_.Clear(); +} + +bool GraphTransferNodeInputInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 node_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &node_id_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeInput node_input = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node_input())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferNodeInputInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferNodeInputInfo) + return false; +#undef DO_ +} + +void GraphTransferNodeInputInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 node_id = 1; + if (this->node_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->node_id(), output); + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeInput node_input = 2; + for (unsigned int i = 0, + n = static_cast(this->node_input_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->node_input(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferNodeInputInfo) +} + +::google::protobuf::uint8* GraphTransferNodeInputInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 node_id = 1; + if (this->node_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->node_id(), target); + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeInput node_input = 2; + for (unsigned int i = 0, + n = static_cast(this->node_input_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->node_input(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferNodeInputInfo) + return target; +} + +size_t GraphTransferNodeInputInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.GraphTransferNodeInput node_input = 2; + { + unsigned int count = static_cast(this->node_input_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node_input(static_cast(i))); + } + } + + // int32 node_id = 1; + if (this->node_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->node_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferNodeInputInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferNodeInputInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferNodeInputInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferNodeInputInfo) + MergeFrom(*source); + } +} + +void GraphTransferNodeInputInfo::MergeFrom(const GraphTransferNodeInputInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + node_input_.MergeFrom(from.node_input_); + if (from.node_id() != 0) { + set_node_id(from.node_id()); + } +} + +void GraphTransferNodeInputInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferNodeInputInfo::CopyFrom(const GraphTransferNodeInputInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferNodeInputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferNodeInputInfo::IsInitialized() const { + return true; +} + +void GraphTransferNodeInputInfo::Swap(GraphTransferNodeInputInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferNodeInputInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferNodeInputInfo::UnsafeArenaSwap(GraphTransferNodeInputInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferNodeInputInfo::InternalSwap(GraphTransferNodeInputInfo* other) { + using std::swap; + CastToBase(&node_input_)->InternalSwap(CastToBase(&other->node_input_)); + swap(node_id_, other->node_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferNodeInputInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GraphTransferNodeOutputInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferNodeOutputInfo::kNodeIdFieldNumber; +const int GraphTransferNodeOutputInfo::kMaxByteSizeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferNodeOutputInfo::GraphTransferNodeOutputInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeOutputInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferNodeOutputInfo) +} +GraphTransferNodeOutputInfo::GraphTransferNodeOutputInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + max_byte_size_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeOutputInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferNodeOutputInfo) +} +GraphTransferNodeOutputInfo::GraphTransferNodeOutputInfo(const GraphTransferNodeOutputInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + max_byte_size_(from.max_byte_size_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + node_id_ = from.node_id_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferNodeOutputInfo) +} + +void GraphTransferNodeOutputInfo::SharedCtor() { + node_id_ = 0; +} + +GraphTransferNodeOutputInfo::~GraphTransferNodeOutputInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + SharedDtor(); +} + +void GraphTransferNodeOutputInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GraphTransferNodeOutputInfo::ArenaDtor(void* object) { + GraphTransferNodeOutputInfo* _this = reinterpret_cast< GraphTransferNodeOutputInfo* >(object); + (void)_this; +} +void GraphTransferNodeOutputInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferNodeOutputInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferNodeOutputInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferNodeOutputInfo& GraphTransferNodeOutputInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferNodeOutputInfo.base); + return *internal_default_instance(); +} + + +void GraphTransferNodeOutputInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + max_byte_size_.Clear(); + node_id_ = 0; + _internal_metadata_.Clear(); +} + +bool GraphTransferNodeOutputInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 node_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &node_id_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 max_byte_size = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_max_byte_size()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 18u, input, this->mutable_max_byte_size()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + return false; +#undef DO_ +} + +void GraphTransferNodeOutputInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 node_id = 1; + if (this->node_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->node_id(), output); + } + + // repeated int32 max_byte_size = 2; + if (this->max_byte_size_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _max_byte_size_cached_byte_size_)); + } + for (int i = 0, n = this->max_byte_size_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->max_byte_size(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferNodeOutputInfo) +} + +::google::protobuf::uint8* GraphTransferNodeOutputInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 node_id = 1; + if (this->node_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->node_id(), target); + } + + // repeated int32 max_byte_size = 2; + if (this->max_byte_size_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _max_byte_size_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->max_byte_size_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + return target; +} + +size_t GraphTransferNodeOutputInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 max_byte_size = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->max_byte_size_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _max_byte_size_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int32 node_id = 1; + if (this->node_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->node_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferNodeOutputInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferNodeOutputInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + MergeFrom(*source); + } +} + +void GraphTransferNodeOutputInfo::MergeFrom(const GraphTransferNodeOutputInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + max_byte_size_.MergeFrom(from.max_byte_size_); + if (from.node_id() != 0) { + set_node_id(from.node_id()); + } +} + +void GraphTransferNodeOutputInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferNodeOutputInfo::CopyFrom(const GraphTransferNodeOutputInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferNodeOutputInfo::IsInitialized() const { + return true; +} + +void GraphTransferNodeOutputInfo::Swap(GraphTransferNodeOutputInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferNodeOutputInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferNodeOutputInfo::UnsafeArenaSwap(GraphTransferNodeOutputInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferNodeOutputInfo::InternalSwap(GraphTransferNodeOutputInfo* other) { + using std::swap; + max_byte_size_.InternalSwap(&other->max_byte_size_); + swap(node_id_, other->node_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferNodeOutputInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GraphTransferGraphInputNodeInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferGraphInputNodeInfo::kNameFieldNumber; +const int GraphTransferGraphInputNodeInfo::kShapeFieldNumber; +const int GraphTransferGraphInputNodeInfo::kDtypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferGraphInputNodeInfo::GraphTransferGraphInputNodeInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphInputNodeInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) +} +GraphTransferGraphInputNodeInfo::GraphTransferGraphInputNodeInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + shape_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphInputNodeInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) +} +GraphTransferGraphInputNodeInfo::GraphTransferGraphInputNodeInfo(const GraphTransferGraphInputNodeInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + shape_(from.shape_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + dtype_ = from.dtype_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) +} + +void GraphTransferGraphInputNodeInfo::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + dtype_ = 0; +} + +GraphTransferGraphInputNodeInfo::~GraphTransferGraphInputNodeInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + SharedDtor(); +} + +void GraphTransferGraphInputNodeInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void GraphTransferGraphInputNodeInfo::ArenaDtor(void* object) { + GraphTransferGraphInputNodeInfo* _this = reinterpret_cast< GraphTransferGraphInputNodeInfo* >(object); + (void)_this; +} +void GraphTransferGraphInputNodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferGraphInputNodeInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferGraphInputNodeInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferGraphInputNodeInfo& GraphTransferGraphInputNodeInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphInputNodeInfo.base); + return *internal_default_instance(); +} + + +void GraphTransferGraphInputNodeInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + shape_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + dtype_ = 0; + _internal_metadata_.Clear(); +} + +bool GraphTransferGraphInputNodeInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_shape()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_shape()))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType dtype = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + return false; +#undef DO_ +} + +void GraphTransferGraphInputNodeInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated int64 shape = 2; + if (this->shape_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _shape_cached_byte_size_)); + } + for (int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->shape(i), output); + } + + // .diplomacy.tensorflow.DataType dtype = 3; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->dtype(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) +} + +::google::protobuf::uint8* GraphTransferGraphInputNodeInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated int64 shape = 2; + if (this->shape_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _shape_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->shape_, target); + } + + // .diplomacy.tensorflow.DataType dtype = 3; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->dtype(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + return target; +} + +size_t GraphTransferGraphInputNodeInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 shape = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->shape_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _shape_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy.tensorflow.DataType dtype = 3; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferGraphInputNodeInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferGraphInputNodeInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + MergeFrom(*source); + } +} + +void GraphTransferGraphInputNodeInfo::MergeFrom(const GraphTransferGraphInputNodeInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + shape_.MergeFrom(from.shape_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void GraphTransferGraphInputNodeInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferGraphInputNodeInfo::CopyFrom(const GraphTransferGraphInputNodeInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferGraphInputNodeInfo::IsInitialized() const { + return true; +} + +void GraphTransferGraphInputNodeInfo::Swap(GraphTransferGraphInputNodeInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferGraphInputNodeInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferGraphInputNodeInfo::UnsafeArenaSwap(GraphTransferGraphInputNodeInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferGraphInputNodeInfo::InternalSwap(GraphTransferGraphInputNodeInfo* other) { + using std::swap; + shape_.InternalSwap(&other->shape_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferGraphInputNodeInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GraphTransferGraphOutputNodeInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferGraphOutputNodeInfo::kNameFieldNumber; +const int GraphTransferGraphOutputNodeInfo::kShapeFieldNumber; +const int GraphTransferGraphOutputNodeInfo::kDtypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferGraphOutputNodeInfo::GraphTransferGraphOutputNodeInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphOutputNodeInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) +} +GraphTransferGraphOutputNodeInfo::GraphTransferGraphOutputNodeInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + shape_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphOutputNodeInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) +} +GraphTransferGraphOutputNodeInfo::GraphTransferGraphOutputNodeInfo(const GraphTransferGraphOutputNodeInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + shape_(from.shape_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + dtype_ = from.dtype_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) +} + +void GraphTransferGraphOutputNodeInfo::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + dtype_ = 0; +} + +GraphTransferGraphOutputNodeInfo::~GraphTransferGraphOutputNodeInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + SharedDtor(); +} + +void GraphTransferGraphOutputNodeInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void GraphTransferGraphOutputNodeInfo::ArenaDtor(void* object) { + GraphTransferGraphOutputNodeInfo* _this = reinterpret_cast< GraphTransferGraphOutputNodeInfo* >(object); + (void)_this; +} +void GraphTransferGraphOutputNodeInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferGraphOutputNodeInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferGraphOutputNodeInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferGraphOutputNodeInfo& GraphTransferGraphOutputNodeInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferGraphOutputNodeInfo.base); + return *internal_default_instance(); +} + + +void GraphTransferGraphOutputNodeInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + shape_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + dtype_ = 0; + _internal_metadata_.Clear(); +} + +bool GraphTransferGraphOutputNodeInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_shape()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_shape()))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType dtype = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + return false; +#undef DO_ +} + +void GraphTransferGraphOutputNodeInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated int64 shape = 2; + if (this->shape_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _shape_cached_byte_size_)); + } + for (int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->shape(i), output); + } + + // .diplomacy.tensorflow.DataType dtype = 3; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->dtype(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) +} + +::google::protobuf::uint8* GraphTransferGraphOutputNodeInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated int64 shape = 2; + if (this->shape_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _shape_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->shape_, target); + } + + // .diplomacy.tensorflow.DataType dtype = 3; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->dtype(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + return target; +} + +size_t GraphTransferGraphOutputNodeInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 shape = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->shape_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _shape_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy.tensorflow.DataType dtype = 3; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferGraphOutputNodeInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferGraphOutputNodeInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + MergeFrom(*source); + } +} + +void GraphTransferGraphOutputNodeInfo::MergeFrom(const GraphTransferGraphOutputNodeInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + shape_.MergeFrom(from.shape_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void GraphTransferGraphOutputNodeInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferGraphOutputNodeInfo::CopyFrom(const GraphTransferGraphOutputNodeInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferGraphOutputNodeInfo::IsInitialized() const { + return true; +} + +void GraphTransferGraphOutputNodeInfo::Swap(GraphTransferGraphOutputNodeInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferGraphOutputNodeInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferGraphOutputNodeInfo::UnsafeArenaSwap(GraphTransferGraphOutputNodeInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferGraphOutputNodeInfo::InternalSwap(GraphTransferGraphOutputNodeInfo* other) { + using std::swap; + shape_.InternalSwap(&other->shape_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferGraphOutputNodeInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GraphTransferInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphTransferInfo::kNodeInfoFieldNumber; +const int GraphTransferInfo::kConstNodeInfoFieldNumber; +const int GraphTransferInfo::kNodeInputInfoFieldNumber; +const int GraphTransferInfo::kNodeOutputInfoFieldNumber; +const int GraphTransferInfo::kGraphInputNodeInfoFieldNumber; +const int GraphTransferInfo::kGraphOutputNodeInfoFieldNumber; +const int GraphTransferInfo::kDestinationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphTransferInfo::GraphTransferInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.GraphTransferInfo) +} +GraphTransferInfo::GraphTransferInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_info_(arena), + const_node_info_(arena), + node_input_info_(arena), + node_output_info_(arena), + graph_input_node_info_(arena), + graph_output_node_info_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.GraphTransferInfo) +} +GraphTransferInfo::GraphTransferInfo(const GraphTransferInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + node_info_(from.node_info_), + const_node_info_(from.const_node_info_), + node_input_info_(from.node_input_info_), + node_output_info_(from.node_output_info_), + graph_input_node_info_(from.graph_input_node_info_), + graph_output_node_info_(from.graph_output_node_info_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + destination_ = from.destination_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.GraphTransferInfo) +} + +void GraphTransferInfo::SharedCtor() { + destination_ = 0; +} + +GraphTransferInfo::~GraphTransferInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.GraphTransferInfo) + SharedDtor(); +} + +void GraphTransferInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GraphTransferInfo::ArenaDtor(void* object) { + GraphTransferInfo* _this = reinterpret_cast< GraphTransferInfo* >(object); + (void)_this; +} +void GraphTransferInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphTransferInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GraphTransferInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GraphTransferInfo& GraphTransferInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::scc_info_GraphTransferInfo.base); + return *internal_default_instance(); +} + + +void GraphTransferInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.GraphTransferInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_info_.Clear(); + const_node_info_.Clear(); + node_input_info_.Clear(); + node_output_info_.Clear(); + graph_input_node_info_.Clear(); + graph_output_node_info_.Clear(); + destination_ = 0; + _internal_metadata_.Clear(); +} + +bool GraphTransferInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.GraphTransferInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.GraphTransferNodeInfo node_info = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node_info())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_const_node_info())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node_input_info())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node_output_info())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_graph_input_node_info())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_graph_output_node_info())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.GraphTransferInfo.Destination destination = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_destination(static_cast< ::diplomacy::tensorflow::GraphTransferInfo_Destination >(value)); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.GraphTransferInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.GraphTransferInfo) + return false; +#undef DO_ +} + +void GraphTransferInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.GraphTransferInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.GraphTransferNodeInfo node_info = 1; + for (unsigned int i = 0, + n = static_cast(this->node_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->node_info(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + for (unsigned int i = 0, + n = static_cast(this->const_node_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->const_node_info(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + for (unsigned int i = 0, + n = static_cast(this->node_input_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->node_input_info(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + for (unsigned int i = 0, + n = static_cast(this->node_output_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->node_output_info(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + for (unsigned int i = 0, + n = static_cast(this->graph_input_node_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, + this->graph_input_node_info(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + for (unsigned int i = 0, + n = static_cast(this->graph_output_node_info_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, + this->graph_output_node_info(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.GraphTransferInfo.Destination destination = 7; + if (this->destination() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 7, this->destination(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.GraphTransferInfo) +} + +::google::protobuf::uint8* GraphTransferInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.GraphTransferInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.GraphTransferNodeInfo node_info = 1; + for (unsigned int i = 0, + n = static_cast(this->node_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->node_info(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + for (unsigned int i = 0, + n = static_cast(this->const_node_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->const_node_info(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + for (unsigned int i = 0, + n = static_cast(this->node_input_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->node_input_info(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + for (unsigned int i = 0, + n = static_cast(this->node_output_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->node_output_info(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + for (unsigned int i = 0, + n = static_cast(this->graph_input_node_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->graph_input_node_info(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + for (unsigned int i = 0, + n = static_cast(this->graph_output_node_info_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->graph_output_node_info(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.GraphTransferInfo.Destination destination = 7; + if (this->destination() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 7, this->destination(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.GraphTransferInfo) + return target; +} + +size_t GraphTransferInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.GraphTransferInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.GraphTransferNodeInfo node_info = 1; + { + unsigned int count = static_cast(this->node_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node_info(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + { + unsigned int count = static_cast(this->const_node_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->const_node_info(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + { + unsigned int count = static_cast(this->node_input_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node_input_info(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + { + unsigned int count = static_cast(this->node_output_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node_output_info(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + { + unsigned int count = static_cast(this->graph_input_node_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->graph_input_node_info(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + { + unsigned int count = static_cast(this->graph_output_node_info_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->graph_output_node_info(static_cast(i))); + } + } + + // .diplomacy.tensorflow.GraphTransferInfo.Destination destination = 7; + if (this->destination() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->destination()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GraphTransferInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.GraphTransferInfo) + GOOGLE_DCHECK_NE(&from, this); + const GraphTransferInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.GraphTransferInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.GraphTransferInfo) + MergeFrom(*source); + } +} + +void GraphTransferInfo::MergeFrom(const GraphTransferInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.GraphTransferInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + node_info_.MergeFrom(from.node_info_); + const_node_info_.MergeFrom(from.const_node_info_); + node_input_info_.MergeFrom(from.node_input_info_); + node_output_info_.MergeFrom(from.node_output_info_); + graph_input_node_info_.MergeFrom(from.graph_input_node_info_); + graph_output_node_info_.MergeFrom(from.graph_output_node_info_); + if (from.destination() != 0) { + set_destination(from.destination()); + } +} + +void GraphTransferInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.GraphTransferInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphTransferInfo::CopyFrom(const GraphTransferInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.GraphTransferInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphTransferInfo::IsInitialized() const { + return true; +} + +void GraphTransferInfo::Swap(GraphTransferInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphTransferInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GraphTransferInfo::UnsafeArenaSwap(GraphTransferInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphTransferInfo::InternalSwap(GraphTransferInfo* other) { + using std::swap; + CastToBase(&node_info_)->InternalSwap(CastToBase(&other->node_info_)); + CastToBase(&const_node_info_)->InternalSwap(CastToBase(&other->const_node_info_)); + CastToBase(&node_input_info_)->InternalSwap(CastToBase(&other->node_input_info_)); + CastToBase(&node_output_info_)->InternalSwap(CastToBase(&other->node_output_info_)); + CastToBase(&graph_input_node_info_)->InternalSwap(CastToBase(&other->graph_input_node_info_)); + CastToBase(&graph_output_node_info_)->InternalSwap(CastToBase(&other->graph_output_node_info_)); + swap(destination_, other->destination_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GraphTransferInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferNodeInput* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferNodeInput >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferNodeInput >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferNodeInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferNodeInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferNodeInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferConstNodeInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferConstNodeInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferConstNodeInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferNodeInputInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferNodeInputInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferNodeInputInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferNodeOutputInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferNodeOutputInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferNodeOutputInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::GraphTransferInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::GraphTransferInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::GraphTransferInfo >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.pb.h new file mode 100644 index 0000000..d5f8491 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.pb.h @@ -0,0 +1,2469 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/graph_transfer_info.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[8]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto +namespace diplomacy { +namespace tensorflow { +class GraphTransferConstNodeInfo; +class GraphTransferConstNodeInfoDefaultTypeInternal; +extern GraphTransferConstNodeInfoDefaultTypeInternal _GraphTransferConstNodeInfo_default_instance_; +class GraphTransferGraphInputNodeInfo; +class GraphTransferGraphInputNodeInfoDefaultTypeInternal; +extern GraphTransferGraphInputNodeInfoDefaultTypeInternal _GraphTransferGraphInputNodeInfo_default_instance_; +class GraphTransferGraphOutputNodeInfo; +class GraphTransferGraphOutputNodeInfoDefaultTypeInternal; +extern GraphTransferGraphOutputNodeInfoDefaultTypeInternal _GraphTransferGraphOutputNodeInfo_default_instance_; +class GraphTransferInfo; +class GraphTransferInfoDefaultTypeInternal; +extern GraphTransferInfoDefaultTypeInternal _GraphTransferInfo_default_instance_; +class GraphTransferNodeInfo; +class GraphTransferNodeInfoDefaultTypeInternal; +extern GraphTransferNodeInfoDefaultTypeInternal _GraphTransferNodeInfo_default_instance_; +class GraphTransferNodeInput; +class GraphTransferNodeInputDefaultTypeInternal; +extern GraphTransferNodeInputDefaultTypeInternal _GraphTransferNodeInput_default_instance_; +class GraphTransferNodeInputInfo; +class GraphTransferNodeInputInfoDefaultTypeInternal; +extern GraphTransferNodeInputInfoDefaultTypeInternal _GraphTransferNodeInputInfo_default_instance_; +class GraphTransferNodeOutputInfo; +class GraphTransferNodeOutputInfoDefaultTypeInternal; +extern GraphTransferNodeOutputInfoDefaultTypeInternal _GraphTransferNodeOutputInfo_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::GraphTransferConstNodeInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferConstNodeInfo>(Arena*); +template<> ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo>(Arena*); +template<> ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo>(Arena*); +template<> ::diplomacy::tensorflow::GraphTransferInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferInfo>(Arena*); +template<> ::diplomacy::tensorflow::GraphTransferNodeInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferNodeInfo>(Arena*); +template<> ::diplomacy::tensorflow::GraphTransferNodeInput* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferNodeInput>(Arena*); +template<> ::diplomacy::tensorflow::GraphTransferNodeInputInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferNodeInputInfo>(Arena*); +template<> ::diplomacy::tensorflow::GraphTransferNodeOutputInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::GraphTransferNodeOutputInfo>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +enum GraphTransferInfo_Destination { + GraphTransferInfo_Destination_NOP = 0, + GraphTransferInfo_Destination_HEXAGON = 1, + GraphTransferInfo_Destination_GraphTransferInfo_Destination_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + GraphTransferInfo_Destination_GraphTransferInfo_Destination_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool GraphTransferInfo_Destination_IsValid(int value); +const GraphTransferInfo_Destination GraphTransferInfo_Destination_Destination_MIN = GraphTransferInfo_Destination_NOP; +const GraphTransferInfo_Destination GraphTransferInfo_Destination_Destination_MAX = GraphTransferInfo_Destination_HEXAGON; +const int GraphTransferInfo_Destination_Destination_ARRAYSIZE = GraphTransferInfo_Destination_Destination_MAX + 1; + +const ::google::protobuf::EnumDescriptor* GraphTransferInfo_Destination_descriptor(); +inline const ::std::string& GraphTransferInfo_Destination_Name(GraphTransferInfo_Destination value) { + return ::google::protobuf::internal::NameOfEnum( + GraphTransferInfo_Destination_descriptor(), value); +} +inline bool GraphTransferInfo_Destination_Parse( + const ::std::string& name, GraphTransferInfo_Destination* value) { + return ::google::protobuf::internal::ParseNamedEnum( + GraphTransferInfo_Destination_descriptor(), name, value); +} +// =================================================================== + +class GraphTransferNodeInput : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferNodeInput) */ { + public: + GraphTransferNodeInput(); + virtual ~GraphTransferNodeInput(); + + GraphTransferNodeInput(const GraphTransferNodeInput& from); + + inline GraphTransferNodeInput& operator=(const GraphTransferNodeInput& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferNodeInput(GraphTransferNodeInput&& from) noexcept + : GraphTransferNodeInput() { + *this = ::std::move(from); + } + + inline GraphTransferNodeInput& operator=(GraphTransferNodeInput&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferNodeInput& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferNodeInput* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferNodeInput_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(GraphTransferNodeInput* other); + void Swap(GraphTransferNodeInput* other); + friend void swap(GraphTransferNodeInput& a, GraphTransferNodeInput& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferNodeInput* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferNodeInput* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferNodeInput& from); + void MergeFrom(const GraphTransferNodeInput& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferNodeInput* other); + protected: + explicit GraphTransferNodeInput(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 node_id = 1; + void clear_node_id(); + static const int kNodeIdFieldNumber = 1; + ::google::protobuf::int32 node_id() const; + void set_node_id(::google::protobuf::int32 value); + + // int32 output_port = 2; + void clear_output_port(); + static const int kOutputPortFieldNumber = 2; + ::google::protobuf::int32 output_port() const; + void set_output_port(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeInput) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 node_id_; + ::google::protobuf::int32 output_port_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GraphTransferNodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferNodeInfo) */ { + public: + GraphTransferNodeInfo(); + virtual ~GraphTransferNodeInfo(); + + GraphTransferNodeInfo(const GraphTransferNodeInfo& from); + + inline GraphTransferNodeInfo& operator=(const GraphTransferNodeInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferNodeInfo(GraphTransferNodeInfo&& from) noexcept + : GraphTransferNodeInfo() { + *this = ::std::move(from); + } + + inline GraphTransferNodeInfo& operator=(GraphTransferNodeInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferNodeInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferNodeInfo* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferNodeInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(GraphTransferNodeInfo* other); + void Swap(GraphTransferNodeInfo* other); + friend void swap(GraphTransferNodeInfo& a, GraphTransferNodeInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferNodeInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferNodeInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferNodeInfo& from); + void MergeFrom(const GraphTransferNodeInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferNodeInfo* other); + protected: + explicit GraphTransferNodeInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string type_name = 3; + void clear_type_name(); + static const int kTypeNameFieldNumber = 3; + const ::std::string& type_name() const; + void set_type_name(const ::std::string& value); + #if LANG_CXX11 + void set_type_name(::std::string&& value); + #endif + void set_type_name(const char* value); + void set_type_name(const char* value, size_t size); + ::std::string* mutable_type_name(); + ::std::string* release_type_name(); + void set_allocated_type_name(::std::string* type_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_type_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_type_name( + ::std::string* type_name); + + // int32 node_id = 2; + void clear_node_id(); + static const int kNodeIdFieldNumber = 2; + ::google::protobuf::int32 node_id() const; + void set_node_id(::google::protobuf::int32 value); + + // int32 soc_op_id = 4; + void clear_soc_op_id(); + static const int kSocOpIdFieldNumber = 4; + ::google::protobuf::int32 soc_op_id() const; + void set_soc_op_id(::google::protobuf::int32 value); + + // int32 padding_id = 5; + void clear_padding_id(); + static const int kPaddingIdFieldNumber = 5; + ::google::protobuf::int32 padding_id() const; + void set_padding_id(::google::protobuf::int32 value); + + // int32 input_count = 6; + void clear_input_count(); + static const int kInputCountFieldNumber = 6; + ::google::protobuf::int32 input_count() const; + void set_input_count(::google::protobuf::int32 value); + + // int32 output_count = 7; + void clear_output_count(); + static const int kOutputCountFieldNumber = 7; + ::google::protobuf::int32 output_count() const; + void set_output_count(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_name_; + ::google::protobuf::int32 node_id_; + ::google::protobuf::int32 soc_op_id_; + ::google::protobuf::int32 padding_id_; + ::google::protobuf::int32 input_count_; + ::google::protobuf::int32 output_count_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GraphTransferConstNodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferConstNodeInfo) */ { + public: + GraphTransferConstNodeInfo(); + virtual ~GraphTransferConstNodeInfo(); + + GraphTransferConstNodeInfo(const GraphTransferConstNodeInfo& from); + + inline GraphTransferConstNodeInfo& operator=(const GraphTransferConstNodeInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferConstNodeInfo(GraphTransferConstNodeInfo&& from) noexcept + : GraphTransferConstNodeInfo() { + *this = ::std::move(from); + } + + inline GraphTransferConstNodeInfo& operator=(GraphTransferConstNodeInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferConstNodeInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferConstNodeInfo* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferConstNodeInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(GraphTransferConstNodeInfo* other); + void Swap(GraphTransferConstNodeInfo* other); + friend void swap(GraphTransferConstNodeInfo& a, GraphTransferConstNodeInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferConstNodeInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferConstNodeInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferConstNodeInfo& from); + void MergeFrom(const GraphTransferConstNodeInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferConstNodeInfo* other); + protected: + explicit GraphTransferConstNodeInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 shape = 3; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 3; + ::google::protobuf::int64 shape(int index) const; + void set_shape(int index, ::google::protobuf::int64 value); + void add_shape(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + shape() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_shape(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // bytes data = 4; + void clear_data(); + static const int kDataFieldNumber = 4; + const ::std::string& data() const; + void set_data(const ::std::string& value); + #if LANG_CXX11 + void set_data(::std::string&& value); + #endif + void set_data(const char* value); + void set_data(const void* value, size_t size); + ::std::string* mutable_data(); + ::std::string* release_data(); + void set_allocated_data(::std::string* data); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_data(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_data( + ::std::string* data); + + // int32 node_id = 2; + void clear_node_id(); + static const int kNodeIdFieldNumber = 2; + ::google::protobuf::int32 node_id() const; + void set_node_id(::google::protobuf::int32 value); + + // .diplomacy.tensorflow.DataType dtype = 5; + void clear_dtype(); + static const int kDtypeFieldNumber = 5; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferConstNodeInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > shape_; + mutable int _shape_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr data_; + ::google::protobuf::int32 node_id_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GraphTransferNodeInputInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferNodeInputInfo) */ { + public: + GraphTransferNodeInputInfo(); + virtual ~GraphTransferNodeInputInfo(); + + GraphTransferNodeInputInfo(const GraphTransferNodeInputInfo& from); + + inline GraphTransferNodeInputInfo& operator=(const GraphTransferNodeInputInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferNodeInputInfo(GraphTransferNodeInputInfo&& from) noexcept + : GraphTransferNodeInputInfo() { + *this = ::std::move(from); + } + + inline GraphTransferNodeInputInfo& operator=(GraphTransferNodeInputInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferNodeInputInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferNodeInputInfo* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferNodeInputInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(GraphTransferNodeInputInfo* other); + void Swap(GraphTransferNodeInputInfo* other); + friend void swap(GraphTransferNodeInputInfo& a, GraphTransferNodeInputInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferNodeInputInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferNodeInputInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferNodeInputInfo& from); + void MergeFrom(const GraphTransferNodeInputInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferNodeInputInfo* other); + protected: + explicit GraphTransferNodeInputInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.GraphTransferNodeInput node_input = 2; + int node_input_size() const; + void clear_node_input(); + static const int kNodeInputFieldNumber = 2; + ::diplomacy::tensorflow::GraphTransferNodeInput* mutable_node_input(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInput >* + mutable_node_input(); + const ::diplomacy::tensorflow::GraphTransferNodeInput& node_input(int index) const; + ::diplomacy::tensorflow::GraphTransferNodeInput* add_node_input(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInput >& + node_input() const; + + // int32 node_id = 1; + void clear_node_id(); + static const int kNodeIdFieldNumber = 1; + ::google::protobuf::int32 node_id() const; + void set_node_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeInputInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInput > node_input_; + ::google::protobuf::int32 node_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GraphTransferNodeOutputInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferNodeOutputInfo) */ { + public: + GraphTransferNodeOutputInfo(); + virtual ~GraphTransferNodeOutputInfo(); + + GraphTransferNodeOutputInfo(const GraphTransferNodeOutputInfo& from); + + inline GraphTransferNodeOutputInfo& operator=(const GraphTransferNodeOutputInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferNodeOutputInfo(GraphTransferNodeOutputInfo&& from) noexcept + : GraphTransferNodeOutputInfo() { + *this = ::std::move(from); + } + + inline GraphTransferNodeOutputInfo& operator=(GraphTransferNodeOutputInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferNodeOutputInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferNodeOutputInfo* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferNodeOutputInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(GraphTransferNodeOutputInfo* other); + void Swap(GraphTransferNodeOutputInfo* other); + friend void swap(GraphTransferNodeOutputInfo& a, GraphTransferNodeOutputInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferNodeOutputInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferNodeOutputInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferNodeOutputInfo& from); + void MergeFrom(const GraphTransferNodeOutputInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferNodeOutputInfo* other); + protected: + explicit GraphTransferNodeOutputInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 max_byte_size = 2; + int max_byte_size_size() const; + void clear_max_byte_size(); + static const int kMaxByteSizeFieldNumber = 2; + ::google::protobuf::int32 max_byte_size(int index) const; + void set_max_byte_size(int index, ::google::protobuf::int32 value); + void add_max_byte_size(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + max_byte_size() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_max_byte_size(); + + // int32 node_id = 1; + void clear_node_id(); + static const int kNodeIdFieldNumber = 1; + ::google::protobuf::int32 node_id() const; + void set_node_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > max_byte_size_; + mutable int _max_byte_size_cached_byte_size_; + ::google::protobuf::int32 node_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GraphTransferGraphInputNodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) */ { + public: + GraphTransferGraphInputNodeInfo(); + virtual ~GraphTransferGraphInputNodeInfo(); + + GraphTransferGraphInputNodeInfo(const GraphTransferGraphInputNodeInfo& from); + + inline GraphTransferGraphInputNodeInfo& operator=(const GraphTransferGraphInputNodeInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferGraphInputNodeInfo(GraphTransferGraphInputNodeInfo&& from) noexcept + : GraphTransferGraphInputNodeInfo() { + *this = ::std::move(from); + } + + inline GraphTransferGraphInputNodeInfo& operator=(GraphTransferGraphInputNodeInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferGraphInputNodeInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferGraphInputNodeInfo* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferGraphInputNodeInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(GraphTransferGraphInputNodeInfo* other); + void Swap(GraphTransferGraphInputNodeInfo* other); + friend void swap(GraphTransferGraphInputNodeInfo& a, GraphTransferGraphInputNodeInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferGraphInputNodeInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferGraphInputNodeInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferGraphInputNodeInfo& from); + void MergeFrom(const GraphTransferGraphInputNodeInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferGraphInputNodeInfo* other); + protected: + explicit GraphTransferGraphInputNodeInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 shape = 2; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + ::google::protobuf::int64 shape(int index) const; + void set_shape(int index, ::google::protobuf::int64 value); + void add_shape(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + shape() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_shape(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // .diplomacy.tensorflow.DataType dtype = 3; + void clear_dtype(); + static const int kDtypeFieldNumber = 3; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > shape_; + mutable int _shape_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GraphTransferGraphOutputNodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) */ { + public: + GraphTransferGraphOutputNodeInfo(); + virtual ~GraphTransferGraphOutputNodeInfo(); + + GraphTransferGraphOutputNodeInfo(const GraphTransferGraphOutputNodeInfo& from); + + inline GraphTransferGraphOutputNodeInfo& operator=(const GraphTransferGraphOutputNodeInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferGraphOutputNodeInfo(GraphTransferGraphOutputNodeInfo&& from) noexcept + : GraphTransferGraphOutputNodeInfo() { + *this = ::std::move(from); + } + + inline GraphTransferGraphOutputNodeInfo& operator=(GraphTransferGraphOutputNodeInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferGraphOutputNodeInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferGraphOutputNodeInfo* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferGraphOutputNodeInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(GraphTransferGraphOutputNodeInfo* other); + void Swap(GraphTransferGraphOutputNodeInfo* other); + friend void swap(GraphTransferGraphOutputNodeInfo& a, GraphTransferGraphOutputNodeInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferGraphOutputNodeInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferGraphOutputNodeInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferGraphOutputNodeInfo& from); + void MergeFrom(const GraphTransferGraphOutputNodeInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferGraphOutputNodeInfo* other); + protected: + explicit GraphTransferGraphOutputNodeInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 shape = 2; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + ::google::protobuf::int64 shape(int index) const; + void set_shape(int index, ::google::protobuf::int64 value); + void add_shape(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + shape() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_shape(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // .diplomacy.tensorflow.DataType dtype = 3; + void clear_dtype(); + static const int kDtypeFieldNumber = 3; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > shape_; + mutable int _shape_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GraphTransferInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.GraphTransferInfo) */ { + public: + GraphTransferInfo(); + virtual ~GraphTransferInfo(); + + GraphTransferInfo(const GraphTransferInfo& from); + + inline GraphTransferInfo& operator=(const GraphTransferInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GraphTransferInfo(GraphTransferInfo&& from) noexcept + : GraphTransferInfo() { + *this = ::std::move(from); + } + + inline GraphTransferInfo& operator=(GraphTransferInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphTransferInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GraphTransferInfo* internal_default_instance() { + return reinterpret_cast( + &_GraphTransferInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(GraphTransferInfo* other); + void Swap(GraphTransferInfo* other); + friend void swap(GraphTransferInfo& a, GraphTransferInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GraphTransferInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + GraphTransferInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GraphTransferInfo& from); + void MergeFrom(const GraphTransferInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphTransferInfo* other); + protected: + explicit GraphTransferInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef GraphTransferInfo_Destination Destination; + static const Destination NOP = + GraphTransferInfo_Destination_NOP; + static const Destination HEXAGON = + GraphTransferInfo_Destination_HEXAGON; + static inline bool Destination_IsValid(int value) { + return GraphTransferInfo_Destination_IsValid(value); + } + static const Destination Destination_MIN = + GraphTransferInfo_Destination_Destination_MIN; + static const Destination Destination_MAX = + GraphTransferInfo_Destination_Destination_MAX; + static const int Destination_ARRAYSIZE = + GraphTransferInfo_Destination_Destination_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Destination_descriptor() { + return GraphTransferInfo_Destination_descriptor(); + } + static inline const ::std::string& Destination_Name(Destination value) { + return GraphTransferInfo_Destination_Name(value); + } + static inline bool Destination_Parse(const ::std::string& name, + Destination* value) { + return GraphTransferInfo_Destination_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.GraphTransferNodeInfo node_info = 1; + int node_info_size() const; + void clear_node_info(); + static const int kNodeInfoFieldNumber = 1; + ::diplomacy::tensorflow::GraphTransferNodeInfo* mutable_node_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInfo >* + mutable_node_info(); + const ::diplomacy::tensorflow::GraphTransferNodeInfo& node_info(int index) const; + ::diplomacy::tensorflow::GraphTransferNodeInfo* add_node_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInfo >& + node_info() const; + + // repeated .diplomacy.tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + int const_node_info_size() const; + void clear_const_node_info(); + static const int kConstNodeInfoFieldNumber = 2; + ::diplomacy::tensorflow::GraphTransferConstNodeInfo* mutable_const_node_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferConstNodeInfo >* + mutable_const_node_info(); + const ::diplomacy::tensorflow::GraphTransferConstNodeInfo& const_node_info(int index) const; + ::diplomacy::tensorflow::GraphTransferConstNodeInfo* add_const_node_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferConstNodeInfo >& + const_node_info() const; + + // repeated .diplomacy.tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + int node_input_info_size() const; + void clear_node_input_info(); + static const int kNodeInputInfoFieldNumber = 3; + ::diplomacy::tensorflow::GraphTransferNodeInputInfo* mutable_node_input_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInputInfo >* + mutable_node_input_info(); + const ::diplomacy::tensorflow::GraphTransferNodeInputInfo& node_input_info(int index) const; + ::diplomacy::tensorflow::GraphTransferNodeInputInfo* add_node_input_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInputInfo >& + node_input_info() const; + + // repeated .diplomacy.tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + int node_output_info_size() const; + void clear_node_output_info(); + static const int kNodeOutputInfoFieldNumber = 4; + ::diplomacy::tensorflow::GraphTransferNodeOutputInfo* mutable_node_output_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeOutputInfo >* + mutable_node_output_info(); + const ::diplomacy::tensorflow::GraphTransferNodeOutputInfo& node_output_info(int index) const; + ::diplomacy::tensorflow::GraphTransferNodeOutputInfo* add_node_output_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeOutputInfo >& + node_output_info() const; + + // repeated .diplomacy.tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + int graph_input_node_info_size() const; + void clear_graph_input_node_info(); + static const int kGraphInputNodeInfoFieldNumber = 5; + ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo* mutable_graph_input_node_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo >* + mutable_graph_input_node_info(); + const ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo& graph_input_node_info(int index) const; + ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo* add_graph_input_node_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo >& + graph_input_node_info() const; + + // repeated .diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + int graph_output_node_info_size() const; + void clear_graph_output_node_info(); + static const int kGraphOutputNodeInfoFieldNumber = 6; + ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo* mutable_graph_output_node_info(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo >* + mutable_graph_output_node_info(); + const ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo& graph_output_node_info(int index) const; + ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo* add_graph_output_node_info(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo >& + graph_output_node_info() const; + + // .diplomacy.tensorflow.GraphTransferInfo.Destination destination = 7; + void clear_destination(); + static const int kDestinationFieldNumber = 7; + ::diplomacy::tensorflow::GraphTransferInfo_Destination destination() const; + void set_destination(::diplomacy::tensorflow::GraphTransferInfo_Destination value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInfo > node_info_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferConstNodeInfo > const_node_info_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInputInfo > node_input_info_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeOutputInfo > node_output_info_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo > graph_input_node_info_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo > graph_output_node_info_; + int destination_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// GraphTransferNodeInput + +// int32 node_id = 1; +inline void GraphTransferNodeInput::clear_node_id() { + node_id_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInput::node_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInput.node_id) + return node_id_; +} +inline void GraphTransferNodeInput::set_node_id(::google::protobuf::int32 value) { + + node_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInput.node_id) +} + +// int32 output_port = 2; +inline void GraphTransferNodeInput::clear_output_port() { + output_port_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInput::output_port() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInput.output_port) + return output_port_; +} +inline void GraphTransferNodeInput::set_output_port(::google::protobuf::int32 value) { + + output_port_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInput.output_port) +} + +// ------------------------------------------------------------------- + +// GraphTransferNodeInfo + +// string name = 1; +inline void GraphTransferNodeInfo::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GraphTransferNodeInfo::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInfo.name) + return name_.Get(); +} +inline void GraphTransferNodeInfo::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInfo.name) +} +#if LANG_CXX11 +inline void GraphTransferNodeInfo::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GraphTransferNodeInfo.name) +} +#endif +inline void GraphTransferNodeInfo::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GraphTransferNodeInfo.name) +} +inline void GraphTransferNodeInfo::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GraphTransferNodeInfo.name) +} +inline ::std::string* GraphTransferNodeInfo::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferNodeInfo.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GraphTransferNodeInfo::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphTransferNodeInfo.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GraphTransferNodeInfo::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphTransferNodeInfo.name) +} +inline ::std::string* GraphTransferNodeInfo::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphTransferNodeInfo.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GraphTransferNodeInfo::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphTransferNodeInfo.name) +} + +// int32 node_id = 2; +inline void GraphTransferNodeInfo::clear_node_id() { + node_id_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInfo::node_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInfo.node_id) + return node_id_; +} +inline void GraphTransferNodeInfo::set_node_id(::google::protobuf::int32 value) { + + node_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInfo.node_id) +} + +// string type_name = 3; +inline void GraphTransferNodeInfo::clear_type_name() { + type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GraphTransferNodeInfo::type_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) + return type_name_.Get(); +} +inline void GraphTransferNodeInfo::set_type_name(const ::std::string& value) { + + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) +} +#if LANG_CXX11 +inline void GraphTransferNodeInfo::set_type_name(::std::string&& value) { + + type_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) +} +#endif +inline void GraphTransferNodeInfo::set_type_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) +} +inline void GraphTransferNodeInfo::set_type_name(const char* value, + size_t size) { + + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) +} +inline ::std::string* GraphTransferNodeInfo::mutable_type_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) + return type_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GraphTransferNodeInfo::release_type_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) + + return type_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GraphTransferNodeInfo::set_allocated_type_name(::std::string* type_name) { + if (type_name != NULL) { + + } else { + + } + type_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) +} +inline ::std::string* GraphTransferNodeInfo::unsafe_arena_release_type_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GraphTransferNodeInfo::unsafe_arena_set_allocated_type_name( + ::std::string* type_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_name != NULL) { + + } else { + + } + type_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphTransferNodeInfo.type_name) +} + +// int32 soc_op_id = 4; +inline void GraphTransferNodeInfo::clear_soc_op_id() { + soc_op_id_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInfo::soc_op_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInfo.soc_op_id) + return soc_op_id_; +} +inline void GraphTransferNodeInfo::set_soc_op_id(::google::protobuf::int32 value) { + + soc_op_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInfo.soc_op_id) +} + +// int32 padding_id = 5; +inline void GraphTransferNodeInfo::clear_padding_id() { + padding_id_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInfo::padding_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInfo.padding_id) + return padding_id_; +} +inline void GraphTransferNodeInfo::set_padding_id(::google::protobuf::int32 value) { + + padding_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInfo.padding_id) +} + +// int32 input_count = 6; +inline void GraphTransferNodeInfo::clear_input_count() { + input_count_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInfo::input_count() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInfo.input_count) + return input_count_; +} +inline void GraphTransferNodeInfo::set_input_count(::google::protobuf::int32 value) { + + input_count_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInfo.input_count) +} + +// int32 output_count = 7; +inline void GraphTransferNodeInfo::clear_output_count() { + output_count_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInfo::output_count() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInfo.output_count) + return output_count_; +} +inline void GraphTransferNodeInfo::set_output_count(::google::protobuf::int32 value) { + + output_count_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInfo.output_count) +} + +// ------------------------------------------------------------------- + +// GraphTransferConstNodeInfo + +// string name = 1; +inline void GraphTransferConstNodeInfo::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GraphTransferConstNodeInfo::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) + return name_.Get(); +} +inline void GraphTransferConstNodeInfo::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) +} +#if LANG_CXX11 +inline void GraphTransferConstNodeInfo::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) +} +#endif +inline void GraphTransferConstNodeInfo::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) +} +inline void GraphTransferConstNodeInfo::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) +} +inline ::std::string* GraphTransferConstNodeInfo::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GraphTransferConstNodeInfo::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GraphTransferConstNodeInfo::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) +} +inline ::std::string* GraphTransferConstNodeInfo::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GraphTransferConstNodeInfo::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphTransferConstNodeInfo.name) +} + +// int32 node_id = 2; +inline void GraphTransferConstNodeInfo::clear_node_id() { + node_id_ = 0; +} +inline ::google::protobuf::int32 GraphTransferConstNodeInfo::node_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferConstNodeInfo.node_id) + return node_id_; +} +inline void GraphTransferConstNodeInfo::set_node_id(::google::protobuf::int32 value) { + + node_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferConstNodeInfo.node_id) +} + +// repeated int64 shape = 3; +inline int GraphTransferConstNodeInfo::shape_size() const { + return shape_.size(); +} +inline void GraphTransferConstNodeInfo::clear_shape() { + shape_.Clear(); +} +inline ::google::protobuf::int64 GraphTransferConstNodeInfo::shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferConstNodeInfo.shape) + return shape_.Get(index); +} +inline void GraphTransferConstNodeInfo::set_shape(int index, ::google::protobuf::int64 value) { + shape_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferConstNodeInfo.shape) +} +inline void GraphTransferConstNodeInfo::add_shape(::google::protobuf::int64 value) { + shape_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferConstNodeInfo.shape) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +GraphTransferConstNodeInfo::shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferConstNodeInfo.shape) + return shape_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +GraphTransferConstNodeInfo::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferConstNodeInfo.shape) + return &shape_; +} + +// bytes data = 4; +inline void GraphTransferConstNodeInfo::clear_data() { + data_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GraphTransferConstNodeInfo::data() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) + return data_.Get(); +} +inline void GraphTransferConstNodeInfo::set_data(const ::std::string& value) { + + data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) +} +#if LANG_CXX11 +inline void GraphTransferConstNodeInfo::set_data(::std::string&& value) { + + data_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) +} +#endif +inline void GraphTransferConstNodeInfo::set_data(const char* value) { + GOOGLE_DCHECK(value != NULL); + + data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) +} +inline void GraphTransferConstNodeInfo::set_data(const void* value, + size_t size) { + + data_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) +} +inline ::std::string* GraphTransferConstNodeInfo::mutable_data() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) + return data_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GraphTransferConstNodeInfo::release_data() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) + + return data_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GraphTransferConstNodeInfo::set_allocated_data(::std::string* data) { + if (data != NULL) { + + } else { + + } + data_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) +} +inline ::std::string* GraphTransferConstNodeInfo::unsafe_arena_release_data() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return data_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GraphTransferConstNodeInfo::unsafe_arena_set_allocated_data( + ::std::string* data) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (data != NULL) { + + } else { + + } + data_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + data, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphTransferConstNodeInfo.data) +} + +// .diplomacy.tensorflow.DataType dtype = 5; +inline void GraphTransferConstNodeInfo::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType GraphTransferConstNodeInfo::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferConstNodeInfo.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void GraphTransferConstNodeInfo::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferConstNodeInfo.dtype) +} + +// ------------------------------------------------------------------- + +// GraphTransferNodeInputInfo + +// int32 node_id = 1; +inline void GraphTransferNodeInputInfo::clear_node_id() { + node_id_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeInputInfo::node_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInputInfo.node_id) + return node_id_; +} +inline void GraphTransferNodeInputInfo::set_node_id(::google::protobuf::int32 value) { + + node_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeInputInfo.node_id) +} + +// repeated .diplomacy.tensorflow.GraphTransferNodeInput node_input = 2; +inline int GraphTransferNodeInputInfo::node_input_size() const { + return node_input_.size(); +} +inline void GraphTransferNodeInputInfo::clear_node_input() { + node_input_.Clear(); +} +inline ::diplomacy::tensorflow::GraphTransferNodeInput* GraphTransferNodeInputInfo::mutable_node_input(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferNodeInputInfo.node_input) + return node_input_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInput >* +GraphTransferNodeInputInfo::mutable_node_input() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferNodeInputInfo.node_input) + return &node_input_; +} +inline const ::diplomacy::tensorflow::GraphTransferNodeInput& GraphTransferNodeInputInfo::node_input(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeInputInfo.node_input) + return node_input_.Get(index); +} +inline ::diplomacy::tensorflow::GraphTransferNodeInput* GraphTransferNodeInputInfo::add_node_input() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferNodeInputInfo.node_input) + return node_input_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInput >& +GraphTransferNodeInputInfo::node_input() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferNodeInputInfo.node_input) + return node_input_; +} + +// ------------------------------------------------------------------- + +// GraphTransferNodeOutputInfo + +// int32 node_id = 1; +inline void GraphTransferNodeOutputInfo::clear_node_id() { + node_id_ = 0; +} +inline ::google::protobuf::int32 GraphTransferNodeOutputInfo::node_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeOutputInfo.node_id) + return node_id_; +} +inline void GraphTransferNodeOutputInfo::set_node_id(::google::protobuf::int32 value) { + + node_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeOutputInfo.node_id) +} + +// repeated int32 max_byte_size = 2; +inline int GraphTransferNodeOutputInfo::max_byte_size_size() const { + return max_byte_size_.size(); +} +inline void GraphTransferNodeOutputInfo::clear_max_byte_size() { + max_byte_size_.Clear(); +} +inline ::google::protobuf::int32 GraphTransferNodeOutputInfo::max_byte_size(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferNodeOutputInfo.max_byte_size) + return max_byte_size_.Get(index); +} +inline void GraphTransferNodeOutputInfo::set_max_byte_size(int index, ::google::protobuf::int32 value) { + max_byte_size_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferNodeOutputInfo.max_byte_size) +} +inline void GraphTransferNodeOutputInfo::add_max_byte_size(::google::protobuf::int32 value) { + max_byte_size_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferNodeOutputInfo.max_byte_size) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +GraphTransferNodeOutputInfo::max_byte_size() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferNodeOutputInfo.max_byte_size) + return max_byte_size_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +GraphTransferNodeOutputInfo::mutable_max_byte_size() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferNodeOutputInfo.max_byte_size) + return &max_byte_size_; +} + +// ------------------------------------------------------------------- + +// GraphTransferGraphInputNodeInfo + +// string name = 1; +inline void GraphTransferGraphInputNodeInfo::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GraphTransferGraphInputNodeInfo::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) + return name_.Get(); +} +inline void GraphTransferGraphInputNodeInfo::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) +} +#if LANG_CXX11 +inline void GraphTransferGraphInputNodeInfo::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) +} +#endif +inline void GraphTransferGraphInputNodeInfo::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) +} +inline void GraphTransferGraphInputNodeInfo::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) +} +inline ::std::string* GraphTransferGraphInputNodeInfo::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GraphTransferGraphInputNodeInfo::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GraphTransferGraphInputNodeInfo::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) +} +inline ::std::string* GraphTransferGraphInputNodeInfo::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GraphTransferGraphInputNodeInfo::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name) +} + +// repeated int64 shape = 2; +inline int GraphTransferGraphInputNodeInfo::shape_size() const { + return shape_.size(); +} +inline void GraphTransferGraphInputNodeInfo::clear_shape() { + shape_.Clear(); +} +inline ::google::protobuf::int64 GraphTransferGraphInputNodeInfo::shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.shape) + return shape_.Get(index); +} +inline void GraphTransferGraphInputNodeInfo::set_shape(int index, ::google::protobuf::int64 value) { + shape_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.shape) +} +inline void GraphTransferGraphInputNodeInfo::add_shape(::google::protobuf::int64 value) { + shape_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.shape) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +GraphTransferGraphInputNodeInfo::shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.shape) + return shape_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +GraphTransferGraphInputNodeInfo::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.shape) + return &shape_; +} + +// .diplomacy.tensorflow.DataType dtype = 3; +inline void GraphTransferGraphInputNodeInfo::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType GraphTransferGraphInputNodeInfo::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void GraphTransferGraphInputNodeInfo::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.dtype) +} + +// ------------------------------------------------------------------- + +// GraphTransferGraphOutputNodeInfo + +// string name = 1; +inline void GraphTransferGraphOutputNodeInfo::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GraphTransferGraphOutputNodeInfo::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) + return name_.Get(); +} +inline void GraphTransferGraphOutputNodeInfo::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) +} +#if LANG_CXX11 +inline void GraphTransferGraphOutputNodeInfo::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) +} +#endif +inline void GraphTransferGraphOutputNodeInfo::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) +} +inline void GraphTransferGraphOutputNodeInfo::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) +} +inline ::std::string* GraphTransferGraphOutputNodeInfo::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GraphTransferGraphOutputNodeInfo::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void GraphTransferGraphOutputNodeInfo::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) +} +inline ::std::string* GraphTransferGraphOutputNodeInfo::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GraphTransferGraphOutputNodeInfo::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name) +} + +// repeated int64 shape = 2; +inline int GraphTransferGraphOutputNodeInfo::shape_size() const { + return shape_.size(); +} +inline void GraphTransferGraphOutputNodeInfo::clear_shape() { + shape_.Clear(); +} +inline ::google::protobuf::int64 GraphTransferGraphOutputNodeInfo::shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.shape) + return shape_.Get(index); +} +inline void GraphTransferGraphOutputNodeInfo::set_shape(int index, ::google::protobuf::int64 value) { + shape_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.shape) +} +inline void GraphTransferGraphOutputNodeInfo::add_shape(::google::protobuf::int64 value) { + shape_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.shape) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +GraphTransferGraphOutputNodeInfo::shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.shape) + return shape_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +GraphTransferGraphOutputNodeInfo::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.shape) + return &shape_; +} + +// .diplomacy.tensorflow.DataType dtype = 3; +inline void GraphTransferGraphOutputNodeInfo::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType GraphTransferGraphOutputNodeInfo::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void GraphTransferGraphOutputNodeInfo::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.dtype) +} + +// ------------------------------------------------------------------- + +// GraphTransferInfo + +// repeated .diplomacy.tensorflow.GraphTransferNodeInfo node_info = 1; +inline int GraphTransferInfo::node_info_size() const { + return node_info_.size(); +} +inline void GraphTransferInfo::clear_node_info() { + node_info_.Clear(); +} +inline ::diplomacy::tensorflow::GraphTransferNodeInfo* GraphTransferInfo::mutable_node_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferInfo.node_info) + return node_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInfo >* +GraphTransferInfo::mutable_node_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferInfo.node_info) + return &node_info_; +} +inline const ::diplomacy::tensorflow::GraphTransferNodeInfo& GraphTransferInfo::node_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferInfo.node_info) + return node_info_.Get(index); +} +inline ::diplomacy::tensorflow::GraphTransferNodeInfo* GraphTransferInfo::add_node_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferInfo.node_info) + return node_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInfo >& +GraphTransferInfo::node_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferInfo.node_info) + return node_info_; +} + +// repeated .diplomacy.tensorflow.GraphTransferConstNodeInfo const_node_info = 2; +inline int GraphTransferInfo::const_node_info_size() const { + return const_node_info_.size(); +} +inline void GraphTransferInfo::clear_const_node_info() { + const_node_info_.Clear(); +} +inline ::diplomacy::tensorflow::GraphTransferConstNodeInfo* GraphTransferInfo::mutable_const_node_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferInfo.const_node_info) + return const_node_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferConstNodeInfo >* +GraphTransferInfo::mutable_const_node_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferInfo.const_node_info) + return &const_node_info_; +} +inline const ::diplomacy::tensorflow::GraphTransferConstNodeInfo& GraphTransferInfo::const_node_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferInfo.const_node_info) + return const_node_info_.Get(index); +} +inline ::diplomacy::tensorflow::GraphTransferConstNodeInfo* GraphTransferInfo::add_const_node_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferInfo.const_node_info) + return const_node_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferConstNodeInfo >& +GraphTransferInfo::const_node_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferInfo.const_node_info) + return const_node_info_; +} + +// repeated .diplomacy.tensorflow.GraphTransferNodeInputInfo node_input_info = 3; +inline int GraphTransferInfo::node_input_info_size() const { + return node_input_info_.size(); +} +inline void GraphTransferInfo::clear_node_input_info() { + node_input_info_.Clear(); +} +inline ::diplomacy::tensorflow::GraphTransferNodeInputInfo* GraphTransferInfo::mutable_node_input_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferInfo.node_input_info) + return node_input_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInputInfo >* +GraphTransferInfo::mutable_node_input_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferInfo.node_input_info) + return &node_input_info_; +} +inline const ::diplomacy::tensorflow::GraphTransferNodeInputInfo& GraphTransferInfo::node_input_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferInfo.node_input_info) + return node_input_info_.Get(index); +} +inline ::diplomacy::tensorflow::GraphTransferNodeInputInfo* GraphTransferInfo::add_node_input_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferInfo.node_input_info) + return node_input_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeInputInfo >& +GraphTransferInfo::node_input_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferInfo.node_input_info) + return node_input_info_; +} + +// repeated .diplomacy.tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; +inline int GraphTransferInfo::node_output_info_size() const { + return node_output_info_.size(); +} +inline void GraphTransferInfo::clear_node_output_info() { + node_output_info_.Clear(); +} +inline ::diplomacy::tensorflow::GraphTransferNodeOutputInfo* GraphTransferInfo::mutable_node_output_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferInfo.node_output_info) + return node_output_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeOutputInfo >* +GraphTransferInfo::mutable_node_output_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferInfo.node_output_info) + return &node_output_info_; +} +inline const ::diplomacy::tensorflow::GraphTransferNodeOutputInfo& GraphTransferInfo::node_output_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferInfo.node_output_info) + return node_output_info_.Get(index); +} +inline ::diplomacy::tensorflow::GraphTransferNodeOutputInfo* GraphTransferInfo::add_node_output_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferInfo.node_output_info) + return node_output_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferNodeOutputInfo >& +GraphTransferInfo::node_output_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferInfo.node_output_info) + return node_output_info_; +} + +// repeated .diplomacy.tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; +inline int GraphTransferInfo::graph_input_node_info_size() const { + return graph_input_node_info_.size(); +} +inline void GraphTransferInfo::clear_graph_input_node_info() { + graph_input_node_info_.Clear(); +} +inline ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo* GraphTransferInfo::mutable_graph_input_node_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferInfo.graph_input_node_info) + return graph_input_node_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo >* +GraphTransferInfo::mutable_graph_input_node_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferInfo.graph_input_node_info) + return &graph_input_node_info_; +} +inline const ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo& GraphTransferInfo::graph_input_node_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferInfo.graph_input_node_info) + return graph_input_node_info_.Get(index); +} +inline ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo* GraphTransferInfo::add_graph_input_node_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferInfo.graph_input_node_info) + return graph_input_node_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphInputNodeInfo >& +GraphTransferInfo::graph_input_node_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferInfo.graph_input_node_info) + return graph_input_node_info_; +} + +// repeated .diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; +inline int GraphTransferInfo::graph_output_node_info_size() const { + return graph_output_node_info_.size(); +} +inline void GraphTransferInfo::clear_graph_output_node_info() { + graph_output_node_info_.Clear(); +} +inline ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo* GraphTransferInfo::mutable_graph_output_node_info(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.GraphTransferInfo.graph_output_node_info) + return graph_output_node_info_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo >* +GraphTransferInfo::mutable_graph_output_node_info() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.GraphTransferInfo.graph_output_node_info) + return &graph_output_node_info_; +} +inline const ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo& GraphTransferInfo::graph_output_node_info(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferInfo.graph_output_node_info) + return graph_output_node_info_.Get(index); +} +inline ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo* GraphTransferInfo::add_graph_output_node_info() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.GraphTransferInfo.graph_output_node_info) + return graph_output_node_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::GraphTransferGraphOutputNodeInfo >& +GraphTransferInfo::graph_output_node_info() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.GraphTransferInfo.graph_output_node_info) + return graph_output_node_info_; +} + +// .diplomacy.tensorflow.GraphTransferInfo.Destination destination = 7; +inline void GraphTransferInfo::clear_destination() { + destination_ = 0; +} +inline ::diplomacy::tensorflow::GraphTransferInfo_Destination GraphTransferInfo::destination() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.GraphTransferInfo.destination) + return static_cast< ::diplomacy::tensorflow::GraphTransferInfo_Destination >(destination_); +} +inline void GraphTransferInfo::set_destination(::diplomacy::tensorflow::GraphTransferInfo_Destination value) { + + destination_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.GraphTransferInfo.destination) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::GraphTransferInfo_Destination> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::GraphTransferInfo_Destination>() { + return ::diplomacy::tensorflow::GraphTransferInfo_Destination_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_5ftransfer_5finfo_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.proto new file mode 100644 index 0000000..b212588 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "GraphTransferInfoProto"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +message GraphTransferNodeInput { + int32 node_id = 1; + int32 output_port = 2; +} +message GraphTransferNodeInfo { + string name = 1; + int32 node_id = 2; + string type_name = 3; + int32 soc_op_id = 4; + int32 padding_id = 5; + int32 input_count = 6; + int32 output_count = 7; +}; +message GraphTransferConstNodeInfo { + string name = 1; + int32 node_id = 2; + repeated int64 shape = 3; + bytes data = 4; + DataType dtype = 5; +}; +message GraphTransferNodeInputInfo { + int32 node_id = 1; + repeated GraphTransferNodeInput node_input = 2; +}; +message GraphTransferNodeOutputInfo { + int32 node_id = 1; + repeated int32 max_byte_size = 2; +}; +message GraphTransferGraphInputNodeInfo { + string name = 1; + repeated int64 shape = 2; + DataType dtype = 3; +} + +message GraphTransferGraphOutputNodeInfo { + string name = 1; + repeated int64 shape = 2; + DataType dtype = 3; +} + +// 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. +message GraphTransferInfo { + enum Destination { + NOP = 0; + HEXAGON = 1; + } + + repeated GraphTransferNodeInfo node_info = 1; + repeated GraphTransferConstNodeInfo const_node_info = 2; + repeated GraphTransferNodeInputInfo node_input_info = 3; + repeated GraphTransferNodeOutputInfo node_output_info = 4; + // Input Node parameters of transferred graph + repeated GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + repeated GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + // Destination of graph transfer + Destination destination = 7; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info_pb2.py new file mode 100644 index 0000000..81ebbb5 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/graph_transfer_info_pb2.py @@ -0,0 +1,541 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/graph_transfer_info.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/graph_transfer_info.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\026GraphTransferInfoProtoP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n=diplomacy_tensorflow/core/framework/graph_transfer_info.proto\x12\x14\x64iplomacy.tensorflow\x1a/diplomacy_tensorflow/core/framework/types.proto\">\n\x16GraphTransferNodeInput\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x13\n\x0boutput_port\x18\x02 \x01(\x05\"\x9b\x01\n\x15GraphTransferNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x05\x12\x11\n\ttype_name\x18\x03 \x01(\t\x12\x11\n\tsoc_op_id\x18\x04 \x01(\x05\x12\x12\n\npadding_id\x18\x05 \x01(\x05\x12\x13\n\x0binput_count\x18\x06 \x01(\x05\x12\x14\n\x0coutput_count\x18\x07 \x01(\x05\"\x87\x01\n\x1aGraphTransferConstNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x05\x12\r\n\x05shape\x18\x03 \x03(\x03\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12-\n\x05\x64type\x18\x05 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\"o\n\x1aGraphTransferNodeInputInfo\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12@\n\nnode_input\x18\x02 \x03(\x0b\x32,.diplomacy.tensorflow.GraphTransferNodeInput\"E\n\x1bGraphTransferNodeOutputInfo\x12\x0f\n\x07node_id\x18\x01 \x01(\x05\x12\x15\n\rmax_byte_size\x18\x02 \x03(\x05\"m\n\x1fGraphTransferGraphInputNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05shape\x18\x02 \x03(\x03\x12-\n\x05\x64type\x18\x03 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\"n\n GraphTransferGraphOutputNodeInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05shape\x18\x02 \x03(\x03\x12-\n\x05\x64type\x18\x03 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\"\xd3\x04\n\x11GraphTransferInfo\x12>\n\tnode_info\x18\x01 \x03(\x0b\x32+.diplomacy.tensorflow.GraphTransferNodeInfo\x12I\n\x0f\x63onst_node_info\x18\x02 \x03(\x0b\x32\x30.diplomacy.tensorflow.GraphTransferConstNodeInfo\x12I\n\x0fnode_input_info\x18\x03 \x03(\x0b\x32\x30.diplomacy.tensorflow.GraphTransferNodeInputInfo\x12K\n\x10node_output_info\x18\x04 \x03(\x0b\x32\x31.diplomacy.tensorflow.GraphTransferNodeOutputInfo\x12T\n\x15graph_input_node_info\x18\x05 \x03(\x0b\x32\x35.diplomacy.tensorflow.GraphTransferGraphInputNodeInfo\x12V\n\x16graph_output_node_info\x18\x06 \x03(\x0b\x32\x36.diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo\x12H\n\x0b\x64\x65stination\x18\x07 \x01(\x0e\x32\x33.diplomacy.tensorflow.GraphTransferInfo.Destination\"#\n\x0b\x44\x65stination\x12\x07\n\x03NOP\x10\x00\x12\x0b\n\x07HEXAGON\x10\x01\x42v\n\x18org.tensorflow.frameworkB\x16GraphTransferInfoProtoP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + +_GRAPHTRANSFERINFO_DESTINATION = _descriptor.EnumDescriptor( + name='Destination', + full_name='diplomacy.tensorflow.GraphTransferInfo.Destination', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='NOP', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='HEXAGON', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1464, + serialized_end=1499, +) +_sym_db.RegisterEnumDescriptor(_GRAPHTRANSFERINFO_DESTINATION) + + +_GRAPHTRANSFERNODEINPUT = _descriptor.Descriptor( + name='GraphTransferNodeInput', + full_name='diplomacy.tensorflow.GraphTransferNodeInput', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_id', full_name='diplomacy.tensorflow.GraphTransferNodeInput.node_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_port', full_name='diplomacy.tensorflow.GraphTransferNodeInput.output_port', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=136, + serialized_end=198, +) + + +_GRAPHTRANSFERNODEINFO = _descriptor.Descriptor( + name='GraphTransferNodeInfo', + full_name='diplomacy.tensorflow.GraphTransferNodeInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.GraphTransferNodeInfo.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_id', full_name='diplomacy.tensorflow.GraphTransferNodeInfo.node_id', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type_name', full_name='diplomacy.tensorflow.GraphTransferNodeInfo.type_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='soc_op_id', full_name='diplomacy.tensorflow.GraphTransferNodeInfo.soc_op_id', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='padding_id', full_name='diplomacy.tensorflow.GraphTransferNodeInfo.padding_id', index=4, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input_count', full_name='diplomacy.tensorflow.GraphTransferNodeInfo.input_count', index=5, + number=6, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_count', full_name='diplomacy.tensorflow.GraphTransferNodeInfo.output_count', index=6, + number=7, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=201, + serialized_end=356, +) + + +_GRAPHTRANSFERCONSTNODEINFO = _descriptor.Descriptor( + name='GraphTransferConstNodeInfo', + full_name='diplomacy.tensorflow.GraphTransferConstNodeInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.GraphTransferConstNodeInfo.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_id', full_name='diplomacy.tensorflow.GraphTransferConstNodeInfo.node_id', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.GraphTransferConstNodeInfo.shape', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='data', full_name='diplomacy.tensorflow.GraphTransferConstNodeInfo.data', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.GraphTransferConstNodeInfo.dtype', index=4, + number=5, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=359, + serialized_end=494, +) + + +_GRAPHTRANSFERNODEINPUTINFO = _descriptor.Descriptor( + name='GraphTransferNodeInputInfo', + full_name='diplomacy.tensorflow.GraphTransferNodeInputInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_id', full_name='diplomacy.tensorflow.GraphTransferNodeInputInfo.node_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_input', full_name='diplomacy.tensorflow.GraphTransferNodeInputInfo.node_input', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=496, + serialized_end=607, +) + + +_GRAPHTRANSFERNODEOUTPUTINFO = _descriptor.Descriptor( + name='GraphTransferNodeOutputInfo', + full_name='diplomacy.tensorflow.GraphTransferNodeOutputInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_id', full_name='diplomacy.tensorflow.GraphTransferNodeOutputInfo.node_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_byte_size', full_name='diplomacy.tensorflow.GraphTransferNodeOutputInfo.max_byte_size', index=1, + number=2, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=609, + serialized_end=678, +) + + +_GRAPHTRANSFERGRAPHINPUTNODEINFO = _descriptor.Descriptor( + name='GraphTransferGraphInputNodeInfo', + full_name='diplomacy.tensorflow.GraphTransferGraphInputNodeInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.shape', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.GraphTransferGraphInputNodeInfo.dtype', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=680, + serialized_end=789, +) + + +_GRAPHTRANSFERGRAPHOUTPUTNODEINFO = _descriptor.Descriptor( + name='GraphTransferGraphOutputNodeInfo', + full_name='diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.shape', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo.dtype', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=791, + serialized_end=901, +) + + +_GRAPHTRANSFERINFO = _descriptor.Descriptor( + name='GraphTransferInfo', + full_name='diplomacy.tensorflow.GraphTransferInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_info', full_name='diplomacy.tensorflow.GraphTransferInfo.node_info', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='const_node_info', full_name='diplomacy.tensorflow.GraphTransferInfo.const_node_info', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_input_info', full_name='diplomacy.tensorflow.GraphTransferInfo.node_input_info', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node_output_info', full_name='diplomacy.tensorflow.GraphTransferInfo.node_output_info', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph_input_node_info', full_name='diplomacy.tensorflow.GraphTransferInfo.graph_input_node_info', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph_output_node_info', full_name='diplomacy.tensorflow.GraphTransferInfo.graph_output_node_info', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='destination', full_name='diplomacy.tensorflow.GraphTransferInfo.destination', index=6, + number=7, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _GRAPHTRANSFERINFO_DESTINATION, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=904, + serialized_end=1499, +) + +_GRAPHTRANSFERCONSTNODEINFO.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_GRAPHTRANSFERNODEINPUTINFO.fields_by_name['node_input'].message_type = _GRAPHTRANSFERNODEINPUT +_GRAPHTRANSFERGRAPHINPUTNODEINFO.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_GRAPHTRANSFERGRAPHOUTPUTNODEINFO.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_GRAPHTRANSFERINFO.fields_by_name['node_info'].message_type = _GRAPHTRANSFERNODEINFO +_GRAPHTRANSFERINFO.fields_by_name['const_node_info'].message_type = _GRAPHTRANSFERCONSTNODEINFO +_GRAPHTRANSFERINFO.fields_by_name['node_input_info'].message_type = _GRAPHTRANSFERNODEINPUTINFO +_GRAPHTRANSFERINFO.fields_by_name['node_output_info'].message_type = _GRAPHTRANSFERNODEOUTPUTINFO +_GRAPHTRANSFERINFO.fields_by_name['graph_input_node_info'].message_type = _GRAPHTRANSFERGRAPHINPUTNODEINFO +_GRAPHTRANSFERINFO.fields_by_name['graph_output_node_info'].message_type = _GRAPHTRANSFERGRAPHOUTPUTNODEINFO +_GRAPHTRANSFERINFO.fields_by_name['destination'].enum_type = _GRAPHTRANSFERINFO_DESTINATION +_GRAPHTRANSFERINFO_DESTINATION.containing_type = _GRAPHTRANSFERINFO +DESCRIPTOR.message_types_by_name['GraphTransferNodeInput'] = _GRAPHTRANSFERNODEINPUT +DESCRIPTOR.message_types_by_name['GraphTransferNodeInfo'] = _GRAPHTRANSFERNODEINFO +DESCRIPTOR.message_types_by_name['GraphTransferConstNodeInfo'] = _GRAPHTRANSFERCONSTNODEINFO +DESCRIPTOR.message_types_by_name['GraphTransferNodeInputInfo'] = _GRAPHTRANSFERNODEINPUTINFO +DESCRIPTOR.message_types_by_name['GraphTransferNodeOutputInfo'] = _GRAPHTRANSFERNODEOUTPUTINFO +DESCRIPTOR.message_types_by_name['GraphTransferGraphInputNodeInfo'] = _GRAPHTRANSFERGRAPHINPUTNODEINFO +DESCRIPTOR.message_types_by_name['GraphTransferGraphOutputNodeInfo'] = _GRAPHTRANSFERGRAPHOUTPUTNODEINFO +DESCRIPTOR.message_types_by_name['GraphTransferInfo'] = _GRAPHTRANSFERINFO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +GraphTransferNodeInput = _reflection.GeneratedProtocolMessageType('GraphTransferNodeInput', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERNODEINPUT, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeInput) + )) +_sym_db.RegisterMessage(GraphTransferNodeInput) + +GraphTransferNodeInfo = _reflection.GeneratedProtocolMessageType('GraphTransferNodeInfo', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERNODEINFO, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeInfo) + )) +_sym_db.RegisterMessage(GraphTransferNodeInfo) + +GraphTransferConstNodeInfo = _reflection.GeneratedProtocolMessageType('GraphTransferConstNodeInfo', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERCONSTNODEINFO, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferConstNodeInfo) + )) +_sym_db.RegisterMessage(GraphTransferConstNodeInfo) + +GraphTransferNodeInputInfo = _reflection.GeneratedProtocolMessageType('GraphTransferNodeInputInfo', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERNODEINPUTINFO, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeInputInfo) + )) +_sym_db.RegisterMessage(GraphTransferNodeInputInfo) + +GraphTransferNodeOutputInfo = _reflection.GeneratedProtocolMessageType('GraphTransferNodeOutputInfo', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERNODEOUTPUTINFO, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferNodeOutputInfo) + )) +_sym_db.RegisterMessage(GraphTransferNodeOutputInfo) + +GraphTransferGraphInputNodeInfo = _reflection.GeneratedProtocolMessageType('GraphTransferGraphInputNodeInfo', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERGRAPHINPUTNODEINFO, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferGraphInputNodeInfo) + )) +_sym_db.RegisterMessage(GraphTransferGraphInputNodeInfo) + +GraphTransferGraphOutputNodeInfo = _reflection.GeneratedProtocolMessageType('GraphTransferGraphOutputNodeInfo', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERGRAPHOUTPUTNODEINFO, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferGraphOutputNodeInfo) + )) +_sym_db.RegisterMessage(GraphTransferGraphOutputNodeInfo) + +GraphTransferInfo = _reflection.GeneratedProtocolMessageType('GraphTransferInfo', (_message.Message,), dict( + DESCRIPTOR = _GRAPHTRANSFERINFO, + __module__ = 'diplomacy_tensorflow.core.framework.graph_transfer_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.GraphTransferInfo) + )) +_sym_db.RegisterMessage(GraphTransferInfo) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.pb.cc new file mode 100644 index 0000000..417eee9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.pb.cc @@ -0,0 +1,452 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/iterator.proto + +#include "diplomacy_tensorflow/core/framework/iterator.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +class IteratorStateMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _IteratorStateMetadata_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto { +static void InitDefaultsIteratorStateMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_IteratorStateMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::IteratorStateMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::IteratorStateMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_IteratorStateMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsIteratorStateMetadata}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_IteratorStateMetadata.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::IteratorStateMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::IteratorStateMetadata, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::IteratorStateMetadata, keys_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::IteratorStateMetadata)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_IteratorStateMetadata_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/iterator.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n2diplomacy_tensorflow/core/framework/it" + "erator.proto\022\024diplomacy.tensorflow\"6\n\025It" + "eratorStateMetadata\022\017\n\007version\030\001 \001(\t\022\014\n\004" + "keys\030\002 \003(\tBi\n\023org.tensorflow.utilB\016Itera" + "torProtosP\001Z=github.com/tensorflow/tenso" + "rflow/tensorflow/go/core/framework\370\001\001b\006p" + "roto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 245); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/iterator.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void IteratorStateMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int IteratorStateMetadata::kVersionFieldNumber; +const int IteratorStateMetadata::kKeysFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +IteratorStateMetadata::IteratorStateMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::scc_info_IteratorStateMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.IteratorStateMetadata) +} +IteratorStateMetadata::IteratorStateMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + keys_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::scc_info_IteratorStateMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.IteratorStateMetadata) +} +IteratorStateMetadata::IteratorStateMetadata(const IteratorStateMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + keys_(from.keys_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.version().size() > 0) { + version_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.IteratorStateMetadata) +} + +void IteratorStateMetadata::SharedCtor() { + version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +IteratorStateMetadata::~IteratorStateMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.IteratorStateMetadata) + SharedDtor(); +} + +void IteratorStateMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void IteratorStateMetadata::ArenaDtor(void* object) { + IteratorStateMetadata* _this = reinterpret_cast< IteratorStateMetadata* >(object); + (void)_this; +} +void IteratorStateMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void IteratorStateMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* IteratorStateMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const IteratorStateMetadata& IteratorStateMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::scc_info_IteratorStateMetadata.base); + return *internal_default_instance(); +} + + +void IteratorStateMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.IteratorStateMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + keys_.Clear(); + version_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool IteratorStateMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.IteratorStateMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_version())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->version().data(), static_cast(this->version().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.IteratorStateMetadata.version")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string keys = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_keys())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->keys(this->keys_size() - 1).data(), + static_cast(this->keys(this->keys_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.IteratorStateMetadata.keys")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.IteratorStateMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.IteratorStateMetadata) + return false; +#undef DO_ +} + +void IteratorStateMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.IteratorStateMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string version = 1; + if (this->version().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->version().data(), static_cast(this->version().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.IteratorStateMetadata.version"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->version(), output); + } + + // repeated string keys = 2; + for (int i = 0, n = this->keys_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->keys(i).data(), static_cast(this->keys(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.IteratorStateMetadata.keys"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->keys(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.IteratorStateMetadata) +} + +::google::protobuf::uint8* IteratorStateMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.IteratorStateMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string version = 1; + if (this->version().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->version().data(), static_cast(this->version().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.IteratorStateMetadata.version"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->version(), target); + } + + // repeated string keys = 2; + for (int i = 0, n = this->keys_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->keys(i).data(), static_cast(this->keys(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.IteratorStateMetadata.keys"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(2, this->keys(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.IteratorStateMetadata) + return target; +} + +size_t IteratorStateMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.IteratorStateMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string keys = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->keys_size()); + for (int i = 0, n = this->keys_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->keys(i)); + } + + // string version = 1; + if (this->version().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->version()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void IteratorStateMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.IteratorStateMetadata) + GOOGLE_DCHECK_NE(&from, this); + const IteratorStateMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.IteratorStateMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.IteratorStateMetadata) + MergeFrom(*source); + } +} + +void IteratorStateMetadata::MergeFrom(const IteratorStateMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.IteratorStateMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + keys_.MergeFrom(from.keys_); + if (from.version().size() > 0) { + set_version(from.version()); + } +} + +void IteratorStateMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.IteratorStateMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void IteratorStateMetadata::CopyFrom(const IteratorStateMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.IteratorStateMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool IteratorStateMetadata::IsInitialized() const { + return true; +} + +void IteratorStateMetadata::Swap(IteratorStateMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + IteratorStateMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void IteratorStateMetadata::UnsafeArenaSwap(IteratorStateMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void IteratorStateMetadata::InternalSwap(IteratorStateMetadata* other) { + using std::swap; + keys_.InternalSwap(CastToBase(&other->keys_)); + version_.Swap(&other->version_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata IteratorStateMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::IteratorStateMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::IteratorStateMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::IteratorStateMetadata >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.pb.h new file mode 100644 index 0000000..63c1691 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.pb.h @@ -0,0 +1,387 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/iterator.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto +namespace diplomacy { +namespace tensorflow { +class IteratorStateMetadata; +class IteratorStateMetadataDefaultTypeInternal; +extern IteratorStateMetadataDefaultTypeInternal _IteratorStateMetadata_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::IteratorStateMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::IteratorStateMetadata>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class IteratorStateMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.IteratorStateMetadata) */ { + public: + IteratorStateMetadata(); + virtual ~IteratorStateMetadata(); + + IteratorStateMetadata(const IteratorStateMetadata& from); + + inline IteratorStateMetadata& operator=(const IteratorStateMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + IteratorStateMetadata(IteratorStateMetadata&& from) noexcept + : IteratorStateMetadata() { + *this = ::std::move(from); + } + + inline IteratorStateMetadata& operator=(IteratorStateMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const IteratorStateMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const IteratorStateMetadata* internal_default_instance() { + return reinterpret_cast( + &_IteratorStateMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(IteratorStateMetadata* other); + void Swap(IteratorStateMetadata* other); + friend void swap(IteratorStateMetadata& a, IteratorStateMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline IteratorStateMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + IteratorStateMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const IteratorStateMetadata& from); + void MergeFrom(const IteratorStateMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(IteratorStateMetadata* other); + protected: + explicit IteratorStateMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string keys = 2; + int keys_size() const; + void clear_keys(); + static const int kKeysFieldNumber = 2; + const ::std::string& keys(int index) const; + ::std::string* mutable_keys(int index); + void set_keys(int index, const ::std::string& value); + #if LANG_CXX11 + void set_keys(int index, ::std::string&& value); + #endif + void set_keys(int index, const char* value); + void set_keys(int index, const char* value, size_t size); + ::std::string* add_keys(); + void add_keys(const ::std::string& value); + #if LANG_CXX11 + void add_keys(::std::string&& value); + #endif + void add_keys(const char* value); + void add_keys(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& keys() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_keys(); + + // string version = 1; + void clear_version(); + static const int kVersionFieldNumber = 1; + const ::std::string& version() const; + void set_version(const ::std::string& value); + #if LANG_CXX11 + void set_version(::std::string&& value); + #endif + void set_version(const char* value); + void set_version(const char* value, size_t size); + ::std::string* mutable_version(); + ::std::string* release_version(); + void set_allocated_version(::std::string* version); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_version(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_version( + ::std::string* version); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.IteratorStateMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> keys_; + ::google::protobuf::internal::ArenaStringPtr version_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// IteratorStateMetadata + +// string version = 1; +inline void IteratorStateMetadata::clear_version() { + version_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& IteratorStateMetadata::version() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.IteratorStateMetadata.version) + return version_.Get(); +} +inline void IteratorStateMetadata::set_version(const ::std::string& value) { + + version_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.IteratorStateMetadata.version) +} +#if LANG_CXX11 +inline void IteratorStateMetadata::set_version(::std::string&& value) { + + version_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.IteratorStateMetadata.version) +} +#endif +inline void IteratorStateMetadata::set_version(const char* value) { + GOOGLE_DCHECK(value != NULL); + + version_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.IteratorStateMetadata.version) +} +inline void IteratorStateMetadata::set_version(const char* value, + size_t size) { + + version_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.IteratorStateMetadata.version) +} +inline ::std::string* IteratorStateMetadata::mutable_version() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.IteratorStateMetadata.version) + return version_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* IteratorStateMetadata::release_version() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.IteratorStateMetadata.version) + + return version_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void IteratorStateMetadata::set_allocated_version(::std::string* version) { + if (version != NULL) { + + } else { + + } + version_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), version, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.IteratorStateMetadata.version) +} +inline ::std::string* IteratorStateMetadata::unsafe_arena_release_version() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.IteratorStateMetadata.version) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return version_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void IteratorStateMetadata::unsafe_arena_set_allocated_version( + ::std::string* version) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (version != NULL) { + + } else { + + } + version_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + version, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.IteratorStateMetadata.version) +} + +// repeated string keys = 2; +inline int IteratorStateMetadata::keys_size() const { + return keys_.size(); +} +inline void IteratorStateMetadata::clear_keys() { + keys_.Clear(); +} +inline const ::std::string& IteratorStateMetadata::keys(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.IteratorStateMetadata.keys) + return keys_.Get(index); +} +inline ::std::string* IteratorStateMetadata::mutable_keys(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.IteratorStateMetadata.keys) + return keys_.Mutable(index); +} +inline void IteratorStateMetadata::set_keys(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.IteratorStateMetadata.keys) + keys_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void IteratorStateMetadata::set_keys(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.IteratorStateMetadata.keys) + keys_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void IteratorStateMetadata::set_keys(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + keys_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.IteratorStateMetadata.keys) +} +inline void IteratorStateMetadata::set_keys(int index, const char* value, size_t size) { + keys_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.IteratorStateMetadata.keys) +} +inline ::std::string* IteratorStateMetadata::add_keys() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.IteratorStateMetadata.keys) + return keys_.Add(); +} +inline void IteratorStateMetadata::add_keys(const ::std::string& value) { + keys_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.IteratorStateMetadata.keys) +} +#if LANG_CXX11 +inline void IteratorStateMetadata::add_keys(::std::string&& value) { + keys_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.IteratorStateMetadata.keys) +} +#endif +inline void IteratorStateMetadata::add_keys(const char* value) { + GOOGLE_DCHECK(value != NULL); + keys_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.IteratorStateMetadata.keys) +} +inline void IteratorStateMetadata::add_keys(const char* value, size_t size) { + keys_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.IteratorStateMetadata.keys) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +IteratorStateMetadata::keys() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.IteratorStateMetadata.keys) + return keys_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +IteratorStateMetadata::mutable_keys() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.IteratorStateMetadata.keys) + return &keys_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fiterator_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.proto new file mode 100644 index 0000000..a284127 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "IteratorProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.util"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +// Protocol buffer representing the metadata for an iterator's state stored +// as a Variant tensor. +message IteratorStateMetadata { + // A user-specified version string. + string version = 1; + + // Keys for tensors in the VariantTensorDataProto. + repeated string keys = 2; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator_pb2.py new file mode 100644 index 0000000..78a678f --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/iterator_pb2.py @@ -0,0 +1,77 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/iterator.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/iterator.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\023org.tensorflow.utilB\016IteratorProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n2diplomacy_tensorflow/core/framework/iterator.proto\x12\x14\x64iplomacy.tensorflow\"6\n\x15IteratorStateMetadata\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x0c\n\x04keys\x18\x02 \x03(\tBi\n\x13org.tensorflow.utilB\x0eIteratorProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_ITERATORSTATEMETADATA = _descriptor.Descriptor( + name='IteratorStateMetadata', + full_name='diplomacy.tensorflow.IteratorStateMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='diplomacy.tensorflow.IteratorStateMetadata.version', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='keys', full_name='diplomacy.tensorflow.IteratorStateMetadata.keys', index=1, + number=2, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=76, + serialized_end=130, +) + +DESCRIPTOR.message_types_by_name['IteratorStateMetadata'] = _ITERATORSTATEMETADATA +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +IteratorStateMetadata = _reflection.GeneratedProtocolMessageType('IteratorStateMetadata', (_message.Message,), dict( + DESCRIPTOR = _ITERATORSTATEMETADATA, + __module__ = 'diplomacy_tensorflow.core.framework.iterator_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.IteratorStateMetadata) + )) +_sym_db.RegisterMessage(IteratorStateMetadata) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.pb.cc new file mode 100644 index 0000000..a509c4e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.pb.cc @@ -0,0 +1,1340 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/kernel_def.proto + +#include "diplomacy_tensorflow/core/framework/kernel_def.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_KernelDef; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_KernelDef_AttrConstraint; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class KernelDef_AttrConstraintDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _KernelDef_AttrConstraint_default_instance_; +class KernelDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _KernelDef_default_instance_; +class KernelListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _KernelList_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto { +static void InitDefaultsKernelDef_AttrConstraint() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_KernelDef_AttrConstraint_default_instance_; + new (ptr) ::diplomacy::tensorflow::KernelDef_AttrConstraint(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::KernelDef_AttrConstraint::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_KernelDef_AttrConstraint = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsKernelDef_AttrConstraint}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base,}}; + +static void InitDefaultsKernelDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_KernelDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::KernelDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::KernelDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_KernelDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsKernelDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef_AttrConstraint.base,}}; + +static void InitDefaultsKernelList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_KernelList_default_instance_; + new (ptr) ::diplomacy::tensorflow::KernelList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::KernelList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_KernelList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsKernelList}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_KernelDef_AttrConstraint.base); + ::google::protobuf::internal::InitSCC(&scc_info_KernelDef.base); + ::google::protobuf::internal::InitSCC(&scc_info_KernelList.base); +} + +::google::protobuf::Metadata file_level_metadata[3]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef_AttrConstraint, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef_AttrConstraint, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef_AttrConstraint, allowed_values_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef, op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef, device_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef, constraint_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef, host_memory_arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef, label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelDef, priority_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::KernelList, kernel_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::KernelDef_AttrConstraint)}, + { 7, -1, sizeof(::diplomacy::tensorflow::KernelDef)}, + { 18, -1, sizeof(::diplomacy::tensorflow::KernelList)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_KernelDef_AttrConstraint_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_KernelDef_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_KernelList_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/kernel_def.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n4diplomacy_tensorflow/core/framework/ke" + "rnel_def.proto\022\024diplomacy.tensorflow\0324di" + "plomacy_tensorflow/core/framework/attr_v" + "alue.proto\"\203\002\n\tKernelDef\022\n\n\002op\030\001 \001(\t\022\023\n\013" + "device_type\030\002 \001(\t\022B\n\nconstraint\030\003 \003(\0132.." + "diplomacy.tensorflow.KernelDef.AttrConst" + "raint\022\027\n\017host_memory_arg\030\004 \003(\t\022\r\n\005label\030" + "\005 \001(\t\022\020\n\010priority\030\006 \001(\005\032W\n\016AttrConstrain" + "t\022\014\n\004name\030\001 \001(\t\0227\n\016allowed_values\030\002 \001(\0132" + "\037.diplomacy.tensorflow.AttrValue\"=\n\nKern" + "elList\022/\n\006kernel\030\001 \003(\0132\037.diplomacy.tenso" + "rflow.KernelDefBo\n\030org.tensorflow.framew" + "orkB\017KernelDefProtosP\001Z=github.com/tenso" + "rflow/tensorflow/tensorflow/go/core/fram" + "ework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 576); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/kernel_def.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void KernelDef_AttrConstraint::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_KernelDef_AttrConstraint_default_instance_._instance.get_mutable()->allowed_values_ = const_cast< ::diplomacy::tensorflow::AttrValue*>( + ::diplomacy::tensorflow::AttrValue::internal_default_instance()); +} +void KernelDef_AttrConstraint::unsafe_arena_set_allocated_allowed_values( + ::diplomacy::tensorflow::AttrValue* allowed_values) { + if (GetArenaNoVirtual() == NULL) { + delete allowed_values_; + } + allowed_values_ = allowed_values; + if (allowed_values) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.KernelDef.AttrConstraint.allowed_values) +} +void KernelDef_AttrConstraint::clear_allowed_values() { + if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) { + delete allowed_values_; + } + allowed_values_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int KernelDef_AttrConstraint::kNameFieldNumber; +const int KernelDef_AttrConstraint::kAllowedValuesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +KernelDef_AttrConstraint::KernelDef_AttrConstraint() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef_AttrConstraint.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.KernelDef.AttrConstraint) +} +KernelDef_AttrConstraint::KernelDef_AttrConstraint(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef_AttrConstraint.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.KernelDef.AttrConstraint) +} +KernelDef_AttrConstraint::KernelDef_AttrConstraint(const KernelDef_AttrConstraint& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + if (from.has_allowed_values()) { + allowed_values_ = new ::diplomacy::tensorflow::AttrValue(*from.allowed_values_); + } else { + allowed_values_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.KernelDef.AttrConstraint) +} + +void KernelDef_AttrConstraint::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + allowed_values_ = NULL; +} + +KernelDef_AttrConstraint::~KernelDef_AttrConstraint() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.KernelDef.AttrConstraint) + SharedDtor(); +} + +void KernelDef_AttrConstraint::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete allowed_values_; +} + +void KernelDef_AttrConstraint::ArenaDtor(void* object) { + KernelDef_AttrConstraint* _this = reinterpret_cast< KernelDef_AttrConstraint* >(object); + (void)_this; +} +void KernelDef_AttrConstraint::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void KernelDef_AttrConstraint::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* KernelDef_AttrConstraint::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const KernelDef_AttrConstraint& KernelDef_AttrConstraint::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef_AttrConstraint.base); + return *internal_default_instance(); +} + + +void KernelDef_AttrConstraint::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) { + delete allowed_values_; + } + allowed_values_ = NULL; + _internal_metadata_.Clear(); +} + +bool KernelDef_AttrConstraint::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.KernelDef.AttrConstraint.name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_allowed_values())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.KernelDef.AttrConstraint) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.KernelDef.AttrConstraint) + return false; +#undef DO_ +} + +void KernelDef_AttrConstraint::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.AttrConstraint.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 2; + if (this->has_allowed_values()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_allowed_values(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.KernelDef.AttrConstraint) +} + +::google::protobuf::uint8* KernelDef_AttrConstraint::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.AttrConstraint.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 2; + if (this->has_allowed_values()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_allowed_values(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.KernelDef.AttrConstraint) + return target; +} + +size_t KernelDef_AttrConstraint::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 2; + if (this->has_allowed_values()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *allowed_values_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void KernelDef_AttrConstraint::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + GOOGLE_DCHECK_NE(&from, this); + const KernelDef_AttrConstraint* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.KernelDef.AttrConstraint) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.KernelDef.AttrConstraint) + MergeFrom(*source); + } +} + +void KernelDef_AttrConstraint::MergeFrom(const KernelDef_AttrConstraint& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.has_allowed_values()) { + mutable_allowed_values()->::diplomacy::tensorflow::AttrValue::MergeFrom(from.allowed_values()); + } +} + +void KernelDef_AttrConstraint::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void KernelDef_AttrConstraint::CopyFrom(const KernelDef_AttrConstraint& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.KernelDef.AttrConstraint) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool KernelDef_AttrConstraint::IsInitialized() const { + return true; +} + +void KernelDef_AttrConstraint::Swap(KernelDef_AttrConstraint* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + KernelDef_AttrConstraint* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void KernelDef_AttrConstraint::UnsafeArenaSwap(KernelDef_AttrConstraint* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void KernelDef_AttrConstraint::InternalSwap(KernelDef_AttrConstraint* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(allowed_values_, other->allowed_values_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata KernelDef_AttrConstraint::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void KernelDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int KernelDef::kOpFieldNumber; +const int KernelDef::kDeviceTypeFieldNumber; +const int KernelDef::kConstraintFieldNumber; +const int KernelDef::kHostMemoryArgFieldNumber; +const int KernelDef::kLabelFieldNumber; +const int KernelDef::kPriorityFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +KernelDef::KernelDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.KernelDef) +} +KernelDef::KernelDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + constraint_(arena), + host_memory_arg_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.KernelDef) +} +KernelDef::KernelDef(const KernelDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + constraint_(from.constraint_), + host_memory_arg_(from.host_memory_arg_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.op().size() > 0) { + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op(), + GetArenaNoVirtual()); + } + device_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.device_type().size() > 0) { + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device_type(), + GetArenaNoVirtual()); + } + label_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.label().size() > 0) { + label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.label(), + GetArenaNoVirtual()); + } + priority_ = from.priority_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.KernelDef) +} + +void KernelDef::SharedCtor() { + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + priority_ = 0; +} + +KernelDef::~KernelDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.KernelDef) + SharedDtor(); +} + +void KernelDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void KernelDef::ArenaDtor(void* object) { + KernelDef* _this = reinterpret_cast< KernelDef* >(object); + (void)_this; +} +void KernelDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void KernelDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* KernelDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const KernelDef& KernelDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelDef.base); + return *internal_default_instance(); +} + + +void KernelDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.KernelDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + constraint_.Clear(); + host_memory_arg_.Clear(); + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + device_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + label_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + priority_ = 0; + _internal_metadata_.Clear(); +} + +bool KernelDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.KernelDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string op = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.KernelDef.op")); + } else { + goto handle_unusual; + } + break; + } + + // string device_type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device_type().data(), static_cast(this->device_type().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.KernelDef.device_type")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.KernelDef.AttrConstraint constraint = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_constraint())); + } else { + goto handle_unusual; + } + break; + } + + // repeated string host_memory_arg = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_host_memory_arg())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_memory_arg(this->host_memory_arg_size() - 1).data(), + static_cast(this->host_memory_arg(this->host_memory_arg_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.KernelDef.host_memory_arg")); + } else { + goto handle_unusual; + } + break; + } + + // string label = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_label())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->label().data(), static_cast(this->label().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.KernelDef.label")); + } else { + goto handle_unusual; + } + break; + } + + // int32 priority = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &priority_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.KernelDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.KernelDef) + return false; +#undef DO_ +} + +void KernelDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.KernelDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op = 1; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.op"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->op(), output); + } + + // string device_type = 2; + if (this->device_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device_type().data(), static_cast(this->device_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.device_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->device_type(), output); + } + + // repeated .diplomacy.tensorflow.KernelDef.AttrConstraint constraint = 3; + for (unsigned int i = 0, + n = static_cast(this->constraint_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->constraint(static_cast(i)), + output); + } + + // repeated string host_memory_arg = 4; + for (int i = 0, n = this->host_memory_arg_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_memory_arg(i).data(), static_cast(this->host_memory_arg(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.host_memory_arg"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 4, this->host_memory_arg(i), output); + } + + // string label = 5; + if (this->label().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->label().data(), static_cast(this->label().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.label"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->label(), output); + } + + // int32 priority = 6; + if (this->priority() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->priority(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.KernelDef) +} + +::google::protobuf::uint8* KernelDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.KernelDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op = 1; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.op"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->op(), target); + } + + // string device_type = 2; + if (this->device_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device_type().data(), static_cast(this->device_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.device_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->device_type(), target); + } + + // repeated .diplomacy.tensorflow.KernelDef.AttrConstraint constraint = 3; + for (unsigned int i = 0, + n = static_cast(this->constraint_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->constraint(static_cast(i)), deterministic, target); + } + + // repeated string host_memory_arg = 4; + for (int i = 0, n = this->host_memory_arg_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host_memory_arg(i).data(), static_cast(this->host_memory_arg(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.host_memory_arg"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(4, this->host_memory_arg(i), target); + } + + // string label = 5; + if (this->label().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->label().data(), static_cast(this->label().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.KernelDef.label"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->label(), target); + } + + // int32 priority = 6; + if (this->priority() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->priority(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.KernelDef) + return target; +} + +size_t KernelDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.KernelDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.KernelDef.AttrConstraint constraint = 3; + { + unsigned int count = static_cast(this->constraint_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->constraint(static_cast(i))); + } + } + + // repeated string host_memory_arg = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->host_memory_arg_size()); + for (int i = 0, n = this->host_memory_arg_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->host_memory_arg(i)); + } + + // string op = 1; + if (this->op().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op()); + } + + // string device_type = 2; + if (this->device_type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device_type()); + } + + // string label = 5; + if (this->label().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->label()); + } + + // int32 priority = 6; + if (this->priority() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->priority()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void KernelDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.KernelDef) + GOOGLE_DCHECK_NE(&from, this); + const KernelDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.KernelDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.KernelDef) + MergeFrom(*source); + } +} + +void KernelDef::MergeFrom(const KernelDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.KernelDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + constraint_.MergeFrom(from.constraint_); + host_memory_arg_.MergeFrom(from.host_memory_arg_); + if (from.op().size() > 0) { + set_op(from.op()); + } + if (from.device_type().size() > 0) { + set_device_type(from.device_type()); + } + if (from.label().size() > 0) { + set_label(from.label()); + } + if (from.priority() != 0) { + set_priority(from.priority()); + } +} + +void KernelDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.KernelDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void KernelDef::CopyFrom(const KernelDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.KernelDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool KernelDef::IsInitialized() const { + return true; +} + +void KernelDef::Swap(KernelDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + KernelDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void KernelDef::UnsafeArenaSwap(KernelDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void KernelDef::InternalSwap(KernelDef* other) { + using std::swap; + CastToBase(&constraint_)->InternalSwap(CastToBase(&other->constraint_)); + host_memory_arg_.InternalSwap(CastToBase(&other->host_memory_arg_)); + op_.Swap(&other->op_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + device_type_.Swap(&other->device_type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + label_.Swap(&other->label_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(priority_, other->priority_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata KernelDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void KernelList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int KernelList::kKernelFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +KernelList::KernelList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.KernelList) +} +KernelList::KernelList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + kernel_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.KernelList) +} +KernelList::KernelList(const KernelList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + kernel_(from.kernel_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.KernelList) +} + +void KernelList::SharedCtor() { +} + +KernelList::~KernelList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.KernelList) + SharedDtor(); +} + +void KernelList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void KernelList::ArenaDtor(void* object) { + KernelList* _this = reinterpret_cast< KernelList* >(object); + (void)_this; +} +void KernelList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void KernelList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* KernelList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const KernelList& KernelList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::scc_info_KernelList.base); + return *internal_default_instance(); +} + + +void KernelList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.KernelList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + kernel_.Clear(); + _internal_metadata_.Clear(); +} + +bool KernelList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.KernelList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.KernelDef kernel = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_kernel())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.KernelList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.KernelList) + return false; +#undef DO_ +} + +void KernelList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.KernelList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.KernelDef kernel = 1; + for (unsigned int i = 0, + n = static_cast(this->kernel_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->kernel(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.KernelList) +} + +::google::protobuf::uint8* KernelList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.KernelList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.KernelDef kernel = 1; + for (unsigned int i = 0, + n = static_cast(this->kernel_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->kernel(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.KernelList) + return target; +} + +size_t KernelList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.KernelList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.KernelDef kernel = 1; + { + unsigned int count = static_cast(this->kernel_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->kernel(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void KernelList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.KernelList) + GOOGLE_DCHECK_NE(&from, this); + const KernelList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.KernelList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.KernelList) + MergeFrom(*source); + } +} + +void KernelList::MergeFrom(const KernelList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.KernelList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + kernel_.MergeFrom(from.kernel_); +} + +void KernelList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.KernelList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void KernelList::CopyFrom(const KernelList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.KernelList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool KernelList::IsInitialized() const { + return true; +} + +void KernelList::Swap(KernelList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + KernelList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void KernelList::UnsafeArenaSwap(KernelList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void KernelList::InternalSwap(KernelList* other) { + using std::swap; + CastToBase(&kernel_)->InternalSwap(CastToBase(&other->kernel_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata KernelList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::KernelDef_AttrConstraint* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::KernelDef_AttrConstraint >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::KernelDef_AttrConstraint >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::KernelDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::KernelDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::KernelDef >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::KernelList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::KernelList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::KernelList >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.pb.h new file mode 100644 index 0000000..ef90332 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.pb.h @@ -0,0 +1,1111 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/kernel_def.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/attr_value.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[3]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class KernelDef; +class KernelDefDefaultTypeInternal; +extern KernelDefDefaultTypeInternal _KernelDef_default_instance_; +class KernelDef_AttrConstraint; +class KernelDef_AttrConstraintDefaultTypeInternal; +extern KernelDef_AttrConstraintDefaultTypeInternal _KernelDef_AttrConstraint_default_instance_; +class KernelList; +class KernelListDefaultTypeInternal; +extern KernelListDefaultTypeInternal _KernelList_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::KernelDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::KernelDef>(Arena*); +template<> ::diplomacy::tensorflow::KernelDef_AttrConstraint* Arena::CreateMaybeMessage<::diplomacy::tensorflow::KernelDef_AttrConstraint>(Arena*); +template<> ::diplomacy::tensorflow::KernelList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::KernelList>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class KernelDef_AttrConstraint : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.KernelDef.AttrConstraint) */ { + public: + KernelDef_AttrConstraint(); + virtual ~KernelDef_AttrConstraint(); + + KernelDef_AttrConstraint(const KernelDef_AttrConstraint& from); + + inline KernelDef_AttrConstraint& operator=(const KernelDef_AttrConstraint& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + KernelDef_AttrConstraint(KernelDef_AttrConstraint&& from) noexcept + : KernelDef_AttrConstraint() { + *this = ::std::move(from); + } + + inline KernelDef_AttrConstraint& operator=(KernelDef_AttrConstraint&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const KernelDef_AttrConstraint& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const KernelDef_AttrConstraint* internal_default_instance() { + return reinterpret_cast( + &_KernelDef_AttrConstraint_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(KernelDef_AttrConstraint* other); + void Swap(KernelDef_AttrConstraint* other); + friend void swap(KernelDef_AttrConstraint& a, KernelDef_AttrConstraint& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline KernelDef_AttrConstraint* New() const final { + return CreateMaybeMessage(NULL); + } + + KernelDef_AttrConstraint* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const KernelDef_AttrConstraint& from); + void MergeFrom(const KernelDef_AttrConstraint& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(KernelDef_AttrConstraint* other); + protected: + explicit KernelDef_AttrConstraint(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // .diplomacy.tensorflow.AttrValue allowed_values = 2; + bool has_allowed_values() const; + void clear_allowed_values(); + static const int kAllowedValuesFieldNumber = 2; + private: + const ::diplomacy::tensorflow::AttrValue& _internal_allowed_values() const; + public: + const ::diplomacy::tensorflow::AttrValue& allowed_values() const; + ::diplomacy::tensorflow::AttrValue* release_allowed_values(); + ::diplomacy::tensorflow::AttrValue* mutable_allowed_values(); + void set_allocated_allowed_values(::diplomacy::tensorflow::AttrValue* allowed_values); + void unsafe_arena_set_allocated_allowed_values( + ::diplomacy::tensorflow::AttrValue* allowed_values); + ::diplomacy::tensorflow::AttrValue* unsafe_arena_release_allowed_values(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.KernelDef.AttrConstraint) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::diplomacy::tensorflow::AttrValue* allowed_values_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class KernelDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.KernelDef) */ { + public: + KernelDef(); + virtual ~KernelDef(); + + KernelDef(const KernelDef& from); + + inline KernelDef& operator=(const KernelDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + KernelDef(KernelDef&& from) noexcept + : KernelDef() { + *this = ::std::move(from); + } + + inline KernelDef& operator=(KernelDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const KernelDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const KernelDef* internal_default_instance() { + return reinterpret_cast( + &_KernelDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(KernelDef* other); + void Swap(KernelDef* other); + friend void swap(KernelDef& a, KernelDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline KernelDef* New() const final { + return CreateMaybeMessage(NULL); + } + + KernelDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const KernelDef& from); + void MergeFrom(const KernelDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(KernelDef* other); + protected: + explicit KernelDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef KernelDef_AttrConstraint AttrConstraint; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.KernelDef.AttrConstraint constraint = 3; + int constraint_size() const; + void clear_constraint(); + static const int kConstraintFieldNumber = 3; + ::diplomacy::tensorflow::KernelDef_AttrConstraint* mutable_constraint(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef_AttrConstraint >* + mutable_constraint(); + const ::diplomacy::tensorflow::KernelDef_AttrConstraint& constraint(int index) const; + ::diplomacy::tensorflow::KernelDef_AttrConstraint* add_constraint(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef_AttrConstraint >& + constraint() const; + + // repeated string host_memory_arg = 4; + int host_memory_arg_size() const; + void clear_host_memory_arg(); + static const int kHostMemoryArgFieldNumber = 4; + const ::std::string& host_memory_arg(int index) const; + ::std::string* mutable_host_memory_arg(int index); + void set_host_memory_arg(int index, const ::std::string& value); + #if LANG_CXX11 + void set_host_memory_arg(int index, ::std::string&& value); + #endif + void set_host_memory_arg(int index, const char* value); + void set_host_memory_arg(int index, const char* value, size_t size); + ::std::string* add_host_memory_arg(); + void add_host_memory_arg(const ::std::string& value); + #if LANG_CXX11 + void add_host_memory_arg(::std::string&& value); + #endif + void add_host_memory_arg(const char* value); + void add_host_memory_arg(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& host_memory_arg() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_host_memory_arg(); + + // string op = 1; + void clear_op(); + static const int kOpFieldNumber = 1; + const ::std::string& op() const; + void set_op(const ::std::string& value); + #if LANG_CXX11 + void set_op(::std::string&& value); + #endif + void set_op(const char* value); + void set_op(const char* value, size_t size); + ::std::string* mutable_op(); + ::std::string* release_op(); + void set_allocated_op(::std::string* op); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_op(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_op( + ::std::string* op); + + // string device_type = 2; + void clear_device_type(); + static const int kDeviceTypeFieldNumber = 2; + const ::std::string& device_type() const; + void set_device_type(const ::std::string& value); + #if LANG_CXX11 + void set_device_type(::std::string&& value); + #endif + void set_device_type(const char* value); + void set_device_type(const char* value, size_t size); + ::std::string* mutable_device_type(); + ::std::string* release_device_type(); + void set_allocated_device_type(::std::string* device_type); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_device_type(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_device_type( + ::std::string* device_type); + + // string label = 5; + void clear_label(); + static const int kLabelFieldNumber = 5; + const ::std::string& label() const; + void set_label(const ::std::string& value); + #if LANG_CXX11 + void set_label(::std::string&& value); + #endif + void set_label(const char* value); + void set_label(const char* value, size_t size); + ::std::string* mutable_label(); + ::std::string* release_label(); + void set_allocated_label(::std::string* label); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_label(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_label( + ::std::string* label); + + // int32 priority = 6; + void clear_priority(); + static const int kPriorityFieldNumber = 6; + ::google::protobuf::int32 priority() const; + void set_priority(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.KernelDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef_AttrConstraint > constraint_; + ::google::protobuf::RepeatedPtrField< ::std::string> host_memory_arg_; + ::google::protobuf::internal::ArenaStringPtr op_; + ::google::protobuf::internal::ArenaStringPtr device_type_; + ::google::protobuf::internal::ArenaStringPtr label_; + ::google::protobuf::int32 priority_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class KernelList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.KernelList) */ { + public: + KernelList(); + virtual ~KernelList(); + + KernelList(const KernelList& from); + + inline KernelList& operator=(const KernelList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + KernelList(KernelList&& from) noexcept + : KernelList() { + *this = ::std::move(from); + } + + inline KernelList& operator=(KernelList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const KernelList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const KernelList* internal_default_instance() { + return reinterpret_cast( + &_KernelList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(KernelList* other); + void Swap(KernelList* other); + friend void swap(KernelList& a, KernelList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline KernelList* New() const final { + return CreateMaybeMessage(NULL); + } + + KernelList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const KernelList& from); + void MergeFrom(const KernelList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(KernelList* other); + protected: + explicit KernelList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.KernelDef kernel = 1; + int kernel_size() const; + void clear_kernel(); + static const int kKernelFieldNumber = 1; + ::diplomacy::tensorflow::KernelDef* mutable_kernel(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef >* + mutable_kernel(); + const ::diplomacy::tensorflow::KernelDef& kernel(int index) const; + ::diplomacy::tensorflow::KernelDef* add_kernel(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef >& + kernel() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.KernelList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef > kernel_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// KernelDef_AttrConstraint + +// string name = 1; +inline void KernelDef_AttrConstraint::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& KernelDef_AttrConstraint::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.AttrConstraint.name) + return name_.Get(); +} +inline void KernelDef_AttrConstraint::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.KernelDef.AttrConstraint.name) +} +#if LANG_CXX11 +inline void KernelDef_AttrConstraint::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.KernelDef.AttrConstraint.name) +} +#endif +inline void KernelDef_AttrConstraint::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.KernelDef.AttrConstraint.name) +} +inline void KernelDef_AttrConstraint::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.KernelDef.AttrConstraint.name) +} +inline ::std::string* KernelDef_AttrConstraint::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelDef.AttrConstraint.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* KernelDef_AttrConstraint::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.KernelDef.AttrConstraint.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void KernelDef_AttrConstraint::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.KernelDef.AttrConstraint.name) +} +inline ::std::string* KernelDef_AttrConstraint::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.KernelDef.AttrConstraint.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void KernelDef_AttrConstraint::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.KernelDef.AttrConstraint.name) +} + +// .diplomacy.tensorflow.AttrValue allowed_values = 2; +inline bool KernelDef_AttrConstraint::has_allowed_values() const { + return this != internal_default_instance() && allowed_values_ != NULL; +} +inline const ::diplomacy::tensorflow::AttrValue& KernelDef_AttrConstraint::_internal_allowed_values() const { + return *allowed_values_; +} +inline const ::diplomacy::tensorflow::AttrValue& KernelDef_AttrConstraint::allowed_values() const { + const ::diplomacy::tensorflow::AttrValue* p = allowed_values_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.AttrConstraint.allowed_values) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_AttrValue_default_instance_); +} +inline ::diplomacy::tensorflow::AttrValue* KernelDef_AttrConstraint::release_allowed_values() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.KernelDef.AttrConstraint.allowed_values) + + ::diplomacy::tensorflow::AttrValue* temp = allowed_values_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + allowed_values_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* KernelDef_AttrConstraint::unsafe_arena_release_allowed_values() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.KernelDef.AttrConstraint.allowed_values) + + ::diplomacy::tensorflow::AttrValue* temp = allowed_values_; + allowed_values_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* KernelDef_AttrConstraint::mutable_allowed_values() { + + if (allowed_values_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::AttrValue>(GetArenaNoVirtual()); + allowed_values_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelDef.AttrConstraint.allowed_values) + return allowed_values_; +} +inline void KernelDef_AttrConstraint::set_allocated_allowed_values(::diplomacy::tensorflow::AttrValue* allowed_values) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(allowed_values_); + } + if (allowed_values) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(allowed_values)->GetArena(); + if (message_arena != submessage_arena) { + allowed_values = ::google::protobuf::internal::GetOwnedMessage( + message_arena, allowed_values, submessage_arena); + } + + } else { + + } + allowed_values_ = allowed_values; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.KernelDef.AttrConstraint.allowed_values) +} + +// ------------------------------------------------------------------- + +// KernelDef + +// string op = 1; +inline void KernelDef::clear_op() { + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& KernelDef::op() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.op) + return op_.Get(); +} +inline void KernelDef::set_op(const ::std::string& value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.KernelDef.op) +} +#if LANG_CXX11 +inline void KernelDef::set_op(::std::string&& value) { + + op_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.KernelDef.op) +} +#endif +inline void KernelDef::set_op(const char* value) { + GOOGLE_DCHECK(value != NULL); + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.KernelDef.op) +} +inline void KernelDef::set_op(const char* value, + size_t size) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.KernelDef.op) +} +inline ::std::string* KernelDef::mutable_op() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelDef.op) + return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* KernelDef::release_op() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.KernelDef.op) + + return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void KernelDef::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.KernelDef.op) +} +inline ::std::string* KernelDef::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.KernelDef.op) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void KernelDef::unsafe_arena_set_allocated_op( + ::std::string* op) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op != NULL) { + + } else { + + } + op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.KernelDef.op) +} + +// string device_type = 2; +inline void KernelDef::clear_device_type() { + device_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& KernelDef::device_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.device_type) + return device_type_.Get(); +} +inline void KernelDef::set_device_type(const ::std::string& value) { + + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.KernelDef.device_type) +} +#if LANG_CXX11 +inline void KernelDef::set_device_type(::std::string&& value) { + + device_type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.KernelDef.device_type) +} +#endif +inline void KernelDef::set_device_type(const char* value) { + GOOGLE_DCHECK(value != NULL); + + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.KernelDef.device_type) +} +inline void KernelDef::set_device_type(const char* value, + size_t size) { + + device_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.KernelDef.device_type) +} +inline ::std::string* KernelDef::mutable_device_type() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelDef.device_type) + return device_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* KernelDef::release_device_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.KernelDef.device_type) + + return device_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void KernelDef::set_allocated_device_type(::std::string* device_type) { + if (device_type != NULL) { + + } else { + + } + device_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device_type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.KernelDef.device_type) +} +inline ::std::string* KernelDef::unsafe_arena_release_device_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.KernelDef.device_type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void KernelDef::unsafe_arena_set_allocated_device_type( + ::std::string* device_type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device_type != NULL) { + + } else { + + } + device_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device_type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.KernelDef.device_type) +} + +// repeated .diplomacy.tensorflow.KernelDef.AttrConstraint constraint = 3; +inline int KernelDef::constraint_size() const { + return constraint_.size(); +} +inline void KernelDef::clear_constraint() { + constraint_.Clear(); +} +inline ::diplomacy::tensorflow::KernelDef_AttrConstraint* KernelDef::mutable_constraint(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelDef.constraint) + return constraint_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef_AttrConstraint >* +KernelDef::mutable_constraint() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.KernelDef.constraint) + return &constraint_; +} +inline const ::diplomacy::tensorflow::KernelDef_AttrConstraint& KernelDef::constraint(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.constraint) + return constraint_.Get(index); +} +inline ::diplomacy::tensorflow::KernelDef_AttrConstraint* KernelDef::add_constraint() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.KernelDef.constraint) + return constraint_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef_AttrConstraint >& +KernelDef::constraint() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.KernelDef.constraint) + return constraint_; +} + +// repeated string host_memory_arg = 4; +inline int KernelDef::host_memory_arg_size() const { + return host_memory_arg_.size(); +} +inline void KernelDef::clear_host_memory_arg() { + host_memory_arg_.Clear(); +} +inline const ::std::string& KernelDef::host_memory_arg(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.host_memory_arg) + return host_memory_arg_.Get(index); +} +inline ::std::string* KernelDef::mutable_host_memory_arg(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelDef.host_memory_arg) + return host_memory_arg_.Mutable(index); +} +inline void KernelDef::set_host_memory_arg(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.KernelDef.host_memory_arg) + host_memory_arg_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void KernelDef::set_host_memory_arg(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.KernelDef.host_memory_arg) + host_memory_arg_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void KernelDef::set_host_memory_arg(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + host_memory_arg_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.KernelDef.host_memory_arg) +} +inline void KernelDef::set_host_memory_arg(int index, const char* value, size_t size) { + host_memory_arg_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.KernelDef.host_memory_arg) +} +inline ::std::string* KernelDef::add_host_memory_arg() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.KernelDef.host_memory_arg) + return host_memory_arg_.Add(); +} +inline void KernelDef::add_host_memory_arg(const ::std::string& value) { + host_memory_arg_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.KernelDef.host_memory_arg) +} +#if LANG_CXX11 +inline void KernelDef::add_host_memory_arg(::std::string&& value) { + host_memory_arg_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.KernelDef.host_memory_arg) +} +#endif +inline void KernelDef::add_host_memory_arg(const char* value) { + GOOGLE_DCHECK(value != NULL); + host_memory_arg_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.KernelDef.host_memory_arg) +} +inline void KernelDef::add_host_memory_arg(const char* value, size_t size) { + host_memory_arg_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.KernelDef.host_memory_arg) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +KernelDef::host_memory_arg() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.KernelDef.host_memory_arg) + return host_memory_arg_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +KernelDef::mutable_host_memory_arg() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.KernelDef.host_memory_arg) + return &host_memory_arg_; +} + +// string label = 5; +inline void KernelDef::clear_label() { + label_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& KernelDef::label() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.label) + return label_.Get(); +} +inline void KernelDef::set_label(const ::std::string& value) { + + label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.KernelDef.label) +} +#if LANG_CXX11 +inline void KernelDef::set_label(::std::string&& value) { + + label_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.KernelDef.label) +} +#endif +inline void KernelDef::set_label(const char* value) { + GOOGLE_DCHECK(value != NULL); + + label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.KernelDef.label) +} +inline void KernelDef::set_label(const char* value, + size_t size) { + + label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.KernelDef.label) +} +inline ::std::string* KernelDef::mutable_label() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelDef.label) + return label_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* KernelDef::release_label() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.KernelDef.label) + + return label_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void KernelDef::set_allocated_label(::std::string* label) { + if (label != NULL) { + + } else { + + } + label_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), label, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.KernelDef.label) +} +inline ::std::string* KernelDef::unsafe_arena_release_label() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.KernelDef.label) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return label_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void KernelDef::unsafe_arena_set_allocated_label( + ::std::string* label) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (label != NULL) { + + } else { + + } + label_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + label, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.KernelDef.label) +} + +// int32 priority = 6; +inline void KernelDef::clear_priority() { + priority_ = 0; +} +inline ::google::protobuf::int32 KernelDef::priority() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelDef.priority) + return priority_; +} +inline void KernelDef::set_priority(::google::protobuf::int32 value) { + + priority_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.KernelDef.priority) +} + +// ------------------------------------------------------------------- + +// KernelList + +// repeated .diplomacy.tensorflow.KernelDef kernel = 1; +inline int KernelList::kernel_size() const { + return kernel_.size(); +} +inline void KernelList::clear_kernel() { + kernel_.Clear(); +} +inline ::diplomacy::tensorflow::KernelDef* KernelList::mutable_kernel(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.KernelList.kernel) + return kernel_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef >* +KernelList::mutable_kernel() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.KernelList.kernel) + return &kernel_; +} +inline const ::diplomacy::tensorflow::KernelDef& KernelList::kernel(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.KernelList.kernel) + return kernel_.Get(index); +} +inline ::diplomacy::tensorflow::KernelDef* KernelList::add_kernel() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.KernelList.kernel) + return kernel_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::KernelDef >& +KernelList::kernel() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.KernelList.kernel) + return kernel_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fkernel_5fdef_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.proto new file mode 100644 index 0000000..170172c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "KernelDefProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/attr_value.proto"; + +message KernelDef { + // Must match the name of an Op. + string op = 1; + + // Type of device this kernel runs on. + string device_type = 2; + + message AttrConstraint { + // Name of an attr from the Op. + string name = 1; + + // A list of values that this kernel supports for this attr. + // Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops. + AttrValue allowed_values = 2; + } + repeated AttrConstraint constraint = 3; + + // Names of the Op's input_/output_args that reside in host memory + // instead of device memory. + repeated string host_memory_arg = 4; + + // This allows experimental kernels to be registered for an op that + // won't be used unless the user specifies a "_kernel" attr with + // value matching this. + string label = 5; + + // Prioritization of kernel amongst different devices. By default we assume + // priority is 0. The higher the priority the better. By default (i.e. if + // this is not set), we prefer GPU kernels over CPU. + int32 priority = 6; +} + +// A collection of KernelDefs +message KernelList { + repeated KernelDef kernel = 1; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def_pb2.py new file mode 100644 index 0000000..1ef37e7 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/kernel_def_pb2.py @@ -0,0 +1,195 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/kernel_def.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import attr_value_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/kernel_def.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\017KernelDefProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n4diplomacy_tensorflow/core/framework/kernel_def.proto\x12\x14\x64iplomacy.tensorflow\x1a\x34\x64iplomacy_tensorflow/core/framework/attr_value.proto\"\x83\x02\n\tKernelDef\x12\n\n\x02op\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12\x42\n\nconstraint\x18\x03 \x03(\x0b\x32..diplomacy.tensorflow.KernelDef.AttrConstraint\x12\x17\n\x0fhost_memory_arg\x18\x04 \x03(\t\x12\r\n\x05label\x18\x05 \x01(\t\x12\x10\n\x08priority\x18\x06 \x01(\x05\x1aW\n\x0e\x41ttrConstraint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x37\n\x0e\x61llowed_values\x18\x02 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue\"=\n\nKernelList\x12/\n\x06kernel\x18\x01 \x03(\x0b\x32\x1f.diplomacy.tensorflow.KernelDefBo\n\x18org.tensorflow.frameworkB\x0fKernelDefProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2.DESCRIPTOR,]) + + + + +_KERNELDEF_ATTRCONSTRAINT = _descriptor.Descriptor( + name='AttrConstraint', + full_name='diplomacy.tensorflow.KernelDef.AttrConstraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.KernelDef.AttrConstraint.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='allowed_values', full_name='diplomacy.tensorflow.KernelDef.AttrConstraint.allowed_values', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=305, + serialized_end=392, +) + +_KERNELDEF = _descriptor.Descriptor( + name='KernelDef', + full_name='diplomacy.tensorflow.KernelDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op', full_name='diplomacy.tensorflow.KernelDef.op', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_type', full_name='diplomacy.tensorflow.KernelDef.device_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='constraint', full_name='diplomacy.tensorflow.KernelDef.constraint', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='host_memory_arg', full_name='diplomacy.tensorflow.KernelDef.host_memory_arg', index=3, + number=4, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='label', full_name='diplomacy.tensorflow.KernelDef.label', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='priority', full_name='diplomacy.tensorflow.KernelDef.priority', index=5, + number=6, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_KERNELDEF_ATTRCONSTRAINT, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=133, + serialized_end=392, +) + + +_KERNELLIST = _descriptor.Descriptor( + name='KernelList', + full_name='diplomacy.tensorflow.KernelList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='kernel', full_name='diplomacy.tensorflow.KernelList.kernel', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=394, + serialized_end=455, +) + +_KERNELDEF_ATTRCONSTRAINT.fields_by_name['allowed_values'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2._ATTRVALUE +_KERNELDEF_ATTRCONSTRAINT.containing_type = _KERNELDEF +_KERNELDEF.fields_by_name['constraint'].message_type = _KERNELDEF_ATTRCONSTRAINT +_KERNELLIST.fields_by_name['kernel'].message_type = _KERNELDEF +DESCRIPTOR.message_types_by_name['KernelDef'] = _KERNELDEF +DESCRIPTOR.message_types_by_name['KernelList'] = _KERNELLIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +KernelDef = _reflection.GeneratedProtocolMessageType('KernelDef', (_message.Message,), dict( + + AttrConstraint = _reflection.GeneratedProtocolMessageType('AttrConstraint', (_message.Message,), dict( + DESCRIPTOR = _KERNELDEF_ATTRCONSTRAINT, + __module__ = 'diplomacy_tensorflow.core.framework.kernel_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.KernelDef.AttrConstraint) + )) + , + DESCRIPTOR = _KERNELDEF, + __module__ = 'diplomacy_tensorflow.core.framework.kernel_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.KernelDef) + )) +_sym_db.RegisterMessage(KernelDef) +_sym_db.RegisterMessage(KernelDef.AttrConstraint) + +KernelList = _reflection.GeneratedProtocolMessageType('KernelList', (_message.Message,), dict( + DESCRIPTOR = _KERNELLIST, + __module__ = 'diplomacy_tensorflow.core.framework.kernel_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.KernelList) + )) +_sym_db.RegisterMessage(KernelList) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.pb.cc new file mode 100644 index 0000000..80d93a8 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.pb.cc @@ -0,0 +1,2673 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/log_memory.proto + +#include "diplomacy_tensorflow/core/framework/log_memory.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorDescription; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto +namespace diplomacy { +namespace tensorflow { +class MemoryLogStepDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryLogStep_default_instance_; +class MemoryLogTensorAllocationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryLogTensorAllocation_default_instance_; +class MemoryLogTensorDeallocationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryLogTensorDeallocation_default_instance_; +class MemoryLogTensorOutputDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryLogTensorOutput_default_instance_; +class MemoryLogRawAllocationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryLogRawAllocation_default_instance_; +class MemoryLogRawDeallocationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryLogRawDeallocation_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto { +static void InitDefaultsMemoryLogStep() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryLogStep_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryLogStep(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryLogStep::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MemoryLogStep = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMemoryLogStep}, {}}; + +static void InitDefaultsMemoryLogTensorAllocation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryLogTensorAllocation_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryLogTensorAllocation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryLogTensorAllocation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_MemoryLogTensorAllocation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMemoryLogTensorAllocation}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::scc_info_TensorDescription.base,}}; + +static void InitDefaultsMemoryLogTensorDeallocation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryLogTensorDeallocation_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryLogTensorDeallocation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryLogTensorDeallocation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MemoryLogTensorDeallocation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMemoryLogTensorDeallocation}, {}}; + +static void InitDefaultsMemoryLogTensorOutput() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryLogTensorOutput_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryLogTensorOutput(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryLogTensorOutput::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_MemoryLogTensorOutput = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMemoryLogTensorOutput}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::scc_info_TensorDescription.base,}}; + +static void InitDefaultsMemoryLogRawAllocation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryLogRawAllocation_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryLogRawAllocation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryLogRawAllocation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MemoryLogRawAllocation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMemoryLogRawAllocation}, {}}; + +static void InitDefaultsMemoryLogRawDeallocation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryLogRawDeallocation_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryLogRawDeallocation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryLogRawDeallocation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MemoryLogRawDeallocation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMemoryLogRawDeallocation}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_MemoryLogStep.base); + ::google::protobuf::internal::InitSCC(&scc_info_MemoryLogTensorAllocation.base); + ::google::protobuf::internal::InitSCC(&scc_info_MemoryLogTensorDeallocation.base); + ::google::protobuf::internal::InitSCC(&scc_info_MemoryLogTensorOutput.base); + ::google::protobuf::internal::InitSCC(&scc_info_MemoryLogRawAllocation.base); + ::google::protobuf::internal::InitSCC(&scc_info_MemoryLogRawDeallocation.base); +} + +::google::protobuf::Metadata file_level_metadata[6]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogStep, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogStep, step_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogStep, handle_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorAllocation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorAllocation, step_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorAllocation, kernel_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorAllocation, tensor_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorDeallocation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorDeallocation, allocation_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorDeallocation, allocator_name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorOutput, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorOutput, step_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorOutput, kernel_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorOutput, index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogTensorOutput, tensor_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawAllocation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawAllocation, step_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawAllocation, operation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawAllocation, num_bytes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawAllocation, ptr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawAllocation, allocation_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawAllocation, allocator_name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawDeallocation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawDeallocation, step_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawDeallocation, operation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawDeallocation, allocation_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawDeallocation, allocator_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryLogRawDeallocation, deferred_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::MemoryLogStep)}, + { 7, -1, sizeof(::diplomacy::tensorflow::MemoryLogTensorAllocation)}, + { 15, -1, sizeof(::diplomacy::tensorflow::MemoryLogTensorDeallocation)}, + { 22, -1, sizeof(::diplomacy::tensorflow::MemoryLogTensorOutput)}, + { 31, -1, sizeof(::diplomacy::tensorflow::MemoryLogRawAllocation)}, + { 42, -1, sizeof(::diplomacy::tensorflow::MemoryLogRawDeallocation)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_MemoryLogStep_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MemoryLogTensorAllocation_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MemoryLogTensorDeallocation_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MemoryLogTensorOutput_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MemoryLogRawAllocation_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MemoryLogRawDeallocation_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/log_memory.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 6); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n4diplomacy_tensorflow/core/framework/lo" + "g_memory.proto\022\024diplomacy.tensorflow\032= 1900 +const int MemoryLogStep::kStepIdFieldNumber; +const int MemoryLogStep::kHandleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryLogStep::MemoryLogStep() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogStep.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryLogStep) +} +MemoryLogStep::MemoryLogStep(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogStep.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MemoryLogStep) +} +MemoryLogStep::MemoryLogStep(const MemoryLogStep& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + handle_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.handle().size() > 0) { + handle_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.handle(), + GetArenaNoVirtual()); + } + step_id_ = from.step_id_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryLogStep) +} + +void MemoryLogStep::SharedCtor() { + handle_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + step_id_ = GOOGLE_LONGLONG(0); +} + +MemoryLogStep::~MemoryLogStep() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryLogStep) + SharedDtor(); +} + +void MemoryLogStep::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + handle_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void MemoryLogStep::ArenaDtor(void* object) { + MemoryLogStep* _this = reinterpret_cast< MemoryLogStep* >(object); + (void)_this; +} +void MemoryLogStep::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MemoryLogStep::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryLogStep::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryLogStep& MemoryLogStep::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogStep.base); + return *internal_default_instance(); +} + + +void MemoryLogStep::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryLogStep) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + handle_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + step_id_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool MemoryLogStep::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryLogStep) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 step_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &step_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string handle = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_handle())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->handle().data(), static_cast(this->handle().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogStep.handle")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryLogStep) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryLogStep) + return false; +#undef DO_ +} + +void MemoryLogStep::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryLogStep) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->step_id(), output); + } + + // string handle = 2; + if (this->handle().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->handle().data(), static_cast(this->handle().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogStep.handle"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->handle(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryLogStep) +} + +::google::protobuf::uint8* MemoryLogStep::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryLogStep) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->step_id(), target); + } + + // string handle = 2; + if (this->handle().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->handle().data(), static_cast(this->handle().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogStep.handle"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->handle(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryLogStep) + return target; +} + +size_t MemoryLogStep::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryLogStep) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string handle = 2; + if (this->handle().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->handle()); + } + + // int64 step_id = 1; + if (this->step_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->step_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryLogStep::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryLogStep) + GOOGLE_DCHECK_NE(&from, this); + const MemoryLogStep* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryLogStep) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryLogStep) + MergeFrom(*source); + } +} + +void MemoryLogStep::MergeFrom(const MemoryLogStep& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryLogStep) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.handle().size() > 0) { + set_handle(from.handle()); + } + if (from.step_id() != 0) { + set_step_id(from.step_id()); + } +} + +void MemoryLogStep::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryLogStep) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryLogStep::CopyFrom(const MemoryLogStep& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryLogStep) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryLogStep::IsInitialized() const { + return true; +} + +void MemoryLogStep::Swap(MemoryLogStep* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MemoryLogStep* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MemoryLogStep::UnsafeArenaSwap(MemoryLogStep* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MemoryLogStep::InternalSwap(MemoryLogStep* other) { + using std::swap; + handle_.Swap(&other->handle_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(step_id_, other->step_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryLogStep::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MemoryLogTensorAllocation::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_MemoryLogTensorAllocation_default_instance_._instance.get_mutable()->tensor_ = const_cast< ::diplomacy::tensorflow::TensorDescription*>( + ::diplomacy::tensorflow::TensorDescription::internal_default_instance()); +} +void MemoryLogTensorAllocation::unsafe_arena_set_allocated_tensor( + ::diplomacy::tensorflow::TensorDescription* tensor) { + if (GetArenaNoVirtual() == NULL) { + delete tensor_; + } + tensor_ = tensor; + if (tensor) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogTensorAllocation.tensor) +} +void MemoryLogTensorAllocation::clear_tensor() { + if (GetArenaNoVirtual() == NULL && tensor_ != NULL) { + delete tensor_; + } + tensor_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryLogTensorAllocation::kStepIdFieldNumber; +const int MemoryLogTensorAllocation::kKernelNameFieldNumber; +const int MemoryLogTensorAllocation::kTensorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryLogTensorAllocation::MemoryLogTensorAllocation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorAllocation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryLogTensorAllocation) +} +MemoryLogTensorAllocation::MemoryLogTensorAllocation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorAllocation.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MemoryLogTensorAllocation) +} +MemoryLogTensorAllocation::MemoryLogTensorAllocation(const MemoryLogTensorAllocation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + kernel_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.kernel_name().size() > 0) { + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.kernel_name(), + GetArenaNoVirtual()); + } + if (from.has_tensor()) { + tensor_ = new ::diplomacy::tensorflow::TensorDescription(*from.tensor_); + } else { + tensor_ = NULL; + } + step_id_ = from.step_id_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryLogTensorAllocation) +} + +void MemoryLogTensorAllocation::SharedCtor() { + kernel_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&tensor_, 0, static_cast( + reinterpret_cast(&step_id_) - + reinterpret_cast(&tensor_)) + sizeof(step_id_)); +} + +MemoryLogTensorAllocation::~MemoryLogTensorAllocation() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryLogTensorAllocation) + SharedDtor(); +} + +void MemoryLogTensorAllocation::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + kernel_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete tensor_; +} + +void MemoryLogTensorAllocation::ArenaDtor(void* object) { + MemoryLogTensorAllocation* _this = reinterpret_cast< MemoryLogTensorAllocation* >(object); + (void)_this; +} +void MemoryLogTensorAllocation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MemoryLogTensorAllocation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryLogTensorAllocation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryLogTensorAllocation& MemoryLogTensorAllocation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorAllocation.base); + return *internal_default_instance(); +} + + +void MemoryLogTensorAllocation::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + kernel_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && tensor_ != NULL) { + delete tensor_; + } + tensor_ = NULL; + step_id_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool MemoryLogTensorAllocation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 step_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &step_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string kernel_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_kernel_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->kernel_name().data(), static_cast(this->kernel_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorDescription tensor = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryLogTensorAllocation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryLogTensorAllocation) + return false; +#undef DO_ +} + +void MemoryLogTensorAllocation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->step_id(), output); + } + + // string kernel_name = 2; + if (this->kernel_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->kernel_name().data(), static_cast(this->kernel_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->kernel_name(), output); + } + + // .diplomacy.tensorflow.TensorDescription tensor = 3; + if (this->has_tensor()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_tensor(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryLogTensorAllocation) +} + +::google::protobuf::uint8* MemoryLogTensorAllocation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->step_id(), target); + } + + // string kernel_name = 2; + if (this->kernel_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->kernel_name().data(), static_cast(this->kernel_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->kernel_name(), target); + } + + // .diplomacy.tensorflow.TensorDescription tensor = 3; + if (this->has_tensor()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_tensor(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryLogTensorAllocation) + return target; +} + +size_t MemoryLogTensorAllocation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string kernel_name = 2; + if (this->kernel_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->kernel_name()); + } + + // .diplomacy.tensorflow.TensorDescription tensor = 3; + if (this->has_tensor()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tensor_); + } + + // int64 step_id = 1; + if (this->step_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->step_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryLogTensorAllocation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + GOOGLE_DCHECK_NE(&from, this); + const MemoryLogTensorAllocation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryLogTensorAllocation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryLogTensorAllocation) + MergeFrom(*source); + } +} + +void MemoryLogTensorAllocation::MergeFrom(const MemoryLogTensorAllocation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.kernel_name().size() > 0) { + set_kernel_name(from.kernel_name()); + } + if (from.has_tensor()) { + mutable_tensor()->::diplomacy::tensorflow::TensorDescription::MergeFrom(from.tensor()); + } + if (from.step_id() != 0) { + set_step_id(from.step_id()); + } +} + +void MemoryLogTensorAllocation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryLogTensorAllocation::CopyFrom(const MemoryLogTensorAllocation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryLogTensorAllocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryLogTensorAllocation::IsInitialized() const { + return true; +} + +void MemoryLogTensorAllocation::Swap(MemoryLogTensorAllocation* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MemoryLogTensorAllocation* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MemoryLogTensorAllocation::UnsafeArenaSwap(MemoryLogTensorAllocation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MemoryLogTensorAllocation::InternalSwap(MemoryLogTensorAllocation* other) { + using std::swap; + kernel_name_.Swap(&other->kernel_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(tensor_, other->tensor_); + swap(step_id_, other->step_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryLogTensorAllocation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MemoryLogTensorDeallocation::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryLogTensorDeallocation::kAllocationIdFieldNumber; +const int MemoryLogTensorDeallocation::kAllocatorNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryLogTensorDeallocation::MemoryLogTensorDeallocation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorDeallocation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryLogTensorDeallocation) +} +MemoryLogTensorDeallocation::MemoryLogTensorDeallocation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorDeallocation.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MemoryLogTensorDeallocation) +} +MemoryLogTensorDeallocation::MemoryLogTensorDeallocation(const MemoryLogTensorDeallocation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.allocator_name().size() > 0) { + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.allocator_name(), + GetArenaNoVirtual()); + } + allocation_id_ = from.allocation_id_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryLogTensorDeallocation) +} + +void MemoryLogTensorDeallocation::SharedCtor() { + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + allocation_id_ = GOOGLE_LONGLONG(0); +} + +MemoryLogTensorDeallocation::~MemoryLogTensorDeallocation() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryLogTensorDeallocation) + SharedDtor(); +} + +void MemoryLogTensorDeallocation::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + allocator_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void MemoryLogTensorDeallocation::ArenaDtor(void* object) { + MemoryLogTensorDeallocation* _this = reinterpret_cast< MemoryLogTensorDeallocation* >(object); + (void)_this; +} +void MemoryLogTensorDeallocation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MemoryLogTensorDeallocation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryLogTensorDeallocation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryLogTensorDeallocation& MemoryLogTensorDeallocation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorDeallocation.base); + return *internal_default_instance(); +} + + +void MemoryLogTensorDeallocation::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + allocation_id_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool MemoryLogTensorDeallocation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 allocation_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &allocation_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string allocator_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_allocator_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryLogTensorDeallocation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryLogTensorDeallocation) + return false; +#undef DO_ +} + +void MemoryLogTensorDeallocation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 allocation_id = 1; + if (this->allocation_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->allocation_id(), output); + } + + // string allocator_name = 2; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->allocator_name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryLogTensorDeallocation) +} + +::google::protobuf::uint8* MemoryLogTensorDeallocation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 allocation_id = 1; + if (this->allocation_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->allocation_id(), target); + } + + // string allocator_name = 2; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->allocator_name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryLogTensorDeallocation) + return target; +} + +size_t MemoryLogTensorDeallocation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string allocator_name = 2; + if (this->allocator_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->allocator_name()); + } + + // int64 allocation_id = 1; + if (this->allocation_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->allocation_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryLogTensorDeallocation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + GOOGLE_DCHECK_NE(&from, this); + const MemoryLogTensorDeallocation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryLogTensorDeallocation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryLogTensorDeallocation) + MergeFrom(*source); + } +} + +void MemoryLogTensorDeallocation::MergeFrom(const MemoryLogTensorDeallocation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.allocator_name().size() > 0) { + set_allocator_name(from.allocator_name()); + } + if (from.allocation_id() != 0) { + set_allocation_id(from.allocation_id()); + } +} + +void MemoryLogTensorDeallocation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryLogTensorDeallocation::CopyFrom(const MemoryLogTensorDeallocation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryLogTensorDeallocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryLogTensorDeallocation::IsInitialized() const { + return true; +} + +void MemoryLogTensorDeallocation::Swap(MemoryLogTensorDeallocation* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MemoryLogTensorDeallocation* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MemoryLogTensorDeallocation::UnsafeArenaSwap(MemoryLogTensorDeallocation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MemoryLogTensorDeallocation::InternalSwap(MemoryLogTensorDeallocation* other) { + using std::swap; + allocator_name_.Swap(&other->allocator_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(allocation_id_, other->allocation_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryLogTensorDeallocation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MemoryLogTensorOutput::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_MemoryLogTensorOutput_default_instance_._instance.get_mutable()->tensor_ = const_cast< ::diplomacy::tensorflow::TensorDescription*>( + ::diplomacy::tensorflow::TensorDescription::internal_default_instance()); +} +void MemoryLogTensorOutput::unsafe_arena_set_allocated_tensor( + ::diplomacy::tensorflow::TensorDescription* tensor) { + if (GetArenaNoVirtual() == NULL) { + delete tensor_; + } + tensor_ = tensor; + if (tensor) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogTensorOutput.tensor) +} +void MemoryLogTensorOutput::clear_tensor() { + if (GetArenaNoVirtual() == NULL && tensor_ != NULL) { + delete tensor_; + } + tensor_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryLogTensorOutput::kStepIdFieldNumber; +const int MemoryLogTensorOutput::kKernelNameFieldNumber; +const int MemoryLogTensorOutput::kIndexFieldNumber; +const int MemoryLogTensorOutput::kTensorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryLogTensorOutput::MemoryLogTensorOutput() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorOutput.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryLogTensorOutput) +} +MemoryLogTensorOutput::MemoryLogTensorOutput(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorOutput.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MemoryLogTensorOutput) +} +MemoryLogTensorOutput::MemoryLogTensorOutput(const MemoryLogTensorOutput& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + kernel_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.kernel_name().size() > 0) { + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.kernel_name(), + GetArenaNoVirtual()); + } + if (from.has_tensor()) { + tensor_ = new ::diplomacy::tensorflow::TensorDescription(*from.tensor_); + } else { + tensor_ = NULL; + } + ::memcpy(&step_id_, &from.step_id_, + static_cast(reinterpret_cast(&index_) - + reinterpret_cast(&step_id_)) + sizeof(index_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryLogTensorOutput) +} + +void MemoryLogTensorOutput::SharedCtor() { + kernel_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&tensor_, 0, static_cast( + reinterpret_cast(&index_) - + reinterpret_cast(&tensor_)) + sizeof(index_)); +} + +MemoryLogTensorOutput::~MemoryLogTensorOutput() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryLogTensorOutput) + SharedDtor(); +} + +void MemoryLogTensorOutput::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + kernel_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete tensor_; +} + +void MemoryLogTensorOutput::ArenaDtor(void* object) { + MemoryLogTensorOutput* _this = reinterpret_cast< MemoryLogTensorOutput* >(object); + (void)_this; +} +void MemoryLogTensorOutput::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MemoryLogTensorOutput::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryLogTensorOutput::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryLogTensorOutput& MemoryLogTensorOutput::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogTensorOutput.base); + return *internal_default_instance(); +} + + +void MemoryLogTensorOutput::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryLogTensorOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + kernel_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && tensor_ != NULL) { + delete tensor_; + } + tensor_ = NULL; + ::memset(&step_id_, 0, static_cast( + reinterpret_cast(&index_) - + reinterpret_cast(&step_id_)) + sizeof(index_)); + _internal_metadata_.Clear(); +} + +bool MemoryLogTensorOutput::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryLogTensorOutput) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 step_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &step_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string kernel_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_kernel_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->kernel_name().data(), static_cast(this->kernel_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name")); + } else { + goto handle_unusual; + } + break; + } + + // int32 index = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &index_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorDescription tensor = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryLogTensorOutput) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryLogTensorOutput) + return false; +#undef DO_ +} + +void MemoryLogTensorOutput::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryLogTensorOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->step_id(), output); + } + + // string kernel_name = 2; + if (this->kernel_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->kernel_name().data(), static_cast(this->kernel_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->kernel_name(), output); + } + + // int32 index = 3; + if (this->index() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->index(), output); + } + + // .diplomacy.tensorflow.TensorDescription tensor = 4; + if (this->has_tensor()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_tensor(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryLogTensorOutput) +} + +::google::protobuf::uint8* MemoryLogTensorOutput::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryLogTensorOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->step_id(), target); + } + + // string kernel_name = 2; + if (this->kernel_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->kernel_name().data(), static_cast(this->kernel_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->kernel_name(), target); + } + + // int32 index = 3; + if (this->index() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->index(), target); + } + + // .diplomacy.tensorflow.TensorDescription tensor = 4; + if (this->has_tensor()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_tensor(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryLogTensorOutput) + return target; +} + +size_t MemoryLogTensorOutput::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryLogTensorOutput) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string kernel_name = 2; + if (this->kernel_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->kernel_name()); + } + + // .diplomacy.tensorflow.TensorDescription tensor = 4; + if (this->has_tensor()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tensor_); + } + + // int64 step_id = 1; + if (this->step_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->step_id()); + } + + // int32 index = 3; + if (this->index() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->index()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryLogTensorOutput::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryLogTensorOutput) + GOOGLE_DCHECK_NE(&from, this); + const MemoryLogTensorOutput* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryLogTensorOutput) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryLogTensorOutput) + MergeFrom(*source); + } +} + +void MemoryLogTensorOutput::MergeFrom(const MemoryLogTensorOutput& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryLogTensorOutput) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.kernel_name().size() > 0) { + set_kernel_name(from.kernel_name()); + } + if (from.has_tensor()) { + mutable_tensor()->::diplomacy::tensorflow::TensorDescription::MergeFrom(from.tensor()); + } + if (from.step_id() != 0) { + set_step_id(from.step_id()); + } + if (from.index() != 0) { + set_index(from.index()); + } +} + +void MemoryLogTensorOutput::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryLogTensorOutput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryLogTensorOutput::CopyFrom(const MemoryLogTensorOutput& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryLogTensorOutput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryLogTensorOutput::IsInitialized() const { + return true; +} + +void MemoryLogTensorOutput::Swap(MemoryLogTensorOutput* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MemoryLogTensorOutput* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MemoryLogTensorOutput::UnsafeArenaSwap(MemoryLogTensorOutput* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MemoryLogTensorOutput::InternalSwap(MemoryLogTensorOutput* other) { + using std::swap; + kernel_name_.Swap(&other->kernel_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(tensor_, other->tensor_); + swap(step_id_, other->step_id_); + swap(index_, other->index_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryLogTensorOutput::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MemoryLogRawAllocation::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryLogRawAllocation::kStepIdFieldNumber; +const int MemoryLogRawAllocation::kOperationFieldNumber; +const int MemoryLogRawAllocation::kNumBytesFieldNumber; +const int MemoryLogRawAllocation::kPtrFieldNumber; +const int MemoryLogRawAllocation::kAllocationIdFieldNumber; +const int MemoryLogRawAllocation::kAllocatorNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryLogRawAllocation::MemoryLogRawAllocation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogRawAllocation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryLogRawAllocation) +} +MemoryLogRawAllocation::MemoryLogRawAllocation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogRawAllocation.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MemoryLogRawAllocation) +} +MemoryLogRawAllocation::MemoryLogRawAllocation(const MemoryLogRawAllocation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + operation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.operation().size() > 0) { + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.operation(), + GetArenaNoVirtual()); + } + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.allocator_name().size() > 0) { + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.allocator_name(), + GetArenaNoVirtual()); + } + ::memcpy(&step_id_, &from.step_id_, + static_cast(reinterpret_cast(&allocation_id_) - + reinterpret_cast(&step_id_)) + sizeof(allocation_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryLogRawAllocation) +} + +void MemoryLogRawAllocation::SharedCtor() { + operation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&step_id_, 0, static_cast( + reinterpret_cast(&allocation_id_) - + reinterpret_cast(&step_id_)) + sizeof(allocation_id_)); +} + +MemoryLogRawAllocation::~MemoryLogRawAllocation() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryLogRawAllocation) + SharedDtor(); +} + +void MemoryLogRawAllocation::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + operation_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + allocator_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void MemoryLogRawAllocation::ArenaDtor(void* object) { + MemoryLogRawAllocation* _this = reinterpret_cast< MemoryLogRawAllocation* >(object); + (void)_this; +} +void MemoryLogRawAllocation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MemoryLogRawAllocation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryLogRawAllocation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryLogRawAllocation& MemoryLogRawAllocation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogRawAllocation.base); + return *internal_default_instance(); +} + + +void MemoryLogRawAllocation::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryLogRawAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + operation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&step_id_, 0, static_cast( + reinterpret_cast(&allocation_id_) - + reinterpret_cast(&step_id_)) + sizeof(allocation_id_)); + _internal_metadata_.Clear(); +} + +bool MemoryLogRawAllocation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryLogRawAllocation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 step_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &step_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string operation = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_operation())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->operation().data(), static_cast(this->operation().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogRawAllocation.operation")); + } else { + goto handle_unusual; + } + break; + } + + // int64 num_bytes = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 ptr = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &ptr_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 allocation_id = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &allocation_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string allocator_name = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_allocator_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryLogRawAllocation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryLogRawAllocation) + return false; +#undef DO_ +} + +void MemoryLogRawAllocation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryLogRawAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->step_id(), output); + } + + // string operation = 2; + if (this->operation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->operation().data(), static_cast(this->operation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawAllocation.operation"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->operation(), output); + } + + // int64 num_bytes = 3; + if (this->num_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->num_bytes(), output); + } + + // uint64 ptr = 4; + if (this->ptr() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->ptr(), output); + } + + // int64 allocation_id = 5; + if (this->allocation_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->allocation_id(), output); + } + + // string allocator_name = 6; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->allocator_name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryLogRawAllocation) +} + +::google::protobuf::uint8* MemoryLogRawAllocation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryLogRawAllocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->step_id(), target); + } + + // string operation = 2; + if (this->operation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->operation().data(), static_cast(this->operation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawAllocation.operation"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->operation(), target); + } + + // int64 num_bytes = 3; + if (this->num_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->num_bytes(), target); + } + + // uint64 ptr = 4; + if (this->ptr() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->ptr(), target); + } + + // int64 allocation_id = 5; + if (this->allocation_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->allocation_id(), target); + } + + // string allocator_name = 6; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->allocator_name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryLogRawAllocation) + return target; +} + +size_t MemoryLogRawAllocation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryLogRawAllocation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string operation = 2; + if (this->operation().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->operation()); + } + + // string allocator_name = 6; + if (this->allocator_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->allocator_name()); + } + + // int64 step_id = 1; + if (this->step_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->step_id()); + } + + // int64 num_bytes = 3; + if (this->num_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_bytes()); + } + + // uint64 ptr = 4; + if (this->ptr() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->ptr()); + } + + // int64 allocation_id = 5; + if (this->allocation_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->allocation_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryLogRawAllocation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryLogRawAllocation) + GOOGLE_DCHECK_NE(&from, this); + const MemoryLogRawAllocation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryLogRawAllocation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryLogRawAllocation) + MergeFrom(*source); + } +} + +void MemoryLogRawAllocation::MergeFrom(const MemoryLogRawAllocation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryLogRawAllocation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.operation().size() > 0) { + set_operation(from.operation()); + } + if (from.allocator_name().size() > 0) { + set_allocator_name(from.allocator_name()); + } + if (from.step_id() != 0) { + set_step_id(from.step_id()); + } + if (from.num_bytes() != 0) { + set_num_bytes(from.num_bytes()); + } + if (from.ptr() != 0) { + set_ptr(from.ptr()); + } + if (from.allocation_id() != 0) { + set_allocation_id(from.allocation_id()); + } +} + +void MemoryLogRawAllocation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryLogRawAllocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryLogRawAllocation::CopyFrom(const MemoryLogRawAllocation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryLogRawAllocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryLogRawAllocation::IsInitialized() const { + return true; +} + +void MemoryLogRawAllocation::Swap(MemoryLogRawAllocation* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MemoryLogRawAllocation* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MemoryLogRawAllocation::UnsafeArenaSwap(MemoryLogRawAllocation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MemoryLogRawAllocation::InternalSwap(MemoryLogRawAllocation* other) { + using std::swap; + operation_.Swap(&other->operation_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + allocator_name_.Swap(&other->allocator_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(step_id_, other->step_id_); + swap(num_bytes_, other->num_bytes_); + swap(ptr_, other->ptr_); + swap(allocation_id_, other->allocation_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryLogRawAllocation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MemoryLogRawDeallocation::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryLogRawDeallocation::kStepIdFieldNumber; +const int MemoryLogRawDeallocation::kOperationFieldNumber; +const int MemoryLogRawDeallocation::kAllocationIdFieldNumber; +const int MemoryLogRawDeallocation::kAllocatorNameFieldNumber; +const int MemoryLogRawDeallocation::kDeferredFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryLogRawDeallocation::MemoryLogRawDeallocation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogRawDeallocation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryLogRawDeallocation) +} +MemoryLogRawDeallocation::MemoryLogRawDeallocation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogRawDeallocation.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MemoryLogRawDeallocation) +} +MemoryLogRawDeallocation::MemoryLogRawDeallocation(const MemoryLogRawDeallocation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + operation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.operation().size() > 0) { + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.operation(), + GetArenaNoVirtual()); + } + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.allocator_name().size() > 0) { + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.allocator_name(), + GetArenaNoVirtual()); + } + ::memcpy(&step_id_, &from.step_id_, + static_cast(reinterpret_cast(&deferred_) - + reinterpret_cast(&step_id_)) + sizeof(deferred_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryLogRawDeallocation) +} + +void MemoryLogRawDeallocation::SharedCtor() { + operation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&step_id_, 0, static_cast( + reinterpret_cast(&deferred_) - + reinterpret_cast(&step_id_)) + sizeof(deferred_)); +} + +MemoryLogRawDeallocation::~MemoryLogRawDeallocation() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryLogRawDeallocation) + SharedDtor(); +} + +void MemoryLogRawDeallocation::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + operation_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + allocator_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void MemoryLogRawDeallocation::ArenaDtor(void* object) { + MemoryLogRawDeallocation* _this = reinterpret_cast< MemoryLogRawDeallocation* >(object); + (void)_this; +} +void MemoryLogRawDeallocation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MemoryLogRawDeallocation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryLogRawDeallocation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryLogRawDeallocation& MemoryLogRawDeallocation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::scc_info_MemoryLogRawDeallocation.base); + return *internal_default_instance(); +} + + +void MemoryLogRawDeallocation::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + operation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&step_id_, 0, static_cast( + reinterpret_cast(&deferred_) - + reinterpret_cast(&step_id_)) + sizeof(deferred_)); + _internal_metadata_.Clear(); +} + +bool MemoryLogRawDeallocation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 step_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &step_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string operation = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_operation())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->operation().data(), static_cast(this->operation().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogRawDeallocation.operation")); + } else { + goto handle_unusual; + } + break; + } + + // int64 allocation_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &allocation_id_))); + } else { + goto handle_unusual; + } + break; + } + + // string allocator_name = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_allocator_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name")); + } else { + goto handle_unusual; + } + break; + } + + // bool deferred = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deferred_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryLogRawDeallocation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryLogRawDeallocation) + return false; +#undef DO_ +} + +void MemoryLogRawDeallocation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->step_id(), output); + } + + // string operation = 2; + if (this->operation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->operation().data(), static_cast(this->operation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawDeallocation.operation"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->operation(), output); + } + + // int64 allocation_id = 3; + if (this->allocation_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->allocation_id(), output); + } + + // string allocator_name = 4; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->allocator_name(), output); + } + + // bool deferred = 5; + if (this->deferred() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->deferred(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryLogRawDeallocation) +} + +::google::protobuf::uint8* MemoryLogRawDeallocation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 step_id = 1; + if (this->step_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->step_id(), target); + } + + // string operation = 2; + if (this->operation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->operation().data(), static_cast(this->operation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawDeallocation.operation"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->operation(), target); + } + + // int64 allocation_id = 3; + if (this->allocation_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->allocation_id(), target); + } + + // string allocator_name = 4; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->allocator_name(), target); + } + + // bool deferred = 5; + if (this->deferred() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->deferred(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryLogRawDeallocation) + return target; +} + +size_t MemoryLogRawDeallocation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string operation = 2; + if (this->operation().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->operation()); + } + + // string allocator_name = 4; + if (this->allocator_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->allocator_name()); + } + + // int64 step_id = 1; + if (this->step_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->step_id()); + } + + // int64 allocation_id = 3; + if (this->allocation_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->allocation_id()); + } + + // bool deferred = 5; + if (this->deferred() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryLogRawDeallocation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + GOOGLE_DCHECK_NE(&from, this); + const MemoryLogRawDeallocation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryLogRawDeallocation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryLogRawDeallocation) + MergeFrom(*source); + } +} + +void MemoryLogRawDeallocation::MergeFrom(const MemoryLogRawDeallocation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.operation().size() > 0) { + set_operation(from.operation()); + } + if (from.allocator_name().size() > 0) { + set_allocator_name(from.allocator_name()); + } + if (from.step_id() != 0) { + set_step_id(from.step_id()); + } + if (from.allocation_id() != 0) { + set_allocation_id(from.allocation_id()); + } + if (from.deferred() != 0) { + set_deferred(from.deferred()); + } +} + +void MemoryLogRawDeallocation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryLogRawDeallocation::CopyFrom(const MemoryLogRawDeallocation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryLogRawDeallocation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryLogRawDeallocation::IsInitialized() const { + return true; +} + +void MemoryLogRawDeallocation::Swap(MemoryLogRawDeallocation* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MemoryLogRawDeallocation* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MemoryLogRawDeallocation::UnsafeArenaSwap(MemoryLogRawDeallocation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MemoryLogRawDeallocation::InternalSwap(MemoryLogRawDeallocation* other) { + using std::swap; + operation_.Swap(&other->operation_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + allocator_name_.Swap(&other->allocator_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(step_id_, other->step_id_); + swap(allocation_id_, other->allocation_id_); + swap(deferred_, other->deferred_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryLogRawDeallocation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryLogStep* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryLogStep >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MemoryLogStep >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryLogTensorAllocation* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryLogTensorAllocation >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MemoryLogTensorAllocation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryLogTensorDeallocation* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryLogTensorDeallocation >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MemoryLogTensorDeallocation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryLogTensorOutput* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryLogTensorOutput >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MemoryLogTensorOutput >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryLogRawAllocation* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryLogRawAllocation >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MemoryLogRawAllocation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryLogRawDeallocation* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryLogRawDeallocation >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MemoryLogRawDeallocation >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.pb.h new file mode 100644 index 0000000..ab63a4a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.pb.h @@ -0,0 +1,1996 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/log_memory.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/tensor_description.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[6]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto +namespace diplomacy { +namespace tensorflow { +class MemoryLogRawAllocation; +class MemoryLogRawAllocationDefaultTypeInternal; +extern MemoryLogRawAllocationDefaultTypeInternal _MemoryLogRawAllocation_default_instance_; +class MemoryLogRawDeallocation; +class MemoryLogRawDeallocationDefaultTypeInternal; +extern MemoryLogRawDeallocationDefaultTypeInternal _MemoryLogRawDeallocation_default_instance_; +class MemoryLogStep; +class MemoryLogStepDefaultTypeInternal; +extern MemoryLogStepDefaultTypeInternal _MemoryLogStep_default_instance_; +class MemoryLogTensorAllocation; +class MemoryLogTensorAllocationDefaultTypeInternal; +extern MemoryLogTensorAllocationDefaultTypeInternal _MemoryLogTensorAllocation_default_instance_; +class MemoryLogTensorDeallocation; +class MemoryLogTensorDeallocationDefaultTypeInternal; +extern MemoryLogTensorDeallocationDefaultTypeInternal _MemoryLogTensorDeallocation_default_instance_; +class MemoryLogTensorOutput; +class MemoryLogTensorOutputDefaultTypeInternal; +extern MemoryLogTensorOutputDefaultTypeInternal _MemoryLogTensorOutput_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::MemoryLogRawAllocation* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryLogRawAllocation>(Arena*); +template<> ::diplomacy::tensorflow::MemoryLogRawDeallocation* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryLogRawDeallocation>(Arena*); +template<> ::diplomacy::tensorflow::MemoryLogStep* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryLogStep>(Arena*); +template<> ::diplomacy::tensorflow::MemoryLogTensorAllocation* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryLogTensorAllocation>(Arena*); +template<> ::diplomacy::tensorflow::MemoryLogTensorDeallocation* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryLogTensorDeallocation>(Arena*); +template<> ::diplomacy::tensorflow::MemoryLogTensorOutput* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryLogTensorOutput>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class MemoryLogStep : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryLogStep) */ { + public: + MemoryLogStep(); + virtual ~MemoryLogStep(); + + MemoryLogStep(const MemoryLogStep& from); + + inline MemoryLogStep& operator=(const MemoryLogStep& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryLogStep(MemoryLogStep&& from) noexcept + : MemoryLogStep() { + *this = ::std::move(from); + } + + inline MemoryLogStep& operator=(MemoryLogStep&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryLogStep& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryLogStep* internal_default_instance() { + return reinterpret_cast( + &_MemoryLogStep_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(MemoryLogStep* other); + void Swap(MemoryLogStep* other); + friend void swap(MemoryLogStep& a, MemoryLogStep& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryLogStep* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryLogStep* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryLogStep& from); + void MergeFrom(const MemoryLogStep& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryLogStep* other); + protected: + explicit MemoryLogStep(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string handle = 2; + void clear_handle(); + static const int kHandleFieldNumber = 2; + const ::std::string& handle() const; + void set_handle(const ::std::string& value); + #if LANG_CXX11 + void set_handle(::std::string&& value); + #endif + void set_handle(const char* value); + void set_handle(const char* value, size_t size); + ::std::string* mutable_handle(); + ::std::string* release_handle(); + void set_allocated_handle(::std::string* handle); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_handle(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_handle( + ::std::string* handle); + + // int64 step_id = 1; + void clear_step_id(); + static const int kStepIdFieldNumber = 1; + ::google::protobuf::int64 step_id() const; + void set_step_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryLogStep) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr handle_; + ::google::protobuf::int64 step_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MemoryLogTensorAllocation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryLogTensorAllocation) */ { + public: + MemoryLogTensorAllocation(); + virtual ~MemoryLogTensorAllocation(); + + MemoryLogTensorAllocation(const MemoryLogTensorAllocation& from); + + inline MemoryLogTensorAllocation& operator=(const MemoryLogTensorAllocation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryLogTensorAllocation(MemoryLogTensorAllocation&& from) noexcept + : MemoryLogTensorAllocation() { + *this = ::std::move(from); + } + + inline MemoryLogTensorAllocation& operator=(MemoryLogTensorAllocation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryLogTensorAllocation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryLogTensorAllocation* internal_default_instance() { + return reinterpret_cast( + &_MemoryLogTensorAllocation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(MemoryLogTensorAllocation* other); + void Swap(MemoryLogTensorAllocation* other); + friend void swap(MemoryLogTensorAllocation& a, MemoryLogTensorAllocation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryLogTensorAllocation* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryLogTensorAllocation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryLogTensorAllocation& from); + void MergeFrom(const MemoryLogTensorAllocation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryLogTensorAllocation* other); + protected: + explicit MemoryLogTensorAllocation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string kernel_name = 2; + void clear_kernel_name(); + static const int kKernelNameFieldNumber = 2; + const ::std::string& kernel_name() const; + void set_kernel_name(const ::std::string& value); + #if LANG_CXX11 + void set_kernel_name(::std::string&& value); + #endif + void set_kernel_name(const char* value); + void set_kernel_name(const char* value, size_t size); + ::std::string* mutable_kernel_name(); + ::std::string* release_kernel_name(); + void set_allocated_kernel_name(::std::string* kernel_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_kernel_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_kernel_name( + ::std::string* kernel_name); + + // .diplomacy.tensorflow.TensorDescription tensor = 3; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 3; + private: + const ::diplomacy::tensorflow::TensorDescription& _internal_tensor() const; + public: + const ::diplomacy::tensorflow::TensorDescription& tensor() const; + ::diplomacy::tensorflow::TensorDescription* release_tensor(); + ::diplomacy::tensorflow::TensorDescription* mutable_tensor(); + void set_allocated_tensor(::diplomacy::tensorflow::TensorDescription* tensor); + void unsafe_arena_set_allocated_tensor( + ::diplomacy::tensorflow::TensorDescription* tensor); + ::diplomacy::tensorflow::TensorDescription* unsafe_arena_release_tensor(); + + // int64 step_id = 1; + void clear_step_id(); + static const int kStepIdFieldNumber = 1; + ::google::protobuf::int64 step_id() const; + void set_step_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryLogTensorAllocation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr kernel_name_; + ::diplomacy::tensorflow::TensorDescription* tensor_; + ::google::protobuf::int64 step_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MemoryLogTensorDeallocation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryLogTensorDeallocation) */ { + public: + MemoryLogTensorDeallocation(); + virtual ~MemoryLogTensorDeallocation(); + + MemoryLogTensorDeallocation(const MemoryLogTensorDeallocation& from); + + inline MemoryLogTensorDeallocation& operator=(const MemoryLogTensorDeallocation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryLogTensorDeallocation(MemoryLogTensorDeallocation&& from) noexcept + : MemoryLogTensorDeallocation() { + *this = ::std::move(from); + } + + inline MemoryLogTensorDeallocation& operator=(MemoryLogTensorDeallocation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryLogTensorDeallocation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryLogTensorDeallocation* internal_default_instance() { + return reinterpret_cast( + &_MemoryLogTensorDeallocation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(MemoryLogTensorDeallocation* other); + void Swap(MemoryLogTensorDeallocation* other); + friend void swap(MemoryLogTensorDeallocation& a, MemoryLogTensorDeallocation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryLogTensorDeallocation* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryLogTensorDeallocation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryLogTensorDeallocation& from); + void MergeFrom(const MemoryLogTensorDeallocation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryLogTensorDeallocation* other); + protected: + explicit MemoryLogTensorDeallocation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string allocator_name = 2; + void clear_allocator_name(); + static const int kAllocatorNameFieldNumber = 2; + const ::std::string& allocator_name() const; + void set_allocator_name(const ::std::string& value); + #if LANG_CXX11 + void set_allocator_name(::std::string&& value); + #endif + void set_allocator_name(const char* value); + void set_allocator_name(const char* value, size_t size); + ::std::string* mutable_allocator_name(); + ::std::string* release_allocator_name(); + void set_allocated_allocator_name(::std::string* allocator_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_allocator_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name); + + // int64 allocation_id = 1; + void clear_allocation_id(); + static const int kAllocationIdFieldNumber = 1; + ::google::protobuf::int64 allocation_id() const; + void set_allocation_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryLogTensorDeallocation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr allocator_name_; + ::google::protobuf::int64 allocation_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MemoryLogTensorOutput : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryLogTensorOutput) */ { + public: + MemoryLogTensorOutput(); + virtual ~MemoryLogTensorOutput(); + + MemoryLogTensorOutput(const MemoryLogTensorOutput& from); + + inline MemoryLogTensorOutput& operator=(const MemoryLogTensorOutput& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryLogTensorOutput(MemoryLogTensorOutput&& from) noexcept + : MemoryLogTensorOutput() { + *this = ::std::move(from); + } + + inline MemoryLogTensorOutput& operator=(MemoryLogTensorOutput&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryLogTensorOutput& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryLogTensorOutput* internal_default_instance() { + return reinterpret_cast( + &_MemoryLogTensorOutput_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(MemoryLogTensorOutput* other); + void Swap(MemoryLogTensorOutput* other); + friend void swap(MemoryLogTensorOutput& a, MemoryLogTensorOutput& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryLogTensorOutput* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryLogTensorOutput* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryLogTensorOutput& from); + void MergeFrom(const MemoryLogTensorOutput& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryLogTensorOutput* other); + protected: + explicit MemoryLogTensorOutput(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string kernel_name = 2; + void clear_kernel_name(); + static const int kKernelNameFieldNumber = 2; + const ::std::string& kernel_name() const; + void set_kernel_name(const ::std::string& value); + #if LANG_CXX11 + void set_kernel_name(::std::string&& value); + #endif + void set_kernel_name(const char* value); + void set_kernel_name(const char* value, size_t size); + ::std::string* mutable_kernel_name(); + ::std::string* release_kernel_name(); + void set_allocated_kernel_name(::std::string* kernel_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_kernel_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_kernel_name( + ::std::string* kernel_name); + + // .diplomacy.tensorflow.TensorDescription tensor = 4; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 4; + private: + const ::diplomacy::tensorflow::TensorDescription& _internal_tensor() const; + public: + const ::diplomacy::tensorflow::TensorDescription& tensor() const; + ::diplomacy::tensorflow::TensorDescription* release_tensor(); + ::diplomacy::tensorflow::TensorDescription* mutable_tensor(); + void set_allocated_tensor(::diplomacy::tensorflow::TensorDescription* tensor); + void unsafe_arena_set_allocated_tensor( + ::diplomacy::tensorflow::TensorDescription* tensor); + ::diplomacy::tensorflow::TensorDescription* unsafe_arena_release_tensor(); + + // int64 step_id = 1; + void clear_step_id(); + static const int kStepIdFieldNumber = 1; + ::google::protobuf::int64 step_id() const; + void set_step_id(::google::protobuf::int64 value); + + // int32 index = 3; + void clear_index(); + static const int kIndexFieldNumber = 3; + ::google::protobuf::int32 index() const; + void set_index(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryLogTensorOutput) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr kernel_name_; + ::diplomacy::tensorflow::TensorDescription* tensor_; + ::google::protobuf::int64 step_id_; + ::google::protobuf::int32 index_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MemoryLogRawAllocation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryLogRawAllocation) */ { + public: + MemoryLogRawAllocation(); + virtual ~MemoryLogRawAllocation(); + + MemoryLogRawAllocation(const MemoryLogRawAllocation& from); + + inline MemoryLogRawAllocation& operator=(const MemoryLogRawAllocation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryLogRawAllocation(MemoryLogRawAllocation&& from) noexcept + : MemoryLogRawAllocation() { + *this = ::std::move(from); + } + + inline MemoryLogRawAllocation& operator=(MemoryLogRawAllocation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryLogRawAllocation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryLogRawAllocation* internal_default_instance() { + return reinterpret_cast( + &_MemoryLogRawAllocation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(MemoryLogRawAllocation* other); + void Swap(MemoryLogRawAllocation* other); + friend void swap(MemoryLogRawAllocation& a, MemoryLogRawAllocation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryLogRawAllocation* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryLogRawAllocation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryLogRawAllocation& from); + void MergeFrom(const MemoryLogRawAllocation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryLogRawAllocation* other); + protected: + explicit MemoryLogRawAllocation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string operation = 2; + void clear_operation(); + static const int kOperationFieldNumber = 2; + const ::std::string& operation() const; + void set_operation(const ::std::string& value); + #if LANG_CXX11 + void set_operation(::std::string&& value); + #endif + void set_operation(const char* value); + void set_operation(const char* value, size_t size); + ::std::string* mutable_operation(); + ::std::string* release_operation(); + void set_allocated_operation(::std::string* operation); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_operation(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_operation( + ::std::string* operation); + + // string allocator_name = 6; + void clear_allocator_name(); + static const int kAllocatorNameFieldNumber = 6; + const ::std::string& allocator_name() const; + void set_allocator_name(const ::std::string& value); + #if LANG_CXX11 + void set_allocator_name(::std::string&& value); + #endif + void set_allocator_name(const char* value); + void set_allocator_name(const char* value, size_t size); + ::std::string* mutable_allocator_name(); + ::std::string* release_allocator_name(); + void set_allocated_allocator_name(::std::string* allocator_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_allocator_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name); + + // int64 step_id = 1; + void clear_step_id(); + static const int kStepIdFieldNumber = 1; + ::google::protobuf::int64 step_id() const; + void set_step_id(::google::protobuf::int64 value); + + // int64 num_bytes = 3; + void clear_num_bytes(); + static const int kNumBytesFieldNumber = 3; + ::google::protobuf::int64 num_bytes() const; + void set_num_bytes(::google::protobuf::int64 value); + + // uint64 ptr = 4; + void clear_ptr(); + static const int kPtrFieldNumber = 4; + ::google::protobuf::uint64 ptr() const; + void set_ptr(::google::protobuf::uint64 value); + + // int64 allocation_id = 5; + void clear_allocation_id(); + static const int kAllocationIdFieldNumber = 5; + ::google::protobuf::int64 allocation_id() const; + void set_allocation_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryLogRawAllocation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr operation_; + ::google::protobuf::internal::ArenaStringPtr allocator_name_; + ::google::protobuf::int64 step_id_; + ::google::protobuf::int64 num_bytes_; + ::google::protobuf::uint64 ptr_; + ::google::protobuf::int64 allocation_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MemoryLogRawDeallocation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryLogRawDeallocation) */ { + public: + MemoryLogRawDeallocation(); + virtual ~MemoryLogRawDeallocation(); + + MemoryLogRawDeallocation(const MemoryLogRawDeallocation& from); + + inline MemoryLogRawDeallocation& operator=(const MemoryLogRawDeallocation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryLogRawDeallocation(MemoryLogRawDeallocation&& from) noexcept + : MemoryLogRawDeallocation() { + *this = ::std::move(from); + } + + inline MemoryLogRawDeallocation& operator=(MemoryLogRawDeallocation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryLogRawDeallocation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryLogRawDeallocation* internal_default_instance() { + return reinterpret_cast( + &_MemoryLogRawDeallocation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(MemoryLogRawDeallocation* other); + void Swap(MemoryLogRawDeallocation* other); + friend void swap(MemoryLogRawDeallocation& a, MemoryLogRawDeallocation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryLogRawDeallocation* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryLogRawDeallocation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryLogRawDeallocation& from); + void MergeFrom(const MemoryLogRawDeallocation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryLogRawDeallocation* other); + protected: + explicit MemoryLogRawDeallocation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string operation = 2; + void clear_operation(); + static const int kOperationFieldNumber = 2; + const ::std::string& operation() const; + void set_operation(const ::std::string& value); + #if LANG_CXX11 + void set_operation(::std::string&& value); + #endif + void set_operation(const char* value); + void set_operation(const char* value, size_t size); + ::std::string* mutable_operation(); + ::std::string* release_operation(); + void set_allocated_operation(::std::string* operation); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_operation(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_operation( + ::std::string* operation); + + // string allocator_name = 4; + void clear_allocator_name(); + static const int kAllocatorNameFieldNumber = 4; + const ::std::string& allocator_name() const; + void set_allocator_name(const ::std::string& value); + #if LANG_CXX11 + void set_allocator_name(::std::string&& value); + #endif + void set_allocator_name(const char* value); + void set_allocator_name(const char* value, size_t size); + ::std::string* mutable_allocator_name(); + ::std::string* release_allocator_name(); + void set_allocated_allocator_name(::std::string* allocator_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_allocator_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name); + + // int64 step_id = 1; + void clear_step_id(); + static const int kStepIdFieldNumber = 1; + ::google::protobuf::int64 step_id() const; + void set_step_id(::google::protobuf::int64 value); + + // int64 allocation_id = 3; + void clear_allocation_id(); + static const int kAllocationIdFieldNumber = 3; + ::google::protobuf::int64 allocation_id() const; + void set_allocation_id(::google::protobuf::int64 value); + + // bool deferred = 5; + void clear_deferred(); + static const int kDeferredFieldNumber = 5; + bool deferred() const; + void set_deferred(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryLogRawDeallocation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr operation_; + ::google::protobuf::internal::ArenaStringPtr allocator_name_; + ::google::protobuf::int64 step_id_; + ::google::protobuf::int64 allocation_id_; + bool deferred_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// MemoryLogStep + +// int64 step_id = 1; +inline void MemoryLogStep::clear_step_id() { + step_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogStep::step_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogStep.step_id) + return step_id_; +} +inline void MemoryLogStep::set_step_id(::google::protobuf::int64 value) { + + step_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogStep.step_id) +} + +// string handle = 2; +inline void MemoryLogStep::clear_handle() { + handle_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogStep::handle() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogStep.handle) + return handle_.Get(); +} +inline void MemoryLogStep::set_handle(const ::std::string& value) { + + handle_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogStep.handle) +} +#if LANG_CXX11 +inline void MemoryLogStep::set_handle(::std::string&& value) { + + handle_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogStep.handle) +} +#endif +inline void MemoryLogStep::set_handle(const char* value) { + GOOGLE_DCHECK(value != NULL); + + handle_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogStep.handle) +} +inline void MemoryLogStep::set_handle(const char* value, + size_t size) { + + handle_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogStep.handle) +} +inline ::std::string* MemoryLogStep::mutable_handle() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogStep.handle) + return handle_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogStep::release_handle() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogStep.handle) + + return handle_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogStep::set_allocated_handle(::std::string* handle) { + if (handle != NULL) { + + } else { + + } + handle_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), handle, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogStep.handle) +} +inline ::std::string* MemoryLogStep::unsafe_arena_release_handle() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogStep.handle) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return handle_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogStep::unsafe_arena_set_allocated_handle( + ::std::string* handle) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (handle != NULL) { + + } else { + + } + handle_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + handle, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogStep.handle) +} + +// ------------------------------------------------------------------- + +// MemoryLogTensorAllocation + +// int64 step_id = 1; +inline void MemoryLogTensorAllocation::clear_step_id() { + step_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogTensorAllocation::step_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorAllocation.step_id) + return step_id_; +} +inline void MemoryLogTensorAllocation::set_step_id(::google::protobuf::int64 value) { + + step_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogTensorAllocation.step_id) +} + +// string kernel_name = 2; +inline void MemoryLogTensorAllocation::clear_kernel_name() { + kernel_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogTensorAllocation::kernel_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) + return kernel_name_.Get(); +} +inline void MemoryLogTensorAllocation::set_kernel_name(const ::std::string& value) { + + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) +} +#if LANG_CXX11 +inline void MemoryLogTensorAllocation::set_kernel_name(::std::string&& value) { + + kernel_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) +} +#endif +inline void MemoryLogTensorAllocation::set_kernel_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) +} +inline void MemoryLogTensorAllocation::set_kernel_name(const char* value, + size_t size) { + + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) +} +inline ::std::string* MemoryLogTensorAllocation::mutable_kernel_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) + return kernel_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogTensorAllocation::release_kernel_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) + + return kernel_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogTensorAllocation::set_allocated_kernel_name(::std::string* kernel_name) { + if (kernel_name != NULL) { + + } else { + + } + kernel_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), kernel_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) +} +inline ::std::string* MemoryLogTensorAllocation::unsafe_arena_release_kernel_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return kernel_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogTensorAllocation::unsafe_arena_set_allocated_kernel_name( + ::std::string* kernel_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (kernel_name != NULL) { + + } else { + + } + kernel_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + kernel_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogTensorAllocation.kernel_name) +} + +// .diplomacy.tensorflow.TensorDescription tensor = 3; +inline bool MemoryLogTensorAllocation::has_tensor() const { + return this != internal_default_instance() && tensor_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorDescription& MemoryLogTensorAllocation::_internal_tensor() const { + return *tensor_; +} +inline const ::diplomacy::tensorflow::TensorDescription& MemoryLogTensorAllocation::tensor() const { + const ::diplomacy::tensorflow::TensorDescription* p = tensor_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorAllocation.tensor) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorDescription_default_instance_); +} +inline ::diplomacy::tensorflow::TensorDescription* MemoryLogTensorAllocation::release_tensor() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogTensorAllocation.tensor) + + ::diplomacy::tensorflow::TensorDescription* temp = tensor_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tensor_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorDescription* MemoryLogTensorAllocation::unsafe_arena_release_tensor() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogTensorAllocation.tensor) + + ::diplomacy::tensorflow::TensorDescription* temp = tensor_; + tensor_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorDescription* MemoryLogTensorAllocation::mutable_tensor() { + + if (tensor_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorDescription>(GetArenaNoVirtual()); + tensor_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogTensorAllocation.tensor) + return tensor_; +} +inline void MemoryLogTensorAllocation::set_allocated_tensor(::diplomacy::tensorflow::TensorDescription* tensor) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_); + } + if (tensor) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor)->GetArena(); + if (message_arena != submessage_arena) { + tensor = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor, submessage_arena); + } + + } else { + + } + tensor_ = tensor; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogTensorAllocation.tensor) +} + +// ------------------------------------------------------------------- + +// MemoryLogTensorDeallocation + +// int64 allocation_id = 1; +inline void MemoryLogTensorDeallocation::clear_allocation_id() { + allocation_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogTensorDeallocation::allocation_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocation_id) + return allocation_id_; +} +inline void MemoryLogTensorDeallocation::set_allocation_id(::google::protobuf::int64 value) { + + allocation_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocation_id) +} + +// string allocator_name = 2; +inline void MemoryLogTensorDeallocation::clear_allocator_name() { + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogTensorDeallocation::allocator_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) + return allocator_name_.Get(); +} +inline void MemoryLogTensorDeallocation::set_allocator_name(const ::std::string& value) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) +} +#if LANG_CXX11 +inline void MemoryLogTensorDeallocation::set_allocator_name(::std::string&& value) { + + allocator_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) +} +#endif +inline void MemoryLogTensorDeallocation::set_allocator_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) +} +inline void MemoryLogTensorDeallocation::set_allocator_name(const char* value, + size_t size) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) +} +inline ::std::string* MemoryLogTensorDeallocation::mutable_allocator_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) + return allocator_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogTensorDeallocation::release_allocator_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) + + return allocator_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogTensorDeallocation::set_allocated_allocator_name(::std::string* allocator_name) { + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), allocator_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) +} +inline ::std::string* MemoryLogTensorDeallocation::unsafe_arena_release_allocator_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return allocator_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogTensorDeallocation::unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + allocator_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogTensorDeallocation.allocator_name) +} + +// ------------------------------------------------------------------- + +// MemoryLogTensorOutput + +// int64 step_id = 1; +inline void MemoryLogTensorOutput::clear_step_id() { + step_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogTensorOutput::step_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorOutput.step_id) + return step_id_; +} +inline void MemoryLogTensorOutput::set_step_id(::google::protobuf::int64 value) { + + step_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogTensorOutput.step_id) +} + +// string kernel_name = 2; +inline void MemoryLogTensorOutput::clear_kernel_name() { + kernel_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogTensorOutput::kernel_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) + return kernel_name_.Get(); +} +inline void MemoryLogTensorOutput::set_kernel_name(const ::std::string& value) { + + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) +} +#if LANG_CXX11 +inline void MemoryLogTensorOutput::set_kernel_name(::std::string&& value) { + + kernel_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) +} +#endif +inline void MemoryLogTensorOutput::set_kernel_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) +} +inline void MemoryLogTensorOutput::set_kernel_name(const char* value, + size_t size) { + + kernel_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) +} +inline ::std::string* MemoryLogTensorOutput::mutable_kernel_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) + return kernel_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogTensorOutput::release_kernel_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) + + return kernel_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogTensorOutput::set_allocated_kernel_name(::std::string* kernel_name) { + if (kernel_name != NULL) { + + } else { + + } + kernel_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), kernel_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) +} +inline ::std::string* MemoryLogTensorOutput::unsafe_arena_release_kernel_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return kernel_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogTensorOutput::unsafe_arena_set_allocated_kernel_name( + ::std::string* kernel_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (kernel_name != NULL) { + + } else { + + } + kernel_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + kernel_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogTensorOutput.kernel_name) +} + +// int32 index = 3; +inline void MemoryLogTensorOutput::clear_index() { + index_ = 0; +} +inline ::google::protobuf::int32 MemoryLogTensorOutput::index() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorOutput.index) + return index_; +} +inline void MemoryLogTensorOutput::set_index(::google::protobuf::int32 value) { + + index_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogTensorOutput.index) +} + +// .diplomacy.tensorflow.TensorDescription tensor = 4; +inline bool MemoryLogTensorOutput::has_tensor() const { + return this != internal_default_instance() && tensor_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorDescription& MemoryLogTensorOutput::_internal_tensor() const { + return *tensor_; +} +inline const ::diplomacy::tensorflow::TensorDescription& MemoryLogTensorOutput::tensor() const { + const ::diplomacy::tensorflow::TensorDescription* p = tensor_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogTensorOutput.tensor) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorDescription_default_instance_); +} +inline ::diplomacy::tensorflow::TensorDescription* MemoryLogTensorOutput::release_tensor() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogTensorOutput.tensor) + + ::diplomacy::tensorflow::TensorDescription* temp = tensor_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tensor_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorDescription* MemoryLogTensorOutput::unsafe_arena_release_tensor() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogTensorOutput.tensor) + + ::diplomacy::tensorflow::TensorDescription* temp = tensor_; + tensor_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorDescription* MemoryLogTensorOutput::mutable_tensor() { + + if (tensor_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorDescription>(GetArenaNoVirtual()); + tensor_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogTensorOutput.tensor) + return tensor_; +} +inline void MemoryLogTensorOutput::set_allocated_tensor(::diplomacy::tensorflow::TensorDescription* tensor) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_); + } + if (tensor) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor)->GetArena(); + if (message_arena != submessage_arena) { + tensor = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor, submessage_arena); + } + + } else { + + } + tensor_ = tensor; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogTensorOutput.tensor) +} + +// ------------------------------------------------------------------- + +// MemoryLogRawAllocation + +// int64 step_id = 1; +inline void MemoryLogRawAllocation::clear_step_id() { + step_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogRawAllocation::step_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawAllocation.step_id) + return step_id_; +} +inline void MemoryLogRawAllocation::set_step_id(::google::protobuf::int64 value) { + + step_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawAllocation.step_id) +} + +// string operation = 2; +inline void MemoryLogRawAllocation::clear_operation() { + operation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogRawAllocation::operation() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawAllocation.operation) + return operation_.Get(); +} +inline void MemoryLogRawAllocation::set_operation(const ::std::string& value) { + + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawAllocation.operation) +} +#if LANG_CXX11 +inline void MemoryLogRawAllocation::set_operation(::std::string&& value) { + + operation_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogRawAllocation.operation) +} +#endif +inline void MemoryLogRawAllocation::set_operation(const char* value) { + GOOGLE_DCHECK(value != NULL); + + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogRawAllocation.operation) +} +inline void MemoryLogRawAllocation::set_operation(const char* value, + size_t size) { + + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogRawAllocation.operation) +} +inline ::std::string* MemoryLogRawAllocation::mutable_operation() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogRawAllocation.operation) + return operation_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogRawAllocation::release_operation() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogRawAllocation.operation) + + return operation_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogRawAllocation::set_allocated_operation(::std::string* operation) { + if (operation != NULL) { + + } else { + + } + operation_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), operation, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogRawAllocation.operation) +} +inline ::std::string* MemoryLogRawAllocation::unsafe_arena_release_operation() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogRawAllocation.operation) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return operation_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogRawAllocation::unsafe_arena_set_allocated_operation( + ::std::string* operation) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (operation != NULL) { + + } else { + + } + operation_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + operation, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogRawAllocation.operation) +} + +// int64 num_bytes = 3; +inline void MemoryLogRawAllocation::clear_num_bytes() { + num_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogRawAllocation::num_bytes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawAllocation.num_bytes) + return num_bytes_; +} +inline void MemoryLogRawAllocation::set_num_bytes(::google::protobuf::int64 value) { + + num_bytes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawAllocation.num_bytes) +} + +// uint64 ptr = 4; +inline void MemoryLogRawAllocation::clear_ptr() { + ptr_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 MemoryLogRawAllocation::ptr() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawAllocation.ptr) + return ptr_; +} +inline void MemoryLogRawAllocation::set_ptr(::google::protobuf::uint64 value) { + + ptr_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawAllocation.ptr) +} + +// int64 allocation_id = 5; +inline void MemoryLogRawAllocation::clear_allocation_id() { + allocation_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogRawAllocation::allocation_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawAllocation.allocation_id) + return allocation_id_; +} +inline void MemoryLogRawAllocation::set_allocation_id(::google::protobuf::int64 value) { + + allocation_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawAllocation.allocation_id) +} + +// string allocator_name = 6; +inline void MemoryLogRawAllocation::clear_allocator_name() { + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogRawAllocation::allocator_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) + return allocator_name_.Get(); +} +inline void MemoryLogRawAllocation::set_allocator_name(const ::std::string& value) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) +} +#if LANG_CXX11 +inline void MemoryLogRawAllocation::set_allocator_name(::std::string&& value) { + + allocator_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) +} +#endif +inline void MemoryLogRawAllocation::set_allocator_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) +} +inline void MemoryLogRawAllocation::set_allocator_name(const char* value, + size_t size) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) +} +inline ::std::string* MemoryLogRawAllocation::mutable_allocator_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) + return allocator_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogRawAllocation::release_allocator_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) + + return allocator_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogRawAllocation::set_allocated_allocator_name(::std::string* allocator_name) { + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), allocator_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) +} +inline ::std::string* MemoryLogRawAllocation::unsafe_arena_release_allocator_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return allocator_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogRawAllocation::unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + allocator_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogRawAllocation.allocator_name) +} + +// ------------------------------------------------------------------- + +// MemoryLogRawDeallocation + +// int64 step_id = 1; +inline void MemoryLogRawDeallocation::clear_step_id() { + step_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogRawDeallocation::step_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawDeallocation.step_id) + return step_id_; +} +inline void MemoryLogRawDeallocation::set_step_id(::google::protobuf::int64 value) { + + step_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawDeallocation.step_id) +} + +// string operation = 2; +inline void MemoryLogRawDeallocation::clear_operation() { + operation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogRawDeallocation::operation() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) + return operation_.Get(); +} +inline void MemoryLogRawDeallocation::set_operation(const ::std::string& value) { + + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) +} +#if LANG_CXX11 +inline void MemoryLogRawDeallocation::set_operation(::std::string&& value) { + + operation_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) +} +#endif +inline void MemoryLogRawDeallocation::set_operation(const char* value) { + GOOGLE_DCHECK(value != NULL); + + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) +} +inline void MemoryLogRawDeallocation::set_operation(const char* value, + size_t size) { + + operation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) +} +inline ::std::string* MemoryLogRawDeallocation::mutable_operation() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) + return operation_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogRawDeallocation::release_operation() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) + + return operation_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogRawDeallocation::set_allocated_operation(::std::string* operation) { + if (operation != NULL) { + + } else { + + } + operation_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), operation, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) +} +inline ::std::string* MemoryLogRawDeallocation::unsafe_arena_release_operation() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return operation_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogRawDeallocation::unsafe_arena_set_allocated_operation( + ::std::string* operation) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (operation != NULL) { + + } else { + + } + operation_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + operation, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogRawDeallocation.operation) +} + +// int64 allocation_id = 3; +inline void MemoryLogRawDeallocation::clear_allocation_id() { + allocation_id_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryLogRawDeallocation::allocation_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawDeallocation.allocation_id) + return allocation_id_; +} +inline void MemoryLogRawDeallocation::set_allocation_id(::google::protobuf::int64 value) { + + allocation_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawDeallocation.allocation_id) +} + +// string allocator_name = 4; +inline void MemoryLogRawDeallocation::clear_allocator_name() { + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& MemoryLogRawDeallocation::allocator_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) + return allocator_name_.Get(); +} +inline void MemoryLogRawDeallocation::set_allocator_name(const ::std::string& value) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) +} +#if LANG_CXX11 +inline void MemoryLogRawDeallocation::set_allocator_name(::std::string&& value) { + + allocator_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) +} +#endif +inline void MemoryLogRawDeallocation::set_allocator_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) +} +inline void MemoryLogRawDeallocation::set_allocator_name(const char* value, + size_t size) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) +} +inline ::std::string* MemoryLogRawDeallocation::mutable_allocator_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) + return allocator_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* MemoryLogRawDeallocation::release_allocator_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) + + return allocator_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void MemoryLogRawDeallocation::set_allocated_allocator_name(::std::string* allocator_name) { + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), allocator_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) +} +inline ::std::string* MemoryLogRawDeallocation::unsafe_arena_release_allocator_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return allocator_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void MemoryLogRawDeallocation::unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + allocator_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.MemoryLogRawDeallocation.allocator_name) +} + +// bool deferred = 5; +inline void MemoryLogRawDeallocation::clear_deferred() { + deferred_ = false; +} +inline bool MemoryLogRawDeallocation::deferred() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryLogRawDeallocation.deferred) + return deferred_; +} +inline void MemoryLogRawDeallocation::set_deferred(bool value) { + + deferred_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryLogRawDeallocation.deferred) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2flog_5fmemory_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.proto new file mode 100644 index 0000000..13ca49d --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "LogMemoryProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/tensor_description.proto"; + +message MemoryLogStep { + // Process-unique step id. + int64 step_id = 1; + + // Handle describing the feeds and fetches of the step. + string handle = 2; +}; + +message MemoryLogTensorAllocation { + // Process-unique step id. + int64 step_id = 1; + + // Name of the kernel making the allocation as set in GraphDef, + // e.g., "affine2/weights/Assign". + string kernel_name = 2; + + // Allocated tensor details. + TensorDescription tensor = 3; +}; + +message MemoryLogTensorDeallocation { + // Id of the tensor buffer being deallocated, used to match to a + // corresponding allocation. + int64 allocation_id = 1; + + // Name of the allocator used. + string allocator_name = 2; +}; + +message MemoryLogTensorOutput { + // Process-unique step id. + int64 step_id = 1; + + // Name of the kernel producing an output as set in GraphDef, e.g., + // "affine2/weights/Assign". + string kernel_name = 2; + + // Index of the output being set. + int32 index = 3; + + // Output tensor details. + TensorDescription tensor = 4; +} + +message MemoryLogRawAllocation { + // Process-unique step id. + int64 step_id = 1; + + // Name of the operation making the allocation. + string operation = 2; + + // Number of bytes in the allocation. + int64 num_bytes = 3; + + // Address of the allocation. + uint64 ptr = 4; + + // Id of the tensor buffer being allocated, used to match to a + // corresponding deallocation. + int64 allocation_id = 5; + + // Name of the allocator used. + string allocator_name = 6; +}; + +message MemoryLogRawDeallocation { + // Process-unique step id. + int64 step_id = 1; + + // Name of the operation making the deallocation. + string operation = 2; + + // Id of the tensor buffer being deallocated, used to match to a + // corresponding allocation. + int64 allocation_id = 3; + + // Name of the allocator used. + string allocator_name = 4; + + // True if the deallocation is queued and will be performed later, + // e.g. for GPU lazy freeing of buffers. + bool deferred = 5; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory_pb2.py new file mode 100644 index 0000000..34cc991 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/log_memory_pb2.py @@ -0,0 +1,381 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/log_memory.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_description_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__description__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/log_memory.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\017LogMemoryProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n4diplomacy_tensorflow/core/framework/log_memory.proto\x12\x14\x64iplomacy.tensorflow\x1a + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_NodeDef_ExperimentalDebugInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_NodeDef_AttrEntry_DoNotUse; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class NodeDef_AttrEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NodeDef_AttrEntry_DoNotUse_default_instance_; +class NodeDef_ExperimentalDebugInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NodeDef_ExperimentalDebugInfo_default_instance_; +class NodeDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NodeDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto { +static void InitDefaultsNodeDef_AttrEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse(); + } + ::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_NodeDef_AttrEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNodeDef_AttrEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base,}}; + +static void InitDefaultsNodeDef_ExperimentalDebugInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NodeDef_ExperimentalDebugInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_NodeDef_ExperimentalDebugInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsNodeDef_ExperimentalDebugInfo}, {}}; + +static void InitDefaultsNodeDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NodeDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::NodeDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::NodeDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_NodeDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsNodeDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef_AttrEntry_DoNotUse.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef_ExperimentalDebugInfo.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_NodeDef_AttrEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_NodeDef_ExperimentalDebugInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_NodeDef.base); +} + +::google::protobuf::Metadata file_level_metadata[3]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo, original_node_names_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef, op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef, input_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef, device_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef, attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeDef, experimental_debug_info_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 7, sizeof(::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse)}, + { 9, -1, sizeof(::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo)}, + { 15, -1, sizeof(::diplomacy::tensorflow::NodeDef)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NodeDef_ExperimentalDebugInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NodeDef_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/node_def.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n2diplomacy_tensorflow/core/framework/no" + "de_def.proto\022\024diplomacy.tensorflow\0324dipl" + "omacy_tensorflow/core/framework/attr_val" + "ue.proto\"\323\002\n\007NodeDef\022\014\n\004name\030\001 \001(\t\022\n\n\002op" + "\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006device\030\004 \001(\t\0225\n" + "\004attr\030\005 \003(\0132\'.diplomacy.tensorflow.NodeD" + "ef.AttrEntry\022T\n\027experimental_debug_info\030" + "\006 \001(\01323.diplomacy.tensorflow.NodeDef.Exp" + "erimentalDebugInfo\032L\n\tAttrEntry\022\013\n\003key\030\001" + " \001(\t\022.\n\005value\030\002 \001(\0132\037.diplomacy.tensorfl" + "ow.AttrValue:\0028\001\0324\n\025ExperimentalDebugInf" + "o\022\033\n\023original_node_names\030\001 \003(\tBi\n\030org.te" + "nsorflow.frameworkB\tNodeProtoP\001Z=github." + "com/tensorflow/tensorflow/tensorflow/go/" + "core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 585); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/node_def.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse() {} +NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void NodeDef_AttrEntry_DoNotUse::MergeFrom(const NodeDef_AttrEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata NodeDef_AttrEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::file_level_metadata[0]; +} +void NodeDef_AttrEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void NodeDef_ExperimentalDebugInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NodeDef_ExperimentalDebugInfo::kOriginalNodeNamesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NodeDef_ExperimentalDebugInfo::NodeDef_ExperimentalDebugInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef_ExperimentalDebugInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) +} +NodeDef_ExperimentalDebugInfo::NodeDef_ExperimentalDebugInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + original_node_names_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef_ExperimentalDebugInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) +} +NodeDef_ExperimentalDebugInfo::NodeDef_ExperimentalDebugInfo(const NodeDef_ExperimentalDebugInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + original_node_names_(from.original_node_names_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) +} + +void NodeDef_ExperimentalDebugInfo::SharedCtor() { +} + +NodeDef_ExperimentalDebugInfo::~NodeDef_ExperimentalDebugInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + SharedDtor(); +} + +void NodeDef_ExperimentalDebugInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void NodeDef_ExperimentalDebugInfo::ArenaDtor(void* object) { + NodeDef_ExperimentalDebugInfo* _this = reinterpret_cast< NodeDef_ExperimentalDebugInfo* >(object); + (void)_this; +} +void NodeDef_ExperimentalDebugInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NodeDef_ExperimentalDebugInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NodeDef_ExperimentalDebugInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NodeDef_ExperimentalDebugInfo& NodeDef_ExperimentalDebugInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef_ExperimentalDebugInfo.base); + return *internal_default_instance(); +} + + +void NodeDef_ExperimentalDebugInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + original_node_names_.Clear(); + _internal_metadata_.Clear(); +} + +bool NodeDef_ExperimentalDebugInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated string original_node_names = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_original_node_names())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->original_node_names(this->original_node_names_size() - 1).data(), + static_cast(this->original_node_names(this->original_node_names_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + return false; +#undef DO_ +} + +void NodeDef_ExperimentalDebugInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string original_node_names = 1; + for (int i = 0, n = this->original_node_names_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->original_node_names(i).data(), static_cast(this->original_node_names(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1, this->original_node_names(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) +} + +::google::protobuf::uint8* NodeDef_ExperimentalDebugInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string original_node_names = 1; + for (int i = 0, n = this->original_node_names_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->original_node_names(i).data(), static_cast(this->original_node_names(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1, this->original_node_names(i), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + return target; +} + +size_t NodeDef_ExperimentalDebugInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string original_node_names = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->original_node_names_size()); + for (int i = 0, n = this->original_node_names_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->original_node_names(i)); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NodeDef_ExperimentalDebugInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + GOOGLE_DCHECK_NE(&from, this); + const NodeDef_ExperimentalDebugInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + MergeFrom(*source); + } +} + +void NodeDef_ExperimentalDebugInfo::MergeFrom(const NodeDef_ExperimentalDebugInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + original_node_names_.MergeFrom(from.original_node_names_); +} + +void NodeDef_ExperimentalDebugInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NodeDef_ExperimentalDebugInfo::CopyFrom(const NodeDef_ExperimentalDebugInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NodeDef_ExperimentalDebugInfo::IsInitialized() const { + return true; +} + +void NodeDef_ExperimentalDebugInfo::Swap(NodeDef_ExperimentalDebugInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NodeDef_ExperimentalDebugInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void NodeDef_ExperimentalDebugInfo::UnsafeArenaSwap(NodeDef_ExperimentalDebugInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NodeDef_ExperimentalDebugInfo::InternalSwap(NodeDef_ExperimentalDebugInfo* other) { + using std::swap; + original_node_names_.InternalSwap(CastToBase(&other->original_node_names_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NodeDef_ExperimentalDebugInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void NodeDef::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_NodeDef_default_instance_._instance.get_mutable()->experimental_debug_info_ = const_cast< ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo*>( + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo::internal_default_instance()); +} +void NodeDef::clear_attr() { + attr_.Clear(); +} +void NodeDef::unsafe_arena_set_allocated_experimental_debug_info( + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* experimental_debug_info) { + if (GetArenaNoVirtual() == NULL) { + delete experimental_debug_info_; + } + experimental_debug_info_ = experimental_debug_info; + if (experimental_debug_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeDef.experimental_debug_info) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NodeDef::kNameFieldNumber; +const int NodeDef::kOpFieldNumber; +const int NodeDef::kInputFieldNumber; +const int NodeDef::kDeviceFieldNumber; +const int NodeDef::kAttrFieldNumber; +const int NodeDef::kExperimentalDebugInfoFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NodeDef::NodeDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NodeDef) +} +NodeDef::NodeDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + input_(arena), + attr_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.NodeDef) +} +NodeDef::NodeDef(const NodeDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + input_(from.input_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + attr_.MergeFrom(from.attr_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.op().size() > 0) { + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op(), + GetArenaNoVirtual()); + } + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.device().size() > 0) { + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device(), + GetArenaNoVirtual()); + } + if (from.has_experimental_debug_info()) { + experimental_debug_info_ = new ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo(*from.experimental_debug_info_); + } else { + experimental_debug_info_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NodeDef) +} + +void NodeDef::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + experimental_debug_info_ = NULL; +} + +NodeDef::~NodeDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NodeDef) + SharedDtor(); +} + +void NodeDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete experimental_debug_info_; +} + +void NodeDef::ArenaDtor(void* object) { + NodeDef* _this = reinterpret_cast< NodeDef* >(object); + (void)_this; +} +void NodeDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NodeDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NodeDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NodeDef& NodeDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::scc_info_NodeDef.base); + return *internal_default_instance(); +} + + +void NodeDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NodeDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + input_.Clear(); + attr_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && experimental_debug_info_ != NULL) { + delete experimental_debug_info_; + } + experimental_debug_info_ = NULL; + _internal_metadata_.Clear(); +} + +bool NodeDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NodeDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeDef.name")); + } else { + goto handle_unusual; + } + break; + } + + // string op = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeDef.op")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string input = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_input())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input(this->input_size() - 1).data(), + static_cast(this->input(this->input_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeDef.input")); + } else { + goto handle_unusual; + } + break; + } + + // string device = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeDef.device")); + } else { + goto handle_unusual; + } + break; + } + + // map attr = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + NodeDef_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + NodeDef_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue > > parser(&attr_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeDef.AttrEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_experimental_debug_info())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NodeDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NodeDef) + return false; +#undef DO_ +} + +void NodeDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NodeDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string op = 2; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.op"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->op(), output); + } + + // repeated string input = 3; + for (int i = 0, n = this->input_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input(i).data(), static_cast(this->input(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.input"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->input(i), output); + } + + // string device = 4; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.device"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->device(), output); + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.AttrEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // .diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + if (this->has_experimental_debug_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_experimental_debug_info(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NodeDef) +} + +::google::protobuf::uint8* NodeDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NodeDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string op = 2; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.op"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->op(), target); + } + + // repeated string input = 3; + for (int i = 0, n = this->input_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input(i).data(), static_cast(this->input(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.input"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->input(i), target); + } + + // string device = 4; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.device"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->device(), target); + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeDef.AttrEntry.key"); + } + }; + + if (deterministic && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // .diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + if (this->has_experimental_debug_info()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_experimental_debug_info(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NodeDef) + return target; +} + +size_t NodeDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NodeDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string input = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->input_size()); + for (int i = 0, n = this->input_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->input(i)); + } + + // map attr = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->attr_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(attr_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string op = 2; + if (this->op().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op()); + } + + // string device = 4; + if (this->device().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device()); + } + + // .diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + if (this->has_experimental_debug_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *experimental_debug_info_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NodeDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NodeDef) + GOOGLE_DCHECK_NE(&from, this); + const NodeDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NodeDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NodeDef) + MergeFrom(*source); + } +} + +void NodeDef::MergeFrom(const NodeDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NodeDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + input_.MergeFrom(from.input_); + attr_.MergeFrom(from.attr_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.op().size() > 0) { + set_op(from.op()); + } + if (from.device().size() > 0) { + set_device(from.device()); + } + if (from.has_experimental_debug_info()) { + mutable_experimental_debug_info()->::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo::MergeFrom(from.experimental_debug_info()); + } +} + +void NodeDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NodeDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NodeDef::CopyFrom(const NodeDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NodeDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NodeDef::IsInitialized() const { + return true; +} + +void NodeDef::Swap(NodeDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NodeDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void NodeDef::UnsafeArenaSwap(NodeDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NodeDef::InternalSwap(NodeDef* other) { + using std::swap; + input_.InternalSwap(CastToBase(&other->input_)); + attr_.Swap(&other->attr_); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + op_.Swap(&other->op_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + device_.Swap(&other->device_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(experimental_debug_info_, other->experimental_debug_info_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NodeDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NodeDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NodeDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NodeDef >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def.pb.h new file mode 100644 index 0000000..0649eb7 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def.pb.h @@ -0,0 +1,944 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/node_def.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_tensorflow/core/framework/attr_value.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[3]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class NodeDef; +class NodeDefDefaultTypeInternal; +extern NodeDefDefaultTypeInternal _NodeDef_default_instance_; +class NodeDef_AttrEntry_DoNotUse; +class NodeDef_AttrEntry_DoNotUseDefaultTypeInternal; +extern NodeDef_AttrEntry_DoNotUseDefaultTypeInternal _NodeDef_AttrEntry_DoNotUse_default_instance_; +class NodeDef_ExperimentalDebugInfo; +class NodeDef_ExperimentalDebugInfoDefaultTypeInternal; +extern NodeDef_ExperimentalDebugInfoDefaultTypeInternal _NodeDef_ExperimentalDebugInfo_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::NodeDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NodeDef>(Arena*); +template<> ::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NodeDef_AttrEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class NodeDef_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + NodeDef_AttrEntry_DoNotUse(); + NodeDef_AttrEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const NodeDef_AttrEntry_DoNotUse& other); + static const NodeDef_AttrEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_NodeDef_AttrEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class NodeDef_ExperimentalDebugInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) */ { + public: + NodeDef_ExperimentalDebugInfo(); + virtual ~NodeDef_ExperimentalDebugInfo(); + + NodeDef_ExperimentalDebugInfo(const NodeDef_ExperimentalDebugInfo& from); + + inline NodeDef_ExperimentalDebugInfo& operator=(const NodeDef_ExperimentalDebugInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NodeDef_ExperimentalDebugInfo(NodeDef_ExperimentalDebugInfo&& from) noexcept + : NodeDef_ExperimentalDebugInfo() { + *this = ::std::move(from); + } + + inline NodeDef_ExperimentalDebugInfo& operator=(NodeDef_ExperimentalDebugInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NodeDef_ExperimentalDebugInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NodeDef_ExperimentalDebugInfo* internal_default_instance() { + return reinterpret_cast( + &_NodeDef_ExperimentalDebugInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(NodeDef_ExperimentalDebugInfo* other); + void Swap(NodeDef_ExperimentalDebugInfo* other); + friend void swap(NodeDef_ExperimentalDebugInfo& a, NodeDef_ExperimentalDebugInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NodeDef_ExperimentalDebugInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + NodeDef_ExperimentalDebugInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NodeDef_ExperimentalDebugInfo& from); + void MergeFrom(const NodeDef_ExperimentalDebugInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NodeDef_ExperimentalDebugInfo* other); + protected: + explicit NodeDef_ExperimentalDebugInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated string original_node_names = 1; + int original_node_names_size() const; + void clear_original_node_names(); + static const int kOriginalNodeNamesFieldNumber = 1; + const ::std::string& original_node_names(int index) const; + ::std::string* mutable_original_node_names(int index); + void set_original_node_names(int index, const ::std::string& value); + #if LANG_CXX11 + void set_original_node_names(int index, ::std::string&& value); + #endif + void set_original_node_names(int index, const char* value); + void set_original_node_names(int index, const char* value, size_t size); + ::std::string* add_original_node_names(); + void add_original_node_names(const ::std::string& value); + #if LANG_CXX11 + void add_original_node_names(::std::string&& value); + #endif + void add_original_node_names(const char* value); + void add_original_node_names(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& original_node_names() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_original_node_names(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> original_node_names_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NodeDef) */ { + public: + NodeDef(); + virtual ~NodeDef(); + + NodeDef(const NodeDef& from); + + inline NodeDef& operator=(const NodeDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NodeDef(NodeDef&& from) noexcept + : NodeDef() { + *this = ::std::move(from); + } + + inline NodeDef& operator=(NodeDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NodeDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NodeDef* internal_default_instance() { + return reinterpret_cast( + &_NodeDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(NodeDef* other); + void Swap(NodeDef* other); + friend void swap(NodeDef& a, NodeDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NodeDef* New() const final { + return CreateMaybeMessage(NULL); + } + + NodeDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NodeDef& from); + void MergeFrom(const NodeDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NodeDef* other); + protected: + explicit NodeDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef NodeDef_ExperimentalDebugInfo ExperimentalDebugInfo; + + // accessors ------------------------------------------------------- + + // repeated string input = 3; + int input_size() const; + void clear_input(); + static const int kInputFieldNumber = 3; + const ::std::string& input(int index) const; + ::std::string* mutable_input(int index); + void set_input(int index, const ::std::string& value); + #if LANG_CXX11 + void set_input(int index, ::std::string&& value); + #endif + void set_input(int index, const char* value); + void set_input(int index, const char* value, size_t size); + ::std::string* add_input(); + void add_input(const ::std::string& value); + #if LANG_CXX11 + void add_input(::std::string&& value); + #endif + void add_input(const char* value); + void add_input(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input(); + + // map attr = 5; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 5; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& + attr() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* + mutable_attr(); + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string op = 2; + void clear_op(); + static const int kOpFieldNumber = 2; + const ::std::string& op() const; + void set_op(const ::std::string& value); + #if LANG_CXX11 + void set_op(::std::string&& value); + #endif + void set_op(const char* value); + void set_op(const char* value, size_t size); + ::std::string* mutable_op(); + ::std::string* release_op(); + void set_allocated_op(::std::string* op); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_op(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_op( + ::std::string* op); + + // string device = 4; + void clear_device(); + static const int kDeviceFieldNumber = 4; + const ::std::string& device() const; + void set_device(const ::std::string& value); + #if LANG_CXX11 + void set_device(::std::string&& value); + #endif + void set_device(const char* value); + void set_device(const char* value, size_t size); + ::std::string* mutable_device(); + ::std::string* release_device(); + void set_allocated_device(::std::string* device); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_device(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_device( + ::std::string* device); + + // .diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + bool has_experimental_debug_info() const; + void clear_experimental_debug_info(); + static const int kExperimentalDebugInfoFieldNumber = 6; + private: + const ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo& _internal_experimental_debug_info() const; + public: + const ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo& experimental_debug_info() const; + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* release_experimental_debug_info(); + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* mutable_experimental_debug_info(); + void set_allocated_experimental_debug_info(::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* experimental_debug_info); + void unsafe_arena_set_allocated_experimental_debug_info( + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* experimental_debug_info); + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* unsafe_arena_release_experimental_debug_info(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NodeDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> input_; + ::google::protobuf::internal::MapField< + NodeDef_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > attr_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr op_; + ::google::protobuf::internal::ArenaStringPtr device_; + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* experimental_debug_info_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// NodeDef_ExperimentalDebugInfo + +// repeated string original_node_names = 1; +inline int NodeDef_ExperimentalDebugInfo::original_node_names_size() const { + return original_node_names_.size(); +} +inline void NodeDef_ExperimentalDebugInfo::clear_original_node_names() { + original_node_names_.Clear(); +} +inline const ::std::string& NodeDef_ExperimentalDebugInfo::original_node_names(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) + return original_node_names_.Get(index); +} +inline ::std::string* NodeDef_ExperimentalDebugInfo::mutable_original_node_names(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) + return original_node_names_.Mutable(index); +} +inline void NodeDef_ExperimentalDebugInfo::set_original_node_names(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) + original_node_names_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void NodeDef_ExperimentalDebugInfo::set_original_node_names(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) + original_node_names_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void NodeDef_ExperimentalDebugInfo::set_original_node_names(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + original_node_names_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) +} +inline void NodeDef_ExperimentalDebugInfo::set_original_node_names(int index, const char* value, size_t size) { + original_node_names_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) +} +inline ::std::string* NodeDef_ExperimentalDebugInfo::add_original_node_names() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) + return original_node_names_.Add(); +} +inline void NodeDef_ExperimentalDebugInfo::add_original_node_names(const ::std::string& value) { + original_node_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) +} +#if LANG_CXX11 +inline void NodeDef_ExperimentalDebugInfo::add_original_node_names(::std::string&& value) { + original_node_names_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) +} +#endif +inline void NodeDef_ExperimentalDebugInfo::add_original_node_names(const char* value) { + GOOGLE_DCHECK(value != NULL); + original_node_names_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) +} +inline void NodeDef_ExperimentalDebugInfo::add_original_node_names(const char* value, size_t size) { + original_node_names_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NodeDef_ExperimentalDebugInfo::original_node_names() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) + return original_node_names_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NodeDef_ExperimentalDebugInfo::mutable_original_node_names() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names) + return &original_node_names_; +} + +// ------------------------------------------------------------------- + +// NodeDef + +// string name = 1; +inline void NodeDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeDef::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeDef.name) + return name_.Get(); +} +inline void NodeDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeDef.name) +} +#if LANG_CXX11 +inline void NodeDef::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NodeDef.name) +} +#endif +inline void NodeDef::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NodeDef.name) +} +inline void NodeDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NodeDef.name) +} +inline ::std::string* NodeDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void NodeDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeDef.name) +} +inline ::std::string* NodeDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeDef.name) +} + +// string op = 2; +inline void NodeDef::clear_op() { + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeDef::op() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeDef.op) + return op_.Get(); +} +inline void NodeDef::set_op(const ::std::string& value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeDef.op) +} +#if LANG_CXX11 +inline void NodeDef::set_op(::std::string&& value) { + + op_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NodeDef.op) +} +#endif +inline void NodeDef::set_op(const char* value) { + GOOGLE_DCHECK(value != NULL); + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NodeDef.op) +} +inline void NodeDef::set_op(const char* value, + size_t size) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NodeDef.op) +} +inline ::std::string* NodeDef::mutable_op() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeDef.op) + return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::release_op() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeDef.op) + + return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void NodeDef::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeDef.op) +} +inline ::std::string* NodeDef::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeDef.op) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeDef::unsafe_arena_set_allocated_op( + ::std::string* op) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op != NULL) { + + } else { + + } + op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeDef.op) +} + +// repeated string input = 3; +inline int NodeDef::input_size() const { + return input_.size(); +} +inline void NodeDef::clear_input() { + input_.Clear(); +} +inline const ::std::string& NodeDef::input(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeDef.input) + return input_.Get(index); +} +inline ::std::string* NodeDef::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeDef.input) + return input_.Mutable(index); +} +inline void NodeDef::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeDef.input) + input_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void NodeDef::set_input(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeDef.input) + input_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void NodeDef::set_input(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + input_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NodeDef.input) +} +inline void NodeDef::set_input(int index, const char* value, size_t size) { + input_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NodeDef.input) +} +inline ::std::string* NodeDef::add_input() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.NodeDef.input) + return input_.Add(); +} +inline void NodeDef::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NodeDef.input) +} +#if LANG_CXX11 +inline void NodeDef::add_input(::std::string&& value) { + input_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NodeDef.input) +} +#endif +inline void NodeDef::add_input(const char* value) { + GOOGLE_DCHECK(value != NULL); + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.NodeDef.input) +} +inline void NodeDef::add_input(const char* value, size_t size) { + input_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.NodeDef.input) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NodeDef::input() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.NodeDef.input) + return input_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NodeDef::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.NodeDef.input) + return &input_; +} + +// string device = 4; +inline void NodeDef::clear_device() { + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeDef::device() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeDef.device) + return device_.Get(); +} +inline void NodeDef::set_device(const ::std::string& value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeDef.device) +} +#if LANG_CXX11 +inline void NodeDef::set_device(::std::string&& value) { + + device_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NodeDef.device) +} +#endif +inline void NodeDef::set_device(const char* value) { + GOOGLE_DCHECK(value != NULL); + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NodeDef.device) +} +inline void NodeDef::set_device(const char* value, + size_t size) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NodeDef.device) +} +inline ::std::string* NodeDef::mutable_device() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeDef.device) + return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::release_device() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeDef.device) + + return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void NodeDef::set_allocated_device(::std::string* device) { + if (device != NULL) { + + } else { + + } + device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeDef.device) +} +inline ::std::string* NodeDef::unsafe_arena_release_device() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeDef.device) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeDef::unsafe_arena_set_allocated_device( + ::std::string* device) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device != NULL) { + + } else { + + } + device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeDef.device) +} + +// map attr = 5; +inline int NodeDef::attr_size() const { + return attr_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& +NodeDef::attr() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.NodeDef.attr) + return attr_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* +NodeDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.NodeDef.attr) + return attr_.MutableMap(); +} + +// .diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; +inline bool NodeDef::has_experimental_debug_info() const { + return this != internal_default_instance() && experimental_debug_info_ != NULL; +} +inline void NodeDef::clear_experimental_debug_info() { + if (GetArenaNoVirtual() == NULL && experimental_debug_info_ != NULL) { + delete experimental_debug_info_; + } + experimental_debug_info_ = NULL; +} +inline const ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo& NodeDef::_internal_experimental_debug_info() const { + return *experimental_debug_info_; +} +inline const ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo& NodeDef::experimental_debug_info() const { + const ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* p = experimental_debug_info_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeDef.experimental_debug_info) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_NodeDef_ExperimentalDebugInfo_default_instance_); +} +inline ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* NodeDef::release_experimental_debug_info() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeDef.experimental_debug_info) + + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* temp = experimental_debug_info_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + experimental_debug_info_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* NodeDef::unsafe_arena_release_experimental_debug_info() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeDef.experimental_debug_info) + + ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* temp = experimental_debug_info_; + experimental_debug_info_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* NodeDef::mutable_experimental_debug_info() { + + if (experimental_debug_info_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo>(GetArenaNoVirtual()); + experimental_debug_info_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeDef.experimental_debug_info) + return experimental_debug_info_; +} +inline void NodeDef::set_allocated_experimental_debug_info(::diplomacy::tensorflow::NodeDef_ExperimentalDebugInfo* experimental_debug_info) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete experimental_debug_info_; + } + if (experimental_debug_info) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(experimental_debug_info); + if (message_arena != submessage_arena) { + experimental_debug_info = ::google::protobuf::internal::GetOwnedMessage( + message_arena, experimental_debug_info, submessage_arena); + } + + } else { + + } + experimental_debug_info_ = experimental_debug_info; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeDef.experimental_debug_info) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fnode_5fdef_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def.proto new file mode 100644 index 0000000..2a04b62 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "NodeProto"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/attr_value.proto"; + +message NodeDef { + // 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_./]*". + string name = 1; + + // The operation name. There may be custom parameters in attrs. + // Op names starting with an underscore are reserved for internal use. + string op = 2; + + // 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". + repeated string input = 3; + + // 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. + string device = 4; + + // 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. + map attr = 5; + + message ExperimentalDebugInfo { + // Opaque string inserted into error messages created by the runtime. + // + // This is intended to store the list of names of the nodes from the + // original graph that this node was derived. For example if this node, say + // C, was result of a fusion of 2 nodes A and B, then 'original_node' would + // be {A, B}. This information can be used to map errors originating at the + // current node to some top level source code. + repeated string original_node_names = 1; + }; + + // This stores debug information associated with the node. + ExperimentalDebugInfo experimental_debug_info = 6; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def_pb2.py new file mode 100644 index 0000000..6084b85 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/node_def_pb2.py @@ -0,0 +1,196 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/node_def.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import attr_value_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/node_def.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\tNodeProtoP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n2diplomacy_tensorflow/core/framework/node_def.proto\x12\x14\x64iplomacy.tensorflow\x1a\x34\x64iplomacy_tensorflow/core/framework/attr_value.proto\"\xd3\x02\n\x07NodeDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02op\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x03(\t\x12\x0e\n\x06\x64\x65vice\x18\x04 \x01(\t\x12\x35\n\x04\x61ttr\x18\x05 \x03(\x0b\x32\'.diplomacy.tensorflow.NodeDef.AttrEntry\x12T\n\x17\x65xperimental_debug_info\x18\x06 \x01(\x0b\x32\x33.diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo\x1aL\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue:\x02\x38\x01\x1a\x34\n\x15\x45xperimentalDebugInfo\x12\x1b\n\x13original_node_names\x18\x01 \x03(\tBi\n\x18org.tensorflow.frameworkB\tNodeProtoP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2.DESCRIPTOR,]) + + + + +_NODEDEF_ATTRENTRY = _descriptor.Descriptor( + name='AttrEntry', + full_name='diplomacy.tensorflow.NodeDef.AttrEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.NodeDef.AttrEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.NodeDef.AttrEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=340, + serialized_end=416, +) + +_NODEDEF_EXPERIMENTALDEBUGINFO = _descriptor.Descriptor( + name='ExperimentalDebugInfo', + full_name='diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='original_node_names', full_name='diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=418, + serialized_end=470, +) + +_NODEDEF = _descriptor.Descriptor( + name='NodeDef', + full_name='diplomacy.tensorflow.NodeDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.NodeDef.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='op', full_name='diplomacy.tensorflow.NodeDef.op', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input', full_name='diplomacy.tensorflow.NodeDef.input', index=2, + number=3, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device', full_name='diplomacy.tensorflow.NodeDef.device', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attr', full_name='diplomacy.tensorflow.NodeDef.attr', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='experimental_debug_info', full_name='diplomacy.tensorflow.NodeDef.experimental_debug_info', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_NODEDEF_ATTRENTRY, _NODEDEF_EXPERIMENTALDEBUGINFO, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=131, + serialized_end=470, +) + +_NODEDEF_ATTRENTRY.fields_by_name['value'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2._ATTRVALUE +_NODEDEF_ATTRENTRY.containing_type = _NODEDEF +_NODEDEF_EXPERIMENTALDEBUGINFO.containing_type = _NODEDEF +_NODEDEF.fields_by_name['attr'].message_type = _NODEDEF_ATTRENTRY +_NODEDEF.fields_by_name['experimental_debug_info'].message_type = _NODEDEF_EXPERIMENTALDEBUGINFO +DESCRIPTOR.message_types_by_name['NodeDef'] = _NODEDEF +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +NodeDef = _reflection.GeneratedProtocolMessageType('NodeDef', (_message.Message,), dict( + + AttrEntry = _reflection.GeneratedProtocolMessageType('AttrEntry', (_message.Message,), dict( + DESCRIPTOR = _NODEDEF_ATTRENTRY, + __module__ = 'diplomacy_tensorflow.core.framework.node_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NodeDef.AttrEntry) + )) + , + + ExperimentalDebugInfo = _reflection.GeneratedProtocolMessageType('ExperimentalDebugInfo', (_message.Message,), dict( + DESCRIPTOR = _NODEDEF_EXPERIMENTALDEBUGINFO, + __module__ = 'diplomacy_tensorflow.core.framework.node_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NodeDef.ExperimentalDebugInfo) + )) + , + DESCRIPTOR = _NODEDEF, + __module__ = 'diplomacy_tensorflow.core.framework.node_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NodeDef) + )) +_sym_db.RegisterMessage(NodeDef) +_sym_db.RegisterMessage(NodeDef.AttrEntry) +_sym_db.RegisterMessage(NodeDef.ExperimentalDebugInfo) + + +DESCRIPTOR._options = None +_NODEDEF_ATTRENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.pb.cc new file mode 100644 index 0000000..4b95e62 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.pb.cc @@ -0,0 +1,2806 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/op_def.proto + +#include "diplomacy_tensorflow/core/framework/op_def.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_OpDef_ArgDef; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_OpDeprecation; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_OpDef_AttrDef; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_OpDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class OpDef_ArgDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpDef_ArgDef_default_instance_; +class OpDef_AttrDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpDef_AttrDef_default_instance_; +class OpDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpDef_default_instance_; +class OpDeprecationDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpDeprecation_default_instance_; +class OpListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpList_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto { +static void InitDefaultsOpDef_ArgDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpDef_ArgDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpDef_ArgDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpDef_ArgDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_OpDef_ArgDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsOpDef_ArgDef}, {}}; + +static void InitDefaultsOpDef_AttrDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpDef_AttrDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpDef_AttrDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpDef_AttrDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_OpDef_AttrDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsOpDef_AttrDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base,}}; + +static void InitDefaultsOpDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_OpDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsOpDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_ArgDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_AttrDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDeprecation.base,}}; + +static void InitDefaultsOpDeprecation() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpDeprecation_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpDeprecation(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpDeprecation::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_OpDeprecation = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsOpDeprecation}, {}}; + +static void InitDefaultsOpList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpList_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_OpList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsOpList}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_OpDef_ArgDef.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpDef_AttrDef.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpDef.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpDeprecation.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpList.base); +} + +::google::protobuf::Metadata file_level_metadata[5]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, type_attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, number_attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, type_list_attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_ArgDef, is_ref_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, default_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, has_minimum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, minimum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef_AttrDef, allowed_values_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, input_arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, output_arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, deprecation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, summary_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, is_commutative_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, is_aggregate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, is_stateful_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDef, allows_uninitialized_input_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDeprecation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDeprecation, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpDeprecation, explanation_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpList, op_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::OpDef_ArgDef)}, + { 12, -1, sizeof(::diplomacy::tensorflow::OpDef_AttrDef)}, + { 24, -1, sizeof(::diplomacy::tensorflow::OpDef)}, + { 40, -1, sizeof(::diplomacy::tensorflow::OpDeprecation)}, + { 47, -1, sizeof(::diplomacy::tensorflow::OpList)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_OpDef_ArgDef_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpDef_AttrDef_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpDef_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpDeprecation_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpList_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/op_def.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 5); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n0diplomacy_tensorflow/core/framework/op" + "_def.proto\022\024diplomacy.tensorflow\0324diplom" + "acy_tensorflow/core/framework/attr_value" + ".proto\032/diplomacy_tensorflow/core/framew" + "ork/types.proto\"\376\005\n\005OpDef\022\014\n\004name\030\001 \001(\t\022" + "5\n\tinput_arg\030\002 \003(\0132\".diplomacy.tensorflo" + "w.OpDef.ArgDef\0226\n\noutput_arg\030\003 \003(\0132\".dip" + "lomacy.tensorflow.OpDef.ArgDef\0221\n\004attr\030\004" + " \003(\0132#.diplomacy.tensorflow.OpDef.AttrDe" + "f\0228\n\013deprecation\030\010 \001(\0132#.diplomacy.tenso" + "rflow.OpDeprecation\022\017\n\007summary\030\005 \001(\t\022\023\n\013" + "description\030\006 \001(\t\022\026\n\016is_commutative\030\022 \001(" + "\010\022\024\n\014is_aggregate\030\020 \001(\010\022\023\n\013is_stateful\030\021" + " \001(\010\022\"\n\032allows_uninitialized_input\030\023 \001(\010" + "\032\251\001\n\006ArgDef\022\014\n\004name\030\001 \001(\t\022\023\n\013description" + "\030\002 \001(\t\022,\n\004type\030\003 \001(\0162\036.diplomacy.tensorf" + "low.DataType\022\021\n\ttype_attr\030\004 \001(\t\022\023\n\013numbe" + "r_attr\030\005 \001(\t\022\026\n\016type_list_attr\030\006 \001(\t\022\016\n\006" + "is_ref\030\020 \001(\010\032\321\001\n\007AttrDef\022\014\n\004name\030\001 \001(\t\022\014" + "\n\004type\030\002 \001(\t\0226\n\rdefault_value\030\003 \001(\0132\037.di" + "plomacy.tensorflow.AttrValue\022\023\n\013descript" + "ion\030\004 \001(\t\022\023\n\013has_minimum\030\005 \001(\010\022\017\n\007minimu" + "m\030\006 \001(\003\0227\n\016allowed_values\030\007 \001(\0132\037.diplom" + "acy.tensorflow.AttrValue\"5\n\rOpDeprecatio" + "n\022\017\n\007version\030\001 \001(\005\022\023\n\013explanation\030\002 \001(\t\"" + "1\n\006OpList\022\'\n\002op\030\001 \003(\0132\033.diplomacy.tensor" + "flow.OpDefBk\n\030org.tensorflow.frameworkB\013" + "OpDefProtosP\001Z=github.com/tensorflow/ten" + "sorflow/tensorflow/go/core/framework\370\001\001b" + "\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1167); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/op_def.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void OpDef_ArgDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDef_ArgDef::kNameFieldNumber; +const int OpDef_ArgDef::kDescriptionFieldNumber; +const int OpDef_ArgDef::kTypeFieldNumber; +const int OpDef_ArgDef::kTypeAttrFieldNumber; +const int OpDef_ArgDef::kNumberAttrFieldNumber; +const int OpDef_ArgDef::kTypeListAttrFieldNumber; +const int OpDef_ArgDef::kIsRefFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDef_ArgDef::OpDef_ArgDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_ArgDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpDef.ArgDef) +} +OpDef_ArgDef::OpDef_ArgDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_ArgDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpDef.ArgDef) +} +OpDef_ArgDef::OpDef_ArgDef(const OpDef_ArgDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description().size() > 0) { + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(), + GetArenaNoVirtual()); + } + type_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.type_attr().size() > 0) { + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_attr(), + GetArenaNoVirtual()); + } + number_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.number_attr().size() > 0) { + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.number_attr(), + GetArenaNoVirtual()); + } + type_list_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.type_list_attr().size() > 0) { + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_list_attr(), + GetArenaNoVirtual()); + } + ::memcpy(&type_, &from.type_, + static_cast(reinterpret_cast(&is_ref_) - + reinterpret_cast(&type_)) + sizeof(is_ref_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpDef.ArgDef) +} + +void OpDef_ArgDef::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + number_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_list_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&type_, 0, static_cast( + reinterpret_cast(&is_ref_) - + reinterpret_cast(&type_)) + sizeof(is_ref_)); +} + +OpDef_ArgDef::~OpDef_ArgDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpDef.ArgDef) + SharedDtor(); +} + +void OpDef_ArgDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_attr_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + number_attr_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_list_attr_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void OpDef_ArgDef::ArenaDtor(void* object) { + OpDef_ArgDef* _this = reinterpret_cast< OpDef_ArgDef* >(object); + (void)_this; +} +void OpDef_ArgDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDef_ArgDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpDef_ArgDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpDef_ArgDef& OpDef_ArgDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_ArgDef.base); + return *internal_default_instance(); +} + + +void OpDef_ArgDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpDef.ArgDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + type_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + number_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + type_list_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&type_, 0, static_cast( + reinterpret_cast(&is_ref_) - + reinterpret_cast(&type_)) + sizeof(is_ref_)); + _internal_metadata_.Clear(); +} + +bool OpDef_ArgDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpDef.ArgDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.ArgDef.name")); + } else { + goto handle_unusual; + } + break; + } + + // string description = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.ArgDef.description")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DataType type = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // string type_attr = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_attr())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_attr().data(), static_cast(this->type_attr().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.ArgDef.type_attr")); + } else { + goto handle_unusual; + } + break; + } + + // string number_attr = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_number_attr())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->number_attr().data(), static_cast(this->number_attr().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.ArgDef.number_attr")); + } else { + goto handle_unusual; + } + break; + } + + // string type_list_attr = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_list_attr())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_list_attr().data(), static_cast(this->type_list_attr().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.ArgDef.type_list_attr")); + } else { + goto handle_unusual; + } + break; + } + + // bool is_ref = 16; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_ref_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpDef.ArgDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpDef.ArgDef) + return false; +#undef DO_ +} + +void OpDef_ArgDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpDef.ArgDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string description = 2; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->description(), output); + } + + // .diplomacy.tensorflow.DataType type = 3; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->type(), output); + } + + // string type_attr = 4; + if (this->type_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_attr().data(), static_cast(this->type_attr().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.type_attr"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->type_attr(), output); + } + + // string number_attr = 5; + if (this->number_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->number_attr().data(), static_cast(this->number_attr().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.number_attr"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->number_attr(), output); + } + + // string type_list_attr = 6; + if (this->type_list_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_list_attr().data(), static_cast(this->type_list_attr().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.type_list_attr"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->type_list_attr(), output); + } + + // bool is_ref = 16; + if (this->is_ref() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->is_ref(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpDef.ArgDef) +} + +::google::protobuf::uint8* OpDef_ArgDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpDef.ArgDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string description = 2; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->description(), target); + } + + // .diplomacy.tensorflow.DataType type = 3; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->type(), target); + } + + // string type_attr = 4; + if (this->type_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_attr().data(), static_cast(this->type_attr().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.type_attr"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->type_attr(), target); + } + + // string number_attr = 5; + if (this->number_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->number_attr().data(), static_cast(this->number_attr().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.number_attr"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->number_attr(), target); + } + + // string type_list_attr = 6; + if (this->type_list_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_list_attr().data(), static_cast(this->type_list_attr().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.ArgDef.type_list_attr"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->type_list_attr(), target); + } + + // bool is_ref = 16; + if (this->is_ref() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->is_ref(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpDef.ArgDef) + return target; +} + +size_t OpDef_ArgDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpDef.ArgDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string description = 2; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // string type_attr = 4; + if (this->type_attr().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_attr()); + } + + // string number_attr = 5; + if (this->number_attr().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->number_attr()); + } + + // string type_list_attr = 6; + if (this->type_list_attr().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_list_attr()); + } + + // .diplomacy.tensorflow.DataType type = 3; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // bool is_ref = 16; + if (this->is_ref() != 0) { + total_size += 2 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpDef_ArgDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpDef.ArgDef) + GOOGLE_DCHECK_NE(&from, this); + const OpDef_ArgDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpDef.ArgDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpDef.ArgDef) + MergeFrom(*source); + } +} + +void OpDef_ArgDef::MergeFrom(const OpDef_ArgDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpDef.ArgDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.type_attr().size() > 0) { + set_type_attr(from.type_attr()); + } + if (from.number_attr().size() > 0) { + set_number_attr(from.number_attr()); + } + if (from.type_list_attr().size() > 0) { + set_type_list_attr(from.type_list_attr()); + } + if (from.type() != 0) { + set_type(from.type()); + } + if (from.is_ref() != 0) { + set_is_ref(from.is_ref()); + } +} + +void OpDef_ArgDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpDef.ArgDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDef_ArgDef::CopyFrom(const OpDef_ArgDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpDef.ArgDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpDef_ArgDef::IsInitialized() const { + return true; +} + +void OpDef_ArgDef::Swap(OpDef_ArgDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDef_ArgDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpDef_ArgDef::UnsafeArenaSwap(OpDef_ArgDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDef_ArgDef::InternalSwap(OpDef_ArgDef* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_.Swap(&other->description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + type_attr_.Swap(&other->type_attr_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + number_attr_.Swap(&other->number_attr_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + type_list_attr_.Swap(&other->type_list_attr_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(type_, other->type_); + swap(is_ref_, other->is_ref_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpDef_ArgDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpDef_AttrDef::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_OpDef_AttrDef_default_instance_._instance.get_mutable()->default_value_ = const_cast< ::diplomacy::tensorflow::AttrValue*>( + ::diplomacy::tensorflow::AttrValue::internal_default_instance()); + ::diplomacy::tensorflow::_OpDef_AttrDef_default_instance_._instance.get_mutable()->allowed_values_ = const_cast< ::diplomacy::tensorflow::AttrValue*>( + ::diplomacy::tensorflow::AttrValue::internal_default_instance()); +} +void OpDef_AttrDef::unsafe_arena_set_allocated_default_value( + ::diplomacy::tensorflow::AttrValue* default_value) { + if (GetArenaNoVirtual() == NULL) { + delete default_value_; + } + default_value_ = default_value; + if (default_value) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.default_value) +} +void OpDef_AttrDef::clear_default_value() { + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) { + delete default_value_; + } + default_value_ = NULL; +} +void OpDef_AttrDef::unsafe_arena_set_allocated_allowed_values( + ::diplomacy::tensorflow::AttrValue* allowed_values) { + if (GetArenaNoVirtual() == NULL) { + delete allowed_values_; + } + allowed_values_ = allowed_values; + if (allowed_values) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.allowed_values) +} +void OpDef_AttrDef::clear_allowed_values() { + if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) { + delete allowed_values_; + } + allowed_values_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDef_AttrDef::kNameFieldNumber; +const int OpDef_AttrDef::kTypeFieldNumber; +const int OpDef_AttrDef::kDefaultValueFieldNumber; +const int OpDef_AttrDef::kDescriptionFieldNumber; +const int OpDef_AttrDef::kHasMinimumFieldNumber; +const int OpDef_AttrDef::kMinimumFieldNumber; +const int OpDef_AttrDef::kAllowedValuesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDef_AttrDef::OpDef_AttrDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_AttrDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpDef.AttrDef) +} +OpDef_AttrDef::OpDef_AttrDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_AttrDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpDef.AttrDef) +} +OpDef_AttrDef::OpDef_AttrDef(const OpDef_AttrDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.type().size() > 0) { + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type(), + GetArenaNoVirtual()); + } + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description().size() > 0) { + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(), + GetArenaNoVirtual()); + } + if (from.has_default_value()) { + default_value_ = new ::diplomacy::tensorflow::AttrValue(*from.default_value_); + } else { + default_value_ = NULL; + } + if (from.has_allowed_values()) { + allowed_values_ = new ::diplomacy::tensorflow::AttrValue(*from.allowed_values_); + } else { + allowed_values_ = NULL; + } + ::memcpy(&minimum_, &from.minimum_, + static_cast(reinterpret_cast(&has_minimum_) - + reinterpret_cast(&minimum_)) + sizeof(has_minimum_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpDef.AttrDef) +} + +void OpDef_AttrDef::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&default_value_, 0, static_cast( + reinterpret_cast(&has_minimum_) - + reinterpret_cast(&default_value_)) + sizeof(has_minimum_)); +} + +OpDef_AttrDef::~OpDef_AttrDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpDef.AttrDef) + SharedDtor(); +} + +void OpDef_AttrDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete default_value_; + if (this != internal_default_instance()) delete allowed_values_; +} + +void OpDef_AttrDef::ArenaDtor(void* object) { + OpDef_AttrDef* _this = reinterpret_cast< OpDef_AttrDef* >(object); + (void)_this; +} +void OpDef_AttrDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDef_AttrDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpDef_AttrDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpDef_AttrDef& OpDef_AttrDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef_AttrDef.base); + return *internal_default_instance(); +} + + +void OpDef_AttrDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpDef.AttrDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) { + delete default_value_; + } + default_value_ = NULL; + if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) { + delete allowed_values_; + } + allowed_values_ = NULL; + ::memset(&minimum_, 0, static_cast( + reinterpret_cast(&has_minimum_) - + reinterpret_cast(&minimum_)) + sizeof(has_minimum_)); + _internal_metadata_.Clear(); +} + +bool OpDef_AttrDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpDef.AttrDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.AttrDef.name")); + } else { + goto handle_unusual; + } + break; + } + + // string type = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), static_cast(this->type().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.AttrDef.type")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_default_value())); + } else { + goto handle_unusual; + } + break; + } + + // string description = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.AttrDef.description")); + } else { + goto handle_unusual; + } + break; + } + + // bool has_minimum = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &has_minimum_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 minimum = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &minimum_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_allowed_values())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpDef.AttrDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpDef.AttrDef) + return false; +#undef DO_ +} + +void OpDef_AttrDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpDef.AttrDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.AttrDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // string type = 2; + if (this->type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), static_cast(this->type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.AttrDef.type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->type(), output); + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_default_value(), output); + } + + // string description = 4; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.AttrDef.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->description(), output); + } + + // bool has_minimum = 5; + if (this->has_minimum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->has_minimum(), output); + } + + // int64 minimum = 6; + if (this->minimum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->minimum(), output); + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 7; + if (this->has_allowed_values()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->_internal_allowed_values(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpDef.AttrDef) +} + +::google::protobuf::uint8* OpDef_AttrDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpDef.AttrDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.AttrDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // string type = 2; + if (this->type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), static_cast(this->type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.AttrDef.type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->type(), target); + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_default_value(), deterministic, target); + } + + // string description = 4; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.AttrDef.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->description(), target); + } + + // bool has_minimum = 5; + if (this->has_minimum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->has_minimum(), target); + } + + // int64 minimum = 6; + if (this->minimum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->minimum(), target); + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 7; + if (this->has_allowed_values()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->_internal_allowed_values(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpDef.AttrDef) + return target; +} + +size_t OpDef_AttrDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpDef.AttrDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string type = 2; + if (this->type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + + // string description = 4; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // .diplomacy.tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *default_value_); + } + + // .diplomacy.tensorflow.AttrValue allowed_values = 7; + if (this->has_allowed_values()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *allowed_values_); + } + + // int64 minimum = 6; + if (this->minimum() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->minimum()); + } + + // bool has_minimum = 5; + if (this->has_minimum() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpDef_AttrDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpDef.AttrDef) + GOOGLE_DCHECK_NE(&from, this); + const OpDef_AttrDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpDef.AttrDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpDef.AttrDef) + MergeFrom(*source); + } +} + +void OpDef_AttrDef::MergeFrom(const OpDef_AttrDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpDef.AttrDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.type().size() > 0) { + set_type(from.type()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.has_default_value()) { + mutable_default_value()->::diplomacy::tensorflow::AttrValue::MergeFrom(from.default_value()); + } + if (from.has_allowed_values()) { + mutable_allowed_values()->::diplomacy::tensorflow::AttrValue::MergeFrom(from.allowed_values()); + } + if (from.minimum() != 0) { + set_minimum(from.minimum()); + } + if (from.has_minimum() != 0) { + set_has_minimum(from.has_minimum()); + } +} + +void OpDef_AttrDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpDef.AttrDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDef_AttrDef::CopyFrom(const OpDef_AttrDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpDef.AttrDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpDef_AttrDef::IsInitialized() const { + return true; +} + +void OpDef_AttrDef::Swap(OpDef_AttrDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDef_AttrDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpDef_AttrDef::UnsafeArenaSwap(OpDef_AttrDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDef_AttrDef::InternalSwap(OpDef_AttrDef* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + type_.Swap(&other->type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_.Swap(&other->description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(default_value_, other->default_value_); + swap(allowed_values_, other->allowed_values_); + swap(minimum_, other->minimum_); + swap(has_minimum_, other->has_minimum_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpDef_AttrDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpDef::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_OpDef_default_instance_._instance.get_mutable()->deprecation_ = const_cast< ::diplomacy::tensorflow::OpDeprecation*>( + ::diplomacy::tensorflow::OpDeprecation::internal_default_instance()); +} +void OpDef::unsafe_arena_set_allocated_deprecation( + ::diplomacy::tensorflow::OpDeprecation* deprecation) { + if (GetArenaNoVirtual() == NULL) { + delete deprecation_; + } + deprecation_ = deprecation; + if (deprecation) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.deprecation) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDef::kNameFieldNumber; +const int OpDef::kInputArgFieldNumber; +const int OpDef::kOutputArgFieldNumber; +const int OpDef::kAttrFieldNumber; +const int OpDef::kDeprecationFieldNumber; +const int OpDef::kSummaryFieldNumber; +const int OpDef::kDescriptionFieldNumber; +const int OpDef::kIsCommutativeFieldNumber; +const int OpDef::kIsAggregateFieldNumber; +const int OpDef::kIsStatefulFieldNumber; +const int OpDef::kAllowsUninitializedInputFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDef::OpDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpDef) +} +OpDef::OpDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + input_arg_(arena), + output_arg_(arena), + attr_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpDef) +} +OpDef::OpDef(const OpDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + input_arg_(from.input_arg_), + output_arg_(from.output_arg_), + attr_(from.attr_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + summary_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.summary().size() > 0) { + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.summary(), + GetArenaNoVirtual()); + } + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.description().size() > 0) { + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description(), + GetArenaNoVirtual()); + } + if (from.has_deprecation()) { + deprecation_ = new ::diplomacy::tensorflow::OpDeprecation(*from.deprecation_); + } else { + deprecation_ = NULL; + } + ::memcpy(&is_commutative_, &from.is_commutative_, + static_cast(reinterpret_cast(&allows_uninitialized_input_) - + reinterpret_cast(&is_commutative_)) + sizeof(allows_uninitialized_input_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpDef) +} + +void OpDef::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + summary_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&deprecation_, 0, static_cast( + reinterpret_cast(&allows_uninitialized_input_) - + reinterpret_cast(&deprecation_)) + sizeof(allows_uninitialized_input_)); +} + +OpDef::~OpDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpDef) + SharedDtor(); +} + +void OpDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + summary_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete deprecation_; +} + +void OpDef::ArenaDtor(void* object) { + OpDef* _this = reinterpret_cast< OpDef* >(object); + (void)_this; +} +void OpDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpDef& OpDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDef.base); + return *internal_default_instance(); +} + + +void OpDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + input_arg_.Clear(); + output_arg_.Clear(); + attr_.Clear(); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && deprecation_ != NULL) { + delete deprecation_; + } + deprecation_ = NULL; + ::memset(&is_commutative_, 0, static_cast( + reinterpret_cast(&allows_uninitialized_input_) - + reinterpret_cast(&is_commutative_)) + sizeof(allows_uninitialized_input_)); + _internal_metadata_.Clear(); +} + +bool OpDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.OpDef.ArgDef input_arg = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_input_arg())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.OpDef.ArgDef output_arg = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_output_arg())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.OpDef.AttrDef attr = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_attr())); + } else { + goto handle_unusual; + } + break; + } + + // string summary = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_summary())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), static_cast(this->summary().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.summary")); + } else { + goto handle_unusual; + } + break; + } + + // string description = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDef.description")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.OpDeprecation deprecation = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_deprecation())); + } else { + goto handle_unusual; + } + break; + } + + // bool is_aggregate = 16; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_aggregate_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_stateful = 17; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_stateful_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_commutative = 18; + case 18: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(144u /* 144 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_commutative_))); + } else { + goto handle_unusual; + } + break; + } + + // bool allows_uninitialized_input = 19; + case 19: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(152u /* 152 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &allows_uninitialized_input_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpDef) + return false; +#undef DO_ +} + +void OpDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .diplomacy.tensorflow.OpDef.ArgDef input_arg = 2; + for (unsigned int i = 0, + n = static_cast(this->input_arg_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->input_arg(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.OpDef.ArgDef output_arg = 3; + for (unsigned int i = 0, + n = static_cast(this->output_arg_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->output_arg(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.OpDef.AttrDef attr = 4; + for (unsigned int i = 0, + n = static_cast(this->attr_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->attr(static_cast(i)), + output); + } + + // string summary = 5; + if (this->summary().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), static_cast(this->summary().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.summary"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->summary(), output); + } + + // string description = 6; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->description(), output); + } + + // .diplomacy.tensorflow.OpDeprecation deprecation = 8; + if (this->has_deprecation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_deprecation(), output); + } + + // bool is_aggregate = 16; + if (this->is_aggregate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->is_aggregate(), output); + } + + // bool is_stateful = 17; + if (this->is_stateful() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->is_stateful(), output); + } + + // bool is_commutative = 18; + if (this->is_commutative() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->is_commutative(), output); + } + + // bool allows_uninitialized_input = 19; + if (this->allows_uninitialized_input() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(19, this->allows_uninitialized_input(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpDef) +} + +::google::protobuf::uint8* OpDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .diplomacy.tensorflow.OpDef.ArgDef input_arg = 2; + for (unsigned int i = 0, + n = static_cast(this->input_arg_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->input_arg(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.OpDef.ArgDef output_arg = 3; + for (unsigned int i = 0, + n = static_cast(this->output_arg_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->output_arg(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.OpDef.AttrDef attr = 4; + for (unsigned int i = 0, + n = static_cast(this->attr_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->attr(static_cast(i)), deterministic, target); + } + + // string summary = 5; + if (this->summary().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), static_cast(this->summary().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.summary"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->summary(), target); + } + + // string description = 6; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDef.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->description(), target); + } + + // .diplomacy.tensorflow.OpDeprecation deprecation = 8; + if (this->has_deprecation()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_deprecation(), deterministic, target); + } + + // bool is_aggregate = 16; + if (this->is_aggregate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->is_aggregate(), target); + } + + // bool is_stateful = 17; + if (this->is_stateful() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->is_stateful(), target); + } + + // bool is_commutative = 18; + if (this->is_commutative() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->is_commutative(), target); + } + + // bool allows_uninitialized_input = 19; + if (this->allows_uninitialized_input() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(19, this->allows_uninitialized_input(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpDef) + return target; +} + +size_t OpDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.OpDef.ArgDef input_arg = 2; + { + unsigned int count = static_cast(this->input_arg_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->input_arg(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.OpDef.ArgDef output_arg = 3; + { + unsigned int count = static_cast(this->output_arg_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->output_arg(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.OpDef.AttrDef attr = 4; + { + unsigned int count = static_cast(this->attr_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->attr(static_cast(i))); + } + } + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string summary = 5; + if (this->summary().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->summary()); + } + + // string description = 6; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // .diplomacy.tensorflow.OpDeprecation deprecation = 8; + if (this->has_deprecation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *deprecation_); + } + + // bool is_commutative = 18; + if (this->is_commutative() != 0) { + total_size += 2 + 1; + } + + // bool is_aggregate = 16; + if (this->is_aggregate() != 0) { + total_size += 2 + 1; + } + + // bool is_stateful = 17; + if (this->is_stateful() != 0) { + total_size += 2 + 1; + } + + // bool allows_uninitialized_input = 19; + if (this->allows_uninitialized_input() != 0) { + total_size += 2 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpDef) + GOOGLE_DCHECK_NE(&from, this); + const OpDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpDef) + MergeFrom(*source); + } +} + +void OpDef::MergeFrom(const OpDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + input_arg_.MergeFrom(from.input_arg_); + output_arg_.MergeFrom(from.output_arg_); + attr_.MergeFrom(from.attr_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.summary().size() > 0) { + set_summary(from.summary()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.has_deprecation()) { + mutable_deprecation()->::diplomacy::tensorflow::OpDeprecation::MergeFrom(from.deprecation()); + } + if (from.is_commutative() != 0) { + set_is_commutative(from.is_commutative()); + } + if (from.is_aggregate() != 0) { + set_is_aggregate(from.is_aggregate()); + } + if (from.is_stateful() != 0) { + set_is_stateful(from.is_stateful()); + } + if (from.allows_uninitialized_input() != 0) { + set_allows_uninitialized_input(from.allows_uninitialized_input()); + } +} + +void OpDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDef::CopyFrom(const OpDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpDef::IsInitialized() const { + return true; +} + +void OpDef::Swap(OpDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpDef::UnsafeArenaSwap(OpDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDef::InternalSwap(OpDef* other) { + using std::swap; + CastToBase(&input_arg_)->InternalSwap(CastToBase(&other->input_arg_)); + CastToBase(&output_arg_)->InternalSwap(CastToBase(&other->output_arg_)); + CastToBase(&attr_)->InternalSwap(CastToBase(&other->attr_)); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + summary_.Swap(&other->summary_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_.Swap(&other->description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(deprecation_, other->deprecation_); + swap(is_commutative_, other->is_commutative_); + swap(is_aggregate_, other->is_aggregate_); + swap(is_stateful_, other->is_stateful_); + swap(allows_uninitialized_input_, other->allows_uninitialized_input_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpDeprecation::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDeprecation::kVersionFieldNumber; +const int OpDeprecation::kExplanationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDeprecation::OpDeprecation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDeprecation.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpDeprecation) +} +OpDeprecation::OpDeprecation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDeprecation.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpDeprecation) +} +OpDeprecation::OpDeprecation(const OpDeprecation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + explanation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.explanation().size() > 0) { + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.explanation(), + GetArenaNoVirtual()); + } + version_ = from.version_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpDeprecation) +} + +void OpDeprecation::SharedCtor() { + explanation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + version_ = 0; +} + +OpDeprecation::~OpDeprecation() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpDeprecation) + SharedDtor(); +} + +void OpDeprecation::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + explanation_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void OpDeprecation::ArenaDtor(void* object) { + OpDeprecation* _this = reinterpret_cast< OpDeprecation* >(object); + (void)_this; +} +void OpDeprecation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDeprecation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpDeprecation::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpDeprecation& OpDeprecation::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpDeprecation.base); + return *internal_default_instance(); +} + + +void OpDeprecation::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpDeprecation) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + explanation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + version_ = 0; + _internal_metadata_.Clear(); +} + +bool OpDeprecation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpDeprecation) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &version_))); + } else { + goto handle_unusual; + } + break; + } + + // string explanation = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_explanation())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->explanation().data(), static_cast(this->explanation().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpDeprecation.explanation")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpDeprecation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpDeprecation) + return false; +#undef DO_ +} + +void OpDeprecation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpDeprecation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 version = 1; + if (this->version() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->version(), output); + } + + // string explanation = 2; + if (this->explanation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->explanation().data(), static_cast(this->explanation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDeprecation.explanation"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->explanation(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpDeprecation) +} + +::google::protobuf::uint8* OpDeprecation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpDeprecation) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 version = 1; + if (this->version() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->version(), target); + } + + // string explanation = 2; + if (this->explanation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->explanation().data(), static_cast(this->explanation().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpDeprecation.explanation"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->explanation(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpDeprecation) + return target; +} + +size_t OpDeprecation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpDeprecation) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string explanation = 2; + if (this->explanation().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->explanation()); + } + + // int32 version = 1; + if (this->version() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->version()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpDeprecation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpDeprecation) + GOOGLE_DCHECK_NE(&from, this); + const OpDeprecation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpDeprecation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpDeprecation) + MergeFrom(*source); + } +} + +void OpDeprecation::MergeFrom(const OpDeprecation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpDeprecation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.explanation().size() > 0) { + set_explanation(from.explanation()); + } + if (from.version() != 0) { + set_version(from.version()); + } +} + +void OpDeprecation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpDeprecation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDeprecation::CopyFrom(const OpDeprecation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpDeprecation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpDeprecation::IsInitialized() const { + return true; +} + +void OpDeprecation::Swap(OpDeprecation* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDeprecation* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpDeprecation::UnsafeArenaSwap(OpDeprecation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDeprecation::InternalSwap(OpDeprecation* other) { + using std::swap; + explanation_.Swap(&other->explanation_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(version_, other->version_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpDeprecation::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpList::kOpFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpList::OpList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpList) +} +OpList::OpList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + op_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpList) +} +OpList::OpList(const OpList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + op_(from.op_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpList) +} + +void OpList::SharedCtor() { +} + +OpList::~OpList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpList) + SharedDtor(); +} + +void OpList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void OpList::ArenaDtor(void* object) { + OpList* _this = reinterpret_cast< OpList* >(object); + (void)_this; +} +void OpList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpList& OpList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::scc_info_OpList.base); + return *internal_default_instance(); +} + + +void OpList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + op_.Clear(); + _internal_metadata_.Clear(); +} + +bool OpList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.OpDef op = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_op())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpList) + return false; +#undef DO_ +} + +void OpList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.OpDef op = 1; + for (unsigned int i = 0, + n = static_cast(this->op_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->op(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpList) +} + +::google::protobuf::uint8* OpList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.OpDef op = 1; + for (unsigned int i = 0, + n = static_cast(this->op_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->op(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpList) + return target; +} + +size_t OpList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.OpDef op = 1; + { + unsigned int count = static_cast(this->op_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->op(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpList) + GOOGLE_DCHECK_NE(&from, this); + const OpList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpList) + MergeFrom(*source); + } +} + +void OpList::MergeFrom(const OpList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + op_.MergeFrom(from.op_); +} + +void OpList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpList::CopyFrom(const OpList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpList::IsInitialized() const { + return true; +} + +void OpList::Swap(OpList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpList::UnsafeArenaSwap(OpList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpList::InternalSwap(OpList* other) { + using std::swap; + CastToBase(&op_)->InternalSwap(CastToBase(&other->op_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpDef_ArgDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpDef_ArgDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpDef_ArgDef >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpDef_AttrDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpDef_AttrDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpDef_AttrDef >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpDef >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpDeprecation* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpDeprecation >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpDeprecation >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpList >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.pb.h new file mode 100644 index 0000000..5d9b035 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.pb.h @@ -0,0 +1,2465 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/op_def.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/attr_value.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[5]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto +namespace diplomacy { +namespace tensorflow { +class OpDef; +class OpDefDefaultTypeInternal; +extern OpDefDefaultTypeInternal _OpDef_default_instance_; +class OpDef_ArgDef; +class OpDef_ArgDefDefaultTypeInternal; +extern OpDef_ArgDefDefaultTypeInternal _OpDef_ArgDef_default_instance_; +class OpDef_AttrDef; +class OpDef_AttrDefDefaultTypeInternal; +extern OpDef_AttrDefDefaultTypeInternal _OpDef_AttrDef_default_instance_; +class OpDeprecation; +class OpDeprecationDefaultTypeInternal; +extern OpDeprecationDefaultTypeInternal _OpDeprecation_default_instance_; +class OpList; +class OpListDefaultTypeInternal; +extern OpListDefaultTypeInternal _OpList_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::OpDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpDef>(Arena*); +template<> ::diplomacy::tensorflow::OpDef_ArgDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpDef_ArgDef>(Arena*); +template<> ::diplomacy::tensorflow::OpDef_AttrDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpDef_AttrDef>(Arena*); +template<> ::diplomacy::tensorflow::OpDeprecation* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpDeprecation>(Arena*); +template<> ::diplomacy::tensorflow::OpList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpList>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class OpDef_ArgDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpDef.ArgDef) */ { + public: + OpDef_ArgDef(); + virtual ~OpDef_ArgDef(); + + OpDef_ArgDef(const OpDef_ArgDef& from); + + inline OpDef_ArgDef& operator=(const OpDef_ArgDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpDef_ArgDef(OpDef_ArgDef&& from) noexcept + : OpDef_ArgDef() { + *this = ::std::move(from); + } + + inline OpDef_ArgDef& operator=(OpDef_ArgDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDef_ArgDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpDef_ArgDef* internal_default_instance() { + return reinterpret_cast( + &_OpDef_ArgDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(OpDef_ArgDef* other); + void Swap(OpDef_ArgDef* other); + friend void swap(OpDef_ArgDef& a, OpDef_ArgDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpDef_ArgDef* New() const final { + return CreateMaybeMessage(NULL); + } + + OpDef_ArgDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpDef_ArgDef& from); + void MergeFrom(const OpDef_ArgDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpDef_ArgDef* other); + protected: + explicit OpDef_ArgDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string description = 2; + void clear_description(); + static const int kDescriptionFieldNumber = 2; + const ::std::string& description() const; + void set_description(const ::std::string& value); + #if LANG_CXX11 + void set_description(::std::string&& value); + #endif + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // string type_attr = 4; + void clear_type_attr(); + static const int kTypeAttrFieldNumber = 4; + const ::std::string& type_attr() const; + void set_type_attr(const ::std::string& value); + #if LANG_CXX11 + void set_type_attr(::std::string&& value); + #endif + void set_type_attr(const char* value); + void set_type_attr(const char* value, size_t size); + ::std::string* mutable_type_attr(); + ::std::string* release_type_attr(); + void set_allocated_type_attr(::std::string* type_attr); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_type_attr(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_type_attr( + ::std::string* type_attr); + + // string number_attr = 5; + void clear_number_attr(); + static const int kNumberAttrFieldNumber = 5; + const ::std::string& number_attr() const; + void set_number_attr(const ::std::string& value); + #if LANG_CXX11 + void set_number_attr(::std::string&& value); + #endif + void set_number_attr(const char* value); + void set_number_attr(const char* value, size_t size); + ::std::string* mutable_number_attr(); + ::std::string* release_number_attr(); + void set_allocated_number_attr(::std::string* number_attr); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_number_attr(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_number_attr( + ::std::string* number_attr); + + // string type_list_attr = 6; + void clear_type_list_attr(); + static const int kTypeListAttrFieldNumber = 6; + const ::std::string& type_list_attr() const; + void set_type_list_attr(const ::std::string& value); + #if LANG_CXX11 + void set_type_list_attr(::std::string&& value); + #endif + void set_type_list_attr(const char* value); + void set_type_list_attr(const char* value, size_t size); + ::std::string* mutable_type_list_attr(); + ::std::string* release_type_list_attr(); + void set_allocated_type_list_attr(::std::string* type_list_attr); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_type_list_attr(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_type_list_attr( + ::std::string* type_list_attr); + + // .diplomacy.tensorflow.DataType type = 3; + void clear_type(); + static const int kTypeFieldNumber = 3; + ::diplomacy::tensorflow::DataType type() const; + void set_type(::diplomacy::tensorflow::DataType value); + + // bool is_ref = 16; + void clear_is_ref(); + static const int kIsRefFieldNumber = 16; + bool is_ref() const; + void set_is_ref(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDef.ArgDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr type_attr_; + ::google::protobuf::internal::ArenaStringPtr number_attr_; + ::google::protobuf::internal::ArenaStringPtr type_list_attr_; + int type_; + bool is_ref_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpDef_AttrDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpDef.AttrDef) */ { + public: + OpDef_AttrDef(); + virtual ~OpDef_AttrDef(); + + OpDef_AttrDef(const OpDef_AttrDef& from); + + inline OpDef_AttrDef& operator=(const OpDef_AttrDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpDef_AttrDef(OpDef_AttrDef&& from) noexcept + : OpDef_AttrDef() { + *this = ::std::move(from); + } + + inline OpDef_AttrDef& operator=(OpDef_AttrDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDef_AttrDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpDef_AttrDef* internal_default_instance() { + return reinterpret_cast( + &_OpDef_AttrDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(OpDef_AttrDef* other); + void Swap(OpDef_AttrDef* other); + friend void swap(OpDef_AttrDef& a, OpDef_AttrDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpDef_AttrDef* New() const final { + return CreateMaybeMessage(NULL); + } + + OpDef_AttrDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpDef_AttrDef& from); + void MergeFrom(const OpDef_AttrDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpDef_AttrDef* other); + protected: + explicit OpDef_AttrDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string type = 2; + void clear_type(); + static const int kTypeFieldNumber = 2; + const ::std::string& type() const; + void set_type(const ::std::string& value); + #if LANG_CXX11 + void set_type(::std::string&& value); + #endif + void set_type(const char* value); + void set_type(const char* value, size_t size); + ::std::string* mutable_type(); + ::std::string* release_type(); + void set_allocated_type(::std::string* type); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_type(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_type( + ::std::string* type); + + // string description = 4; + void clear_description(); + static const int kDescriptionFieldNumber = 4; + const ::std::string& description() const; + void set_description(const ::std::string& value); + #if LANG_CXX11 + void set_description(::std::string&& value); + #endif + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // .diplomacy.tensorflow.AttrValue default_value = 3; + bool has_default_value() const; + void clear_default_value(); + static const int kDefaultValueFieldNumber = 3; + private: + const ::diplomacy::tensorflow::AttrValue& _internal_default_value() const; + public: + const ::diplomacy::tensorflow::AttrValue& default_value() const; + ::diplomacy::tensorflow::AttrValue* release_default_value(); + ::diplomacy::tensorflow::AttrValue* mutable_default_value(); + void set_allocated_default_value(::diplomacy::tensorflow::AttrValue* default_value); + void unsafe_arena_set_allocated_default_value( + ::diplomacy::tensorflow::AttrValue* default_value); + ::diplomacy::tensorflow::AttrValue* unsafe_arena_release_default_value(); + + // .diplomacy.tensorflow.AttrValue allowed_values = 7; + bool has_allowed_values() const; + void clear_allowed_values(); + static const int kAllowedValuesFieldNumber = 7; + private: + const ::diplomacy::tensorflow::AttrValue& _internal_allowed_values() const; + public: + const ::diplomacy::tensorflow::AttrValue& allowed_values() const; + ::diplomacy::tensorflow::AttrValue* release_allowed_values(); + ::diplomacy::tensorflow::AttrValue* mutable_allowed_values(); + void set_allocated_allowed_values(::diplomacy::tensorflow::AttrValue* allowed_values); + void unsafe_arena_set_allocated_allowed_values( + ::diplomacy::tensorflow::AttrValue* allowed_values); + ::diplomacy::tensorflow::AttrValue* unsafe_arena_release_allowed_values(); + + // int64 minimum = 6; + void clear_minimum(); + static const int kMinimumFieldNumber = 6; + ::google::protobuf::int64 minimum() const; + void set_minimum(::google::protobuf::int64 value); + + // bool has_minimum = 5; + void clear_has_minimum(); + static const int kHasMinimumFieldNumber = 5; + bool has_minimum() const; + void set_has_minimum(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDef.AttrDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::diplomacy::tensorflow::AttrValue* default_value_; + ::diplomacy::tensorflow::AttrValue* allowed_values_; + ::google::protobuf::int64 minimum_; + bool has_minimum_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpDef) */ { + public: + OpDef(); + virtual ~OpDef(); + + OpDef(const OpDef& from); + + inline OpDef& operator=(const OpDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpDef(OpDef&& from) noexcept + : OpDef() { + *this = ::std::move(from); + } + + inline OpDef& operator=(OpDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpDef* internal_default_instance() { + return reinterpret_cast( + &_OpDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(OpDef* other); + void Swap(OpDef* other); + friend void swap(OpDef& a, OpDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpDef* New() const final { + return CreateMaybeMessage(NULL); + } + + OpDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpDef& from); + void MergeFrom(const OpDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpDef* other); + protected: + explicit OpDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef OpDef_ArgDef ArgDef; + typedef OpDef_AttrDef AttrDef; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.OpDef.ArgDef input_arg = 2; + int input_arg_size() const; + void clear_input_arg(); + static const int kInputArgFieldNumber = 2; + ::diplomacy::tensorflow::OpDef_ArgDef* mutable_input_arg(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >* + mutable_input_arg(); + const ::diplomacy::tensorflow::OpDef_ArgDef& input_arg(int index) const; + ::diplomacy::tensorflow::OpDef_ArgDef* add_input_arg(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >& + input_arg() const; + + // repeated .diplomacy.tensorflow.OpDef.ArgDef output_arg = 3; + int output_arg_size() const; + void clear_output_arg(); + static const int kOutputArgFieldNumber = 3; + ::diplomacy::tensorflow::OpDef_ArgDef* mutable_output_arg(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >* + mutable_output_arg(); + const ::diplomacy::tensorflow::OpDef_ArgDef& output_arg(int index) const; + ::diplomacy::tensorflow::OpDef_ArgDef* add_output_arg(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >& + output_arg() const; + + // repeated .diplomacy.tensorflow.OpDef.AttrDef attr = 4; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 4; + ::diplomacy::tensorflow::OpDef_AttrDef* mutable_attr(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_AttrDef >* + mutable_attr(); + const ::diplomacy::tensorflow::OpDef_AttrDef& attr(int index) const; + ::diplomacy::tensorflow::OpDef_AttrDef* add_attr(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_AttrDef >& + attr() const; + + // string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string summary = 5; + void clear_summary(); + static const int kSummaryFieldNumber = 5; + const ::std::string& summary() const; + void set_summary(const ::std::string& value); + #if LANG_CXX11 + void set_summary(::std::string&& value); + #endif + void set_summary(const char* value); + void set_summary(const char* value, size_t size); + ::std::string* mutable_summary(); + ::std::string* release_summary(); + void set_allocated_summary(::std::string* summary); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_summary(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_summary( + ::std::string* summary); + + // string description = 6; + void clear_description(); + static const int kDescriptionFieldNumber = 6; + const ::std::string& description() const; + void set_description(const ::std::string& value); + #if LANG_CXX11 + void set_description(::std::string&& value); + #endif + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_description(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // .diplomacy.tensorflow.OpDeprecation deprecation = 8; + bool has_deprecation() const; + void clear_deprecation(); + static const int kDeprecationFieldNumber = 8; + private: + const ::diplomacy::tensorflow::OpDeprecation& _internal_deprecation() const; + public: + const ::diplomacy::tensorflow::OpDeprecation& deprecation() const; + ::diplomacy::tensorflow::OpDeprecation* release_deprecation(); + ::diplomacy::tensorflow::OpDeprecation* mutable_deprecation(); + void set_allocated_deprecation(::diplomacy::tensorflow::OpDeprecation* deprecation); + void unsafe_arena_set_allocated_deprecation( + ::diplomacy::tensorflow::OpDeprecation* deprecation); + ::diplomacy::tensorflow::OpDeprecation* unsafe_arena_release_deprecation(); + + // bool is_commutative = 18; + void clear_is_commutative(); + static const int kIsCommutativeFieldNumber = 18; + bool is_commutative() const; + void set_is_commutative(bool value); + + // bool is_aggregate = 16; + void clear_is_aggregate(); + static const int kIsAggregateFieldNumber = 16; + bool is_aggregate() const; + void set_is_aggregate(bool value); + + // bool is_stateful = 17; + void clear_is_stateful(); + static const int kIsStatefulFieldNumber = 17; + bool is_stateful() const; + void set_is_stateful(bool value); + + // bool allows_uninitialized_input = 19; + void clear_allows_uninitialized_input(); + static const int kAllowsUninitializedInputFieldNumber = 19; + bool allows_uninitialized_input() const; + void set_allows_uninitialized_input(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef > input_arg_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef > output_arg_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_AttrDef > attr_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr summary_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::diplomacy::tensorflow::OpDeprecation* deprecation_; + bool is_commutative_; + bool is_aggregate_; + bool is_stateful_; + bool allows_uninitialized_input_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpDeprecation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpDeprecation) */ { + public: + OpDeprecation(); + virtual ~OpDeprecation(); + + OpDeprecation(const OpDeprecation& from); + + inline OpDeprecation& operator=(const OpDeprecation& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpDeprecation(OpDeprecation&& from) noexcept + : OpDeprecation() { + *this = ::std::move(from); + } + + inline OpDeprecation& operator=(OpDeprecation&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDeprecation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpDeprecation* internal_default_instance() { + return reinterpret_cast( + &_OpDeprecation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(OpDeprecation* other); + void Swap(OpDeprecation* other); + friend void swap(OpDeprecation& a, OpDeprecation& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpDeprecation* New() const final { + return CreateMaybeMessage(NULL); + } + + OpDeprecation* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpDeprecation& from); + void MergeFrom(const OpDeprecation& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpDeprecation* other); + protected: + explicit OpDeprecation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string explanation = 2; + void clear_explanation(); + static const int kExplanationFieldNumber = 2; + const ::std::string& explanation() const; + void set_explanation(const ::std::string& value); + #if LANG_CXX11 + void set_explanation(::std::string&& value); + #endif + void set_explanation(const char* value); + void set_explanation(const char* value, size_t size); + ::std::string* mutable_explanation(); + ::std::string* release_explanation(); + void set_allocated_explanation(::std::string* explanation); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_explanation(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_explanation( + ::std::string* explanation); + + // int32 version = 1; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::google::protobuf::int32 version() const; + void set_version(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDeprecation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr explanation_; + ::google::protobuf::int32 version_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpList) */ { + public: + OpList(); + virtual ~OpList(); + + OpList(const OpList& from); + + inline OpList& operator=(const OpList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpList(OpList&& from) noexcept + : OpList() { + *this = ::std::move(from); + } + + inline OpList& operator=(OpList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpList* internal_default_instance() { + return reinterpret_cast( + &_OpList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(OpList* other); + void Swap(OpList* other); + friend void swap(OpList& a, OpList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpList* New() const final { + return CreateMaybeMessage(NULL); + } + + OpList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpList& from); + void MergeFrom(const OpList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpList* other); + protected: + explicit OpList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.OpDef op = 1; + int op_size() const; + void clear_op(); + static const int kOpFieldNumber = 1; + ::diplomacy::tensorflow::OpDef* mutable_op(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef >* + mutable_op(); + const ::diplomacy::tensorflow::OpDef& op(int index) const; + ::diplomacy::tensorflow::OpDef* add_op(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef >& + op() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef > op_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// OpDef_ArgDef + +// string name = 1; +inline void OpDef_ArgDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.ArgDef.name) + return name_.Get(); +} +inline void OpDef_ArgDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.ArgDef.name) +} +#if LANG_CXX11 +inline void OpDef_ArgDef::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.ArgDef.name) +} +#endif +inline void OpDef_ArgDef::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.ArgDef.name) +} +inline void OpDef_ArgDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.ArgDef.name) +} +inline ::std::string* OpDef_ArgDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.ArgDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.ArgDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.name) +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.ArgDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.name) +} + +// string description = 2; +inline void OpDef_ArgDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::description() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.ArgDef.description) + return description_.Get(); +} +inline void OpDef_ArgDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.ArgDef.description) +} +#if LANG_CXX11 +inline void OpDef_ArgDef::set_description(::std::string&& value) { + + description_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.ArgDef.description) +} +#endif +inline void OpDef_ArgDef::set_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.ArgDef.description) +} +inline void OpDef_ArgDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.ArgDef.description) +} +inline ::std::string* OpDef_ArgDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.ArgDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.ArgDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.description) +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.ArgDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.description) +} + +// .diplomacy.tensorflow.DataType type = 3; +inline void OpDef_ArgDef::clear_type() { + type_ = 0; +} +inline ::diplomacy::tensorflow::DataType OpDef_ArgDef::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.ArgDef.type) + return static_cast< ::diplomacy::tensorflow::DataType >(type_); +} +inline void OpDef_ArgDef::set_type(::diplomacy::tensorflow::DataType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.ArgDef.type) +} + +// string type_attr = 4; +inline void OpDef_ArgDef::clear_type_attr() { + type_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::type_attr() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.ArgDef.type_attr) + return type_attr_.Get(); +} +inline void OpDef_ArgDef::set_type_attr(const ::std::string& value) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.ArgDef.type_attr) +} +#if LANG_CXX11 +inline void OpDef_ArgDef::set_type_attr(::std::string&& value) { + + type_attr_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.ArgDef.type_attr) +} +#endif +inline void OpDef_ArgDef::set_type_attr(const char* value) { + GOOGLE_DCHECK(value != NULL); + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.ArgDef.type_attr) +} +inline void OpDef_ArgDef::set_type_attr(const char* value, + size_t size) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.ArgDef.type_attr) +} +inline ::std::string* OpDef_ArgDef::mutable_type_attr() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.ArgDef.type_attr) + return type_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_type_attr() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.ArgDef.type_attr) + + return type_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_type_attr(::std::string* type_attr) { + if (type_attr != NULL) { + + } else { + + } + type_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.type_attr) +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_type_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.ArgDef.type_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_type_attr( + ::std::string* type_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_attr != NULL) { + + } else { + + } + type_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.type_attr) +} + +// string number_attr = 5; +inline void OpDef_ArgDef::clear_number_attr() { + number_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::number_attr() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.ArgDef.number_attr) + return number_attr_.Get(); +} +inline void OpDef_ArgDef::set_number_attr(const ::std::string& value) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.ArgDef.number_attr) +} +#if LANG_CXX11 +inline void OpDef_ArgDef::set_number_attr(::std::string&& value) { + + number_attr_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.ArgDef.number_attr) +} +#endif +inline void OpDef_ArgDef::set_number_attr(const char* value) { + GOOGLE_DCHECK(value != NULL); + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.ArgDef.number_attr) +} +inline void OpDef_ArgDef::set_number_attr(const char* value, + size_t size) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.ArgDef.number_attr) +} +inline ::std::string* OpDef_ArgDef::mutable_number_attr() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.ArgDef.number_attr) + return number_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_number_attr() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.ArgDef.number_attr) + + return number_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_number_attr(::std::string* number_attr) { + if (number_attr != NULL) { + + } else { + + } + number_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), number_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.number_attr) +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_number_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.ArgDef.number_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return number_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_number_attr( + ::std::string* number_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (number_attr != NULL) { + + } else { + + } + number_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + number_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.number_attr) +} + +// string type_list_attr = 6; +inline void OpDef_ArgDef::clear_type_list_attr() { + type_list_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::type_list_attr() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) + return type_list_attr_.Get(); +} +inline void OpDef_ArgDef::set_type_list_attr(const ::std::string& value) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) +} +#if LANG_CXX11 +inline void OpDef_ArgDef::set_type_list_attr(::std::string&& value) { + + type_list_attr_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) +} +#endif +inline void OpDef_ArgDef::set_type_list_attr(const char* value) { + GOOGLE_DCHECK(value != NULL); + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) +} +inline void OpDef_ArgDef::set_type_list_attr(const char* value, + size_t size) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) +} +inline ::std::string* OpDef_ArgDef::mutable_type_list_attr() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) + return type_list_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_type_list_attr() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) + + return type_list_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_type_list_attr(::std::string* type_list_attr) { + if (type_list_attr != NULL) { + + } else { + + } + type_list_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_list_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_type_list_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_list_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_type_list_attr( + ::std::string* type_list_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_list_attr != NULL) { + + } else { + + } + type_list_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_list_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.ArgDef.type_list_attr) +} + +// bool is_ref = 16; +inline void OpDef_ArgDef::clear_is_ref() { + is_ref_ = false; +} +inline bool OpDef_ArgDef::is_ref() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.ArgDef.is_ref) + return is_ref_; +} +inline void OpDef_ArgDef::set_is_ref(bool value) { + + is_ref_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.ArgDef.is_ref) +} + +// ------------------------------------------------------------------- + +// OpDef_AttrDef + +// string name = 1; +inline void OpDef_AttrDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_AttrDef::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.AttrDef.name) + return name_.Get(); +} +inline void OpDef_AttrDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.AttrDef.name) +} +#if LANG_CXX11 +inline void OpDef_AttrDef::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.AttrDef.name) +} +#endif +inline void OpDef_AttrDef::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.AttrDef.name) +} +inline void OpDef_AttrDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.AttrDef.name) +} +inline ::std::string* OpDef_AttrDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.AttrDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.AttrDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.name) +} +inline ::std::string* OpDef_AttrDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.AttrDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.name) +} + +// string type = 2; +inline void OpDef_AttrDef::clear_type() { + type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_AttrDef::type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.AttrDef.type) + return type_.Get(); +} +inline void OpDef_AttrDef::set_type(const ::std::string& value) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.AttrDef.type) +} +#if LANG_CXX11 +inline void OpDef_AttrDef::set_type(::std::string&& value) { + + type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.AttrDef.type) +} +#endif +inline void OpDef_AttrDef::set_type(const char* value) { + GOOGLE_DCHECK(value != NULL); + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.AttrDef.type) +} +inline void OpDef_AttrDef::set_type(const char* value, + size_t size) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.AttrDef.type) +} +inline ::std::string* OpDef_AttrDef::mutable_type() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.AttrDef.type) + return type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::release_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.AttrDef.type) + + return type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::set_allocated_type(::std::string* type) { + if (type != NULL) { + + } else { + + } + type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.type) +} +inline ::std::string* OpDef_AttrDef::unsafe_arena_release_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.AttrDef.type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::unsafe_arena_set_allocated_type( + ::std::string* type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type != NULL) { + + } else { + + } + type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.type) +} + +// .diplomacy.tensorflow.AttrValue default_value = 3; +inline bool OpDef_AttrDef::has_default_value() const { + return this != internal_default_instance() && default_value_ != NULL; +} +inline const ::diplomacy::tensorflow::AttrValue& OpDef_AttrDef::_internal_default_value() const { + return *default_value_; +} +inline const ::diplomacy::tensorflow::AttrValue& OpDef_AttrDef::default_value() const { + const ::diplomacy::tensorflow::AttrValue* p = default_value_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.AttrDef.default_value) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_AttrValue_default_instance_); +} +inline ::diplomacy::tensorflow::AttrValue* OpDef_AttrDef::release_default_value() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.AttrDef.default_value) + + ::diplomacy::tensorflow::AttrValue* temp = default_value_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + default_value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* OpDef_AttrDef::unsafe_arena_release_default_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.AttrDef.default_value) + + ::diplomacy::tensorflow::AttrValue* temp = default_value_; + default_value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* OpDef_AttrDef::mutable_default_value() { + + if (default_value_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::AttrValue>(GetArenaNoVirtual()); + default_value_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.AttrDef.default_value) + return default_value_; +} +inline void OpDef_AttrDef::set_allocated_default_value(::diplomacy::tensorflow::AttrValue* default_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(default_value_); + } + if (default_value) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(default_value)->GetArena(); + if (message_arena != submessage_arena) { + default_value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, default_value, submessage_arena); + } + + } else { + + } + default_value_ = default_value; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.default_value) +} + +// string description = 4; +inline void OpDef_AttrDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_AttrDef::description() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.AttrDef.description) + return description_.Get(); +} +inline void OpDef_AttrDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.AttrDef.description) +} +#if LANG_CXX11 +inline void OpDef_AttrDef::set_description(::std::string&& value) { + + description_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.AttrDef.description) +} +#endif +inline void OpDef_AttrDef::set_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.AttrDef.description) +} +inline void OpDef_AttrDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.AttrDef.description) +} +inline ::std::string* OpDef_AttrDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.AttrDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::release_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.AttrDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.description) +} +inline ::std::string* OpDef_AttrDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.AttrDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.description) +} + +// bool has_minimum = 5; +inline void OpDef_AttrDef::clear_has_minimum() { + has_minimum_ = false; +} +inline bool OpDef_AttrDef::has_minimum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.AttrDef.has_minimum) + return has_minimum_; +} +inline void OpDef_AttrDef::set_has_minimum(bool value) { + + has_minimum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.AttrDef.has_minimum) +} + +// int64 minimum = 6; +inline void OpDef_AttrDef::clear_minimum() { + minimum_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpDef_AttrDef::minimum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.AttrDef.minimum) + return minimum_; +} +inline void OpDef_AttrDef::set_minimum(::google::protobuf::int64 value) { + + minimum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.AttrDef.minimum) +} + +// .diplomacy.tensorflow.AttrValue allowed_values = 7; +inline bool OpDef_AttrDef::has_allowed_values() const { + return this != internal_default_instance() && allowed_values_ != NULL; +} +inline const ::diplomacy::tensorflow::AttrValue& OpDef_AttrDef::_internal_allowed_values() const { + return *allowed_values_; +} +inline const ::diplomacy::tensorflow::AttrValue& OpDef_AttrDef::allowed_values() const { + const ::diplomacy::tensorflow::AttrValue* p = allowed_values_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.AttrDef.allowed_values) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_AttrValue_default_instance_); +} +inline ::diplomacy::tensorflow::AttrValue* OpDef_AttrDef::release_allowed_values() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.AttrDef.allowed_values) + + ::diplomacy::tensorflow::AttrValue* temp = allowed_values_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + allowed_values_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* OpDef_AttrDef::unsafe_arena_release_allowed_values() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.AttrDef.allowed_values) + + ::diplomacy::tensorflow::AttrValue* temp = allowed_values_; + allowed_values_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AttrValue* OpDef_AttrDef::mutable_allowed_values() { + + if (allowed_values_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::AttrValue>(GetArenaNoVirtual()); + allowed_values_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.AttrDef.allowed_values) + return allowed_values_; +} +inline void OpDef_AttrDef::set_allocated_allowed_values(::diplomacy::tensorflow::AttrValue* allowed_values) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(allowed_values_); + } + if (allowed_values) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(allowed_values)->GetArena(); + if (message_arena != submessage_arena) { + allowed_values = ::google::protobuf::internal::GetOwnedMessage( + message_arena, allowed_values, submessage_arena); + } + + } else { + + } + allowed_values_ = allowed_values; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.AttrDef.allowed_values) +} + +// ------------------------------------------------------------------- + +// OpDef + +// string name = 1; +inline void OpDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.name) + return name_.Get(); +} +inline void OpDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.name) +} +#if LANG_CXX11 +inline void OpDef::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.name) +} +#endif +inline void OpDef::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.name) +} +inline void OpDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.name) +} +inline ::std::string* OpDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.name) +} +inline ::std::string* OpDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.name) +} + +// repeated .diplomacy.tensorflow.OpDef.ArgDef input_arg = 2; +inline int OpDef::input_arg_size() const { + return input_arg_.size(); +} +inline void OpDef::clear_input_arg() { + input_arg_.Clear(); +} +inline ::diplomacy::tensorflow::OpDef_ArgDef* OpDef::mutable_input_arg(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.input_arg) + return input_arg_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >* +OpDef::mutable_input_arg() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpDef.input_arg) + return &input_arg_; +} +inline const ::diplomacy::tensorflow::OpDef_ArgDef& OpDef::input_arg(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.input_arg) + return input_arg_.Get(index); +} +inline ::diplomacy::tensorflow::OpDef_ArgDef* OpDef::add_input_arg() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpDef.input_arg) + return input_arg_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >& +OpDef::input_arg() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpDef.input_arg) + return input_arg_; +} + +// repeated .diplomacy.tensorflow.OpDef.ArgDef output_arg = 3; +inline int OpDef::output_arg_size() const { + return output_arg_.size(); +} +inline void OpDef::clear_output_arg() { + output_arg_.Clear(); +} +inline ::diplomacy::tensorflow::OpDef_ArgDef* OpDef::mutable_output_arg(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.output_arg) + return output_arg_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >* +OpDef::mutable_output_arg() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpDef.output_arg) + return &output_arg_; +} +inline const ::diplomacy::tensorflow::OpDef_ArgDef& OpDef::output_arg(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.output_arg) + return output_arg_.Get(index); +} +inline ::diplomacy::tensorflow::OpDef_ArgDef* OpDef::add_output_arg() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpDef.output_arg) + return output_arg_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_ArgDef >& +OpDef::output_arg() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpDef.output_arg) + return output_arg_; +} + +// repeated .diplomacy.tensorflow.OpDef.AttrDef attr = 4; +inline int OpDef::attr_size() const { + return attr_.size(); +} +inline void OpDef::clear_attr() { + attr_.Clear(); +} +inline ::diplomacy::tensorflow::OpDef_AttrDef* OpDef::mutable_attr(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.attr) + return attr_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_AttrDef >* +OpDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpDef.attr) + return &attr_; +} +inline const ::diplomacy::tensorflow::OpDef_AttrDef& OpDef::attr(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.attr) + return attr_.Get(index); +} +inline ::diplomacy::tensorflow::OpDef_AttrDef* OpDef::add_attr() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpDef.attr) + return attr_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef_AttrDef >& +OpDef::attr() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpDef.attr) + return attr_; +} + +// .diplomacy.tensorflow.OpDeprecation deprecation = 8; +inline bool OpDef::has_deprecation() const { + return this != internal_default_instance() && deprecation_ != NULL; +} +inline void OpDef::clear_deprecation() { + if (GetArenaNoVirtual() == NULL && deprecation_ != NULL) { + delete deprecation_; + } + deprecation_ = NULL; +} +inline const ::diplomacy::tensorflow::OpDeprecation& OpDef::_internal_deprecation() const { + return *deprecation_; +} +inline const ::diplomacy::tensorflow::OpDeprecation& OpDef::deprecation() const { + const ::diplomacy::tensorflow::OpDeprecation* p = deprecation_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.deprecation) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_OpDeprecation_default_instance_); +} +inline ::diplomacy::tensorflow::OpDeprecation* OpDef::release_deprecation() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.deprecation) + + ::diplomacy::tensorflow::OpDeprecation* temp = deprecation_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + deprecation_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpDeprecation* OpDef::unsafe_arena_release_deprecation() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.deprecation) + + ::diplomacy::tensorflow::OpDeprecation* temp = deprecation_; + deprecation_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpDeprecation* OpDef::mutable_deprecation() { + + if (deprecation_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::OpDeprecation>(GetArenaNoVirtual()); + deprecation_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.deprecation) + return deprecation_; +} +inline void OpDef::set_allocated_deprecation(::diplomacy::tensorflow::OpDeprecation* deprecation) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete deprecation_; + } + if (deprecation) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(deprecation); + if (message_arena != submessage_arena) { + deprecation = ::google::protobuf::internal::GetOwnedMessage( + message_arena, deprecation, submessage_arena); + } + + } else { + + } + deprecation_ = deprecation; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.deprecation) +} + +// string summary = 5; +inline void OpDef::clear_summary() { + summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef::summary() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.summary) + return summary_.Get(); +} +inline void OpDef::set_summary(const ::std::string& value) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.summary) +} +#if LANG_CXX11 +inline void OpDef::set_summary(::std::string&& value) { + + summary_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.summary) +} +#endif +inline void OpDef::set_summary(const char* value) { + GOOGLE_DCHECK(value != NULL); + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.summary) +} +inline void OpDef::set_summary(const char* value, + size_t size) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.summary) +} +inline ::std::string* OpDef::mutable_summary() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.summary) + return summary_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::release_summary() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.summary) + + return summary_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef::set_allocated_summary(::std::string* summary) { + if (summary != NULL) { + + } else { + + } + summary_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), summary, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.summary) +} +inline ::std::string* OpDef::unsafe_arena_release_summary() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.summary) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return summary_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef::unsafe_arena_set_allocated_summary( + ::std::string* summary) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (summary != NULL) { + + } else { + + } + summary_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + summary, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.summary) +} + +// string description = 6; +inline void OpDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef::description() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.description) + return description_.Get(); +} +inline void OpDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.description) +} +#if LANG_CXX11 +inline void OpDef::set_description(::std::string&& value) { + + description_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDef.description) +} +#endif +inline void OpDef::set_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDef.description) +} +inline void OpDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDef.description) +} +inline ::std::string* OpDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::release_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDef.description) +} +inline ::std::string* OpDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDef.description) +} + +// bool is_commutative = 18; +inline void OpDef::clear_is_commutative() { + is_commutative_ = false; +} +inline bool OpDef::is_commutative() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.is_commutative) + return is_commutative_; +} +inline void OpDef::set_is_commutative(bool value) { + + is_commutative_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.is_commutative) +} + +// bool is_aggregate = 16; +inline void OpDef::clear_is_aggregate() { + is_aggregate_ = false; +} +inline bool OpDef::is_aggregate() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.is_aggregate) + return is_aggregate_; +} +inline void OpDef::set_is_aggregate(bool value) { + + is_aggregate_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.is_aggregate) +} + +// bool is_stateful = 17; +inline void OpDef::clear_is_stateful() { + is_stateful_ = false; +} +inline bool OpDef::is_stateful() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.is_stateful) + return is_stateful_; +} +inline void OpDef::set_is_stateful(bool value) { + + is_stateful_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.is_stateful) +} + +// bool allows_uninitialized_input = 19; +inline void OpDef::clear_allows_uninitialized_input() { + allows_uninitialized_input_ = false; +} +inline bool OpDef::allows_uninitialized_input() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDef.allows_uninitialized_input) + return allows_uninitialized_input_; +} +inline void OpDef::set_allows_uninitialized_input(bool value) { + + allows_uninitialized_input_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDef.allows_uninitialized_input) +} + +// ------------------------------------------------------------------- + +// OpDeprecation + +// int32 version = 1; +inline void OpDeprecation::clear_version() { + version_ = 0; +} +inline ::google::protobuf::int32 OpDeprecation::version() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDeprecation.version) + return version_; +} +inline void OpDeprecation::set_version(::google::protobuf::int32 value) { + + version_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDeprecation.version) +} + +// string explanation = 2; +inline void OpDeprecation::clear_explanation() { + explanation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDeprecation::explanation() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpDeprecation.explanation) + return explanation_.Get(); +} +inline void OpDeprecation::set_explanation(const ::std::string& value) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpDeprecation.explanation) +} +#if LANG_CXX11 +inline void OpDeprecation::set_explanation(::std::string&& value) { + + explanation_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpDeprecation.explanation) +} +#endif +inline void OpDeprecation::set_explanation(const char* value) { + GOOGLE_DCHECK(value != NULL); + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpDeprecation.explanation) +} +inline void OpDeprecation::set_explanation(const char* value, + size_t size) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpDeprecation.explanation) +} +inline ::std::string* OpDeprecation::mutable_explanation() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpDeprecation.explanation) + return explanation_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDeprecation::release_explanation() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpDeprecation.explanation) + + return explanation_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpDeprecation::set_allocated_explanation(::std::string* explanation) { + if (explanation != NULL) { + + } else { + + } + explanation_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), explanation, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpDeprecation.explanation) +} +inline ::std::string* OpDeprecation::unsafe_arena_release_explanation() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpDeprecation.explanation) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return explanation_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDeprecation::unsafe_arena_set_allocated_explanation( + ::std::string* explanation) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (explanation != NULL) { + + } else { + + } + explanation_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + explanation, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpDeprecation.explanation) +} + +// ------------------------------------------------------------------- + +// OpList + +// repeated .diplomacy.tensorflow.OpDef op = 1; +inline int OpList::op_size() const { + return op_.size(); +} +inline void OpList::clear_op() { + op_.Clear(); +} +inline ::diplomacy::tensorflow::OpDef* OpList::mutable_op(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpList.op) + return op_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef >* +OpList::mutable_op() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpList.op) + return &op_; +} +inline const ::diplomacy::tensorflow::OpDef& OpList::op(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpList.op) + return op_.Get(index); +} +inline ::diplomacy::tensorflow::OpDef* OpList::add_op() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpList.op) + return op_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpDef >& +OpList::op() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpList.op) + return op_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fop_5fdef_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.proto new file mode 100644 index 0000000..93a4ff9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def.proto @@ -0,0 +1,166 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "OpDefProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/attr_value.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +// Defines an operation. A NodeDef in a GraphDef specifies an Op by +// using the "op" field which should match the name of a OpDef. +// LINT.IfChange +message OpDef { + // Op names starting with an underscore are reserved for internal use. + // Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9_]*". + string name = 1; + + // For describing inputs and outputs. + message ArgDef { + // Name for the input/output. Should match the regexp "[a-z][a-z0-9_]*". + string name = 1; + + // Human readable description. + string description = 2; + + // Describes the type of one or more tensors that are accepted/produced + // by this input/output arg. The only legal combinations are: + // * For a single tensor: either the "type" field is set or the + // "type_attr" field is set to the name of an attr with type "type". + // * For a sequence of tensors with the same type: the "number_attr" + // field will be set to the name of an attr with type "int", and + // either the "type" or "type_attr" field will be set as for + // single tensors. + // * For a sequence of tensors, the "type_list_attr" field will be set + // to the name of an attr with type "list(type)". + DataType type = 3; + string type_attr = 4; // if specified, attr must have type "type" + string number_attr = 5; // if specified, attr must have type "int" + // If specified, attr must have type "list(type)", and none of + // type, type_attr, and number_attr may be specified. + string type_list_attr = 6; + + // For inputs: if true, the inputs are required to be refs. + // By default, inputs can be either refs or non-refs. + // For outputs: if true, outputs are refs, otherwise they are not. + bool is_ref = 16; + }; + + // Description of the input(s). + repeated ArgDef input_arg = 2; + + // Description of the output(s). + repeated ArgDef output_arg = 3; + + // Description of the graph-construction-time configuration of this + // Op. That is to say, this describes the attr fields that will + // be specified in the NodeDef. + message AttrDef { + // A descriptive name for the argument. May be used, e.g. by the + // Python client, as a keyword argument name, and so should match + // the regexp "[a-z][a-z0-9_]+". + string name = 1; + + // One of the type names from attr_value.proto ("string", "list(string)", + // "int", etc.). + string type = 2; + + // A reasonable default for this attribute if the user does not supply + // a value. If not specified, the user must supply a value. + AttrValue default_value = 3; + + // Human-readable description. + string description = 4; + + // TODO(josh11b): bool is_optional? + + // --- Constraints --- + // These constraints are only in effect if specified. Default is no + // constraints. + + // For type == "int", this is a minimum value. For "list(___)" + // types, this is the minimum length. + bool has_minimum = 5; + int64 minimum = 6; + + // The set of allowed values. Has type that is the "list" version + // of the "type" field above (uses the "list" field of AttrValue). + // If type == "type" or "list(type)" above, then the "type" field + // of "allowed_values.list" has the set of allowed DataTypes. + // If type == "string" or "list(string)", then the "s" field of + // "allowed_values.list" has the set of allowed strings. + AttrValue allowed_values = 7; + } + repeated AttrDef attr = 4; + + // Optional deprecation based on GraphDef versions. + OpDeprecation deprecation = 8; + + // One-line human-readable description of what the Op does. + string summary = 5; + + // Additional, longer human-readable description of what the Op does. + string description = 6; + + // ------------------------------------------------------------------------- + // Which optimizations this operation can participate in. + + // True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs) + bool is_commutative = 18; + + // If is_aggregate is true, then this operation accepts N >= 2 + // inputs and produces 1 output all of the same type. Should be + // associative and commutative, and produce output with the same + // shape as the input. The optimizer may replace an aggregate op + // taking input from multiple devices with a tree of aggregate ops + // that aggregate locally within each device (and possibly within + // groups of nearby devices) before communicating. + // TODO(josh11b): Implement that optimization. + bool is_aggregate = 16; // for things like add + + // Other optimizations go here, like + // can_alias_input, rewrite_when_output_unused, partitioning_strategy, etc. + + // ------------------------------------------------------------------------- + // Optimization constraints. + + // Ops are marked as stateful if their behavior depends on some state beyond + // their input tensors (e.g. variable reading op) or if they have + // a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops + // must always produce the same output for the same input and have + // no side-effects. + // + // By default Ops may be moved between devices. Stateful ops should + // either not be moved, or should only be moved if that state can also + // be moved (e.g. via some sort of save / restore). + // Stateful ops are guaranteed to never be optimized away by Common + // Subexpression Elimination (CSE). + bool is_stateful = 17; // for things like variables, queue + + // ------------------------------------------------------------------------- + // Non-standard options. + + // By default, all inputs to an Op must be initialized Tensors. Ops + // that may initialize tensors for the first time should set this + // field to true, to allow the Op to take an uninitialized Tensor as + // input. + bool allows_uninitialized_input = 19; // for Assign, etc. +}; +// LINT.ThenChange( +// https://www.tensorflow.org/code/tensorflow/core/framework/op_def_util.cc) + +// Information about version-dependent deprecation of an op +message OpDeprecation { + // First GraphDef version at which the op is disallowed. + int32 version = 1; + + // Explanation of why it was deprecated and what to use instead. + string explanation = 2; +}; + +// A collection of OpDefs +message OpList { + repeated OpDef op = 1; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def_pb2.py new file mode 100644 index 0000000..50fb336 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/op_def_pb2.py @@ -0,0 +1,398 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/op_def.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import attr_value_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/op_def.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\013OpDefProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n0diplomacy_tensorflow/core/framework/op_def.proto\x12\x14\x64iplomacy.tensorflow\x1a\x34\x64iplomacy_tensorflow/core/framework/attr_value.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"\xfe\x05\n\x05OpDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\tinput_arg\x18\x02 \x03(\x0b\x32\".diplomacy.tensorflow.OpDef.ArgDef\x12\x36\n\noutput_arg\x18\x03 \x03(\x0b\x32\".diplomacy.tensorflow.OpDef.ArgDef\x12\x31\n\x04\x61ttr\x18\x04 \x03(\x0b\x32#.diplomacy.tensorflow.OpDef.AttrDef\x12\x38\n\x0b\x64\x65precation\x18\x08 \x01(\x0b\x32#.diplomacy.tensorflow.OpDeprecation\x12\x0f\n\x07summary\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x16\n\x0eis_commutative\x18\x12 \x01(\x08\x12\x14\n\x0cis_aggregate\x18\x10 \x01(\x08\x12\x13\n\x0bis_stateful\x18\x11 \x01(\x08\x12\"\n\x1a\x61llows_uninitialized_input\x18\x13 \x01(\x08\x1a\xa9\x01\n\x06\x41rgDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12,\n\x04type\x18\x03 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\x12\x11\n\ttype_attr\x18\x04 \x01(\t\x12\x13\n\x0bnumber_attr\x18\x05 \x01(\t\x12\x16\n\x0etype_list_attr\x18\x06 \x01(\t\x12\x0e\n\x06is_ref\x18\x10 \x01(\x08\x1a\xd1\x01\n\x07\x41ttrDef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x36\n\rdefault_value\x18\x03 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x13\n\x0bhas_minimum\x18\x05 \x01(\x08\x12\x0f\n\x07minimum\x18\x06 \x01(\x03\x12\x37\n\x0e\x61llowed_values\x18\x07 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue\"5\n\rOpDeprecation\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12\x13\n\x0b\x65xplanation\x18\x02 \x01(\t\"1\n\x06OpList\x12\'\n\x02op\x18\x01 \x03(\x0b\x32\x1b.diplomacy.tensorflow.OpDefBk\n\x18org.tensorflow.frameworkB\x0bOpDefProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + + +_OPDEF_ARGDEF = _descriptor.Descriptor( + name='ArgDef', + full_name='diplomacy.tensorflow.OpDef.ArgDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.OpDef.ArgDef.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='diplomacy.tensorflow.OpDef.ArgDef.description', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.OpDef.ArgDef.type', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type_attr', full_name='diplomacy.tensorflow.OpDef.ArgDef.type_attr', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='number_attr', full_name='diplomacy.tensorflow.OpDef.ArgDef.number_attr', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type_list_attr', full_name='diplomacy.tensorflow.OpDef.ArgDef.type_list_attr', index=5, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_ref', full_name='diplomacy.tensorflow.OpDef.ArgDef.is_ref', index=6, + number=16, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=563, + serialized_end=732, +) + +_OPDEF_ATTRDEF = _descriptor.Descriptor( + name='AttrDef', + full_name='diplomacy.tensorflow.OpDef.AttrDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.OpDef.AttrDef.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='diplomacy.tensorflow.OpDef.AttrDef.type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default_value', full_name='diplomacy.tensorflow.OpDef.AttrDef.default_value', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='diplomacy.tensorflow.OpDef.AttrDef.description', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='has_minimum', full_name='diplomacy.tensorflow.OpDef.AttrDef.has_minimum', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='minimum', full_name='diplomacy.tensorflow.OpDef.AttrDef.minimum', index=5, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='allowed_values', full_name='diplomacy.tensorflow.OpDef.AttrDef.allowed_values', index=6, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=735, + serialized_end=944, +) + +_OPDEF = _descriptor.Descriptor( + name='OpDef', + full_name='diplomacy.tensorflow.OpDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.OpDef.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='input_arg', full_name='diplomacy.tensorflow.OpDef.input_arg', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_arg', full_name='diplomacy.tensorflow.OpDef.output_arg', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attr', full_name='diplomacy.tensorflow.OpDef.attr', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='deprecation', full_name='diplomacy.tensorflow.OpDef.deprecation', index=4, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='summary', full_name='diplomacy.tensorflow.OpDef.summary', index=5, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='diplomacy.tensorflow.OpDef.description', index=6, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_commutative', full_name='diplomacy.tensorflow.OpDef.is_commutative', index=7, + number=18, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_aggregate', full_name='diplomacy.tensorflow.OpDef.is_aggregate', index=8, + number=16, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_stateful', full_name='diplomacy.tensorflow.OpDef.is_stateful', index=9, + number=17, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='allows_uninitialized_input', full_name='diplomacy.tensorflow.OpDef.allows_uninitialized_input', index=10, + number=19, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_OPDEF_ARGDEF, _OPDEF_ATTRDEF, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=178, + serialized_end=944, +) + + +_OPDEPRECATION = _descriptor.Descriptor( + name='OpDeprecation', + full_name='diplomacy.tensorflow.OpDeprecation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='version', full_name='diplomacy.tensorflow.OpDeprecation.version', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='explanation', full_name='diplomacy.tensorflow.OpDeprecation.explanation', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=946, + serialized_end=999, +) + + +_OPLIST = _descriptor.Descriptor( + name='OpList', + full_name='diplomacy.tensorflow.OpList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op', full_name='diplomacy.tensorflow.OpList.op', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1001, + serialized_end=1050, +) + +_OPDEF_ARGDEF.fields_by_name['type'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_OPDEF_ARGDEF.containing_type = _OPDEF +_OPDEF_ATTRDEF.fields_by_name['default_value'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2._ATTRVALUE +_OPDEF_ATTRDEF.fields_by_name['allowed_values'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2._ATTRVALUE +_OPDEF_ATTRDEF.containing_type = _OPDEF +_OPDEF.fields_by_name['input_arg'].message_type = _OPDEF_ARGDEF +_OPDEF.fields_by_name['output_arg'].message_type = _OPDEF_ARGDEF +_OPDEF.fields_by_name['attr'].message_type = _OPDEF_ATTRDEF +_OPDEF.fields_by_name['deprecation'].message_type = _OPDEPRECATION +_OPLIST.fields_by_name['op'].message_type = _OPDEF +DESCRIPTOR.message_types_by_name['OpDef'] = _OPDEF +DESCRIPTOR.message_types_by_name['OpDeprecation'] = _OPDEPRECATION +DESCRIPTOR.message_types_by_name['OpList'] = _OPLIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +OpDef = _reflection.GeneratedProtocolMessageType('OpDef', (_message.Message,), dict( + + ArgDef = _reflection.GeneratedProtocolMessageType('ArgDef', (_message.Message,), dict( + DESCRIPTOR = _OPDEF_ARGDEF, + __module__ = 'diplomacy_tensorflow.core.framework.op_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDef.ArgDef) + )) + , + + AttrDef = _reflection.GeneratedProtocolMessageType('AttrDef', (_message.Message,), dict( + DESCRIPTOR = _OPDEF_ATTRDEF, + __module__ = 'diplomacy_tensorflow.core.framework.op_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDef.AttrDef) + )) + , + DESCRIPTOR = _OPDEF, + __module__ = 'diplomacy_tensorflow.core.framework.op_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDef) + )) +_sym_db.RegisterMessage(OpDef) +_sym_db.RegisterMessage(OpDef.ArgDef) +_sym_db.RegisterMessage(OpDef.AttrDef) + +OpDeprecation = _reflection.GeneratedProtocolMessageType('OpDeprecation', (_message.Message,), dict( + DESCRIPTOR = _OPDEPRECATION, + __module__ = 'diplomacy_tensorflow.core.framework.op_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpDeprecation) + )) +_sym_db.RegisterMessage(OpDeprecation) + +OpList = _reflection.GeneratedProtocolMessageType('OpList', (_message.Message,), dict( + DESCRIPTOR = _OPLIST, + __module__ = 'diplomacy_tensorflow.core.framework.op_def_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpList) + )) +_sym_db.RegisterMessage(OpList) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.pb.cc new file mode 100644 index 0000000..30d99ee --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.pb.cc @@ -0,0 +1,509 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/reader_base.proto + +#include "diplomacy_tensorflow/core/framework/reader_base.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +class ReaderBaseStateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ReaderBaseState_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto { +static void InitDefaultsReaderBaseState() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ReaderBaseState_default_instance_; + new (ptr) ::diplomacy::tensorflow::ReaderBaseState(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ReaderBaseState::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ReaderBaseState = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsReaderBaseState}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_ReaderBaseState.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ReaderBaseState, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ReaderBaseState, work_started_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ReaderBaseState, work_finished_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ReaderBaseState, num_records_produced_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ReaderBaseState, current_work_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::ReaderBaseState)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_ReaderBaseState_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/reader_base.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n5diplomacy_tensorflow/core/framework/re" + "ader_base.proto\022\024diplomacy.tensorflow\"r\n" + "\017ReaderBaseState\022\024\n\014work_started\030\001 \001(\003\022\025" + "\n\rwork_finished\030\002 \001(\003\022\034\n\024num_records_pro" + "duced\030\003 \001(\003\022\024\n\014current_work\030\004 \001(\014Bp\n\030org" + ".tensorflow.frameworkB\020ReaderBaseProtosP" + "\001Z=github.com/tensorflow/tensorflow/tens" + "orflow/go/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 315); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/reader_base.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void ReaderBaseState::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ReaderBaseState::kWorkStartedFieldNumber; +const int ReaderBaseState::kWorkFinishedFieldNumber; +const int ReaderBaseState::kNumRecordsProducedFieldNumber; +const int ReaderBaseState::kCurrentWorkFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ReaderBaseState::ReaderBaseState() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::scc_info_ReaderBaseState.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ReaderBaseState) +} +ReaderBaseState::ReaderBaseState(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::scc_info_ReaderBaseState.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ReaderBaseState) +} +ReaderBaseState::ReaderBaseState(const ReaderBaseState& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + current_work_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.current_work().size() > 0) { + current_work_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.current_work(), + GetArenaNoVirtual()); + } + ::memcpy(&work_started_, &from.work_started_, + static_cast(reinterpret_cast(&num_records_produced_) - + reinterpret_cast(&work_started_)) + sizeof(num_records_produced_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ReaderBaseState) +} + +void ReaderBaseState::SharedCtor() { + current_work_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&work_started_, 0, static_cast( + reinterpret_cast(&num_records_produced_) - + reinterpret_cast(&work_started_)) + sizeof(num_records_produced_)); +} + +ReaderBaseState::~ReaderBaseState() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ReaderBaseState) + SharedDtor(); +} + +void ReaderBaseState::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + current_work_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ReaderBaseState::ArenaDtor(void* object) { + ReaderBaseState* _this = reinterpret_cast< ReaderBaseState* >(object); + (void)_this; +} +void ReaderBaseState::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ReaderBaseState::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ReaderBaseState::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ReaderBaseState& ReaderBaseState::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::scc_info_ReaderBaseState.base); + return *internal_default_instance(); +} + + +void ReaderBaseState::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ReaderBaseState) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + current_work_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&work_started_, 0, static_cast( + reinterpret_cast(&num_records_produced_) - + reinterpret_cast(&work_started_)) + sizeof(num_records_produced_)); + _internal_metadata_.Clear(); +} + +bool ReaderBaseState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ReaderBaseState) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 work_started = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &work_started_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 work_finished = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &work_finished_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 num_records_produced = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_records_produced_))); + } else { + goto handle_unusual; + } + break; + } + + // bytes current_work = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_current_work())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ReaderBaseState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ReaderBaseState) + return false; +#undef DO_ +} + +void ReaderBaseState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ReaderBaseState) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 work_started = 1; + if (this->work_started() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->work_started(), output); + } + + // int64 work_finished = 2; + if (this->work_finished() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->work_finished(), output); + } + + // int64 num_records_produced = 3; + if (this->num_records_produced() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->num_records_produced(), output); + } + + // bytes current_work = 4; + if (this->current_work().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->current_work(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ReaderBaseState) +} + +::google::protobuf::uint8* ReaderBaseState::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ReaderBaseState) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 work_started = 1; + if (this->work_started() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->work_started(), target); + } + + // int64 work_finished = 2; + if (this->work_finished() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->work_finished(), target); + } + + // int64 num_records_produced = 3; + if (this->num_records_produced() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->num_records_produced(), target); + } + + // bytes current_work = 4; + if (this->current_work().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->current_work(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ReaderBaseState) + return target; +} + +size_t ReaderBaseState::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ReaderBaseState) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // bytes current_work = 4; + if (this->current_work().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->current_work()); + } + + // int64 work_started = 1; + if (this->work_started() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->work_started()); + } + + // int64 work_finished = 2; + if (this->work_finished() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->work_finished()); + } + + // int64 num_records_produced = 3; + if (this->num_records_produced() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_records_produced()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ReaderBaseState::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ReaderBaseState) + GOOGLE_DCHECK_NE(&from, this); + const ReaderBaseState* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ReaderBaseState) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ReaderBaseState) + MergeFrom(*source); + } +} + +void ReaderBaseState::MergeFrom(const ReaderBaseState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ReaderBaseState) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.current_work().size() > 0) { + set_current_work(from.current_work()); + } + if (from.work_started() != 0) { + set_work_started(from.work_started()); + } + if (from.work_finished() != 0) { + set_work_finished(from.work_finished()); + } + if (from.num_records_produced() != 0) { + set_num_records_produced(from.num_records_produced()); + } +} + +void ReaderBaseState::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ReaderBaseState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReaderBaseState::CopyFrom(const ReaderBaseState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ReaderBaseState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReaderBaseState::IsInitialized() const { + return true; +} + +void ReaderBaseState::Swap(ReaderBaseState* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ReaderBaseState* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ReaderBaseState::UnsafeArenaSwap(ReaderBaseState* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ReaderBaseState::InternalSwap(ReaderBaseState* other) { + using std::swap; + current_work_.Swap(&other->current_work_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(work_started_, other->work_started_); + swap(work_finished_, other->work_finished_); + swap(num_records_produced_, other->num_records_produced_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ReaderBaseState::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ReaderBaseState* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ReaderBaseState >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ReaderBaseState >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.pb.h new file mode 100644 index 0000000..99ac9a3 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.pb.h @@ -0,0 +1,358 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/reader_base.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto +namespace diplomacy { +namespace tensorflow { +class ReaderBaseState; +class ReaderBaseStateDefaultTypeInternal; +extern ReaderBaseStateDefaultTypeInternal _ReaderBaseState_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::ReaderBaseState* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ReaderBaseState>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class ReaderBaseState : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ReaderBaseState) */ { + public: + ReaderBaseState(); + virtual ~ReaderBaseState(); + + ReaderBaseState(const ReaderBaseState& from); + + inline ReaderBaseState& operator=(const ReaderBaseState& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ReaderBaseState(ReaderBaseState&& from) noexcept + : ReaderBaseState() { + *this = ::std::move(from); + } + + inline ReaderBaseState& operator=(ReaderBaseState&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ReaderBaseState& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ReaderBaseState* internal_default_instance() { + return reinterpret_cast( + &_ReaderBaseState_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(ReaderBaseState* other); + void Swap(ReaderBaseState* other); + friend void swap(ReaderBaseState& a, ReaderBaseState& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ReaderBaseState* New() const final { + return CreateMaybeMessage(NULL); + } + + ReaderBaseState* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ReaderBaseState& from); + void MergeFrom(const ReaderBaseState& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ReaderBaseState* other); + protected: + explicit ReaderBaseState(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // bytes current_work = 4; + void clear_current_work(); + static const int kCurrentWorkFieldNumber = 4; + const ::std::string& current_work() const; + void set_current_work(const ::std::string& value); + #if LANG_CXX11 + void set_current_work(::std::string&& value); + #endif + void set_current_work(const char* value); + void set_current_work(const void* value, size_t size); + ::std::string* mutable_current_work(); + ::std::string* release_current_work(); + void set_allocated_current_work(::std::string* current_work); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_current_work(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_current_work( + ::std::string* current_work); + + // int64 work_started = 1; + void clear_work_started(); + static const int kWorkStartedFieldNumber = 1; + ::google::protobuf::int64 work_started() const; + void set_work_started(::google::protobuf::int64 value); + + // int64 work_finished = 2; + void clear_work_finished(); + static const int kWorkFinishedFieldNumber = 2; + ::google::protobuf::int64 work_finished() const; + void set_work_finished(::google::protobuf::int64 value); + + // int64 num_records_produced = 3; + void clear_num_records_produced(); + static const int kNumRecordsProducedFieldNumber = 3; + ::google::protobuf::int64 num_records_produced() const; + void set_num_records_produced(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ReaderBaseState) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr current_work_; + ::google::protobuf::int64 work_started_; + ::google::protobuf::int64 work_finished_; + ::google::protobuf::int64 num_records_produced_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ReaderBaseState + +// int64 work_started = 1; +inline void ReaderBaseState::clear_work_started() { + work_started_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ReaderBaseState::work_started() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ReaderBaseState.work_started) + return work_started_; +} +inline void ReaderBaseState::set_work_started(::google::protobuf::int64 value) { + + work_started_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ReaderBaseState.work_started) +} + +// int64 work_finished = 2; +inline void ReaderBaseState::clear_work_finished() { + work_finished_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ReaderBaseState::work_finished() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ReaderBaseState.work_finished) + return work_finished_; +} +inline void ReaderBaseState::set_work_finished(::google::protobuf::int64 value) { + + work_finished_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ReaderBaseState.work_finished) +} + +// int64 num_records_produced = 3; +inline void ReaderBaseState::clear_num_records_produced() { + num_records_produced_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 ReaderBaseState::num_records_produced() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ReaderBaseState.num_records_produced) + return num_records_produced_; +} +inline void ReaderBaseState::set_num_records_produced(::google::protobuf::int64 value) { + + num_records_produced_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ReaderBaseState.num_records_produced) +} + +// bytes current_work = 4; +inline void ReaderBaseState::clear_current_work() { + current_work_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ReaderBaseState::current_work() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ReaderBaseState.current_work) + return current_work_.Get(); +} +inline void ReaderBaseState::set_current_work(const ::std::string& value) { + + current_work_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ReaderBaseState.current_work) +} +#if LANG_CXX11 +inline void ReaderBaseState::set_current_work(::std::string&& value) { + + current_work_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ReaderBaseState.current_work) +} +#endif +inline void ReaderBaseState::set_current_work(const char* value) { + GOOGLE_DCHECK(value != NULL); + + current_work_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ReaderBaseState.current_work) +} +inline void ReaderBaseState::set_current_work(const void* value, + size_t size) { + + current_work_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ReaderBaseState.current_work) +} +inline ::std::string* ReaderBaseState::mutable_current_work() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ReaderBaseState.current_work) + return current_work_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ReaderBaseState::release_current_work() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ReaderBaseState.current_work) + + return current_work_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ReaderBaseState::set_allocated_current_work(::std::string* current_work) { + if (current_work != NULL) { + + } else { + + } + current_work_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), current_work, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ReaderBaseState.current_work) +} +inline ::std::string* ReaderBaseState::unsafe_arena_release_current_work() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ReaderBaseState.current_work) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return current_work_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ReaderBaseState::unsafe_arena_set_allocated_current_work( + ::std::string* current_work) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (current_work != NULL) { + + } else { + + } + current_work_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + current_work, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ReaderBaseState.current_work) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2freader_5fbase_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.proto new file mode 100644 index 0000000..d2aea5a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "ReaderBaseProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +// For serializing and restoring the state of ReaderBase, see +// reader_base.h for details. +message ReaderBaseState { + int64 work_started = 1; + int64 work_finished = 2; + int64 num_records_produced = 3; + bytes current_work = 4; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base_pb2.py new file mode 100644 index 0000000..5153bad --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/reader_base_pb2.py @@ -0,0 +1,91 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/reader_base.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/reader_base.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\020ReaderBaseProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n5diplomacy_tensorflow/core/framework/reader_base.proto\x12\x14\x64iplomacy.tensorflow\"r\n\x0fReaderBaseState\x12\x14\n\x0cwork_started\x18\x01 \x01(\x03\x12\x15\n\rwork_finished\x18\x02 \x01(\x03\x12\x1c\n\x14num_records_produced\x18\x03 \x01(\x03\x12\x14\n\x0c\x63urrent_work\x18\x04 \x01(\x0c\x42p\n\x18org.tensorflow.frameworkB\x10ReaderBaseProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_READERBASESTATE = _descriptor.Descriptor( + name='ReaderBaseState', + full_name='diplomacy.tensorflow.ReaderBaseState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='work_started', full_name='diplomacy.tensorflow.ReaderBaseState.work_started', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='work_finished', full_name='diplomacy.tensorflow.ReaderBaseState.work_finished', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_records_produced', full_name='diplomacy.tensorflow.ReaderBaseState.num_records_produced', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='current_work', full_name='diplomacy.tensorflow.ReaderBaseState.current_work', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=79, + serialized_end=193, +) + +DESCRIPTOR.message_types_by_name['ReaderBaseState'] = _READERBASESTATE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ReaderBaseState = _reflection.GeneratedProtocolMessageType('ReaderBaseState', (_message.Message,), dict( + DESCRIPTOR = _READERBASESTATE, + __module__ = 'diplomacy_tensorflow.core.framework.reader_base_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ReaderBaseState) + )) +_sym_db.RegisterMessage(ReaderBaseState) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.pb.cc new file mode 100644 index 0000000..bb0c1af --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.pb.cc @@ -0,0 +1,1104 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto + +#include "diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_GraphDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class RemoteFusedGraphExecuteInfo_TensorShapeTypeProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_default_instance_; +class RemoteFusedGraphExecuteInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _RemoteFusedGraphExecuteInfo_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto { +static void InitDefaultsRemoteFusedGraphExecuteInfo_TensorShapeTypeProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsRemoteFusedGraphExecuteInfo_TensorShapeTypeProto}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base,}}; + +static void InitDefaultsRemoteFusedGraphExecuteInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_RemoteFusedGraphExecuteInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_RemoteFusedGraphExecuteInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsRemoteFusedGraphExecuteInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::scc_info_GraphDef.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::scc_info_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_RemoteFusedGraphExecuteInfo.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto, dtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto, shape_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, remote_graph_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, graph_input_node_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, graph_output_node_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, executor_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, serialized_executor_parameters_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, default_graph_input_tensor_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo, default_graph_output_tensor_shape_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto)}, + { 7, -1, sizeof(::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_RemoteFusedGraphExecuteInfo_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nIdiplomacy_tensorflow/core/framework/re" + "mote_fused_graph_execute_info.proto\022\024dip" + "lomacy.tensorflow\032/diplomacy_tensorflow/" + "core/framework/graph.proto\0326diplomacy_te" + "nsorflow/core/framework/tensor_shape.pro" + "to\032/diplomacy_tensorflow/core/framework/" + "types.proto\"\264\004\n\033RemoteFusedGraphExecuteI" + "nfo\0224\n\014remote_graph\030\001 \001(\0132\036.diplomacy.te" + "nsorflow.GraphDef\022\035\n\025graph_input_node_na" + "me\030\002 \003(\t\022\036\n\026graph_output_node_name\030\003 \003(\t" + "\022\025\n\rexecutor_name\030\004 \001(\t\022&\n\036serialized_ex" + "ecutor_parameters\030\005 \001(\014\022p\n default_graph" + "_input_tensor_shape\030\006 \003(\0132F.diplomacy.te" + "nsorflow.RemoteFusedGraphExecuteInfo.Ten" + "sorShapeTypeProto\022q\n!default_graph_outpu" + "t_tensor_shape\030\007 \003(\0132F.diplomacy.tensorf" + "low.RemoteFusedGraphExecuteInfo.TensorSh" + "apeTypeProto\032|\n\024TensorShapeTypeProto\022-\n\005" + "dtype\030\001 \001(\0162\036.diplomacy.tensorflow.DataT" + "ype\0225\n\005shape\030\002 \001(\0132&.diplomacy.tensorflo" + "w.TensorShapeProtoB\200\001\n\030org.tensorflow.fr" + "ameworkB RemoteFusedGraphExecuteInfoProt" + "oP\001Z=github.com/tensorflow/tensorflow/te" + "nsorflow/go/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 957); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fgraph_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_default_instance_._instance.get_mutable()->shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); +} +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.shape) +} +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::kDtypeFieldNumber; +const int RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::kShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::scc_info_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) +} +RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::scc_info_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) +} +RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape()) { + shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + dtype_ = from.dtype_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::SharedCtor() { + ::memset(&shape_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&shape_)) + sizeof(dtype_)); +} + +RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::~RemoteFusedGraphExecuteInfo_TensorShapeTypeProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + SharedDtor(); +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete shape_; +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::ArenaDtor(void* object) { + RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* _this = reinterpret_cast< RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* >(object); + (void)_this; +} +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::scc_info_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto.base); + return *internal_default_instance(); +} + + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + dtype_ = 0; + _internal_metadata_.Clear(); +} + +bool RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.DataType dtype = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + return false; +#undef DO_ +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->dtype(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) +} + +::google::protobuf::uint8* RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->dtype(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + return target; +} + +size_t RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + GOOGLE_DCHECK_NE(&from, this); + const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + MergeFrom(*source); + } +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::MergeFrom(const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_shape()) { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::CopyFrom(const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::IsInitialized() const { + return true; +} + +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::Swap(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::UnsafeArenaSwap(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::InternalSwap(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* other) { + using std::swap; + swap(shape_, other->shape_); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void RemoteFusedGraphExecuteInfo::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_RemoteFusedGraphExecuteInfo_default_instance_._instance.get_mutable()->remote_graph_ = const_cast< ::diplomacy::tensorflow::GraphDef*>( + ::diplomacy::tensorflow::GraphDef::internal_default_instance()); +} +void RemoteFusedGraphExecuteInfo::unsafe_arena_set_allocated_remote_graph( + ::diplomacy::tensorflow::GraphDef* remote_graph) { + if (GetArenaNoVirtual() == NULL) { + delete remote_graph_; + } + remote_graph_ = remote_graph; + if (remote_graph) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.remote_graph) +} +void RemoteFusedGraphExecuteInfo::clear_remote_graph() { + if (GetArenaNoVirtual() == NULL && remote_graph_ != NULL) { + delete remote_graph_; + } + remote_graph_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RemoteFusedGraphExecuteInfo::kRemoteGraphFieldNumber; +const int RemoteFusedGraphExecuteInfo::kGraphInputNodeNameFieldNumber; +const int RemoteFusedGraphExecuteInfo::kGraphOutputNodeNameFieldNumber; +const int RemoteFusedGraphExecuteInfo::kExecutorNameFieldNumber; +const int RemoteFusedGraphExecuteInfo::kSerializedExecutorParametersFieldNumber; +const int RemoteFusedGraphExecuteInfo::kDefaultGraphInputTensorShapeFieldNumber; +const int RemoteFusedGraphExecuteInfo::kDefaultGraphOutputTensorShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RemoteFusedGraphExecuteInfo::RemoteFusedGraphExecuteInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::scc_info_RemoteFusedGraphExecuteInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) +} +RemoteFusedGraphExecuteInfo::RemoteFusedGraphExecuteInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + graph_input_node_name_(arena), + graph_output_node_name_(arena), + default_graph_input_tensor_shape_(arena), + default_graph_output_tensor_shape_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::scc_info_RemoteFusedGraphExecuteInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) +} +RemoteFusedGraphExecuteInfo::RemoteFusedGraphExecuteInfo(const RemoteFusedGraphExecuteInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + graph_input_node_name_(from.graph_input_node_name_), + graph_output_node_name_(from.graph_output_node_name_), + default_graph_input_tensor_shape_(from.default_graph_input_tensor_shape_), + default_graph_output_tensor_shape_(from.default_graph_output_tensor_shape_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + executor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.executor_name().size() > 0) { + executor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.executor_name(), + GetArenaNoVirtual()); + } + serialized_executor_parameters_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.serialized_executor_parameters().size() > 0) { + serialized_executor_parameters_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialized_executor_parameters(), + GetArenaNoVirtual()); + } + if (from.has_remote_graph()) { + remote_graph_ = new ::diplomacy::tensorflow::GraphDef(*from.remote_graph_); + } else { + remote_graph_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) +} + +void RemoteFusedGraphExecuteInfo::SharedCtor() { + executor_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + serialized_executor_parameters_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + remote_graph_ = NULL; +} + +RemoteFusedGraphExecuteInfo::~RemoteFusedGraphExecuteInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + SharedDtor(); +} + +void RemoteFusedGraphExecuteInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + executor_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + serialized_executor_parameters_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete remote_graph_; +} + +void RemoteFusedGraphExecuteInfo::ArenaDtor(void* object) { + RemoteFusedGraphExecuteInfo* _this = reinterpret_cast< RemoteFusedGraphExecuteInfo* >(object); + (void)_this; +} +void RemoteFusedGraphExecuteInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void RemoteFusedGraphExecuteInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* RemoteFusedGraphExecuteInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const RemoteFusedGraphExecuteInfo& RemoteFusedGraphExecuteInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::scc_info_RemoteFusedGraphExecuteInfo.base); + return *internal_default_instance(); +} + + +void RemoteFusedGraphExecuteInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + graph_input_node_name_.Clear(); + graph_output_node_name_.Clear(); + default_graph_input_tensor_shape_.Clear(); + default_graph_output_tensor_shape_.Clear(); + executor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + serialized_executor_parameters_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && remote_graph_ != NULL) { + delete remote_graph_; + } + remote_graph_ = NULL; + _internal_metadata_.Clear(); +} + +bool RemoteFusedGraphExecuteInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.GraphDef remote_graph = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_remote_graph())); + } else { + goto handle_unusual; + } + break; + } + + // repeated string graph_input_node_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_graph_input_node_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_input_node_name(this->graph_input_node_name_size() - 1).data(), + static_cast(this->graph_input_node_name(this->graph_input_node_name_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated string graph_output_node_name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_graph_output_node_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_output_node_name(this->graph_output_node_name_size() - 1).data(), + static_cast(this->graph_output_node_name(this->graph_output_node_name_size() - 1).length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name")); + } else { + goto handle_unusual; + } + break; + } + + // string executor_name = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_executor_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->executor_name().data(), static_cast(this->executor_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name")); + } else { + goto handle_unusual; + } + break; + } + + // bytes serialized_executor_parameters = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_serialized_executor_parameters())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_default_graph_input_tensor_shape())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_default_graph_output_tensor_shape())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + return false; +#undef DO_ +} + +void RemoteFusedGraphExecuteInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.GraphDef remote_graph = 1; + if (this->has_remote_graph()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_remote_graph(), output); + } + + // repeated string graph_input_node_name = 2; + for (int i = 0, n = this->graph_input_node_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_input_node_name(i).data(), static_cast(this->graph_input_node_name(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->graph_input_node_name(i), output); + } + + // repeated string graph_output_node_name = 3; + for (int i = 0, n = this->graph_output_node_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_output_node_name(i).data(), static_cast(this->graph_output_node_name(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->graph_output_node_name(i), output); + } + + // string executor_name = 4; + if (this->executor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->executor_name().data(), static_cast(this->executor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->executor_name(), output); + } + + // bytes serialized_executor_parameters = 5; + if (this->serialized_executor_parameters().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 5, this->serialized_executor_parameters(), output); + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; + for (unsigned int i = 0, + n = static_cast(this->default_graph_input_tensor_shape_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, + this->default_graph_input_tensor_shape(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; + for (unsigned int i = 0, + n = static_cast(this->default_graph_output_tensor_shape_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, + this->default_graph_output_tensor_shape(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) +} + +::google::protobuf::uint8* RemoteFusedGraphExecuteInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.GraphDef remote_graph = 1; + if (this->has_remote_graph()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_remote_graph(), deterministic, target); + } + + // repeated string graph_input_node_name = 2; + for (int i = 0, n = this->graph_input_node_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_input_node_name(i).data(), static_cast(this->graph_input_node_name(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(2, this->graph_input_node_name(i), target); + } + + // repeated string graph_output_node_name = 3; + for (int i = 0, n = this->graph_output_node_name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->graph_output_node_name(i).data(), static_cast(this->graph_output_node_name(i).length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->graph_output_node_name(i), target); + } + + // string executor_name = 4; + if (this->executor_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->executor_name().data(), static_cast(this->executor_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->executor_name(), target); + } + + // bytes serialized_executor_parameters = 5; + if (this->serialized_executor_parameters().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 5, this->serialized_executor_parameters(), target); + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; + for (unsigned int i = 0, + n = static_cast(this->default_graph_input_tensor_shape_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->default_graph_input_tensor_shape(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; + for (unsigned int i = 0, + n = static_cast(this->default_graph_output_tensor_shape_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->default_graph_output_tensor_shape(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + return target; +} + +size_t RemoteFusedGraphExecuteInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated string graph_input_node_name = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->graph_input_node_name_size()); + for (int i = 0, n = this->graph_input_node_name_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->graph_input_node_name(i)); + } + + // repeated string graph_output_node_name = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->graph_output_node_name_size()); + for (int i = 0, n = this->graph_output_node_name_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->graph_output_node_name(i)); + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; + { + unsigned int count = static_cast(this->default_graph_input_tensor_shape_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->default_graph_input_tensor_shape(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; + { + unsigned int count = static_cast(this->default_graph_output_tensor_shape_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->default_graph_output_tensor_shape(static_cast(i))); + } + } + + // string executor_name = 4; + if (this->executor_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->executor_name()); + } + + // bytes serialized_executor_parameters = 5; + if (this->serialized_executor_parameters().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->serialized_executor_parameters()); + } + + // .diplomacy.tensorflow.GraphDef remote_graph = 1; + if (this->has_remote_graph()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *remote_graph_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void RemoteFusedGraphExecuteInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + GOOGLE_DCHECK_NE(&from, this); + const RemoteFusedGraphExecuteInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + MergeFrom(*source); + } +} + +void RemoteFusedGraphExecuteInfo::MergeFrom(const RemoteFusedGraphExecuteInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + graph_input_node_name_.MergeFrom(from.graph_input_node_name_); + graph_output_node_name_.MergeFrom(from.graph_output_node_name_); + default_graph_input_tensor_shape_.MergeFrom(from.default_graph_input_tensor_shape_); + default_graph_output_tensor_shape_.MergeFrom(from.default_graph_output_tensor_shape_); + if (from.executor_name().size() > 0) { + set_executor_name(from.executor_name()); + } + if (from.serialized_executor_parameters().size() > 0) { + set_serialized_executor_parameters(from.serialized_executor_parameters()); + } + if (from.has_remote_graph()) { + mutable_remote_graph()->::diplomacy::tensorflow::GraphDef::MergeFrom(from.remote_graph()); + } +} + +void RemoteFusedGraphExecuteInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RemoteFusedGraphExecuteInfo::CopyFrom(const RemoteFusedGraphExecuteInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RemoteFusedGraphExecuteInfo::IsInitialized() const { + return true; +} + +void RemoteFusedGraphExecuteInfo::Swap(RemoteFusedGraphExecuteInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + RemoteFusedGraphExecuteInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void RemoteFusedGraphExecuteInfo::UnsafeArenaSwap(RemoteFusedGraphExecuteInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void RemoteFusedGraphExecuteInfo::InternalSwap(RemoteFusedGraphExecuteInfo* other) { + using std::swap; + graph_input_node_name_.InternalSwap(CastToBase(&other->graph_input_node_name_)); + graph_output_node_name_.InternalSwap(CastToBase(&other->graph_output_node_name_)); + CastToBase(&default_graph_input_tensor_shape_)->InternalSwap(CastToBase(&other->default_graph_input_tensor_shape_)); + CastToBase(&default_graph_output_tensor_shape_)->InternalSwap(CastToBase(&other->default_graph_output_tensor_shape_)); + executor_name_.Swap(&other->executor_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + serialized_executor_parameters_.Swap(&other->serialized_executor_parameters_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(remote_graph_, other->remote_graph_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata RemoteFusedGraphExecuteInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.pb.h new file mode 100644 index 0000000..b37d65c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.pb.h @@ -0,0 +1,961 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/graph.pb.h" +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto +namespace diplomacy { +namespace tensorflow { +class RemoteFusedGraphExecuteInfo; +class RemoteFusedGraphExecuteInfoDefaultTypeInternal; +extern RemoteFusedGraphExecuteInfoDefaultTypeInternal _RemoteFusedGraphExecuteInfo_default_instance_; +class RemoteFusedGraphExecuteInfo_TensorShapeTypeProto; +class RemoteFusedGraphExecuteInfo_TensorShapeTypeProtoDefaultTypeInternal; +extern RemoteFusedGraphExecuteInfo_TensorShapeTypeProtoDefaultTypeInternal _RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo>(Arena*); +template<> ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class RemoteFusedGraphExecuteInfo_TensorShapeTypeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) */ { + public: + RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(); + virtual ~RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(); + + RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& from); + + inline RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& operator=(const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto&& from) noexcept + : RemoteFusedGraphExecuteInfo_TensorShapeTypeProto() { + *this = ::std::move(from); + } + + inline RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& operator=(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* internal_default_instance() { + return reinterpret_cast( + &_RemoteFusedGraphExecuteInfo_TensorShapeTypeProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* other); + void Swap(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* other); + friend void swap(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& a, RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* New() const final { + return CreateMaybeMessage(NULL); + } + + RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& from); + void MergeFrom(const RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* other); + protected: + explicit RemoteFusedGraphExecuteInfo_TensorShapeTypeProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // .diplomacy.tensorflow.DataType dtype = 1; + void clear_dtype(); + static const int kDtypeFieldNumber = 1; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class RemoteFusedGraphExecuteInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) */ { + public: + RemoteFusedGraphExecuteInfo(); + virtual ~RemoteFusedGraphExecuteInfo(); + + RemoteFusedGraphExecuteInfo(const RemoteFusedGraphExecuteInfo& from); + + inline RemoteFusedGraphExecuteInfo& operator=(const RemoteFusedGraphExecuteInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + RemoteFusedGraphExecuteInfo(RemoteFusedGraphExecuteInfo&& from) noexcept + : RemoteFusedGraphExecuteInfo() { + *this = ::std::move(from); + } + + inline RemoteFusedGraphExecuteInfo& operator=(RemoteFusedGraphExecuteInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const RemoteFusedGraphExecuteInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const RemoteFusedGraphExecuteInfo* internal_default_instance() { + return reinterpret_cast( + &_RemoteFusedGraphExecuteInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(RemoteFusedGraphExecuteInfo* other); + void Swap(RemoteFusedGraphExecuteInfo* other); + friend void swap(RemoteFusedGraphExecuteInfo& a, RemoteFusedGraphExecuteInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline RemoteFusedGraphExecuteInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + RemoteFusedGraphExecuteInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const RemoteFusedGraphExecuteInfo& from); + void MergeFrom(const RemoteFusedGraphExecuteInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RemoteFusedGraphExecuteInfo* other); + protected: + explicit RemoteFusedGraphExecuteInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef RemoteFusedGraphExecuteInfo_TensorShapeTypeProto TensorShapeTypeProto; + + // accessors ------------------------------------------------------- + + // repeated string graph_input_node_name = 2; + int graph_input_node_name_size() const; + void clear_graph_input_node_name(); + static const int kGraphInputNodeNameFieldNumber = 2; + const ::std::string& graph_input_node_name(int index) const; + ::std::string* mutable_graph_input_node_name(int index); + void set_graph_input_node_name(int index, const ::std::string& value); + #if LANG_CXX11 + void set_graph_input_node_name(int index, ::std::string&& value); + #endif + void set_graph_input_node_name(int index, const char* value); + void set_graph_input_node_name(int index, const char* value, size_t size); + ::std::string* add_graph_input_node_name(); + void add_graph_input_node_name(const ::std::string& value); + #if LANG_CXX11 + void add_graph_input_node_name(::std::string&& value); + #endif + void add_graph_input_node_name(const char* value); + void add_graph_input_node_name(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& graph_input_node_name() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_graph_input_node_name(); + + // repeated string graph_output_node_name = 3; + int graph_output_node_name_size() const; + void clear_graph_output_node_name(); + static const int kGraphOutputNodeNameFieldNumber = 3; + const ::std::string& graph_output_node_name(int index) const; + ::std::string* mutable_graph_output_node_name(int index); + void set_graph_output_node_name(int index, const ::std::string& value); + #if LANG_CXX11 + void set_graph_output_node_name(int index, ::std::string&& value); + #endif + void set_graph_output_node_name(int index, const char* value); + void set_graph_output_node_name(int index, const char* value, size_t size); + ::std::string* add_graph_output_node_name(); + void add_graph_output_node_name(const ::std::string& value); + #if LANG_CXX11 + void add_graph_output_node_name(::std::string&& value); + #endif + void add_graph_output_node_name(const char* value); + void add_graph_output_node_name(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& graph_output_node_name() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_graph_output_node_name(); + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; + int default_graph_input_tensor_shape_size() const; + void clear_default_graph_input_tensor_shape(); + static const int kDefaultGraphInputTensorShapeFieldNumber = 6; + ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* mutable_default_graph_input_tensor_shape(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >* + mutable_default_graph_input_tensor_shape(); + const ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& default_graph_input_tensor_shape(int index) const; + ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* add_default_graph_input_tensor_shape(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >& + default_graph_input_tensor_shape() const; + + // repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; + int default_graph_output_tensor_shape_size() const; + void clear_default_graph_output_tensor_shape(); + static const int kDefaultGraphOutputTensorShapeFieldNumber = 7; + ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* mutable_default_graph_output_tensor_shape(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >* + mutable_default_graph_output_tensor_shape(); + const ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& default_graph_output_tensor_shape(int index) const; + ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* add_default_graph_output_tensor_shape(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >& + default_graph_output_tensor_shape() const; + + // string executor_name = 4; + void clear_executor_name(); + static const int kExecutorNameFieldNumber = 4; + const ::std::string& executor_name() const; + void set_executor_name(const ::std::string& value); + #if LANG_CXX11 + void set_executor_name(::std::string&& value); + #endif + void set_executor_name(const char* value); + void set_executor_name(const char* value, size_t size); + ::std::string* mutable_executor_name(); + ::std::string* release_executor_name(); + void set_allocated_executor_name(::std::string* executor_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_executor_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_executor_name( + ::std::string* executor_name); + + // bytes serialized_executor_parameters = 5; + void clear_serialized_executor_parameters(); + static const int kSerializedExecutorParametersFieldNumber = 5; + const ::std::string& serialized_executor_parameters() const; + void set_serialized_executor_parameters(const ::std::string& value); + #if LANG_CXX11 + void set_serialized_executor_parameters(::std::string&& value); + #endif + void set_serialized_executor_parameters(const char* value); + void set_serialized_executor_parameters(const void* value, size_t size); + ::std::string* mutable_serialized_executor_parameters(); + ::std::string* release_serialized_executor_parameters(); + void set_allocated_serialized_executor_parameters(::std::string* serialized_executor_parameters); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_serialized_executor_parameters(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_serialized_executor_parameters( + ::std::string* serialized_executor_parameters); + + // .diplomacy.tensorflow.GraphDef remote_graph = 1; + bool has_remote_graph() const; + void clear_remote_graph(); + static const int kRemoteGraphFieldNumber = 1; + private: + const ::diplomacy::tensorflow::GraphDef& _internal_remote_graph() const; + public: + const ::diplomacy::tensorflow::GraphDef& remote_graph() const; + ::diplomacy::tensorflow::GraphDef* release_remote_graph(); + ::diplomacy::tensorflow::GraphDef* mutable_remote_graph(); + void set_allocated_remote_graph(::diplomacy::tensorflow::GraphDef* remote_graph); + void unsafe_arena_set_allocated_remote_graph( + ::diplomacy::tensorflow::GraphDef* remote_graph); + ::diplomacy::tensorflow::GraphDef* unsafe_arena_release_remote_graph(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> graph_input_node_name_; + ::google::protobuf::RepeatedPtrField< ::std::string> graph_output_node_name_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto > default_graph_input_tensor_shape_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto > default_graph_output_tensor_shape_; + ::google::protobuf::internal::ArenaStringPtr executor_name_; + ::google::protobuf::internal::ArenaStringPtr serialized_executor_parameters_; + ::diplomacy::tensorflow::GraphDef* remote_graph_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// RemoteFusedGraphExecuteInfo_TensorShapeTypeProto + +// .diplomacy.tensorflow.DataType dtype = 1; +inline void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.dtype) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 2; +inline bool RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::_internal_shape() const { + return *shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.shape) + return shape_; +} +inline void RemoteFusedGraphExecuteInfo_TensorShapeTypeProto::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.shape) +} + +// ------------------------------------------------------------------- + +// RemoteFusedGraphExecuteInfo + +// .diplomacy.tensorflow.GraphDef remote_graph = 1; +inline bool RemoteFusedGraphExecuteInfo::has_remote_graph() const { + return this != internal_default_instance() && remote_graph_ != NULL; +} +inline const ::diplomacy::tensorflow::GraphDef& RemoteFusedGraphExecuteInfo::_internal_remote_graph() const { + return *remote_graph_; +} +inline const ::diplomacy::tensorflow::GraphDef& RemoteFusedGraphExecuteInfo::remote_graph() const { + const ::diplomacy::tensorflow::GraphDef* p = remote_graph_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.remote_graph) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_GraphDef_default_instance_); +} +inline ::diplomacy::tensorflow::GraphDef* RemoteFusedGraphExecuteInfo::release_remote_graph() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.remote_graph) + + ::diplomacy::tensorflow::GraphDef* temp = remote_graph_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + remote_graph_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::GraphDef* RemoteFusedGraphExecuteInfo::unsafe_arena_release_remote_graph() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.remote_graph) + + ::diplomacy::tensorflow::GraphDef* temp = remote_graph_; + remote_graph_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::GraphDef* RemoteFusedGraphExecuteInfo::mutable_remote_graph() { + + if (remote_graph_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::GraphDef>(GetArenaNoVirtual()); + remote_graph_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.remote_graph) + return remote_graph_; +} +inline void RemoteFusedGraphExecuteInfo::set_allocated_remote_graph(::diplomacy::tensorflow::GraphDef* remote_graph) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(remote_graph_); + } + if (remote_graph) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(remote_graph)->GetArena(); + if (message_arena != submessage_arena) { + remote_graph = ::google::protobuf::internal::GetOwnedMessage( + message_arena, remote_graph, submessage_arena); + } + + } else { + + } + remote_graph_ = remote_graph; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.remote_graph) +} + +// repeated string graph_input_node_name = 2; +inline int RemoteFusedGraphExecuteInfo::graph_input_node_name_size() const { + return graph_input_node_name_.size(); +} +inline void RemoteFusedGraphExecuteInfo::clear_graph_input_node_name() { + graph_input_node_name_.Clear(); +} +inline const ::std::string& RemoteFusedGraphExecuteInfo::graph_input_node_name(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) + return graph_input_node_name_.Get(index); +} +inline ::std::string* RemoteFusedGraphExecuteInfo::mutable_graph_input_node_name(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) + return graph_input_node_name_.Mutable(index); +} +inline void RemoteFusedGraphExecuteInfo::set_graph_input_node_name(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) + graph_input_node_name_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void RemoteFusedGraphExecuteInfo::set_graph_input_node_name(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) + graph_input_node_name_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void RemoteFusedGraphExecuteInfo::set_graph_input_node_name(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + graph_input_node_name_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) +} +inline void RemoteFusedGraphExecuteInfo::set_graph_input_node_name(int index, const char* value, size_t size) { + graph_input_node_name_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) +} +inline ::std::string* RemoteFusedGraphExecuteInfo::add_graph_input_node_name() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) + return graph_input_node_name_.Add(); +} +inline void RemoteFusedGraphExecuteInfo::add_graph_input_node_name(const ::std::string& value) { + graph_input_node_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) +} +#if LANG_CXX11 +inline void RemoteFusedGraphExecuteInfo::add_graph_input_node_name(::std::string&& value) { + graph_input_node_name_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) +} +#endif +inline void RemoteFusedGraphExecuteInfo::add_graph_input_node_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + graph_input_node_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) +} +inline void RemoteFusedGraphExecuteInfo::add_graph_input_node_name(const char* value, size_t size) { + graph_input_node_name_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +RemoteFusedGraphExecuteInfo::graph_input_node_name() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) + return graph_input_node_name_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +RemoteFusedGraphExecuteInfo::mutable_graph_input_node_name() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name) + return &graph_input_node_name_; +} + +// repeated string graph_output_node_name = 3; +inline int RemoteFusedGraphExecuteInfo::graph_output_node_name_size() const { + return graph_output_node_name_.size(); +} +inline void RemoteFusedGraphExecuteInfo::clear_graph_output_node_name() { + graph_output_node_name_.Clear(); +} +inline const ::std::string& RemoteFusedGraphExecuteInfo::graph_output_node_name(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) + return graph_output_node_name_.Get(index); +} +inline ::std::string* RemoteFusedGraphExecuteInfo::mutable_graph_output_node_name(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) + return graph_output_node_name_.Mutable(index); +} +inline void RemoteFusedGraphExecuteInfo::set_graph_output_node_name(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) + graph_output_node_name_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void RemoteFusedGraphExecuteInfo::set_graph_output_node_name(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) + graph_output_node_name_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void RemoteFusedGraphExecuteInfo::set_graph_output_node_name(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + graph_output_node_name_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) +} +inline void RemoteFusedGraphExecuteInfo::set_graph_output_node_name(int index, const char* value, size_t size) { + graph_output_node_name_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) +} +inline ::std::string* RemoteFusedGraphExecuteInfo::add_graph_output_node_name() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) + return graph_output_node_name_.Add(); +} +inline void RemoteFusedGraphExecuteInfo::add_graph_output_node_name(const ::std::string& value) { + graph_output_node_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) +} +#if LANG_CXX11 +inline void RemoteFusedGraphExecuteInfo::add_graph_output_node_name(::std::string&& value) { + graph_output_node_name_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) +} +#endif +inline void RemoteFusedGraphExecuteInfo::add_graph_output_node_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + graph_output_node_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) +} +inline void RemoteFusedGraphExecuteInfo::add_graph_output_node_name(const char* value, size_t size) { + graph_output_node_name_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +RemoteFusedGraphExecuteInfo::graph_output_node_name() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) + return graph_output_node_name_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +RemoteFusedGraphExecuteInfo::mutable_graph_output_node_name() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name) + return &graph_output_node_name_; +} + +// string executor_name = 4; +inline void RemoteFusedGraphExecuteInfo::clear_executor_name() { + executor_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& RemoteFusedGraphExecuteInfo::executor_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) + return executor_name_.Get(); +} +inline void RemoteFusedGraphExecuteInfo::set_executor_name(const ::std::string& value) { + + executor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) +} +#if LANG_CXX11 +inline void RemoteFusedGraphExecuteInfo::set_executor_name(::std::string&& value) { + + executor_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) +} +#endif +inline void RemoteFusedGraphExecuteInfo::set_executor_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + executor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) +} +inline void RemoteFusedGraphExecuteInfo::set_executor_name(const char* value, + size_t size) { + + executor_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) +} +inline ::std::string* RemoteFusedGraphExecuteInfo::mutable_executor_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) + return executor_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* RemoteFusedGraphExecuteInfo::release_executor_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) + + return executor_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void RemoteFusedGraphExecuteInfo::set_allocated_executor_name(::std::string* executor_name) { + if (executor_name != NULL) { + + } else { + + } + executor_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), executor_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) +} +inline ::std::string* RemoteFusedGraphExecuteInfo::unsafe_arena_release_executor_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return executor_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void RemoteFusedGraphExecuteInfo::unsafe_arena_set_allocated_executor_name( + ::std::string* executor_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (executor_name != NULL) { + + } else { + + } + executor_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + executor_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name) +} + +// bytes serialized_executor_parameters = 5; +inline void RemoteFusedGraphExecuteInfo::clear_serialized_executor_parameters() { + serialized_executor_parameters_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& RemoteFusedGraphExecuteInfo::serialized_executor_parameters() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) + return serialized_executor_parameters_.Get(); +} +inline void RemoteFusedGraphExecuteInfo::set_serialized_executor_parameters(const ::std::string& value) { + + serialized_executor_parameters_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) +} +#if LANG_CXX11 +inline void RemoteFusedGraphExecuteInfo::set_serialized_executor_parameters(::std::string&& value) { + + serialized_executor_parameters_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) +} +#endif +inline void RemoteFusedGraphExecuteInfo::set_serialized_executor_parameters(const char* value) { + GOOGLE_DCHECK(value != NULL); + + serialized_executor_parameters_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) +} +inline void RemoteFusedGraphExecuteInfo::set_serialized_executor_parameters(const void* value, + size_t size) { + + serialized_executor_parameters_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) +} +inline ::std::string* RemoteFusedGraphExecuteInfo::mutable_serialized_executor_parameters() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) + return serialized_executor_parameters_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* RemoteFusedGraphExecuteInfo::release_serialized_executor_parameters() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) + + return serialized_executor_parameters_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void RemoteFusedGraphExecuteInfo::set_allocated_serialized_executor_parameters(::std::string* serialized_executor_parameters) { + if (serialized_executor_parameters != NULL) { + + } else { + + } + serialized_executor_parameters_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialized_executor_parameters, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) +} +inline ::std::string* RemoteFusedGraphExecuteInfo::unsafe_arena_release_serialized_executor_parameters() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return serialized_executor_parameters_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void RemoteFusedGraphExecuteInfo::unsafe_arena_set_allocated_serialized_executor_parameters( + ::std::string* serialized_executor_parameters) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (serialized_executor_parameters != NULL) { + + } else { + + } + serialized_executor_parameters_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + serialized_executor_parameters, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters) +} + +// repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_input_tensor_shape = 6; +inline int RemoteFusedGraphExecuteInfo::default_graph_input_tensor_shape_size() const { + return default_graph_input_tensor_shape_.size(); +} +inline void RemoteFusedGraphExecuteInfo::clear_default_graph_input_tensor_shape() { + default_graph_input_tensor_shape_.Clear(); +} +inline ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* RemoteFusedGraphExecuteInfo::mutable_default_graph_input_tensor_shape(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_input_tensor_shape) + return default_graph_input_tensor_shape_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >* +RemoteFusedGraphExecuteInfo::mutable_default_graph_input_tensor_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_input_tensor_shape) + return &default_graph_input_tensor_shape_; +} +inline const ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& RemoteFusedGraphExecuteInfo::default_graph_input_tensor_shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_input_tensor_shape) + return default_graph_input_tensor_shape_.Get(index); +} +inline ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* RemoteFusedGraphExecuteInfo::add_default_graph_input_tensor_shape() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_input_tensor_shape) + return default_graph_input_tensor_shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >& +RemoteFusedGraphExecuteInfo::default_graph_input_tensor_shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_input_tensor_shape) + return default_graph_input_tensor_shape_; +} + +// repeated .diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto default_graph_output_tensor_shape = 7; +inline int RemoteFusedGraphExecuteInfo::default_graph_output_tensor_shape_size() const { + return default_graph_output_tensor_shape_.size(); +} +inline void RemoteFusedGraphExecuteInfo::clear_default_graph_output_tensor_shape() { + default_graph_output_tensor_shape_.Clear(); +} +inline ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* RemoteFusedGraphExecuteInfo::mutable_default_graph_output_tensor_shape(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_output_tensor_shape) + return default_graph_output_tensor_shape_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >* +RemoteFusedGraphExecuteInfo::mutable_default_graph_output_tensor_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_output_tensor_shape) + return &default_graph_output_tensor_shape_; +} +inline const ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto& RemoteFusedGraphExecuteInfo::default_graph_output_tensor_shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_output_tensor_shape) + return default_graph_output_tensor_shape_.Get(index); +} +inline ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto* RemoteFusedGraphExecuteInfo::add_default_graph_output_tensor_shape() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_output_tensor_shape) + return default_graph_output_tensor_shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::RemoteFusedGraphExecuteInfo_TensorShapeTypeProto >& +RemoteFusedGraphExecuteInfo::default_graph_output_tensor_shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_output_tensor_shape) + return default_graph_output_tensor_shape_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fremote_5ffused_5fgraph_5fexecute_5finfo_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto new file mode 100644 index 0000000..1d3c2ed --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "RemoteFusedGraphExecuteInfoProto"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/graph.proto"; +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +// 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. +message RemoteFusedGraphExecuteInfo { + + message TensorShapeTypeProto { + DataType dtype = 1; + TensorShapeProto shape = 2; + } + + // Definition of remote graph + GraphDef remote_graph = 1; + + // Remote fused graph input node name + repeated string graph_input_node_name = 2; + + // Remote fused graph output node name + repeated string graph_output_node_name = 3; + + // Executor's name + string executor_name = 4; + + // Optional: Parameters given to the executor + bytes serialized_executor_parameters = 5; + + // Optional: Default graph input tensor shape used to allocate memory + // before executing op + repeated TensorShapeTypeProto default_graph_input_tensor_shape = 6; + + // Optional: Default graph input tensor shape used to allocate memory + // before executing op + // TODO(satok): Remote output tensor shape once shape information is stored + // in NodeDef + repeated TensorShapeTypeProto default_graph_output_tensor_shape = 7; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info_pb2.py new file mode 100644 index 0000000..83e19d7 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info_pb2.py @@ -0,0 +1,167 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import graph_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_graph__pb2 +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB RemoteFusedGraphExecuteInfoProtoP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\nIdiplomacy_tensorflow/core/framework/remote_fused_graph_execute_info.proto\x12\x14\x64iplomacy.tensorflow\x1a/diplomacy_tensorflow/core/framework/graph.proto\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\"\xb4\x04\n\x1bRemoteFusedGraphExecuteInfo\x12\x34\n\x0cremote_graph\x18\x01 \x01(\x0b\x32\x1e.diplomacy.tensorflow.GraphDef\x12\x1d\n\x15graph_input_node_name\x18\x02 \x03(\t\x12\x1e\n\x16graph_output_node_name\x18\x03 \x03(\t\x12\x15\n\rexecutor_name\x18\x04 \x01(\t\x12&\n\x1eserialized_executor_parameters\x18\x05 \x01(\x0c\x12p\n default_graph_input_tensor_shape\x18\x06 \x03(\x0b\x32\x46.diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto\x12q\n!default_graph_output_tensor_shape\x18\x07 \x03(\x0b\x32\x46.diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto\x1a|\n\x14TensorShapeTypeProto\x12-\n\x05\x64type\x18\x01 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\x12\x35\n\x05shape\x18\x02 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProtoB\x80\x01\n\x18org.tensorflow.frameworkB RemoteFusedGraphExecuteInfoProtoP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_graph__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,]) + + + + +_REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO = _descriptor.Descriptor( + name='TensorShapeTypeProto', + full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.dtype', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto.shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=694, + serialized_end=818, +) + +_REMOTEFUSEDGRAPHEXECUTEINFO = _descriptor.Descriptor( + name='RemoteFusedGraphExecuteInfo', + full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='remote_graph', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.remote_graph', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph_input_node_name', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_input_node_name', index=1, + number=2, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph_output_node_name', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.graph_output_node_name', index=2, + number=3, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='executor_name', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.executor_name', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='serialized_executor_parameters', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.serialized_executor_parameters', index=4, + number=5, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default_graph_input_tensor_shape', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_input_tensor_shape', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default_graph_output_tensor_shape', full_name='diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.default_graph_output_tensor_shape', index=6, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=254, + serialized_end=818, +) + +_REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO.containing_type = _REMOTEFUSEDGRAPHEXECUTEINFO +_REMOTEFUSEDGRAPHEXECUTEINFO.fields_by_name['remote_graph'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_graph__pb2._GRAPHDEF +_REMOTEFUSEDGRAPHEXECUTEINFO.fields_by_name['default_graph_input_tensor_shape'].message_type = _REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO +_REMOTEFUSEDGRAPHEXECUTEINFO.fields_by_name['default_graph_output_tensor_shape'].message_type = _REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO +DESCRIPTOR.message_types_by_name['RemoteFusedGraphExecuteInfo'] = _REMOTEFUSEDGRAPHEXECUTEINFO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +RemoteFusedGraphExecuteInfo = _reflection.GeneratedProtocolMessageType('RemoteFusedGraphExecuteInfo', (_message.Message,), dict( + + TensorShapeTypeProto = _reflection.GeneratedProtocolMessageType('TensorShapeTypeProto', (_message.Message,), dict( + DESCRIPTOR = _REMOTEFUSEDGRAPHEXECUTEINFO_TENSORSHAPETYPEPROTO, + __module__ = 'diplomacy_tensorflow.core.framework.remote_fused_graph_execute_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + )) + , + DESCRIPTOR = _REMOTEFUSEDGRAPHEXECUTEINFO, + __module__ = 'diplomacy_tensorflow.core.framework.remote_fused_graph_execute_info_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.RemoteFusedGraphExecuteInfo) + )) +_sym_db.RegisterMessage(RemoteFusedGraphExecuteInfo) +_sym_db.RegisterMessage(RemoteFusedGraphExecuteInfo.TensorShapeTypeProto) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.pb.cc new file mode 100644 index 0000000..d3eafcc --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.pb.cc @@ -0,0 +1,618 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/resource_handle.proto + +#include "diplomacy_tensorflow/core/framework/resource_handle.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +class ResourceHandleProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ResourceHandleProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto { +static void InitDefaultsResourceHandleProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_ResourceHandleProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::ResourceHandleProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::ResourceHandleProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_ResourceHandleProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsResourceHandleProto}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_ResourceHandleProto.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ResourceHandleProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ResourceHandleProto, device_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ResourceHandleProto, container_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ResourceHandleProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ResourceHandleProto, hash_code_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::ResourceHandleProto, maybe_type_name_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::ResourceHandleProto)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_ResourceHandleProto_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/resource_handle.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n9diplomacy_tensorflow/core/framework/re" + "source_handle.proto\022\024diplomacy.tensorflo" + "w\"r\n\023ResourceHandleProto\022\016\n\006device\030\001 \001(\t" + "\022\021\n\tcontainer\030\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\021\n\thas" + "h_code\030\004 \001(\004\022\027\n\017maybe_type_name\030\005 \001(\tBn\n" + "\030org.tensorflow.frameworkB\016ResourceHandl" + "eP\001Z=github.com/tensorflow/tensorflow/te" + "nsorflow/go/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 317); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/resource_handle.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void ResourceHandleProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ResourceHandleProto::kDeviceFieldNumber; +const int ResourceHandleProto::kContainerFieldNumber; +const int ResourceHandleProto::kNameFieldNumber; +const int ResourceHandleProto::kHashCodeFieldNumber; +const int ResourceHandleProto::kMaybeTypeNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ResourceHandleProto::ResourceHandleProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::scc_info_ResourceHandleProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.ResourceHandleProto) +} +ResourceHandleProto::ResourceHandleProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::scc_info_ResourceHandleProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.ResourceHandleProto) +} +ResourceHandleProto::ResourceHandleProto(const ResourceHandleProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.device().size() > 0) { + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device(), + GetArenaNoVirtual()); + } + container_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.container().size() > 0) { + container_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.container(), + GetArenaNoVirtual()); + } + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + maybe_type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.maybe_type_name().size() > 0) { + maybe_type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.maybe_type_name(), + GetArenaNoVirtual()); + } + hash_code_ = from.hash_code_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.ResourceHandleProto) +} + +void ResourceHandleProto::SharedCtor() { + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + container_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + maybe_type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + hash_code_ = GOOGLE_ULONGLONG(0); +} + +ResourceHandleProto::~ResourceHandleProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.ResourceHandleProto) + SharedDtor(); +} + +void ResourceHandleProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + device_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + container_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + maybe_type_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ResourceHandleProto::ArenaDtor(void* object) { + ResourceHandleProto* _this = reinterpret_cast< ResourceHandleProto* >(object); + (void)_this; +} +void ResourceHandleProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void ResourceHandleProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* ResourceHandleProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const ResourceHandleProto& ResourceHandleProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::scc_info_ResourceHandleProto.base); + return *internal_default_instance(); +} + + +void ResourceHandleProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.ResourceHandleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + container_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + maybe_type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + hash_code_ = GOOGLE_ULONGLONG(0); + _internal_metadata_.Clear(); +} + +bool ResourceHandleProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.ResourceHandleProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string device = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ResourceHandleProto.device")); + } else { + goto handle_unusual; + } + break; + } + + // string container = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_container())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->container().data(), static_cast(this->container().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ResourceHandleProto.container")); + } else { + goto handle_unusual; + } + break; + } + + // string name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ResourceHandleProto.name")); + } else { + goto handle_unusual; + } + break; + } + + // uint64 hash_code = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &hash_code_))); + } else { + goto handle_unusual; + } + break; + } + + // string maybe_type_name = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_maybe_type_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->maybe_type_name().data(), static_cast(this->maybe_type_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.ResourceHandleProto.maybe_type_name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.ResourceHandleProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.ResourceHandleProto) + return false; +#undef DO_ +} + +void ResourceHandleProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.ResourceHandleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string device = 1; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.device"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->device(), output); + } + + // string container = 2; + if (this->container().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->container().data(), static_cast(this->container().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.container"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->container(), output); + } + + // string name = 3; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->name(), output); + } + + // uint64 hash_code = 4; + if (this->hash_code() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->hash_code(), output); + } + + // string maybe_type_name = 5; + if (this->maybe_type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->maybe_type_name().data(), static_cast(this->maybe_type_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.maybe_type_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->maybe_type_name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.ResourceHandleProto) +} + +::google::protobuf::uint8* ResourceHandleProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.ResourceHandleProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string device = 1; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.device"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->device(), target); + } + + // string container = 2; + if (this->container().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->container().data(), static_cast(this->container().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.container"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->container(), target); + } + + // string name = 3; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->name(), target); + } + + // uint64 hash_code = 4; + if (this->hash_code() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->hash_code(), target); + } + + // string maybe_type_name = 5; + if (this->maybe_type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->maybe_type_name().data(), static_cast(this->maybe_type_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.ResourceHandleProto.maybe_type_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->maybe_type_name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.ResourceHandleProto) + return target; +} + +size_t ResourceHandleProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.ResourceHandleProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string device = 1; + if (this->device().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device()); + } + + // string container = 2; + if (this->container().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->container()); + } + + // string name = 3; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // string maybe_type_name = 5; + if (this->maybe_type_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->maybe_type_name()); + } + + // uint64 hash_code = 4; + if (this->hash_code() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->hash_code()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ResourceHandleProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.ResourceHandleProto) + GOOGLE_DCHECK_NE(&from, this); + const ResourceHandleProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.ResourceHandleProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.ResourceHandleProto) + MergeFrom(*source); + } +} + +void ResourceHandleProto::MergeFrom(const ResourceHandleProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.ResourceHandleProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.device().size() > 0) { + set_device(from.device()); + } + if (from.container().size() > 0) { + set_container(from.container()); + } + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.maybe_type_name().size() > 0) { + set_maybe_type_name(from.maybe_type_name()); + } + if (from.hash_code() != 0) { + set_hash_code(from.hash_code()); + } +} + +void ResourceHandleProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.ResourceHandleProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ResourceHandleProto::CopyFrom(const ResourceHandleProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.ResourceHandleProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ResourceHandleProto::IsInitialized() const { + return true; +} + +void ResourceHandleProto::Swap(ResourceHandleProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + ResourceHandleProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void ResourceHandleProto::UnsafeArenaSwap(ResourceHandleProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void ResourceHandleProto::InternalSwap(ResourceHandleProto* other) { + using std::swap; + device_.Swap(&other->device_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + container_.Swap(&other->container_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + maybe_type_name_.Swap(&other->maybe_type_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(hash_code_, other->hash_code_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata ResourceHandleProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::ResourceHandleProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::ResourceHandleProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::ResourceHandleProto >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.pb.h new file mode 100644 index 0000000..6544b98 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.pb.h @@ -0,0 +1,613 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/resource_handle.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto +namespace diplomacy { +namespace tensorflow { +class ResourceHandleProto; +class ResourceHandleProtoDefaultTypeInternal; +extern ResourceHandleProtoDefaultTypeInternal _ResourceHandleProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::ResourceHandleProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::ResourceHandleProto>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class ResourceHandleProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.ResourceHandleProto) */ { + public: + ResourceHandleProto(); + virtual ~ResourceHandleProto(); + + ResourceHandleProto(const ResourceHandleProto& from); + + inline ResourceHandleProto& operator=(const ResourceHandleProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + ResourceHandleProto(ResourceHandleProto&& from) noexcept + : ResourceHandleProto() { + *this = ::std::move(from); + } + + inline ResourceHandleProto& operator=(ResourceHandleProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const ResourceHandleProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ResourceHandleProto* internal_default_instance() { + return reinterpret_cast( + &_ResourceHandleProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(ResourceHandleProto* other); + void Swap(ResourceHandleProto* other); + friend void swap(ResourceHandleProto& a, ResourceHandleProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline ResourceHandleProto* New() const final { + return CreateMaybeMessage(NULL); + } + + ResourceHandleProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const ResourceHandleProto& from); + void MergeFrom(const ResourceHandleProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ResourceHandleProto* other); + protected: + explicit ResourceHandleProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string device = 1; + void clear_device(); + static const int kDeviceFieldNumber = 1; + const ::std::string& device() const; + void set_device(const ::std::string& value); + #if LANG_CXX11 + void set_device(::std::string&& value); + #endif + void set_device(const char* value); + void set_device(const char* value, size_t size); + ::std::string* mutable_device(); + ::std::string* release_device(); + void set_allocated_device(::std::string* device); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_device(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_device( + ::std::string* device); + + // string container = 2; + void clear_container(); + static const int kContainerFieldNumber = 2; + const ::std::string& container() const; + void set_container(const ::std::string& value); + #if LANG_CXX11 + void set_container(::std::string&& value); + #endif + void set_container(const char* value); + void set_container(const char* value, size_t size); + ::std::string* mutable_container(); + ::std::string* release_container(); + void set_allocated_container(::std::string* container); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_container(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_container( + ::std::string* container); + + // string name = 3; + void clear_name(); + static const int kNameFieldNumber = 3; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // string maybe_type_name = 5; + void clear_maybe_type_name(); + static const int kMaybeTypeNameFieldNumber = 5; + const ::std::string& maybe_type_name() const; + void set_maybe_type_name(const ::std::string& value); + #if LANG_CXX11 + void set_maybe_type_name(::std::string&& value); + #endif + void set_maybe_type_name(const char* value); + void set_maybe_type_name(const char* value, size_t size); + ::std::string* mutable_maybe_type_name(); + ::std::string* release_maybe_type_name(); + void set_allocated_maybe_type_name(::std::string* maybe_type_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_maybe_type_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_maybe_type_name( + ::std::string* maybe_type_name); + + // uint64 hash_code = 4; + void clear_hash_code(); + static const int kHashCodeFieldNumber = 4; + ::google::protobuf::uint64 hash_code() const; + void set_hash_code(::google::protobuf::uint64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ResourceHandleProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr device_; + ::google::protobuf::internal::ArenaStringPtr container_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr maybe_type_name_; + ::google::protobuf::uint64 hash_code_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ResourceHandleProto + +// string device = 1; +inline void ResourceHandleProto::clear_device() { + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ResourceHandleProto::device() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ResourceHandleProto.device) + return device_.Get(); +} +inline void ResourceHandleProto::set_device(const ::std::string& value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ResourceHandleProto.device) +} +#if LANG_CXX11 +inline void ResourceHandleProto::set_device(::std::string&& value) { + + device_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ResourceHandleProto.device) +} +#endif +inline void ResourceHandleProto::set_device(const char* value) { + GOOGLE_DCHECK(value != NULL); + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ResourceHandleProto.device) +} +inline void ResourceHandleProto::set_device(const char* value, + size_t size) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ResourceHandleProto.device) +} +inline ::std::string* ResourceHandleProto::mutable_device() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ResourceHandleProto.device) + return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ResourceHandleProto::release_device() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ResourceHandleProto.device) + + return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ResourceHandleProto::set_allocated_device(::std::string* device) { + if (device != NULL) { + + } else { + + } + device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ResourceHandleProto.device) +} +inline ::std::string* ResourceHandleProto::unsafe_arena_release_device() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ResourceHandleProto.device) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ResourceHandleProto::unsafe_arena_set_allocated_device( + ::std::string* device) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device != NULL) { + + } else { + + } + device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ResourceHandleProto.device) +} + +// string container = 2; +inline void ResourceHandleProto::clear_container() { + container_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ResourceHandleProto::container() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ResourceHandleProto.container) + return container_.Get(); +} +inline void ResourceHandleProto::set_container(const ::std::string& value) { + + container_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ResourceHandleProto.container) +} +#if LANG_CXX11 +inline void ResourceHandleProto::set_container(::std::string&& value) { + + container_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ResourceHandleProto.container) +} +#endif +inline void ResourceHandleProto::set_container(const char* value) { + GOOGLE_DCHECK(value != NULL); + + container_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ResourceHandleProto.container) +} +inline void ResourceHandleProto::set_container(const char* value, + size_t size) { + + container_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ResourceHandleProto.container) +} +inline ::std::string* ResourceHandleProto::mutable_container() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ResourceHandleProto.container) + return container_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ResourceHandleProto::release_container() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ResourceHandleProto.container) + + return container_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ResourceHandleProto::set_allocated_container(::std::string* container) { + if (container != NULL) { + + } else { + + } + container_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), container, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ResourceHandleProto.container) +} +inline ::std::string* ResourceHandleProto::unsafe_arena_release_container() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ResourceHandleProto.container) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return container_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ResourceHandleProto::unsafe_arena_set_allocated_container( + ::std::string* container) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (container != NULL) { + + } else { + + } + container_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + container, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ResourceHandleProto.container) +} + +// string name = 3; +inline void ResourceHandleProto::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ResourceHandleProto::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ResourceHandleProto.name) + return name_.Get(); +} +inline void ResourceHandleProto::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ResourceHandleProto.name) +} +#if LANG_CXX11 +inline void ResourceHandleProto::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ResourceHandleProto.name) +} +#endif +inline void ResourceHandleProto::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ResourceHandleProto.name) +} +inline void ResourceHandleProto::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ResourceHandleProto.name) +} +inline ::std::string* ResourceHandleProto::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ResourceHandleProto.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ResourceHandleProto::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ResourceHandleProto.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ResourceHandleProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ResourceHandleProto.name) +} +inline ::std::string* ResourceHandleProto::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ResourceHandleProto.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ResourceHandleProto::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ResourceHandleProto.name) +} + +// uint64 hash_code = 4; +inline void ResourceHandleProto::clear_hash_code() { + hash_code_ = GOOGLE_ULONGLONG(0); +} +inline ::google::protobuf::uint64 ResourceHandleProto::hash_code() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ResourceHandleProto.hash_code) + return hash_code_; +} +inline void ResourceHandleProto::set_hash_code(::google::protobuf::uint64 value) { + + hash_code_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ResourceHandleProto.hash_code) +} + +// string maybe_type_name = 5; +inline void ResourceHandleProto::clear_maybe_type_name() { + maybe_type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& ResourceHandleProto::maybe_type_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) + return maybe_type_name_.Get(); +} +inline void ResourceHandleProto::set_maybe_type_name(const ::std::string& value) { + + maybe_type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) +} +#if LANG_CXX11 +inline void ResourceHandleProto::set_maybe_type_name(::std::string&& value) { + + maybe_type_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) +} +#endif +inline void ResourceHandleProto::set_maybe_type_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + maybe_type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) +} +inline void ResourceHandleProto::set_maybe_type_name(const char* value, + size_t size) { + + maybe_type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) +} +inline ::std::string* ResourceHandleProto::mutable_maybe_type_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) + return maybe_type_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* ResourceHandleProto::release_maybe_type_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) + + return maybe_type_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void ResourceHandleProto::set_allocated_maybe_type_name(::std::string* maybe_type_name) { + if (maybe_type_name != NULL) { + + } else { + + } + maybe_type_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), maybe_type_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) +} +inline ::std::string* ResourceHandleProto::unsafe_arena_release_maybe_type_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return maybe_type_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void ResourceHandleProto::unsafe_arena_set_allocated_maybe_type_name( + ::std::string* maybe_type_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (maybe_type_name != NULL) { + + } else { + + } + maybe_type_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + maybe_type_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.ResourceHandleProto.maybe_type_name) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.proto new file mode 100644 index 0000000..229c08e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "ResourceHandle"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +// 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. +message ResourceHandleProto { + // Unique name for the device containing the resource. + string device = 1; + + // Container in which this resource is placed. + string container = 2; + + // Unique name of this resource. + string name = 3; + + // Hash code for the type of the resource. Is only valid in the same device + // and in the same execution. + uint64 hash_code = 4; + + // For debug-only, the name of the type pointed to by this handle, if + // available. + string maybe_type_name = 5; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle_pb2.py new file mode 100644 index 0000000..5b4e75e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/resource_handle_pb2.py @@ -0,0 +1,98 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/resource_handle.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/resource_handle.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\016ResourceHandleP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n9diplomacy_tensorflow/core/framework/resource_handle.proto\x12\x14\x64iplomacy.tensorflow\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_RESOURCEHANDLEPROTO = _descriptor.Descriptor( + name='ResourceHandleProto', + full_name='diplomacy.tensorflow.ResourceHandleProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device', full_name='diplomacy.tensorflow.ResourceHandleProto.device', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='container', full_name='diplomacy.tensorflow.ResourceHandleProto.container', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.ResourceHandleProto.name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='hash_code', full_name='diplomacy.tensorflow.ResourceHandleProto.hash_code', index=3, + number=4, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='maybe_type_name', full_name='diplomacy.tensorflow.ResourceHandleProto.maybe_type_name', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=83, + serialized_end=197, +) + +DESCRIPTOR.message_types_by_name['ResourceHandleProto'] = _RESOURCEHANDLEPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ResourceHandleProto = _reflection.GeneratedProtocolMessageType('ResourceHandleProto', (_message.Message,), dict( + DESCRIPTOR = _RESOURCEHANDLEPROTO, + __module__ = 'diplomacy_tensorflow.core.framework.resource_handle_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.ResourceHandleProto) + )) +_sym_db.RegisterMessage(ResourceHandleProto) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.pb.cc new file mode 100644 index 0000000..6193a86 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.pb.cc @@ -0,0 +1,3505 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/step_stats.proto + +#include "diplomacy_tensorflow/core/framework/step_stats.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_AllocationDescription; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_AllocationRecord; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_MemoryStats; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_AllocatorMemoryUsed; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DeviceStepStats; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_NodeOutput; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_NodeExecStats; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorDescription; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto +namespace diplomacy { +namespace tensorflow { +class AllocationRecordDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AllocationRecord_default_instance_; +class AllocatorMemoryUsedDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _AllocatorMemoryUsed_default_instance_; +class NodeOutputDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NodeOutput_default_instance_; +class MemoryStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _MemoryStats_default_instance_; +class NodeExecStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NodeExecStats_default_instance_; +class DeviceStepStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DeviceStepStats_default_instance_; +class StepStatsDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _StepStats_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto { +static void InitDefaultsAllocationRecord() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_AllocationRecord_default_instance_; + new (ptr) ::diplomacy::tensorflow::AllocationRecord(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::AllocationRecord::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_AllocationRecord = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAllocationRecord}, {}}; + +static void InitDefaultsAllocatorMemoryUsed() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_AllocatorMemoryUsed_default_instance_; + new (ptr) ::diplomacy::tensorflow::AllocatorMemoryUsed(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::AllocatorMemoryUsed::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_AllocatorMemoryUsed = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsAllocatorMemoryUsed}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocationRecord.base,}}; + +static void InitDefaultsNodeOutput() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NodeOutput_default_instance_; + new (ptr) ::diplomacy::tensorflow::NodeOutput(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::NodeOutput::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_NodeOutput = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNodeOutput}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::scc_info_TensorDescription.base,}}; + +static void InitDefaultsMemoryStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_MemoryStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::MemoryStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::MemoryStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_MemoryStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMemoryStats}, {}}; + +static void InitDefaultsNodeExecStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NodeExecStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::NodeExecStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::NodeExecStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_NodeExecStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsNodeExecStats}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocatorMemoryUsed.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeOutput.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::scc_info_AllocationDescription.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_MemoryStats.base,}}; + +static void InitDefaultsDeviceStepStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_DeviceStepStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::DeviceStepStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::DeviceStepStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_DeviceStepStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsDeviceStepStats}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeExecStats.base,}}; + +static void InitDefaultsStepStats() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_StepStats_default_instance_; + new (ptr) ::diplomacy::tensorflow::StepStats(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::StepStats::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_StepStats = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsStepStats}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_DeviceStepStats.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_AllocationRecord.base); + ::google::protobuf::internal::InitSCC(&scc_info_AllocatorMemoryUsed.base); + ::google::protobuf::internal::InitSCC(&scc_info_NodeOutput.base); + ::google::protobuf::internal::InitSCC(&scc_info_MemoryStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_NodeExecStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_DeviceStepStats.base); + ::google::protobuf::internal::InitSCC(&scc_info_StepStats.base); +} + +::google::protobuf::Metadata file_level_metadata[7]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationRecord, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationRecord, alloc_micros_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocationRecord, alloc_bytes_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocatorMemoryUsed, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocatorMemoryUsed, allocator_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocatorMemoryUsed, total_bytes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocatorMemoryUsed, peak_bytes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocatorMemoryUsed, live_bytes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocatorMemoryUsed, allocation_records_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::AllocatorMemoryUsed, allocator_bytes_in_use_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeOutput, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeOutput, slot_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeOutput, tensor_description_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryStats, temp_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryStats, persistent_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryStats, persistent_tensor_alloc_ids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryStats, device_temp_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryStats, device_persistent_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::MemoryStats, device_persistent_tensor_alloc_ids_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, node_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, all_start_micros_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, op_start_rel_micros_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, op_end_rel_micros_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, all_end_rel_micros_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, memory_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, timeline_label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, scheduled_micros_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, thread_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, referenced_tensor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, memory_stats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, all_start_nanos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, op_start_rel_nanos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, op_end_rel_nanos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, all_end_rel_nanos_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NodeExecStats, scheduled_nanos_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceStepStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceStepStats, device_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::DeviceStepStats, node_stats_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::StepStats, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::StepStats, dev_stats_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::AllocationRecord)}, + { 7, -1, sizeof(::diplomacy::tensorflow::AllocatorMemoryUsed)}, + { 18, -1, sizeof(::diplomacy::tensorflow::NodeOutput)}, + { 25, -1, sizeof(::diplomacy::tensorflow::MemoryStats)}, + { 36, -1, sizeof(::diplomacy::tensorflow::NodeExecStats)}, + { 58, -1, sizeof(::diplomacy::tensorflow::DeviceStepStats)}, + { 65, -1, sizeof(::diplomacy::tensorflow::StepStats)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_AllocationRecord_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_AllocatorMemoryUsed_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NodeOutput_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_MemoryStats_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NodeExecStats_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_DeviceStepStats_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_StepStats_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/step_stats.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n4diplomacy_tensorflow/core/framework/st" + "ep_stats.proto\022\024diplomacy.tensorflow\032@di" + "plomacy_tensorflow/core/framework/alloca" + "tion_description.proto\032= 1900 +const int AllocationRecord::kAllocMicrosFieldNumber; +const int AllocationRecord::kAllocBytesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AllocationRecord::AllocationRecord() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocationRecord.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.AllocationRecord) +} +AllocationRecord::AllocationRecord(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocationRecord.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.AllocationRecord) +} +AllocationRecord::AllocationRecord(const AllocationRecord& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&alloc_micros_, &from.alloc_micros_, + static_cast(reinterpret_cast(&alloc_bytes_) - + reinterpret_cast(&alloc_micros_)) + sizeof(alloc_bytes_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.AllocationRecord) +} + +void AllocationRecord::SharedCtor() { + ::memset(&alloc_micros_, 0, static_cast( + reinterpret_cast(&alloc_bytes_) - + reinterpret_cast(&alloc_micros_)) + sizeof(alloc_bytes_)); +} + +AllocationRecord::~AllocationRecord() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.AllocationRecord) + SharedDtor(); +} + +void AllocationRecord::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void AllocationRecord::ArenaDtor(void* object) { + AllocationRecord* _this = reinterpret_cast< AllocationRecord* >(object); + (void)_this; +} +void AllocationRecord::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AllocationRecord::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AllocationRecord::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AllocationRecord& AllocationRecord::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocationRecord.base); + return *internal_default_instance(); +} + + +void AllocationRecord::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.AllocationRecord) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&alloc_micros_, 0, static_cast( + reinterpret_cast(&alloc_bytes_) - + reinterpret_cast(&alloc_micros_)) + sizeof(alloc_bytes_)); + _internal_metadata_.Clear(); +} + +bool AllocationRecord::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.AllocationRecord) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 alloc_micros = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &alloc_micros_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 alloc_bytes = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &alloc_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.AllocationRecord) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.AllocationRecord) + return false; +#undef DO_ +} + +void AllocationRecord::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.AllocationRecord) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 alloc_micros = 1; + if (this->alloc_micros() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->alloc_micros(), output); + } + + // int64 alloc_bytes = 2; + if (this->alloc_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->alloc_bytes(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.AllocationRecord) +} + +::google::protobuf::uint8* AllocationRecord::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.AllocationRecord) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 alloc_micros = 1; + if (this->alloc_micros() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->alloc_micros(), target); + } + + // int64 alloc_bytes = 2; + if (this->alloc_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->alloc_bytes(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.AllocationRecord) + return target; +} + +size_t AllocationRecord::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.AllocationRecord) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 alloc_micros = 1; + if (this->alloc_micros() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->alloc_micros()); + } + + // int64 alloc_bytes = 2; + if (this->alloc_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->alloc_bytes()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AllocationRecord::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.AllocationRecord) + GOOGLE_DCHECK_NE(&from, this); + const AllocationRecord* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.AllocationRecord) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.AllocationRecord) + MergeFrom(*source); + } +} + +void AllocationRecord::MergeFrom(const AllocationRecord& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.AllocationRecord) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.alloc_micros() != 0) { + set_alloc_micros(from.alloc_micros()); + } + if (from.alloc_bytes() != 0) { + set_alloc_bytes(from.alloc_bytes()); + } +} + +void AllocationRecord::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.AllocationRecord) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AllocationRecord::CopyFrom(const AllocationRecord& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.AllocationRecord) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AllocationRecord::IsInitialized() const { + return true; +} + +void AllocationRecord::Swap(AllocationRecord* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AllocationRecord* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void AllocationRecord::UnsafeArenaSwap(AllocationRecord* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AllocationRecord::InternalSwap(AllocationRecord* other) { + using std::swap; + swap(alloc_micros_, other->alloc_micros_); + swap(alloc_bytes_, other->alloc_bytes_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AllocationRecord::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void AllocatorMemoryUsed::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AllocatorMemoryUsed::kAllocatorNameFieldNumber; +const int AllocatorMemoryUsed::kTotalBytesFieldNumber; +const int AllocatorMemoryUsed::kPeakBytesFieldNumber; +const int AllocatorMemoryUsed::kLiveBytesFieldNumber; +const int AllocatorMemoryUsed::kAllocationRecordsFieldNumber; +const int AllocatorMemoryUsed::kAllocatorBytesInUseFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AllocatorMemoryUsed::AllocatorMemoryUsed() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocatorMemoryUsed.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.AllocatorMemoryUsed) +} +AllocatorMemoryUsed::AllocatorMemoryUsed(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + allocation_records_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocatorMemoryUsed.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.AllocatorMemoryUsed) +} +AllocatorMemoryUsed::AllocatorMemoryUsed(const AllocatorMemoryUsed& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + allocation_records_(from.allocation_records_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.allocator_name().size() > 0) { + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.allocator_name(), + GetArenaNoVirtual()); + } + ::memcpy(&total_bytes_, &from.total_bytes_, + static_cast(reinterpret_cast(&allocator_bytes_in_use_) - + reinterpret_cast(&total_bytes_)) + sizeof(allocator_bytes_in_use_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.AllocatorMemoryUsed) +} + +void AllocatorMemoryUsed::SharedCtor() { + allocator_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&total_bytes_, 0, static_cast( + reinterpret_cast(&allocator_bytes_in_use_) - + reinterpret_cast(&total_bytes_)) + sizeof(allocator_bytes_in_use_)); +} + +AllocatorMemoryUsed::~AllocatorMemoryUsed() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.AllocatorMemoryUsed) + SharedDtor(); +} + +void AllocatorMemoryUsed::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + allocator_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void AllocatorMemoryUsed::ArenaDtor(void* object) { + AllocatorMemoryUsed* _this = reinterpret_cast< AllocatorMemoryUsed* >(object); + (void)_this; +} +void AllocatorMemoryUsed::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AllocatorMemoryUsed::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* AllocatorMemoryUsed::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const AllocatorMemoryUsed& AllocatorMemoryUsed::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_AllocatorMemoryUsed.base); + return *internal_default_instance(); +} + + +void AllocatorMemoryUsed::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.AllocatorMemoryUsed) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + allocation_records_.Clear(); + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&total_bytes_, 0, static_cast( + reinterpret_cast(&allocator_bytes_in_use_) - + reinterpret_cast(&total_bytes_)) + sizeof(allocator_bytes_in_use_)); + _internal_metadata_.Clear(); +} + +bool AllocatorMemoryUsed::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.AllocatorMemoryUsed) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string allocator_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_allocator_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name")); + } else { + goto handle_unusual; + } + break; + } + + // int64 total_bytes = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &total_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 peak_bytes = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &peak_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 live_bytes = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &live_bytes_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 allocator_bytes_in_use = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &allocator_bytes_in_use_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.AllocationRecord allocation_records = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_allocation_records())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.AllocatorMemoryUsed) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.AllocatorMemoryUsed) + return false; +#undef DO_ +} + +void AllocatorMemoryUsed::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.AllocatorMemoryUsed) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string allocator_name = 1; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->allocator_name(), output); + } + + // int64 total_bytes = 2; + if (this->total_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->total_bytes(), output); + } + + // int64 peak_bytes = 3; + if (this->peak_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->peak_bytes(), output); + } + + // int64 live_bytes = 4; + if (this->live_bytes() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->live_bytes(), output); + } + + // int64 allocator_bytes_in_use = 5; + if (this->allocator_bytes_in_use() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->allocator_bytes_in_use(), output); + } + + // repeated .diplomacy.tensorflow.AllocationRecord allocation_records = 6; + for (unsigned int i = 0, + n = static_cast(this->allocation_records_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, + this->allocation_records(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.AllocatorMemoryUsed) +} + +::google::protobuf::uint8* AllocatorMemoryUsed::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.AllocatorMemoryUsed) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string allocator_name = 1; + if (this->allocator_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->allocator_name().data(), static_cast(this->allocator_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->allocator_name(), target); + } + + // int64 total_bytes = 2; + if (this->total_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->total_bytes(), target); + } + + // int64 peak_bytes = 3; + if (this->peak_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->peak_bytes(), target); + } + + // int64 live_bytes = 4; + if (this->live_bytes() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->live_bytes(), target); + } + + // int64 allocator_bytes_in_use = 5; + if (this->allocator_bytes_in_use() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->allocator_bytes_in_use(), target); + } + + // repeated .diplomacy.tensorflow.AllocationRecord allocation_records = 6; + for (unsigned int i = 0, + n = static_cast(this->allocation_records_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->allocation_records(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.AllocatorMemoryUsed) + return target; +} + +size_t AllocatorMemoryUsed::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.AllocatorMemoryUsed) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.AllocationRecord allocation_records = 6; + { + unsigned int count = static_cast(this->allocation_records_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->allocation_records(static_cast(i))); + } + } + + // string allocator_name = 1; + if (this->allocator_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->allocator_name()); + } + + // int64 total_bytes = 2; + if (this->total_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->total_bytes()); + } + + // int64 peak_bytes = 3; + if (this->peak_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->peak_bytes()); + } + + // int64 live_bytes = 4; + if (this->live_bytes() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->live_bytes()); + } + + // int64 allocator_bytes_in_use = 5; + if (this->allocator_bytes_in_use() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->allocator_bytes_in_use()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AllocatorMemoryUsed::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.AllocatorMemoryUsed) + GOOGLE_DCHECK_NE(&from, this); + const AllocatorMemoryUsed* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.AllocatorMemoryUsed) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.AllocatorMemoryUsed) + MergeFrom(*source); + } +} + +void AllocatorMemoryUsed::MergeFrom(const AllocatorMemoryUsed& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.AllocatorMemoryUsed) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + allocation_records_.MergeFrom(from.allocation_records_); + if (from.allocator_name().size() > 0) { + set_allocator_name(from.allocator_name()); + } + if (from.total_bytes() != 0) { + set_total_bytes(from.total_bytes()); + } + if (from.peak_bytes() != 0) { + set_peak_bytes(from.peak_bytes()); + } + if (from.live_bytes() != 0) { + set_live_bytes(from.live_bytes()); + } + if (from.allocator_bytes_in_use() != 0) { + set_allocator_bytes_in_use(from.allocator_bytes_in_use()); + } +} + +void AllocatorMemoryUsed::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.AllocatorMemoryUsed) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AllocatorMemoryUsed::CopyFrom(const AllocatorMemoryUsed& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.AllocatorMemoryUsed) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AllocatorMemoryUsed::IsInitialized() const { + return true; +} + +void AllocatorMemoryUsed::Swap(AllocatorMemoryUsed* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AllocatorMemoryUsed* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void AllocatorMemoryUsed::UnsafeArenaSwap(AllocatorMemoryUsed* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AllocatorMemoryUsed::InternalSwap(AllocatorMemoryUsed* other) { + using std::swap; + CastToBase(&allocation_records_)->InternalSwap(CastToBase(&other->allocation_records_)); + allocator_name_.Swap(&other->allocator_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(total_bytes_, other->total_bytes_); + swap(peak_bytes_, other->peak_bytes_); + swap(live_bytes_, other->live_bytes_); + swap(allocator_bytes_in_use_, other->allocator_bytes_in_use_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata AllocatorMemoryUsed::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void NodeOutput::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_NodeOutput_default_instance_._instance.get_mutable()->tensor_description_ = const_cast< ::diplomacy::tensorflow::TensorDescription*>( + ::diplomacy::tensorflow::TensorDescription::internal_default_instance()); +} +void NodeOutput::unsafe_arena_set_allocated_tensor_description( + ::diplomacy::tensorflow::TensorDescription* tensor_description) { + if (GetArenaNoVirtual() == NULL) { + delete tensor_description_; + } + tensor_description_ = tensor_description; + if (tensor_description) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeOutput.tensor_description) +} +void NodeOutput::clear_tensor_description() { + if (GetArenaNoVirtual() == NULL && tensor_description_ != NULL) { + delete tensor_description_; + } + tensor_description_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NodeOutput::kSlotFieldNumber; +const int NodeOutput::kTensorDescriptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NodeOutput::NodeOutput() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeOutput.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NodeOutput) +} +NodeOutput::NodeOutput(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeOutput.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.NodeOutput) +} +NodeOutput::NodeOutput(const NodeOutput& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_tensor_description()) { + tensor_description_ = new ::diplomacy::tensorflow::TensorDescription(*from.tensor_description_); + } else { + tensor_description_ = NULL; + } + slot_ = from.slot_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NodeOutput) +} + +void NodeOutput::SharedCtor() { + ::memset(&tensor_description_, 0, static_cast( + reinterpret_cast(&slot_) - + reinterpret_cast(&tensor_description_)) + sizeof(slot_)); +} + +NodeOutput::~NodeOutput() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NodeOutput) + SharedDtor(); +} + +void NodeOutput::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete tensor_description_; +} + +void NodeOutput::ArenaDtor(void* object) { + NodeOutput* _this = reinterpret_cast< NodeOutput* >(object); + (void)_this; +} +void NodeOutput::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NodeOutput::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NodeOutput::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NodeOutput& NodeOutput::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeOutput.base); + return *internal_default_instance(); +} + + +void NodeOutput::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NodeOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && tensor_description_ != NULL) { + delete tensor_description_; + } + tensor_description_ = NULL; + slot_ = 0; + _internal_metadata_.Clear(); +} + +bool NodeOutput::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NodeOutput) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 slot = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &slot_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorDescription tensor_description = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor_description())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NodeOutput) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NodeOutput) + return false; +#undef DO_ +} + +void NodeOutput::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NodeOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 slot = 1; + if (this->slot() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->slot(), output); + } + + // .diplomacy.tensorflow.TensorDescription tensor_description = 3; + if (this->has_tensor_description()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_tensor_description(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NodeOutput) +} + +::google::protobuf::uint8* NodeOutput::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NodeOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 slot = 1; + if (this->slot() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->slot(), target); + } + + // .diplomacy.tensorflow.TensorDescription tensor_description = 3; + if (this->has_tensor_description()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_tensor_description(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NodeOutput) + return target; +} + +size_t NodeOutput::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NodeOutput) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.TensorDescription tensor_description = 3; + if (this->has_tensor_description()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tensor_description_); + } + + // int32 slot = 1; + if (this->slot() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->slot()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NodeOutput::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NodeOutput) + GOOGLE_DCHECK_NE(&from, this); + const NodeOutput* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NodeOutput) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NodeOutput) + MergeFrom(*source); + } +} + +void NodeOutput::MergeFrom(const NodeOutput& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NodeOutput) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_tensor_description()) { + mutable_tensor_description()->::diplomacy::tensorflow::TensorDescription::MergeFrom(from.tensor_description()); + } + if (from.slot() != 0) { + set_slot(from.slot()); + } +} + +void NodeOutput::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NodeOutput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NodeOutput::CopyFrom(const NodeOutput& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NodeOutput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NodeOutput::IsInitialized() const { + return true; +} + +void NodeOutput::Swap(NodeOutput* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NodeOutput* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void NodeOutput::UnsafeArenaSwap(NodeOutput* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NodeOutput::InternalSwap(NodeOutput* other) { + using std::swap; + swap(tensor_description_, other->tensor_description_); + swap(slot_, other->slot_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NodeOutput::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void MemoryStats::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryStats::kTempMemorySizeFieldNumber; +const int MemoryStats::kPersistentMemorySizeFieldNumber; +const int MemoryStats::kPersistentTensorAllocIdsFieldNumber; +const int MemoryStats::kDeviceTempMemorySizeFieldNumber; +const int MemoryStats::kDevicePersistentMemorySizeFieldNumber; +const int MemoryStats::kDevicePersistentTensorAllocIdsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryStats::MemoryStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_MemoryStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.MemoryStats) +} +MemoryStats::MemoryStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + persistent_tensor_alloc_ids_(arena), + device_persistent_tensor_alloc_ids_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_MemoryStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.MemoryStats) +} +MemoryStats::MemoryStats(const MemoryStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + persistent_tensor_alloc_ids_(from.persistent_tensor_alloc_ids_), + device_persistent_tensor_alloc_ids_(from.device_persistent_tensor_alloc_ids_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&temp_memory_size_, &from.temp_memory_size_, + static_cast(reinterpret_cast(&device_persistent_memory_size_) - + reinterpret_cast(&temp_memory_size_)) + sizeof(device_persistent_memory_size_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.MemoryStats) +} + +void MemoryStats::SharedCtor() { + ::memset(&temp_memory_size_, 0, static_cast( + reinterpret_cast(&device_persistent_memory_size_) - + reinterpret_cast(&temp_memory_size_)) + sizeof(device_persistent_memory_size_)); +} + +MemoryStats::~MemoryStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.MemoryStats) + SharedDtor(); +} + +void MemoryStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void MemoryStats::ArenaDtor(void* object) { + MemoryStats* _this = reinterpret_cast< MemoryStats* >(object); + (void)_this; +} +void MemoryStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void MemoryStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* MemoryStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const MemoryStats& MemoryStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_MemoryStats.base); + return *internal_default_instance(); +} + + +void MemoryStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.MemoryStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + persistent_tensor_alloc_ids_.Clear(); + device_persistent_tensor_alloc_ids_.Clear(); + ::memset(&temp_memory_size_, 0, static_cast( + reinterpret_cast(&device_persistent_memory_size_) - + reinterpret_cast(&temp_memory_size_)) + sizeof(device_persistent_memory_size_)); + _internal_metadata_.Clear(); +} + +bool MemoryStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.MemoryStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 temp_memory_size = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &temp_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 device_temp_memory_size = 2 [deprecated = true]; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_temp_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 persistent_memory_size = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &persistent_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 device_persistent_memory_size = 4 [deprecated = true]; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_persistent_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 persistent_tensor_alloc_ids = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_persistent_tensor_alloc_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 42u, input, this->mutable_persistent_tensor_alloc_ids()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_device_persistent_tensor_alloc_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 50u, input, this->mutable_device_persistent_tensor_alloc_ids()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.MemoryStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.MemoryStats) + return false; +#undef DO_ +} + +void MemoryStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.MemoryStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 temp_memory_size = 1; + if (this->temp_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->temp_memory_size(), output); + } + + // int64 device_temp_memory_size = 2 [deprecated = true]; + if (this->device_temp_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->device_temp_memory_size(), output); + } + + // int64 persistent_memory_size = 3; + if (this->persistent_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->persistent_memory_size(), output); + } + + // int64 device_persistent_memory_size = 4 [deprecated = true]; + if (this->device_persistent_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->device_persistent_memory_size(), output); + } + + // repeated int64 persistent_tensor_alloc_ids = 5; + if (this->persistent_tensor_alloc_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _persistent_tensor_alloc_ids_cached_byte_size_)); + } + for (int i = 0, n = this->persistent_tensor_alloc_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->persistent_tensor_alloc_ids(i), output); + } + + // repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + if (this->device_persistent_tensor_alloc_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _device_persistent_tensor_alloc_ids_cached_byte_size_)); + } + for (int i = 0, n = this->device_persistent_tensor_alloc_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->device_persistent_tensor_alloc_ids(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.MemoryStats) +} + +::google::protobuf::uint8* MemoryStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.MemoryStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 temp_memory_size = 1; + if (this->temp_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->temp_memory_size(), target); + } + + // int64 device_temp_memory_size = 2 [deprecated = true]; + if (this->device_temp_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->device_temp_memory_size(), target); + } + + // int64 persistent_memory_size = 3; + if (this->persistent_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->persistent_memory_size(), target); + } + + // int64 device_persistent_memory_size = 4 [deprecated = true]; + if (this->device_persistent_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->device_persistent_memory_size(), target); + } + + // repeated int64 persistent_tensor_alloc_ids = 5; + if (this->persistent_tensor_alloc_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _persistent_tensor_alloc_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->persistent_tensor_alloc_ids_, target); + } + + // repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + if (this->device_persistent_tensor_alloc_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _device_persistent_tensor_alloc_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->device_persistent_tensor_alloc_ids_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.MemoryStats) + return target; +} + +size_t MemoryStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.MemoryStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 persistent_tensor_alloc_ids = 5; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->persistent_tensor_alloc_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _persistent_tensor_alloc_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->device_persistent_tensor_alloc_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _device_persistent_tensor_alloc_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 temp_memory_size = 1; + if (this->temp_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->temp_memory_size()); + } + + // int64 device_temp_memory_size = 2 [deprecated = true]; + if (this->device_temp_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_temp_memory_size()); + } + + // int64 persistent_memory_size = 3; + if (this->persistent_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->persistent_memory_size()); + } + + // int64 device_persistent_memory_size = 4 [deprecated = true]; + if (this->device_persistent_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_persistent_memory_size()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MemoryStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.MemoryStats) + GOOGLE_DCHECK_NE(&from, this); + const MemoryStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.MemoryStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.MemoryStats) + MergeFrom(*source); + } +} + +void MemoryStats::MergeFrom(const MemoryStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.MemoryStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + persistent_tensor_alloc_ids_.MergeFrom(from.persistent_tensor_alloc_ids_); + device_persistent_tensor_alloc_ids_.MergeFrom(from.device_persistent_tensor_alloc_ids_); + if (from.temp_memory_size() != 0) { + set_temp_memory_size(from.temp_memory_size()); + } + if (from.device_temp_memory_size() != 0) { + set_device_temp_memory_size(from.device_temp_memory_size()); + } + if (from.persistent_memory_size() != 0) { + set_persistent_memory_size(from.persistent_memory_size()); + } + if (from.device_persistent_memory_size() != 0) { + set_device_persistent_memory_size(from.device_persistent_memory_size()); + } +} + +void MemoryStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.MemoryStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryStats::CopyFrom(const MemoryStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.MemoryStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryStats::IsInitialized() const { + return true; +} + +void MemoryStats::Swap(MemoryStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + MemoryStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void MemoryStats::UnsafeArenaSwap(MemoryStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void MemoryStats::InternalSwap(MemoryStats* other) { + using std::swap; + persistent_tensor_alloc_ids_.InternalSwap(&other->persistent_tensor_alloc_ids_); + device_persistent_tensor_alloc_ids_.InternalSwap(&other->device_persistent_tensor_alloc_ids_); + swap(temp_memory_size_, other->temp_memory_size_); + swap(device_temp_memory_size_, other->device_temp_memory_size_); + swap(persistent_memory_size_, other->persistent_memory_size_); + swap(device_persistent_memory_size_, other->device_persistent_memory_size_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata MemoryStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void NodeExecStats::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_NodeExecStats_default_instance_._instance.get_mutable()->memory_stats_ = const_cast< ::diplomacy::tensorflow::MemoryStats*>( + ::diplomacy::tensorflow::MemoryStats::internal_default_instance()); +} +void NodeExecStats::clear_referenced_tensor() { + referenced_tensor_.Clear(); +} +void NodeExecStats::unsafe_arena_set_allocated_memory_stats( + ::diplomacy::tensorflow::MemoryStats* memory_stats) { + if (GetArenaNoVirtual() == NULL) { + delete memory_stats_; + } + memory_stats_ = memory_stats; + if (memory_stats) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeExecStats.memory_stats) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NodeExecStats::kNodeNameFieldNumber; +const int NodeExecStats::kAllStartMicrosFieldNumber; +const int NodeExecStats::kOpStartRelMicrosFieldNumber; +const int NodeExecStats::kOpEndRelMicrosFieldNumber; +const int NodeExecStats::kAllEndRelMicrosFieldNumber; +const int NodeExecStats::kMemoryFieldNumber; +const int NodeExecStats::kOutputFieldNumber; +const int NodeExecStats::kTimelineLabelFieldNumber; +const int NodeExecStats::kScheduledMicrosFieldNumber; +const int NodeExecStats::kThreadIdFieldNumber; +const int NodeExecStats::kReferencedTensorFieldNumber; +const int NodeExecStats::kMemoryStatsFieldNumber; +const int NodeExecStats::kAllStartNanosFieldNumber; +const int NodeExecStats::kOpStartRelNanosFieldNumber; +const int NodeExecStats::kOpEndRelNanosFieldNumber; +const int NodeExecStats::kAllEndRelNanosFieldNumber; +const int NodeExecStats::kScheduledNanosFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NodeExecStats::NodeExecStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeExecStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NodeExecStats) +} +NodeExecStats::NodeExecStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + memory_(arena), + output_(arena), + referenced_tensor_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeExecStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.NodeExecStats) +} +NodeExecStats::NodeExecStats(const NodeExecStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + memory_(from.memory_), + output_(from.output_), + referenced_tensor_(from.referenced_tensor_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.node_name().size() > 0) { + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node_name(), + GetArenaNoVirtual()); + } + timeline_label_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.timeline_label().size() > 0) { + timeline_label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.timeline_label(), + GetArenaNoVirtual()); + } + if (from.has_memory_stats()) { + memory_stats_ = new ::diplomacy::tensorflow::MemoryStats(*from.memory_stats_); + } else { + memory_stats_ = NULL; + } + ::memcpy(&all_start_micros_, &from.all_start_micros_, + static_cast(reinterpret_cast(&thread_id_) - + reinterpret_cast(&all_start_micros_)) + sizeof(thread_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NodeExecStats) +} + +void NodeExecStats::SharedCtor() { + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + timeline_label_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&memory_stats_, 0, static_cast( + reinterpret_cast(&thread_id_) - + reinterpret_cast(&memory_stats_)) + sizeof(thread_id_)); +} + +NodeExecStats::~NodeExecStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NodeExecStats) + SharedDtor(); +} + +void NodeExecStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + node_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + timeline_label_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete memory_stats_; +} + +void NodeExecStats::ArenaDtor(void* object) { + NodeExecStats* _this = reinterpret_cast< NodeExecStats* >(object); + (void)_this; +} +void NodeExecStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NodeExecStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NodeExecStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NodeExecStats& NodeExecStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_NodeExecStats.base); + return *internal_default_instance(); +} + + +void NodeExecStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NodeExecStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + memory_.Clear(); + output_.Clear(); + referenced_tensor_.Clear(); + node_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + timeline_label_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && memory_stats_ != NULL) { + delete memory_stats_; + } + memory_stats_ = NULL; + ::memset(&all_start_micros_, 0, static_cast( + reinterpret_cast(&thread_id_) - + reinterpret_cast(&all_start_micros_)) + sizeof(thread_id_)); + _internal_metadata_.Clear(); +} + +bool NodeExecStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NodeExecStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string node_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_node_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeExecStats.node_name")); + } else { + goto handle_unusual; + } + break; + } + + // int64 all_start_micros = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &all_start_micros_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 op_start_rel_micros = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &op_start_rel_micros_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 op_end_rel_micros = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &op_end_rel_micros_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 all_end_rel_micros = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &all_end_rel_micros_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.AllocatorMemoryUsed memory = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_memory())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.NodeOutput output = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_output())); + } else { + goto handle_unusual; + } + break; + } + + // string timeline_label = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_timeline_label())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->timeline_label().data(), static_cast(this->timeline_label().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.NodeExecStats.timeline_label")); + } else { + goto handle_unusual; + } + break; + } + + // int64 scheduled_micros = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &scheduled_micros_))); + } else { + goto handle_unusual; + } + break; + } + + // uint32 thread_id = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &thread_id_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.AllocationDescription referenced_tensor = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_referenced_tensor())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.MemoryStats memory_stats = 12; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_memory_stats())); + } else { + goto handle_unusual; + } + break; + } + + // int64 all_start_nanos = 13; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &all_start_nanos_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 op_start_rel_nanos = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(112u /* 112 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &op_start_rel_nanos_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 op_end_rel_nanos = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(120u /* 120 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &op_end_rel_nanos_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 all_end_rel_nanos = 16; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &all_end_rel_nanos_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 scheduled_nanos = 17; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &scheduled_nanos_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NodeExecStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NodeExecStats) + return false; +#undef DO_ +} + +void NodeExecStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NodeExecStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string node_name = 1; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeExecStats.node_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->node_name(), output); + } + + // int64 all_start_micros = 2; + if (this->all_start_micros() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->all_start_micros(), output); + } + + // int64 op_start_rel_micros = 3; + if (this->op_start_rel_micros() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->op_start_rel_micros(), output); + } + + // int64 op_end_rel_micros = 4; + if (this->op_end_rel_micros() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->op_end_rel_micros(), output); + } + + // int64 all_end_rel_micros = 5; + if (this->all_end_rel_micros() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->all_end_rel_micros(), output); + } + + // repeated .diplomacy.tensorflow.AllocatorMemoryUsed memory = 6; + for (unsigned int i = 0, + n = static_cast(this->memory_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, + this->memory(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.NodeOutput output = 7; + for (unsigned int i = 0, + n = static_cast(this->output_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, + this->output(static_cast(i)), + output); + } + + // string timeline_label = 8; + if (this->timeline_label().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->timeline_label().data(), static_cast(this->timeline_label().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeExecStats.timeline_label"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 8, this->timeline_label(), output); + } + + // int64 scheduled_micros = 9; + if (this->scheduled_micros() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(9, this->scheduled_micros(), output); + } + + // uint32 thread_id = 10; + if (this->thread_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->thread_id(), output); + } + + // repeated .diplomacy.tensorflow.AllocationDescription referenced_tensor = 11; + for (unsigned int i = 0, + n = static_cast(this->referenced_tensor_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, + this->referenced_tensor(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.MemoryStats memory_stats = 12; + if (this->has_memory_stats()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, this->_internal_memory_stats(), output); + } + + // int64 all_start_nanos = 13; + if (this->all_start_nanos() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(13, this->all_start_nanos(), output); + } + + // int64 op_start_rel_nanos = 14; + if (this->op_start_rel_nanos() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(14, this->op_start_rel_nanos(), output); + } + + // int64 op_end_rel_nanos = 15; + if (this->op_end_rel_nanos() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(15, this->op_end_rel_nanos(), output); + } + + // int64 all_end_rel_nanos = 16; + if (this->all_end_rel_nanos() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(16, this->all_end_rel_nanos(), output); + } + + // int64 scheduled_nanos = 17; + if (this->scheduled_nanos() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(17, this->scheduled_nanos(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NodeExecStats) +} + +::google::protobuf::uint8* NodeExecStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NodeExecStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string node_name = 1; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeExecStats.node_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->node_name(), target); + } + + // int64 all_start_micros = 2; + if (this->all_start_micros() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->all_start_micros(), target); + } + + // int64 op_start_rel_micros = 3; + if (this->op_start_rel_micros() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->op_start_rel_micros(), target); + } + + // int64 op_end_rel_micros = 4; + if (this->op_end_rel_micros() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->op_end_rel_micros(), target); + } + + // int64 all_end_rel_micros = 5; + if (this->all_end_rel_micros() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->all_end_rel_micros(), target); + } + + // repeated .diplomacy.tensorflow.AllocatorMemoryUsed memory = 6; + for (unsigned int i = 0, + n = static_cast(this->memory_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->memory(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.NodeOutput output = 7; + for (unsigned int i = 0, + n = static_cast(this->output_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 7, this->output(static_cast(i)), deterministic, target); + } + + // string timeline_label = 8; + if (this->timeline_label().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->timeline_label().data(), static_cast(this->timeline_label().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.NodeExecStats.timeline_label"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 8, this->timeline_label(), target); + } + + // int64 scheduled_micros = 9; + if (this->scheduled_micros() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(9, this->scheduled_micros(), target); + } + + // uint32 thread_id = 10; + if (this->thread_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->thread_id(), target); + } + + // repeated .diplomacy.tensorflow.AllocationDescription referenced_tensor = 11; + for (unsigned int i = 0, + n = static_cast(this->referenced_tensor_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 11, this->referenced_tensor(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.MemoryStats memory_stats = 12; + if (this->has_memory_stats()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 12, this->_internal_memory_stats(), deterministic, target); + } + + // int64 all_start_nanos = 13; + if (this->all_start_nanos() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(13, this->all_start_nanos(), target); + } + + // int64 op_start_rel_nanos = 14; + if (this->op_start_rel_nanos() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(14, this->op_start_rel_nanos(), target); + } + + // int64 op_end_rel_nanos = 15; + if (this->op_end_rel_nanos() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(15, this->op_end_rel_nanos(), target); + } + + // int64 all_end_rel_nanos = 16; + if (this->all_end_rel_nanos() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(16, this->all_end_rel_nanos(), target); + } + + // int64 scheduled_nanos = 17; + if (this->scheduled_nanos() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(17, this->scheduled_nanos(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NodeExecStats) + return target; +} + +size_t NodeExecStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NodeExecStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.AllocatorMemoryUsed memory = 6; + { + unsigned int count = static_cast(this->memory_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->memory(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.NodeOutput output = 7; + { + unsigned int count = static_cast(this->output_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->output(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.AllocationDescription referenced_tensor = 11; + { + unsigned int count = static_cast(this->referenced_tensor_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->referenced_tensor(static_cast(i))); + } + } + + // string node_name = 1; + if (this->node_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->node_name()); + } + + // string timeline_label = 8; + if (this->timeline_label().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->timeline_label()); + } + + // .diplomacy.tensorflow.MemoryStats memory_stats = 12; + if (this->has_memory_stats()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *memory_stats_); + } + + // int64 all_start_micros = 2; + if (this->all_start_micros() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->all_start_micros()); + } + + // int64 op_start_rel_micros = 3; + if (this->op_start_rel_micros() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->op_start_rel_micros()); + } + + // int64 op_end_rel_micros = 4; + if (this->op_end_rel_micros() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->op_end_rel_micros()); + } + + // int64 all_end_rel_micros = 5; + if (this->all_end_rel_micros() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->all_end_rel_micros()); + } + + // int64 scheduled_micros = 9; + if (this->scheduled_micros() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->scheduled_micros()); + } + + // int64 all_start_nanos = 13; + if (this->all_start_nanos() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->all_start_nanos()); + } + + // int64 op_start_rel_nanos = 14; + if (this->op_start_rel_nanos() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->op_start_rel_nanos()); + } + + // int64 op_end_rel_nanos = 15; + if (this->op_end_rel_nanos() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->op_end_rel_nanos()); + } + + // int64 all_end_rel_nanos = 16; + if (this->all_end_rel_nanos() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->all_end_rel_nanos()); + } + + // int64 scheduled_nanos = 17; + if (this->scheduled_nanos() != 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->scheduled_nanos()); + } + + // uint32 thread_id = 10; + if (this->thread_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->thread_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NodeExecStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NodeExecStats) + GOOGLE_DCHECK_NE(&from, this); + const NodeExecStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NodeExecStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NodeExecStats) + MergeFrom(*source); + } +} + +void NodeExecStats::MergeFrom(const NodeExecStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NodeExecStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + memory_.MergeFrom(from.memory_); + output_.MergeFrom(from.output_); + referenced_tensor_.MergeFrom(from.referenced_tensor_); + if (from.node_name().size() > 0) { + set_node_name(from.node_name()); + } + if (from.timeline_label().size() > 0) { + set_timeline_label(from.timeline_label()); + } + if (from.has_memory_stats()) { + mutable_memory_stats()->::diplomacy::tensorflow::MemoryStats::MergeFrom(from.memory_stats()); + } + if (from.all_start_micros() != 0) { + set_all_start_micros(from.all_start_micros()); + } + if (from.op_start_rel_micros() != 0) { + set_op_start_rel_micros(from.op_start_rel_micros()); + } + if (from.op_end_rel_micros() != 0) { + set_op_end_rel_micros(from.op_end_rel_micros()); + } + if (from.all_end_rel_micros() != 0) { + set_all_end_rel_micros(from.all_end_rel_micros()); + } + if (from.scheduled_micros() != 0) { + set_scheduled_micros(from.scheduled_micros()); + } + if (from.all_start_nanos() != 0) { + set_all_start_nanos(from.all_start_nanos()); + } + if (from.op_start_rel_nanos() != 0) { + set_op_start_rel_nanos(from.op_start_rel_nanos()); + } + if (from.op_end_rel_nanos() != 0) { + set_op_end_rel_nanos(from.op_end_rel_nanos()); + } + if (from.all_end_rel_nanos() != 0) { + set_all_end_rel_nanos(from.all_end_rel_nanos()); + } + if (from.scheduled_nanos() != 0) { + set_scheduled_nanos(from.scheduled_nanos()); + } + if (from.thread_id() != 0) { + set_thread_id(from.thread_id()); + } +} + +void NodeExecStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NodeExecStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NodeExecStats::CopyFrom(const NodeExecStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NodeExecStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NodeExecStats::IsInitialized() const { + return true; +} + +void NodeExecStats::Swap(NodeExecStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NodeExecStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void NodeExecStats::UnsafeArenaSwap(NodeExecStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NodeExecStats::InternalSwap(NodeExecStats* other) { + using std::swap; + CastToBase(&memory_)->InternalSwap(CastToBase(&other->memory_)); + CastToBase(&output_)->InternalSwap(CastToBase(&other->output_)); + CastToBase(&referenced_tensor_)->InternalSwap(CastToBase(&other->referenced_tensor_)); + node_name_.Swap(&other->node_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + timeline_label_.Swap(&other->timeline_label_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(memory_stats_, other->memory_stats_); + swap(all_start_micros_, other->all_start_micros_); + swap(op_start_rel_micros_, other->op_start_rel_micros_); + swap(op_end_rel_micros_, other->op_end_rel_micros_); + swap(all_end_rel_micros_, other->all_end_rel_micros_); + swap(scheduled_micros_, other->scheduled_micros_); + swap(all_start_nanos_, other->all_start_nanos_); + swap(op_start_rel_nanos_, other->op_start_rel_nanos_); + swap(op_end_rel_nanos_, other->op_end_rel_nanos_); + swap(all_end_rel_nanos_, other->all_end_rel_nanos_); + swap(scheduled_nanos_, other->scheduled_nanos_); + swap(thread_id_, other->thread_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NodeExecStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DeviceStepStats::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DeviceStepStats::kDeviceFieldNumber; +const int DeviceStepStats::kNodeStatsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DeviceStepStats::DeviceStepStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_DeviceStepStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.DeviceStepStats) +} +DeviceStepStats::DeviceStepStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_stats_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_DeviceStepStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.DeviceStepStats) +} +DeviceStepStats::DeviceStepStats(const DeviceStepStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + node_stats_(from.node_stats_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.device().size() > 0) { + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.DeviceStepStats) +} + +void DeviceStepStats::SharedCtor() { + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +DeviceStepStats::~DeviceStepStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.DeviceStepStats) + SharedDtor(); +} + +void DeviceStepStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + device_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void DeviceStepStats::ArenaDtor(void* object) { + DeviceStepStats* _this = reinterpret_cast< DeviceStepStats* >(object); + (void)_this; +} +void DeviceStepStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DeviceStepStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DeviceStepStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DeviceStepStats& DeviceStepStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_DeviceStepStats.base); + return *internal_default_instance(); +} + + +void DeviceStepStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.DeviceStepStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_stats_.Clear(); + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool DeviceStepStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.DeviceStepStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string device = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.DeviceStepStats.device")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.NodeExecStats node_stats = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_node_stats())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.DeviceStepStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.DeviceStepStats) + return false; +#undef DO_ +} + +void DeviceStepStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.DeviceStepStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string device = 1; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceStepStats.device"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->device(), output); + } + + // repeated .diplomacy.tensorflow.NodeExecStats node_stats = 2; + for (unsigned int i = 0, + n = static_cast(this->node_stats_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->node_stats(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.DeviceStepStats) +} + +::google::protobuf::uint8* DeviceStepStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.DeviceStepStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string device = 1; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), static_cast(this->device().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.DeviceStepStats.device"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->device(), target); + } + + // repeated .diplomacy.tensorflow.NodeExecStats node_stats = 2; + for (unsigned int i = 0, + n = static_cast(this->node_stats_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->node_stats(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.DeviceStepStats) + return target; +} + +size_t DeviceStepStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.DeviceStepStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.NodeExecStats node_stats = 2; + { + unsigned int count = static_cast(this->node_stats_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->node_stats(static_cast(i))); + } + } + + // string device = 1; + if (this->device().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DeviceStepStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.DeviceStepStats) + GOOGLE_DCHECK_NE(&from, this); + const DeviceStepStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.DeviceStepStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.DeviceStepStats) + MergeFrom(*source); + } +} + +void DeviceStepStats::MergeFrom(const DeviceStepStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.DeviceStepStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + node_stats_.MergeFrom(from.node_stats_); + if (from.device().size() > 0) { + set_device(from.device()); + } +} + +void DeviceStepStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.DeviceStepStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DeviceStepStats::CopyFrom(const DeviceStepStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.DeviceStepStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DeviceStepStats::IsInitialized() const { + return true; +} + +void DeviceStepStats::Swap(DeviceStepStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DeviceStepStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DeviceStepStats::UnsafeArenaSwap(DeviceStepStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DeviceStepStats::InternalSwap(DeviceStepStats* other) { + using std::swap; + CastToBase(&node_stats_)->InternalSwap(CastToBase(&other->node_stats_)); + device_.Swap(&other->device_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DeviceStepStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void StepStats::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int StepStats::kDevStatsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +StepStats::StepStats() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_StepStats.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.StepStats) +} +StepStats::StepStats(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dev_stats_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_StepStats.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.StepStats) +} +StepStats::StepStats(const StepStats& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dev_stats_(from.dev_stats_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.StepStats) +} + +void StepStats::SharedCtor() { +} + +StepStats::~StepStats() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.StepStats) + SharedDtor(); +} + +void StepStats::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void StepStats::ArenaDtor(void* object) { + StepStats* _this = reinterpret_cast< StepStats* >(object); + (void)_this; +} +void StepStats::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void StepStats::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* StepStats::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const StepStats& StepStats::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::scc_info_StepStats.base); + return *internal_default_instance(); +} + + +void StepStats::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.StepStats) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dev_stats_.Clear(); + _internal_metadata_.Clear(); +} + +bool StepStats::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.StepStats) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.DeviceStepStats dev_stats = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_dev_stats())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.StepStats) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.StepStats) + return false; +#undef DO_ +} + +void StepStats::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.StepStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.DeviceStepStats dev_stats = 1; + for (unsigned int i = 0, + n = static_cast(this->dev_stats_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->dev_stats(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.StepStats) +} + +::google::protobuf::uint8* StepStats::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.StepStats) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.DeviceStepStats dev_stats = 1; + for (unsigned int i = 0, + n = static_cast(this->dev_stats_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->dev_stats(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.StepStats) + return target; +} + +size_t StepStats::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.StepStats) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.DeviceStepStats dev_stats = 1; + { + unsigned int count = static_cast(this->dev_stats_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->dev_stats(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StepStats::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.StepStats) + GOOGLE_DCHECK_NE(&from, this); + const StepStats* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.StepStats) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.StepStats) + MergeFrom(*source); + } +} + +void StepStats::MergeFrom(const StepStats& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.StepStats) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dev_stats_.MergeFrom(from.dev_stats_); +} + +void StepStats::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.StepStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StepStats::CopyFrom(const StepStats& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.StepStats) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StepStats::IsInitialized() const { + return true; +} + +void StepStats::Swap(StepStats* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + StepStats* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void StepStats::UnsafeArenaSwap(StepStats* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void StepStats::InternalSwap(StepStats* other) { + using std::swap; + CastToBase(&dev_stats_)->InternalSwap(CastToBase(&other->dev_stats_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata StepStats::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::AllocationRecord* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::AllocationRecord >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::AllocationRecord >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::AllocatorMemoryUsed* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::AllocatorMemoryUsed >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::AllocatorMemoryUsed >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NodeOutput* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NodeOutput >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NodeOutput >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::MemoryStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::MemoryStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::MemoryStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NodeExecStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NodeExecStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NodeExecStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::DeviceStepStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::DeviceStepStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::DeviceStepStats >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::StepStats* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::StepStats >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::StepStats >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.pb.h new file mode 100644 index 0000000..1e3de19 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.pb.h @@ -0,0 +1,2281 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/step_stats.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/allocation_description.pb.h" +#include "diplomacy_tensorflow/core/framework/tensor_description.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[7]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto +namespace diplomacy { +namespace tensorflow { +class AllocationRecord; +class AllocationRecordDefaultTypeInternal; +extern AllocationRecordDefaultTypeInternal _AllocationRecord_default_instance_; +class AllocatorMemoryUsed; +class AllocatorMemoryUsedDefaultTypeInternal; +extern AllocatorMemoryUsedDefaultTypeInternal _AllocatorMemoryUsed_default_instance_; +class DeviceStepStats; +class DeviceStepStatsDefaultTypeInternal; +extern DeviceStepStatsDefaultTypeInternal _DeviceStepStats_default_instance_; +class MemoryStats; +class MemoryStatsDefaultTypeInternal; +extern MemoryStatsDefaultTypeInternal _MemoryStats_default_instance_; +class NodeExecStats; +class NodeExecStatsDefaultTypeInternal; +extern NodeExecStatsDefaultTypeInternal _NodeExecStats_default_instance_; +class NodeOutput; +class NodeOutputDefaultTypeInternal; +extern NodeOutputDefaultTypeInternal _NodeOutput_default_instance_; +class StepStats; +class StepStatsDefaultTypeInternal; +extern StepStatsDefaultTypeInternal _StepStats_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::AllocationRecord* Arena::CreateMaybeMessage<::diplomacy::tensorflow::AllocationRecord>(Arena*); +template<> ::diplomacy::tensorflow::AllocatorMemoryUsed* Arena::CreateMaybeMessage<::diplomacy::tensorflow::AllocatorMemoryUsed>(Arena*); +template<> ::diplomacy::tensorflow::DeviceStepStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::DeviceStepStats>(Arena*); +template<> ::diplomacy::tensorflow::MemoryStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::MemoryStats>(Arena*); +template<> ::diplomacy::tensorflow::NodeExecStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NodeExecStats>(Arena*); +template<> ::diplomacy::tensorflow::NodeOutput* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NodeOutput>(Arena*); +template<> ::diplomacy::tensorflow::StepStats* Arena::CreateMaybeMessage<::diplomacy::tensorflow::StepStats>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class AllocationRecord : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.AllocationRecord) */ { + public: + AllocationRecord(); + virtual ~AllocationRecord(); + + AllocationRecord(const AllocationRecord& from); + + inline AllocationRecord& operator=(const AllocationRecord& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AllocationRecord(AllocationRecord&& from) noexcept + : AllocationRecord() { + *this = ::std::move(from); + } + + inline AllocationRecord& operator=(AllocationRecord&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AllocationRecord& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AllocationRecord* internal_default_instance() { + return reinterpret_cast( + &_AllocationRecord_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(AllocationRecord* other); + void Swap(AllocationRecord* other); + friend void swap(AllocationRecord& a, AllocationRecord& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AllocationRecord* New() const final { + return CreateMaybeMessage(NULL); + } + + AllocationRecord* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AllocationRecord& from); + void MergeFrom(const AllocationRecord& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AllocationRecord* other); + protected: + explicit AllocationRecord(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 alloc_micros = 1; + void clear_alloc_micros(); + static const int kAllocMicrosFieldNumber = 1; + ::google::protobuf::int64 alloc_micros() const; + void set_alloc_micros(::google::protobuf::int64 value); + + // int64 alloc_bytes = 2; + void clear_alloc_bytes(); + static const int kAllocBytesFieldNumber = 2; + ::google::protobuf::int64 alloc_bytes() const; + void set_alloc_bytes(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AllocationRecord) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 alloc_micros_; + ::google::protobuf::int64 alloc_bytes_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class AllocatorMemoryUsed : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.AllocatorMemoryUsed) */ { + public: + AllocatorMemoryUsed(); + virtual ~AllocatorMemoryUsed(); + + AllocatorMemoryUsed(const AllocatorMemoryUsed& from); + + inline AllocatorMemoryUsed& operator=(const AllocatorMemoryUsed& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + AllocatorMemoryUsed(AllocatorMemoryUsed&& from) noexcept + : AllocatorMemoryUsed() { + *this = ::std::move(from); + } + + inline AllocatorMemoryUsed& operator=(AllocatorMemoryUsed&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AllocatorMemoryUsed& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AllocatorMemoryUsed* internal_default_instance() { + return reinterpret_cast( + &_AllocatorMemoryUsed_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(AllocatorMemoryUsed* other); + void Swap(AllocatorMemoryUsed* other); + friend void swap(AllocatorMemoryUsed& a, AllocatorMemoryUsed& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline AllocatorMemoryUsed* New() const final { + return CreateMaybeMessage(NULL); + } + + AllocatorMemoryUsed* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const AllocatorMemoryUsed& from); + void MergeFrom(const AllocatorMemoryUsed& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AllocatorMemoryUsed* other); + protected: + explicit AllocatorMemoryUsed(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.AllocationRecord allocation_records = 6; + int allocation_records_size() const; + void clear_allocation_records(); + static const int kAllocationRecordsFieldNumber = 6; + ::diplomacy::tensorflow::AllocationRecord* mutable_allocation_records(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationRecord >* + mutable_allocation_records(); + const ::diplomacy::tensorflow::AllocationRecord& allocation_records(int index) const; + ::diplomacy::tensorflow::AllocationRecord* add_allocation_records(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationRecord >& + allocation_records() const; + + // string allocator_name = 1; + void clear_allocator_name(); + static const int kAllocatorNameFieldNumber = 1; + const ::std::string& allocator_name() const; + void set_allocator_name(const ::std::string& value); + #if LANG_CXX11 + void set_allocator_name(::std::string&& value); + #endif + void set_allocator_name(const char* value); + void set_allocator_name(const char* value, size_t size); + ::std::string* mutable_allocator_name(); + ::std::string* release_allocator_name(); + void set_allocated_allocator_name(::std::string* allocator_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_allocator_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name); + + // int64 total_bytes = 2; + void clear_total_bytes(); + static const int kTotalBytesFieldNumber = 2; + ::google::protobuf::int64 total_bytes() const; + void set_total_bytes(::google::protobuf::int64 value); + + // int64 peak_bytes = 3; + void clear_peak_bytes(); + static const int kPeakBytesFieldNumber = 3; + ::google::protobuf::int64 peak_bytes() const; + void set_peak_bytes(::google::protobuf::int64 value); + + // int64 live_bytes = 4; + void clear_live_bytes(); + static const int kLiveBytesFieldNumber = 4; + ::google::protobuf::int64 live_bytes() const; + void set_live_bytes(::google::protobuf::int64 value); + + // int64 allocator_bytes_in_use = 5; + void clear_allocator_bytes_in_use(); + static const int kAllocatorBytesInUseFieldNumber = 5; + ::google::protobuf::int64 allocator_bytes_in_use() const; + void set_allocator_bytes_in_use(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.AllocatorMemoryUsed) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationRecord > allocation_records_; + ::google::protobuf::internal::ArenaStringPtr allocator_name_; + ::google::protobuf::int64 total_bytes_; + ::google::protobuf::int64 peak_bytes_; + ::google::protobuf::int64 live_bytes_; + ::google::protobuf::int64 allocator_bytes_in_use_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class NodeOutput : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NodeOutput) */ { + public: + NodeOutput(); + virtual ~NodeOutput(); + + NodeOutput(const NodeOutput& from); + + inline NodeOutput& operator=(const NodeOutput& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NodeOutput(NodeOutput&& from) noexcept + : NodeOutput() { + *this = ::std::move(from); + } + + inline NodeOutput& operator=(NodeOutput&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NodeOutput& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NodeOutput* internal_default_instance() { + return reinterpret_cast( + &_NodeOutput_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(NodeOutput* other); + void Swap(NodeOutput* other); + friend void swap(NodeOutput& a, NodeOutput& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NodeOutput* New() const final { + return CreateMaybeMessage(NULL); + } + + NodeOutput* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NodeOutput& from); + void MergeFrom(const NodeOutput& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NodeOutput* other); + protected: + explicit NodeOutput(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.TensorDescription tensor_description = 3; + bool has_tensor_description() const; + void clear_tensor_description(); + static const int kTensorDescriptionFieldNumber = 3; + private: + const ::diplomacy::tensorflow::TensorDescription& _internal_tensor_description() const; + public: + const ::diplomacy::tensorflow::TensorDescription& tensor_description() const; + ::diplomacy::tensorflow::TensorDescription* release_tensor_description(); + ::diplomacy::tensorflow::TensorDescription* mutable_tensor_description(); + void set_allocated_tensor_description(::diplomacy::tensorflow::TensorDescription* tensor_description); + void unsafe_arena_set_allocated_tensor_description( + ::diplomacy::tensorflow::TensorDescription* tensor_description); + ::diplomacy::tensorflow::TensorDescription* unsafe_arena_release_tensor_description(); + + // int32 slot = 1; + void clear_slot(); + static const int kSlotFieldNumber = 1; + ::google::protobuf::int32 slot() const; + void set_slot(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NodeOutput) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::TensorDescription* tensor_description_; + ::google::protobuf::int32 slot_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class MemoryStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.MemoryStats) */ { + public: + MemoryStats(); + virtual ~MemoryStats(); + + MemoryStats(const MemoryStats& from); + + inline MemoryStats& operator=(const MemoryStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + MemoryStats(MemoryStats&& from) noexcept + : MemoryStats() { + *this = ::std::move(from); + } + + inline MemoryStats& operator=(MemoryStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MemoryStats* internal_default_instance() { + return reinterpret_cast( + &_MemoryStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(MemoryStats* other); + void Swap(MemoryStats* other); + friend void swap(MemoryStats& a, MemoryStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline MemoryStats* New() const final { + return CreateMaybeMessage(NULL); + } + + MemoryStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const MemoryStats& from); + void MergeFrom(const MemoryStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MemoryStats* other); + protected: + explicit MemoryStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 persistent_tensor_alloc_ids = 5; + int persistent_tensor_alloc_ids_size() const; + void clear_persistent_tensor_alloc_ids(); + static const int kPersistentTensorAllocIdsFieldNumber = 5; + ::google::protobuf::int64 persistent_tensor_alloc_ids(int index) const; + void set_persistent_tensor_alloc_ids(int index, ::google::protobuf::int64 value); + void add_persistent_tensor_alloc_ids(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + persistent_tensor_alloc_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_persistent_tensor_alloc_ids(); + + // repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR int device_persistent_tensor_alloc_ids_size() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_device_persistent_tensor_alloc_ids(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kDevicePersistentTensorAllocIdsFieldNumber = 6; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 device_persistent_tensor_alloc_ids(int index) const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_device_persistent_tensor_alloc_ids(int index, ::google::protobuf::int64 value); + GOOGLE_PROTOBUF_DEPRECATED_ATTR void add_device_persistent_tensor_alloc_ids(::google::protobuf::int64 value); + GOOGLE_PROTOBUF_DEPRECATED_ATTR const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + device_persistent_tensor_alloc_ids() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_device_persistent_tensor_alloc_ids(); + + // int64 temp_memory_size = 1; + void clear_temp_memory_size(); + static const int kTempMemorySizeFieldNumber = 1; + ::google::protobuf::int64 temp_memory_size() const; + void set_temp_memory_size(::google::protobuf::int64 value); + + // int64 device_temp_memory_size = 2 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_device_temp_memory_size(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kDeviceTempMemorySizeFieldNumber = 2; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 device_temp_memory_size() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_device_temp_memory_size(::google::protobuf::int64 value); + + // int64 persistent_memory_size = 3; + void clear_persistent_memory_size(); + static const int kPersistentMemorySizeFieldNumber = 3; + ::google::protobuf::int64 persistent_memory_size() const; + void set_persistent_memory_size(::google::protobuf::int64 value); + + // int64 device_persistent_memory_size = 4 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_device_persistent_memory_size(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kDevicePersistentMemorySizeFieldNumber = 4; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 device_persistent_memory_size() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_device_persistent_memory_size(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.MemoryStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > persistent_tensor_alloc_ids_; + mutable int _persistent_tensor_alloc_ids_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > device_persistent_tensor_alloc_ids_; + mutable int _device_persistent_tensor_alloc_ids_cached_byte_size_; + ::google::protobuf::int64 temp_memory_size_; + ::google::protobuf::int64 device_temp_memory_size_; + ::google::protobuf::int64 persistent_memory_size_; + ::google::protobuf::int64 device_persistent_memory_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class NodeExecStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NodeExecStats) */ { + public: + NodeExecStats(); + virtual ~NodeExecStats(); + + NodeExecStats(const NodeExecStats& from); + + inline NodeExecStats& operator=(const NodeExecStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NodeExecStats(NodeExecStats&& from) noexcept + : NodeExecStats() { + *this = ::std::move(from); + } + + inline NodeExecStats& operator=(NodeExecStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NodeExecStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NodeExecStats* internal_default_instance() { + return reinterpret_cast( + &_NodeExecStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(NodeExecStats* other); + void Swap(NodeExecStats* other); + friend void swap(NodeExecStats& a, NodeExecStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NodeExecStats* New() const final { + return CreateMaybeMessage(NULL); + } + + NodeExecStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NodeExecStats& from); + void MergeFrom(const NodeExecStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NodeExecStats* other); + protected: + explicit NodeExecStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.AllocatorMemoryUsed memory = 6; + int memory_size() const; + void clear_memory(); + static const int kMemoryFieldNumber = 6; + ::diplomacy::tensorflow::AllocatorMemoryUsed* mutable_memory(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocatorMemoryUsed >* + mutable_memory(); + const ::diplomacy::tensorflow::AllocatorMemoryUsed& memory(int index) const; + ::diplomacy::tensorflow::AllocatorMemoryUsed* add_memory(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocatorMemoryUsed >& + memory() const; + + // repeated .diplomacy.tensorflow.NodeOutput output = 7; + int output_size() const; + void clear_output(); + static const int kOutputFieldNumber = 7; + ::diplomacy::tensorflow::NodeOutput* mutable_output(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeOutput >* + mutable_output(); + const ::diplomacy::tensorflow::NodeOutput& output(int index) const; + ::diplomacy::tensorflow::NodeOutput* add_output(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeOutput >& + output() const; + + // repeated .diplomacy.tensorflow.AllocationDescription referenced_tensor = 11; + int referenced_tensor_size() const; + void clear_referenced_tensor(); + static const int kReferencedTensorFieldNumber = 11; + ::diplomacy::tensorflow::AllocationDescription* mutable_referenced_tensor(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationDescription >* + mutable_referenced_tensor(); + const ::diplomacy::tensorflow::AllocationDescription& referenced_tensor(int index) const; + ::diplomacy::tensorflow::AllocationDescription* add_referenced_tensor(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationDescription >& + referenced_tensor() const; + + // string node_name = 1; + void clear_node_name(); + static const int kNodeNameFieldNumber = 1; + const ::std::string& node_name() const; + void set_node_name(const ::std::string& value); + #if LANG_CXX11 + void set_node_name(::std::string&& value); + #endif + void set_node_name(const char* value); + void set_node_name(const char* value, size_t size); + ::std::string* mutable_node_name(); + ::std::string* release_node_name(); + void set_allocated_node_name(::std::string* node_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_node_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_node_name( + ::std::string* node_name); + + // string timeline_label = 8; + void clear_timeline_label(); + static const int kTimelineLabelFieldNumber = 8; + const ::std::string& timeline_label() const; + void set_timeline_label(const ::std::string& value); + #if LANG_CXX11 + void set_timeline_label(::std::string&& value); + #endif + void set_timeline_label(const char* value); + void set_timeline_label(const char* value, size_t size); + ::std::string* mutable_timeline_label(); + ::std::string* release_timeline_label(); + void set_allocated_timeline_label(::std::string* timeline_label); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_timeline_label(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_timeline_label( + ::std::string* timeline_label); + + // .diplomacy.tensorflow.MemoryStats memory_stats = 12; + bool has_memory_stats() const; + void clear_memory_stats(); + static const int kMemoryStatsFieldNumber = 12; + private: + const ::diplomacy::tensorflow::MemoryStats& _internal_memory_stats() const; + public: + const ::diplomacy::tensorflow::MemoryStats& memory_stats() const; + ::diplomacy::tensorflow::MemoryStats* release_memory_stats(); + ::diplomacy::tensorflow::MemoryStats* mutable_memory_stats(); + void set_allocated_memory_stats(::diplomacy::tensorflow::MemoryStats* memory_stats); + void unsafe_arena_set_allocated_memory_stats( + ::diplomacy::tensorflow::MemoryStats* memory_stats); + ::diplomacy::tensorflow::MemoryStats* unsafe_arena_release_memory_stats(); + + // int64 all_start_micros = 2; + void clear_all_start_micros(); + static const int kAllStartMicrosFieldNumber = 2; + ::google::protobuf::int64 all_start_micros() const; + void set_all_start_micros(::google::protobuf::int64 value); + + // int64 op_start_rel_micros = 3; + void clear_op_start_rel_micros(); + static const int kOpStartRelMicrosFieldNumber = 3; + ::google::protobuf::int64 op_start_rel_micros() const; + void set_op_start_rel_micros(::google::protobuf::int64 value); + + // int64 op_end_rel_micros = 4; + void clear_op_end_rel_micros(); + static const int kOpEndRelMicrosFieldNumber = 4; + ::google::protobuf::int64 op_end_rel_micros() const; + void set_op_end_rel_micros(::google::protobuf::int64 value); + + // int64 all_end_rel_micros = 5; + void clear_all_end_rel_micros(); + static const int kAllEndRelMicrosFieldNumber = 5; + ::google::protobuf::int64 all_end_rel_micros() const; + void set_all_end_rel_micros(::google::protobuf::int64 value); + + // int64 scheduled_micros = 9; + void clear_scheduled_micros(); + static const int kScheduledMicrosFieldNumber = 9; + ::google::protobuf::int64 scheduled_micros() const; + void set_scheduled_micros(::google::protobuf::int64 value); + + // int64 all_start_nanos = 13; + void clear_all_start_nanos(); + static const int kAllStartNanosFieldNumber = 13; + ::google::protobuf::int64 all_start_nanos() const; + void set_all_start_nanos(::google::protobuf::int64 value); + + // int64 op_start_rel_nanos = 14; + void clear_op_start_rel_nanos(); + static const int kOpStartRelNanosFieldNumber = 14; + ::google::protobuf::int64 op_start_rel_nanos() const; + void set_op_start_rel_nanos(::google::protobuf::int64 value); + + // int64 op_end_rel_nanos = 15; + void clear_op_end_rel_nanos(); + static const int kOpEndRelNanosFieldNumber = 15; + ::google::protobuf::int64 op_end_rel_nanos() const; + void set_op_end_rel_nanos(::google::protobuf::int64 value); + + // int64 all_end_rel_nanos = 16; + void clear_all_end_rel_nanos(); + static const int kAllEndRelNanosFieldNumber = 16; + ::google::protobuf::int64 all_end_rel_nanos() const; + void set_all_end_rel_nanos(::google::protobuf::int64 value); + + // int64 scheduled_nanos = 17; + void clear_scheduled_nanos(); + static const int kScheduledNanosFieldNumber = 17; + ::google::protobuf::int64 scheduled_nanos() const; + void set_scheduled_nanos(::google::protobuf::int64 value); + + // uint32 thread_id = 10; + void clear_thread_id(); + static const int kThreadIdFieldNumber = 10; + ::google::protobuf::uint32 thread_id() const; + void set_thread_id(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NodeExecStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocatorMemoryUsed > memory_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeOutput > output_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationDescription > referenced_tensor_; + ::google::protobuf::internal::ArenaStringPtr node_name_; + ::google::protobuf::internal::ArenaStringPtr timeline_label_; + ::diplomacy::tensorflow::MemoryStats* memory_stats_; + ::google::protobuf::int64 all_start_micros_; + ::google::protobuf::int64 op_start_rel_micros_; + ::google::protobuf::int64 op_end_rel_micros_; + ::google::protobuf::int64 all_end_rel_micros_; + ::google::protobuf::int64 scheduled_micros_; + ::google::protobuf::int64 all_start_nanos_; + ::google::protobuf::int64 op_start_rel_nanos_; + ::google::protobuf::int64 op_end_rel_nanos_; + ::google::protobuf::int64 all_end_rel_nanos_; + ::google::protobuf::int64 scheduled_nanos_; + ::google::protobuf::uint32 thread_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DeviceStepStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.DeviceStepStats) */ { + public: + DeviceStepStats(); + virtual ~DeviceStepStats(); + + DeviceStepStats(const DeviceStepStats& from); + + inline DeviceStepStats& operator=(const DeviceStepStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DeviceStepStats(DeviceStepStats&& from) noexcept + : DeviceStepStats() { + *this = ::std::move(from); + } + + inline DeviceStepStats& operator=(DeviceStepStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DeviceStepStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DeviceStepStats* internal_default_instance() { + return reinterpret_cast( + &_DeviceStepStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(DeviceStepStats* other); + void Swap(DeviceStepStats* other); + friend void swap(DeviceStepStats& a, DeviceStepStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DeviceStepStats* New() const final { + return CreateMaybeMessage(NULL); + } + + DeviceStepStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DeviceStepStats& from); + void MergeFrom(const DeviceStepStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DeviceStepStats* other); + protected: + explicit DeviceStepStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.NodeExecStats node_stats = 2; + int node_stats_size() const; + void clear_node_stats(); + static const int kNodeStatsFieldNumber = 2; + ::diplomacy::tensorflow::NodeExecStats* mutable_node_stats(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeExecStats >* + mutable_node_stats(); + const ::diplomacy::tensorflow::NodeExecStats& node_stats(int index) const; + ::diplomacy::tensorflow::NodeExecStats* add_node_stats(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeExecStats >& + node_stats() const; + + // string device = 1; + void clear_device(); + static const int kDeviceFieldNumber = 1; + const ::std::string& device() const; + void set_device(const ::std::string& value); + #if LANG_CXX11 + void set_device(::std::string&& value); + #endif + void set_device(const char* value); + void set_device(const char* value, size_t size); + ::std::string* mutable_device(); + ::std::string* release_device(); + void set_allocated_device(::std::string* device); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_device(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_device( + ::std::string* device); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.DeviceStepStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeExecStats > node_stats_; + ::google::protobuf::internal::ArenaStringPtr device_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class StepStats : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.StepStats) */ { + public: + StepStats(); + virtual ~StepStats(); + + StepStats(const StepStats& from); + + inline StepStats& operator=(const StepStats& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + StepStats(StepStats&& from) noexcept + : StepStats() { + *this = ::std::move(from); + } + + inline StepStats& operator=(StepStats&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const StepStats& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StepStats* internal_default_instance() { + return reinterpret_cast( + &_StepStats_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(StepStats* other); + void Swap(StepStats* other); + friend void swap(StepStats& a, StepStats& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline StepStats* New() const final { + return CreateMaybeMessage(NULL); + } + + StepStats* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const StepStats& from); + void MergeFrom(const StepStats& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StepStats* other); + protected: + explicit StepStats(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.DeviceStepStats dev_stats = 1; + int dev_stats_size() const; + void clear_dev_stats(); + static const int kDevStatsFieldNumber = 1; + ::diplomacy::tensorflow::DeviceStepStats* mutable_dev_stats(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::DeviceStepStats >* + mutable_dev_stats(); + const ::diplomacy::tensorflow::DeviceStepStats& dev_stats(int index) const; + ::diplomacy::tensorflow::DeviceStepStats* add_dev_stats(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::DeviceStepStats >& + dev_stats() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.StepStats) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::DeviceStepStats > dev_stats_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// AllocationRecord + +// int64 alloc_micros = 1; +inline void AllocationRecord::clear_alloc_micros() { + alloc_micros_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocationRecord::alloc_micros() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationRecord.alloc_micros) + return alloc_micros_; +} +inline void AllocationRecord::set_alloc_micros(::google::protobuf::int64 value) { + + alloc_micros_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationRecord.alloc_micros) +} + +// int64 alloc_bytes = 2; +inline void AllocationRecord::clear_alloc_bytes() { + alloc_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocationRecord::alloc_bytes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocationRecord.alloc_bytes) + return alloc_bytes_; +} +inline void AllocationRecord::set_alloc_bytes(::google::protobuf::int64 value) { + + alloc_bytes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocationRecord.alloc_bytes) +} + +// ------------------------------------------------------------------- + +// AllocatorMemoryUsed + +// string allocator_name = 1; +inline void AllocatorMemoryUsed::clear_allocator_name() { + allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& AllocatorMemoryUsed::allocator_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) + return allocator_name_.Get(); +} +inline void AllocatorMemoryUsed::set_allocator_name(const ::std::string& value) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) +} +#if LANG_CXX11 +inline void AllocatorMemoryUsed::set_allocator_name(::std::string&& value) { + + allocator_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) +} +#endif +inline void AllocatorMemoryUsed::set_allocator_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) +} +inline void AllocatorMemoryUsed::set_allocator_name(const char* value, + size_t size) { + + allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) +} +inline ::std::string* AllocatorMemoryUsed::mutable_allocator_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) + return allocator_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* AllocatorMemoryUsed::release_allocator_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) + + return allocator_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void AllocatorMemoryUsed::set_allocated_allocator_name(::std::string* allocator_name) { + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), allocator_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) +} +inline ::std::string* AllocatorMemoryUsed::unsafe_arena_release_allocator_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return allocator_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void AllocatorMemoryUsed::unsafe_arena_set_allocated_allocator_name( + ::std::string* allocator_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (allocator_name != NULL) { + + } else { + + } + allocator_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + allocator_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_name) +} + +// int64 total_bytes = 2; +inline void AllocatorMemoryUsed::clear_total_bytes() { + total_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocatorMemoryUsed::total_bytes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocatorMemoryUsed.total_bytes) + return total_bytes_; +} +inline void AllocatorMemoryUsed::set_total_bytes(::google::protobuf::int64 value) { + + total_bytes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocatorMemoryUsed.total_bytes) +} + +// int64 peak_bytes = 3; +inline void AllocatorMemoryUsed::clear_peak_bytes() { + peak_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocatorMemoryUsed::peak_bytes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocatorMemoryUsed.peak_bytes) + return peak_bytes_; +} +inline void AllocatorMemoryUsed::set_peak_bytes(::google::protobuf::int64 value) { + + peak_bytes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocatorMemoryUsed.peak_bytes) +} + +// int64 live_bytes = 4; +inline void AllocatorMemoryUsed::clear_live_bytes() { + live_bytes_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocatorMemoryUsed::live_bytes() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocatorMemoryUsed.live_bytes) + return live_bytes_; +} +inline void AllocatorMemoryUsed::set_live_bytes(::google::protobuf::int64 value) { + + live_bytes_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocatorMemoryUsed.live_bytes) +} + +// repeated .diplomacy.tensorflow.AllocationRecord allocation_records = 6; +inline int AllocatorMemoryUsed::allocation_records_size() const { + return allocation_records_.size(); +} +inline void AllocatorMemoryUsed::clear_allocation_records() { + allocation_records_.Clear(); +} +inline ::diplomacy::tensorflow::AllocationRecord* AllocatorMemoryUsed::mutable_allocation_records(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.AllocatorMemoryUsed.allocation_records) + return allocation_records_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationRecord >* +AllocatorMemoryUsed::mutable_allocation_records() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.AllocatorMemoryUsed.allocation_records) + return &allocation_records_; +} +inline const ::diplomacy::tensorflow::AllocationRecord& AllocatorMemoryUsed::allocation_records(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocatorMemoryUsed.allocation_records) + return allocation_records_.Get(index); +} +inline ::diplomacy::tensorflow::AllocationRecord* AllocatorMemoryUsed::add_allocation_records() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.AllocatorMemoryUsed.allocation_records) + return allocation_records_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationRecord >& +AllocatorMemoryUsed::allocation_records() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.AllocatorMemoryUsed.allocation_records) + return allocation_records_; +} + +// int64 allocator_bytes_in_use = 5; +inline void AllocatorMemoryUsed::clear_allocator_bytes_in_use() { + allocator_bytes_in_use_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 AllocatorMemoryUsed::allocator_bytes_in_use() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_bytes_in_use) + return allocator_bytes_in_use_; +} +inline void AllocatorMemoryUsed::set_allocator_bytes_in_use(::google::protobuf::int64 value) { + + allocator_bytes_in_use_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.AllocatorMemoryUsed.allocator_bytes_in_use) +} + +// ------------------------------------------------------------------- + +// NodeOutput + +// int32 slot = 1; +inline void NodeOutput::clear_slot() { + slot_ = 0; +} +inline ::google::protobuf::int32 NodeOutput::slot() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeOutput.slot) + return slot_; +} +inline void NodeOutput::set_slot(::google::protobuf::int32 value) { + + slot_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeOutput.slot) +} + +// .diplomacy.tensorflow.TensorDescription tensor_description = 3; +inline bool NodeOutput::has_tensor_description() const { + return this != internal_default_instance() && tensor_description_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorDescription& NodeOutput::_internal_tensor_description() const { + return *tensor_description_; +} +inline const ::diplomacy::tensorflow::TensorDescription& NodeOutput::tensor_description() const { + const ::diplomacy::tensorflow::TensorDescription* p = tensor_description_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeOutput.tensor_description) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorDescription_default_instance_); +} +inline ::diplomacy::tensorflow::TensorDescription* NodeOutput::release_tensor_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeOutput.tensor_description) + + ::diplomacy::tensorflow::TensorDescription* temp = tensor_description_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tensor_description_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorDescription* NodeOutput::unsafe_arena_release_tensor_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeOutput.tensor_description) + + ::diplomacy::tensorflow::TensorDescription* temp = tensor_description_; + tensor_description_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorDescription* NodeOutput::mutable_tensor_description() { + + if (tensor_description_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorDescription>(GetArenaNoVirtual()); + tensor_description_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeOutput.tensor_description) + return tensor_description_; +} +inline void NodeOutput::set_allocated_tensor_description(::diplomacy::tensorflow::TensorDescription* tensor_description) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_description_); + } + if (tensor_description) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor_description)->GetArena(); + if (message_arena != submessage_arena) { + tensor_description = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor_description, submessage_arena); + } + + } else { + + } + tensor_description_ = tensor_description; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeOutput.tensor_description) +} + +// ------------------------------------------------------------------- + +// MemoryStats + +// int64 temp_memory_size = 1; +inline void MemoryStats::clear_temp_memory_size() { + temp_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryStats::temp_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryStats.temp_memory_size) + return temp_memory_size_; +} +inline void MemoryStats::set_temp_memory_size(::google::protobuf::int64 value) { + + temp_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryStats.temp_memory_size) +} + +// int64 persistent_memory_size = 3; +inline void MemoryStats::clear_persistent_memory_size() { + persistent_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryStats::persistent_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryStats.persistent_memory_size) + return persistent_memory_size_; +} +inline void MemoryStats::set_persistent_memory_size(::google::protobuf::int64 value) { + + persistent_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryStats.persistent_memory_size) +} + +// repeated int64 persistent_tensor_alloc_ids = 5; +inline int MemoryStats::persistent_tensor_alloc_ids_size() const { + return persistent_tensor_alloc_ids_.size(); +} +inline void MemoryStats::clear_persistent_tensor_alloc_ids() { + persistent_tensor_alloc_ids_.Clear(); +} +inline ::google::protobuf::int64 MemoryStats::persistent_tensor_alloc_ids(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryStats.persistent_tensor_alloc_ids) + return persistent_tensor_alloc_ids_.Get(index); +} +inline void MemoryStats::set_persistent_tensor_alloc_ids(int index, ::google::protobuf::int64 value) { + persistent_tensor_alloc_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryStats.persistent_tensor_alloc_ids) +} +inline void MemoryStats::add_persistent_tensor_alloc_ids(::google::protobuf::int64 value) { + persistent_tensor_alloc_ids_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.MemoryStats.persistent_tensor_alloc_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +MemoryStats::persistent_tensor_alloc_ids() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.MemoryStats.persistent_tensor_alloc_ids) + return persistent_tensor_alloc_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +MemoryStats::mutable_persistent_tensor_alloc_ids() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.MemoryStats.persistent_tensor_alloc_ids) + return &persistent_tensor_alloc_ids_; +} + +// int64 device_temp_memory_size = 2 [deprecated = true]; +inline void MemoryStats::clear_device_temp_memory_size() { + device_temp_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryStats::device_temp_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryStats.device_temp_memory_size) + return device_temp_memory_size_; +} +inline void MemoryStats::set_device_temp_memory_size(::google::protobuf::int64 value) { + + device_temp_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryStats.device_temp_memory_size) +} + +// int64 device_persistent_memory_size = 4 [deprecated = true]; +inline void MemoryStats::clear_device_persistent_memory_size() { + device_persistent_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 MemoryStats::device_persistent_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryStats.device_persistent_memory_size) + return device_persistent_memory_size_; +} +inline void MemoryStats::set_device_persistent_memory_size(::google::protobuf::int64 value) { + + device_persistent_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryStats.device_persistent_memory_size) +} + +// repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; +inline int MemoryStats::device_persistent_tensor_alloc_ids_size() const { + return device_persistent_tensor_alloc_ids_.size(); +} +inline void MemoryStats::clear_device_persistent_tensor_alloc_ids() { + device_persistent_tensor_alloc_ids_.Clear(); +} +inline ::google::protobuf::int64 MemoryStats::device_persistent_tensor_alloc_ids(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.MemoryStats.device_persistent_tensor_alloc_ids) + return device_persistent_tensor_alloc_ids_.Get(index); +} +inline void MemoryStats::set_device_persistent_tensor_alloc_ids(int index, ::google::protobuf::int64 value) { + device_persistent_tensor_alloc_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.MemoryStats.device_persistent_tensor_alloc_ids) +} +inline void MemoryStats::add_device_persistent_tensor_alloc_ids(::google::protobuf::int64 value) { + device_persistent_tensor_alloc_ids_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.MemoryStats.device_persistent_tensor_alloc_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +MemoryStats::device_persistent_tensor_alloc_ids() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.MemoryStats.device_persistent_tensor_alloc_ids) + return device_persistent_tensor_alloc_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +MemoryStats::mutable_device_persistent_tensor_alloc_ids() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.MemoryStats.device_persistent_tensor_alloc_ids) + return &device_persistent_tensor_alloc_ids_; +} + +// ------------------------------------------------------------------- + +// NodeExecStats + +// string node_name = 1; +inline void NodeExecStats::clear_node_name() { + node_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeExecStats::node_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.node_name) + return node_name_.Get(); +} +inline void NodeExecStats::set_node_name(const ::std::string& value) { + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.node_name) +} +#if LANG_CXX11 +inline void NodeExecStats::set_node_name(::std::string&& value) { + + node_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NodeExecStats.node_name) +} +#endif +inline void NodeExecStats::set_node_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NodeExecStats.node_name) +} +inline void NodeExecStats::set_node_name(const char* value, + size_t size) { + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NodeExecStats.node_name) +} +inline ::std::string* NodeExecStats::mutable_node_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeExecStats.node_name) + return node_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeExecStats::release_node_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeExecStats.node_name) + + return node_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void NodeExecStats::set_allocated_node_name(::std::string* node_name) { + if (node_name != NULL) { + + } else { + + } + node_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), node_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeExecStats.node_name) +} +inline ::std::string* NodeExecStats::unsafe_arena_release_node_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeExecStats.node_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return node_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeExecStats::unsafe_arena_set_allocated_node_name( + ::std::string* node_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (node_name != NULL) { + + } else { + + } + node_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + node_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeExecStats.node_name) +} + +// int64 all_start_micros = 2; +inline void NodeExecStats::clear_all_start_micros() { + all_start_micros_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::all_start_micros() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.all_start_micros) + return all_start_micros_; +} +inline void NodeExecStats::set_all_start_micros(::google::protobuf::int64 value) { + + all_start_micros_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.all_start_micros) +} + +// int64 op_start_rel_micros = 3; +inline void NodeExecStats::clear_op_start_rel_micros() { + op_start_rel_micros_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::op_start_rel_micros() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.op_start_rel_micros) + return op_start_rel_micros_; +} +inline void NodeExecStats::set_op_start_rel_micros(::google::protobuf::int64 value) { + + op_start_rel_micros_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.op_start_rel_micros) +} + +// int64 op_end_rel_micros = 4; +inline void NodeExecStats::clear_op_end_rel_micros() { + op_end_rel_micros_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::op_end_rel_micros() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.op_end_rel_micros) + return op_end_rel_micros_; +} +inline void NodeExecStats::set_op_end_rel_micros(::google::protobuf::int64 value) { + + op_end_rel_micros_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.op_end_rel_micros) +} + +// int64 all_end_rel_micros = 5; +inline void NodeExecStats::clear_all_end_rel_micros() { + all_end_rel_micros_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::all_end_rel_micros() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.all_end_rel_micros) + return all_end_rel_micros_; +} +inline void NodeExecStats::set_all_end_rel_micros(::google::protobuf::int64 value) { + + all_end_rel_micros_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.all_end_rel_micros) +} + +// repeated .diplomacy.tensorflow.AllocatorMemoryUsed memory = 6; +inline int NodeExecStats::memory_size() const { + return memory_.size(); +} +inline void NodeExecStats::clear_memory() { + memory_.Clear(); +} +inline ::diplomacy::tensorflow::AllocatorMemoryUsed* NodeExecStats::mutable_memory(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeExecStats.memory) + return memory_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocatorMemoryUsed >* +NodeExecStats::mutable_memory() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.NodeExecStats.memory) + return &memory_; +} +inline const ::diplomacy::tensorflow::AllocatorMemoryUsed& NodeExecStats::memory(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.memory) + return memory_.Get(index); +} +inline ::diplomacy::tensorflow::AllocatorMemoryUsed* NodeExecStats::add_memory() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NodeExecStats.memory) + return memory_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocatorMemoryUsed >& +NodeExecStats::memory() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.NodeExecStats.memory) + return memory_; +} + +// repeated .diplomacy.tensorflow.NodeOutput output = 7; +inline int NodeExecStats::output_size() const { + return output_.size(); +} +inline void NodeExecStats::clear_output() { + output_.Clear(); +} +inline ::diplomacy::tensorflow::NodeOutput* NodeExecStats::mutable_output(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeExecStats.output) + return output_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeOutput >* +NodeExecStats::mutable_output() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.NodeExecStats.output) + return &output_; +} +inline const ::diplomacy::tensorflow::NodeOutput& NodeExecStats::output(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.output) + return output_.Get(index); +} +inline ::diplomacy::tensorflow::NodeOutput* NodeExecStats::add_output() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NodeExecStats.output) + return output_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeOutput >& +NodeExecStats::output() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.NodeExecStats.output) + return output_; +} + +// string timeline_label = 8; +inline void NodeExecStats::clear_timeline_label() { + timeline_label_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeExecStats::timeline_label() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.timeline_label) + return timeline_label_.Get(); +} +inline void NodeExecStats::set_timeline_label(const ::std::string& value) { + + timeline_label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.timeline_label) +} +#if LANG_CXX11 +inline void NodeExecStats::set_timeline_label(::std::string&& value) { + + timeline_label_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.NodeExecStats.timeline_label) +} +#endif +inline void NodeExecStats::set_timeline_label(const char* value) { + GOOGLE_DCHECK(value != NULL); + + timeline_label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.NodeExecStats.timeline_label) +} +inline void NodeExecStats::set_timeline_label(const char* value, + size_t size) { + + timeline_label_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.NodeExecStats.timeline_label) +} +inline ::std::string* NodeExecStats::mutable_timeline_label() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeExecStats.timeline_label) + return timeline_label_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeExecStats::release_timeline_label() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeExecStats.timeline_label) + + return timeline_label_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void NodeExecStats::set_allocated_timeline_label(::std::string* timeline_label) { + if (timeline_label != NULL) { + + } else { + + } + timeline_label_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), timeline_label, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeExecStats.timeline_label) +} +inline ::std::string* NodeExecStats::unsafe_arena_release_timeline_label() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeExecStats.timeline_label) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return timeline_label_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeExecStats::unsafe_arena_set_allocated_timeline_label( + ::std::string* timeline_label) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (timeline_label != NULL) { + + } else { + + } + timeline_label_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + timeline_label, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.NodeExecStats.timeline_label) +} + +// int64 scheduled_micros = 9; +inline void NodeExecStats::clear_scheduled_micros() { + scheduled_micros_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::scheduled_micros() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.scheduled_micros) + return scheduled_micros_; +} +inline void NodeExecStats::set_scheduled_micros(::google::protobuf::int64 value) { + + scheduled_micros_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.scheduled_micros) +} + +// uint32 thread_id = 10; +inline void NodeExecStats::clear_thread_id() { + thread_id_ = 0u; +} +inline ::google::protobuf::uint32 NodeExecStats::thread_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.thread_id) + return thread_id_; +} +inline void NodeExecStats::set_thread_id(::google::protobuf::uint32 value) { + + thread_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.thread_id) +} + +// repeated .diplomacy.tensorflow.AllocationDescription referenced_tensor = 11; +inline int NodeExecStats::referenced_tensor_size() const { + return referenced_tensor_.size(); +} +inline ::diplomacy::tensorflow::AllocationDescription* NodeExecStats::mutable_referenced_tensor(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeExecStats.referenced_tensor) + return referenced_tensor_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationDescription >* +NodeExecStats::mutable_referenced_tensor() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.NodeExecStats.referenced_tensor) + return &referenced_tensor_; +} +inline const ::diplomacy::tensorflow::AllocationDescription& NodeExecStats::referenced_tensor(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.referenced_tensor) + return referenced_tensor_.Get(index); +} +inline ::diplomacy::tensorflow::AllocationDescription* NodeExecStats::add_referenced_tensor() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.NodeExecStats.referenced_tensor) + return referenced_tensor_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::AllocationDescription >& +NodeExecStats::referenced_tensor() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.NodeExecStats.referenced_tensor) + return referenced_tensor_; +} + +// .diplomacy.tensorflow.MemoryStats memory_stats = 12; +inline bool NodeExecStats::has_memory_stats() const { + return this != internal_default_instance() && memory_stats_ != NULL; +} +inline void NodeExecStats::clear_memory_stats() { + if (GetArenaNoVirtual() == NULL && memory_stats_ != NULL) { + delete memory_stats_; + } + memory_stats_ = NULL; +} +inline const ::diplomacy::tensorflow::MemoryStats& NodeExecStats::_internal_memory_stats() const { + return *memory_stats_; +} +inline const ::diplomacy::tensorflow::MemoryStats& NodeExecStats::memory_stats() const { + const ::diplomacy::tensorflow::MemoryStats* p = memory_stats_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.memory_stats) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_MemoryStats_default_instance_); +} +inline ::diplomacy::tensorflow::MemoryStats* NodeExecStats::release_memory_stats() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.NodeExecStats.memory_stats) + + ::diplomacy::tensorflow::MemoryStats* temp = memory_stats_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + memory_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::MemoryStats* NodeExecStats::unsafe_arena_release_memory_stats() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.NodeExecStats.memory_stats) + + ::diplomacy::tensorflow::MemoryStats* temp = memory_stats_; + memory_stats_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::MemoryStats* NodeExecStats::mutable_memory_stats() { + + if (memory_stats_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::MemoryStats>(GetArenaNoVirtual()); + memory_stats_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.NodeExecStats.memory_stats) + return memory_stats_; +} +inline void NodeExecStats::set_allocated_memory_stats(::diplomacy::tensorflow::MemoryStats* memory_stats) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete memory_stats_; + } + if (memory_stats) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(memory_stats); + if (message_arena != submessage_arena) { + memory_stats = ::google::protobuf::internal::GetOwnedMessage( + message_arena, memory_stats, submessage_arena); + } + + } else { + + } + memory_stats_ = memory_stats; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.NodeExecStats.memory_stats) +} + +// int64 all_start_nanos = 13; +inline void NodeExecStats::clear_all_start_nanos() { + all_start_nanos_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::all_start_nanos() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.all_start_nanos) + return all_start_nanos_; +} +inline void NodeExecStats::set_all_start_nanos(::google::protobuf::int64 value) { + + all_start_nanos_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.all_start_nanos) +} + +// int64 op_start_rel_nanos = 14; +inline void NodeExecStats::clear_op_start_rel_nanos() { + op_start_rel_nanos_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::op_start_rel_nanos() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.op_start_rel_nanos) + return op_start_rel_nanos_; +} +inline void NodeExecStats::set_op_start_rel_nanos(::google::protobuf::int64 value) { + + op_start_rel_nanos_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.op_start_rel_nanos) +} + +// int64 op_end_rel_nanos = 15; +inline void NodeExecStats::clear_op_end_rel_nanos() { + op_end_rel_nanos_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::op_end_rel_nanos() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.op_end_rel_nanos) + return op_end_rel_nanos_; +} +inline void NodeExecStats::set_op_end_rel_nanos(::google::protobuf::int64 value) { + + op_end_rel_nanos_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.op_end_rel_nanos) +} + +// int64 all_end_rel_nanos = 16; +inline void NodeExecStats::clear_all_end_rel_nanos() { + all_end_rel_nanos_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::all_end_rel_nanos() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.all_end_rel_nanos) + return all_end_rel_nanos_; +} +inline void NodeExecStats::set_all_end_rel_nanos(::google::protobuf::int64 value) { + + all_end_rel_nanos_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.all_end_rel_nanos) +} + +// int64 scheduled_nanos = 17; +inline void NodeExecStats::clear_scheduled_nanos() { + scheduled_nanos_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 NodeExecStats::scheduled_nanos() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NodeExecStats.scheduled_nanos) + return scheduled_nanos_; +} +inline void NodeExecStats::set_scheduled_nanos(::google::protobuf::int64 value) { + + scheduled_nanos_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NodeExecStats.scheduled_nanos) +} + +// ------------------------------------------------------------------- + +// DeviceStepStats + +// string device = 1; +inline void DeviceStepStats::clear_device() { + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& DeviceStepStats::device() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceStepStats.device) + return device_.Get(); +} +inline void DeviceStepStats::set_device(const ::std::string& value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.DeviceStepStats.device) +} +#if LANG_CXX11 +inline void DeviceStepStats::set_device(::std::string&& value) { + + device_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.DeviceStepStats.device) +} +#endif +inline void DeviceStepStats::set_device(const char* value) { + GOOGLE_DCHECK(value != NULL); + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.DeviceStepStats.device) +} +inline void DeviceStepStats::set_device(const char* value, + size_t size) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.DeviceStepStats.device) +} +inline ::std::string* DeviceStepStats::mutable_device() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.DeviceStepStats.device) + return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* DeviceStepStats::release_device() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.DeviceStepStats.device) + + return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void DeviceStepStats::set_allocated_device(::std::string* device) { + if (device != NULL) { + + } else { + + } + device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.DeviceStepStats.device) +} +inline ::std::string* DeviceStepStats::unsafe_arena_release_device() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.DeviceStepStats.device) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void DeviceStepStats::unsafe_arena_set_allocated_device( + ::std::string* device) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device != NULL) { + + } else { + + } + device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.DeviceStepStats.device) +} + +// repeated .diplomacy.tensorflow.NodeExecStats node_stats = 2; +inline int DeviceStepStats::node_stats_size() const { + return node_stats_.size(); +} +inline void DeviceStepStats::clear_node_stats() { + node_stats_.Clear(); +} +inline ::diplomacy::tensorflow::NodeExecStats* DeviceStepStats::mutable_node_stats(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.DeviceStepStats.node_stats) + return node_stats_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeExecStats >* +DeviceStepStats::mutable_node_stats() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.DeviceStepStats.node_stats) + return &node_stats_; +} +inline const ::diplomacy::tensorflow::NodeExecStats& DeviceStepStats::node_stats(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.DeviceStepStats.node_stats) + return node_stats_.Get(index); +} +inline ::diplomacy::tensorflow::NodeExecStats* DeviceStepStats::add_node_stats() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.DeviceStepStats.node_stats) + return node_stats_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::NodeExecStats >& +DeviceStepStats::node_stats() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.DeviceStepStats.node_stats) + return node_stats_; +} + +// ------------------------------------------------------------------- + +// StepStats + +// repeated .diplomacy.tensorflow.DeviceStepStats dev_stats = 1; +inline int StepStats::dev_stats_size() const { + return dev_stats_.size(); +} +inline void StepStats::clear_dev_stats() { + dev_stats_.Clear(); +} +inline ::diplomacy::tensorflow::DeviceStepStats* StepStats::mutable_dev_stats(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.StepStats.dev_stats) + return dev_stats_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::DeviceStepStats >* +StepStats::mutable_dev_stats() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.StepStats.dev_stats) + return &dev_stats_; +} +inline const ::diplomacy::tensorflow::DeviceStepStats& StepStats::dev_stats(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.StepStats.dev_stats) + return dev_stats_.Get(index); +} +inline ::diplomacy::tensorflow::DeviceStepStats* StepStats::add_dev_stats() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.StepStats.dev_stats) + return dev_stats_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::DeviceStepStats >& +StepStats::dev_stats() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.StepStats.dev_stats) + return dev_stats_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fstep_5fstats_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.proto new file mode 100644 index 0000000..abdff79 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "StepStatsProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/allocation_description.proto"; +import "diplomacy_tensorflow/core/framework/tensor_description.proto"; + +// An allocation/de-allocation operation performed by the allocator. +message AllocationRecord { + // The timestamp of the operation. + int64 alloc_micros = 1; + // Number of bytes allocated, or de-allocated if negative. + int64 alloc_bytes = 2; +} + +message AllocatorMemoryUsed { + string allocator_name = 1; + // These are per-node allocator memory stats. + int64 total_bytes = 2; + int64 peak_bytes = 3; + // The bytes that are not deallocated. + int64 live_bytes = 4; + // The allocation and deallocation timeline. + repeated AllocationRecord allocation_records = 6; + + // These are snapshots of the overall allocator memory stats. + // The number of live bytes currently allocated by the allocator. + int64 allocator_bytes_in_use = 5; +} + +// Output sizes recorded for a single execution of a graph node. +message NodeOutput { + int32 slot = 1; + TensorDescription tensor_description = 3; +}; + +// For memory tracking. +message MemoryStats { + int64 temp_memory_size = 1; + int64 persistent_memory_size = 3; + repeated int64 persistent_tensor_alloc_ids = 5; + + int64 device_temp_memory_size = 2 [deprecated = true]; + int64 device_persistent_memory_size = 4 [deprecated = true]; + repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; +} + +// Time/size stats recorded for a single execution of a graph node. +message NodeExecStats { + // TODO(tucker): Use some more compact form of node identity than + // the full string name. Either all processes should agree on a + // global id (cost_id?) for each node, or we should use a hash of + // the name. + string node_name = 1; + int64 all_start_micros = 2; + int64 op_start_rel_micros = 3; + int64 op_end_rel_micros = 4; + int64 all_end_rel_micros = 5; + repeated AllocatorMemoryUsed memory = 6; + repeated NodeOutput output = 7; + string timeline_label = 8; + int64 scheduled_micros = 9; + uint32 thread_id = 10; + repeated AllocationDescription referenced_tensor = 11; + MemoryStats memory_stats = 12; + int64 all_start_nanos = 13; + int64 op_start_rel_nanos = 14; + int64 op_end_rel_nanos = 15; + int64 all_end_rel_nanos = 16; + int64 scheduled_nanos = 17; +}; + +message DeviceStepStats { + string device = 1; + repeated NodeExecStats node_stats = 2; +} + +message StepStats { + repeated DeviceStepStats dev_stats = 1; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats_pb2.py new file mode 100644 index 0000000..4e3607b --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/step_stats_pb2.py @@ -0,0 +1,521 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/step_stats.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import allocation_description_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_allocation__description__pb2 +from diplomacy_tensorflow.core.framework import tensor_description_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__description__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/step_stats.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\017StepStatsProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n4diplomacy_tensorflow/core/framework/step_stats.proto\x12\x14\x64iplomacy.tensorflow\x1a@diplomacy_tensorflow/core/framework/allocation_description.proto\x1a + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_HistogramProto; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SummaryMetadata_PluginData; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Summary_Audio; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Summary_Image; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_SummaryMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto ::google::protobuf::internal::SCCInfo<5> scc_info_Summary_Value; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace diplomacy { +namespace tensorflow { +class SummaryDescriptionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SummaryDescription_default_instance_; +class HistogramProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _HistogramProto_default_instance_; +class SummaryMetadata_PluginDataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SummaryMetadata_PluginData_default_instance_; +class SummaryMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SummaryMetadata_default_instance_; +class Summary_ImageDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Summary_Image_default_instance_; +class Summary_AudioDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Summary_Audio_default_instance_; +class Summary_ValueDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + float simple_value_; + ::google::protobuf::internal::ArenaStringPtr obsolete_old_style_histogram_; + const ::diplomacy::tensorflow::Summary_Image* image_; + const ::diplomacy::tensorflow::HistogramProto* histo_; + const ::diplomacy::tensorflow::Summary_Audio* audio_; + const ::diplomacy::tensorflow::TensorProto* tensor_; +} _Summary_Value_default_instance_; +class SummaryDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Summary_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto { +static void InitDefaultsSummaryDescription() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_SummaryDescription_default_instance_; + new (ptr) ::diplomacy::tensorflow::SummaryDescription(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::SummaryDescription::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SummaryDescription = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSummaryDescription}, {}}; + +static void InitDefaultsHistogramProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_HistogramProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::HistogramProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::HistogramProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_HistogramProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsHistogramProto}, {}}; + +static void InitDefaultsSummaryMetadata_PluginData() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_SummaryMetadata_PluginData_default_instance_; + new (ptr) ::diplomacy::tensorflow::SummaryMetadata_PluginData(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::SummaryMetadata_PluginData::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SummaryMetadata_PluginData = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSummaryMetadata_PluginData}, {}}; + +static void InitDefaultsSummaryMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_SummaryMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::SummaryMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::SummaryMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_SummaryMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSummaryMetadata}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata_PluginData.base,}}; + +static void InitDefaultsSummary_Image() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Summary_Image_default_instance_; + new (ptr) ::diplomacy::tensorflow::Summary_Image(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Summary_Image::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Summary_Image = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSummary_Image}, {}}; + +static void InitDefaultsSummary_Audio() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Summary_Audio_default_instance_; + new (ptr) ::diplomacy::tensorflow::Summary_Audio(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Summary_Audio::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Summary_Audio = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSummary_Audio}, {}}; + +static void InitDefaultsSummary_Value() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Summary_Value_default_instance_; + new (ptr) ::diplomacy::tensorflow::Summary_Value(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Summary_Value::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<5> scc_info_Summary_Value = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 5, InitDefaultsSummary_Value}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Image.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_HistogramProto.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Audio.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base,}}; + +static void InitDefaultsSummary() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_Summary_default_instance_; + new (ptr) ::diplomacy::tensorflow::Summary(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::Summary::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Summary = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsSummary}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Value.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_SummaryDescription.base); + ::google::protobuf::internal::InitSCC(&scc_info_HistogramProto.base); + ::google::protobuf::internal::InitSCC(&scc_info_SummaryMetadata_PluginData.base); + ::google::protobuf::internal::InitSCC(&scc_info_SummaryMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_Summary_Image.base); + ::google::protobuf::internal::InitSCC(&scc_info_Summary_Audio.base); + ::google::protobuf::internal::InitSCC(&scc_info_Summary_Value.base); + ::google::protobuf::internal::InitSCC(&scc_info_Summary.base); +} + +::google::protobuf::Metadata file_level_metadata[8]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryDescription, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryDescription, type_hint_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, min_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, max_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, sum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, sum_squares_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, bucket_limit_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::HistogramProto, bucket_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryMetadata_PluginData, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryMetadata_PluginData, plugin_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryMetadata_PluginData, content_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryMetadata, plugin_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryMetadata, display_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SummaryMetadata, summary_description_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Image, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Image, height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Image, width_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Image, colorspace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Image, encoded_image_string_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Audio, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Audio, sample_rate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Audio, num_channels_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Audio, length_frames_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Audio, encoded_audio_string_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Audio, content_type_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Value, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Value, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Value, node_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Value, tag_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Value, metadata_), + offsetof(::diplomacy::tensorflow::Summary_ValueDefaultTypeInternal, simple_value_), + offsetof(::diplomacy::tensorflow::Summary_ValueDefaultTypeInternal, obsolete_old_style_histogram_), + offsetof(::diplomacy::tensorflow::Summary_ValueDefaultTypeInternal, image_), + offsetof(::diplomacy::tensorflow::Summary_ValueDefaultTypeInternal, histo_), + offsetof(::diplomacy::tensorflow::Summary_ValueDefaultTypeInternal, audio_), + offsetof(::diplomacy::tensorflow::Summary_ValueDefaultTypeInternal, tensor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary_Value, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::Summary, value_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::SummaryDescription)}, + { 6, -1, sizeof(::diplomacy::tensorflow::HistogramProto)}, + { 18, -1, sizeof(::diplomacy::tensorflow::SummaryMetadata_PluginData)}, + { 25, -1, sizeof(::diplomacy::tensorflow::SummaryMetadata)}, + { 33, -1, sizeof(::diplomacy::tensorflow::Summary_Image)}, + { 42, -1, sizeof(::diplomacy::tensorflow::Summary_Audio)}, + { 52, -1, sizeof(::diplomacy::tensorflow::Summary_Value)}, + { 67, -1, sizeof(::diplomacy::tensorflow::Summary)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_SummaryDescription_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_HistogramProto_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_SummaryMetadata_PluginData_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_SummaryMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Summary_Image_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Summary_Audio_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Summary_Value_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_Summary_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/summary.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 8); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n1diplomacy_tensorflow/core/framework/su" + "mmary.proto\022\024diplomacy.tensorflow\0320diplo" + "macy_tensorflow/core/framework/tensor.pr" + "oto\"\'\n\022SummaryDescription\022\021\n\ttype_hint\030\001" + " \001(\t\"\207\001\n\016HistogramProto\022\013\n\003min\030\001 \001(\001\022\013\n\003" + "max\030\002 \001(\001\022\013\n\003num\030\003 \001(\001\022\013\n\003sum\030\004 \001(\001\022\023\n\013s" + "um_squares\030\005 \001(\001\022\030\n\014bucket_limit\030\006 \003(\001B\002" + "\020\001\022\022\n\006bucket\030\007 \003(\001B\002\020\001\"\277\001\n\017SummaryMetada" + "ta\022E\n\013plugin_data\030\001 \001(\01320.diplomacy.tens" + "orflow.SummaryMetadata.PluginData\022\024\n\014dis" + "play_name\030\002 \001(\t\022\033\n\023summary_description\030\003" + " \001(\t\0322\n\nPluginData\022\023\n\013plugin_name\030\001 \001(\t\022" + "\017\n\007content\030\002 \001(\014\"\232\005\n\007Summary\0222\n\005value\030\001 " + "\003(\0132#.diplomacy.tensorflow.Summary.Value" + "\032X\n\005Image\022\016\n\006height\030\001 \001(\005\022\r\n\005width\030\002 \001(\005" + "\022\022\n\ncolorspace\030\003 \001(\005\022\034\n\024encoded_image_st" + "ring\030\004 \001(\014\032}\n\005Audio\022\023\n\013sample_rate\030\001 \001(\002" + "\022\024\n\014num_channels\030\002 \001(\003\022\025\n\rlength_frames\030" + "\003 \001(\003\022\034\n\024encoded_audio_string\030\004 \001(\014\022\024\n\014c" + "ontent_type\030\005 \001(\t\032\201\003\n\005Value\022\021\n\tnode_name" + "\030\007 \001(\t\022\013\n\003tag\030\001 \001(\t\0227\n\010metadata\030\t \001(\0132%." + "diplomacy.tensorflow.SummaryMetadata\022\026\n\014" + "simple_value\030\002 \001(\002H\000\022&\n\034obsolete_old_sty" + "le_histogram\030\003 \001(\014H\000\0224\n\005image\030\004 \001(\0132#.di" + "plomacy.tensorflow.Summary.ImageH\000\0225\n\005hi" + "sto\030\005 \001(\0132$.diplomacy.tensorflow.Histogr" + "amProtoH\000\0224\n\005audio\030\006 \001(\0132#.diplomacy.ten" + "sorflow.Summary.AudioH\000\0223\n\006tensor\030\010 \001(\0132" + "!.diplomacy.tensorflow.TensorProtoH\000B\007\n\005" + "valueBm\n\030org.tensorflow.frameworkB\rSumma" + "ryProtosP\001Z=github.com/tensorflow/tensor" + "flow/tensorflow/go/core/framework\370\001\001b\006pr" + "oto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1284); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/summary.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void SummaryDescription::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SummaryDescription::kTypeHintFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SummaryDescription::SummaryDescription() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryDescription.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.SummaryDescription) +} +SummaryDescription::SummaryDescription(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryDescription.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.SummaryDescription) +} +SummaryDescription::SummaryDescription(const SummaryDescription& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + type_hint_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.type_hint().size() > 0) { + type_hint_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_hint(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.SummaryDescription) +} + +void SummaryDescription::SharedCtor() { + type_hint_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +SummaryDescription::~SummaryDescription() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.SummaryDescription) + SharedDtor(); +} + +void SummaryDescription::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + type_hint_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SummaryDescription::ArenaDtor(void* object) { + SummaryDescription* _this = reinterpret_cast< SummaryDescription* >(object); + (void)_this; +} +void SummaryDescription::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SummaryDescription::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SummaryDescription::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SummaryDescription& SummaryDescription::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryDescription.base); + return *internal_default_instance(); +} + + +void SummaryDescription::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.SummaryDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + type_hint_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool SummaryDescription::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.SummaryDescription) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string type_hint = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_hint())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_hint().data(), static_cast(this->type_hint().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.SummaryDescription.type_hint")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.SummaryDescription) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.SummaryDescription) + return false; +#undef DO_ +} + +void SummaryDescription::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.SummaryDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string type_hint = 1; + if (this->type_hint().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_hint().data(), static_cast(this->type_hint().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryDescription.type_hint"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->type_hint(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.SummaryDescription) +} + +::google::protobuf::uint8* SummaryDescription::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.SummaryDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string type_hint = 1; + if (this->type_hint().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_hint().data(), static_cast(this->type_hint().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryDescription.type_hint"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->type_hint(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.SummaryDescription) + return target; +} + +size_t SummaryDescription::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.SummaryDescription) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string type_hint = 1; + if (this->type_hint().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_hint()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SummaryDescription::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.SummaryDescription) + GOOGLE_DCHECK_NE(&from, this); + const SummaryDescription* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.SummaryDescription) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.SummaryDescription) + MergeFrom(*source); + } +} + +void SummaryDescription::MergeFrom(const SummaryDescription& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.SummaryDescription) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.type_hint().size() > 0) { + set_type_hint(from.type_hint()); + } +} + +void SummaryDescription::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.SummaryDescription) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SummaryDescription::CopyFrom(const SummaryDescription& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.SummaryDescription) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SummaryDescription::IsInitialized() const { + return true; +} + +void SummaryDescription::Swap(SummaryDescription* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SummaryDescription* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SummaryDescription::UnsafeArenaSwap(SummaryDescription* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SummaryDescription::InternalSwap(SummaryDescription* other) { + using std::swap; + type_hint_.Swap(&other->type_hint_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SummaryDescription::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void HistogramProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HistogramProto::kMinFieldNumber; +const int HistogramProto::kMaxFieldNumber; +const int HistogramProto::kNumFieldNumber; +const int HistogramProto::kSumFieldNumber; +const int HistogramProto::kSumSquaresFieldNumber; +const int HistogramProto::kBucketLimitFieldNumber; +const int HistogramProto::kBucketFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HistogramProto::HistogramProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_HistogramProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.HistogramProto) +} +HistogramProto::HistogramProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + bucket_limit_(arena), + bucket_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_HistogramProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.HistogramProto) +} +HistogramProto::HistogramProto(const HistogramProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + bucket_limit_(from.bucket_limit_), + bucket_(from.bucket_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&min_, &from.min_, + static_cast(reinterpret_cast(&sum_squares_) - + reinterpret_cast(&min_)) + sizeof(sum_squares_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.HistogramProto) +} + +void HistogramProto::SharedCtor() { + ::memset(&min_, 0, static_cast( + reinterpret_cast(&sum_squares_) - + reinterpret_cast(&min_)) + sizeof(sum_squares_)); +} + +HistogramProto::~HistogramProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.HistogramProto) + SharedDtor(); +} + +void HistogramProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void HistogramProto::ArenaDtor(void* object) { + HistogramProto* _this = reinterpret_cast< HistogramProto* >(object); + (void)_this; +} +void HistogramProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void HistogramProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* HistogramProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const HistogramProto& HistogramProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_HistogramProto.base); + return *internal_default_instance(); +} + + +void HistogramProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.HistogramProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + bucket_limit_.Clear(); + bucket_.Clear(); + ::memset(&min_, 0, static_cast( + reinterpret_cast(&sum_squares_) - + reinterpret_cast(&min_)) + sizeof(sum_squares_)); + _internal_metadata_.Clear(); +} + +bool HistogramProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.HistogramProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // double min = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &min_))); + } else { + goto handle_unusual; + } + break; + } + + // double max = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &max_))); + } else { + goto handle_unusual; + } + break; + } + + // double num = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(25u /* 25 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &num_))); + } else { + goto handle_unusual; + } + break; + } + + // double sum = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(33u /* 33 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &sum_))); + } else { + goto handle_unusual; + } + break; + } + + // double sum_squares = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(41u /* 41 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &sum_squares_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated double bucket_limit = 6 [packed = true]; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_bucket_limit()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(49u /* 49 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 50u, input, this->mutable_bucket_limit()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated double bucket = 7 [packed = true]; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_bucket()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(57u /* 57 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 58u, input, this->mutable_bucket()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.HistogramProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.HistogramProto) + return false; +#undef DO_ +} + +void HistogramProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.HistogramProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double min = 1; + if (this->min() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->min(), output); + } + + // double max = 2; + if (this->max() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->max(), output); + } + + // double num = 3; + if (this->num() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->num(), output); + } + + // double sum = 4; + if (this->sum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(4, this->sum(), output); + } + + // double sum_squares = 5; + if (this->sum_squares() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(5, this->sum_squares(), output); + } + + // repeated double bucket_limit = 6 [packed = true]; + if (this->bucket_limit_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _bucket_limit_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteDoubleArray( + this->bucket_limit().data(), this->bucket_limit_size(), output); + } + + // repeated double bucket = 7 [packed = true]; + if (this->bucket_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _bucket_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteDoubleArray( + this->bucket().data(), this->bucket_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.HistogramProto) +} + +::google::protobuf::uint8* HistogramProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.HistogramProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double min = 1; + if (this->min() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->min(), target); + } + + // double max = 2; + if (this->max() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->max(), target); + } + + // double num = 3; + if (this->num() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(3, this->num(), target); + } + + // double sum = 4; + if (this->sum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(4, this->sum(), target); + } + + // double sum_squares = 5; + if (this->sum_squares() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(5, this->sum_squares(), target); + } + + // repeated double bucket_limit = 6 [packed = true]; + if (this->bucket_limit_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _bucket_limit_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->bucket_limit_, target); + } + + // repeated double bucket = 7 [packed = true]; + if (this->bucket_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 7, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _bucket_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->bucket_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.HistogramProto) + return target; +} + +size_t HistogramProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.HistogramProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated double bucket_limit = 6 [packed = true]; + { + unsigned int count = static_cast(this->bucket_limit_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _bucket_limit_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double bucket = 7 [packed = true]; + { + unsigned int count = static_cast(this->bucket_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _bucket_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // double min = 1; + if (this->min() != 0) { + total_size += 1 + 8; + } + + // double max = 2; + if (this->max() != 0) { + total_size += 1 + 8; + } + + // double num = 3; + if (this->num() != 0) { + total_size += 1 + 8; + } + + // double sum = 4; + if (this->sum() != 0) { + total_size += 1 + 8; + } + + // double sum_squares = 5; + if (this->sum_squares() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HistogramProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.HistogramProto) + GOOGLE_DCHECK_NE(&from, this); + const HistogramProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.HistogramProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.HistogramProto) + MergeFrom(*source); + } +} + +void HistogramProto::MergeFrom(const HistogramProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.HistogramProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + bucket_limit_.MergeFrom(from.bucket_limit_); + bucket_.MergeFrom(from.bucket_); + if (from.min() != 0) { + set_min(from.min()); + } + if (from.max() != 0) { + set_max(from.max()); + } + if (from.num() != 0) { + set_num(from.num()); + } + if (from.sum() != 0) { + set_sum(from.sum()); + } + if (from.sum_squares() != 0) { + set_sum_squares(from.sum_squares()); + } +} + +void HistogramProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.HistogramProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HistogramProto::CopyFrom(const HistogramProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.HistogramProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HistogramProto::IsInitialized() const { + return true; +} + +void HistogramProto::Swap(HistogramProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + HistogramProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void HistogramProto::UnsafeArenaSwap(HistogramProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void HistogramProto::InternalSwap(HistogramProto* other) { + using std::swap; + bucket_limit_.InternalSwap(&other->bucket_limit_); + bucket_.InternalSwap(&other->bucket_); + swap(min_, other->min_); + swap(max_, other->max_); + swap(num_, other->num_); + swap(sum_, other->sum_); + swap(sum_squares_, other->sum_squares_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata HistogramProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SummaryMetadata_PluginData::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SummaryMetadata_PluginData::kPluginNameFieldNumber; +const int SummaryMetadata_PluginData::kContentFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SummaryMetadata_PluginData::SummaryMetadata_PluginData() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata_PluginData.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.SummaryMetadata.PluginData) +} +SummaryMetadata_PluginData::SummaryMetadata_PluginData(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata_PluginData.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.SummaryMetadata.PluginData) +} +SummaryMetadata_PluginData::SummaryMetadata_PluginData(const SummaryMetadata_PluginData& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + plugin_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.plugin_name().size() > 0) { + plugin_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.plugin_name(), + GetArenaNoVirtual()); + } + content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.content().size() > 0) { + content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.content(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.SummaryMetadata.PluginData) +} + +void SummaryMetadata_PluginData::SharedCtor() { + plugin_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +SummaryMetadata_PluginData::~SummaryMetadata_PluginData() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.SummaryMetadata.PluginData) + SharedDtor(); +} + +void SummaryMetadata_PluginData::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + plugin_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + content_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SummaryMetadata_PluginData::ArenaDtor(void* object) { + SummaryMetadata_PluginData* _this = reinterpret_cast< SummaryMetadata_PluginData* >(object); + (void)_this; +} +void SummaryMetadata_PluginData::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SummaryMetadata_PluginData::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SummaryMetadata_PluginData::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SummaryMetadata_PluginData& SummaryMetadata_PluginData::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata_PluginData.base); + return *internal_default_instance(); +} + + +void SummaryMetadata_PluginData::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + plugin_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool SummaryMetadata_PluginData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string plugin_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_plugin_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->plugin_name().data(), static_cast(this->plugin_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name")); + } else { + goto handle_unusual; + } + break; + } + + // bytes content = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_content())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.SummaryMetadata.PluginData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.SummaryMetadata.PluginData) + return false; +#undef DO_ +} + +void SummaryMetadata_PluginData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string plugin_name = 1; + if (this->plugin_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->plugin_name().data(), static_cast(this->plugin_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->plugin_name(), output); + } + + // bytes content = 2; + if (this->content().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->content(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.SummaryMetadata.PluginData) +} + +::google::protobuf::uint8* SummaryMetadata_PluginData::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string plugin_name = 1; + if (this->plugin_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->plugin_name().data(), static_cast(this->plugin_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->plugin_name(), target); + } + + // bytes content = 2; + if (this->content().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 2, this->content(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.SummaryMetadata.PluginData) + return target; +} + +size_t SummaryMetadata_PluginData::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string plugin_name = 1; + if (this->plugin_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->plugin_name()); + } + + // bytes content = 2; + if (this->content().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->content()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SummaryMetadata_PluginData::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + GOOGLE_DCHECK_NE(&from, this); + const SummaryMetadata_PluginData* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.SummaryMetadata.PluginData) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.SummaryMetadata.PluginData) + MergeFrom(*source); + } +} + +void SummaryMetadata_PluginData::MergeFrom(const SummaryMetadata_PluginData& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.plugin_name().size() > 0) { + set_plugin_name(from.plugin_name()); + } + if (from.content().size() > 0) { + set_content(from.content()); + } +} + +void SummaryMetadata_PluginData::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SummaryMetadata_PluginData::CopyFrom(const SummaryMetadata_PluginData& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.SummaryMetadata.PluginData) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SummaryMetadata_PluginData::IsInitialized() const { + return true; +} + +void SummaryMetadata_PluginData::Swap(SummaryMetadata_PluginData* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SummaryMetadata_PluginData* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SummaryMetadata_PluginData::UnsafeArenaSwap(SummaryMetadata_PluginData* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SummaryMetadata_PluginData::InternalSwap(SummaryMetadata_PluginData* other) { + using std::swap; + plugin_name_.Swap(&other->plugin_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + content_.Swap(&other->content_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SummaryMetadata_PluginData::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SummaryMetadata::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_SummaryMetadata_default_instance_._instance.get_mutable()->plugin_data_ = const_cast< ::diplomacy::tensorflow::SummaryMetadata_PluginData*>( + ::diplomacy::tensorflow::SummaryMetadata_PluginData::internal_default_instance()); +} +void SummaryMetadata::unsafe_arena_set_allocated_plugin_data( + ::diplomacy::tensorflow::SummaryMetadata_PluginData* plugin_data) { + if (GetArenaNoVirtual() == NULL) { + delete plugin_data_; + } + plugin_data_ = plugin_data; + if (plugin_data) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SummaryMetadata.plugin_data) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SummaryMetadata::kPluginDataFieldNumber; +const int SummaryMetadata::kDisplayNameFieldNumber; +const int SummaryMetadata::kSummaryDescriptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SummaryMetadata::SummaryMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.SummaryMetadata) +} +SummaryMetadata::SummaryMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.SummaryMetadata) +} +SummaryMetadata::SummaryMetadata(const SummaryMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + display_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.display_name().size() > 0) { + display_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.display_name(), + GetArenaNoVirtual()); + } + summary_description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.summary_description().size() > 0) { + summary_description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.summary_description(), + GetArenaNoVirtual()); + } + if (from.has_plugin_data()) { + plugin_data_ = new ::diplomacy::tensorflow::SummaryMetadata_PluginData(*from.plugin_data_); + } else { + plugin_data_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.SummaryMetadata) +} + +void SummaryMetadata::SharedCtor() { + display_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + summary_description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + plugin_data_ = NULL; +} + +SummaryMetadata::~SummaryMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.SummaryMetadata) + SharedDtor(); +} + +void SummaryMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + display_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + summary_description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete plugin_data_; +} + +void SummaryMetadata::ArenaDtor(void* object) { + SummaryMetadata* _this = reinterpret_cast< SummaryMetadata* >(object); + (void)_this; +} +void SummaryMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SummaryMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SummaryMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SummaryMetadata& SummaryMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_SummaryMetadata.base); + return *internal_default_instance(); +} + + +void SummaryMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.SummaryMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + display_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + summary_description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && plugin_data_ != NULL) { + delete plugin_data_; + } + plugin_data_ = NULL; + _internal_metadata_.Clear(); +} + +bool SummaryMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.SummaryMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.SummaryMetadata.PluginData plugin_data = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_plugin_data())); + } else { + goto handle_unusual; + } + break; + } + + // string display_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_display_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->display_name().data(), static_cast(this->display_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.SummaryMetadata.display_name")); + } else { + goto handle_unusual; + } + break; + } + + // string summary_description = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_summary_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary_description().data(), static_cast(this->summary_description().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.SummaryMetadata.summary_description")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.SummaryMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.SummaryMetadata) + return false; +#undef DO_ +} + +void SummaryMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.SummaryMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.SummaryMetadata.PluginData plugin_data = 1; + if (this->has_plugin_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_plugin_data(), output); + } + + // string display_name = 2; + if (this->display_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->display_name().data(), static_cast(this->display_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryMetadata.display_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->display_name(), output); + } + + // string summary_description = 3; + if (this->summary_description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary_description().data(), static_cast(this->summary_description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryMetadata.summary_description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->summary_description(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.SummaryMetadata) +} + +::google::protobuf::uint8* SummaryMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.SummaryMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.SummaryMetadata.PluginData plugin_data = 1; + if (this->has_plugin_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_plugin_data(), deterministic, target); + } + + // string display_name = 2; + if (this->display_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->display_name().data(), static_cast(this->display_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryMetadata.display_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->display_name(), target); + } + + // string summary_description = 3; + if (this->summary_description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary_description().data(), static_cast(this->summary_description().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SummaryMetadata.summary_description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->summary_description(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.SummaryMetadata) + return target; +} + +size_t SummaryMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.SummaryMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string display_name = 2; + if (this->display_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->display_name()); + } + + // string summary_description = 3; + if (this->summary_description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->summary_description()); + } + + // .diplomacy.tensorflow.SummaryMetadata.PluginData plugin_data = 1; + if (this->has_plugin_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *plugin_data_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SummaryMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.SummaryMetadata) + GOOGLE_DCHECK_NE(&from, this); + const SummaryMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.SummaryMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.SummaryMetadata) + MergeFrom(*source); + } +} + +void SummaryMetadata::MergeFrom(const SummaryMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.SummaryMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.display_name().size() > 0) { + set_display_name(from.display_name()); + } + if (from.summary_description().size() > 0) { + set_summary_description(from.summary_description()); + } + if (from.has_plugin_data()) { + mutable_plugin_data()->::diplomacy::tensorflow::SummaryMetadata_PluginData::MergeFrom(from.plugin_data()); + } +} + +void SummaryMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.SummaryMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SummaryMetadata::CopyFrom(const SummaryMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.SummaryMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SummaryMetadata::IsInitialized() const { + return true; +} + +void SummaryMetadata::Swap(SummaryMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SummaryMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SummaryMetadata::UnsafeArenaSwap(SummaryMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SummaryMetadata::InternalSwap(SummaryMetadata* other) { + using std::swap; + display_name_.Swap(&other->display_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + summary_description_.Swap(&other->summary_description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(plugin_data_, other->plugin_data_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SummaryMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Summary_Image::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Summary_Image::kHeightFieldNumber; +const int Summary_Image::kWidthFieldNumber; +const int Summary_Image::kColorspaceFieldNumber; +const int Summary_Image::kEncodedImageStringFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Summary_Image::Summary_Image() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Image.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Summary.Image) +} +Summary_Image::Summary_Image(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Image.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Summary.Image) +} +Summary_Image::Summary_Image(const Summary_Image& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + encoded_image_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.encoded_image_string().size() > 0) { + encoded_image_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.encoded_image_string(), + GetArenaNoVirtual()); + } + ::memcpy(&height_, &from.height_, + static_cast(reinterpret_cast(&colorspace_) - + reinterpret_cast(&height_)) + sizeof(colorspace_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Summary.Image) +} + +void Summary_Image::SharedCtor() { + encoded_image_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&height_, 0, static_cast( + reinterpret_cast(&colorspace_) - + reinterpret_cast(&height_)) + sizeof(colorspace_)); +} + +Summary_Image::~Summary_Image() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Summary.Image) + SharedDtor(); +} + +void Summary_Image::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + encoded_image_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Summary_Image::ArenaDtor(void* object) { + Summary_Image* _this = reinterpret_cast< Summary_Image* >(object); + (void)_this; +} +void Summary_Image::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Summary_Image::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Summary_Image::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Summary_Image& Summary_Image::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Image.base); + return *internal_default_instance(); +} + + +void Summary_Image::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Summary.Image) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + encoded_image_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&height_, 0, static_cast( + reinterpret_cast(&colorspace_) - + reinterpret_cast(&height_)) + sizeof(colorspace_)); + _internal_metadata_.Clear(); +} + +bool Summary_Image::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Summary.Image) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 height = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 width = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 colorspace = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &colorspace_))); + } else { + goto handle_unusual; + } + break; + } + + // bytes encoded_image_string = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_encoded_image_string())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Summary.Image) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Summary.Image) + return false; +#undef DO_ +} + +void Summary_Image::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Summary.Image) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 height = 1; + if (this->height() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->height(), output); + } + + // int32 width = 2; + if (this->width() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->width(), output); + } + + // int32 colorspace = 3; + if (this->colorspace() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->colorspace(), output); + } + + // bytes encoded_image_string = 4; + if (this->encoded_image_string().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->encoded_image_string(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Summary.Image) +} + +::google::protobuf::uint8* Summary_Image::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Summary.Image) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 height = 1; + if (this->height() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->height(), target); + } + + // int32 width = 2; + if (this->width() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->width(), target); + } + + // int32 colorspace = 3; + if (this->colorspace() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->colorspace(), target); + } + + // bytes encoded_image_string = 4; + if (this->encoded_image_string().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->encoded_image_string(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Summary.Image) + return target; +} + +size_t Summary_Image::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Summary.Image) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // bytes encoded_image_string = 4; + if (this->encoded_image_string().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->encoded_image_string()); + } + + // int32 height = 1; + if (this->height() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->height()); + } + + // int32 width = 2; + if (this->width() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->width()); + } + + // int32 colorspace = 3; + if (this->colorspace() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->colorspace()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Summary_Image::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Summary.Image) + GOOGLE_DCHECK_NE(&from, this); + const Summary_Image* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Summary.Image) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Summary.Image) + MergeFrom(*source); + } +} + +void Summary_Image::MergeFrom(const Summary_Image& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Summary.Image) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.encoded_image_string().size() > 0) { + set_encoded_image_string(from.encoded_image_string()); + } + if (from.height() != 0) { + set_height(from.height()); + } + if (from.width() != 0) { + set_width(from.width()); + } + if (from.colorspace() != 0) { + set_colorspace(from.colorspace()); + } +} + +void Summary_Image::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Summary.Image) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Summary_Image::CopyFrom(const Summary_Image& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Summary.Image) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Summary_Image::IsInitialized() const { + return true; +} + +void Summary_Image::Swap(Summary_Image* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Summary_Image* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Summary_Image::UnsafeArenaSwap(Summary_Image* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Summary_Image::InternalSwap(Summary_Image* other) { + using std::swap; + encoded_image_string_.Swap(&other->encoded_image_string_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(height_, other->height_); + swap(width_, other->width_); + swap(colorspace_, other->colorspace_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Summary_Image::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Summary_Audio::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Summary_Audio::kSampleRateFieldNumber; +const int Summary_Audio::kNumChannelsFieldNumber; +const int Summary_Audio::kLengthFramesFieldNumber; +const int Summary_Audio::kEncodedAudioStringFieldNumber; +const int Summary_Audio::kContentTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Summary_Audio::Summary_Audio() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Audio.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Summary.Audio) +} +Summary_Audio::Summary_Audio(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Audio.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Summary.Audio) +} +Summary_Audio::Summary_Audio(const Summary_Audio& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + encoded_audio_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.encoded_audio_string().size() > 0) { + encoded_audio_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.encoded_audio_string(), + GetArenaNoVirtual()); + } + content_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.content_type().size() > 0) { + content_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.content_type(), + GetArenaNoVirtual()); + } + ::memcpy(&num_channels_, &from.num_channels_, + static_cast(reinterpret_cast(&sample_rate_) - + reinterpret_cast(&num_channels_)) + sizeof(sample_rate_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Summary.Audio) +} + +void Summary_Audio::SharedCtor() { + encoded_audio_string_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + content_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&num_channels_, 0, static_cast( + reinterpret_cast(&sample_rate_) - + reinterpret_cast(&num_channels_)) + sizeof(sample_rate_)); +} + +Summary_Audio::~Summary_Audio() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Summary.Audio) + SharedDtor(); +} + +void Summary_Audio::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + encoded_audio_string_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + content_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Summary_Audio::ArenaDtor(void* object) { + Summary_Audio* _this = reinterpret_cast< Summary_Audio* >(object); + (void)_this; +} +void Summary_Audio::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Summary_Audio::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Summary_Audio::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Summary_Audio& Summary_Audio::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Audio.base); + return *internal_default_instance(); +} + + +void Summary_Audio::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Summary.Audio) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + encoded_audio_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + content_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ::memset(&num_channels_, 0, static_cast( + reinterpret_cast(&sample_rate_) - + reinterpret_cast(&num_channels_)) + sizeof(sample_rate_)); + _internal_metadata_.Clear(); +} + +bool Summary_Audio::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Summary.Audio) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float sample_rate = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &sample_rate_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 num_channels = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_channels_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 length_frames = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &length_frames_))); + } else { + goto handle_unusual; + } + break; + } + + // bytes encoded_audio_string = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_encoded_audio_string())); + } else { + goto handle_unusual; + } + break; + } + + // string content_type = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_content_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->content_type().data(), static_cast(this->content_type().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.Summary.Audio.content_type")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Summary.Audio) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Summary.Audio) + return false; +#undef DO_ +} + +void Summary_Audio::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Summary.Audio) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float sample_rate = 1; + if (this->sample_rate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->sample_rate(), output); + } + + // int64 num_channels = 2; + if (this->num_channels() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->num_channels(), output); + } + + // int64 length_frames = 3; + if (this->length_frames() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->length_frames(), output); + } + + // bytes encoded_audio_string = 4; + if (this->encoded_audio_string().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->encoded_audio_string(), output); + } + + // string content_type = 5; + if (this->content_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->content_type().data(), static_cast(this->content_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Summary.Audio.content_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->content_type(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Summary.Audio) +} + +::google::protobuf::uint8* Summary_Audio::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Summary.Audio) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float sample_rate = 1; + if (this->sample_rate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->sample_rate(), target); + } + + // int64 num_channels = 2; + if (this->num_channels() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->num_channels(), target); + } + + // int64 length_frames = 3; + if (this->length_frames() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->length_frames(), target); + } + + // bytes encoded_audio_string = 4; + if (this->encoded_audio_string().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->encoded_audio_string(), target); + } + + // string content_type = 5; + if (this->content_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->content_type().data(), static_cast(this->content_type().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Summary.Audio.content_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->content_type(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Summary.Audio) + return target; +} + +size_t Summary_Audio::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Summary.Audio) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // bytes encoded_audio_string = 4; + if (this->encoded_audio_string().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->encoded_audio_string()); + } + + // string content_type = 5; + if (this->content_type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->content_type()); + } + + // int64 num_channels = 2; + if (this->num_channels() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_channels()); + } + + // int64 length_frames = 3; + if (this->length_frames() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->length_frames()); + } + + // float sample_rate = 1; + if (this->sample_rate() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Summary_Audio::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Summary.Audio) + GOOGLE_DCHECK_NE(&from, this); + const Summary_Audio* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Summary.Audio) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Summary.Audio) + MergeFrom(*source); + } +} + +void Summary_Audio::MergeFrom(const Summary_Audio& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Summary.Audio) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.encoded_audio_string().size() > 0) { + set_encoded_audio_string(from.encoded_audio_string()); + } + if (from.content_type().size() > 0) { + set_content_type(from.content_type()); + } + if (from.num_channels() != 0) { + set_num_channels(from.num_channels()); + } + if (from.length_frames() != 0) { + set_length_frames(from.length_frames()); + } + if (from.sample_rate() != 0) { + set_sample_rate(from.sample_rate()); + } +} + +void Summary_Audio::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Summary.Audio) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Summary_Audio::CopyFrom(const Summary_Audio& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Summary.Audio) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Summary_Audio::IsInitialized() const { + return true; +} + +void Summary_Audio::Swap(Summary_Audio* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Summary_Audio* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Summary_Audio::UnsafeArenaSwap(Summary_Audio* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Summary_Audio::InternalSwap(Summary_Audio* other) { + using std::swap; + encoded_audio_string_.Swap(&other->encoded_audio_string_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + content_type_.Swap(&other->content_type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(num_channels_, other->num_channels_); + swap(length_frames_, other->length_frames_); + swap(sample_rate_, other->sample_rate_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Summary_Audio::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Summary_Value::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_Summary_Value_default_instance_._instance.get_mutable()->metadata_ = const_cast< ::diplomacy::tensorflow::SummaryMetadata*>( + ::diplomacy::tensorflow::SummaryMetadata::internal_default_instance()); + ::diplomacy::tensorflow::_Summary_Value_default_instance_.simple_value_ = 0; + ::diplomacy::tensorflow::_Summary_Value_default_instance_.obsolete_old_style_histogram_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::diplomacy::tensorflow::_Summary_Value_default_instance_.image_ = const_cast< ::diplomacy::tensorflow::Summary_Image*>( + ::diplomacy::tensorflow::Summary_Image::internal_default_instance()); + ::diplomacy::tensorflow::_Summary_Value_default_instance_.histo_ = const_cast< ::diplomacy::tensorflow::HistogramProto*>( + ::diplomacy::tensorflow::HistogramProto::internal_default_instance()); + ::diplomacy::tensorflow::_Summary_Value_default_instance_.audio_ = const_cast< ::diplomacy::tensorflow::Summary_Audio*>( + ::diplomacy::tensorflow::Summary_Audio::internal_default_instance()); + ::diplomacy::tensorflow::_Summary_Value_default_instance_.tensor_ = const_cast< ::diplomacy::tensorflow::TensorProto*>( + ::diplomacy::tensorflow::TensorProto::internal_default_instance()); +} +void Summary_Value::unsafe_arena_set_allocated_metadata( + ::diplomacy::tensorflow::SummaryMetadata* metadata) { + if (GetArenaNoVirtual() == NULL) { + delete metadata_; + } + metadata_ = metadata; + if (metadata) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.metadata) +} +void Summary_Value::set_allocated_image(::diplomacy::tensorflow::Summary_Image* image) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (image) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(image); + if (message_arena != submessage_arena) { + image = ::google::protobuf::internal::GetOwnedMessage( + message_arena, image, submessage_arena); + } + set_has_image(); + value_.image_ = image; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.image) +} +void Summary_Value::set_allocated_histo(::diplomacy::tensorflow::HistogramProto* histo) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (histo) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(histo); + if (message_arena != submessage_arena) { + histo = ::google::protobuf::internal::GetOwnedMessage( + message_arena, histo, submessage_arena); + } + set_has_histo(); + value_.histo_ = histo; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.histo) +} +void Summary_Value::set_allocated_audio(::diplomacy::tensorflow::Summary_Audio* audio) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (audio) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(audio); + if (message_arena != submessage_arena) { + audio = ::google::protobuf::internal::GetOwnedMessage( + message_arena, audio, submessage_arena); + } + set_has_audio(); + value_.audio_ = audio; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.audio) +} +void Summary_Value::set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_value(); + if (tensor) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor)->GetArena(); + if (message_arena != submessage_arena) { + tensor = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor, submessage_arena); + } + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.tensor) +} +void Summary_Value::clear_tensor() { + if (has_tensor()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.tensor_; + } + clear_has_value(); + } +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Summary_Value::kNodeNameFieldNumber; +const int Summary_Value::kTagFieldNumber; +const int Summary_Value::kMetadataFieldNumber; +const int Summary_Value::kSimpleValueFieldNumber; +const int Summary_Value::kObsoleteOldStyleHistogramFieldNumber; +const int Summary_Value::kImageFieldNumber; +const int Summary_Value::kHistoFieldNumber; +const int Summary_Value::kAudioFieldNumber; +const int Summary_Value::kTensorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Summary_Value::Summary_Value() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Value.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Summary.Value) +} +Summary_Value::Summary_Value(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Value.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Summary.Value) +} +Summary_Value::Summary_Value(const Summary_Value& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + tag_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tag().size() > 0) { + tag_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tag(), + GetArenaNoVirtual()); + } + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.node_name().size() > 0) { + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node_name(), + GetArenaNoVirtual()); + } + if (from.has_metadata()) { + metadata_ = new ::diplomacy::tensorflow::SummaryMetadata(*from.metadata_); + } else { + metadata_ = NULL; + } + clear_has_value(); + switch (from.value_case()) { + case kSimpleValue: { + set_simple_value(from.simple_value()); + break; + } + case kObsoleteOldStyleHistogram: { + set_obsolete_old_style_histogram(from.obsolete_old_style_histogram()); + break; + } + case kImage: { + mutable_image()->::diplomacy::tensorflow::Summary_Image::MergeFrom(from.image()); + break; + } + case kHisto: { + mutable_histo()->::diplomacy::tensorflow::HistogramProto::MergeFrom(from.histo()); + break; + } + case kAudio: { + mutable_audio()->::diplomacy::tensorflow::Summary_Audio::MergeFrom(from.audio()); + break; + } + case kTensor: { + mutable_tensor()->::diplomacy::tensorflow::TensorProto::MergeFrom(from.tensor()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Summary.Value) +} + +void Summary_Value::SharedCtor() { + tag_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + metadata_ = NULL; + clear_has_value(); +} + +Summary_Value::~Summary_Value() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Summary.Value) + SharedDtor(); +} + +void Summary_Value::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + tag_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + node_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete metadata_; + if (has_value()) { + clear_value(); + } +} + +void Summary_Value::ArenaDtor(void* object) { + Summary_Value* _this = reinterpret_cast< Summary_Value* >(object); + (void)_this; +} +void Summary_Value::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Summary_Value::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Summary_Value::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Summary_Value& Summary_Value::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary_Value.base); + return *internal_default_instance(); +} + + +void Summary_Value::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.Summary.Value) + switch (value_case()) { + case kSimpleValue: { + // No need to clear + break; + } + case kObsoleteOldStyleHistogram: { + value_.obsolete_old_style_histogram_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + break; + } + case kImage: { + if (GetArenaNoVirtual() == NULL) { + delete value_.image_; + } + break; + } + case kHisto: { + if (GetArenaNoVirtual() == NULL) { + delete value_.histo_; + } + break; + } + case kAudio: { + if (GetArenaNoVirtual() == NULL) { + delete value_.audio_; + } + break; + } + case kTensor: { + if (GetArenaNoVirtual() == NULL) { + delete value_.tensor_; + } + break; + } + case VALUE_NOT_SET: { + break; + } + } + _oneof_case_[0] = VALUE_NOT_SET; +} + + +void Summary_Value::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Summary.Value) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tag_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + node_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && metadata_ != NULL) { + delete metadata_; + } + metadata_ = NULL; + clear_value(); + _internal_metadata_.Clear(); +} + +bool Summary_Value::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Summary.Value) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string tag = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tag())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tag().data(), static_cast(this->tag().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.Summary.Value.tag")); + } else { + goto handle_unusual; + } + break; + } + + // float simple_value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_.simple_value_))); + set_has_simple_value(); + } else { + goto handle_unusual; + } + break; + } + + // bytes obsolete_old_style_histogram = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_obsolete_old_style_histogram())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.Summary.Image image = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_image())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.HistogramProto histo = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_histo())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.Summary.Audio audio = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_audio())); + } else { + goto handle_unusual; + } + break; + } + + // string node_name = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_node_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.Summary.Value.node_name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorProto tensor = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.SummaryMetadata metadata = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_metadata())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Summary.Value) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Summary.Value) + return false; +#undef DO_ +} + +void Summary_Value::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Summary.Value) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string tag = 1; + if (this->tag().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tag().data(), static_cast(this->tag().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Summary.Value.tag"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->tag(), output); + } + + // float simple_value = 2; + if (has_simple_value()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->simple_value(), output); + } + + // bytes obsolete_old_style_histogram = 3; + if (has_obsolete_old_style_histogram()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->obsolete_old_style_histogram(), output); + } + + // .diplomacy.tensorflow.Summary.Image image = 4; + if (has_image()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_image(), output); + } + + // .diplomacy.tensorflow.HistogramProto histo = 5; + if (has_histo()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_histo(), output); + } + + // .diplomacy.tensorflow.Summary.Audio audio = 6; + if (has_audio()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_audio(), output); + } + + // string node_name = 7; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Summary.Value.node_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->node_name(), output); + } + + // .diplomacy.tensorflow.TensorProto tensor = 8; + if (has_tensor()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_tensor(), output); + } + + // .diplomacy.tensorflow.SummaryMetadata metadata = 9; + if (this->has_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->_internal_metadata(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Summary.Value) +} + +::google::protobuf::uint8* Summary_Value::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Summary.Value) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string tag = 1; + if (this->tag().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->tag().data(), static_cast(this->tag().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Summary.Value.tag"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->tag(), target); + } + + // float simple_value = 2; + if (has_simple_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->simple_value(), target); + } + + // bytes obsolete_old_style_histogram = 3; + if (has_obsolete_old_style_histogram()) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->obsolete_old_style_histogram(), target); + } + + // .diplomacy.tensorflow.Summary.Image image = 4; + if (has_image()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_image(), deterministic, target); + } + + // .diplomacy.tensorflow.HistogramProto histo = 5; + if (has_histo()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_histo(), deterministic, target); + } + + // .diplomacy.tensorflow.Summary.Audio audio = 6; + if (has_audio()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_audio(), deterministic, target); + } + + // string node_name = 7; + if (this->node_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node_name().data(), static_cast(this->node_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.Summary.Value.node_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->node_name(), target); + } + + // .diplomacy.tensorflow.TensorProto tensor = 8; + if (has_tensor()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_tensor(), deterministic, target); + } + + // .diplomacy.tensorflow.SummaryMetadata metadata = 9; + if (this->has_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 9, this->_internal_metadata(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Summary.Value) + return target; +} + +size_t Summary_Value::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Summary.Value) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string tag = 1; + if (this->tag().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tag()); + } + + // string node_name = 7; + if (this->node_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->node_name()); + } + + // .diplomacy.tensorflow.SummaryMetadata metadata = 9; + if (this->has_metadata()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *metadata_); + } + + switch (value_case()) { + // float simple_value = 2; + case kSimpleValue: { + total_size += 1 + 4; + break; + } + // bytes obsolete_old_style_histogram = 3; + case kObsoleteOldStyleHistogram: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->obsolete_old_style_histogram()); + break; + } + // .diplomacy.tensorflow.Summary.Image image = 4; + case kImage: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.image_); + break; + } + // .diplomacy.tensorflow.HistogramProto histo = 5; + case kHisto: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.histo_); + break; + } + // .diplomacy.tensorflow.Summary.Audio audio = 6; + case kAudio: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.audio_); + break; + } + // .diplomacy.tensorflow.TensorProto tensor = 8; + case kTensor: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_.tensor_); + break; + } + case VALUE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Summary_Value::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Summary.Value) + GOOGLE_DCHECK_NE(&from, this); + const Summary_Value* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Summary.Value) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Summary.Value) + MergeFrom(*source); + } +} + +void Summary_Value::MergeFrom(const Summary_Value& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Summary.Value) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.tag().size() > 0) { + set_tag(from.tag()); + } + if (from.node_name().size() > 0) { + set_node_name(from.node_name()); + } + if (from.has_metadata()) { + mutable_metadata()->::diplomacy::tensorflow::SummaryMetadata::MergeFrom(from.metadata()); + } + switch (from.value_case()) { + case kSimpleValue: { + set_simple_value(from.simple_value()); + break; + } + case kObsoleteOldStyleHistogram: { + set_obsolete_old_style_histogram(from.obsolete_old_style_histogram()); + break; + } + case kImage: { + mutable_image()->::diplomacy::tensorflow::Summary_Image::MergeFrom(from.image()); + break; + } + case kHisto: { + mutable_histo()->::diplomacy::tensorflow::HistogramProto::MergeFrom(from.histo()); + break; + } + case kAudio: { + mutable_audio()->::diplomacy::tensorflow::Summary_Audio::MergeFrom(from.audio()); + break; + } + case kTensor: { + mutable_tensor()->::diplomacy::tensorflow::TensorProto::MergeFrom(from.tensor()); + break; + } + case VALUE_NOT_SET: { + break; + } + } +} + +void Summary_Value::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Summary.Value) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Summary_Value::CopyFrom(const Summary_Value& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Summary.Value) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Summary_Value::IsInitialized() const { + return true; +} + +void Summary_Value::Swap(Summary_Value* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Summary_Value* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Summary_Value::UnsafeArenaSwap(Summary_Value* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Summary_Value::InternalSwap(Summary_Value* other) { + using std::swap; + tag_.Swap(&other->tag_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + node_name_.Swap(&other->node_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(metadata_, other->metadata_); + swap(value_, other->value_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Summary_Value::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Summary::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Summary::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Summary::Summary() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.Summary) +} +Summary::Summary(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.Summary) +} +Summary::Summary(const Summary& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.Summary) +} + +void Summary::SharedCtor() { +} + +Summary::~Summary() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.Summary) + SharedDtor(); +} + +void Summary::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Summary::ArenaDtor(void* object) { + Summary* _this = reinterpret_cast< Summary* >(object); + (void)_this; +} +void Summary::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Summary::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Summary::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Summary& Summary::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::scc_info_Summary.base); + return *internal_default_instance(); +} + + +void Summary::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.Summary) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool Summary::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.Summary) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.Summary.Value value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.Summary) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.Summary) + return false; +#undef DO_ +} + +void Summary::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.Summary) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.Summary.Value value = 1; + for (unsigned int i = 0, + n = static_cast(this->value_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->value(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.Summary) +} + +::google::protobuf::uint8* Summary::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.Summary) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.Summary.Value value = 1; + for (unsigned int i = 0, + n = static_cast(this->value_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->value(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.Summary) + return target; +} + +size_t Summary::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.Summary) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.Summary.Value value = 1; + { + unsigned int count = static_cast(this->value_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->value(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Summary::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.Summary) + GOOGLE_DCHECK_NE(&from, this); + const Summary* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.Summary) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.Summary) + MergeFrom(*source); + } +} + +void Summary::MergeFrom(const Summary& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.Summary) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void Summary::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.Summary) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Summary::CopyFrom(const Summary& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.Summary) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Summary::IsInitialized() const { + return true; +} + +void Summary::Swap(Summary* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Summary* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Summary::UnsafeArenaSwap(Summary* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Summary::InternalSwap(Summary* other) { + using std::swap; + CastToBase(&value_)->InternalSwap(CastToBase(&other->value_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Summary::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::SummaryDescription* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::SummaryDescription >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::SummaryDescription >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::HistogramProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::HistogramProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::HistogramProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::SummaryMetadata_PluginData* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::SummaryMetadata_PluginData >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::SummaryMetadata_PluginData >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::SummaryMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::SummaryMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::SummaryMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Summary_Image* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Summary_Image >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Summary_Image >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Summary_Audio* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Summary_Audio >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Summary_Audio >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Summary_Value* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Summary_Value >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Summary_Value >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::Summary* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Summary >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::Summary >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary.pb.h new file mode 100644 index 0000000..d1a3c99 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary.pb.h @@ -0,0 +1,3117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/summary.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/tensor.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[8]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto +namespace diplomacy { +namespace tensorflow { +class HistogramProto; +class HistogramProtoDefaultTypeInternal; +extern HistogramProtoDefaultTypeInternal _HistogramProto_default_instance_; +class Summary; +class SummaryDefaultTypeInternal; +extern SummaryDefaultTypeInternal _Summary_default_instance_; +class SummaryDescription; +class SummaryDescriptionDefaultTypeInternal; +extern SummaryDescriptionDefaultTypeInternal _SummaryDescription_default_instance_; +class SummaryMetadata; +class SummaryMetadataDefaultTypeInternal; +extern SummaryMetadataDefaultTypeInternal _SummaryMetadata_default_instance_; +class SummaryMetadata_PluginData; +class SummaryMetadata_PluginDataDefaultTypeInternal; +extern SummaryMetadata_PluginDataDefaultTypeInternal _SummaryMetadata_PluginData_default_instance_; +class Summary_Audio; +class Summary_AudioDefaultTypeInternal; +extern Summary_AudioDefaultTypeInternal _Summary_Audio_default_instance_; +class Summary_Image; +class Summary_ImageDefaultTypeInternal; +extern Summary_ImageDefaultTypeInternal _Summary_Image_default_instance_; +class Summary_Value; +class Summary_ValueDefaultTypeInternal; +extern Summary_ValueDefaultTypeInternal _Summary_Value_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::HistogramProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::HistogramProto>(Arena*); +template<> ::diplomacy::tensorflow::Summary* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Summary>(Arena*); +template<> ::diplomacy::tensorflow::SummaryDescription* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SummaryDescription>(Arena*); +template<> ::diplomacy::tensorflow::SummaryMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SummaryMetadata>(Arena*); +template<> ::diplomacy::tensorflow::SummaryMetadata_PluginData* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SummaryMetadata_PluginData>(Arena*); +template<> ::diplomacy::tensorflow::Summary_Audio* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Summary_Audio>(Arena*); +template<> ::diplomacy::tensorflow::Summary_Image* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Summary_Image>(Arena*); +template<> ::diplomacy::tensorflow::Summary_Value* Arena::CreateMaybeMessage<::diplomacy::tensorflow::Summary_Value>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class SummaryDescription : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SummaryDescription) */ { + public: + SummaryDescription(); + virtual ~SummaryDescription(); + + SummaryDescription(const SummaryDescription& from); + + inline SummaryDescription& operator=(const SummaryDescription& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SummaryDescription(SummaryDescription&& from) noexcept + : SummaryDescription() { + *this = ::std::move(from); + } + + inline SummaryDescription& operator=(SummaryDescription&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SummaryDescription& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SummaryDescription* internal_default_instance() { + return reinterpret_cast( + &_SummaryDescription_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(SummaryDescription* other); + void Swap(SummaryDescription* other); + friend void swap(SummaryDescription& a, SummaryDescription& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SummaryDescription* New() const final { + return CreateMaybeMessage(NULL); + } + + SummaryDescription* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SummaryDescription& from); + void MergeFrom(const SummaryDescription& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SummaryDescription* other); + protected: + explicit SummaryDescription(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string type_hint = 1; + void clear_type_hint(); + static const int kTypeHintFieldNumber = 1; + const ::std::string& type_hint() const; + void set_type_hint(const ::std::string& value); + #if LANG_CXX11 + void set_type_hint(::std::string&& value); + #endif + void set_type_hint(const char* value); + void set_type_hint(const char* value, size_t size); + ::std::string* mutable_type_hint(); + ::std::string* release_type_hint(); + void set_allocated_type_hint(::std::string* type_hint); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_type_hint(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_type_hint( + ::std::string* type_hint); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SummaryDescription) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr type_hint_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class HistogramProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.HistogramProto) */ { + public: + HistogramProto(); + virtual ~HistogramProto(); + + HistogramProto(const HistogramProto& from); + + inline HistogramProto& operator=(const HistogramProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + HistogramProto(HistogramProto&& from) noexcept + : HistogramProto() { + *this = ::std::move(from); + } + + inline HistogramProto& operator=(HistogramProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const HistogramProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HistogramProto* internal_default_instance() { + return reinterpret_cast( + &_HistogramProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(HistogramProto* other); + void Swap(HistogramProto* other); + friend void swap(HistogramProto& a, HistogramProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline HistogramProto* New() const final { + return CreateMaybeMessage(NULL); + } + + HistogramProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const HistogramProto& from); + void MergeFrom(const HistogramProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HistogramProto* other); + protected: + explicit HistogramProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated double bucket_limit = 6 [packed = true]; + int bucket_limit_size() const; + void clear_bucket_limit(); + static const int kBucketLimitFieldNumber = 6; + double bucket_limit(int index) const; + void set_bucket_limit(int index, double value); + void add_bucket_limit(double value); + const ::google::protobuf::RepeatedField< double >& + bucket_limit() const; + ::google::protobuf::RepeatedField< double >* + mutable_bucket_limit(); + + // repeated double bucket = 7 [packed = true]; + int bucket_size() const; + void clear_bucket(); + static const int kBucketFieldNumber = 7; + double bucket(int index) const; + void set_bucket(int index, double value); + void add_bucket(double value); + const ::google::protobuf::RepeatedField< double >& + bucket() const; + ::google::protobuf::RepeatedField< double >* + mutable_bucket(); + + // double min = 1; + void clear_min(); + static const int kMinFieldNumber = 1; + double min() const; + void set_min(double value); + + // double max = 2; + void clear_max(); + static const int kMaxFieldNumber = 2; + double max() const; + void set_max(double value); + + // double num = 3; + void clear_num(); + static const int kNumFieldNumber = 3; + double num() const; + void set_num(double value); + + // double sum = 4; + void clear_sum(); + static const int kSumFieldNumber = 4; + double sum() const; + void set_sum(double value); + + // double sum_squares = 5; + void clear_sum_squares(); + static const int kSumSquaresFieldNumber = 5; + double sum_squares() const; + void set_sum_squares(double value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HistogramProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< double > bucket_limit_; + mutable int _bucket_limit_cached_byte_size_; + ::google::protobuf::RepeatedField< double > bucket_; + mutable int _bucket_cached_byte_size_; + double min_; + double max_; + double num_; + double sum_; + double sum_squares_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SummaryMetadata_PluginData : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SummaryMetadata.PluginData) */ { + public: + SummaryMetadata_PluginData(); + virtual ~SummaryMetadata_PluginData(); + + SummaryMetadata_PluginData(const SummaryMetadata_PluginData& from); + + inline SummaryMetadata_PluginData& operator=(const SummaryMetadata_PluginData& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SummaryMetadata_PluginData(SummaryMetadata_PluginData&& from) noexcept + : SummaryMetadata_PluginData() { + *this = ::std::move(from); + } + + inline SummaryMetadata_PluginData& operator=(SummaryMetadata_PluginData&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SummaryMetadata_PluginData& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SummaryMetadata_PluginData* internal_default_instance() { + return reinterpret_cast( + &_SummaryMetadata_PluginData_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(SummaryMetadata_PluginData* other); + void Swap(SummaryMetadata_PluginData* other); + friend void swap(SummaryMetadata_PluginData& a, SummaryMetadata_PluginData& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SummaryMetadata_PluginData* New() const final { + return CreateMaybeMessage(NULL); + } + + SummaryMetadata_PluginData* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SummaryMetadata_PluginData& from); + void MergeFrom(const SummaryMetadata_PluginData& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SummaryMetadata_PluginData* other); + protected: + explicit SummaryMetadata_PluginData(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string plugin_name = 1; + void clear_plugin_name(); + static const int kPluginNameFieldNumber = 1; + const ::std::string& plugin_name() const; + void set_plugin_name(const ::std::string& value); + #if LANG_CXX11 + void set_plugin_name(::std::string&& value); + #endif + void set_plugin_name(const char* value); + void set_plugin_name(const char* value, size_t size); + ::std::string* mutable_plugin_name(); + ::std::string* release_plugin_name(); + void set_allocated_plugin_name(::std::string* plugin_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_plugin_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_plugin_name( + ::std::string* plugin_name); + + // bytes content = 2; + void clear_content(); + static const int kContentFieldNumber = 2; + const ::std::string& content() const; + void set_content(const ::std::string& value); + #if LANG_CXX11 + void set_content(::std::string&& value); + #endif + void set_content(const char* value); + void set_content(const void* value, size_t size); + ::std::string* mutable_content(); + ::std::string* release_content(); + void set_allocated_content(::std::string* content); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_content(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_content( + ::std::string* content); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SummaryMetadata.PluginData) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr plugin_name_; + ::google::protobuf::internal::ArenaStringPtr content_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SummaryMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SummaryMetadata) */ { + public: + SummaryMetadata(); + virtual ~SummaryMetadata(); + + SummaryMetadata(const SummaryMetadata& from); + + inline SummaryMetadata& operator=(const SummaryMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SummaryMetadata(SummaryMetadata&& from) noexcept + : SummaryMetadata() { + *this = ::std::move(from); + } + + inline SummaryMetadata& operator=(SummaryMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SummaryMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SummaryMetadata* internal_default_instance() { + return reinterpret_cast( + &_SummaryMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(SummaryMetadata* other); + void Swap(SummaryMetadata* other); + friend void swap(SummaryMetadata& a, SummaryMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SummaryMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + SummaryMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SummaryMetadata& from); + void MergeFrom(const SummaryMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SummaryMetadata* other); + protected: + explicit SummaryMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef SummaryMetadata_PluginData PluginData; + + // accessors ------------------------------------------------------- + + // string display_name = 2; + void clear_display_name(); + static const int kDisplayNameFieldNumber = 2; + const ::std::string& display_name() const; + void set_display_name(const ::std::string& value); + #if LANG_CXX11 + void set_display_name(::std::string&& value); + #endif + void set_display_name(const char* value); + void set_display_name(const char* value, size_t size); + ::std::string* mutable_display_name(); + ::std::string* release_display_name(); + void set_allocated_display_name(::std::string* display_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_display_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_display_name( + ::std::string* display_name); + + // string summary_description = 3; + void clear_summary_description(); + static const int kSummaryDescriptionFieldNumber = 3; + const ::std::string& summary_description() const; + void set_summary_description(const ::std::string& value); + #if LANG_CXX11 + void set_summary_description(::std::string&& value); + #endif + void set_summary_description(const char* value); + void set_summary_description(const char* value, size_t size); + ::std::string* mutable_summary_description(); + ::std::string* release_summary_description(); + void set_allocated_summary_description(::std::string* summary_description); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_summary_description(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_summary_description( + ::std::string* summary_description); + + // .diplomacy.tensorflow.SummaryMetadata.PluginData plugin_data = 1; + bool has_plugin_data() const; + void clear_plugin_data(); + static const int kPluginDataFieldNumber = 1; + private: + const ::diplomacy::tensorflow::SummaryMetadata_PluginData& _internal_plugin_data() const; + public: + const ::diplomacy::tensorflow::SummaryMetadata_PluginData& plugin_data() const; + ::diplomacy::tensorflow::SummaryMetadata_PluginData* release_plugin_data(); + ::diplomacy::tensorflow::SummaryMetadata_PluginData* mutable_plugin_data(); + void set_allocated_plugin_data(::diplomacy::tensorflow::SummaryMetadata_PluginData* plugin_data); + void unsafe_arena_set_allocated_plugin_data( + ::diplomacy::tensorflow::SummaryMetadata_PluginData* plugin_data); + ::diplomacy::tensorflow::SummaryMetadata_PluginData* unsafe_arena_release_plugin_data(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SummaryMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr display_name_; + ::google::protobuf::internal::ArenaStringPtr summary_description_; + ::diplomacy::tensorflow::SummaryMetadata_PluginData* plugin_data_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Summary_Image : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Summary.Image) */ { + public: + Summary_Image(); + virtual ~Summary_Image(); + + Summary_Image(const Summary_Image& from); + + inline Summary_Image& operator=(const Summary_Image& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Summary_Image(Summary_Image&& from) noexcept + : Summary_Image() { + *this = ::std::move(from); + } + + inline Summary_Image& operator=(Summary_Image&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Summary_Image& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Summary_Image* internal_default_instance() { + return reinterpret_cast( + &_Summary_Image_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(Summary_Image* other); + void Swap(Summary_Image* other); + friend void swap(Summary_Image& a, Summary_Image& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Summary_Image* New() const final { + return CreateMaybeMessage(NULL); + } + + Summary_Image* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Summary_Image& from); + void MergeFrom(const Summary_Image& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Summary_Image* other); + protected: + explicit Summary_Image(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // bytes encoded_image_string = 4; + void clear_encoded_image_string(); + static const int kEncodedImageStringFieldNumber = 4; + const ::std::string& encoded_image_string() const; + void set_encoded_image_string(const ::std::string& value); + #if LANG_CXX11 + void set_encoded_image_string(::std::string&& value); + #endif + void set_encoded_image_string(const char* value); + void set_encoded_image_string(const void* value, size_t size); + ::std::string* mutable_encoded_image_string(); + ::std::string* release_encoded_image_string(); + void set_allocated_encoded_image_string(::std::string* encoded_image_string); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_encoded_image_string(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_encoded_image_string( + ::std::string* encoded_image_string); + + // int32 height = 1; + void clear_height(); + static const int kHeightFieldNumber = 1; + ::google::protobuf::int32 height() const; + void set_height(::google::protobuf::int32 value); + + // int32 width = 2; + void clear_width(); + static const int kWidthFieldNumber = 2; + ::google::protobuf::int32 width() const; + void set_width(::google::protobuf::int32 value); + + // int32 colorspace = 3; + void clear_colorspace(); + static const int kColorspaceFieldNumber = 3; + ::google::protobuf::int32 colorspace() const; + void set_colorspace(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary.Image) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr encoded_image_string_; + ::google::protobuf::int32 height_; + ::google::protobuf::int32 width_; + ::google::protobuf::int32 colorspace_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Summary_Audio : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Summary.Audio) */ { + public: + Summary_Audio(); + virtual ~Summary_Audio(); + + Summary_Audio(const Summary_Audio& from); + + inline Summary_Audio& operator=(const Summary_Audio& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Summary_Audio(Summary_Audio&& from) noexcept + : Summary_Audio() { + *this = ::std::move(from); + } + + inline Summary_Audio& operator=(Summary_Audio&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Summary_Audio& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Summary_Audio* internal_default_instance() { + return reinterpret_cast( + &_Summary_Audio_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(Summary_Audio* other); + void Swap(Summary_Audio* other); + friend void swap(Summary_Audio& a, Summary_Audio& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Summary_Audio* New() const final { + return CreateMaybeMessage(NULL); + } + + Summary_Audio* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Summary_Audio& from); + void MergeFrom(const Summary_Audio& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Summary_Audio* other); + protected: + explicit Summary_Audio(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // bytes encoded_audio_string = 4; + void clear_encoded_audio_string(); + static const int kEncodedAudioStringFieldNumber = 4; + const ::std::string& encoded_audio_string() const; + void set_encoded_audio_string(const ::std::string& value); + #if LANG_CXX11 + void set_encoded_audio_string(::std::string&& value); + #endif + void set_encoded_audio_string(const char* value); + void set_encoded_audio_string(const void* value, size_t size); + ::std::string* mutable_encoded_audio_string(); + ::std::string* release_encoded_audio_string(); + void set_allocated_encoded_audio_string(::std::string* encoded_audio_string); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_encoded_audio_string(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_encoded_audio_string( + ::std::string* encoded_audio_string); + + // string content_type = 5; + void clear_content_type(); + static const int kContentTypeFieldNumber = 5; + const ::std::string& content_type() const; + void set_content_type(const ::std::string& value); + #if LANG_CXX11 + void set_content_type(::std::string&& value); + #endif + void set_content_type(const char* value); + void set_content_type(const char* value, size_t size); + ::std::string* mutable_content_type(); + ::std::string* release_content_type(); + void set_allocated_content_type(::std::string* content_type); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_content_type(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_content_type( + ::std::string* content_type); + + // int64 num_channels = 2; + void clear_num_channels(); + static const int kNumChannelsFieldNumber = 2; + ::google::protobuf::int64 num_channels() const; + void set_num_channels(::google::protobuf::int64 value); + + // int64 length_frames = 3; + void clear_length_frames(); + static const int kLengthFramesFieldNumber = 3; + ::google::protobuf::int64 length_frames() const; + void set_length_frames(::google::protobuf::int64 value); + + // float sample_rate = 1; + void clear_sample_rate(); + static const int kSampleRateFieldNumber = 1; + float sample_rate() const; + void set_sample_rate(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary.Audio) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr encoded_audio_string_; + ::google::protobuf::internal::ArenaStringPtr content_type_; + ::google::protobuf::int64 num_channels_; + ::google::protobuf::int64 length_frames_; + float sample_rate_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Summary_Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Summary.Value) */ { + public: + Summary_Value(); + virtual ~Summary_Value(); + + Summary_Value(const Summary_Value& from); + + inline Summary_Value& operator=(const Summary_Value& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Summary_Value(Summary_Value&& from) noexcept + : Summary_Value() { + *this = ::std::move(from); + } + + inline Summary_Value& operator=(Summary_Value&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Summary_Value& default_instance(); + + enum ValueCase { + kSimpleValue = 2, + kObsoleteOldStyleHistogram = 3, + kImage = 4, + kHisto = 5, + kAudio = 6, + kTensor = 8, + VALUE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Summary_Value* internal_default_instance() { + return reinterpret_cast( + &_Summary_Value_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(Summary_Value* other); + void Swap(Summary_Value* other); + friend void swap(Summary_Value& a, Summary_Value& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Summary_Value* New() const final { + return CreateMaybeMessage(NULL); + } + + Summary_Value* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Summary_Value& from); + void MergeFrom(const Summary_Value& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Summary_Value* other); + protected: + explicit Summary_Value(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string tag = 1; + void clear_tag(); + static const int kTagFieldNumber = 1; + const ::std::string& tag() const; + void set_tag(const ::std::string& value); + #if LANG_CXX11 + void set_tag(::std::string&& value); + #endif + void set_tag(const char* value); + void set_tag(const char* value, size_t size); + ::std::string* mutable_tag(); + ::std::string* release_tag(); + void set_allocated_tag(::std::string* tag); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_tag(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_tag( + ::std::string* tag); + + // string node_name = 7; + void clear_node_name(); + static const int kNodeNameFieldNumber = 7; + const ::std::string& node_name() const; + void set_node_name(const ::std::string& value); + #if LANG_CXX11 + void set_node_name(::std::string&& value); + #endif + void set_node_name(const char* value); + void set_node_name(const char* value, size_t size); + ::std::string* mutable_node_name(); + ::std::string* release_node_name(); + void set_allocated_node_name(::std::string* node_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_node_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_node_name( + ::std::string* node_name); + + // .diplomacy.tensorflow.SummaryMetadata metadata = 9; + bool has_metadata() const; + void clear_metadata(); + static const int kMetadataFieldNumber = 9; + private: + const ::diplomacy::tensorflow::SummaryMetadata& _internal_metadata() const; + public: + const ::diplomacy::tensorflow::SummaryMetadata& metadata() const; + ::diplomacy::tensorflow::SummaryMetadata* release_metadata(); + ::diplomacy::tensorflow::SummaryMetadata* mutable_metadata(); + void set_allocated_metadata(::diplomacy::tensorflow::SummaryMetadata* metadata); + void unsafe_arena_set_allocated_metadata( + ::diplomacy::tensorflow::SummaryMetadata* metadata); + ::diplomacy::tensorflow::SummaryMetadata* unsafe_arena_release_metadata(); + + // float simple_value = 2; + private: + bool has_simple_value() const; + public: + void clear_simple_value(); + static const int kSimpleValueFieldNumber = 2; + float simple_value() const; + void set_simple_value(float value); + + // bytes obsolete_old_style_histogram = 3; + private: + bool has_obsolete_old_style_histogram() const; + public: + void clear_obsolete_old_style_histogram(); + static const int kObsoleteOldStyleHistogramFieldNumber = 3; + const ::std::string& obsolete_old_style_histogram() const; + void set_obsolete_old_style_histogram(const ::std::string& value); + #if LANG_CXX11 + void set_obsolete_old_style_histogram(::std::string&& value); + #endif + void set_obsolete_old_style_histogram(const char* value); + void set_obsolete_old_style_histogram(const void* value, size_t size); + ::std::string* mutable_obsolete_old_style_histogram(); + ::std::string* release_obsolete_old_style_histogram(); + void set_allocated_obsolete_old_style_histogram(::std::string* obsolete_old_style_histogram); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_obsolete_old_style_histogram(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_obsolete_old_style_histogram( + ::std::string* obsolete_old_style_histogram); + + // .diplomacy.tensorflow.Summary.Image image = 4; + bool has_image() const; + void clear_image(); + static const int kImageFieldNumber = 4; + private: + const ::diplomacy::tensorflow::Summary_Image& _internal_image() const; + public: + const ::diplomacy::tensorflow::Summary_Image& image() const; + ::diplomacy::tensorflow::Summary_Image* release_image(); + ::diplomacy::tensorflow::Summary_Image* mutable_image(); + void set_allocated_image(::diplomacy::tensorflow::Summary_Image* image); + void unsafe_arena_set_allocated_image( + ::diplomacy::tensorflow::Summary_Image* image); + ::diplomacy::tensorflow::Summary_Image* unsafe_arena_release_image(); + + // .diplomacy.tensorflow.HistogramProto histo = 5; + bool has_histo() const; + void clear_histo(); + static const int kHistoFieldNumber = 5; + private: + const ::diplomacy::tensorflow::HistogramProto& _internal_histo() const; + public: + const ::diplomacy::tensorflow::HistogramProto& histo() const; + ::diplomacy::tensorflow::HistogramProto* release_histo(); + ::diplomacy::tensorflow::HistogramProto* mutable_histo(); + void set_allocated_histo(::diplomacy::tensorflow::HistogramProto* histo); + void unsafe_arena_set_allocated_histo( + ::diplomacy::tensorflow::HistogramProto* histo); + ::diplomacy::tensorflow::HistogramProto* unsafe_arena_release_histo(); + + // .diplomacy.tensorflow.Summary.Audio audio = 6; + bool has_audio() const; + void clear_audio(); + static const int kAudioFieldNumber = 6; + private: + const ::diplomacy::tensorflow::Summary_Audio& _internal_audio() const; + public: + const ::diplomacy::tensorflow::Summary_Audio& audio() const; + ::diplomacy::tensorflow::Summary_Audio* release_audio(); + ::diplomacy::tensorflow::Summary_Audio* mutable_audio(); + void set_allocated_audio(::diplomacy::tensorflow::Summary_Audio* audio); + void unsafe_arena_set_allocated_audio( + ::diplomacy::tensorflow::Summary_Audio* audio); + ::diplomacy::tensorflow::Summary_Audio* unsafe_arena_release_audio(); + + // .diplomacy.tensorflow.TensorProto tensor = 8; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 8; + private: + const ::diplomacy::tensorflow::TensorProto& _internal_tensor() const; + public: + const ::diplomacy::tensorflow::TensorProto& tensor() const; + ::diplomacy::tensorflow::TensorProto* release_tensor(); + ::diplomacy::tensorflow::TensorProto* mutable_tensor(); + void set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor); + void unsafe_arena_set_allocated_tensor( + ::diplomacy::tensorflow::TensorProto* tensor); + ::diplomacy::tensorflow::TensorProto* unsafe_arena_release_tensor(); + + void clear_value(); + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary.Value) + private: + void set_has_simple_value(); + void set_has_obsolete_old_style_histogram(); + void set_has_image(); + void set_has_histo(); + void set_has_audio(); + void set_has_tensor(); + + inline bool has_value() const; + inline void clear_has_value(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr tag_; + ::google::protobuf::internal::ArenaStringPtr node_name_; + ::diplomacy::tensorflow::SummaryMetadata* metadata_; + union ValueUnion { + ValueUnion() {} + float simple_value_; + ::google::protobuf::internal::ArenaStringPtr obsolete_old_style_histogram_; + ::diplomacy::tensorflow::Summary_Image* image_; + ::diplomacy::tensorflow::HistogramProto* histo_; + ::diplomacy::tensorflow::Summary_Audio* audio_; + ::diplomacy::tensorflow::TensorProto* tensor_; + } value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Summary : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.Summary) */ { + public: + Summary(); + virtual ~Summary(); + + Summary(const Summary& from); + + inline Summary& operator=(const Summary& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Summary(Summary&& from) noexcept + : Summary() { + *this = ::std::move(from); + } + + inline Summary& operator=(Summary&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Summary& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Summary* internal_default_instance() { + return reinterpret_cast( + &_Summary_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(Summary* other); + void Swap(Summary* other); + friend void swap(Summary& a, Summary& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Summary* New() const final { + return CreateMaybeMessage(NULL); + } + + Summary* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Summary& from); + void MergeFrom(const Summary& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Summary* other); + protected: + explicit Summary(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Summary_Image Image; + typedef Summary_Audio Audio; + typedef Summary_Value Value; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.Summary.Value value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + ::diplomacy::tensorflow::Summary_Value* mutable_value(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Summary_Value >* + mutable_value(); + const ::diplomacy::tensorflow::Summary_Value& value(int index) const; + ::diplomacy::tensorflow::Summary_Value* add_value(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Summary_Value >& + value() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Summary_Value > value_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// SummaryDescription + +// string type_hint = 1; +inline void SummaryDescription::clear_type_hint() { + type_hint_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SummaryDescription::type_hint() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SummaryDescription.type_hint) + return type_hint_.Get(); +} +inline void SummaryDescription::set_type_hint(const ::std::string& value) { + + type_hint_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SummaryDescription.type_hint) +} +#if LANG_CXX11 +inline void SummaryDescription::set_type_hint(::std::string&& value) { + + type_hint_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SummaryDescription.type_hint) +} +#endif +inline void SummaryDescription::set_type_hint(const char* value) { + GOOGLE_DCHECK(value != NULL); + + type_hint_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SummaryDescription.type_hint) +} +inline void SummaryDescription::set_type_hint(const char* value, + size_t size) { + + type_hint_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SummaryDescription.type_hint) +} +inline ::std::string* SummaryDescription::mutable_type_hint() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SummaryDescription.type_hint) + return type_hint_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SummaryDescription::release_type_hint() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SummaryDescription.type_hint) + + return type_hint_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SummaryDescription::set_allocated_type_hint(::std::string* type_hint) { + if (type_hint != NULL) { + + } else { + + } + type_hint_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_hint, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SummaryDescription.type_hint) +} +inline ::std::string* SummaryDescription::unsafe_arena_release_type_hint() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SummaryDescription.type_hint) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_hint_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SummaryDescription::unsafe_arena_set_allocated_type_hint( + ::std::string* type_hint) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_hint != NULL) { + + } else { + + } + type_hint_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_hint, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SummaryDescription.type_hint) +} + +// ------------------------------------------------------------------- + +// HistogramProto + +// double min = 1; +inline void HistogramProto::clear_min() { + min_ = 0; +} +inline double HistogramProto::min() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HistogramProto.min) + return min_; +} +inline void HistogramProto::set_min(double value) { + + min_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HistogramProto.min) +} + +// double max = 2; +inline void HistogramProto::clear_max() { + max_ = 0; +} +inline double HistogramProto::max() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HistogramProto.max) + return max_; +} +inline void HistogramProto::set_max(double value) { + + max_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HistogramProto.max) +} + +// double num = 3; +inline void HistogramProto::clear_num() { + num_ = 0; +} +inline double HistogramProto::num() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HistogramProto.num) + return num_; +} +inline void HistogramProto::set_num(double value) { + + num_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HistogramProto.num) +} + +// double sum = 4; +inline void HistogramProto::clear_sum() { + sum_ = 0; +} +inline double HistogramProto::sum() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HistogramProto.sum) + return sum_; +} +inline void HistogramProto::set_sum(double value) { + + sum_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HistogramProto.sum) +} + +// double sum_squares = 5; +inline void HistogramProto::clear_sum_squares() { + sum_squares_ = 0; +} +inline double HistogramProto::sum_squares() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HistogramProto.sum_squares) + return sum_squares_; +} +inline void HistogramProto::set_sum_squares(double value) { + + sum_squares_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HistogramProto.sum_squares) +} + +// repeated double bucket_limit = 6 [packed = true]; +inline int HistogramProto::bucket_limit_size() const { + return bucket_limit_.size(); +} +inline void HistogramProto::clear_bucket_limit() { + bucket_limit_.Clear(); +} +inline double HistogramProto::bucket_limit(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HistogramProto.bucket_limit) + return bucket_limit_.Get(index); +} +inline void HistogramProto::set_bucket_limit(int index, double value) { + bucket_limit_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HistogramProto.bucket_limit) +} +inline void HistogramProto::add_bucket_limit(double value) { + bucket_limit_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.HistogramProto.bucket_limit) +} +inline const ::google::protobuf::RepeatedField< double >& +HistogramProto::bucket_limit() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.HistogramProto.bucket_limit) + return bucket_limit_; +} +inline ::google::protobuf::RepeatedField< double >* +HistogramProto::mutable_bucket_limit() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.HistogramProto.bucket_limit) + return &bucket_limit_; +} + +// repeated double bucket = 7 [packed = true]; +inline int HistogramProto::bucket_size() const { + return bucket_.size(); +} +inline void HistogramProto::clear_bucket() { + bucket_.Clear(); +} +inline double HistogramProto::bucket(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.HistogramProto.bucket) + return bucket_.Get(index); +} +inline void HistogramProto::set_bucket(int index, double value) { + bucket_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.HistogramProto.bucket) +} +inline void HistogramProto::add_bucket(double value) { + bucket_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.HistogramProto.bucket) +} +inline const ::google::protobuf::RepeatedField< double >& +HistogramProto::bucket() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.HistogramProto.bucket) + return bucket_; +} +inline ::google::protobuf::RepeatedField< double >* +HistogramProto::mutable_bucket() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.HistogramProto.bucket) + return &bucket_; +} + +// ------------------------------------------------------------------- + +// SummaryMetadata_PluginData + +// string plugin_name = 1; +inline void SummaryMetadata_PluginData::clear_plugin_name() { + plugin_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SummaryMetadata_PluginData::plugin_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) + return plugin_name_.Get(); +} +inline void SummaryMetadata_PluginData::set_plugin_name(const ::std::string& value) { + + plugin_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) +} +#if LANG_CXX11 +inline void SummaryMetadata_PluginData::set_plugin_name(::std::string&& value) { + + plugin_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) +} +#endif +inline void SummaryMetadata_PluginData::set_plugin_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + plugin_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) +} +inline void SummaryMetadata_PluginData::set_plugin_name(const char* value, + size_t size) { + + plugin_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) +} +inline ::std::string* SummaryMetadata_PluginData::mutable_plugin_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) + return plugin_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SummaryMetadata_PluginData::release_plugin_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) + + return plugin_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SummaryMetadata_PluginData::set_allocated_plugin_name(::std::string* plugin_name) { + if (plugin_name != NULL) { + + } else { + + } + plugin_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), plugin_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) +} +inline ::std::string* SummaryMetadata_PluginData::unsafe_arena_release_plugin_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return plugin_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SummaryMetadata_PluginData::unsafe_arena_set_allocated_plugin_name( + ::std::string* plugin_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (plugin_name != NULL) { + + } else { + + } + plugin_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + plugin_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name) +} + +// bytes content = 2; +inline void SummaryMetadata_PluginData::clear_content() { + content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SummaryMetadata_PluginData::content() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SummaryMetadata.PluginData.content) + return content_.Get(); +} +inline void SummaryMetadata_PluginData::set_content(const ::std::string& value) { + + content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SummaryMetadata.PluginData.content) +} +#if LANG_CXX11 +inline void SummaryMetadata_PluginData::set_content(::std::string&& value) { + + content_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SummaryMetadata.PluginData.content) +} +#endif +inline void SummaryMetadata_PluginData::set_content(const char* value) { + GOOGLE_DCHECK(value != NULL); + + content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SummaryMetadata.PluginData.content) +} +inline void SummaryMetadata_PluginData::set_content(const void* value, + size_t size) { + + content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SummaryMetadata.PluginData.content) +} +inline ::std::string* SummaryMetadata_PluginData::mutable_content() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SummaryMetadata.PluginData.content) + return content_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SummaryMetadata_PluginData::release_content() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SummaryMetadata.PluginData.content) + + return content_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SummaryMetadata_PluginData::set_allocated_content(::std::string* content) { + if (content != NULL) { + + } else { + + } + content_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), content, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SummaryMetadata.PluginData.content) +} +inline ::std::string* SummaryMetadata_PluginData::unsafe_arena_release_content() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SummaryMetadata.PluginData.content) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return content_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SummaryMetadata_PluginData::unsafe_arena_set_allocated_content( + ::std::string* content) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (content != NULL) { + + } else { + + } + content_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + content, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SummaryMetadata.PluginData.content) +} + +// ------------------------------------------------------------------- + +// SummaryMetadata + +// .diplomacy.tensorflow.SummaryMetadata.PluginData plugin_data = 1; +inline bool SummaryMetadata::has_plugin_data() const { + return this != internal_default_instance() && plugin_data_ != NULL; +} +inline void SummaryMetadata::clear_plugin_data() { + if (GetArenaNoVirtual() == NULL && plugin_data_ != NULL) { + delete plugin_data_; + } + plugin_data_ = NULL; +} +inline const ::diplomacy::tensorflow::SummaryMetadata_PluginData& SummaryMetadata::_internal_plugin_data() const { + return *plugin_data_; +} +inline const ::diplomacy::tensorflow::SummaryMetadata_PluginData& SummaryMetadata::plugin_data() const { + const ::diplomacy::tensorflow::SummaryMetadata_PluginData* p = plugin_data_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SummaryMetadata.plugin_data) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_SummaryMetadata_PluginData_default_instance_); +} +inline ::diplomacy::tensorflow::SummaryMetadata_PluginData* SummaryMetadata::release_plugin_data() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SummaryMetadata.plugin_data) + + ::diplomacy::tensorflow::SummaryMetadata_PluginData* temp = plugin_data_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + plugin_data_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SummaryMetadata_PluginData* SummaryMetadata::unsafe_arena_release_plugin_data() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SummaryMetadata.plugin_data) + + ::diplomacy::tensorflow::SummaryMetadata_PluginData* temp = plugin_data_; + plugin_data_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SummaryMetadata_PluginData* SummaryMetadata::mutable_plugin_data() { + + if (plugin_data_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::SummaryMetadata_PluginData>(GetArenaNoVirtual()); + plugin_data_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SummaryMetadata.plugin_data) + return plugin_data_; +} +inline void SummaryMetadata::set_allocated_plugin_data(::diplomacy::tensorflow::SummaryMetadata_PluginData* plugin_data) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete plugin_data_; + } + if (plugin_data) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(plugin_data); + if (message_arena != submessage_arena) { + plugin_data = ::google::protobuf::internal::GetOwnedMessage( + message_arena, plugin_data, submessage_arena); + } + + } else { + + } + plugin_data_ = plugin_data; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SummaryMetadata.plugin_data) +} + +// string display_name = 2; +inline void SummaryMetadata::clear_display_name() { + display_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SummaryMetadata::display_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SummaryMetadata.display_name) + return display_name_.Get(); +} +inline void SummaryMetadata::set_display_name(const ::std::string& value) { + + display_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SummaryMetadata.display_name) +} +#if LANG_CXX11 +inline void SummaryMetadata::set_display_name(::std::string&& value) { + + display_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SummaryMetadata.display_name) +} +#endif +inline void SummaryMetadata::set_display_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + display_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SummaryMetadata.display_name) +} +inline void SummaryMetadata::set_display_name(const char* value, + size_t size) { + + display_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SummaryMetadata.display_name) +} +inline ::std::string* SummaryMetadata::mutable_display_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SummaryMetadata.display_name) + return display_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SummaryMetadata::release_display_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SummaryMetadata.display_name) + + return display_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SummaryMetadata::set_allocated_display_name(::std::string* display_name) { + if (display_name != NULL) { + + } else { + + } + display_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), display_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SummaryMetadata.display_name) +} +inline ::std::string* SummaryMetadata::unsafe_arena_release_display_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SummaryMetadata.display_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return display_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SummaryMetadata::unsafe_arena_set_allocated_display_name( + ::std::string* display_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (display_name != NULL) { + + } else { + + } + display_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + display_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SummaryMetadata.display_name) +} + +// string summary_description = 3; +inline void SummaryMetadata::clear_summary_description() { + summary_description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SummaryMetadata::summary_description() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SummaryMetadata.summary_description) + return summary_description_.Get(); +} +inline void SummaryMetadata::set_summary_description(const ::std::string& value) { + + summary_description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SummaryMetadata.summary_description) +} +#if LANG_CXX11 +inline void SummaryMetadata::set_summary_description(::std::string&& value) { + + summary_description_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SummaryMetadata.summary_description) +} +#endif +inline void SummaryMetadata::set_summary_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + + summary_description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SummaryMetadata.summary_description) +} +inline void SummaryMetadata::set_summary_description(const char* value, + size_t size) { + + summary_description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SummaryMetadata.summary_description) +} +inline ::std::string* SummaryMetadata::mutable_summary_description() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SummaryMetadata.summary_description) + return summary_description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SummaryMetadata::release_summary_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SummaryMetadata.summary_description) + + return summary_description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SummaryMetadata::set_allocated_summary_description(::std::string* summary_description) { + if (summary_description != NULL) { + + } else { + + } + summary_description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), summary_description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SummaryMetadata.summary_description) +} +inline ::std::string* SummaryMetadata::unsafe_arena_release_summary_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SummaryMetadata.summary_description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return summary_description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SummaryMetadata::unsafe_arena_set_allocated_summary_description( + ::std::string* summary_description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (summary_description != NULL) { + + } else { + + } + summary_description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + summary_description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SummaryMetadata.summary_description) +} + +// ------------------------------------------------------------------- + +// Summary_Image + +// int32 height = 1; +inline void Summary_Image::clear_height() { + height_ = 0; +} +inline ::google::protobuf::int32 Summary_Image::height() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Image.height) + return height_; +} +inline void Summary_Image::set_height(::google::protobuf::int32 value) { + + height_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Image.height) +} + +// int32 width = 2; +inline void Summary_Image::clear_width() { + width_ = 0; +} +inline ::google::protobuf::int32 Summary_Image::width() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Image.width) + return width_; +} +inline void Summary_Image::set_width(::google::protobuf::int32 value) { + + width_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Image.width) +} + +// int32 colorspace = 3; +inline void Summary_Image::clear_colorspace() { + colorspace_ = 0; +} +inline ::google::protobuf::int32 Summary_Image::colorspace() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Image.colorspace) + return colorspace_; +} +inline void Summary_Image::set_colorspace(::google::protobuf::int32 value) { + + colorspace_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Image.colorspace) +} + +// bytes encoded_image_string = 4; +inline void Summary_Image::clear_encoded_image_string() { + encoded_image_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Summary_Image::encoded_image_string() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Image.encoded_image_string) + return encoded_image_string_.Get(); +} +inline void Summary_Image::set_encoded_image_string(const ::std::string& value) { + + encoded_image_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Image.encoded_image_string) +} +#if LANG_CXX11 +inline void Summary_Image::set_encoded_image_string(::std::string&& value) { + + encoded_image_string_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.Summary.Image.encoded_image_string) +} +#endif +inline void Summary_Image::set_encoded_image_string(const char* value) { + GOOGLE_DCHECK(value != NULL); + + encoded_image_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.Summary.Image.encoded_image_string) +} +inline void Summary_Image::set_encoded_image_string(const void* value, + size_t size) { + + encoded_image_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.Summary.Image.encoded_image_string) +} +inline ::std::string* Summary_Image::mutable_encoded_image_string() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Image.encoded_image_string) + return encoded_image_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Summary_Image::release_encoded_image_string() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Image.encoded_image_string) + + return encoded_image_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Summary_Image::set_allocated_encoded_image_string(::std::string* encoded_image_string) { + if (encoded_image_string != NULL) { + + } else { + + } + encoded_image_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), encoded_image_string, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Image.encoded_image_string) +} +inline ::std::string* Summary_Image::unsafe_arena_release_encoded_image_string() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Image.encoded_image_string) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return encoded_image_string_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Summary_Image::unsafe_arena_set_allocated_encoded_image_string( + ::std::string* encoded_image_string) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (encoded_image_string != NULL) { + + } else { + + } + encoded_image_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + encoded_image_string, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Image.encoded_image_string) +} + +// ------------------------------------------------------------------- + +// Summary_Audio + +// float sample_rate = 1; +inline void Summary_Audio::clear_sample_rate() { + sample_rate_ = 0; +} +inline float Summary_Audio::sample_rate() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Audio.sample_rate) + return sample_rate_; +} +inline void Summary_Audio::set_sample_rate(float value) { + + sample_rate_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Audio.sample_rate) +} + +// int64 num_channels = 2; +inline void Summary_Audio::clear_num_channels() { + num_channels_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 Summary_Audio::num_channels() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Audio.num_channels) + return num_channels_; +} +inline void Summary_Audio::set_num_channels(::google::protobuf::int64 value) { + + num_channels_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Audio.num_channels) +} + +// int64 length_frames = 3; +inline void Summary_Audio::clear_length_frames() { + length_frames_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 Summary_Audio::length_frames() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Audio.length_frames) + return length_frames_; +} +inline void Summary_Audio::set_length_frames(::google::protobuf::int64 value) { + + length_frames_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Audio.length_frames) +} + +// bytes encoded_audio_string = 4; +inline void Summary_Audio::clear_encoded_audio_string() { + encoded_audio_string_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Summary_Audio::encoded_audio_string() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) + return encoded_audio_string_.Get(); +} +inline void Summary_Audio::set_encoded_audio_string(const ::std::string& value) { + + encoded_audio_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) +} +#if LANG_CXX11 +inline void Summary_Audio::set_encoded_audio_string(::std::string&& value) { + + encoded_audio_string_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) +} +#endif +inline void Summary_Audio::set_encoded_audio_string(const char* value) { + GOOGLE_DCHECK(value != NULL); + + encoded_audio_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) +} +inline void Summary_Audio::set_encoded_audio_string(const void* value, + size_t size) { + + encoded_audio_string_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) +} +inline ::std::string* Summary_Audio::mutable_encoded_audio_string() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) + return encoded_audio_string_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Summary_Audio::release_encoded_audio_string() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) + + return encoded_audio_string_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Summary_Audio::set_allocated_encoded_audio_string(::std::string* encoded_audio_string) { + if (encoded_audio_string != NULL) { + + } else { + + } + encoded_audio_string_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), encoded_audio_string, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) +} +inline ::std::string* Summary_Audio::unsafe_arena_release_encoded_audio_string() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return encoded_audio_string_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Summary_Audio::unsafe_arena_set_allocated_encoded_audio_string( + ::std::string* encoded_audio_string) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (encoded_audio_string != NULL) { + + } else { + + } + encoded_audio_string_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + encoded_audio_string, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Audio.encoded_audio_string) +} + +// string content_type = 5; +inline void Summary_Audio::clear_content_type() { + content_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Summary_Audio::content_type() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Audio.content_type) + return content_type_.Get(); +} +inline void Summary_Audio::set_content_type(const ::std::string& value) { + + content_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Audio.content_type) +} +#if LANG_CXX11 +inline void Summary_Audio::set_content_type(::std::string&& value) { + + content_type_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.Summary.Audio.content_type) +} +#endif +inline void Summary_Audio::set_content_type(const char* value) { + GOOGLE_DCHECK(value != NULL); + + content_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.Summary.Audio.content_type) +} +inline void Summary_Audio::set_content_type(const char* value, + size_t size) { + + content_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.Summary.Audio.content_type) +} +inline ::std::string* Summary_Audio::mutable_content_type() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Audio.content_type) + return content_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Summary_Audio::release_content_type() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Audio.content_type) + + return content_type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Summary_Audio::set_allocated_content_type(::std::string* content_type) { + if (content_type != NULL) { + + } else { + + } + content_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), content_type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Audio.content_type) +} +inline ::std::string* Summary_Audio::unsafe_arena_release_content_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Audio.content_type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return content_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Summary_Audio::unsafe_arena_set_allocated_content_type( + ::std::string* content_type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (content_type != NULL) { + + } else { + + } + content_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + content_type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Audio.content_type) +} + +// ------------------------------------------------------------------- + +// Summary_Value + +// string node_name = 7; +inline void Summary_Value::clear_node_name() { + node_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Summary_Value::node_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.node_name) + return node_name_.Get(); +} +inline void Summary_Value::set_node_name(const ::std::string& value) { + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Value.node_name) +} +#if LANG_CXX11 +inline void Summary_Value::set_node_name(::std::string&& value) { + + node_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.Summary.Value.node_name) +} +#endif +inline void Summary_Value::set_node_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.Summary.Value.node_name) +} +inline void Summary_Value::set_node_name(const char* value, + size_t size) { + + node_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.Summary.Value.node_name) +} +inline ::std::string* Summary_Value::mutable_node_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.node_name) + return node_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Summary_Value::release_node_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.node_name) + + return node_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Summary_Value::set_allocated_node_name(::std::string* node_name) { + if (node_name != NULL) { + + } else { + + } + node_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), node_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.node_name) +} +inline ::std::string* Summary_Value::unsafe_arena_release_node_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.node_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return node_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Summary_Value::unsafe_arena_set_allocated_node_name( + ::std::string* node_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (node_name != NULL) { + + } else { + + } + node_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + node_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.node_name) +} + +// string tag = 1; +inline void Summary_Value::clear_tag() { + tag_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& Summary_Value::tag() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.tag) + return tag_.Get(); +} +inline void Summary_Value::set_tag(const ::std::string& value) { + + tag_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Value.tag) +} +#if LANG_CXX11 +inline void Summary_Value::set_tag(::std::string&& value) { + + tag_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.Summary.Value.tag) +} +#endif +inline void Summary_Value::set_tag(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tag_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.Summary.Value.tag) +} +inline void Summary_Value::set_tag(const char* value, + size_t size) { + + tag_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.Summary.Value.tag) +} +inline ::std::string* Summary_Value::mutable_tag() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.tag) + return tag_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* Summary_Value::release_tag() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.tag) + + return tag_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void Summary_Value::set_allocated_tag(::std::string* tag) { + if (tag != NULL) { + + } else { + + } + tag_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tag, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.tag) +} +inline ::std::string* Summary_Value::unsafe_arena_release_tag() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.tag) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return tag_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void Summary_Value::unsafe_arena_set_allocated_tag( + ::std::string* tag) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (tag != NULL) { + + } else { + + } + tag_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + tag, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.tag) +} + +// .diplomacy.tensorflow.SummaryMetadata metadata = 9; +inline bool Summary_Value::has_metadata() const { + return this != internal_default_instance() && metadata_ != NULL; +} +inline void Summary_Value::clear_metadata() { + if (GetArenaNoVirtual() == NULL && metadata_ != NULL) { + delete metadata_; + } + metadata_ = NULL; +} +inline const ::diplomacy::tensorflow::SummaryMetadata& Summary_Value::_internal_metadata() const { + return *metadata_; +} +inline const ::diplomacy::tensorflow::SummaryMetadata& Summary_Value::metadata() const { + const ::diplomacy::tensorflow::SummaryMetadata* p = metadata_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.metadata) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_SummaryMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::SummaryMetadata* Summary_Value::release_metadata() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.metadata) + + ::diplomacy::tensorflow::SummaryMetadata* temp = metadata_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SummaryMetadata* Summary_Value::unsafe_arena_release_metadata() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.metadata) + + ::diplomacy::tensorflow::SummaryMetadata* temp = metadata_; + metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SummaryMetadata* Summary_Value::mutable_metadata() { + + if (metadata_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::SummaryMetadata>(GetArenaNoVirtual()); + metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.metadata) + return metadata_; +} +inline void Summary_Value::set_allocated_metadata(::diplomacy::tensorflow::SummaryMetadata* metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete metadata_; + } + if (metadata) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(metadata); + if (message_arena != submessage_arena) { + metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, metadata, submessage_arena); + } + + } else { + + } + metadata_ = metadata; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.metadata) +} + +// float simple_value = 2; +inline bool Summary_Value::has_simple_value() const { + return value_case() == kSimpleValue; +} +inline void Summary_Value::set_has_simple_value() { + _oneof_case_[0] = kSimpleValue; +} +inline void Summary_Value::clear_simple_value() { + if (has_simple_value()) { + value_.simple_value_ = 0; + clear_has_value(); + } +} +inline float Summary_Value::simple_value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.simple_value) + if (has_simple_value()) { + return value_.simple_value_; + } + return 0; +} +inline void Summary_Value::set_simple_value(float value) { + if (!has_simple_value()) { + clear_value(); + set_has_simple_value(); + } + value_.simple_value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Value.simple_value) +} + +// bytes obsolete_old_style_histogram = 3; +inline bool Summary_Value::has_obsolete_old_style_histogram() const { + return value_case() == kObsoleteOldStyleHistogram; +} +inline void Summary_Value::set_has_obsolete_old_style_histogram() { + _oneof_case_[0] = kObsoleteOldStyleHistogram; +} +inline void Summary_Value::clear_obsolete_old_style_histogram() { + if (has_obsolete_old_style_histogram()) { + value_.obsolete_old_style_histogram_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_value(); + } +} +inline const ::std::string& Summary_Value::obsolete_old_style_histogram() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) + if (has_obsolete_old_style_histogram()) { + return value_.obsolete_old_style_histogram_.Get(); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void Summary_Value::set_obsolete_old_style_histogram(const ::std::string& value) { + if (!has_obsolete_old_style_histogram()) { + clear_value(); + set_has_obsolete_old_style_histogram(); + value_.obsolete_old_style_histogram_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.obsolete_old_style_histogram_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) +} +#if LANG_CXX11 +inline void Summary_Value::set_obsolete_old_style_histogram(::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) + if (!has_obsolete_old_style_histogram()) { + clear_value(); + set_has_obsolete_old_style_histogram(); + value_.obsolete_old_style_histogram_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.obsolete_old_style_histogram_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) +} +#endif +inline void Summary_Value::set_obsolete_old_style_histogram(const char* value) { + GOOGLE_DCHECK(value != NULL); + if (!has_obsolete_old_style_histogram()) { + clear_value(); + set_has_obsolete_old_style_histogram(); + value_.obsolete_old_style_histogram_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.obsolete_old_style_histogram_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) +} +inline void Summary_Value::set_obsolete_old_style_histogram(const void* value, + size_t size) { + if (!has_obsolete_old_style_histogram()) { + clear_value(); + set_has_obsolete_old_style_histogram(); + value_.obsolete_old_style_histogram_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.obsolete_old_style_histogram_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) +} +inline ::std::string* Summary_Value::mutable_obsolete_old_style_histogram() { + if (!has_obsolete_old_style_histogram()) { + clear_value(); + set_has_obsolete_old_style_histogram(); + value_.obsolete_old_style_histogram_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return value_.obsolete_old_style_histogram_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) +} +inline ::std::string* Summary_Value::release_obsolete_old_style_histogram() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) + if (has_obsolete_old_style_histogram()) { + clear_has_value(); + return value_.obsolete_old_style_histogram_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void Summary_Value::set_allocated_obsolete_old_style_histogram(::std::string* obsolete_old_style_histogram) { + if (!has_obsolete_old_style_histogram()) { + value_.obsolete_old_style_histogram_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (obsolete_old_style_histogram != NULL) { + set_has_obsolete_old_style_histogram(); + value_.obsolete_old_style_histogram_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), obsolete_old_style_histogram, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) +} +inline ::std::string* Summary_Value::unsafe_arena_release_obsolete_old_style_histogram() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_obsolete_old_style_histogram()) { + clear_has_value(); + return value_.obsolete_old_style_histogram_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void Summary_Value::unsafe_arena_set_allocated_obsolete_old_style_histogram(::std::string* obsolete_old_style_histogram) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_obsolete_old_style_histogram()) { + value_.obsolete_old_style_histogram_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (obsolete_old_style_histogram) { + set_has_obsolete_old_style_histogram(); + value_.obsolete_old_style_histogram_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), obsolete_old_style_histogram, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram) +} + +// .diplomacy.tensorflow.Summary.Image image = 4; +inline bool Summary_Value::has_image() const { + return value_case() == kImage; +} +inline void Summary_Value::set_has_image() { + _oneof_case_[0] = kImage; +} +inline void Summary_Value::clear_image() { + if (has_image()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.image_; + } + clear_has_value(); + } +} +inline const ::diplomacy::tensorflow::Summary_Image& Summary_Value::_internal_image() const { + return *value_.image_; +} +inline ::diplomacy::tensorflow::Summary_Image* Summary_Value::release_image() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.image) + if (has_image()) { + clear_has_value(); + ::diplomacy::tensorflow::Summary_Image* temp = value_.image_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.image_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::Summary_Image& Summary_Value::image() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.image) + return has_image() + ? *value_.image_ + : *reinterpret_cast< ::diplomacy::tensorflow::Summary_Image*>(&::diplomacy::tensorflow::_Summary_Image_default_instance_); +} +inline ::diplomacy::tensorflow::Summary_Image* Summary_Value::unsafe_arena_release_image() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.image) + if (has_image()) { + clear_has_value(); + ::diplomacy::tensorflow::Summary_Image* temp = value_.image_; + value_.image_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Summary_Value::unsafe_arena_set_allocated_image(::diplomacy::tensorflow::Summary_Image* image) { + clear_value(); + if (image) { + set_has_image(); + value_.image_ = image; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.image) +} +inline ::diplomacy::tensorflow::Summary_Image* Summary_Value::mutable_image() { + if (!has_image()) { + clear_value(); + set_has_image(); + value_.image_ = CreateMaybeMessage< ::diplomacy::tensorflow::Summary_Image >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.image) + return value_.image_; +} + +// .diplomacy.tensorflow.HistogramProto histo = 5; +inline bool Summary_Value::has_histo() const { + return value_case() == kHisto; +} +inline void Summary_Value::set_has_histo() { + _oneof_case_[0] = kHisto; +} +inline void Summary_Value::clear_histo() { + if (has_histo()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.histo_; + } + clear_has_value(); + } +} +inline const ::diplomacy::tensorflow::HistogramProto& Summary_Value::_internal_histo() const { + return *value_.histo_; +} +inline ::diplomacy::tensorflow::HistogramProto* Summary_Value::release_histo() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.histo) + if (has_histo()) { + clear_has_value(); + ::diplomacy::tensorflow::HistogramProto* temp = value_.histo_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.histo_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::HistogramProto& Summary_Value::histo() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.histo) + return has_histo() + ? *value_.histo_ + : *reinterpret_cast< ::diplomacy::tensorflow::HistogramProto*>(&::diplomacy::tensorflow::_HistogramProto_default_instance_); +} +inline ::diplomacy::tensorflow::HistogramProto* Summary_Value::unsafe_arena_release_histo() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.histo) + if (has_histo()) { + clear_has_value(); + ::diplomacy::tensorflow::HistogramProto* temp = value_.histo_; + value_.histo_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Summary_Value::unsafe_arena_set_allocated_histo(::diplomacy::tensorflow::HistogramProto* histo) { + clear_value(); + if (histo) { + set_has_histo(); + value_.histo_ = histo; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.histo) +} +inline ::diplomacy::tensorflow::HistogramProto* Summary_Value::mutable_histo() { + if (!has_histo()) { + clear_value(); + set_has_histo(); + value_.histo_ = CreateMaybeMessage< ::diplomacy::tensorflow::HistogramProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.histo) + return value_.histo_; +} + +// .diplomacy.tensorflow.Summary.Audio audio = 6; +inline bool Summary_Value::has_audio() const { + return value_case() == kAudio; +} +inline void Summary_Value::set_has_audio() { + _oneof_case_[0] = kAudio; +} +inline void Summary_Value::clear_audio() { + if (has_audio()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.audio_; + } + clear_has_value(); + } +} +inline const ::diplomacy::tensorflow::Summary_Audio& Summary_Value::_internal_audio() const { + return *value_.audio_; +} +inline ::diplomacy::tensorflow::Summary_Audio* Summary_Value::release_audio() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.audio) + if (has_audio()) { + clear_has_value(); + ::diplomacy::tensorflow::Summary_Audio* temp = value_.audio_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.audio_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::Summary_Audio& Summary_Value::audio() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.audio) + return has_audio() + ? *value_.audio_ + : *reinterpret_cast< ::diplomacy::tensorflow::Summary_Audio*>(&::diplomacy::tensorflow::_Summary_Audio_default_instance_); +} +inline ::diplomacy::tensorflow::Summary_Audio* Summary_Value::unsafe_arena_release_audio() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.audio) + if (has_audio()) { + clear_has_value(); + ::diplomacy::tensorflow::Summary_Audio* temp = value_.audio_; + value_.audio_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Summary_Value::unsafe_arena_set_allocated_audio(::diplomacy::tensorflow::Summary_Audio* audio) { + clear_value(); + if (audio) { + set_has_audio(); + value_.audio_ = audio; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.audio) +} +inline ::diplomacy::tensorflow::Summary_Audio* Summary_Value::mutable_audio() { + if (!has_audio()) { + clear_value(); + set_has_audio(); + value_.audio_ = CreateMaybeMessage< ::diplomacy::tensorflow::Summary_Audio >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.audio) + return value_.audio_; +} + +// .diplomacy.tensorflow.TensorProto tensor = 8; +inline bool Summary_Value::has_tensor() const { + return value_case() == kTensor; +} +inline void Summary_Value::set_has_tensor() { + _oneof_case_[0] = kTensor; +} +inline const ::diplomacy::tensorflow::TensorProto& Summary_Value::_internal_tensor() const { + return *value_.tensor_; +} +inline ::diplomacy::tensorflow::TensorProto* Summary_Value::release_tensor() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.Summary.Value.tensor) + if (has_tensor()) { + clear_has_value(); + ::diplomacy::tensorflow::TensorProto* temp = value_.tensor_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_.tensor_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::TensorProto& Summary_Value::tensor() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.Value.tensor) + return has_tensor() + ? *value_.tensor_ + : *reinterpret_cast< ::diplomacy::tensorflow::TensorProto*>(&::diplomacy::tensorflow::_TensorProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorProto* Summary_Value::unsafe_arena_release_tensor() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.Summary.Value.tensor) + if (has_tensor()) { + clear_has_value(); + ::diplomacy::tensorflow::TensorProto* temp = value_.tensor_; + value_.tensor_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Summary_Value::unsafe_arena_set_allocated_tensor(::diplomacy::tensorflow::TensorProto* tensor) { + clear_value(); + if (tensor) { + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.Summary.Value.tensor) +} +inline ::diplomacy::tensorflow::TensorProto* Summary_Value::mutable_tensor() { + if (!has_tensor()) { + clear_value(); + set_has_tensor(); + value_.tensor_ = CreateMaybeMessage< ::diplomacy::tensorflow::TensorProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.Value.tensor) + return value_.tensor_; +} + +inline bool Summary_Value::has_value() const { + return value_case() != VALUE_NOT_SET; +} +inline void Summary_Value::clear_has_value() { + _oneof_case_[0] = VALUE_NOT_SET; +} +inline Summary_Value::ValueCase Summary_Value::value_case() const { + return Summary_Value::ValueCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Summary + +// repeated .diplomacy.tensorflow.Summary.Value value = 1; +inline int Summary::value_size() const { + return value_.size(); +} +inline void Summary::clear_value() { + value_.Clear(); +} +inline ::diplomacy::tensorflow::Summary_Value* Summary::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.Summary.value) + return value_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Summary_Value >* +Summary::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.Summary.value) + return &value_; +} +inline const ::diplomacy::tensorflow::Summary_Value& Summary::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.Summary.value) + return value_.Get(index); +} +inline ::diplomacy::tensorflow::Summary_Value* Summary::add_value() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.Summary.value) + return value_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::Summary_Value >& +Summary::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.Summary.value) + return value_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fsummary_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary.proto new file mode 100644 index 0000000..7117d1d --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "SummaryProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/tensor.proto"; + +// Metadata associated with a series of Summary data +message SummaryDescription { + // Hint on how plugins should process the data in this series. + // Supported values include "scalar", "histogram", "image", "audio" + string type_hint = 1; +} + +// Serialization format for histogram module in +// core/lib/histogram/histogram.h +message HistogramProto { + double min = 1; + double max = 2; + double num = 3; + double sum = 4; + double sum_squares = 5; + + // Parallel arrays encoding the bucket boundaries and the bucket values. + // bucket(i) is the count for the bucket i. The range for + // a bucket is: + // i == 0: -DBL_MAX .. bucket_limit(0) + // i != 0: bucket_limit(i-1) .. bucket_limit(i) + repeated double bucket_limit = 6 [packed = true]; + repeated double bucket = 7 [packed = true]; +}; + +// A SummaryMetadata encapsulates information on which plugins are able to make +// use of a certain summary value. +message SummaryMetadata { + message PluginData { + // The name of the plugin this data pertains to. + string plugin_name = 1; + + // The content to store for the plugin. The best practice is for this to be + // a binary serialized protocol buffer. + bytes content = 2; + } + + // Data that associates a summary with a certain plugin. + PluginData plugin_data = 1; + + // Display name for viewing in TensorBoard. + string display_name = 2; + + // Longform readable description of the summary sequence. Markdown supported. + string summary_description = 3; +}; + +// A Summary is a set of named values to be displayed by the +// visualizer. +// +// Summaries are produced regularly during training, as controlled by +// the "summary_interval_secs" attribute of the training operation. +// Summaries are also produced at the end of an evaluation. +message Summary { + message Image { + // Dimensions of the image. + int32 height = 1; + int32 width = 2; + // Valid colorspace values are + // 1 - grayscale + // 2 - grayscale + alpha + // 3 - RGB + // 4 - RGBA + // 5 - DIGITAL_YUV + // 6 - BGRA + int32 colorspace = 3; + // Image data in encoded format. All image formats supported by + // image_codec::CoderUtil can be stored here. + bytes encoded_image_string = 4; + } + + message Audio { + // Sample rate of the audio in Hz. + float sample_rate = 1; + // Number of channels of audio. + int64 num_channels = 2; + // Length of the audio in frames (samples per channel). + int64 length_frames = 3; + // Encoded audio data and its associated RFC 2045 content type (e.g. + // "audio/wav"). + bytes encoded_audio_string = 4; + string content_type = 5; + } + + message Value { + // This field is deprecated and will not be set. + string node_name = 7; + + // Tag name for the data. Used by TensorBoard plugins to organize data. Tags + // are often organized by scope (which contains slashes to convey + // hierarchy). For example: foo/bar/0 + string tag = 1; + + // Contains metadata on the summary value such as which plugins may use it. + // Take note that many summary values may lack a metadata field. This is + // because the FileWriter only keeps a metadata object on the first summary + // value with a certain tag for each tag. TensorBoard then remembers which + // tags are associated with which plugins. This saves space. + SummaryMetadata metadata = 9; + + // Value associated with the tag. + oneof value { + float simple_value = 2; + bytes obsolete_old_style_histogram = 3; + Image image = 4; + HistogramProto histo = 5; + Audio audio = 6; + TensorProto tensor = 8; + } + } + + // Set of values for the summary. + repeated Value value = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary_pb2.py new file mode 100644 index 0000000..0cdab1f --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/summary_pb2.py @@ -0,0 +1,543 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/summary.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/summary.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\rSummaryProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n1diplomacy_tensorflow/core/framework/summary.proto\x12\x14\x64iplomacy.tensorflow\x1a\x30\x64iplomacy_tensorflow/core/framework/tensor.proto\"\'\n\x12SummaryDescription\x12\x11\n\ttype_hint\x18\x01 \x01(\t\"\x87\x01\n\x0eHistogramProto\x12\x0b\n\x03min\x18\x01 \x01(\x01\x12\x0b\n\x03max\x18\x02 \x01(\x01\x12\x0b\n\x03num\x18\x03 \x01(\x01\x12\x0b\n\x03sum\x18\x04 \x01(\x01\x12\x13\n\x0bsum_squares\x18\x05 \x01(\x01\x12\x18\n\x0c\x62ucket_limit\x18\x06 \x03(\x01\x42\x02\x10\x01\x12\x12\n\x06\x62ucket\x18\x07 \x03(\x01\x42\x02\x10\x01\"\xbf\x01\n\x0fSummaryMetadata\x12\x45\n\x0bplugin_data\x18\x01 \x01(\x0b\x32\x30.diplomacy.tensorflow.SummaryMetadata.PluginData\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1b\n\x13summary_description\x18\x03 \x01(\t\x1a\x32\n\nPluginData\x12\x13\n\x0bplugin_name\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\x0c\"\x9a\x05\n\x07Summary\x12\x32\n\x05value\x18\x01 \x03(\x0b\x32#.diplomacy.tensorflow.Summary.Value\x1aX\n\x05Image\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x12\n\ncolorspace\x18\x03 \x01(\x05\x12\x1c\n\x14\x65ncoded_image_string\x18\x04 \x01(\x0c\x1a}\n\x05\x41udio\x12\x13\n\x0bsample_rate\x18\x01 \x01(\x02\x12\x14\n\x0cnum_channels\x18\x02 \x01(\x03\x12\x15\n\rlength_frames\x18\x03 \x01(\x03\x12\x1c\n\x14\x65ncoded_audio_string\x18\x04 \x01(\x0c\x12\x14\n\x0c\x63ontent_type\x18\x05 \x01(\t\x1a\x81\x03\n\x05Value\x12\x11\n\tnode_name\x18\x07 \x01(\t\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x37\n\x08metadata\x18\t \x01(\x0b\x32%.diplomacy.tensorflow.SummaryMetadata\x12\x16\n\x0csimple_value\x18\x02 \x01(\x02H\x00\x12&\n\x1cobsolete_old_style_histogram\x18\x03 \x01(\x0cH\x00\x12\x34\n\x05image\x18\x04 \x01(\x0b\x32#.diplomacy.tensorflow.Summary.ImageH\x00\x12\x35\n\x05histo\x18\x05 \x01(\x0b\x32$.diplomacy.tensorflow.HistogramProtoH\x00\x12\x34\n\x05\x61udio\x18\x06 \x01(\x0b\x32#.diplomacy.tensorflow.Summary.AudioH\x00\x12\x33\n\x06tensor\x18\x08 \x01(\x0b\x32!.diplomacy.tensorflow.TensorProtoH\x00\x42\x07\n\x05valueBm\n\x18org.tensorflow.frameworkB\rSummaryProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2.DESCRIPTOR,]) + + + + +_SUMMARYDESCRIPTION = _descriptor.Descriptor( + name='SummaryDescription', + full_name='diplomacy.tensorflow.SummaryDescription', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type_hint', full_name='diplomacy.tensorflow.SummaryDescription.type_hint', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=125, + serialized_end=164, +) + + +_HISTOGRAMPROTO = _descriptor.Descriptor( + name='HistogramProto', + full_name='diplomacy.tensorflow.HistogramProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='min', full_name='diplomacy.tensorflow.HistogramProto.min', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max', full_name='diplomacy.tensorflow.HistogramProto.max', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num', full_name='diplomacy.tensorflow.HistogramProto.num', index=2, + number=3, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sum', full_name='diplomacy.tensorflow.HistogramProto.sum', index=3, + number=4, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sum_squares', full_name='diplomacy.tensorflow.HistogramProto.sum_squares', index=4, + number=5, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bucket_limit', full_name='diplomacy.tensorflow.HistogramProto.bucket_limit', index=5, + number=6, type=1, cpp_type=5, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bucket', full_name='diplomacy.tensorflow.HistogramProto.bucket', index=6, + number=7, type=1, cpp_type=5, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=167, + serialized_end=302, +) + + +_SUMMARYMETADATA_PLUGINDATA = _descriptor.Descriptor( + name='PluginData', + full_name='diplomacy.tensorflow.SummaryMetadata.PluginData', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='plugin_name', full_name='diplomacy.tensorflow.SummaryMetadata.PluginData.plugin_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='content', full_name='diplomacy.tensorflow.SummaryMetadata.PluginData.content', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=446, + serialized_end=496, +) + +_SUMMARYMETADATA = _descriptor.Descriptor( + name='SummaryMetadata', + full_name='diplomacy.tensorflow.SummaryMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='plugin_data', full_name='diplomacy.tensorflow.SummaryMetadata.plugin_data', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='display_name', full_name='diplomacy.tensorflow.SummaryMetadata.display_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='summary_description', full_name='diplomacy.tensorflow.SummaryMetadata.summary_description', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SUMMARYMETADATA_PLUGINDATA, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=305, + serialized_end=496, +) + + +_SUMMARY_IMAGE = _descriptor.Descriptor( + name='Image', + full_name='diplomacy.tensorflow.Summary.Image', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='height', full_name='diplomacy.tensorflow.Summary.Image.height', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='width', full_name='diplomacy.tensorflow.Summary.Image.width', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='colorspace', full_name='diplomacy.tensorflow.Summary.Image.colorspace', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='encoded_image_string', full_name='diplomacy.tensorflow.Summary.Image.encoded_image_string', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=562, + serialized_end=650, +) + +_SUMMARY_AUDIO = _descriptor.Descriptor( + name='Audio', + full_name='diplomacy.tensorflow.Summary.Audio', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='sample_rate', full_name='diplomacy.tensorflow.Summary.Audio.sample_rate', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_channels', full_name='diplomacy.tensorflow.Summary.Audio.num_channels', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='length_frames', full_name='diplomacy.tensorflow.Summary.Audio.length_frames', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='encoded_audio_string', full_name='diplomacy.tensorflow.Summary.Audio.encoded_audio_string', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='content_type', full_name='diplomacy.tensorflow.Summary.Audio.content_type', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=652, + serialized_end=777, +) + +_SUMMARY_VALUE = _descriptor.Descriptor( + name='Value', + full_name='diplomacy.tensorflow.Summary.Value', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_name', full_name='diplomacy.tensorflow.Summary.Value.node_name', index=0, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tag', full_name='diplomacy.tensorflow.Summary.Value.tag', index=1, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata', full_name='diplomacy.tensorflow.Summary.Value.metadata', index=2, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='simple_value', full_name='diplomacy.tensorflow.Summary.Value.simple_value', index=3, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='obsolete_old_style_histogram', full_name='diplomacy.tensorflow.Summary.Value.obsolete_old_style_histogram', index=4, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='image', full_name='diplomacy.tensorflow.Summary.Value.image', index=5, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='histo', full_name='diplomacy.tensorflow.Summary.Value.histo', index=6, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='audio', full_name='diplomacy.tensorflow.Summary.Value.audio', index=7, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor', full_name='diplomacy.tensorflow.Summary.Value.tensor', index=8, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='value', full_name='diplomacy.tensorflow.Summary.Value.value', + index=0, containing_type=None, fields=[]), + ], + serialized_start=780, + serialized_end=1165, +) + +_SUMMARY = _descriptor.Descriptor( + name='Summary', + full_name='diplomacy.tensorflow.Summary', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.Summary.value', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SUMMARY_IMAGE, _SUMMARY_AUDIO, _SUMMARY_VALUE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=499, + serialized_end=1165, +) + +_SUMMARYMETADATA_PLUGINDATA.containing_type = _SUMMARYMETADATA +_SUMMARYMETADATA.fields_by_name['plugin_data'].message_type = _SUMMARYMETADATA_PLUGINDATA +_SUMMARY_IMAGE.containing_type = _SUMMARY +_SUMMARY_AUDIO.containing_type = _SUMMARY +_SUMMARY_VALUE.fields_by_name['metadata'].message_type = _SUMMARYMETADATA +_SUMMARY_VALUE.fields_by_name['image'].message_type = _SUMMARY_IMAGE +_SUMMARY_VALUE.fields_by_name['histo'].message_type = _HISTOGRAMPROTO +_SUMMARY_VALUE.fields_by_name['audio'].message_type = _SUMMARY_AUDIO +_SUMMARY_VALUE.fields_by_name['tensor'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2._TENSORPROTO +_SUMMARY_VALUE.containing_type = _SUMMARY +_SUMMARY_VALUE.oneofs_by_name['value'].fields.append( + _SUMMARY_VALUE.fields_by_name['simple_value']) +_SUMMARY_VALUE.fields_by_name['simple_value'].containing_oneof = _SUMMARY_VALUE.oneofs_by_name['value'] +_SUMMARY_VALUE.oneofs_by_name['value'].fields.append( + _SUMMARY_VALUE.fields_by_name['obsolete_old_style_histogram']) +_SUMMARY_VALUE.fields_by_name['obsolete_old_style_histogram'].containing_oneof = _SUMMARY_VALUE.oneofs_by_name['value'] +_SUMMARY_VALUE.oneofs_by_name['value'].fields.append( + _SUMMARY_VALUE.fields_by_name['image']) +_SUMMARY_VALUE.fields_by_name['image'].containing_oneof = _SUMMARY_VALUE.oneofs_by_name['value'] +_SUMMARY_VALUE.oneofs_by_name['value'].fields.append( + _SUMMARY_VALUE.fields_by_name['histo']) +_SUMMARY_VALUE.fields_by_name['histo'].containing_oneof = _SUMMARY_VALUE.oneofs_by_name['value'] +_SUMMARY_VALUE.oneofs_by_name['value'].fields.append( + _SUMMARY_VALUE.fields_by_name['audio']) +_SUMMARY_VALUE.fields_by_name['audio'].containing_oneof = _SUMMARY_VALUE.oneofs_by_name['value'] +_SUMMARY_VALUE.oneofs_by_name['value'].fields.append( + _SUMMARY_VALUE.fields_by_name['tensor']) +_SUMMARY_VALUE.fields_by_name['tensor'].containing_oneof = _SUMMARY_VALUE.oneofs_by_name['value'] +_SUMMARY.fields_by_name['value'].message_type = _SUMMARY_VALUE +DESCRIPTOR.message_types_by_name['SummaryDescription'] = _SUMMARYDESCRIPTION +DESCRIPTOR.message_types_by_name['HistogramProto'] = _HISTOGRAMPROTO +DESCRIPTOR.message_types_by_name['SummaryMetadata'] = _SUMMARYMETADATA +DESCRIPTOR.message_types_by_name['Summary'] = _SUMMARY +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +SummaryDescription = _reflection.GeneratedProtocolMessageType('SummaryDescription', (_message.Message,), dict( + DESCRIPTOR = _SUMMARYDESCRIPTION, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SummaryDescription) + )) +_sym_db.RegisterMessage(SummaryDescription) + +HistogramProto = _reflection.GeneratedProtocolMessageType('HistogramProto', (_message.Message,), dict( + DESCRIPTOR = _HISTOGRAMPROTO, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.HistogramProto) + )) +_sym_db.RegisterMessage(HistogramProto) + +SummaryMetadata = _reflection.GeneratedProtocolMessageType('SummaryMetadata', (_message.Message,), dict( + + PluginData = _reflection.GeneratedProtocolMessageType('PluginData', (_message.Message,), dict( + DESCRIPTOR = _SUMMARYMETADATA_PLUGINDATA, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SummaryMetadata.PluginData) + )) + , + DESCRIPTOR = _SUMMARYMETADATA, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SummaryMetadata) + )) +_sym_db.RegisterMessage(SummaryMetadata) +_sym_db.RegisterMessage(SummaryMetadata.PluginData) + +Summary = _reflection.GeneratedProtocolMessageType('Summary', (_message.Message,), dict( + + Image = _reflection.GeneratedProtocolMessageType('Image', (_message.Message,), dict( + DESCRIPTOR = _SUMMARY_IMAGE, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary.Image) + )) + , + + Audio = _reflection.GeneratedProtocolMessageType('Audio', (_message.Message,), dict( + DESCRIPTOR = _SUMMARY_AUDIO, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary.Audio) + )) + , + + Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), dict( + DESCRIPTOR = _SUMMARY_VALUE, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary.Value) + )) + , + DESCRIPTOR = _SUMMARY, + __module__ = 'diplomacy_tensorflow.core.framework.summary_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.Summary) + )) +_sym_db.RegisterMessage(Summary) +_sym_db.RegisterMessage(Summary.Image) +_sym_db.RegisterMessage(Summary.Audio) +_sym_db.RegisterMessage(Summary.Value) + + +DESCRIPTOR._options = None +_HISTOGRAMPROTO.fields_by_name['bucket_limit']._options = None +_HISTOGRAMPROTO.fields_by_name['bucket']._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.pb.cc new file mode 100644 index 0000000..f3ab0fa --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.pb.cc @@ -0,0 +1,1749 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/tensor.proto + +#include "diplomacy_tensorflow/core/framework/tensor.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ResourceHandleProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorProto_default_instance_; +class VariantTensorDataProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _VariantTensorDataProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +static void InitDefaultsTensorProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_TensorProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::TensorProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + { + void* ptr = &::diplomacy::tensorflow::_VariantTensorDataProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::VariantTensorDataProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::TensorProto::InitAsDefaultInstance(); + ::diplomacy::tensorflow::VariantTensorDataProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TensorProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTensorProto}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::scc_info_ResourceHandleProto.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TensorProto.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, dtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, tensor_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, version_number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, tensor_content_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, half_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, float_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, double_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, int_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, string_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, scomplex_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, int64_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, bool_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, dcomplex_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, resource_handle_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, variant_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, uint32_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorProto, uint64_val_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariantTensorDataProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariantTensorDataProto, type_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariantTensorDataProto, metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariantTensorDataProto, tensors_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::TensorProto)}, + { 22, -1, sizeof(::diplomacy::tensorflow::VariantTensorDataProto)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_TensorProto_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_VariantTensorDataProto_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/tensor.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n0diplomacy_tensorflow/core/framework/te" + "nsor.proto\022\024diplomacy.tensorflow\0329diplom" + "acy_tensorflow/core/framework/resource_h" + "andle.proto\0326diplomacy_tensorflow/core/f" + "ramework/tensor_shape.proto\032/diplomacy_t" + "ensorflow/core/framework/types.proto\"\264\004\n" + "\013TensorProto\022-\n\005dtype\030\001 \001(\0162\036.diplomacy." + "tensorflow.DataType\022<\n\014tensor_shape\030\002 \001(" + "\0132&.diplomacy.tensorflow.TensorShapeProt" + "o\022\026\n\016version_number\030\003 \001(\005\022\026\n\016tensor_cont" + "ent\030\004 \001(\014\022\024\n\010half_val\030\r \003(\005B\002\020\001\022\025\n\tfloat" + "_val\030\005 \003(\002B\002\020\001\022\026\n\ndouble_val\030\006 \003(\001B\002\020\001\022\023" + "\n\007int_val\030\007 \003(\005B\002\020\001\022\022\n\nstring_val\030\010 \003(\014\022" + "\030\n\014scomplex_val\030\t \003(\002B\002\020\001\022\025\n\tint64_val\030\n" + " \003(\003B\002\020\001\022\024\n\010bool_val\030\013 \003(\010B\002\020\001\022\030\n\014dcompl" + "ex_val\030\014 \003(\001B\002\020\001\022F\n\023resource_handle_val\030" + "\016 \003(\0132).diplomacy.tensorflow.ResourceHan" + "dleProto\022A\n\013variant_val\030\017 \003(\0132,.diplomac" + "y.tensorflow.VariantTensorDataProto\022\026\n\nu" + "int32_val\030\020 \003(\rB\002\020\001\022\026\n\nuint64_val\030\021 \003(\004B" + "\002\020\001\"q\n\026VariantTensorDataProto\022\021\n\ttype_na" + "me\030\001 \001(\t\022\020\n\010metadata\030\002 \001(\014\0222\n\007tensors\030\003 " + "\003(\0132!.diplomacy.tensorflow.TensorProtoBl" + "\n\030org.tensorflow.frameworkB\014TensorProtos" + "P\001Z=github.com/tensorflow/tensorflow/ten" + "sorflow/go/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1036); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/tensor.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void TensorProto::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_TensorProto_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); +} +void TensorProto::unsafe_arena_set_allocated_tensor_shape( + ::diplomacy::tensorflow::TensorShapeProto* tensor_shape) { + if (GetArenaNoVirtual() == NULL) { + delete tensor_shape_; + } + tensor_shape_ = tensor_shape; + if (tensor_shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.TensorProto.tensor_shape) +} +void TensorProto::clear_tensor_shape() { + if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) { + delete tensor_shape_; + } + tensor_shape_ = NULL; +} +void TensorProto::clear_resource_handle_val() { + resource_handle_val_.Clear(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorProto::kDtypeFieldNumber; +const int TensorProto::kTensorShapeFieldNumber; +const int TensorProto::kVersionNumberFieldNumber; +const int TensorProto::kTensorContentFieldNumber; +const int TensorProto::kHalfValFieldNumber; +const int TensorProto::kFloatValFieldNumber; +const int TensorProto::kDoubleValFieldNumber; +const int TensorProto::kIntValFieldNumber; +const int TensorProto::kStringValFieldNumber; +const int TensorProto::kScomplexValFieldNumber; +const int TensorProto::kInt64ValFieldNumber; +const int TensorProto::kBoolValFieldNumber; +const int TensorProto::kDcomplexValFieldNumber; +const int TensorProto::kResourceHandleValFieldNumber; +const int TensorProto::kVariantValFieldNumber; +const int TensorProto::kUint32ValFieldNumber; +const int TensorProto::kUint64ValFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorProto::TensorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.TensorProto) +} +TensorProto::TensorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + float_val_(arena), + double_val_(arena), + int_val_(arena), + string_val_(arena), + scomplex_val_(arena), + int64_val_(arena), + bool_val_(arena), + dcomplex_val_(arena), + half_val_(arena), + resource_handle_val_(arena), + variant_val_(arena), + uint32_val_(arena), + uint64_val_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.TensorProto) +} +TensorProto::TensorProto(const TensorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + float_val_(from.float_val_), + double_val_(from.double_val_), + int_val_(from.int_val_), + string_val_(from.string_val_), + scomplex_val_(from.scomplex_val_), + int64_val_(from.int64_val_), + bool_val_(from.bool_val_), + dcomplex_val_(from.dcomplex_val_), + half_val_(from.half_val_), + resource_handle_val_(from.resource_handle_val_), + variant_val_(from.variant_val_), + uint32_val_(from.uint32_val_), + uint64_val_(from.uint64_val_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + tensor_content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.tensor_content().size() > 0) { + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_content(), + GetArenaNoVirtual()); + } + if (from.has_tensor_shape()) { + tensor_shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.tensor_shape_); + } else { + tensor_shape_ = NULL; + } + ::memcpy(&dtype_, &from.dtype_, + static_cast(reinterpret_cast(&version_number_) - + reinterpret_cast(&dtype_)) + sizeof(version_number_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.TensorProto) +} + +void TensorProto::SharedCtor() { + tensor_content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&tensor_shape_, 0, static_cast( + reinterpret_cast(&version_number_) - + reinterpret_cast(&tensor_shape_)) + sizeof(version_number_)); +} + +TensorProto::~TensorProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.TensorProto) + SharedDtor(); +} + +void TensorProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + tensor_content_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete tensor_shape_; +} + +void TensorProto::ArenaDtor(void* object) { + TensorProto* _this = reinterpret_cast< TensorProto* >(object); + (void)_this; +} +void TensorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorProto& TensorProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base); + return *internal_default_instance(); +} + + +void TensorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.TensorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + float_val_.Clear(); + double_val_.Clear(); + int_val_.Clear(); + string_val_.Clear(); + scomplex_val_.Clear(); + int64_val_.Clear(); + bool_val_.Clear(); + dcomplex_val_.Clear(); + half_val_.Clear(); + resource_handle_val_.Clear(); + variant_val_.Clear(); + uint32_val_.Clear(); + uint64_val_.Clear(); + tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) { + delete tensor_shape_; + } + tensor_shape_ = NULL; + ::memset(&dtype_, 0, static_cast( + reinterpret_cast(&version_number_) - + reinterpret_cast(&dtype_)) + sizeof(version_number_)); + _internal_metadata_.Clear(); +} + +bool TensorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.TensorProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.DataType dtype = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_tensor_shape())); + } else { + goto handle_unusual; + } + break; + } + + // int32 version_number = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &version_number_))); + } else { + goto handle_unusual; + } + break; + } + + // bytes tensor_content = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_tensor_content())); + } else { + goto handle_unusual; + } + break; + } + + // repeated float float_val = 5 [packed = true]; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_float_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 42u, input, this->mutable_float_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated double double_val = 6 [packed = true]; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_double_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(49u /* 49 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 50u, input, this->mutable_double_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 int_val = 7 [packed = true]; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_int_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 58u, input, this->mutable_int_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated bytes string_val = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_string_val())); + } else { + goto handle_unusual; + } + break; + } + + // repeated float scomplex_val = 9 [packed = true]; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_scomplex_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 74u, input, this->mutable_scomplex_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 int64_val = 10 [packed = true]; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_int64_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 82u, input, this->mutable_int64_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated bool bool_val = 11 [packed = true]; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_bool_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 90u, input, this->mutable_bool_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated double dcomplex_val = 12 [packed = true]; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_dcomplex_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 98u, input, this->mutable_dcomplex_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 half_val = 13 [packed = true]; + case 13: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_half_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 106u, input, this->mutable_half_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.ResourceHandleProto resource_handle_val = 14; + case 14: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_resource_handle_val())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.VariantTensorDataProto variant_val = 15; + case 15: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(122u /* 122 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_variant_val())); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint32 uint32_val = 16 [packed = true]; + case 16: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(130u /* 130 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_uint32_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(128u /* 128 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 2, 130u, input, this->mutable_uint32_val()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated uint64 uint64_val = 17 [packed = true]; + case 17: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(138u /* 138 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, this->mutable_uint64_val()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(136u /* 136 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + 2, 138u, input, this->mutable_uint64_val()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.TensorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.TensorProto) + return false; +#undef DO_ +} + +void TensorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.TensorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->dtype(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 2; + if (this->has_tensor_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_tensor_shape(), output); + } + + // int32 version_number = 3; + if (this->version_number() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version_number(), output); + } + + // bytes tensor_content = 4; + if (this->tensor_content().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->tensor_content(), output); + } + + // repeated float float_val = 5 [packed = true]; + if (this->float_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _float_val_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->float_val().data(), this->float_val_size(), output); + } + + // repeated double double_val = 6 [packed = true]; + if (this->double_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _double_val_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteDoubleArray( + this->double_val().data(), this->double_val_size(), output); + } + + // repeated int32 int_val = 7 [packed = true]; + if (this->int_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _int_val_cached_byte_size_)); + } + for (int i = 0, n = this->int_val_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->int_val(i), output); + } + + // repeated bytes string_val = 8; + for (int i = 0, n = this->string_val_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 8, this->string_val(i), output); + } + + // repeated float scomplex_val = 9 [packed = true]; + if (this->scomplex_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _scomplex_val_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->scomplex_val().data(), this->scomplex_val_size(), output); + } + + // repeated int64 int64_val = 10 [packed = true]; + if (this->int64_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _int64_val_cached_byte_size_)); + } + for (int i = 0, n = this->int64_val_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->int64_val(i), output); + } + + // repeated bool bool_val = 11 [packed = true]; + if (this->bool_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _bool_val_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteBoolArray( + this->bool_val().data(), this->bool_val_size(), output); + } + + // repeated double dcomplex_val = 12 [packed = true]; + if (this->dcomplex_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _dcomplex_val_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteDoubleArray( + this->dcomplex_val().data(), this->dcomplex_val_size(), output); + } + + // repeated int32 half_val = 13 [packed = true]; + if (this->half_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(13, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _half_val_cached_byte_size_)); + } + for (int i = 0, n = this->half_val_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->half_val(i), output); + } + + // repeated .diplomacy.tensorflow.ResourceHandleProto resource_handle_val = 14; + for (unsigned int i = 0, + n = static_cast(this->resource_handle_val_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 14, + this->resource_handle_val(static_cast(i)), + output); + } + + // repeated .diplomacy.tensorflow.VariantTensorDataProto variant_val = 15; + for (unsigned int i = 0, + n = static_cast(this->variant_val_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 15, + this->variant_val(static_cast(i)), + output); + } + + // repeated uint32 uint32_val = 16 [packed = true]; + if (this->uint32_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(16, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _uint32_val_cached_byte_size_)); + } + for (int i = 0, n = this->uint32_val_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->uint32_val(i), output); + } + + // repeated uint64 uint64_val = 17 [packed = true]; + if (this->uint64_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(17, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _uint64_val_cached_byte_size_)); + } + for (int i = 0, n = this->uint64_val_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag( + this->uint64_val(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.TensorProto) +} + +::google::protobuf::uint8* TensorProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.TensorProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->dtype(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 2; + if (this->has_tensor_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_tensor_shape(), deterministic, target); + } + + // int32 version_number = 3; + if (this->version_number() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version_number(), target); + } + + // bytes tensor_content = 4; + if (this->tensor_content().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->tensor_content(), target); + } + + // repeated float float_val = 5 [packed = true]; + if (this->float_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _float_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->float_val_, target); + } + + // repeated double double_val = 6 [packed = true]; + if (this->double_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _double_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->double_val_, target); + } + + // repeated int32 int_val = 7 [packed = true]; + if (this->int_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 7, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _int_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->int_val_, target); + } + + // repeated bytes string_val = 8; + for (int i = 0, n = this->string_val_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(8, this->string_val(i), target); + } + + // repeated float scomplex_val = 9 [packed = true]; + if (this->scomplex_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 9, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _scomplex_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->scomplex_val_, target); + } + + // repeated int64 int64_val = 10 [packed = true]; + if (this->int64_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _int64_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->int64_val_, target); + } + + // repeated bool bool_val = 11 [packed = true]; + if (this->bool_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 11, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _bool_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteBoolNoTagToArray(this->bool_val_, target); + } + + // repeated double dcomplex_val = 12 [packed = true]; + if (this->dcomplex_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 12, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _dcomplex_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->dcomplex_val_, target); + } + + // repeated int32 half_val = 13 [packed = true]; + if (this->half_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 13, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _half_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->half_val_, target); + } + + // repeated .diplomacy.tensorflow.ResourceHandleProto resource_handle_val = 14; + for (unsigned int i = 0, + n = static_cast(this->resource_handle_val_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 14, this->resource_handle_val(static_cast(i)), deterministic, target); + } + + // repeated .diplomacy.tensorflow.VariantTensorDataProto variant_val = 15; + for (unsigned int i = 0, + n = static_cast(this->variant_val_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 15, this->variant_val(static_cast(i)), deterministic, target); + } + + // repeated uint32 uint32_val = 16 [packed = true]; + if (this->uint32_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 16, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _uint32_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->uint32_val_, target); + } + + // repeated uint64 uint64_val = 17 [packed = true]; + if (this->uint64_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 17, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _uint64_val_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt64NoTagToArray(this->uint64_val_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.TensorProto) + return target; +} + +size_t TensorProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.TensorProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated float float_val = 5 [packed = true]; + { + unsigned int count = static_cast(this->float_val_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _float_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_val = 6 [packed = true]; + { + unsigned int count = static_cast(this->double_val_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int32 int_val = 7 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->int_val_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _int_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated bytes string_val = 8; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->string_val_size()); + for (int i = 0, n = this->string_val_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->string_val(i)); + } + + // repeated float scomplex_val = 9 [packed = true]; + { + unsigned int count = static_cast(this->scomplex_val_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _scomplex_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 int64_val = 10 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->int64_val_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _int64_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated bool bool_val = 11 [packed = true]; + { + unsigned int count = static_cast(this->bool_val_size()); + size_t data_size = 1UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _bool_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double dcomplex_val = 12 [packed = true]; + { + unsigned int count = static_cast(this->dcomplex_val_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dcomplex_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int32 half_val = 13 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->half_val_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .diplomacy.tensorflow.ResourceHandleProto resource_handle_val = 14; + { + unsigned int count = static_cast(this->resource_handle_val_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->resource_handle_val(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.VariantTensorDataProto variant_val = 15; + { + unsigned int count = static_cast(this->variant_val_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->variant_val(static_cast(i))); + } + } + + // repeated uint32 uint32_val = 16 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->uint32_val_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _uint32_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint64 uint64_val = 17 [packed = true]; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + UInt64Size(this->uint64_val_); + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _uint64_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // bytes tensor_content = 4; + if (this->tensor_content().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->tensor_content()); + } + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 2; + if (this->has_tensor_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *tensor_shape_); + } + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + // int32 version_number = 3; + if (this->version_number() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->version_number()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.TensorProto) + GOOGLE_DCHECK_NE(&from, this); + const TensorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.TensorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.TensorProto) + MergeFrom(*source); + } +} + +void TensorProto::MergeFrom(const TensorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.TensorProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + float_val_.MergeFrom(from.float_val_); + double_val_.MergeFrom(from.double_val_); + int_val_.MergeFrom(from.int_val_); + string_val_.MergeFrom(from.string_val_); + scomplex_val_.MergeFrom(from.scomplex_val_); + int64_val_.MergeFrom(from.int64_val_); + bool_val_.MergeFrom(from.bool_val_); + dcomplex_val_.MergeFrom(from.dcomplex_val_); + half_val_.MergeFrom(from.half_val_); + resource_handle_val_.MergeFrom(from.resource_handle_val_); + variant_val_.MergeFrom(from.variant_val_); + uint32_val_.MergeFrom(from.uint32_val_); + uint64_val_.MergeFrom(from.uint64_val_); + if (from.tensor_content().size() > 0) { + set_tensor_content(from.tensor_content()); + } + if (from.has_tensor_shape()) { + mutable_tensor_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } + if (from.version_number() != 0) { + set_version_number(from.version_number()); + } +} + +void TensorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.TensorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorProto::CopyFrom(const TensorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.TensorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorProto::IsInitialized() const { + return true; +} + +void TensorProto::Swap(TensorProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorProto::UnsafeArenaSwap(TensorProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorProto::InternalSwap(TensorProto* other) { + using std::swap; + float_val_.InternalSwap(&other->float_val_); + double_val_.InternalSwap(&other->double_val_); + int_val_.InternalSwap(&other->int_val_); + string_val_.InternalSwap(CastToBase(&other->string_val_)); + scomplex_val_.InternalSwap(&other->scomplex_val_); + int64_val_.InternalSwap(&other->int64_val_); + bool_val_.InternalSwap(&other->bool_val_); + dcomplex_val_.InternalSwap(&other->dcomplex_val_); + half_val_.InternalSwap(&other->half_val_); + CastToBase(&resource_handle_val_)->InternalSwap(CastToBase(&other->resource_handle_val_)); + CastToBase(&variant_val_)->InternalSwap(CastToBase(&other->variant_val_)); + uint32_val_.InternalSwap(&other->uint32_val_); + uint64_val_.InternalSwap(&other->uint64_val_); + tensor_content_.Swap(&other->tensor_content_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(tensor_shape_, other->tensor_shape_); + swap(dtype_, other->dtype_); + swap(version_number_, other->version_number_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void VariantTensorDataProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int VariantTensorDataProto::kTypeNameFieldNumber; +const int VariantTensorDataProto::kMetadataFieldNumber; +const int VariantTensorDataProto::kTensorsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +VariantTensorDataProto::VariantTensorDataProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.VariantTensorDataProto) +} +VariantTensorDataProto::VariantTensorDataProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + tensors_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.VariantTensorDataProto) +} +VariantTensorDataProto::VariantTensorDataProto(const VariantTensorDataProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + tensors_(from.tensors_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.type_name().size() > 0) { + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name(), + GetArenaNoVirtual()); + } + metadata_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.metadata().size() > 0) { + metadata_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.metadata(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.VariantTensorDataProto) +} + +void VariantTensorDataProto::SharedCtor() { + type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + metadata_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +VariantTensorDataProto::~VariantTensorDataProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.VariantTensorDataProto) + SharedDtor(); +} + +void VariantTensorDataProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + type_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + metadata_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void VariantTensorDataProto::ArenaDtor(void* object) { + VariantTensorDataProto* _this = reinterpret_cast< VariantTensorDataProto* >(object); + (void)_this; +} +void VariantTensorDataProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void VariantTensorDataProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* VariantTensorDataProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const VariantTensorDataProto& VariantTensorDataProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base); + return *internal_default_instance(); +} + + +void VariantTensorDataProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.VariantTensorDataProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + tensors_.Clear(); + type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + metadata_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool VariantTensorDataProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.VariantTensorDataProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string type_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VariantTensorDataProto.type_name")); + } else { + goto handle_unusual; + } + break; + } + + // bytes metadata = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_metadata())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.TensorProto tensors = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tensors())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.VariantTensorDataProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.VariantTensorDataProto) + return false; +#undef DO_ +} + +void VariantTensorDataProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.VariantTensorDataProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string type_name = 1; + if (this->type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariantTensorDataProto.type_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->type_name(), output); + } + + // bytes metadata = 2; + if (this->metadata().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->metadata(), output); + } + + // repeated .diplomacy.tensorflow.TensorProto tensors = 3; + for (unsigned int i = 0, + n = static_cast(this->tensors_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->tensors(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.VariantTensorDataProto) +} + +::google::protobuf::uint8* VariantTensorDataProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.VariantTensorDataProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string type_name = 1; + if (this->type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_name().data(), static_cast(this->type_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariantTensorDataProto.type_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->type_name(), target); + } + + // bytes metadata = 2; + if (this->metadata().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 2, this->metadata(), target); + } + + // repeated .diplomacy.tensorflow.TensorProto tensors = 3; + for (unsigned int i = 0, + n = static_cast(this->tensors_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->tensors(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.VariantTensorDataProto) + return target; +} + +size_t VariantTensorDataProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.VariantTensorDataProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.TensorProto tensors = 3; + { + unsigned int count = static_cast(this->tensors_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tensors(static_cast(i))); + } + } + + // string type_name = 1; + if (this->type_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_name()); + } + + // bytes metadata = 2; + if (this->metadata().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->metadata()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void VariantTensorDataProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.VariantTensorDataProto) + GOOGLE_DCHECK_NE(&from, this); + const VariantTensorDataProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.VariantTensorDataProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.VariantTensorDataProto) + MergeFrom(*source); + } +} + +void VariantTensorDataProto::MergeFrom(const VariantTensorDataProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.VariantTensorDataProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + tensors_.MergeFrom(from.tensors_); + if (from.type_name().size() > 0) { + set_type_name(from.type_name()); + } + if (from.metadata().size() > 0) { + set_metadata(from.metadata()); + } +} + +void VariantTensorDataProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.VariantTensorDataProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void VariantTensorDataProto::CopyFrom(const VariantTensorDataProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.VariantTensorDataProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool VariantTensorDataProto::IsInitialized() const { + return true; +} + +void VariantTensorDataProto::Swap(VariantTensorDataProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + VariantTensorDataProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void VariantTensorDataProto::UnsafeArenaSwap(VariantTensorDataProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void VariantTensorDataProto::InternalSwap(VariantTensorDataProto* other) { + using std::swap; + CastToBase(&tensors_)->InternalSwap(CastToBase(&other->tensors_)); + type_name_.Swap(&other->type_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + metadata_.Swap(&other->metadata_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata VariantTensorDataProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::TensorProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::TensorProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::TensorProto >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::VariantTensorDataProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::VariantTensorDataProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::VariantTensorDataProto >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.pb.h new file mode 100644 index 0000000..ea12945 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.pb.h @@ -0,0 +1,1392 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/tensor.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/resource_handle.pb.h" +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorProto; +class TensorProtoDefaultTypeInternal; +extern TensorProtoDefaultTypeInternal _TensorProto_default_instance_; +class VariantTensorDataProto; +class VariantTensorDataProtoDefaultTypeInternal; +extern VariantTensorDataProtoDefaultTypeInternal _VariantTensorDataProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::TensorProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::TensorProto>(Arena*); +template<> ::diplomacy::tensorflow::VariantTensorDataProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::VariantTensorDataProto>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.TensorProto) */ { + public: + TensorProto(); + virtual ~TensorProto(); + + TensorProto(const TensorProto& from); + + inline TensorProto& operator=(const TensorProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorProto(TensorProto&& from) noexcept + : TensorProto() { + *this = ::std::move(from); + } + + inline TensorProto& operator=(TensorProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorProto* internal_default_instance() { + return reinterpret_cast( + &_TensorProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TensorProto* other); + void Swap(TensorProto* other); + friend void swap(TensorProto& a, TensorProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorProto* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorProto& from); + void MergeFrom(const TensorProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorProto* other); + protected: + explicit TensorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated float float_val = 5 [packed = true]; + int float_val_size() const; + void clear_float_val(); + static const int kFloatValFieldNumber = 5; + float float_val(int index) const; + void set_float_val(int index, float value); + void add_float_val(float value); + const ::google::protobuf::RepeatedField< float >& + float_val() const; + ::google::protobuf::RepeatedField< float >* + mutable_float_val(); + + // repeated double double_val = 6 [packed = true]; + int double_val_size() const; + void clear_double_val(); + static const int kDoubleValFieldNumber = 6; + double double_val(int index) const; + void set_double_val(int index, double value); + void add_double_val(double value); + const ::google::protobuf::RepeatedField< double >& + double_val() const; + ::google::protobuf::RepeatedField< double >* + mutable_double_val(); + + // repeated int32 int_val = 7 [packed = true]; + int int_val_size() const; + void clear_int_val(); + static const int kIntValFieldNumber = 7; + ::google::protobuf::int32 int_val(int index) const; + void set_int_val(int index, ::google::protobuf::int32 value); + void add_int_val(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + int_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_int_val(); + + // repeated bytes string_val = 8; + int string_val_size() const; + void clear_string_val(); + static const int kStringValFieldNumber = 8; + const ::std::string& string_val(int index) const; + ::std::string* mutable_string_val(int index); + void set_string_val(int index, const ::std::string& value); + #if LANG_CXX11 + void set_string_val(int index, ::std::string&& value); + #endif + void set_string_val(int index, const char* value); + void set_string_val(int index, const void* value, size_t size); + ::std::string* add_string_val(); + void add_string_val(const ::std::string& value); + #if LANG_CXX11 + void add_string_val(::std::string&& value); + #endif + void add_string_val(const char* value); + void add_string_val(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& string_val() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_string_val(); + + // repeated float scomplex_val = 9 [packed = true]; + int scomplex_val_size() const; + void clear_scomplex_val(); + static const int kScomplexValFieldNumber = 9; + float scomplex_val(int index) const; + void set_scomplex_val(int index, float value); + void add_scomplex_val(float value); + const ::google::protobuf::RepeatedField< float >& + scomplex_val() const; + ::google::protobuf::RepeatedField< float >* + mutable_scomplex_val(); + + // repeated int64 int64_val = 10 [packed = true]; + int int64_val_size() const; + void clear_int64_val(); + static const int kInt64ValFieldNumber = 10; + ::google::protobuf::int64 int64_val(int index) const; + void set_int64_val(int index, ::google::protobuf::int64 value); + void add_int64_val(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + int64_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_int64_val(); + + // repeated bool bool_val = 11 [packed = true]; + int bool_val_size() const; + void clear_bool_val(); + static const int kBoolValFieldNumber = 11; + bool bool_val(int index) const; + void set_bool_val(int index, bool value); + void add_bool_val(bool value); + const ::google::protobuf::RepeatedField< bool >& + bool_val() const; + ::google::protobuf::RepeatedField< bool >* + mutable_bool_val(); + + // repeated double dcomplex_val = 12 [packed = true]; + int dcomplex_val_size() const; + void clear_dcomplex_val(); + static const int kDcomplexValFieldNumber = 12; + double dcomplex_val(int index) const; + void set_dcomplex_val(int index, double value); + void add_dcomplex_val(double value); + const ::google::protobuf::RepeatedField< double >& + dcomplex_val() const; + ::google::protobuf::RepeatedField< double >* + mutable_dcomplex_val(); + + // repeated int32 half_val = 13 [packed = true]; + int half_val_size() const; + void clear_half_val(); + static const int kHalfValFieldNumber = 13; + ::google::protobuf::int32 half_val(int index) const; + void set_half_val(int index, ::google::protobuf::int32 value); + void add_half_val(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + half_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_half_val(); + + // repeated .diplomacy.tensorflow.ResourceHandleProto resource_handle_val = 14; + int resource_handle_val_size() const; + void clear_resource_handle_val(); + static const int kResourceHandleValFieldNumber = 14; + ::diplomacy::tensorflow::ResourceHandleProto* mutable_resource_handle_val(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ResourceHandleProto >* + mutable_resource_handle_val(); + const ::diplomacy::tensorflow::ResourceHandleProto& resource_handle_val(int index) const; + ::diplomacy::tensorflow::ResourceHandleProto* add_resource_handle_val(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ResourceHandleProto >& + resource_handle_val() const; + + // repeated .diplomacy.tensorflow.VariantTensorDataProto variant_val = 15; + int variant_val_size() const; + void clear_variant_val(); + static const int kVariantValFieldNumber = 15; + ::diplomacy::tensorflow::VariantTensorDataProto* mutable_variant_val(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::VariantTensorDataProto >* + mutable_variant_val(); + const ::diplomacy::tensorflow::VariantTensorDataProto& variant_val(int index) const; + ::diplomacy::tensorflow::VariantTensorDataProto* add_variant_val(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::VariantTensorDataProto >& + variant_val() const; + + // repeated uint32 uint32_val = 16 [packed = true]; + int uint32_val_size() const; + void clear_uint32_val(); + static const int kUint32ValFieldNumber = 16; + ::google::protobuf::uint32 uint32_val(int index) const; + void set_uint32_val(int index, ::google::protobuf::uint32 value); + void add_uint32_val(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + uint32_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_uint32_val(); + + // repeated uint64 uint64_val = 17 [packed = true]; + int uint64_val_size() const; + void clear_uint64_val(); + static const int kUint64ValFieldNumber = 17; + ::google::protobuf::uint64 uint64_val(int index) const; + void set_uint64_val(int index, ::google::protobuf::uint64 value); + void add_uint64_val(::google::protobuf::uint64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >& + uint64_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >* + mutable_uint64_val(); + + // bytes tensor_content = 4; + void clear_tensor_content(); + static const int kTensorContentFieldNumber = 4; + const ::std::string& tensor_content() const; + void set_tensor_content(const ::std::string& value); + #if LANG_CXX11 + void set_tensor_content(::std::string&& value); + #endif + void set_tensor_content(const char* value); + void set_tensor_content(const void* value, size_t size); + ::std::string* mutable_tensor_content(); + ::std::string* release_tensor_content(); + void set_allocated_tensor_content(::std::string* tensor_content); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_tensor_content(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_tensor_content( + ::std::string* tensor_content); + + // .diplomacy.tensorflow.TensorShapeProto tensor_shape = 2; + bool has_tensor_shape() const; + void clear_tensor_shape(); + static const int kTensorShapeFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_tensor_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& tensor_shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_tensor_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_tensor_shape(); + void set_allocated_tensor_shape(::diplomacy::tensorflow::TensorShapeProto* tensor_shape); + void unsafe_arena_set_allocated_tensor_shape( + ::diplomacy::tensorflow::TensorShapeProto* tensor_shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_tensor_shape(); + + // .diplomacy.tensorflow.DataType dtype = 1; + void clear_dtype(); + static const int kDtypeFieldNumber = 1; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // int32 version_number = 3; + void clear_version_number(); + static const int kVersionNumberFieldNumber = 3; + ::google::protobuf::int32 version_number() const; + void set_version_number(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< float > float_val_; + mutable int _float_val_cached_byte_size_; + ::google::protobuf::RepeatedField< double > double_val_; + mutable int _double_val_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > int_val_; + mutable int _int_val_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::std::string> string_val_; + ::google::protobuf::RepeatedField< float > scomplex_val_; + mutable int _scomplex_val_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > int64_val_; + mutable int _int64_val_cached_byte_size_; + ::google::protobuf::RepeatedField< bool > bool_val_; + mutable int _bool_val_cached_byte_size_; + ::google::protobuf::RepeatedField< double > dcomplex_val_; + mutable int _dcomplex_val_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > half_val_; + mutable int _half_val_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ResourceHandleProto > resource_handle_val_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::VariantTensorDataProto > variant_val_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > uint32_val_; + mutable int _uint32_val_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint64 > uint64_val_; + mutable int _uint64_val_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr tensor_content_; + ::diplomacy::tensorflow::TensorShapeProto* tensor_shape_; + int dtype_; + ::google::protobuf::int32 version_number_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class VariantTensorDataProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.VariantTensorDataProto) */ { + public: + VariantTensorDataProto(); + virtual ~VariantTensorDataProto(); + + VariantTensorDataProto(const VariantTensorDataProto& from); + + inline VariantTensorDataProto& operator=(const VariantTensorDataProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + VariantTensorDataProto(VariantTensorDataProto&& from) noexcept + : VariantTensorDataProto() { + *this = ::std::move(from); + } + + inline VariantTensorDataProto& operator=(VariantTensorDataProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const VariantTensorDataProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const VariantTensorDataProto* internal_default_instance() { + return reinterpret_cast( + &_VariantTensorDataProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(VariantTensorDataProto* other); + void Swap(VariantTensorDataProto* other); + friend void swap(VariantTensorDataProto& a, VariantTensorDataProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline VariantTensorDataProto* New() const final { + return CreateMaybeMessage(NULL); + } + + VariantTensorDataProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const VariantTensorDataProto& from); + void MergeFrom(const VariantTensorDataProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(VariantTensorDataProto* other); + protected: + explicit VariantTensorDataProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.TensorProto tensors = 3; + int tensors_size() const; + void clear_tensors(); + static const int kTensorsFieldNumber = 3; + ::diplomacy::tensorflow::TensorProto* mutable_tensors(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >* + mutable_tensors(); + const ::diplomacy::tensorflow::TensorProto& tensors(int index) const; + ::diplomacy::tensorflow::TensorProto* add_tensors(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >& + tensors() const; + + // string type_name = 1; + void clear_type_name(); + static const int kTypeNameFieldNumber = 1; + const ::std::string& type_name() const; + void set_type_name(const ::std::string& value); + #if LANG_CXX11 + void set_type_name(::std::string&& value); + #endif + void set_type_name(const char* value); + void set_type_name(const char* value, size_t size); + ::std::string* mutable_type_name(); + ::std::string* release_type_name(); + void set_allocated_type_name(::std::string* type_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_type_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_type_name( + ::std::string* type_name); + + // bytes metadata = 2; + void clear_metadata(); + static const int kMetadataFieldNumber = 2; + const ::std::string& metadata() const; + void set_metadata(const ::std::string& value); + #if LANG_CXX11 + void set_metadata(::std::string&& value); + #endif + void set_metadata(const char* value); + void set_metadata(const void* value, size_t size); + ::std::string* mutable_metadata(); + ::std::string* release_metadata(); + void set_allocated_metadata(::std::string* metadata); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_metadata(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_metadata( + ::std::string* metadata); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VariantTensorDataProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto > tensors_; + ::google::protobuf::internal::ArenaStringPtr type_name_; + ::google::protobuf::internal::ArenaStringPtr metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TensorProto + +// .diplomacy.tensorflow.DataType dtype = 1; +inline void TensorProto::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType TensorProto::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void TensorProto::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.dtype) +} + +// .diplomacy.tensorflow.TensorShapeProto tensor_shape = 2; +inline bool TensorProto::has_tensor_shape() const { + return this != internal_default_instance() && tensor_shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& TensorProto::_internal_tensor_shape() const { + return *tensor_shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& TensorProto::tensor_shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = tensor_shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.tensor_shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorProto::release_tensor_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.TensorProto.tensor_shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = tensor_shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + tensor_shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorProto::unsafe_arena_release_tensor_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.TensorProto.tensor_shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = tensor_shape_; + tensor_shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorProto::mutable_tensor_shape() { + + if (tensor_shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + tensor_shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorProto.tensor_shape) + return tensor_shape_; +} +inline void TensorProto::set_allocated_tensor_shape(::diplomacy::tensorflow::TensorShapeProto* tensor_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_shape_); + } + if (tensor_shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(tensor_shape)->GetArena(); + if (message_arena != submessage_arena) { + tensor_shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, tensor_shape, submessage_arena); + } + + } else { + + } + tensor_shape_ = tensor_shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.TensorProto.tensor_shape) +} + +// int32 version_number = 3; +inline void TensorProto::clear_version_number() { + version_number_ = 0; +} +inline ::google::protobuf::int32 TensorProto::version_number() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.version_number) + return version_number_; +} +inline void TensorProto::set_version_number(::google::protobuf::int32 value) { + + version_number_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.version_number) +} + +// bytes tensor_content = 4; +inline void TensorProto::clear_tensor_content() { + tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& TensorProto::tensor_content() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.tensor_content) + return tensor_content_.Get(); +} +inline void TensorProto::set_tensor_content(const ::std::string& value) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.tensor_content) +} +#if LANG_CXX11 +inline void TensorProto::set_tensor_content(::std::string&& value) { + + tensor_content_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.TensorProto.tensor_content) +} +#endif +inline void TensorProto::set_tensor_content(const char* value) { + GOOGLE_DCHECK(value != NULL); + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.TensorProto.tensor_content) +} +inline void TensorProto::set_tensor_content(const void* value, + size_t size) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.TensorProto.tensor_content) +} +inline ::std::string* TensorProto::mutable_tensor_content() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorProto.tensor_content) + return tensor_content_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* TensorProto::release_tensor_content() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.TensorProto.tensor_content) + + return tensor_content_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void TensorProto::set_allocated_tensor_content(::std::string* tensor_content) { + if (tensor_content != NULL) { + + } else { + + } + tensor_content_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_content, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.TensorProto.tensor_content) +} +inline ::std::string* TensorProto::unsafe_arena_release_tensor_content() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.TensorProto.tensor_content) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return tensor_content_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void TensorProto::unsafe_arena_set_allocated_tensor_content( + ::std::string* tensor_content) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (tensor_content != NULL) { + + } else { + + } + tensor_content_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + tensor_content, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.TensorProto.tensor_content) +} + +// repeated int32 half_val = 13 [packed = true]; +inline int TensorProto::half_val_size() const { + return half_val_.size(); +} +inline void TensorProto::clear_half_val() { + half_val_.Clear(); +} +inline ::google::protobuf::int32 TensorProto::half_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.half_val) + return half_val_.Get(index); +} +inline void TensorProto::set_half_val(int index, ::google::protobuf::int32 value) { + half_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.half_val) +} +inline void TensorProto::add_half_val(::google::protobuf::int32 value) { + half_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.half_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TensorProto::half_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.half_val) + return half_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TensorProto::mutable_half_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.half_val) + return &half_val_; +} + +// repeated float float_val = 5 [packed = true]; +inline int TensorProto::float_val_size() const { + return float_val_.size(); +} +inline void TensorProto::clear_float_val() { + float_val_.Clear(); +} +inline float TensorProto::float_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.float_val) + return float_val_.Get(index); +} +inline void TensorProto::set_float_val(int index, float value) { + float_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.float_val) +} +inline void TensorProto::add_float_val(float value) { + float_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.float_val) +} +inline const ::google::protobuf::RepeatedField< float >& +TensorProto::float_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.float_val) + return float_val_; +} +inline ::google::protobuf::RepeatedField< float >* +TensorProto::mutable_float_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.float_val) + return &float_val_; +} + +// repeated double double_val = 6 [packed = true]; +inline int TensorProto::double_val_size() const { + return double_val_.size(); +} +inline void TensorProto::clear_double_val() { + double_val_.Clear(); +} +inline double TensorProto::double_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.double_val) + return double_val_.Get(index); +} +inline void TensorProto::set_double_val(int index, double value) { + double_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.double_val) +} +inline void TensorProto::add_double_val(double value) { + double_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.double_val) +} +inline const ::google::protobuf::RepeatedField< double >& +TensorProto::double_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.double_val) + return double_val_; +} +inline ::google::protobuf::RepeatedField< double >* +TensorProto::mutable_double_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.double_val) + return &double_val_; +} + +// repeated int32 int_val = 7 [packed = true]; +inline int TensorProto::int_val_size() const { + return int_val_.size(); +} +inline void TensorProto::clear_int_val() { + int_val_.Clear(); +} +inline ::google::protobuf::int32 TensorProto::int_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.int_val) + return int_val_.Get(index); +} +inline void TensorProto::set_int_val(int index, ::google::protobuf::int32 value) { + int_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.int_val) +} +inline void TensorProto::add_int_val(::google::protobuf::int32 value) { + int_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.int_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TensorProto::int_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.int_val) + return int_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TensorProto::mutable_int_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.int_val) + return &int_val_; +} + +// repeated bytes string_val = 8; +inline int TensorProto::string_val_size() const { + return string_val_.size(); +} +inline void TensorProto::clear_string_val() { + string_val_.Clear(); +} +inline const ::std::string& TensorProto::string_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.string_val) + return string_val_.Get(index); +} +inline ::std::string* TensorProto::mutable_string_val(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorProto.string_val) + return string_val_.Mutable(index); +} +inline void TensorProto::set_string_val(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.string_val) + string_val_.Mutable(index)->assign(value); +} +#if LANG_CXX11 +inline void TensorProto::set_string_val(int index, ::std::string&& value) { + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.string_val) + string_val_.Mutable(index)->assign(std::move(value)); +} +#endif +inline void TensorProto::set_string_val(int index, const char* value) { + GOOGLE_DCHECK(value != NULL); + string_val_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.TensorProto.string_val) +} +inline void TensorProto::set_string_val(int index, const void* value, size_t size) { + string_val_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.TensorProto.string_val) +} +inline ::std::string* TensorProto::add_string_val() { + // @@protoc_insertion_point(field_add_mutable:diplomacy.tensorflow.TensorProto.string_val) + return string_val_.Add(); +} +inline void TensorProto::add_string_val(const ::std::string& value) { + string_val_.Add()->assign(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.string_val) +} +#if LANG_CXX11 +inline void TensorProto::add_string_val(::std::string&& value) { + string_val_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.string_val) +} +#endif +inline void TensorProto::add_string_val(const char* value) { + GOOGLE_DCHECK(value != NULL); + string_val_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:diplomacy.tensorflow.TensorProto.string_val) +} +inline void TensorProto::add_string_val(const void* value, size_t size) { + string_val_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:diplomacy.tensorflow.TensorProto.string_val) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +TensorProto::string_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.string_val) + return string_val_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +TensorProto::mutable_string_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.string_val) + return &string_val_; +} + +// repeated float scomplex_val = 9 [packed = true]; +inline int TensorProto::scomplex_val_size() const { + return scomplex_val_.size(); +} +inline void TensorProto::clear_scomplex_val() { + scomplex_val_.Clear(); +} +inline float TensorProto::scomplex_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.scomplex_val) + return scomplex_val_.Get(index); +} +inline void TensorProto::set_scomplex_val(int index, float value) { + scomplex_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.scomplex_val) +} +inline void TensorProto::add_scomplex_val(float value) { + scomplex_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.scomplex_val) +} +inline const ::google::protobuf::RepeatedField< float >& +TensorProto::scomplex_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.scomplex_val) + return scomplex_val_; +} +inline ::google::protobuf::RepeatedField< float >* +TensorProto::mutable_scomplex_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.scomplex_val) + return &scomplex_val_; +} + +// repeated int64 int64_val = 10 [packed = true]; +inline int TensorProto::int64_val_size() const { + return int64_val_.size(); +} +inline void TensorProto::clear_int64_val() { + int64_val_.Clear(); +} +inline ::google::protobuf::int64 TensorProto::int64_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.int64_val) + return int64_val_.Get(index); +} +inline void TensorProto::set_int64_val(int index, ::google::protobuf::int64 value) { + int64_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.int64_val) +} +inline void TensorProto::add_int64_val(::google::protobuf::int64 value) { + int64_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.int64_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +TensorProto::int64_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.int64_val) + return int64_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +TensorProto::mutable_int64_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.int64_val) + return &int64_val_; +} + +// repeated bool bool_val = 11 [packed = true]; +inline int TensorProto::bool_val_size() const { + return bool_val_.size(); +} +inline void TensorProto::clear_bool_val() { + bool_val_.Clear(); +} +inline bool TensorProto::bool_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.bool_val) + return bool_val_.Get(index); +} +inline void TensorProto::set_bool_val(int index, bool value) { + bool_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.bool_val) +} +inline void TensorProto::add_bool_val(bool value) { + bool_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.bool_val) +} +inline const ::google::protobuf::RepeatedField< bool >& +TensorProto::bool_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.bool_val) + return bool_val_; +} +inline ::google::protobuf::RepeatedField< bool >* +TensorProto::mutable_bool_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.bool_val) + return &bool_val_; +} + +// repeated double dcomplex_val = 12 [packed = true]; +inline int TensorProto::dcomplex_val_size() const { + return dcomplex_val_.size(); +} +inline void TensorProto::clear_dcomplex_val() { + dcomplex_val_.Clear(); +} +inline double TensorProto::dcomplex_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.dcomplex_val) + return dcomplex_val_.Get(index); +} +inline void TensorProto::set_dcomplex_val(int index, double value) { + dcomplex_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.dcomplex_val) +} +inline void TensorProto::add_dcomplex_val(double value) { + dcomplex_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.dcomplex_val) +} +inline const ::google::protobuf::RepeatedField< double >& +TensorProto::dcomplex_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.dcomplex_val) + return dcomplex_val_; +} +inline ::google::protobuf::RepeatedField< double >* +TensorProto::mutable_dcomplex_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.dcomplex_val) + return &dcomplex_val_; +} + +// repeated .diplomacy.tensorflow.ResourceHandleProto resource_handle_val = 14; +inline int TensorProto::resource_handle_val_size() const { + return resource_handle_val_.size(); +} +inline ::diplomacy::tensorflow::ResourceHandleProto* TensorProto::mutable_resource_handle_val(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorProto.resource_handle_val) + return resource_handle_val_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ResourceHandleProto >* +TensorProto::mutable_resource_handle_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.resource_handle_val) + return &resource_handle_val_; +} +inline const ::diplomacy::tensorflow::ResourceHandleProto& TensorProto::resource_handle_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.resource_handle_val) + return resource_handle_val_.Get(index); +} +inline ::diplomacy::tensorflow::ResourceHandleProto* TensorProto::add_resource_handle_val() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.resource_handle_val) + return resource_handle_val_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::ResourceHandleProto >& +TensorProto::resource_handle_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.resource_handle_val) + return resource_handle_val_; +} + +// repeated .diplomacy.tensorflow.VariantTensorDataProto variant_val = 15; +inline int TensorProto::variant_val_size() const { + return variant_val_.size(); +} +inline void TensorProto::clear_variant_val() { + variant_val_.Clear(); +} +inline ::diplomacy::tensorflow::VariantTensorDataProto* TensorProto::mutable_variant_val(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorProto.variant_val) + return variant_val_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::VariantTensorDataProto >* +TensorProto::mutable_variant_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.variant_val) + return &variant_val_; +} +inline const ::diplomacy::tensorflow::VariantTensorDataProto& TensorProto::variant_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.variant_val) + return variant_val_.Get(index); +} +inline ::diplomacy::tensorflow::VariantTensorDataProto* TensorProto::add_variant_val() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.variant_val) + return variant_val_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::VariantTensorDataProto >& +TensorProto::variant_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.variant_val) + return variant_val_; +} + +// repeated uint32 uint32_val = 16 [packed = true]; +inline int TensorProto::uint32_val_size() const { + return uint32_val_.size(); +} +inline void TensorProto::clear_uint32_val() { + uint32_val_.Clear(); +} +inline ::google::protobuf::uint32 TensorProto::uint32_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.uint32_val) + return uint32_val_.Get(index); +} +inline void TensorProto::set_uint32_val(int index, ::google::protobuf::uint32 value) { + uint32_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.uint32_val) +} +inline void TensorProto::add_uint32_val(::google::protobuf::uint32 value) { + uint32_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.uint32_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +TensorProto::uint32_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.uint32_val) + return uint32_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +TensorProto::mutable_uint32_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.uint32_val) + return &uint32_val_; +} + +// repeated uint64 uint64_val = 17 [packed = true]; +inline int TensorProto::uint64_val_size() const { + return uint64_val_.size(); +} +inline void TensorProto::clear_uint64_val() { + uint64_val_.Clear(); +} +inline ::google::protobuf::uint64 TensorProto::uint64_val(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorProto.uint64_val) + return uint64_val_.Get(index); +} +inline void TensorProto::set_uint64_val(int index, ::google::protobuf::uint64 value) { + uint64_val_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorProto.uint64_val) +} +inline void TensorProto::add_uint64_val(::google::protobuf::uint64 value) { + uint64_val_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorProto.uint64_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >& +TensorProto::uint64_val() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorProto.uint64_val) + return uint64_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >* +TensorProto::mutable_uint64_val() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorProto.uint64_val) + return &uint64_val_; +} + +// ------------------------------------------------------------------- + +// VariantTensorDataProto + +// string type_name = 1; +inline void VariantTensorDataProto::clear_type_name() { + type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VariantTensorDataProto::type_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariantTensorDataProto.type_name) + return type_name_.Get(); +} +inline void VariantTensorDataProto::set_type_name(const ::std::string& value) { + + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariantTensorDataProto.type_name) +} +#if LANG_CXX11 +inline void VariantTensorDataProto::set_type_name(::std::string&& value) { + + type_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariantTensorDataProto.type_name) +} +#endif +inline void VariantTensorDataProto::set_type_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariantTensorDataProto.type_name) +} +inline void VariantTensorDataProto::set_type_name(const char* value, + size_t size) { + + type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariantTensorDataProto.type_name) +} +inline ::std::string* VariantTensorDataProto::mutable_type_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariantTensorDataProto.type_name) + return type_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VariantTensorDataProto::release_type_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariantTensorDataProto.type_name) + + return type_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VariantTensorDataProto::set_allocated_type_name(::std::string* type_name) { + if (type_name != NULL) { + + } else { + + } + type_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariantTensorDataProto.type_name) +} +inline ::std::string* VariantTensorDataProto::unsafe_arena_release_type_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariantTensorDataProto.type_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VariantTensorDataProto::unsafe_arena_set_allocated_type_name( + ::std::string* type_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_name != NULL) { + + } else { + + } + type_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariantTensorDataProto.type_name) +} + +// bytes metadata = 2; +inline void VariantTensorDataProto::clear_metadata() { + metadata_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VariantTensorDataProto::metadata() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariantTensorDataProto.metadata) + return metadata_.Get(); +} +inline void VariantTensorDataProto::set_metadata(const ::std::string& value) { + + metadata_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariantTensorDataProto.metadata) +} +#if LANG_CXX11 +inline void VariantTensorDataProto::set_metadata(::std::string&& value) { + + metadata_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariantTensorDataProto.metadata) +} +#endif +inline void VariantTensorDataProto::set_metadata(const char* value) { + GOOGLE_DCHECK(value != NULL); + + metadata_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariantTensorDataProto.metadata) +} +inline void VariantTensorDataProto::set_metadata(const void* value, + size_t size) { + + metadata_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariantTensorDataProto.metadata) +} +inline ::std::string* VariantTensorDataProto::mutable_metadata() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariantTensorDataProto.metadata) + return metadata_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VariantTensorDataProto::release_metadata() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariantTensorDataProto.metadata) + + return metadata_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VariantTensorDataProto::set_allocated_metadata(::std::string* metadata) { + if (metadata != NULL) { + + } else { + + } + metadata_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), metadata, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariantTensorDataProto.metadata) +} +inline ::std::string* VariantTensorDataProto::unsafe_arena_release_metadata() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariantTensorDataProto.metadata) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return metadata_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VariantTensorDataProto::unsafe_arena_set_allocated_metadata( + ::std::string* metadata) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (metadata != NULL) { + + } else { + + } + metadata_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + metadata, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariantTensorDataProto.metadata) +} + +// repeated .diplomacy.tensorflow.TensorProto tensors = 3; +inline int VariantTensorDataProto::tensors_size() const { + return tensors_.size(); +} +inline void VariantTensorDataProto::clear_tensors() { + tensors_.Clear(); +} +inline ::diplomacy::tensorflow::TensorProto* VariantTensorDataProto::mutable_tensors(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariantTensorDataProto.tensors) + return tensors_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >* +VariantTensorDataProto::mutable_tensors() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.VariantTensorDataProto.tensors) + return &tensors_; +} +inline const ::diplomacy::tensorflow::TensorProto& VariantTensorDataProto::tensors(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariantTensorDataProto.tensors) + return tensors_.Get(index); +} +inline ::diplomacy::tensorflow::TensorProto* VariantTensorDataProto::add_tensors() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.VariantTensorDataProto.tensors) + return tensors_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorProto >& +VariantTensorDataProto::tensors() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.VariantTensorDataProto.tensors) + return tensors_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.proto new file mode 100644 index 0000000..2a3c563 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "TensorProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/resource_handle.proto"; +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; + +// Protocol buffer representing a tensor. +message TensorProto { + DataType dtype = 1; + + // Shape of the tensor. TODO(touts): sort out the 0-rank issues. + TensorShapeProto tensor_shape = 2; + + // Only one of the representations below is set, one of "tensor_contents" and + // the "xxx_val" attributes. We are not using oneof because as oneofs cannot + // contain repeated fields it would require another extra set of messages. + + // 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. + int32 version_number = 3; + + // 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. + bytes tensor_content = 4; + + // Type specific representations that make it easy to create tensor protos in + // all languages. Only the representation corresponding to "dtype" can + // be set. The values hold the flattened representation of the tensor in + // row major order. + + // DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll + // have some pointless zero padding for each value here. + repeated int32 half_val = 13 [packed = true]; + + // DT_FLOAT. + repeated float float_val = 5 [packed = true]; + + // DT_DOUBLE. + repeated double double_val = 6 [packed = true]; + + // DT_INT32, DT_INT16, DT_INT8, DT_UINT8. + repeated int32 int_val = 7 [packed = true]; + + // DT_STRING + repeated bytes string_val = 8; + + // DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real + // and imaginary parts of i-th single precision complex. + repeated float scomplex_val = 9 [packed = true]; + + // DT_INT64 + repeated int64 int64_val = 10 [packed = true]; + + // DT_BOOL + repeated bool bool_val = 11 [packed = true]; + + // DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real + // and imaginary parts of i-th double precision complex. + repeated double dcomplex_val = 12 [packed = true]; + + // DT_RESOURCE + repeated ResourceHandleProto resource_handle_val = 14; + + // DT_VARIANT + repeated VariantTensorDataProto variant_val = 15; + + // DT_UINT32 + repeated uint32 uint32_val = 16 [packed = true]; + + // DT_UINT64 + repeated uint64 uint64_val = 17 [packed = true]; +}; + +// Protocol buffer representing the serialization format of DT_VARIANT tensors. +message VariantTensorDataProto { + // Name of the type of objects being serialized. + string type_name = 1; + // Portions of the object that are not Tensors. + bytes metadata = 2; + // Tensors contained within objects being serialized. + repeated TensorProto tensors = 3; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.pb.cc new file mode 100644 index 0000000..a95da08 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.pb.cc @@ -0,0 +1,542 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/tensor_description.proto + +#include "diplomacy_tensorflow/core/framework/tensor_description.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_AllocationDescription; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorDescriptionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorDescription_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto { +static void InitDefaultsTensorDescription() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_TensorDescription_default_instance_; + new (ptr) ::diplomacy::tensorflow::TensorDescription(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::TensorDescription::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_TensorDescription = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsTensorDescription}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::scc_info_AllocationDescription.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TensorDescription.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorDescription, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorDescription, dtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorDescription, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorDescription, allocation_description_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::TensorDescription)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_TensorDescription_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/tensor_description.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nshape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); + ::diplomacy::tensorflow::_TensorDescription_default_instance_._instance.get_mutable()->allocation_description_ = const_cast< ::diplomacy::tensorflow::AllocationDescription*>( + ::diplomacy::tensorflow::AllocationDescription::internal_default_instance()); +} +void TensorDescription::unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.TensorDescription.shape) +} +void TensorDescription::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +void TensorDescription::unsafe_arena_set_allocated_allocation_description( + ::diplomacy::tensorflow::AllocationDescription* allocation_description) { + if (GetArenaNoVirtual() == NULL) { + delete allocation_description_; + } + allocation_description_ = allocation_description; + if (allocation_description) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.TensorDescription.allocation_description) +} +void TensorDescription::clear_allocation_description() { + if (GetArenaNoVirtual() == NULL && allocation_description_ != NULL) { + delete allocation_description_; + } + allocation_description_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorDescription::kDtypeFieldNumber; +const int TensorDescription::kShapeFieldNumber; +const int TensorDescription::kAllocationDescriptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorDescription::TensorDescription() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::scc_info_TensorDescription.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.TensorDescription) +} +TensorDescription::TensorDescription(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::scc_info_TensorDescription.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.TensorDescription) +} +TensorDescription::TensorDescription(const TensorDescription& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape()) { + shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + if (from.has_allocation_description()) { + allocation_description_ = new ::diplomacy::tensorflow::AllocationDescription(*from.allocation_description_); + } else { + allocation_description_ = NULL; + } + dtype_ = from.dtype_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.TensorDescription) +} + +void TensorDescription::SharedCtor() { + ::memset(&shape_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&shape_)) + sizeof(dtype_)); +} + +TensorDescription::~TensorDescription() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.TensorDescription) + SharedDtor(); +} + +void TensorDescription::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete shape_; + if (this != internal_default_instance()) delete allocation_description_; +} + +void TensorDescription::ArenaDtor(void* object) { + TensorDescription* _this = reinterpret_cast< TensorDescription* >(object); + (void)_this; +} +void TensorDescription::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorDescription::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorDescription::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorDescription& TensorDescription::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::scc_info_TensorDescription.base); + return *internal_default_instance(); +} + + +void TensorDescription::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.TensorDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + if (GetArenaNoVirtual() == NULL && allocation_description_ != NULL) { + delete allocation_description_; + } + allocation_description_ = NULL; + dtype_ = 0; + _internal_metadata_.Clear(); +} + +bool TensorDescription::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.TensorDescription) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.DataType dtype = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.AllocationDescription allocation_description = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_allocation_description())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.TensorDescription) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.TensorDescription) + return false; +#undef DO_ +} + +void TensorDescription::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.TensorDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->dtype(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape(), output); + } + + // .diplomacy.tensorflow.AllocationDescription allocation_description = 4; + if (this->has_allocation_description()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_allocation_description(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.TensorDescription) +} + +::google::protobuf::uint8* TensorDescription::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.TensorDescription) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->dtype(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape(), deterministic, target); + } + + // .diplomacy.tensorflow.AllocationDescription allocation_description = 4; + if (this->has_allocation_description()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_allocation_description(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.TensorDescription) + return target; +} + +size_t TensorDescription::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.TensorDescription) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // .diplomacy.tensorflow.AllocationDescription allocation_description = 4; + if (this->has_allocation_description()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *allocation_description_); + } + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorDescription::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.TensorDescription) + GOOGLE_DCHECK_NE(&from, this); + const TensorDescription* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.TensorDescription) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.TensorDescription) + MergeFrom(*source); + } +} + +void TensorDescription::MergeFrom(const TensorDescription& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.TensorDescription) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_shape()) { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + } + if (from.has_allocation_description()) { + mutable_allocation_description()->::diplomacy::tensorflow::AllocationDescription::MergeFrom(from.allocation_description()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void TensorDescription::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.TensorDescription) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorDescription::CopyFrom(const TensorDescription& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.TensorDescription) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorDescription::IsInitialized() const { + return true; +} + +void TensorDescription::Swap(TensorDescription* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorDescription* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorDescription::UnsafeArenaSwap(TensorDescription* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorDescription::InternalSwap(TensorDescription* other) { + using std::swap; + swap(shape_, other->shape_); + swap(allocation_description_, other->allocation_description_); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorDescription::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::TensorDescription* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::TensorDescription >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::TensorDescription >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.pb.h new file mode 100644 index 0000000..379e323 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.pb.h @@ -0,0 +1,370 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/tensor_description.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "diplomacy_tensorflow/core/framework/types.pb.h" +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/allocation_description.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorDescription; +class TensorDescriptionDefaultTypeInternal; +extern TensorDescriptionDefaultTypeInternal _TensorDescription_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::TensorDescription* Arena::CreateMaybeMessage<::diplomacy::tensorflow::TensorDescription>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class TensorDescription : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.TensorDescription) */ { + public: + TensorDescription(); + virtual ~TensorDescription(); + + TensorDescription(const TensorDescription& from); + + inline TensorDescription& operator=(const TensorDescription& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorDescription(TensorDescription&& from) noexcept + : TensorDescription() { + *this = ::std::move(from); + } + + inline TensorDescription& operator=(TensorDescription&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorDescription& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorDescription* internal_default_instance() { + return reinterpret_cast( + &_TensorDescription_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TensorDescription* other); + void Swap(TensorDescription* other); + friend void swap(TensorDescription& a, TensorDescription& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorDescription* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorDescription* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorDescription& from); + void MergeFrom(const TensorDescription& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorDescription* other); + protected: + explicit TensorDescription(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // .diplomacy.tensorflow.AllocationDescription allocation_description = 4; + bool has_allocation_description() const; + void clear_allocation_description(); + static const int kAllocationDescriptionFieldNumber = 4; + private: + const ::diplomacy::tensorflow::AllocationDescription& _internal_allocation_description() const; + public: + const ::diplomacy::tensorflow::AllocationDescription& allocation_description() const; + ::diplomacy::tensorflow::AllocationDescription* release_allocation_description(); + ::diplomacy::tensorflow::AllocationDescription* mutable_allocation_description(); + void set_allocated_allocation_description(::diplomacy::tensorflow::AllocationDescription* allocation_description); + void unsafe_arena_set_allocated_allocation_description( + ::diplomacy::tensorflow::AllocationDescription* allocation_description); + ::diplomacy::tensorflow::AllocationDescription* unsafe_arena_release_allocation_description(); + + // .diplomacy.tensorflow.DataType dtype = 1; + void clear_dtype(); + static const int kDtypeFieldNumber = 1; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorDescription) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + ::diplomacy::tensorflow::AllocationDescription* allocation_description_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TensorDescription + +// .diplomacy.tensorflow.DataType dtype = 1; +inline void TensorDescription::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType TensorDescription::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorDescription.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void TensorDescription::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorDescription.dtype) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 2; +inline bool TensorDescription::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& TensorDescription::_internal_shape() const { + return *shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& TensorDescription::shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorDescription.shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorDescription::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.TensorDescription.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorDescription::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.TensorDescription.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* TensorDescription::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorDescription.shape) + return shape_; +} +inline void TensorDescription::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.TensorDescription.shape) +} + +// .diplomacy.tensorflow.AllocationDescription allocation_description = 4; +inline bool TensorDescription::has_allocation_description() const { + return this != internal_default_instance() && allocation_description_ != NULL; +} +inline const ::diplomacy::tensorflow::AllocationDescription& TensorDescription::_internal_allocation_description() const { + return *allocation_description_; +} +inline const ::diplomacy::tensorflow::AllocationDescription& TensorDescription::allocation_description() const { + const ::diplomacy::tensorflow::AllocationDescription* p = allocation_description_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorDescription.allocation_description) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_AllocationDescription_default_instance_); +} +inline ::diplomacy::tensorflow::AllocationDescription* TensorDescription::release_allocation_description() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.TensorDescription.allocation_description) + + ::diplomacy::tensorflow::AllocationDescription* temp = allocation_description_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + allocation_description_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AllocationDescription* TensorDescription::unsafe_arena_release_allocation_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.TensorDescription.allocation_description) + + ::diplomacy::tensorflow::AllocationDescription* temp = allocation_description_; + allocation_description_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::AllocationDescription* TensorDescription::mutable_allocation_description() { + + if (allocation_description_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::AllocationDescription>(GetArenaNoVirtual()); + allocation_description_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorDescription.allocation_description) + return allocation_description_; +} +inline void TensorDescription::set_allocated_allocation_description(::diplomacy::tensorflow::AllocationDescription* allocation_description) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(allocation_description_); + } + if (allocation_description) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(allocation_description)->GetArena(); + if (message_arena != submessage_arena) { + allocation_description = ::google::protobuf::internal::GetOwnedMessage( + message_arena, allocation_description, submessage_arena); + } + + } else { + + } + allocation_description_ = allocation_description; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.TensorDescription.allocation_description) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.proto new file mode 100644 index 0000000..edfb408 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "TensorDescriptionProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; +import "diplomacy_tensorflow/core/framework/types.proto"; +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/allocation_description.proto"; + +message TensorDescription { + // Data type of tensor elements + DataType dtype = 1; + + // Shape of the tensor. + TensorShapeProto shape = 2; + + // Information about the size and allocator used for the data + AllocationDescription allocation_description = 4; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description_pb2.py new file mode 100644 index 0000000..b634937 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_description_pb2.py @@ -0,0 +1,91 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/tensor_description.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import allocation_description_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_allocation__description__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/tensor_description.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\027TensorDescriptionProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TensorShapeProto_Dim; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorShapeProto_DimDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorShapeProto_Dim_default_instance_; +class TensorShapeProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorShapeProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +static void InitDefaultsTensorShapeProto_Dim() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_TensorShapeProto_Dim_default_instance_; + new (ptr) ::diplomacy::tensorflow::TensorShapeProto_Dim(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::TensorShapeProto_Dim::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TensorShapeProto_Dim = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTensorShapeProto_Dim}, {}}; + +static void InitDefaultsTensorShapeProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_TensorShapeProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::TensorShapeProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::TensorShapeProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTensorShapeProto}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto_Dim.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TensorShapeProto_Dim.base); + ::google::protobuf::internal::InitSCC(&scc_info_TensorShapeProto.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorShapeProto_Dim, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorShapeProto_Dim, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorShapeProto_Dim, name_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorShapeProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorShapeProto, dim_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorShapeProto, unknown_rank_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::TensorShapeProto_Dim)}, + { 7, -1, sizeof(::diplomacy::tensorflow::TensorShapeProto)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_TensorShapeProto_Dim_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_TensorShapeProto_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/tensor_shape.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n6diplomacy_tensorflow/core/framework/te" + "nsor_shape.proto\022\024diplomacy.tensorflow\"\204" + "\001\n\020TensorShapeProto\0227\n\003dim\030\002 \003(\0132*.diplo" + "macy.tensorflow.TensorShapeProto.Dim\022\024\n\014" + "unknown_rank\030\003 \001(\010\032!\n\003Dim\022\014\n\004size\030\001 \001(\003\022" + "\014\n\004name\030\002 \001(\tBq\n\030org.tensorflow.framewor" + "kB\021TensorShapeProtosP\001Z=github.com/tenso" + "rflow/tensorflow/tensorflow/go/core/fram" + "ework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 336); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/tensor_shape.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void TensorShapeProto_Dim::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorShapeProto_Dim::kSizeFieldNumber; +const int TensorShapeProto_Dim::kNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorShapeProto_Dim::TensorShapeProto_Dim() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto_Dim.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.TensorShapeProto.Dim) +} +TensorShapeProto_Dim::TensorShapeProto_Dim(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto_Dim.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.TensorShapeProto.Dim) +} +TensorShapeProto_Dim::TensorShapeProto_Dim(const TensorShapeProto_Dim& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.name().size() > 0) { + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(), + GetArenaNoVirtual()); + } + size_ = from.size_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.TensorShapeProto.Dim) +} + +void TensorShapeProto_Dim::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + size_ = GOOGLE_LONGLONG(0); +} + +TensorShapeProto_Dim::~TensorShapeProto_Dim() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.TensorShapeProto.Dim) + SharedDtor(); +} + +void TensorShapeProto_Dim::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void TensorShapeProto_Dim::ArenaDtor(void* object) { + TensorShapeProto_Dim* _this = reinterpret_cast< TensorShapeProto_Dim* >(object); + (void)_this; +} +void TensorShapeProto_Dim::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorShapeProto_Dim::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorShapeProto_Dim::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorShapeProto_Dim& TensorShapeProto_Dim::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto_Dim.base); + return *internal_default_instance(); +} + + +void TensorShapeProto_Dim::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.TensorShapeProto.Dim) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + size_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool TensorShapeProto_Dim::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.TensorShapeProto.Dim) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 size = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &size_))); + } else { + goto handle_unusual; + } + break; + } + + // string name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.TensorShapeProto.Dim.name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.TensorShapeProto.Dim) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.TensorShapeProto.Dim) + return false; +#undef DO_ +} + +void TensorShapeProto_Dim::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.TensorShapeProto.Dim) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 size = 1; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->size(), output); + } + + // string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.TensorShapeProto.Dim.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->name(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.TensorShapeProto.Dim) +} + +::google::protobuf::uint8* TensorShapeProto_Dim::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.TensorShapeProto.Dim) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 size = 1; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->size(), target); + } + + // string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.TensorShapeProto.Dim.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->name(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.TensorShapeProto.Dim) + return target; +} + +size_t TensorShapeProto_Dim::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.TensorShapeProto.Dim) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string name = 2; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // int64 size = 1; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->size()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorShapeProto_Dim::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.TensorShapeProto.Dim) + GOOGLE_DCHECK_NE(&from, this); + const TensorShapeProto_Dim* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.TensorShapeProto.Dim) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.TensorShapeProto.Dim) + MergeFrom(*source); + } +} + +void TensorShapeProto_Dim::MergeFrom(const TensorShapeProto_Dim& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.TensorShapeProto.Dim) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.size() != 0) { + set_size(from.size()); + } +} + +void TensorShapeProto_Dim::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.TensorShapeProto.Dim) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorShapeProto_Dim::CopyFrom(const TensorShapeProto_Dim& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.TensorShapeProto.Dim) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorShapeProto_Dim::IsInitialized() const { + return true; +} + +void TensorShapeProto_Dim::Swap(TensorShapeProto_Dim* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorShapeProto_Dim* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorShapeProto_Dim::UnsafeArenaSwap(TensorShapeProto_Dim* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorShapeProto_Dim::InternalSwap(TensorShapeProto_Dim* other) { + using std::swap; + name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(size_, other->size_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorShapeProto_Dim::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TensorShapeProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorShapeProto::kDimFieldNumber; +const int TensorShapeProto::kUnknownRankFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorShapeProto::TensorShapeProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.TensorShapeProto) +} +TensorShapeProto::TensorShapeProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dim_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.TensorShapeProto) +} +TensorShapeProto::TensorShapeProto(const TensorShapeProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + dim_(from.dim_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + unknown_rank_ = from.unknown_rank_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.TensorShapeProto) +} + +void TensorShapeProto::SharedCtor() { + unknown_rank_ = false; +} + +TensorShapeProto::~TensorShapeProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.TensorShapeProto) + SharedDtor(); +} + +void TensorShapeProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TensorShapeProto::ArenaDtor(void* object) { + TensorShapeProto* _this = reinterpret_cast< TensorShapeProto* >(object); + (void)_this; +} +void TensorShapeProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorShapeProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorShapeProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorShapeProto& TensorShapeProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base); + return *internal_default_instance(); +} + + +void TensorShapeProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.TensorShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + dim_.Clear(); + unknown_rank_ = false; + _internal_metadata_.Clear(); +} + +bool TensorShapeProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.TensorShapeProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.TensorShapeProto.Dim dim = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_dim())); + } else { + goto handle_unusual; + } + break; + } + + // bool unknown_rank = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &unknown_rank_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.TensorShapeProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.TensorShapeProto) + return false; +#undef DO_ +} + +void TensorShapeProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.TensorShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.TensorShapeProto.Dim dim = 2; + for (unsigned int i = 0, + n = static_cast(this->dim_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, + this->dim(static_cast(i)), + output); + } + + // bool unknown_rank = 3; + if (this->unknown_rank() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->unknown_rank(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.TensorShapeProto) +} + +::google::protobuf::uint8* TensorShapeProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.TensorShapeProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.TensorShapeProto.Dim dim = 2; + for (unsigned int i = 0, + n = static_cast(this->dim_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->dim(static_cast(i)), deterministic, target); + } + + // bool unknown_rank = 3; + if (this->unknown_rank() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->unknown_rank(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.TensorShapeProto) + return target; +} + +size_t TensorShapeProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.TensorShapeProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.TensorShapeProto.Dim dim = 2; + { + unsigned int count = static_cast(this->dim_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->dim(static_cast(i))); + } + } + + // bool unknown_rank = 3; + if (this->unknown_rank() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorShapeProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.TensorShapeProto) + GOOGLE_DCHECK_NE(&from, this); + const TensorShapeProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.TensorShapeProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.TensorShapeProto) + MergeFrom(*source); + } +} + +void TensorShapeProto::MergeFrom(const TensorShapeProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.TensorShapeProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + dim_.MergeFrom(from.dim_); + if (from.unknown_rank() != 0) { + set_unknown_rank(from.unknown_rank()); + } +} + +void TensorShapeProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.TensorShapeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorShapeProto::CopyFrom(const TensorShapeProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.TensorShapeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorShapeProto::IsInitialized() const { + return true; +} + +void TensorShapeProto::Swap(TensorShapeProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorShapeProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorShapeProto::UnsafeArenaSwap(TensorShapeProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorShapeProto::InternalSwap(TensorShapeProto* other) { + using std::swap; + CastToBase(&dim_)->InternalSwap(CastToBase(&other->dim_)); + swap(unknown_rank_, other->unknown_rank_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorShapeProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::TensorShapeProto_Dim* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::TensorShapeProto_Dim >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::TensorShapeProto_Dim >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::TensorShapeProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::TensorShapeProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::TensorShapeProto >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape.pb.h new file mode 100644 index 0000000..bd67ed3 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape.pb.h @@ -0,0 +1,503 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/tensor_shape.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorShapeProto; +class TensorShapeProtoDefaultTypeInternal; +extern TensorShapeProtoDefaultTypeInternal _TensorShapeProto_default_instance_; +class TensorShapeProto_Dim; +class TensorShapeProto_DimDefaultTypeInternal; +extern TensorShapeProto_DimDefaultTypeInternal _TensorShapeProto_Dim_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::TensorShapeProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(Arena*); +template<> ::diplomacy::tensorflow::TensorShapeProto_Dim* Arena::CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto_Dim>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class TensorShapeProto_Dim : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.TensorShapeProto.Dim) */ { + public: + TensorShapeProto_Dim(); + virtual ~TensorShapeProto_Dim(); + + TensorShapeProto_Dim(const TensorShapeProto_Dim& from); + + inline TensorShapeProto_Dim& operator=(const TensorShapeProto_Dim& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorShapeProto_Dim(TensorShapeProto_Dim&& from) noexcept + : TensorShapeProto_Dim() { + *this = ::std::move(from); + } + + inline TensorShapeProto_Dim& operator=(TensorShapeProto_Dim&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorShapeProto_Dim& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorShapeProto_Dim* internal_default_instance() { + return reinterpret_cast( + &_TensorShapeProto_Dim_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TensorShapeProto_Dim* other); + void Swap(TensorShapeProto_Dim* other); + friend void swap(TensorShapeProto_Dim& a, TensorShapeProto_Dim& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorShapeProto_Dim* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorShapeProto_Dim* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorShapeProto_Dim& from); + void MergeFrom(const TensorShapeProto_Dim& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorShapeProto_Dim* other); + protected: + explicit TensorShapeProto_Dim(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string name = 2; + void clear_name(); + static const int kNameFieldNumber = 2; + const ::std::string& name() const; + void set_name(const ::std::string& value); + #if LANG_CXX11 + void set_name(::std::string&& value); + #endif + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // int64 size = 1; + void clear_size(); + static const int kSizeFieldNumber = 1; + ::google::protobuf::int64 size() const; + void set_size(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorShapeProto.Dim) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::int64 size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.TensorShapeProto) */ { + public: + TensorShapeProto(); + virtual ~TensorShapeProto(); + + TensorShapeProto(const TensorShapeProto& from); + + inline TensorShapeProto& operator=(const TensorShapeProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorShapeProto(TensorShapeProto&& from) noexcept + : TensorShapeProto() { + *this = ::std::move(from); + } + + inline TensorShapeProto& operator=(TensorShapeProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorShapeProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorShapeProto* internal_default_instance() { + return reinterpret_cast( + &_TensorShapeProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(TensorShapeProto* other); + void Swap(TensorShapeProto* other); + friend void swap(TensorShapeProto& a, TensorShapeProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorShapeProto* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorShapeProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorShapeProto& from); + void MergeFrom(const TensorShapeProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorShapeProto* other); + protected: + explicit TensorShapeProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef TensorShapeProto_Dim Dim; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.TensorShapeProto.Dim dim = 2; + int dim_size() const; + void clear_dim(); + static const int kDimFieldNumber = 2; + ::diplomacy::tensorflow::TensorShapeProto_Dim* mutable_dim(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto_Dim >* + mutable_dim(); + const ::diplomacy::tensorflow::TensorShapeProto_Dim& dim(int index) const; + ::diplomacy::tensorflow::TensorShapeProto_Dim* add_dim(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto_Dim >& + dim() const; + + // bool unknown_rank = 3; + void clear_unknown_rank(); + static const int kUnknownRankFieldNumber = 3; + bool unknown_rank() const; + void set_unknown_rank(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorShapeProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto_Dim > dim_; + bool unknown_rank_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TensorShapeProto_Dim + +// int64 size = 1; +inline void TensorShapeProto_Dim::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 TensorShapeProto_Dim::size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorShapeProto.Dim.size) + return size_; +} +inline void TensorShapeProto_Dim::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorShapeProto.Dim.size) +} + +// string name = 2; +inline void TensorShapeProto_Dim::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& TensorShapeProto_Dim::name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorShapeProto.Dim.name) + return name_.Get(); +} +inline void TensorShapeProto_Dim::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorShapeProto.Dim.name) +} +#if LANG_CXX11 +inline void TensorShapeProto_Dim::set_name(::std::string&& value) { + + name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.TensorShapeProto.Dim.name) +} +#endif +inline void TensorShapeProto_Dim::set_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.TensorShapeProto.Dim.name) +} +inline void TensorShapeProto_Dim::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.TensorShapeProto.Dim.name) +} +inline ::std::string* TensorShapeProto_Dim::mutable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorShapeProto.Dim.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* TensorShapeProto_Dim::release_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.TensorShapeProto.Dim.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void TensorShapeProto_Dim::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.TensorShapeProto.Dim.name) +} +inline ::std::string* TensorShapeProto_Dim::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.TensorShapeProto.Dim.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void TensorShapeProto_Dim::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.TensorShapeProto.Dim.name) +} + +// ------------------------------------------------------------------- + +// TensorShapeProto + +// repeated .diplomacy.tensorflow.TensorShapeProto.Dim dim = 2; +inline int TensorShapeProto::dim_size() const { + return dim_.size(); +} +inline void TensorShapeProto::clear_dim() { + dim_.Clear(); +} +inline ::diplomacy::tensorflow::TensorShapeProto_Dim* TensorShapeProto::mutable_dim(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorShapeProto.dim) + return dim_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto_Dim >* +TensorShapeProto::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorShapeProto.dim) + return &dim_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto_Dim& TensorShapeProto::dim(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorShapeProto.dim) + return dim_.Get(index); +} +inline ::diplomacy::tensorflow::TensorShapeProto_Dim* TensorShapeProto::add_dim() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorShapeProto.dim) + return dim_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorShapeProto_Dim >& +TensorShapeProto::dim() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorShapeProto.dim) + return dim_; +} + +// bool unknown_rank = 3; +inline void TensorShapeProto::clear_unknown_rank() { + unknown_rank_ = false; +} +inline bool TensorShapeProto::unknown_rank() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorShapeProto.unknown_rank) + return unknown_rank_; +} +inline void TensorShapeProto::set_unknown_rank(bool value) { + + unknown_rank_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorShapeProto.unknown_rank) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape.proto new file mode 100644 index 0000000..9c952ad --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape.proto @@ -0,0 +1,46 @@ +// Protocol buffer representing the shape of tensors. + +syntax = "proto3"; +option cc_enable_arenas = true; +option java_outer_classname = "TensorShapeProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +package diplomacy.tensorflow; + +// Dimensions of a tensor. +message TensorShapeProto { + // One dimension of the tensor. + message Dim { + // 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. + int64 size = 1; + + // Optional name of the tensor dimension. + string name = 2; + }; + + // 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. + repeated Dim dim = 2; + + // If true, the number of dimensions in the shape is unknown. + // + // If true, "dim.size()" must be 0. + bool unknown_rank = 3; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape_pb2.py new file mode 100644 index 0000000..a356a0f --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_shape_pb2.py @@ -0,0 +1,124 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/tensor_shape.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/tensor_shape.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\021TensorShapeProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n6diplomacy_tensorflow/core/framework/tensor_shape.proto\x12\x14\x64iplomacy.tensorflow\"\x84\x01\n\x10TensorShapeProto\x12\x37\n\x03\x64im\x18\x02 \x03(\x0b\x32*.diplomacy.tensorflow.TensorShapeProto.Dim\x12\x14\n\x0cunknown_rank\x18\x03 \x01(\x08\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tBq\n\x18org.tensorflow.frameworkB\x11TensorShapeProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_TENSORSHAPEPROTO_DIM = _descriptor.Descriptor( + name='Dim', + full_name='diplomacy.tensorflow.TensorShapeProto.Dim', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='size', full_name='diplomacy.tensorflow.TensorShapeProto.Dim.size', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='diplomacy.tensorflow.TensorShapeProto.Dim.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=180, + serialized_end=213, +) + +_TENSORSHAPEPROTO = _descriptor.Descriptor( + name='TensorShapeProto', + full_name='diplomacy.tensorflow.TensorShapeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dim', full_name='diplomacy.tensorflow.TensorShapeProto.dim', index=0, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='unknown_rank', full_name='diplomacy.tensorflow.TensorShapeProto.unknown_rank', index=1, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TENSORSHAPEPROTO_DIM, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=213, +) + +_TENSORSHAPEPROTO_DIM.containing_type = _TENSORSHAPEPROTO +_TENSORSHAPEPROTO.fields_by_name['dim'].message_type = _TENSORSHAPEPROTO_DIM +DESCRIPTOR.message_types_by_name['TensorShapeProto'] = _TENSORSHAPEPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TensorShapeProto = _reflection.GeneratedProtocolMessageType('TensorShapeProto', (_message.Message,), dict( + + Dim = _reflection.GeneratedProtocolMessageType('Dim', (_message.Message,), dict( + DESCRIPTOR = _TENSORSHAPEPROTO_DIM, + __module__ = 'diplomacy_tensorflow.core.framework.tensor_shape_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorShapeProto.Dim) + )) + , + DESCRIPTOR = _TENSORSHAPEPROTO, + __module__ = 'diplomacy_tensorflow.core.framework.tensor_shape_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorShapeProto) + )) +_sym_db.RegisterMessage(TensorShapeProto) +_sym_db.RegisterMessage(TensorShapeProto.Dim) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.pb.cc new file mode 100644 index 0000000..99184d9 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.pb.cc @@ -0,0 +1,761 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/tensor_slice.proto + +#include "diplomacy_tensorflow/core/framework/tensor_slice.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TensorSliceProto_Extent; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorSliceProto_ExtentDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + ::google::protobuf::int64 length_; +} _TensorSliceProto_Extent_default_instance_; +class TensorSliceProtoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TensorSliceProto_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto { +static void InitDefaultsTensorSliceProto_Extent() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_TensorSliceProto_Extent_default_instance_; + new (ptr) ::diplomacy::tensorflow::TensorSliceProto_Extent(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::TensorSliceProto_Extent::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TensorSliceProto_Extent = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTensorSliceProto_Extent}, {}}; + +static void InitDefaultsTensorSliceProto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_TensorSliceProto_default_instance_; + new (ptr) ::diplomacy::tensorflow::TensorSliceProto(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::TensorSliceProto::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TensorSliceProto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTensorSliceProto}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::scc_info_TensorSliceProto_Extent.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_TensorSliceProto_Extent.base); + ::google::protobuf::internal::InitSCC(&scc_info_TensorSliceProto.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorSliceProto_Extent, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorSliceProto_Extent, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorSliceProto_Extent, start_), + offsetof(::diplomacy::tensorflow::TensorSliceProto_ExtentDefaultTypeInternal, length_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorSliceProto_Extent, has_length_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorSliceProto, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::TensorSliceProto, extent_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::TensorSliceProto_Extent)}, + { 8, -1, sizeof(::diplomacy::tensorflow::TensorSliceProto)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_TensorSliceProto_Extent_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_TensorSliceProto_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/tensor_slice.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n6diplomacy_tensorflow/core/framework/te" + "nsor_slice.proto\022\024diplomacy.tensorflow\"\212" + "\001\n\020TensorSliceProto\022=\n\006extent\030\001 \003(\0132-.di" + "plomacy.tensorflow.TensorSliceProto.Exte" + "nt\0327\n\006Extent\022\r\n\005start\030\001 \001(\003\022\020\n\006length\030\002 " + "\001(\003H\000B\014\n\nhas_lengthBq\n\030org.tensorflow.fr" + "ameworkB\021TensorSliceProtosP\001Z=github.com" + "/tensorflow/tensorflow/tensorflow/go/cor" + "e/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 342); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/tensor_slice.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void TensorSliceProto_Extent::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_TensorSliceProto_Extent_default_instance_.length_ = GOOGLE_LONGLONG(0); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorSliceProto_Extent::kStartFieldNumber; +const int TensorSliceProto_Extent::kLengthFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorSliceProto_Extent::TensorSliceProto_Extent() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::scc_info_TensorSliceProto_Extent.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.TensorSliceProto.Extent) +} +TensorSliceProto_Extent::TensorSliceProto_Extent(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::scc_info_TensorSliceProto_Extent.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.TensorSliceProto.Extent) +} +TensorSliceProto_Extent::TensorSliceProto_Extent(const TensorSliceProto_Extent& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + start_ = from.start_; + clear_has_has_length(); + switch (from.has_length_case()) { + case kLength: { + set_length(from.length()); + break; + } + case HAS_LENGTH_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.TensorSliceProto.Extent) +} + +void TensorSliceProto_Extent::SharedCtor() { + start_ = GOOGLE_LONGLONG(0); + clear_has_has_length(); +} + +TensorSliceProto_Extent::~TensorSliceProto_Extent() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.TensorSliceProto.Extent) + SharedDtor(); +} + +void TensorSliceProto_Extent::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_has_length()) { + clear_has_length(); + } +} + +void TensorSliceProto_Extent::ArenaDtor(void* object) { + TensorSliceProto_Extent* _this = reinterpret_cast< TensorSliceProto_Extent* >(object); + (void)_this; +} +void TensorSliceProto_Extent::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorSliceProto_Extent::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorSliceProto_Extent::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorSliceProto_Extent& TensorSliceProto_Extent::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::scc_info_TensorSliceProto_Extent.base); + return *internal_default_instance(); +} + + +void TensorSliceProto_Extent::clear_has_length() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.TensorSliceProto.Extent) + switch (has_length_case()) { + case kLength: { + // No need to clear + break; + } + case HAS_LENGTH_NOT_SET: { + break; + } + } + _oneof_case_[0] = HAS_LENGTH_NOT_SET; +} + + +void TensorSliceProto_Extent::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.TensorSliceProto.Extent) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + start_ = GOOGLE_LONGLONG(0); + clear_has_length(); + _internal_metadata_.Clear(); +} + +bool TensorSliceProto_Extent::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.TensorSliceProto.Extent) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 start = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &start_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 length = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + clear_has_length(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &has_length_.length_))); + set_has_length(); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.TensorSliceProto.Extent) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.TensorSliceProto.Extent) + return false; +#undef DO_ +} + +void TensorSliceProto_Extent::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.TensorSliceProto.Extent) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 start = 1; + if (this->start() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->start(), output); + } + + // int64 length = 2; + if (has_length()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->length(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.TensorSliceProto.Extent) +} + +::google::protobuf::uint8* TensorSliceProto_Extent::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.TensorSliceProto.Extent) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 start = 1; + if (this->start() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->start(), target); + } + + // int64 length = 2; + if (has_length()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->length(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.TensorSliceProto.Extent) + return target; +} + +size_t TensorSliceProto_Extent::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.TensorSliceProto.Extent) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 start = 1; + if (this->start() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->start()); + } + + switch (has_length_case()) { + // int64 length = 2; + case kLength: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->length()); + break; + } + case HAS_LENGTH_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorSliceProto_Extent::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.TensorSliceProto.Extent) + GOOGLE_DCHECK_NE(&from, this); + const TensorSliceProto_Extent* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.TensorSliceProto.Extent) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.TensorSliceProto.Extent) + MergeFrom(*source); + } +} + +void TensorSliceProto_Extent::MergeFrom(const TensorSliceProto_Extent& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.TensorSliceProto.Extent) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.start() != 0) { + set_start(from.start()); + } + switch (from.has_length_case()) { + case kLength: { + set_length(from.length()); + break; + } + case HAS_LENGTH_NOT_SET: { + break; + } + } +} + +void TensorSliceProto_Extent::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.TensorSliceProto.Extent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorSliceProto_Extent::CopyFrom(const TensorSliceProto_Extent& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.TensorSliceProto.Extent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorSliceProto_Extent::IsInitialized() const { + return true; +} + +void TensorSliceProto_Extent::Swap(TensorSliceProto_Extent* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorSliceProto_Extent* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorSliceProto_Extent::UnsafeArenaSwap(TensorSliceProto_Extent* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorSliceProto_Extent::InternalSwap(TensorSliceProto_Extent* other) { + using std::swap; + swap(start_, other->start_); + swap(has_length_, other->has_length_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorSliceProto_Extent::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TensorSliceProto::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorSliceProto::kExtentFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorSliceProto::TensorSliceProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::scc_info_TensorSliceProto.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.TensorSliceProto) +} +TensorSliceProto::TensorSliceProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + extent_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::scc_info_TensorSliceProto.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.TensorSliceProto) +} +TensorSliceProto::TensorSliceProto(const TensorSliceProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + extent_(from.extent_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.TensorSliceProto) +} + +void TensorSliceProto::SharedCtor() { +} + +TensorSliceProto::~TensorSliceProto() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.TensorSliceProto) + SharedDtor(); +} + +void TensorSliceProto::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TensorSliceProto::ArenaDtor(void* object) { + TensorSliceProto* _this = reinterpret_cast< TensorSliceProto* >(object); + (void)_this; +} +void TensorSliceProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorSliceProto::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TensorSliceProto::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TensorSliceProto& TensorSliceProto::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::scc_info_TensorSliceProto.base); + return *internal_default_instance(); +} + + +void TensorSliceProto::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.TensorSliceProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + extent_.Clear(); + _internal_metadata_.Clear(); +} + +bool TensorSliceProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.TensorSliceProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.TensorSliceProto.Extent extent = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_extent())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.TensorSliceProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.TensorSliceProto) + return false; +#undef DO_ +} + +void TensorSliceProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.TensorSliceProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.TensorSliceProto.Extent extent = 1; + for (unsigned int i = 0, + n = static_cast(this->extent_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->extent(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.TensorSliceProto) +} + +::google::protobuf::uint8* TensorSliceProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.TensorSliceProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.TensorSliceProto.Extent extent = 1; + for (unsigned int i = 0, + n = static_cast(this->extent_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->extent(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.TensorSliceProto) + return target; +} + +size_t TensorSliceProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.TensorSliceProto) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.TensorSliceProto.Extent extent = 1; + { + unsigned int count = static_cast(this->extent_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->extent(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TensorSliceProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.TensorSliceProto) + GOOGLE_DCHECK_NE(&from, this); + const TensorSliceProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.TensorSliceProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.TensorSliceProto) + MergeFrom(*source); + } +} + +void TensorSliceProto::MergeFrom(const TensorSliceProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.TensorSliceProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + extent_.MergeFrom(from.extent_); +} + +void TensorSliceProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.TensorSliceProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorSliceProto::CopyFrom(const TensorSliceProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.TensorSliceProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TensorSliceProto::IsInitialized() const { + return true; +} + +void TensorSliceProto::Swap(TensorSliceProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorSliceProto* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TensorSliceProto::UnsafeArenaSwap(TensorSliceProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorSliceProto::InternalSwap(TensorSliceProto* other) { + using std::swap; + CastToBase(&extent_)->InternalSwap(CastToBase(&other->extent_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TensorSliceProto::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::TensorSliceProto_Extent* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::TensorSliceProto_Extent >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::TensorSliceProto_Extent >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::TensorSliceProto* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::TensorSliceProto >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::TensorSliceProto >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.pb.h new file mode 100644 index 0000000..a766d89 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.pb.h @@ -0,0 +1,447 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/tensor_slice.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto +namespace diplomacy { +namespace tensorflow { +class TensorSliceProto; +class TensorSliceProtoDefaultTypeInternal; +extern TensorSliceProtoDefaultTypeInternal _TensorSliceProto_default_instance_; +class TensorSliceProto_Extent; +class TensorSliceProto_ExtentDefaultTypeInternal; +extern TensorSliceProto_ExtentDefaultTypeInternal _TensorSliceProto_Extent_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::TensorSliceProto* Arena::CreateMaybeMessage<::diplomacy::tensorflow::TensorSliceProto>(Arena*); +template<> ::diplomacy::tensorflow::TensorSliceProto_Extent* Arena::CreateMaybeMessage<::diplomacy::tensorflow::TensorSliceProto_Extent>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class TensorSliceProto_Extent : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.TensorSliceProto.Extent) */ { + public: + TensorSliceProto_Extent(); + virtual ~TensorSliceProto_Extent(); + + TensorSliceProto_Extent(const TensorSliceProto_Extent& from); + + inline TensorSliceProto_Extent& operator=(const TensorSliceProto_Extent& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorSliceProto_Extent(TensorSliceProto_Extent&& from) noexcept + : TensorSliceProto_Extent() { + *this = ::std::move(from); + } + + inline TensorSliceProto_Extent& operator=(TensorSliceProto_Extent&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorSliceProto_Extent& default_instance(); + + enum HasLengthCase { + kLength = 2, + HAS_LENGTH_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorSliceProto_Extent* internal_default_instance() { + return reinterpret_cast( + &_TensorSliceProto_Extent_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(TensorSliceProto_Extent* other); + void Swap(TensorSliceProto_Extent* other); + friend void swap(TensorSliceProto_Extent& a, TensorSliceProto_Extent& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorSliceProto_Extent* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorSliceProto_Extent* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorSliceProto_Extent& from); + void MergeFrom(const TensorSliceProto_Extent& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorSliceProto_Extent* other); + protected: + explicit TensorSliceProto_Extent(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 start = 1; + void clear_start(); + static const int kStartFieldNumber = 1; + ::google::protobuf::int64 start() const; + void set_start(::google::protobuf::int64 value); + + // int64 length = 2; + private: + bool has_length() const; + public: + void clear_length(); + static const int kLengthFieldNumber = 2; + ::google::protobuf::int64 length() const; + void set_length(::google::protobuf::int64 value); + + void clear_has_length(); + HasLengthCase has_length_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorSliceProto.Extent) + private: + void set_has_length(); + + inline bool has_has_length() const; + inline void clear_has_has_length(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 start_; + union HasLengthUnion { + HasLengthUnion() {} + ::google::protobuf::int64 length_; + } has_length_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TensorSliceProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.TensorSliceProto) */ { + public: + TensorSliceProto(); + virtual ~TensorSliceProto(); + + TensorSliceProto(const TensorSliceProto& from); + + inline TensorSliceProto& operator=(const TensorSliceProto& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TensorSliceProto(TensorSliceProto&& from) noexcept + : TensorSliceProto() { + *this = ::std::move(from); + } + + inline TensorSliceProto& operator=(TensorSliceProto&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorSliceProto& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TensorSliceProto* internal_default_instance() { + return reinterpret_cast( + &_TensorSliceProto_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(TensorSliceProto* other); + void Swap(TensorSliceProto* other); + friend void swap(TensorSliceProto& a, TensorSliceProto& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TensorSliceProto* New() const final { + return CreateMaybeMessage(NULL); + } + + TensorSliceProto* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TensorSliceProto& from); + void MergeFrom(const TensorSliceProto& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TensorSliceProto* other); + protected: + explicit TensorSliceProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef TensorSliceProto_Extent Extent; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.TensorSliceProto.Extent extent = 1; + int extent_size() const; + void clear_extent(); + static const int kExtentFieldNumber = 1; + ::diplomacy::tensorflow::TensorSliceProto_Extent* mutable_extent(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorSliceProto_Extent >* + mutable_extent(); + const ::diplomacy::tensorflow::TensorSliceProto_Extent& extent(int index) const; + ::diplomacy::tensorflow::TensorSliceProto_Extent* add_extent(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorSliceProto_Extent >& + extent() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorSliceProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorSliceProto_Extent > extent_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TensorSliceProto_Extent + +// int64 start = 1; +inline void TensorSliceProto_Extent::clear_start() { + start_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 TensorSliceProto_Extent::start() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorSliceProto.Extent.start) + return start_; +} +inline void TensorSliceProto_Extent::set_start(::google::protobuf::int64 value) { + + start_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorSliceProto.Extent.start) +} + +// int64 length = 2; +inline bool TensorSliceProto_Extent::has_length() const { + return has_length_case() == kLength; +} +inline void TensorSliceProto_Extent::set_has_length() { + _oneof_case_[0] = kLength; +} +inline void TensorSliceProto_Extent::clear_length() { + if (has_length()) { + has_length_.length_ = GOOGLE_LONGLONG(0); + clear_has_has_length(); + } +} +inline ::google::protobuf::int64 TensorSliceProto_Extent::length() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorSliceProto.Extent.length) + if (has_length()) { + return has_length_.length_; + } + return GOOGLE_LONGLONG(0); +} +inline void TensorSliceProto_Extent::set_length(::google::protobuf::int64 value) { + if (!has_length()) { + clear_has_length(); + set_has_length(); + } + has_length_.length_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.TensorSliceProto.Extent.length) +} + +inline bool TensorSliceProto_Extent::has_has_length() const { + return has_length_case() != HAS_LENGTH_NOT_SET; +} +inline void TensorSliceProto_Extent::clear_has_has_length() { + _oneof_case_[0] = HAS_LENGTH_NOT_SET; +} +inline TensorSliceProto_Extent::HasLengthCase TensorSliceProto_Extent::has_length_case() const { + return TensorSliceProto_Extent::HasLengthCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// TensorSliceProto + +// repeated .diplomacy.tensorflow.TensorSliceProto.Extent extent = 1; +inline int TensorSliceProto::extent_size() const { + return extent_.size(); +} +inline void TensorSliceProto::clear_extent() { + extent_.Clear(); +} +inline ::diplomacy::tensorflow::TensorSliceProto_Extent* TensorSliceProto::mutable_extent(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.TensorSliceProto.extent) + return extent_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorSliceProto_Extent >* +TensorSliceProto::mutable_extent() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.TensorSliceProto.extent) + return &extent_; +} +inline const ::diplomacy::tensorflow::TensorSliceProto_Extent& TensorSliceProto::extent(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.TensorSliceProto.extent) + return extent_.Get(index); +} +inline ::diplomacy::tensorflow::TensorSliceProto_Extent* TensorSliceProto::add_extent() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.TensorSliceProto.extent) + return extent_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::TensorSliceProto_Extent >& +TensorSliceProto::extent() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.TensorSliceProto.extent) + return extent_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.proto new file mode 100644 index 0000000..c54459f --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice.proto @@ -0,0 +1,38 @@ +// Protocol buffer representing slices of a tensor + +syntax = "proto3"; +option cc_enable_arenas = true; +option java_outer_classname = "TensorSliceProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +package diplomacy.tensorflow; + +// Can only be interpreted if you know the corresponding TensorShape. +message TensorSliceProto { + // Extent of the slice in one dimension. + message Extent { + // Either both or no attributes must be set. When no attribute is set + // means: All data in that dimension. + + // Start index of the slice, starting at 0. + int64 start = 1; + + // Length of the slice: if the length is missing or -1 we will + // interpret this as "everything in this dimension". We use + // "oneof" to preserve information about whether the length is + // present without changing the serialization format from the + // prior proto2 version of this proto. + oneof has_length { + int64 length = 2; + } + }; + + // 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. + repeated Extent extent = 1; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice_pb2.py new file mode 100644 index 0000000..a27c7a0 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/tensor_slice_pb2.py @@ -0,0 +1,123 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/tensor_slice.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/tensor_slice.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\021TensorSliceProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n6diplomacy_tensorflow/core/framework/tensor_slice.proto\x12\x14\x64iplomacy.tensorflow\"\x8a\x01\n\x10TensorSliceProto\x12=\n\x06\x65xtent\x18\x01 \x03(\x0b\x32-.diplomacy.tensorflow.TensorSliceProto.Extent\x1a\x37\n\x06\x45xtent\x12\r\n\x05start\x18\x01 \x01(\x03\x12\x10\n\x06length\x18\x02 \x01(\x03H\x00\x42\x0c\n\nhas_lengthBq\n\x18org.tensorflow.frameworkB\x11TensorSliceProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_TENSORSLICEPROTO_EXTENT = _descriptor.Descriptor( + name='Extent', + full_name='diplomacy.tensorflow.TensorSliceProto.Extent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='start', full_name='diplomacy.tensorflow.TensorSliceProto.Extent.start', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='length', full_name='diplomacy.tensorflow.TensorSliceProto.Extent.length', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='has_length', full_name='diplomacy.tensorflow.TensorSliceProto.Extent.has_length', + index=0, containing_type=None, fields=[]), + ], + serialized_start=164, + serialized_end=219, +) + +_TENSORSLICEPROTO = _descriptor.Descriptor( + name='TensorSliceProto', + full_name='diplomacy.tensorflow.TensorSliceProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='extent', full_name='diplomacy.tensorflow.TensorSliceProto.extent', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TENSORSLICEPROTO_EXTENT, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=219, +) + +_TENSORSLICEPROTO_EXTENT.containing_type = _TENSORSLICEPROTO +_TENSORSLICEPROTO_EXTENT.oneofs_by_name['has_length'].fields.append( + _TENSORSLICEPROTO_EXTENT.fields_by_name['length']) +_TENSORSLICEPROTO_EXTENT.fields_by_name['length'].containing_oneof = _TENSORSLICEPROTO_EXTENT.oneofs_by_name['has_length'] +_TENSORSLICEPROTO.fields_by_name['extent'].message_type = _TENSORSLICEPROTO_EXTENT +DESCRIPTOR.message_types_by_name['TensorSliceProto'] = _TENSORSLICEPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TensorSliceProto = _reflection.GeneratedProtocolMessageType('TensorSliceProto', (_message.Message,), dict( + + Extent = _reflection.GeneratedProtocolMessageType('Extent', (_message.Message,), dict( + DESCRIPTOR = _TENSORSLICEPROTO_EXTENT, + __module__ = 'diplomacy_tensorflow.core.framework.tensor_slice_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorSliceProto.Extent) + )) + , + DESCRIPTOR = _TENSORSLICEPROTO, + __module__ = 'diplomacy_tensorflow.core.framework.tensor_slice_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.TensorSliceProto) + )) +_sym_db.RegisterMessage(TensorSliceProto) +_sym_db.RegisterMessage(TensorSliceProto.Extent) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.pb.cc new file mode 100644 index 0000000..41f3036 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.pb.cc @@ -0,0 +1,169 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/types.proto + +#include "diplomacy_tensorflow/core/framework/types.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto { +void InitDefaults() { +} + +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; +const ::google::protobuf::uint32 TableStruct::offsets[1] = {}; +static const ::google::protobuf::internal::MigrationSchema* schemas = NULL; +static const ::google::protobuf::Message* const* file_default_instances = NULL; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/types.proto", schemas, file_default_instances, TableStruct::offsets, + NULL, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n/diplomacy_tensorflow/core/framework/ty" + "pes.proto\022\024diplomacy.tensorflow*\252\006\n\010Data" + "Type\022\016\n\nDT_INVALID\020\000\022\014\n\010DT_FLOAT\020\001\022\r\n\tDT" + "_DOUBLE\020\002\022\014\n\010DT_INT32\020\003\022\014\n\010DT_UINT8\020\004\022\014\n" + "\010DT_INT16\020\005\022\013\n\007DT_INT8\020\006\022\r\n\tDT_STRING\020\007\022" + "\020\n\014DT_COMPLEX64\020\010\022\014\n\010DT_INT64\020\t\022\013\n\007DT_BO" + "OL\020\n\022\014\n\010DT_QINT8\020\013\022\r\n\tDT_QUINT8\020\014\022\r\n\tDT_" + "QINT32\020\r\022\017\n\013DT_BFLOAT16\020\016\022\r\n\tDT_QINT16\020\017" + "\022\016\n\nDT_QUINT16\020\020\022\r\n\tDT_UINT16\020\021\022\021\n\rDT_CO" + "MPLEX128\020\022\022\013\n\007DT_HALF\020\023\022\017\n\013DT_RESOURCE\020\024" + "\022\016\n\nDT_VARIANT\020\025\022\r\n\tDT_UINT32\020\026\022\r\n\tDT_UI" + "NT64\020\027\022\020\n\014DT_FLOAT_REF\020e\022\021\n\rDT_DOUBLE_RE" + "F\020f\022\020\n\014DT_INT32_REF\020g\022\020\n\014DT_UINT8_REF\020h\022" + "\020\n\014DT_INT16_REF\020i\022\017\n\013DT_INT8_REF\020j\022\021\n\rDT" + "_STRING_REF\020k\022\024\n\020DT_COMPLEX64_REF\020l\022\020\n\014D" + "T_INT64_REF\020m\022\017\n\013DT_BOOL_REF\020n\022\020\n\014DT_QIN" + "T8_REF\020o\022\021\n\rDT_QUINT8_REF\020p\022\021\n\rDT_QINT32" + "_REF\020q\022\023\n\017DT_BFLOAT16_REF\020r\022\021\n\rDT_QINT16" + "_REF\020s\022\022\n\016DT_QUINT16_REF\020t\022\021\n\rDT_UINT16_" + "REF\020u\022\025\n\021DT_COMPLEX128_REF\020v\022\017\n\013DT_HALF_" + "REF\020w\022\023\n\017DT_RESOURCE_REF\020x\022\022\n\016DT_VARIANT" + "_REF\020y\022\021\n\rDT_UINT32_REF\020z\022\021\n\rDT_UINT64_R" + "EF\020{Bk\n\030org.tensorflow.frameworkB\013TypesP" + "rotosP\001Z=github.com/tensorflow/tensorflo" + "w/tensorflow/go/core/framework\370\001\001b\006proto" + "3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1001); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/types.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto +namespace diplomacy { +namespace tensorflow { +const ::google::protobuf::EnumDescriptor* DataType_descriptor() { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::file_level_enum_descriptors[0]; +} +bool DataType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + return true; + default: + return false; + } +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.pb.h new file mode 100644 index 0000000..ad6bca1 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.pb.h @@ -0,0 +1,155 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/types.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto +namespace diplomacy { +namespace tensorflow { +} // namespace tensorflow +} // namespace diplomacy +namespace diplomacy { +namespace tensorflow { + +enum DataType { + DT_INVALID = 0, + DT_FLOAT = 1, + DT_DOUBLE = 2, + DT_INT32 = 3, + DT_UINT8 = 4, + DT_INT16 = 5, + DT_INT8 = 6, + DT_STRING = 7, + DT_COMPLEX64 = 8, + DT_INT64 = 9, + DT_BOOL = 10, + DT_QINT8 = 11, + DT_QUINT8 = 12, + DT_QINT32 = 13, + DT_BFLOAT16 = 14, + DT_QINT16 = 15, + DT_QUINT16 = 16, + DT_UINT16 = 17, + DT_COMPLEX128 = 18, + DT_HALF = 19, + DT_RESOURCE = 20, + DT_VARIANT = 21, + DT_UINT32 = 22, + DT_UINT64 = 23, + DT_FLOAT_REF = 101, + DT_DOUBLE_REF = 102, + DT_INT32_REF = 103, + DT_UINT8_REF = 104, + DT_INT16_REF = 105, + DT_INT8_REF = 106, + DT_STRING_REF = 107, + DT_COMPLEX64_REF = 108, + DT_INT64_REF = 109, + DT_BOOL_REF = 110, + DT_QINT8_REF = 111, + DT_QUINT8_REF = 112, + DT_QINT32_REF = 113, + DT_BFLOAT16_REF = 114, + DT_QINT16_REF = 115, + DT_QUINT16_REF = 116, + DT_UINT16_REF = 117, + DT_COMPLEX128_REF = 118, + DT_HALF_REF = 119, + DT_RESOURCE_REF = 120, + DT_VARIANT_REF = 121, + DT_UINT32_REF = 122, + DT_UINT64_REF = 123, + DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool DataType_IsValid(int value); +const DataType DataType_MIN = DT_INVALID; +const DataType DataType_MAX = DT_UINT64_REF; +const int DataType_ARRAYSIZE = DataType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* DataType_descriptor(); +inline const ::std::string& DataType_Name(DataType value) { + return ::google::protobuf::internal::NameOfEnum( + DataType_descriptor(), value); +} +inline bool DataType_Parse( + const ::std::string& name, DataType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + DataType_descriptor(), name, value); +} +// =================================================================== + + +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::DataType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::DataType>() { + return ::diplomacy::tensorflow::DataType_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.proto new file mode 100644 index 0000000..4491f67 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "TypesProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +// LINT.IfChange +enum DataType { + // Not a legal value for DataType. Used to indicate a DataType field + // has not been set. + DT_INVALID = 0; + + // Data types that all computation devices are expected to be + // capable to support. + DT_FLOAT = 1; + DT_DOUBLE = 2; + DT_INT32 = 3; + DT_UINT8 = 4; + DT_INT16 = 5; + DT_INT8 = 6; + DT_STRING = 7; + DT_COMPLEX64 = 8; // Single-precision complex + DT_INT64 = 9; + DT_BOOL = 10; + DT_QINT8 = 11; // Quantized int8 + DT_QUINT8 = 12; // Quantized uint8 + DT_QINT32 = 13; // Quantized int32 + DT_BFLOAT16 = 14; // Float32 truncated to 16 bits. Only for cast ops. + DT_QINT16 = 15; // Quantized int16 + DT_QUINT16 = 16; // Quantized uint16 + DT_UINT16 = 17; + DT_COMPLEX128 = 18; // Double-precision complex + DT_HALF = 19; + DT_RESOURCE = 20; + DT_VARIANT = 21; // Arbitrary C++ data types + DT_UINT32 = 22; + DT_UINT64 = 23; + + // Do not use! These are only for parameters. Every enum above + // should have a corresponding value below (verified by types_test). + DT_FLOAT_REF = 101; + DT_DOUBLE_REF = 102; + DT_INT32_REF = 103; + DT_UINT8_REF = 104; + DT_INT16_REF = 105; + DT_INT8_REF = 106; + DT_STRING_REF = 107; + DT_COMPLEX64_REF = 108; + DT_INT64_REF = 109; + DT_BOOL_REF = 110; + DT_QINT8_REF = 111; + DT_QUINT8_REF = 112; + DT_QINT32_REF = 113; + DT_BFLOAT16_REF = 114; + DT_QINT16_REF = 115; + DT_QUINT16_REF = 116; + DT_UINT16_REF = 117; + DT_COMPLEX128_REF = 118; + DT_HALF_REF = 119; + DT_RESOURCE_REF = 120; + DT_VARIANT_REF = 121; + DT_UINT32_REF = 122; + DT_UINT64_REF = 123; +} +// LINT.ThenChange( +// https://www.tensorflow.org/code/tensorflow/c/c_api.h, +// https://www.tensorflow.org/code/tensorflow/go/tensor.go, +// https://www.tensorflow.org/code/tensorflow/core/framework/tensor.cc, +// https://www.tensorflow.org/code/tensorflow/core/framework/types.h, +// https://www.tensorflow.org/code/tensorflow/core/framework/types.cc, +// https://www.tensorflow.org/code/tensorflow/python/framework/dtypes.py, +// https://www.tensorflow.org/code/tensorflow/python/framework/function.py) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types_pb2.py new file mode 100644 index 0000000..9bb8955 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/types_pb2.py @@ -0,0 +1,283 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/types.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/types.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\013TypesProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n/diplomacy_tensorflow/core/framework/types.proto\x12\x14\x64iplomacy.tensorflow*\xaa\x06\n\x08\x44\x61taType\x12\x0e\n\nDT_INVALID\x10\x00\x12\x0c\n\x08\x44T_FLOAT\x10\x01\x12\r\n\tDT_DOUBLE\x10\x02\x12\x0c\n\x08\x44T_INT32\x10\x03\x12\x0c\n\x08\x44T_UINT8\x10\x04\x12\x0c\n\x08\x44T_INT16\x10\x05\x12\x0b\n\x07\x44T_INT8\x10\x06\x12\r\n\tDT_STRING\x10\x07\x12\x10\n\x0c\x44T_COMPLEX64\x10\x08\x12\x0c\n\x08\x44T_INT64\x10\t\x12\x0b\n\x07\x44T_BOOL\x10\n\x12\x0c\n\x08\x44T_QINT8\x10\x0b\x12\r\n\tDT_QUINT8\x10\x0c\x12\r\n\tDT_QINT32\x10\r\x12\x0f\n\x0b\x44T_BFLOAT16\x10\x0e\x12\r\n\tDT_QINT16\x10\x0f\x12\x0e\n\nDT_QUINT16\x10\x10\x12\r\n\tDT_UINT16\x10\x11\x12\x11\n\rDT_COMPLEX128\x10\x12\x12\x0b\n\x07\x44T_HALF\x10\x13\x12\x0f\n\x0b\x44T_RESOURCE\x10\x14\x12\x0e\n\nDT_VARIANT\x10\x15\x12\r\n\tDT_UINT32\x10\x16\x12\r\n\tDT_UINT64\x10\x17\x12\x10\n\x0c\x44T_FLOAT_REF\x10\x65\x12\x11\n\rDT_DOUBLE_REF\x10\x66\x12\x10\n\x0c\x44T_INT32_REF\x10g\x12\x10\n\x0c\x44T_UINT8_REF\x10h\x12\x10\n\x0c\x44T_INT16_REF\x10i\x12\x0f\n\x0b\x44T_INT8_REF\x10j\x12\x11\n\rDT_STRING_REF\x10k\x12\x14\n\x10\x44T_COMPLEX64_REF\x10l\x12\x10\n\x0c\x44T_INT64_REF\x10m\x12\x0f\n\x0b\x44T_BOOL_REF\x10n\x12\x10\n\x0c\x44T_QINT8_REF\x10o\x12\x11\n\rDT_QUINT8_REF\x10p\x12\x11\n\rDT_QINT32_REF\x10q\x12\x13\n\x0f\x44T_BFLOAT16_REF\x10r\x12\x11\n\rDT_QINT16_REF\x10s\x12\x12\n\x0e\x44T_QUINT16_REF\x10t\x12\x11\n\rDT_UINT16_REF\x10u\x12\x15\n\x11\x44T_COMPLEX128_REF\x10v\x12\x0f\n\x0b\x44T_HALF_REF\x10w\x12\x13\n\x0f\x44T_RESOURCE_REF\x10x\x12\x12\n\x0e\x44T_VARIANT_REF\x10y\x12\x11\n\rDT_UINT32_REF\x10z\x12\x11\n\rDT_UINT64_REF\x10{Bk\n\x18org.tensorflow.frameworkB\x0bTypesProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + +_DATATYPE = _descriptor.EnumDescriptor( + name='DataType', + full_name='diplomacy.tensorflow.DataType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DT_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOAT', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_DOUBLE', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT32', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT8', index=4, number=4, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT16', index=5, number=5, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT8', index=6, number=6, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_STRING', index=7, number=7, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX64', index=8, number=8, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT64', index=9, number=9, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BOOL', index=10, number=10, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT8', index=11, number=11, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT8', index=12, number=12, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT32', index=13, number=13, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BFLOAT16', index=14, number=14, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT16', index=15, number=15, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT16', index=16, number=16, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT16', index=17, number=17, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX128', index=18, number=18, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_HALF', index=19, number=19, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_RESOURCE', index=20, number=20, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_VARIANT', index=21, number=21, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT32', index=22, number=22, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT64', index=23, number=23, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOAT_REF', index=24, number=101, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_DOUBLE_REF', index=25, number=102, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT32_REF', index=26, number=103, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT8_REF', index=27, number=104, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT16_REF', index=28, number=105, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT8_REF', index=29, number=106, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_STRING_REF', index=30, number=107, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX64_REF', index=31, number=108, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT64_REF', index=32, number=109, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BOOL_REF', index=33, number=110, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT8_REF', index=34, number=111, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT8_REF', index=35, number=112, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT32_REF', index=36, number=113, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BFLOAT16_REF', index=37, number=114, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT16_REF', index=38, number=115, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT16_REF', index=39, number=116, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT16_REF', index=40, number=117, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX128_REF', index=41, number=118, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_HALF_REF', index=42, number=119, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_RESOURCE_REF', index=43, number=120, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_VARIANT_REF', index=44, number=121, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT32_REF', index=45, number=122, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT64_REF', index=46, number=123, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=74, + serialized_end=884, +) +_sym_db.RegisterEnumDescriptor(_DATATYPE) + +DataType = enum_type_wrapper.EnumTypeWrapper(_DATATYPE) +DT_INVALID = 0 +DT_FLOAT = 1 +DT_DOUBLE = 2 +DT_INT32 = 3 +DT_UINT8 = 4 +DT_INT16 = 5 +DT_INT8 = 6 +DT_STRING = 7 +DT_COMPLEX64 = 8 +DT_INT64 = 9 +DT_BOOL = 10 +DT_QINT8 = 11 +DT_QUINT8 = 12 +DT_QINT32 = 13 +DT_BFLOAT16 = 14 +DT_QINT16 = 15 +DT_QUINT16 = 16 +DT_UINT16 = 17 +DT_COMPLEX128 = 18 +DT_HALF = 19 +DT_RESOURCE = 20 +DT_VARIANT = 21 +DT_UINT32 = 22 +DT_UINT64 = 23 +DT_FLOAT_REF = 101 +DT_DOUBLE_REF = 102 +DT_INT32_REF = 103 +DT_UINT8_REF = 104 +DT_INT16_REF = 105 +DT_INT8_REF = 106 +DT_STRING_REF = 107 +DT_COMPLEX64_REF = 108 +DT_INT64_REF = 109 +DT_BOOL_REF = 110 +DT_QINT8_REF = 111 +DT_QUINT8_REF = 112 +DT_QINT32_REF = 113 +DT_BFLOAT16_REF = 114 +DT_QINT16_REF = 115 +DT_QUINT16_REF = 116 +DT_UINT16_REF = 117 +DT_COMPLEX128_REF = 118 +DT_HALF_REF = 119 +DT_RESOURCE_REF = 120 +DT_VARIANT_REF = 121 +DT_UINT32_REF = 122 +DT_UINT64_REF = 123 + + +DESCRIPTOR.enum_types_by_name['DataType'] = _DATATYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.pb.cc new file mode 100644 index 0000000..f0d2a5e --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.pb.cc @@ -0,0 +1,1230 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/variable.proto + +#include "diplomacy_tensorflow/core/framework/variable.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SaveSliceInfoDef; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto +namespace diplomacy { +namespace tensorflow { +class VariableDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _VariableDef_default_instance_; +class SaveSliceInfoDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SaveSliceInfoDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto { +static void InitDefaultsVariableDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_VariableDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::VariableDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::VariableDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_VariableDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsVariableDef}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::scc_info_SaveSliceInfoDef.base,}}; + +static void InitDefaultsSaveSliceInfoDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_SaveSliceInfoDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::SaveSliceInfoDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::SaveSliceInfoDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SaveSliceInfoDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSaveSliceInfoDef}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_VariableDef.base); + ::google::protobuf::internal::InitSCC(&scc_info_SaveSliceInfoDef.base); +} + +::google::protobuf::Metadata file_level_metadata[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, variable_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, initial_value_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, initializer_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, snapshot_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, save_slice_info_def_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, is_resource_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VariableDef, trainable_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SaveSliceInfoDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SaveSliceInfoDef, full_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SaveSliceInfoDef, full_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SaveSliceInfoDef, var_offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SaveSliceInfoDef, var_shape_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::VariableDef)}, + { 12, -1, sizeof(::diplomacy::tensorflow::SaveSliceInfoDef)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_VariableDef_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_SaveSliceInfoDef_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/variable.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n2diplomacy_tensorflow/core/framework/va" + "riable.proto\022\024diplomacy.tensorflow\"\336\001\n\013V" + "ariableDef\022\025\n\rvariable_name\030\001 \001(\t\022\032\n\022ini" + "tial_value_name\030\006 \001(\t\022\030\n\020initializer_nam" + "e\030\002 \001(\t\022\025\n\rsnapshot_name\030\003 \001(\t\022C\n\023save_s" + "lice_info_def\030\004 \001(\0132&.diplomacy.tensorfl" + "ow.SaveSliceInfoDef\022\023\n\013is_resource\030\005 \001(\010" + "\022\021\n\ttrainable\030\007 \001(\010\"`\n\020SaveSliceInfoDef\022" + "\021\n\tfull_name\030\001 \001(\t\022\022\n\nfull_shape\030\002 \003(\003\022\022" + "\n\nvar_offset\030\003 \003(\003\022\021\n\tvar_shape\030\004 \003(\003Bn\n" + "\030org.tensorflow.frameworkB\016VariableProto" + "sP\001Z=github.com/tensorflow/tensorflow/te" + "nsorflow/go/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 517); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/variable.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void VariableDef::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_VariableDef_default_instance_._instance.get_mutable()->save_slice_info_def_ = const_cast< ::diplomacy::tensorflow::SaveSliceInfoDef*>( + ::diplomacy::tensorflow::SaveSliceInfoDef::internal_default_instance()); +} +void VariableDef::unsafe_arena_set_allocated_save_slice_info_def( + ::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def) { + if (GetArenaNoVirtual() == NULL) { + delete save_slice_info_def_; + } + save_slice_info_def_ = save_slice_info_def; + if (save_slice_info_def) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.save_slice_info_def) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int VariableDef::kVariableNameFieldNumber; +const int VariableDef::kInitialValueNameFieldNumber; +const int VariableDef::kInitializerNameFieldNumber; +const int VariableDef::kSnapshotNameFieldNumber; +const int VariableDef::kSaveSliceInfoDefFieldNumber; +const int VariableDef::kIsResourceFieldNumber; +const int VariableDef::kTrainableFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +VariableDef::VariableDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::scc_info_VariableDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.VariableDef) +} +VariableDef::VariableDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::scc_info_VariableDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.VariableDef) +} +VariableDef::VariableDef(const VariableDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + variable_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.variable_name().size() > 0) { + variable_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.variable_name(), + GetArenaNoVirtual()); + } + initializer_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.initializer_name().size() > 0) { + initializer_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.initializer_name(), + GetArenaNoVirtual()); + } + snapshot_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.snapshot_name().size() > 0) { + snapshot_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.snapshot_name(), + GetArenaNoVirtual()); + } + initial_value_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.initial_value_name().size() > 0) { + initial_value_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.initial_value_name(), + GetArenaNoVirtual()); + } + if (from.has_save_slice_info_def()) { + save_slice_info_def_ = new ::diplomacy::tensorflow::SaveSliceInfoDef(*from.save_slice_info_def_); + } else { + save_slice_info_def_ = NULL; + } + ::memcpy(&is_resource_, &from.is_resource_, + static_cast(reinterpret_cast(&trainable_) - + reinterpret_cast(&is_resource_)) + sizeof(trainable_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.VariableDef) +} + +void VariableDef::SharedCtor() { + variable_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + initializer_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + snapshot_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + initial_value_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&save_slice_info_def_, 0, static_cast( + reinterpret_cast(&trainable_) - + reinterpret_cast(&save_slice_info_def_)) + sizeof(trainable_)); +} + +VariableDef::~VariableDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.VariableDef) + SharedDtor(); +} + +void VariableDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + variable_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + initializer_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + snapshot_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + initial_value_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete save_slice_info_def_; +} + +void VariableDef::ArenaDtor(void* object) { + VariableDef* _this = reinterpret_cast< VariableDef* >(object); + (void)_this; +} +void VariableDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void VariableDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* VariableDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const VariableDef& VariableDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::scc_info_VariableDef.base); + return *internal_default_instance(); +} + + +void VariableDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.VariableDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + variable_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + initializer_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + snapshot_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + initial_value_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && save_slice_info_def_ != NULL) { + delete save_slice_info_def_; + } + save_slice_info_def_ = NULL; + ::memset(&is_resource_, 0, static_cast( + reinterpret_cast(&trainable_) - + reinterpret_cast(&is_resource_)) + sizeof(trainable_)); + _internal_metadata_.Clear(); +} + +bool VariableDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.VariableDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string variable_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_variable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->variable_name().data(), static_cast(this->variable_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VariableDef.variable_name")); + } else { + goto handle_unusual; + } + break; + } + + // string initializer_name = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_initializer_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->initializer_name().data(), static_cast(this->initializer_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VariableDef.initializer_name")); + } else { + goto handle_unusual; + } + break; + } + + // string snapshot_name = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_snapshot_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->snapshot_name().data(), static_cast(this->snapshot_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VariableDef.snapshot_name")); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_save_slice_info_def())); + } else { + goto handle_unusual; + } + break; + } + + // bool is_resource = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_resource_))); + } else { + goto handle_unusual; + } + break; + } + + // string initial_value_name = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_initial_value_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->initial_value_name().data(), static_cast(this->initial_value_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.VariableDef.initial_value_name")); + } else { + goto handle_unusual; + } + break; + } + + // bool trainable = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &trainable_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.VariableDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.VariableDef) + return false; +#undef DO_ +} + +void VariableDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.VariableDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string variable_name = 1; + if (this->variable_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->variable_name().data(), static_cast(this->variable_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.variable_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->variable_name(), output); + } + + // string initializer_name = 2; + if (this->initializer_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->initializer_name().data(), static_cast(this->initializer_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.initializer_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->initializer_name(), output); + } + + // string snapshot_name = 3; + if (this->snapshot_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->snapshot_name().data(), static_cast(this->snapshot_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.snapshot_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->snapshot_name(), output); + } + + // .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + if (this->has_save_slice_info_def()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_save_slice_info_def(), output); + } + + // bool is_resource = 5; + if (this->is_resource() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->is_resource(), output); + } + + // string initial_value_name = 6; + if (this->initial_value_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->initial_value_name().data(), static_cast(this->initial_value_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.initial_value_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->initial_value_name(), output); + } + + // bool trainable = 7; + if (this->trainable() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->trainable(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.VariableDef) +} + +::google::protobuf::uint8* VariableDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.VariableDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string variable_name = 1; + if (this->variable_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->variable_name().data(), static_cast(this->variable_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.variable_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->variable_name(), target); + } + + // string initializer_name = 2; + if (this->initializer_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->initializer_name().data(), static_cast(this->initializer_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.initializer_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->initializer_name(), target); + } + + // string snapshot_name = 3; + if (this->snapshot_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->snapshot_name().data(), static_cast(this->snapshot_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.snapshot_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->snapshot_name(), target); + } + + // .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + if (this->has_save_slice_info_def()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_save_slice_info_def(), deterministic, target); + } + + // bool is_resource = 5; + if (this->is_resource() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->is_resource(), target); + } + + // string initial_value_name = 6; + if (this->initial_value_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->initial_value_name().data(), static_cast(this->initial_value_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.VariableDef.initial_value_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->initial_value_name(), target); + } + + // bool trainable = 7; + if (this->trainable() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->trainable(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.VariableDef) + return target; +} + +size_t VariableDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.VariableDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string variable_name = 1; + if (this->variable_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->variable_name()); + } + + // string initializer_name = 2; + if (this->initializer_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->initializer_name()); + } + + // string snapshot_name = 3; + if (this->snapshot_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->snapshot_name()); + } + + // string initial_value_name = 6; + if (this->initial_value_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->initial_value_name()); + } + + // .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + if (this->has_save_slice_info_def()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *save_slice_info_def_); + } + + // bool is_resource = 5; + if (this->is_resource() != 0) { + total_size += 1 + 1; + } + + // bool trainable = 7; + if (this->trainable() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void VariableDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.VariableDef) + GOOGLE_DCHECK_NE(&from, this); + const VariableDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.VariableDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.VariableDef) + MergeFrom(*source); + } +} + +void VariableDef::MergeFrom(const VariableDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.VariableDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.variable_name().size() > 0) { + set_variable_name(from.variable_name()); + } + if (from.initializer_name().size() > 0) { + set_initializer_name(from.initializer_name()); + } + if (from.snapshot_name().size() > 0) { + set_snapshot_name(from.snapshot_name()); + } + if (from.initial_value_name().size() > 0) { + set_initial_value_name(from.initial_value_name()); + } + if (from.has_save_slice_info_def()) { + mutable_save_slice_info_def()->::diplomacy::tensorflow::SaveSliceInfoDef::MergeFrom(from.save_slice_info_def()); + } + if (from.is_resource() != 0) { + set_is_resource(from.is_resource()); + } + if (from.trainable() != 0) { + set_trainable(from.trainable()); + } +} + +void VariableDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.VariableDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void VariableDef::CopyFrom(const VariableDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.VariableDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool VariableDef::IsInitialized() const { + return true; +} + +void VariableDef::Swap(VariableDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + VariableDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void VariableDef::UnsafeArenaSwap(VariableDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void VariableDef::InternalSwap(VariableDef* other) { + using std::swap; + variable_name_.Swap(&other->variable_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + initializer_name_.Swap(&other->initializer_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + snapshot_name_.Swap(&other->snapshot_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + initial_value_name_.Swap(&other->initial_value_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(save_slice_info_def_, other->save_slice_info_def_); + swap(is_resource_, other->is_resource_); + swap(trainable_, other->trainable_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata VariableDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SaveSliceInfoDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SaveSliceInfoDef::kFullNameFieldNumber; +const int SaveSliceInfoDef::kFullShapeFieldNumber; +const int SaveSliceInfoDef::kVarOffsetFieldNumber; +const int SaveSliceInfoDef::kVarShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SaveSliceInfoDef::SaveSliceInfoDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::scc_info_SaveSliceInfoDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.SaveSliceInfoDef) +} +SaveSliceInfoDef::SaveSliceInfoDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + full_shape_(arena), + var_offset_(arena), + var_shape_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::scc_info_SaveSliceInfoDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.SaveSliceInfoDef) +} +SaveSliceInfoDef::SaveSliceInfoDef(const SaveSliceInfoDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + full_shape_(from.full_shape_), + var_offset_(from.var_offset_), + var_shape_(from.var_shape_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + full_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.full_name().size() > 0) { + full_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.full_name(), + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.SaveSliceInfoDef) +} + +void SaveSliceInfoDef::SharedCtor() { + full_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +SaveSliceInfoDef::~SaveSliceInfoDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.SaveSliceInfoDef) + SharedDtor(); +} + +void SaveSliceInfoDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + full_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SaveSliceInfoDef::ArenaDtor(void* object) { + SaveSliceInfoDef* _this = reinterpret_cast< SaveSliceInfoDef* >(object); + (void)_this; +} +void SaveSliceInfoDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SaveSliceInfoDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SaveSliceInfoDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SaveSliceInfoDef& SaveSliceInfoDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::scc_info_SaveSliceInfoDef.base); + return *internal_default_instance(); +} + + +void SaveSliceInfoDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.SaveSliceInfoDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + full_shape_.Clear(); + var_offset_.Clear(); + var_shape_.Clear(); + full_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + _internal_metadata_.Clear(); +} + +bool SaveSliceInfoDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.SaveSliceInfoDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string full_name = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_full_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->full_name().data(), static_cast(this->full_name().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.SaveSliceInfoDef.full_name")); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 full_shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_full_shape()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 18u, input, this->mutable_full_shape()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 var_offset = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_var_offset()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26u, input, this->mutable_var_offset()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int64 var_shape = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_var_shape()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 34u, input, this->mutable_var_shape()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.SaveSliceInfoDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.SaveSliceInfoDef) + return false; +#undef DO_ +} + +void SaveSliceInfoDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.SaveSliceInfoDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string full_name = 1; + if (this->full_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->full_name().data(), static_cast(this->full_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SaveSliceInfoDef.full_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->full_name(), output); + } + + // repeated int64 full_shape = 2; + if (this->full_shape_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _full_shape_cached_byte_size_)); + } + for (int i = 0, n = this->full_shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->full_shape(i), output); + } + + // repeated int64 var_offset = 3; + if (this->var_offset_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _var_offset_cached_byte_size_)); + } + for (int i = 0, n = this->var_offset_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->var_offset(i), output); + } + + // repeated int64 var_shape = 4; + if (this->var_shape_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _var_shape_cached_byte_size_)); + } + for (int i = 0, n = this->var_shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->var_shape(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.SaveSliceInfoDef) +} + +::google::protobuf::uint8* SaveSliceInfoDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.SaveSliceInfoDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string full_name = 1; + if (this->full_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->full_name().data(), static_cast(this->full_name().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.SaveSliceInfoDef.full_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->full_name(), target); + } + + // repeated int64 full_shape = 2; + if (this->full_shape_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _full_shape_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->full_shape_, target); + } + + // repeated int64 var_offset = 3; + if (this->var_offset_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _var_offset_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->var_offset_, target); + } + + // repeated int64 var_shape = 4; + if (this->var_shape_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _var_shape_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->var_shape_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.SaveSliceInfoDef) + return target; +} + +size_t SaveSliceInfoDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.SaveSliceInfoDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 full_shape = 2; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->full_shape_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _full_shape_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 var_offset = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->var_offset_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _var_offset_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 var_shape = 4; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->var_shape_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _var_shape_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // string full_name = 1; + if (this->full_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->full_name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SaveSliceInfoDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.SaveSliceInfoDef) + GOOGLE_DCHECK_NE(&from, this); + const SaveSliceInfoDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.SaveSliceInfoDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.SaveSliceInfoDef) + MergeFrom(*source); + } +} + +void SaveSliceInfoDef::MergeFrom(const SaveSliceInfoDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.SaveSliceInfoDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + full_shape_.MergeFrom(from.full_shape_); + var_offset_.MergeFrom(from.var_offset_); + var_shape_.MergeFrom(from.var_shape_); + if (from.full_name().size() > 0) { + set_full_name(from.full_name()); + } +} + +void SaveSliceInfoDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.SaveSliceInfoDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SaveSliceInfoDef::CopyFrom(const SaveSliceInfoDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.SaveSliceInfoDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SaveSliceInfoDef::IsInitialized() const { + return true; +} + +void SaveSliceInfoDef::Swap(SaveSliceInfoDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SaveSliceInfoDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SaveSliceInfoDef::UnsafeArenaSwap(SaveSliceInfoDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SaveSliceInfoDef::InternalSwap(SaveSliceInfoDef* other) { + using std::swap; + full_shape_.InternalSwap(&other->full_shape_); + var_offset_.InternalSwap(&other->var_offset_); + var_shape_.InternalSwap(&other->var_shape_); + full_name_.Swap(&other->full_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SaveSliceInfoDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::VariableDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::VariableDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::VariableDef >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::SaveSliceInfoDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::SaveSliceInfoDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::SaveSliceInfoDef >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.pb.h new file mode 100644 index 0000000..c9cd9f7 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.pb.h @@ -0,0 +1,1067 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/variable.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[2]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto +namespace diplomacy { +namespace tensorflow { +class SaveSliceInfoDef; +class SaveSliceInfoDefDefaultTypeInternal; +extern SaveSliceInfoDefDefaultTypeInternal _SaveSliceInfoDef_default_instance_; +class VariableDef; +class VariableDefDefaultTypeInternal; +extern VariableDefDefaultTypeInternal _VariableDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::SaveSliceInfoDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SaveSliceInfoDef>(Arena*); +template<> ::diplomacy::tensorflow::VariableDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::VariableDef>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class VariableDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.VariableDef) */ { + public: + VariableDef(); + virtual ~VariableDef(); + + VariableDef(const VariableDef& from); + + inline VariableDef& operator=(const VariableDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + VariableDef(VariableDef&& from) noexcept + : VariableDef() { + *this = ::std::move(from); + } + + inline VariableDef& operator=(VariableDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const VariableDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const VariableDef* internal_default_instance() { + return reinterpret_cast( + &_VariableDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(VariableDef* other); + void Swap(VariableDef* other); + friend void swap(VariableDef& a, VariableDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline VariableDef* New() const final { + return CreateMaybeMessage(NULL); + } + + VariableDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const VariableDef& from); + void MergeFrom(const VariableDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(VariableDef* other); + protected: + explicit VariableDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // string variable_name = 1; + void clear_variable_name(); + static const int kVariableNameFieldNumber = 1; + const ::std::string& variable_name() const; + void set_variable_name(const ::std::string& value); + #if LANG_CXX11 + void set_variable_name(::std::string&& value); + #endif + void set_variable_name(const char* value); + void set_variable_name(const char* value, size_t size); + ::std::string* mutable_variable_name(); + ::std::string* release_variable_name(); + void set_allocated_variable_name(::std::string* variable_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_variable_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_variable_name( + ::std::string* variable_name); + + // string initializer_name = 2; + void clear_initializer_name(); + static const int kInitializerNameFieldNumber = 2; + const ::std::string& initializer_name() const; + void set_initializer_name(const ::std::string& value); + #if LANG_CXX11 + void set_initializer_name(::std::string&& value); + #endif + void set_initializer_name(const char* value); + void set_initializer_name(const char* value, size_t size); + ::std::string* mutable_initializer_name(); + ::std::string* release_initializer_name(); + void set_allocated_initializer_name(::std::string* initializer_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_initializer_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_initializer_name( + ::std::string* initializer_name); + + // string snapshot_name = 3; + void clear_snapshot_name(); + static const int kSnapshotNameFieldNumber = 3; + const ::std::string& snapshot_name() const; + void set_snapshot_name(const ::std::string& value); + #if LANG_CXX11 + void set_snapshot_name(::std::string&& value); + #endif + void set_snapshot_name(const char* value); + void set_snapshot_name(const char* value, size_t size); + ::std::string* mutable_snapshot_name(); + ::std::string* release_snapshot_name(); + void set_allocated_snapshot_name(::std::string* snapshot_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_snapshot_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_snapshot_name( + ::std::string* snapshot_name); + + // string initial_value_name = 6; + void clear_initial_value_name(); + static const int kInitialValueNameFieldNumber = 6; + const ::std::string& initial_value_name() const; + void set_initial_value_name(const ::std::string& value); + #if LANG_CXX11 + void set_initial_value_name(::std::string&& value); + #endif + void set_initial_value_name(const char* value); + void set_initial_value_name(const char* value, size_t size); + ::std::string* mutable_initial_value_name(); + ::std::string* release_initial_value_name(); + void set_allocated_initial_value_name(::std::string* initial_value_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_initial_value_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_initial_value_name( + ::std::string* initial_value_name); + + // .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + bool has_save_slice_info_def() const; + void clear_save_slice_info_def(); + static const int kSaveSliceInfoDefFieldNumber = 4; + private: + const ::diplomacy::tensorflow::SaveSliceInfoDef& _internal_save_slice_info_def() const; + public: + const ::diplomacy::tensorflow::SaveSliceInfoDef& save_slice_info_def() const; + ::diplomacy::tensorflow::SaveSliceInfoDef* release_save_slice_info_def(); + ::diplomacy::tensorflow::SaveSliceInfoDef* mutable_save_slice_info_def(); + void set_allocated_save_slice_info_def(::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def); + void unsafe_arena_set_allocated_save_slice_info_def( + ::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def); + ::diplomacy::tensorflow::SaveSliceInfoDef* unsafe_arena_release_save_slice_info_def(); + + // bool is_resource = 5; + void clear_is_resource(); + static const int kIsResourceFieldNumber = 5; + bool is_resource() const; + void set_is_resource(bool value); + + // bool trainable = 7; + void clear_trainable(); + static const int kTrainableFieldNumber = 7; + bool trainable() const; + void set_trainable(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VariableDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr variable_name_; + ::google::protobuf::internal::ArenaStringPtr initializer_name_; + ::google::protobuf::internal::ArenaStringPtr snapshot_name_; + ::google::protobuf::internal::ArenaStringPtr initial_value_name_; + ::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def_; + bool is_resource_; + bool trainable_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SaveSliceInfoDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SaveSliceInfoDef) */ { + public: + SaveSliceInfoDef(); + virtual ~SaveSliceInfoDef(); + + SaveSliceInfoDef(const SaveSliceInfoDef& from); + + inline SaveSliceInfoDef& operator=(const SaveSliceInfoDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SaveSliceInfoDef(SaveSliceInfoDef&& from) noexcept + : SaveSliceInfoDef() { + *this = ::std::move(from); + } + + inline SaveSliceInfoDef& operator=(SaveSliceInfoDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SaveSliceInfoDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SaveSliceInfoDef* internal_default_instance() { + return reinterpret_cast( + &_SaveSliceInfoDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(SaveSliceInfoDef* other); + void Swap(SaveSliceInfoDef* other); + friend void swap(SaveSliceInfoDef& a, SaveSliceInfoDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SaveSliceInfoDef* New() const final { + return CreateMaybeMessage(NULL); + } + + SaveSliceInfoDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SaveSliceInfoDef& from); + void MergeFrom(const SaveSliceInfoDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SaveSliceInfoDef* other); + protected: + explicit SaveSliceInfoDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 full_shape = 2; + int full_shape_size() const; + void clear_full_shape(); + static const int kFullShapeFieldNumber = 2; + ::google::protobuf::int64 full_shape(int index) const; + void set_full_shape(int index, ::google::protobuf::int64 value); + void add_full_shape(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + full_shape() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_full_shape(); + + // repeated int64 var_offset = 3; + int var_offset_size() const; + void clear_var_offset(); + static const int kVarOffsetFieldNumber = 3; + ::google::protobuf::int64 var_offset(int index) const; + void set_var_offset(int index, ::google::protobuf::int64 value); + void add_var_offset(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + var_offset() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_var_offset(); + + // repeated int64 var_shape = 4; + int var_shape_size() const; + void clear_var_shape(); + static const int kVarShapeFieldNumber = 4; + ::google::protobuf::int64 var_shape(int index) const; + void set_var_shape(int index, ::google::protobuf::int64 value); + void add_var_shape(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + var_shape() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_var_shape(); + + // string full_name = 1; + void clear_full_name(); + static const int kFullNameFieldNumber = 1; + const ::std::string& full_name() const; + void set_full_name(const ::std::string& value); + #if LANG_CXX11 + void set_full_name(::std::string&& value); + #endif + void set_full_name(const char* value); + void set_full_name(const char* value, size_t size); + ::std::string* mutable_full_name(); + ::std::string* release_full_name(); + void set_allocated_full_name(::std::string* full_name); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_full_name(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_full_name( + ::std::string* full_name); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SaveSliceInfoDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > full_shape_; + mutable int _full_shape_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > var_offset_; + mutable int _var_offset_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > var_shape_; + mutable int _var_shape_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr full_name_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// VariableDef + +// string variable_name = 1; +inline void VariableDef::clear_variable_name() { + variable_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VariableDef::variable_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.variable_name) + return variable_name_.Get(); +} +inline void VariableDef::set_variable_name(const ::std::string& value) { + + variable_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.variable_name) +} +#if LANG_CXX11 +inline void VariableDef::set_variable_name(::std::string&& value) { + + variable_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.variable_name) +} +#endif +inline void VariableDef::set_variable_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + variable_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.variable_name) +} +inline void VariableDef::set_variable_name(const char* value, + size_t size) { + + variable_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.variable_name) +} +inline ::std::string* VariableDef::mutable_variable_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.variable_name) + return variable_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VariableDef::release_variable_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.variable_name) + + return variable_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VariableDef::set_allocated_variable_name(::std::string* variable_name) { + if (variable_name != NULL) { + + } else { + + } + variable_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), variable_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.variable_name) +} +inline ::std::string* VariableDef::unsafe_arena_release_variable_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.variable_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return variable_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VariableDef::unsafe_arena_set_allocated_variable_name( + ::std::string* variable_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (variable_name != NULL) { + + } else { + + } + variable_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + variable_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.variable_name) +} + +// string initial_value_name = 6; +inline void VariableDef::clear_initial_value_name() { + initial_value_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VariableDef::initial_value_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.initial_value_name) + return initial_value_name_.Get(); +} +inline void VariableDef::set_initial_value_name(const ::std::string& value) { + + initial_value_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.initial_value_name) +} +#if LANG_CXX11 +inline void VariableDef::set_initial_value_name(::std::string&& value) { + + initial_value_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.initial_value_name) +} +#endif +inline void VariableDef::set_initial_value_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + initial_value_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.initial_value_name) +} +inline void VariableDef::set_initial_value_name(const char* value, + size_t size) { + + initial_value_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.initial_value_name) +} +inline ::std::string* VariableDef::mutable_initial_value_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.initial_value_name) + return initial_value_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VariableDef::release_initial_value_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.initial_value_name) + + return initial_value_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VariableDef::set_allocated_initial_value_name(::std::string* initial_value_name) { + if (initial_value_name != NULL) { + + } else { + + } + initial_value_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), initial_value_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.initial_value_name) +} +inline ::std::string* VariableDef::unsafe_arena_release_initial_value_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.initial_value_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return initial_value_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VariableDef::unsafe_arena_set_allocated_initial_value_name( + ::std::string* initial_value_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (initial_value_name != NULL) { + + } else { + + } + initial_value_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + initial_value_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.initial_value_name) +} + +// string initializer_name = 2; +inline void VariableDef::clear_initializer_name() { + initializer_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VariableDef::initializer_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.initializer_name) + return initializer_name_.Get(); +} +inline void VariableDef::set_initializer_name(const ::std::string& value) { + + initializer_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.initializer_name) +} +#if LANG_CXX11 +inline void VariableDef::set_initializer_name(::std::string&& value) { + + initializer_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.initializer_name) +} +#endif +inline void VariableDef::set_initializer_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + initializer_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.initializer_name) +} +inline void VariableDef::set_initializer_name(const char* value, + size_t size) { + + initializer_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.initializer_name) +} +inline ::std::string* VariableDef::mutable_initializer_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.initializer_name) + return initializer_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VariableDef::release_initializer_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.initializer_name) + + return initializer_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VariableDef::set_allocated_initializer_name(::std::string* initializer_name) { + if (initializer_name != NULL) { + + } else { + + } + initializer_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), initializer_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.initializer_name) +} +inline ::std::string* VariableDef::unsafe_arena_release_initializer_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.initializer_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return initializer_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VariableDef::unsafe_arena_set_allocated_initializer_name( + ::std::string* initializer_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (initializer_name != NULL) { + + } else { + + } + initializer_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + initializer_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.initializer_name) +} + +// string snapshot_name = 3; +inline void VariableDef::clear_snapshot_name() { + snapshot_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& VariableDef::snapshot_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.snapshot_name) + return snapshot_name_.Get(); +} +inline void VariableDef::set_snapshot_name(const ::std::string& value) { + + snapshot_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.snapshot_name) +} +#if LANG_CXX11 +inline void VariableDef::set_snapshot_name(::std::string&& value) { + + snapshot_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.snapshot_name) +} +#endif +inline void VariableDef::set_snapshot_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + snapshot_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.snapshot_name) +} +inline void VariableDef::set_snapshot_name(const char* value, + size_t size) { + + snapshot_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.snapshot_name) +} +inline ::std::string* VariableDef::mutable_snapshot_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.snapshot_name) + return snapshot_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* VariableDef::release_snapshot_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.snapshot_name) + + return snapshot_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void VariableDef::set_allocated_snapshot_name(::std::string* snapshot_name) { + if (snapshot_name != NULL) { + + } else { + + } + snapshot_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), snapshot_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.snapshot_name) +} +inline ::std::string* VariableDef::unsafe_arena_release_snapshot_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.snapshot_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return snapshot_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void VariableDef::unsafe_arena_set_allocated_snapshot_name( + ::std::string* snapshot_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (snapshot_name != NULL) { + + } else { + + } + snapshot_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + snapshot_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.snapshot_name) +} + +// .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4; +inline bool VariableDef::has_save_slice_info_def() const { + return this != internal_default_instance() && save_slice_info_def_ != NULL; +} +inline void VariableDef::clear_save_slice_info_def() { + if (GetArenaNoVirtual() == NULL && save_slice_info_def_ != NULL) { + delete save_slice_info_def_; + } + save_slice_info_def_ = NULL; +} +inline const ::diplomacy::tensorflow::SaveSliceInfoDef& VariableDef::_internal_save_slice_info_def() const { + return *save_slice_info_def_; +} +inline const ::diplomacy::tensorflow::SaveSliceInfoDef& VariableDef::save_slice_info_def() const { + const ::diplomacy::tensorflow::SaveSliceInfoDef* p = save_slice_info_def_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.save_slice_info_def) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_SaveSliceInfoDef_default_instance_); +} +inline ::diplomacy::tensorflow::SaveSliceInfoDef* VariableDef::release_save_slice_info_def() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.save_slice_info_def) + + ::diplomacy::tensorflow::SaveSliceInfoDef* temp = save_slice_info_def_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + save_slice_info_def_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SaveSliceInfoDef* VariableDef::unsafe_arena_release_save_slice_info_def() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.save_slice_info_def) + + ::diplomacy::tensorflow::SaveSliceInfoDef* temp = save_slice_info_def_; + save_slice_info_def_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SaveSliceInfoDef* VariableDef::mutable_save_slice_info_def() { + + if (save_slice_info_def_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::SaveSliceInfoDef>(GetArenaNoVirtual()); + save_slice_info_def_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.save_slice_info_def) + return save_slice_info_def_; +} +inline void VariableDef::set_allocated_save_slice_info_def(::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete save_slice_info_def_; + } + if (save_slice_info_def) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(save_slice_info_def); + if (message_arena != submessage_arena) { + save_slice_info_def = ::google::protobuf::internal::GetOwnedMessage( + message_arena, save_slice_info_def, submessage_arena); + } + + } else { + + } + save_slice_info_def_ = save_slice_info_def; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.save_slice_info_def) +} + +// bool is_resource = 5; +inline void VariableDef::clear_is_resource() { + is_resource_ = false; +} +inline bool VariableDef::is_resource() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.is_resource) + return is_resource_; +} +inline void VariableDef::set_is_resource(bool value) { + + is_resource_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.is_resource) +} + +// bool trainable = 7; +inline void VariableDef::clear_trainable() { + trainable_ = false; +} +inline bool VariableDef::trainable() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.trainable) + return trainable_; +} +inline void VariableDef::set_trainable(bool value) { + + trainable_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.trainable) +} + +// ------------------------------------------------------------------- + +// SaveSliceInfoDef + +// string full_name = 1; +inline void SaveSliceInfoDef::clear_full_name() { + full_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& SaveSliceInfoDef::full_name() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.full_name) + return full_name_.Get(); +} +inline void SaveSliceInfoDef::set_full_name(const ::std::string& value) { + + full_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.full_name) +} +#if LANG_CXX11 +inline void SaveSliceInfoDef::set_full_name(::std::string&& value) { + + full_name_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SaveSliceInfoDef.full_name) +} +#endif +inline void SaveSliceInfoDef::set_full_name(const char* value) { + GOOGLE_DCHECK(value != NULL); + + full_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SaveSliceInfoDef.full_name) +} +inline void SaveSliceInfoDef::set_full_name(const char* value, + size_t size) { + + full_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SaveSliceInfoDef.full_name) +} +inline ::std::string* SaveSliceInfoDef::mutable_full_name() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SaveSliceInfoDef.full_name) + return full_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* SaveSliceInfoDef::release_full_name() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SaveSliceInfoDef.full_name) + + return full_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void SaveSliceInfoDef::set_allocated_full_name(::std::string* full_name) { + if (full_name != NULL) { + + } else { + + } + full_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), full_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SaveSliceInfoDef.full_name) +} +inline ::std::string* SaveSliceInfoDef::unsafe_arena_release_full_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SaveSliceInfoDef.full_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return full_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void SaveSliceInfoDef::unsafe_arena_set_allocated_full_name( + ::std::string* full_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (full_name != NULL) { + + } else { + + } + full_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + full_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SaveSliceInfoDef.full_name) +} + +// repeated int64 full_shape = 2; +inline int SaveSliceInfoDef::full_shape_size() const { + return full_shape_.size(); +} +inline void SaveSliceInfoDef::clear_full_shape() { + full_shape_.Clear(); +} +inline ::google::protobuf::int64 SaveSliceInfoDef::full_shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.full_shape) + return full_shape_.Get(index); +} +inline void SaveSliceInfoDef::set_full_shape(int index, ::google::protobuf::int64 value) { + full_shape_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.full_shape) +} +inline void SaveSliceInfoDef::add_full_shape(::google::protobuf::int64 value) { + full_shape_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.SaveSliceInfoDef.full_shape) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +SaveSliceInfoDef::full_shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.SaveSliceInfoDef.full_shape) + return full_shape_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +SaveSliceInfoDef::mutable_full_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.SaveSliceInfoDef.full_shape) + return &full_shape_; +} + +// repeated int64 var_offset = 3; +inline int SaveSliceInfoDef::var_offset_size() const { + return var_offset_.size(); +} +inline void SaveSliceInfoDef::clear_var_offset() { + var_offset_.Clear(); +} +inline ::google::protobuf::int64 SaveSliceInfoDef::var_offset(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.var_offset) + return var_offset_.Get(index); +} +inline void SaveSliceInfoDef::set_var_offset(int index, ::google::protobuf::int64 value) { + var_offset_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.var_offset) +} +inline void SaveSliceInfoDef::add_var_offset(::google::protobuf::int64 value) { + var_offset_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.SaveSliceInfoDef.var_offset) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +SaveSliceInfoDef::var_offset() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.SaveSliceInfoDef.var_offset) + return var_offset_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +SaveSliceInfoDef::mutable_var_offset() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.SaveSliceInfoDef.var_offset) + return &var_offset_; +} + +// repeated int64 var_shape = 4; +inline int SaveSliceInfoDef::var_shape_size() const { + return var_shape_.size(); +} +inline void SaveSliceInfoDef::clear_var_shape() { + var_shape_.Clear(); +} +inline ::google::protobuf::int64 SaveSliceInfoDef::var_shape(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.var_shape) + return var_shape_.Get(index); +} +inline void SaveSliceInfoDef::set_var_shape(int index, ::google::protobuf::int64 value) { + var_shape_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.var_shape) +} +inline void SaveSliceInfoDef::add_var_shape(::google::protobuf::int64 value) { + var_shape_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.SaveSliceInfoDef.var_shape) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +SaveSliceInfoDef::var_shape() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.SaveSliceInfoDef.var_shape) + return var_shape_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +SaveSliceInfoDef::mutable_var_shape() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.SaveSliceInfoDef.var_shape) + return &var_shape_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.proto new file mode 100644 index 0000000..e1698b0 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "VariableProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +// Protocol buffer representing a Variable. +message VariableDef { + // Name of the variable tensor. + string variable_name = 1; + + // Name of the tensor holding the variable's initial value. + string initial_value_name = 6; + + // Name of the initializer op. + string initializer_name = 2; + + // Name of the snapshot tensor. + string snapshot_name = 3; + + // Support for saving variables as slices of a larger variable. + SaveSliceInfoDef save_slice_info_def = 4; + + // Whether to represent this as a ResourceVariable. + bool is_resource = 5; + + // Whether this variable should be trained. + bool trainable = 7; +} + +message SaveSliceInfoDef { + // Name of the full variable of which this is a slice. + string full_name = 1; + // Shape of the full variable. + repeated int64 full_shape = 2; + // Offset of this variable into the full variable. + repeated int64 var_offset = 3; + // Shape of this variable. + repeated int64 var_shape = 4; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable_pb2.py new file mode 100644 index 0000000..749874c --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/variable_pb2.py @@ -0,0 +1,173 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/variable.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/variable.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\016VariableProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n2diplomacy_tensorflow/core/framework/variable.proto\x12\x14\x64iplomacy.tensorflow\"\xde\x01\n\x0bVariableDef\x12\x15\n\rvariable_name\x18\x01 \x01(\t\x12\x1a\n\x12initial_value_name\x18\x06 \x01(\t\x12\x18\n\x10initializer_name\x18\x02 \x01(\t\x12\x15\n\rsnapshot_name\x18\x03 \x01(\t\x12\x43\n\x13save_slice_info_def\x18\x04 \x01(\x0b\x32&.diplomacy.tensorflow.SaveSliceInfoDef\x12\x13\n\x0bis_resource\x18\x05 \x01(\x08\x12\x11\n\ttrainable\x18\x07 \x01(\x08\"`\n\x10SaveSliceInfoDef\x12\x11\n\tfull_name\x18\x01 \x01(\t\x12\x12\n\nfull_shape\x18\x02 \x03(\x03\x12\x12\n\nvar_offset\x18\x03 \x03(\x03\x12\x11\n\tvar_shape\x18\x04 \x03(\x03\x42n\n\x18org.tensorflow.frameworkB\x0eVariableProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_VARIABLEDEF = _descriptor.Descriptor( + name='VariableDef', + full_name='diplomacy.tensorflow.VariableDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='variable_name', full_name='diplomacy.tensorflow.VariableDef.variable_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initial_value_name', full_name='diplomacy.tensorflow.VariableDef.initial_value_name', index=1, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='initializer_name', full_name='diplomacy.tensorflow.VariableDef.initializer_name', index=2, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='snapshot_name', full_name='diplomacy.tensorflow.VariableDef.snapshot_name', index=3, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='save_slice_info_def', full_name='diplomacy.tensorflow.VariableDef.save_slice_info_def', index=4, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_resource', full_name='diplomacy.tensorflow.VariableDef.is_resource', index=5, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='trainable', full_name='diplomacy.tensorflow.VariableDef.trainable', index=6, + number=7, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=77, + serialized_end=299, +) + + +_SAVESLICEINFODEF = _descriptor.Descriptor( + name='SaveSliceInfoDef', + full_name='diplomacy.tensorflow.SaveSliceInfoDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='full_name', full_name='diplomacy.tensorflow.SaveSliceInfoDef.full_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='full_shape', full_name='diplomacy.tensorflow.SaveSliceInfoDef.full_shape', index=1, + number=2, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='var_offset', full_name='diplomacy.tensorflow.SaveSliceInfoDef.var_offset', index=2, + number=3, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='var_shape', full_name='diplomacy.tensorflow.SaveSliceInfoDef.var_shape', index=3, + number=4, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=301, + serialized_end=397, +) + +_VARIABLEDEF.fields_by_name['save_slice_info_def'].message_type = _SAVESLICEINFODEF +DESCRIPTOR.message_types_by_name['VariableDef'] = _VARIABLEDEF +DESCRIPTOR.message_types_by_name['SaveSliceInfoDef'] = _SAVESLICEINFODEF +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +VariableDef = _reflection.GeneratedProtocolMessageType('VariableDef', (_message.Message,), dict( + DESCRIPTOR = _VARIABLEDEF, + __module__ = 'diplomacy_tensorflow.core.framework.variable_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VariableDef) + )) +_sym_db.RegisterMessage(VariableDef) + +SaveSliceInfoDef = _reflection.GeneratedProtocolMessageType('SaveSliceInfoDef', (_message.Message,), dict( + DESCRIPTOR = _SAVESLICEINFODEF, + __module__ = 'diplomacy_tensorflow.core.framework.variable_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SaveSliceInfoDef) + )) +_sym_db.RegisterMessage(SaveSliceInfoDef) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.pb.cc new file mode 100644 index 0000000..acec4d4 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.pb.cc @@ -0,0 +1,490 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/versions.proto + +#include "diplomacy_tensorflow/core/framework/versions.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +class VersionDefDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _VersionDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto { +static void InitDefaultsVersionDef() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_VersionDef_default_instance_; + new (ptr) ::diplomacy::tensorflow::VersionDef(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::VersionDef::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_VersionDef = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsVersionDef}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_VersionDef.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VersionDef, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VersionDef, producer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VersionDef, min_consumer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::VersionDef, bad_consumers_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::VersionDef)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_VersionDef_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/framework/versions.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n2diplomacy_tensorflow/core/framework/ve" + "rsions.proto\022\024diplomacy.tensorflow\"K\n\nVe" + "rsionDef\022\020\n\010producer\030\001 \001(\005\022\024\n\014min_consum" + "er\030\002 \001(\005\022\025\n\rbad_consumers\030\003 \003(\005Bn\n\030org.t" + "ensorflow.frameworkB\016VersionsProtosP\001Z=g" + "ithub.com/tensorflow/tensorflow/tensorfl" + "ow/go/core/framework\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 271); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/framework/versions.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void VersionDef::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int VersionDef::kProducerFieldNumber; +const int VersionDef::kMinConsumerFieldNumber; +const int VersionDef::kBadConsumersFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +VersionDef::VersionDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::scc_info_VersionDef.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.VersionDef) +} +VersionDef::VersionDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + bad_consumers_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::scc_info_VersionDef.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.VersionDef) +} +VersionDef::VersionDef(const VersionDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + bad_consumers_(from.bad_consumers_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&producer_, &from.producer_, + static_cast(reinterpret_cast(&min_consumer_) - + reinterpret_cast(&producer_)) + sizeof(min_consumer_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.VersionDef) +} + +void VersionDef::SharedCtor() { + ::memset(&producer_, 0, static_cast( + reinterpret_cast(&min_consumer_) - + reinterpret_cast(&producer_)) + sizeof(min_consumer_)); +} + +VersionDef::~VersionDef() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.VersionDef) + SharedDtor(); +} + +void VersionDef::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void VersionDef::ArenaDtor(void* object) { + VersionDef* _this = reinterpret_cast< VersionDef* >(object); + (void)_this; +} +void VersionDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void VersionDef::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* VersionDef::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const VersionDef& VersionDef::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::scc_info_VersionDef.base); + return *internal_default_instance(); +} + + +void VersionDef::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.VersionDef) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + bad_consumers_.Clear(); + ::memset(&producer_, 0, static_cast( + reinterpret_cast(&min_consumer_) - + reinterpret_cast(&producer_)) + sizeof(min_consumer_)); + _internal_metadata_.Clear(); +} + +bool VersionDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.VersionDef) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 producer = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &producer_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 min_consumer = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_consumer_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated int32 bad_consumers = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_bad_consumers()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 26u, input, this->mutable_bad_consumers()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.VersionDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.VersionDef) + return false; +#undef DO_ +} + +void VersionDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.VersionDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 producer = 1; + if (this->producer() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->producer(), output); + } + + // int32 min_consumer = 2; + if (this->min_consumer() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->min_consumer(), output); + } + + // repeated int32 bad_consumers = 3; + if (this->bad_consumers_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _bad_consumers_cached_byte_size_)); + } + for (int i = 0, n = this->bad_consumers_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->bad_consumers(i), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.VersionDef) +} + +::google::protobuf::uint8* VersionDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.VersionDef) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 producer = 1; + if (this->producer() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->producer(), target); + } + + // int32 min_consumer = 2; + if (this->min_consumer() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->min_consumer(), target); + } + + // repeated int32 bad_consumers = 3; + if (this->bad_consumers_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _bad_consumers_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->bad_consumers_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.VersionDef) + return target; +} + +size_t VersionDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.VersionDef) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 bad_consumers = 3; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->bad_consumers_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _bad_consumers_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int32 producer = 1; + if (this->producer() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->producer()); + } + + // int32 min_consumer = 2; + if (this->min_consumer() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->min_consumer()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void VersionDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.VersionDef) + GOOGLE_DCHECK_NE(&from, this); + const VersionDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.VersionDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.VersionDef) + MergeFrom(*source); + } +} + +void VersionDef::MergeFrom(const VersionDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.VersionDef) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + bad_consumers_.MergeFrom(from.bad_consumers_); + if (from.producer() != 0) { + set_producer(from.producer()); + } + if (from.min_consumer() != 0) { + set_min_consumer(from.min_consumer()); + } +} + +void VersionDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.VersionDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void VersionDef::CopyFrom(const VersionDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.VersionDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool VersionDef::IsInitialized() const { + return true; +} + +void VersionDef::Swap(VersionDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + VersionDef* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void VersionDef::UnsafeArenaSwap(VersionDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void VersionDef::InternalSwap(VersionDef* other) { + using std::swap; + bad_consumers_.InternalSwap(&other->bad_consumers_); + swap(producer_, other->producer_); + swap(min_consumer_, other->min_consumer_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata VersionDef::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::VersionDef* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::VersionDef >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::VersionDef >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.pb.h new file mode 100644 index 0000000..847d6ba --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.pb.h @@ -0,0 +1,282 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/framework/versions.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto +namespace diplomacy { +namespace tensorflow { +class VersionDef; +class VersionDefDefaultTypeInternal; +extern VersionDefDefaultTypeInternal _VersionDef_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::VersionDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::VersionDef>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class VersionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.VersionDef) */ { + public: + VersionDef(); + virtual ~VersionDef(); + + VersionDef(const VersionDef& from); + + inline VersionDef& operator=(const VersionDef& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + VersionDef(VersionDef&& from) noexcept + : VersionDef() { + *this = ::std::move(from); + } + + inline VersionDef& operator=(VersionDef&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const VersionDef& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const VersionDef* internal_default_instance() { + return reinterpret_cast( + &_VersionDef_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(VersionDef* other); + void Swap(VersionDef* other); + friend void swap(VersionDef& a, VersionDef& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline VersionDef* New() const final { + return CreateMaybeMessage(NULL); + } + + VersionDef* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const VersionDef& from); + void MergeFrom(const VersionDef& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(VersionDef* other); + protected: + explicit VersionDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 bad_consumers = 3; + int bad_consumers_size() const; + void clear_bad_consumers(); + static const int kBadConsumersFieldNumber = 3; + ::google::protobuf::int32 bad_consumers(int index) const; + void set_bad_consumers(int index, ::google::protobuf::int32 value); + void add_bad_consumers(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + bad_consumers() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_bad_consumers(); + + // int32 producer = 1; + void clear_producer(); + static const int kProducerFieldNumber = 1; + ::google::protobuf::int32 producer() const; + void set_producer(::google::protobuf::int32 value); + + // int32 min_consumer = 2; + void clear_min_consumer(); + static const int kMinConsumerFieldNumber = 2; + ::google::protobuf::int32 min_consumer() const; + void set_min_consumer(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VersionDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > bad_consumers_; + mutable int _bad_consumers_cached_byte_size_; + ::google::protobuf::int32 producer_; + ::google::protobuf::int32 min_consumer_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// VersionDef + +// int32 producer = 1; +inline void VersionDef::clear_producer() { + producer_ = 0; +} +inline ::google::protobuf::int32 VersionDef::producer() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VersionDef.producer) + return producer_; +} +inline void VersionDef::set_producer(::google::protobuf::int32 value) { + + producer_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VersionDef.producer) +} + +// int32 min_consumer = 2; +inline void VersionDef::clear_min_consumer() { + min_consumer_ = 0; +} +inline ::google::protobuf::int32 VersionDef::min_consumer() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VersionDef.min_consumer) + return min_consumer_; +} +inline void VersionDef::set_min_consumer(::google::protobuf::int32 value) { + + min_consumer_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VersionDef.min_consumer) +} + +// repeated int32 bad_consumers = 3; +inline int VersionDef::bad_consumers_size() const { + return bad_consumers_.size(); +} +inline void VersionDef::clear_bad_consumers() { + bad_consumers_.Clear(); +} +inline ::google::protobuf::int32 VersionDef::bad_consumers(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VersionDef.bad_consumers) + return bad_consumers_.Get(index); +} +inline void VersionDef::set_bad_consumers(int index, ::google::protobuf::int32 value) { + bad_consumers_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VersionDef.bad_consumers) +} +inline void VersionDef::add_bad_consumers(::google::protobuf::int32 value) { + bad_consumers_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.VersionDef.bad_consumers) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +VersionDef::bad_consumers() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.VersionDef.bad_consumers) + return bad_consumers_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +VersionDef::mutable_bad_consumers() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.VersionDef.bad_consumers) + return &bad_consumers_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fversions_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.proto new file mode 100644 index 0000000..3e3a1a6 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "VersionsProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework"; + +// 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 +// +message VersionDef { + // The version of the code that produced this data. + int32 producer = 1; + + // Any consumer below this version is not allowed to consume this data. + int32 min_consumer = 2; + + // Specific consumer versions which are disallowed (e.g. due to bugs). + repeated int32 bad_consumers = 3; +}; diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions_pb2.py new file mode 100644 index 0000000..d2f076f --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/framework/versions_pb2.py @@ -0,0 +1,84 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/framework/versions.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/framework/versions.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\016VersionsProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n2diplomacy_tensorflow/core/framework/versions.proto\x12\x14\x64iplomacy.tensorflow\"K\n\nVersionDef\x12\x10\n\x08producer\x18\x01 \x01(\x05\x12\x14\n\x0cmin_consumer\x18\x02 \x01(\x05\x12\x15\n\rbad_consumers\x18\x03 \x03(\x05\x42n\n\x18org.tensorflow.frameworkB\x0eVersionsProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_VERSIONDEF = _descriptor.Descriptor( + name='VersionDef', + full_name='diplomacy.tensorflow.VersionDef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='producer', full_name='diplomacy.tensorflow.VersionDef.producer', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_consumer', full_name='diplomacy.tensorflow.VersionDef.min_consumer', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bad_consumers', full_name='diplomacy.tensorflow.VersionDef.bad_consumers', index=2, + number=3, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=76, + serialized_end=151, +) + +DESCRIPTOR.message_types_by_name['VersionDef'] = _VERSIONDEF +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +VersionDef = _reflection.GeneratedProtocolMessageType('VersionDef', (_message.Message,), dict( + DESCRIPTOR = _VERSIONDEF, + __module__ = 'diplomacy_tensorflow.core.framework.versions_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VersionDef) + )) +_sym_db.RegisterMessage(VersionDef) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.pb.cc new file mode 100644 index 0000000..67e5615 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.pb.cc @@ -0,0 +1,3926 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto + +#include "diplomacy_tensorflow/core/grappler/costs/op_performance_data.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_AttrValue; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_TensorProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapeProto; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_LogNormalDistribution; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_NormalDistribution; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_OpPerformance_OpMemory; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SessionInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_OpInfo_AttrEntry_DoNotUse; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_OpInfo_TensorProperties; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<4> scc_info_OpInfo; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto ::google::protobuf::internal::SCCInfo<5> scc_info_OpPerformance; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_DeviceProperties; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto +namespace diplomacy { +namespace tensorflow { +class SessionInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SessionInfo_default_instance_; +class OpInfo_AttrEntry_DoNotUseDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpInfo_AttrEntry_DoNotUse_default_instance_; +class OpInfo_TensorPropertiesDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpInfo_TensorProperties_default_instance_; +class OpInfoDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpInfo_default_instance_; +class NormalDistributionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NormalDistribution_default_instance_; +class LogNormalDistributionDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _LogNormalDistribution_default_instance_; +class OpPerformance_OpMemoryDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpPerformance_OpMemory_default_instance_; +class OpPerformanceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::NormalDistribution* execution_time_normal_; + const ::diplomacy::tensorflow::LogNormalDistribution* execution_time_log_normal_; +} _OpPerformance_default_instance_; +class OpPerformanceListDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _OpPerformanceList_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto { +static void InitDefaultsSessionInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_SessionInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::SessionInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::SessionInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SessionInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSessionInfo}, {}}; + +static void InitDefaultsOpInfo_AttrEntry_DoNotUse() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpInfo_AttrEntry_DoNotUse_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse(); + } + ::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_OpInfo_AttrEntry_DoNotUse = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsOpInfo_AttrEntry_DoNotUse}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::scc_info_AttrValue.base,}}; + +static void InitDefaultsOpInfo_TensorProperties() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpInfo_TensorProperties_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpInfo_TensorProperties(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpInfo_TensorProperties::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_OpInfo_TensorProperties = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsOpInfo_TensorProperties}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::scc_info_TensorShapeProto.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::scc_info_TensorProto.base,}}; + +static void InitDefaultsOpInfo() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpInfo_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpInfo(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpInfo::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<4> scc_info_OpInfo = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsOpInfo}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo_AttrEntry_DoNotUse.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo_TensorProperties.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto::scc_info_DeviceProperties.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_SessionInfo.base,}}; + +static void InitDefaultsNormalDistribution() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_NormalDistribution_default_instance_; + new (ptr) ::diplomacy::tensorflow::NormalDistribution(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::NormalDistribution::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_NormalDistribution = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsNormalDistribution}, {}}; + +static void InitDefaultsLogNormalDistribution() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_LogNormalDistribution_default_instance_; + new (ptr) ::diplomacy::tensorflow::LogNormalDistribution(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::LogNormalDistribution::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_LogNormalDistribution = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsLogNormalDistribution}, {}}; + +static void InitDefaultsOpPerformance_OpMemory() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpPerformance_OpMemory_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpPerformance_OpMemory(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpPerformance_OpMemory::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_OpPerformance_OpMemory = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsOpPerformance_OpMemory}, {}}; + +static void InitDefaultsOpPerformance() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpPerformance_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpPerformance(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpPerformance::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<5> scc_info_OpPerformance = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 5, InitDefaultsOpPerformance}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_SessionInfo.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_NormalDistribution.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_LogNormalDistribution.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance_OpMemory.base,}}; + +static void InitDefaultsOpPerformanceList() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::_OpPerformanceList_default_instance_; + new (ptr) ::diplomacy::tensorflow::OpPerformanceList(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::OpPerformanceList::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_OpPerformanceList = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsOpPerformanceList}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_SessionInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpInfo_AttrEntry_DoNotUse.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpInfo_TensorProperties.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpInfo.base); + ::google::protobuf::internal::InitSCC(&scc_info_NormalDistribution.base); + ::google::protobuf::internal::InitSCC(&scc_info_LogNormalDistribution.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpPerformance_OpMemory.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpPerformance.base); + ::google::protobuf::internal::InitSCC(&scc_info_OpPerformanceList.base); +} + +::google::protobuf::Metadata file_level_metadata[9]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SessionInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::SessionInfo, intra_op_parallelism_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_TensorProperties, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_TensorProperties, dtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_TensorProperties, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo_TensorProperties, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo, op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo, attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo, inputs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo, outputs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo, device_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpInfo, session_info_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NormalDistribution, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NormalDistribution, mu_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::NormalDistribution, sigma_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::LogNormalDistribution, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::LogNormalDistribution, mu_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::LogNormalDistribution, sigma_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance_OpMemory, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance_OpMemory, output_memory_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance_OpMemory, temp_memory_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance_OpMemory, persistent_memory_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance_OpMemory, device_temp_memory_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance_OpMemory, device_persistent_memory_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, session_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, node_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, temporary_memory_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, compute_cost_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, compute_time_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, memory_time_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, compute_efficiency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, memory_efficiency_), + offsetof(::diplomacy::tensorflow::OpPerformanceDefaultTypeInternal, execution_time_normal_), + offsetof(::diplomacy::tensorflow::OpPerformanceDefaultTypeInternal, execution_time_log_normal_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, op_memory_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformance, execution_time_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformanceList, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::OpPerformanceList, op_performance_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::SessionInfo)}, + { 6, 13, sizeof(::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse)}, + { 15, -1, sizeof(::diplomacy::tensorflow::OpInfo_TensorProperties)}, + { 23, -1, sizeof(::diplomacy::tensorflow::OpInfo)}, + { 34, -1, sizeof(::diplomacy::tensorflow::NormalDistribution)}, + { 41, -1, sizeof(::diplomacy::tensorflow::LogNormalDistribution)}, + { 48, -1, sizeof(::diplomacy::tensorflow::OpPerformance_OpMemory)}, + { 58, -1, sizeof(::diplomacy::tensorflow::OpPerformance)}, + { 76, -1, sizeof(::diplomacy::tensorflow::OpPerformanceList)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::_SessionInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpInfo_AttrEntry_DoNotUse_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpInfo_TensorProperties_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpInfo_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_NormalDistribution_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_LogNormalDistribution_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpPerformance_OpMemory_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpPerformance_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::_OpPerformanceList_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 9); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nBdiplomacy_tensorflow/core/grappler/cos" + "ts/op_performance_data.proto\022\024diplomacy." + "tensorflow\0320diplomacy_tensorflow/core/fr" + "amework/tensor.proto\0326diplomacy_tensorfl" + "ow/core/framework/tensor_shape.proto\032/di" + "plomacy_tensorflow/core/framework/types." + "proto\0324diplomacy_tensorflow/core/framewo" + "rk/attr_value.proto\032:diplomacy_tensorflo" + "w/core/protobuf/device_properties.proto\"" + "+\n\013SessionInfo\022\034\n\024intra_op_parallelism\030\001" + " \001(\003\"\265\004\n\006OpInfo\022\n\n\002op\030\001 \001(\t\0224\n\004attr\030\002 \003(" + "\0132&.diplomacy.tensorflow.OpInfo.AttrEntr" + "y\022=\n\006inputs\030\003 \003(\0132-.diplomacy.tensorflow" + ".OpInfo.TensorProperties\022>\n\007outputs\030\005 \003(" + "\0132-.diplomacy.tensorflow.OpInfo.TensorPr" + "operties\0226\n\006device\030\004 \001(\0132&.diplomacy.ten" + "sorflow.DeviceProperties\0227\n\014session_info" + "\030\006 \001(\0132!.diplomacy.tensorflow.SessionInf" + "o\032L\n\tAttrEntry\022\013\n\003key\030\001 \001(\t\022.\n\005value\030\002 \001" + "(\0132\037.diplomacy.tensorflow.AttrValue:\0028\001\032" + "\252\001\n\020TensorProperties\022-\n\005dtype\030\001 \001(\0162\036.di" + "plomacy.tensorflow.DataType\0225\n\005shape\030\002 \001" + "(\0132&.diplomacy.tensorflow.TensorShapePro" + "to\0220\n\005value\030\003 \001(\0132!.diplomacy.tensorflow" + ".TensorProto\"/\n\022NormalDistribution\022\n\n\002mu" + "\030\001 \001(\001\022\r\n\005sigma\030\002 \001(\001\"2\n\025LogNormalDistri" + "bution\022\n\n\002mu\030\001 \001(\001\022\r\n\005sigma\030\002 \001(\001\"\245\005\n\rOp" + "Performance\022(\n\002op\030\001 \001(\0132\034.diplomacy.tens" + "orflow.OpInfo\022;\n\014session_info\030\014 \001(\0132!.di" + "plomacy.tensorflow.SessionInfoB\002\030\001\022\014\n\004no" + "de\030\005 \001(\t\022\035\n\025temporary_memory_size\030\002 \001(\003\022" + "\024\n\014compute_cost\030\003 \001(\003\022\024\n\014compute_time\030\006 " + "\001(\003\022\023\n\013memory_time\030\007 \001(\003\022\032\n\022compute_effi" + "ciency\030\004 \001(\001\022\031\n\021memory_efficiency\030\010 \001(\001\022" + "I\n\025execution_time_normal\030\n \001(\0132(.diploma" + "cy.tensorflow.NormalDistributionH\000\022P\n\031ex" + "ecution_time_log_normal\030\013 \001(\0132+.diplomac" + "y.tensorflow.LogNormalDistributionH\000\022\?\n\t" + "op_memory\030\t \001(\0132,.diplomacy.tensorflow.O" + "pPerformance.OpMemory\032\227\001\n\010OpMemory\022\025\n\rou" + "tput_memory\030\001 \003(\003\022\023\n\013temp_memory\030\002 \001(\003\022\031" + "\n\021persistent_memory\030\004 \001(\003\022\036\n\022device_temp" + "_memory\030\003 \001(\003B\002\030\001\022$\n\030device_persistent_m" + "emory\030\005 \001(\003B\002\030\001B\020\n\016execution_time\"P\n\021OpP" + "erformanceList\022;\n\016op_performance\030\001 \003(\0132#" + ".diplomacy.tensorflow.OpPerformanceB\003\370\001\001" + "b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1848); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto", &protobuf_RegisterTypes); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2ftypes_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::AddDescriptors(); + ::protobuf_diplomacy_5ftensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +void SessionInfo::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SessionInfo::kIntraOpParallelismFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SessionInfo::SessionInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_SessionInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.SessionInfo) +} +SessionInfo::SessionInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_SessionInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.SessionInfo) +} +SessionInfo::SessionInfo(const SessionInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + intra_op_parallelism_ = from.intra_op_parallelism_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.SessionInfo) +} + +void SessionInfo::SharedCtor() { + intra_op_parallelism_ = GOOGLE_LONGLONG(0); +} + +SessionInfo::~SessionInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.SessionInfo) + SharedDtor(); +} + +void SessionInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void SessionInfo::ArenaDtor(void* object) { + SessionInfo* _this = reinterpret_cast< SessionInfo* >(object); + (void)_this; +} +void SessionInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SessionInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SessionInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SessionInfo& SessionInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_SessionInfo.base); + return *internal_default_instance(); +} + + +void SessionInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.SessionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + intra_op_parallelism_ = GOOGLE_LONGLONG(0); + _internal_metadata_.Clear(); +} + +bool SessionInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.SessionInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 intra_op_parallelism = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &intra_op_parallelism_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.SessionInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.SessionInfo) + return false; +#undef DO_ +} + +void SessionInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.SessionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 intra_op_parallelism = 1; + if (this->intra_op_parallelism() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->intra_op_parallelism(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.SessionInfo) +} + +::google::protobuf::uint8* SessionInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.SessionInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 intra_op_parallelism = 1; + if (this->intra_op_parallelism() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->intra_op_parallelism(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.SessionInfo) + return target; +} + +size_t SessionInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.SessionInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 intra_op_parallelism = 1; + if (this->intra_op_parallelism() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->intra_op_parallelism()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SessionInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.SessionInfo) + GOOGLE_DCHECK_NE(&from, this); + const SessionInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.SessionInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.SessionInfo) + MergeFrom(*source); + } +} + +void SessionInfo::MergeFrom(const SessionInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.SessionInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.intra_op_parallelism() != 0) { + set_intra_op_parallelism(from.intra_op_parallelism()); + } +} + +void SessionInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.SessionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SessionInfo::CopyFrom(const SessionInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.SessionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SessionInfo::IsInitialized() const { + return true; +} + +void SessionInfo::Swap(SessionInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SessionInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SessionInfo::UnsafeArenaSwap(SessionInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SessionInfo::InternalSwap(SessionInfo* other) { + using std::swap; + swap(intra_op_parallelism_, other->intra_op_parallelism_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SessionInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +OpInfo_AttrEntry_DoNotUse::OpInfo_AttrEntry_DoNotUse() {} +OpInfo_AttrEntry_DoNotUse::OpInfo_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} +void OpInfo_AttrEntry_DoNotUse::MergeFrom(const OpInfo_AttrEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::google::protobuf::Metadata OpInfo_AttrEntry_DoNotUse::GetMetadata() const { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[1]; +} +void OpInfo_AttrEntry_DoNotUse::MergeFrom( + const ::google::protobuf::Message& other) { + ::google::protobuf::Message::MergeFrom(other); +} + + +// =================================================================== + +void OpInfo_TensorProperties::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_OpInfo_TensorProperties_default_instance_._instance.get_mutable()->shape_ = const_cast< ::diplomacy::tensorflow::TensorShapeProto*>( + ::diplomacy::tensorflow::TensorShapeProto::internal_default_instance()); + ::diplomacy::tensorflow::_OpInfo_TensorProperties_default_instance_._instance.get_mutable()->value_ = const_cast< ::diplomacy::tensorflow::TensorProto*>( + ::diplomacy::tensorflow::TensorProto::internal_default_instance()); +} +void OpInfo_TensorProperties::unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape) { + if (GetArenaNoVirtual() == NULL) { + delete shape_; + } + shape_ = shape; + if (shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpInfo.TensorProperties.shape) +} +void OpInfo_TensorProperties::clear_shape() { + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; +} +void OpInfo_TensorProperties::unsafe_arena_set_allocated_value( + ::diplomacy::tensorflow::TensorProto* value) { + if (GetArenaNoVirtual() == NULL) { + delete value_; + } + value_ = value; + if (value) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpInfo.TensorProperties.value) +} +void OpInfo_TensorProperties::clear_value() { + if (GetArenaNoVirtual() == NULL && value_ != NULL) { + delete value_; + } + value_ = NULL; +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpInfo_TensorProperties::kDtypeFieldNumber; +const int OpInfo_TensorProperties::kShapeFieldNumber; +const int OpInfo_TensorProperties::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpInfo_TensorProperties::OpInfo_TensorProperties() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo_TensorProperties.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpInfo.TensorProperties) +} +OpInfo_TensorProperties::OpInfo_TensorProperties(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo_TensorProperties.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpInfo.TensorProperties) +} +OpInfo_TensorProperties::OpInfo_TensorProperties(const OpInfo_TensorProperties& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_shape()) { + shape_ = new ::diplomacy::tensorflow::TensorShapeProto(*from.shape_); + } else { + shape_ = NULL; + } + if (from.has_value()) { + value_ = new ::diplomacy::tensorflow::TensorProto(*from.value_); + } else { + value_ = NULL; + } + dtype_ = from.dtype_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpInfo.TensorProperties) +} + +void OpInfo_TensorProperties::SharedCtor() { + ::memset(&shape_, 0, static_cast( + reinterpret_cast(&dtype_) - + reinterpret_cast(&shape_)) + sizeof(dtype_)); +} + +OpInfo_TensorProperties::~OpInfo_TensorProperties() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpInfo.TensorProperties) + SharedDtor(); +} + +void OpInfo_TensorProperties::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete shape_; + if (this != internal_default_instance()) delete value_; +} + +void OpInfo_TensorProperties::ArenaDtor(void* object) { + OpInfo_TensorProperties* _this = reinterpret_cast< OpInfo_TensorProperties* >(object); + (void)_this; +} +void OpInfo_TensorProperties::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpInfo_TensorProperties::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpInfo_TensorProperties::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpInfo_TensorProperties& OpInfo_TensorProperties::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo_TensorProperties.base); + return *internal_default_instance(); +} + + +void OpInfo_TensorProperties::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpInfo.TensorProperties) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && shape_ != NULL) { + delete shape_; + } + shape_ = NULL; + if (GetArenaNoVirtual() == NULL && value_ != NULL) { + delete value_; + } + value_ = NULL; + dtype_ = 0; + _internal_metadata_.Clear(); +} + +bool OpInfo_TensorProperties::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpInfo.TensorProperties) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.DataType dtype = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::diplomacy::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_shape())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.TensorProto value = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_value())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpInfo.TensorProperties) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpInfo.TensorProperties) + return false; +#undef DO_ +} + +void OpInfo_TensorProperties::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpInfo.TensorProperties) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->dtype(), output); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_shape(), output); + } + + // .diplomacy.tensorflow.TensorProto value = 3; + if (this->has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_value(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpInfo.TensorProperties) +} + +::google::protobuf::uint8* OpInfo_TensorProperties::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpInfo.TensorProperties) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->dtype(), target); + } + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_shape(), deterministic, target); + } + + // .diplomacy.tensorflow.TensorProto value = 3; + if (this->has_value()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_value(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpInfo.TensorProperties) + return target; +} + +size_t OpInfo_TensorProperties::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpInfo.TensorProperties) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + if (this->has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *shape_); + } + + // .diplomacy.tensorflow.TensorProto value = 3; + if (this->has_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *value_); + } + + // .diplomacy.tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpInfo_TensorProperties::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpInfo.TensorProperties) + GOOGLE_DCHECK_NE(&from, this); + const OpInfo_TensorProperties* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpInfo.TensorProperties) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpInfo.TensorProperties) + MergeFrom(*source); + } +} + +void OpInfo_TensorProperties::MergeFrom(const OpInfo_TensorProperties& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpInfo.TensorProperties) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_shape()) { + mutable_shape()->::diplomacy::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + } + if (from.has_value()) { + mutable_value()->::diplomacy::tensorflow::TensorProto::MergeFrom(from.value()); + } + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } +} + +void OpInfo_TensorProperties::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpInfo.TensorProperties) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpInfo_TensorProperties::CopyFrom(const OpInfo_TensorProperties& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpInfo.TensorProperties) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpInfo_TensorProperties::IsInitialized() const { + return true; +} + +void OpInfo_TensorProperties::Swap(OpInfo_TensorProperties* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpInfo_TensorProperties* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpInfo_TensorProperties::UnsafeArenaSwap(OpInfo_TensorProperties* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpInfo_TensorProperties::InternalSwap(OpInfo_TensorProperties* other) { + using std::swap; + swap(shape_, other->shape_); + swap(value_, other->value_); + swap(dtype_, other->dtype_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpInfo_TensorProperties::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpInfo::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_OpInfo_default_instance_._instance.get_mutable()->device_ = const_cast< ::diplomacy::tensorflow::DeviceProperties*>( + ::diplomacy::tensorflow::DeviceProperties::internal_default_instance()); + ::diplomacy::tensorflow::_OpInfo_default_instance_._instance.get_mutable()->session_info_ = const_cast< ::diplomacy::tensorflow::SessionInfo*>( + ::diplomacy::tensorflow::SessionInfo::internal_default_instance()); +} +void OpInfo::clear_attr() { + attr_.Clear(); +} +void OpInfo::unsafe_arena_set_allocated_device( + ::diplomacy::tensorflow::DeviceProperties* device) { + if (GetArenaNoVirtual() == NULL) { + delete device_; + } + device_ = device; + if (device) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpInfo.device) +} +void OpInfo::clear_device() { + if (GetArenaNoVirtual() == NULL && device_ != NULL) { + delete device_; + } + device_ = NULL; +} +void OpInfo::unsafe_arena_set_allocated_session_info( + ::diplomacy::tensorflow::SessionInfo* session_info) { + if (GetArenaNoVirtual() == NULL) { + delete session_info_; + } + session_info_ = session_info; + if (session_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpInfo.session_info) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpInfo::kOpFieldNumber; +const int OpInfo::kAttrFieldNumber; +const int OpInfo::kInputsFieldNumber; +const int OpInfo::kOutputsFieldNumber; +const int OpInfo::kDeviceFieldNumber; +const int OpInfo::kSessionInfoFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpInfo::OpInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpInfo) +} +OpInfo::OpInfo(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + attr_(arena), + inputs_(arena), + outputs_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpInfo) +} +OpInfo::OpInfo(const OpInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + inputs_(from.inputs_), + outputs_(from.outputs_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + attr_.MergeFrom(from.attr_); + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.op().size() > 0) { + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op(), + GetArenaNoVirtual()); + } + if (from.has_device()) { + device_ = new ::diplomacy::tensorflow::DeviceProperties(*from.device_); + } else { + device_ = NULL; + } + if (from.has_session_info()) { + session_info_ = new ::diplomacy::tensorflow::SessionInfo(*from.session_info_); + } else { + session_info_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpInfo) +} + +void OpInfo::SharedCtor() { + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&device_, 0, static_cast( + reinterpret_cast(&session_info_) - + reinterpret_cast(&device_)) + sizeof(session_info_)); +} + +OpInfo::~OpInfo() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpInfo) + SharedDtor(); +} + +void OpInfo::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete device_; + if (this != internal_default_instance()) delete session_info_; +} + +void OpInfo::ArenaDtor(void* object) { + OpInfo* _this = reinterpret_cast< OpInfo* >(object); + (void)_this; +} +void OpInfo::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpInfo::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpInfo& OpInfo::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpInfo.base); + return *internal_default_instance(); +} + + +void OpInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + attr_.Clear(); + inputs_.Clear(); + outputs_.Clear(); + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && device_ != NULL) { + delete device_; + } + device_ = NULL; + if (GetArenaNoVirtual() == NULL && session_info_ != NULL) { + delete session_info_; + } + session_info_ = NULL; + _internal_metadata_.Clear(); +} + +bool OpInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpInfo) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string op = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpInfo.op")); + } else { + goto handle_unusual; + } + break; + } + + // map attr = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + OpInfo_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField< + OpInfo_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue > > parser(&attr_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), static_cast(parser.key().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpInfo.AttrEntry.key")); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties inputs = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_inputs())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.DeviceProperties device = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_device())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties outputs = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_outputs())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.SessionInfo session_info = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_session_info())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpInfo) + return false; +#undef DO_ +} + +void OpInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op = 1; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpInfo.op"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->op(), output); + } + + // map attr = 2; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpInfo.AttrEntry.key"); + } + }; + + if (output->IsSerializationDeterministic() && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties inputs = 3; + for (unsigned int i = 0, + n = static_cast(this->inputs_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->inputs(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.DeviceProperties device = 4; + if (this->has_device()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_device(), output); + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties outputs = 5; + for (unsigned int i = 0, + n = static_cast(this->outputs_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, + this->outputs(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.SessionInfo session_info = 6; + if (this->has_session_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->_internal_session_info(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpInfo) +} + +::google::protobuf::uint8* OpInfo::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpInfo) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string op = 1; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), static_cast(this->op().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpInfo.op"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->op(), target); + } + + // map attr = 2; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), static_cast(p->first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpInfo.AttrEntry.key"); + } + }; + + if (deterministic && + this->attr().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + ::std::unique_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[static_cast(i)]->first, items[static_cast(i)]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[static_cast(i)]); + } + } else { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties inputs = 3; + for (unsigned int i = 0, + n = static_cast(this->inputs_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->inputs(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.DeviceProperties device = 4; + if (this->has_device()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_device(), deterministic, target); + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties outputs = 5; + for (unsigned int i = 0, + n = static_cast(this->outputs_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->outputs(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.SessionInfo session_info = 6; + if (this->has_session_info()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, this->_internal_session_info(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpInfo) + return target; +} + +size_t OpInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpInfo) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // map attr = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->attr_size()); + { + ::std::unique_ptr entry; + for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(attr_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties inputs = 3; + { + unsigned int count = static_cast(this->inputs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->inputs(static_cast(i))); + } + } + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties outputs = 5; + { + unsigned int count = static_cast(this->outputs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->outputs(static_cast(i))); + } + } + + // string op = 1; + if (this->op().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op()); + } + + // .diplomacy.tensorflow.DeviceProperties device = 4; + if (this->has_device()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *device_); + } + + // .diplomacy.tensorflow.SessionInfo session_info = 6; + if (this->has_session_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *session_info_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpInfo) + GOOGLE_DCHECK_NE(&from, this); + const OpInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpInfo) + MergeFrom(*source); + } +} + +void OpInfo::MergeFrom(const OpInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + attr_.MergeFrom(from.attr_); + inputs_.MergeFrom(from.inputs_); + outputs_.MergeFrom(from.outputs_); + if (from.op().size() > 0) { + set_op(from.op()); + } + if (from.has_device()) { + mutable_device()->::diplomacy::tensorflow::DeviceProperties::MergeFrom(from.device()); + } + if (from.has_session_info()) { + mutable_session_info()->::diplomacy::tensorflow::SessionInfo::MergeFrom(from.session_info()); + } +} + +void OpInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpInfo::CopyFrom(const OpInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpInfo::IsInitialized() const { + return true; +} + +void OpInfo::Swap(OpInfo* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpInfo* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpInfo::UnsafeArenaSwap(OpInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpInfo::InternalSwap(OpInfo* other) { + using std::swap; + attr_.Swap(&other->attr_); + CastToBase(&inputs_)->InternalSwap(CastToBase(&other->inputs_)); + CastToBase(&outputs_)->InternalSwap(CastToBase(&other->outputs_)); + op_.Swap(&other->op_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(device_, other->device_); + swap(session_info_, other->session_info_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpInfo::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void NormalDistribution::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NormalDistribution::kMuFieldNumber; +const int NormalDistribution::kSigmaFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NormalDistribution::NormalDistribution() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_NormalDistribution.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.NormalDistribution) +} +NormalDistribution::NormalDistribution(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_NormalDistribution.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.NormalDistribution) +} +NormalDistribution::NormalDistribution(const NormalDistribution& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&mu_, &from.mu_, + static_cast(reinterpret_cast(&sigma_) - + reinterpret_cast(&mu_)) + sizeof(sigma_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.NormalDistribution) +} + +void NormalDistribution::SharedCtor() { + ::memset(&mu_, 0, static_cast( + reinterpret_cast(&sigma_) - + reinterpret_cast(&mu_)) + sizeof(sigma_)); +} + +NormalDistribution::~NormalDistribution() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.NormalDistribution) + SharedDtor(); +} + +void NormalDistribution::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void NormalDistribution::ArenaDtor(void* object) { + NormalDistribution* _this = reinterpret_cast< NormalDistribution* >(object); + (void)_this; +} +void NormalDistribution::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NormalDistribution::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NormalDistribution::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NormalDistribution& NormalDistribution::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_NormalDistribution.base); + return *internal_default_instance(); +} + + +void NormalDistribution::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.NormalDistribution) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&mu_, 0, static_cast( + reinterpret_cast(&sigma_) - + reinterpret_cast(&mu_)) + sizeof(sigma_)); + _internal_metadata_.Clear(); +} + +bool NormalDistribution::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.NormalDistribution) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // double mu = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &mu_))); + } else { + goto handle_unusual; + } + break; + } + + // double sigma = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &sigma_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.NormalDistribution) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.NormalDistribution) + return false; +#undef DO_ +} + +void NormalDistribution::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.NormalDistribution) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double mu = 1; + if (this->mu() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->mu(), output); + } + + // double sigma = 2; + if (this->sigma() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->sigma(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.NormalDistribution) +} + +::google::protobuf::uint8* NormalDistribution::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.NormalDistribution) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double mu = 1; + if (this->mu() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->mu(), target); + } + + // double sigma = 2; + if (this->sigma() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->sigma(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.NormalDistribution) + return target; +} + +size_t NormalDistribution::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.NormalDistribution) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // double mu = 1; + if (this->mu() != 0) { + total_size += 1 + 8; + } + + // double sigma = 2; + if (this->sigma() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NormalDistribution::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.NormalDistribution) + GOOGLE_DCHECK_NE(&from, this); + const NormalDistribution* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.NormalDistribution) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.NormalDistribution) + MergeFrom(*source); + } +} + +void NormalDistribution::MergeFrom(const NormalDistribution& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.NormalDistribution) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.mu() != 0) { + set_mu(from.mu()); + } + if (from.sigma() != 0) { + set_sigma(from.sigma()); + } +} + +void NormalDistribution::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.NormalDistribution) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NormalDistribution::CopyFrom(const NormalDistribution& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.NormalDistribution) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NormalDistribution::IsInitialized() const { + return true; +} + +void NormalDistribution::Swap(NormalDistribution* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NormalDistribution* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void NormalDistribution::UnsafeArenaSwap(NormalDistribution* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NormalDistribution::InternalSwap(NormalDistribution* other) { + using std::swap; + swap(mu_, other->mu_); + swap(sigma_, other->sigma_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NormalDistribution::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void LogNormalDistribution::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LogNormalDistribution::kMuFieldNumber; +const int LogNormalDistribution::kSigmaFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LogNormalDistribution::LogNormalDistribution() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_LogNormalDistribution.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.LogNormalDistribution) +} +LogNormalDistribution::LogNormalDistribution(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_LogNormalDistribution.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.LogNormalDistribution) +} +LogNormalDistribution::LogNormalDistribution(const LogNormalDistribution& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&mu_, &from.mu_, + static_cast(reinterpret_cast(&sigma_) - + reinterpret_cast(&mu_)) + sizeof(sigma_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.LogNormalDistribution) +} + +void LogNormalDistribution::SharedCtor() { + ::memset(&mu_, 0, static_cast( + reinterpret_cast(&sigma_) - + reinterpret_cast(&mu_)) + sizeof(sigma_)); +} + +LogNormalDistribution::~LogNormalDistribution() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.LogNormalDistribution) + SharedDtor(); +} + +void LogNormalDistribution::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void LogNormalDistribution::ArenaDtor(void* object) { + LogNormalDistribution* _this = reinterpret_cast< LogNormalDistribution* >(object); + (void)_this; +} +void LogNormalDistribution::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void LogNormalDistribution::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* LogNormalDistribution::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const LogNormalDistribution& LogNormalDistribution::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_LogNormalDistribution.base); + return *internal_default_instance(); +} + + +void LogNormalDistribution::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.LogNormalDistribution) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&mu_, 0, static_cast( + reinterpret_cast(&sigma_) - + reinterpret_cast(&mu_)) + sizeof(sigma_)); + _internal_metadata_.Clear(); +} + +bool LogNormalDistribution::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.LogNormalDistribution) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // double mu = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(9u /* 9 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &mu_))); + } else { + goto handle_unusual; + } + break; + } + + // double sigma = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &sigma_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.LogNormalDistribution) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.LogNormalDistribution) + return false; +#undef DO_ +} + +void LogNormalDistribution::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.LogNormalDistribution) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double mu = 1; + if (this->mu() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->mu(), output); + } + + // double sigma = 2; + if (this->sigma() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->sigma(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.LogNormalDistribution) +} + +::google::protobuf::uint8* LogNormalDistribution::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.LogNormalDistribution) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double mu = 1; + if (this->mu() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->mu(), target); + } + + // double sigma = 2; + if (this->sigma() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->sigma(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.LogNormalDistribution) + return target; +} + +size_t LogNormalDistribution::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.LogNormalDistribution) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // double mu = 1; + if (this->mu() != 0) { + total_size += 1 + 8; + } + + // double sigma = 2; + if (this->sigma() != 0) { + total_size += 1 + 8; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void LogNormalDistribution::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.LogNormalDistribution) + GOOGLE_DCHECK_NE(&from, this); + const LogNormalDistribution* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.LogNormalDistribution) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.LogNormalDistribution) + MergeFrom(*source); + } +} + +void LogNormalDistribution::MergeFrom(const LogNormalDistribution& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.LogNormalDistribution) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.mu() != 0) { + set_mu(from.mu()); + } + if (from.sigma() != 0) { + set_sigma(from.sigma()); + } +} + +void LogNormalDistribution::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.LogNormalDistribution) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LogNormalDistribution::CopyFrom(const LogNormalDistribution& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.LogNormalDistribution) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LogNormalDistribution::IsInitialized() const { + return true; +} + +void LogNormalDistribution::Swap(LogNormalDistribution* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + LogNormalDistribution* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void LogNormalDistribution::UnsafeArenaSwap(LogNormalDistribution* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void LogNormalDistribution::InternalSwap(LogNormalDistribution* other) { + using std::swap; + swap(mu_, other->mu_); + swap(sigma_, other->sigma_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata LogNormalDistribution::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpPerformance_OpMemory::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpPerformance_OpMemory::kOutputMemoryFieldNumber; +const int OpPerformance_OpMemory::kTempMemoryFieldNumber; +const int OpPerformance_OpMemory::kPersistentMemoryFieldNumber; +const int OpPerformance_OpMemory::kDeviceTempMemoryFieldNumber; +const int OpPerformance_OpMemory::kDevicePersistentMemoryFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpPerformance_OpMemory::OpPerformance_OpMemory() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance_OpMemory.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpPerformance.OpMemory) +} +OpPerformance_OpMemory::OpPerformance_OpMemory(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + output_memory_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance_OpMemory.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpPerformance.OpMemory) +} +OpPerformance_OpMemory::OpPerformance_OpMemory(const OpPerformance_OpMemory& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + output_memory_(from.output_memory_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&temp_memory_, &from.temp_memory_, + static_cast(reinterpret_cast(&device_persistent_memory_) - + reinterpret_cast(&temp_memory_)) + sizeof(device_persistent_memory_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpPerformance.OpMemory) +} + +void OpPerformance_OpMemory::SharedCtor() { + ::memset(&temp_memory_, 0, static_cast( + reinterpret_cast(&device_persistent_memory_) - + reinterpret_cast(&temp_memory_)) + sizeof(device_persistent_memory_)); +} + +OpPerformance_OpMemory::~OpPerformance_OpMemory() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpPerformance.OpMemory) + SharedDtor(); +} + +void OpPerformance_OpMemory::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void OpPerformance_OpMemory::ArenaDtor(void* object) { + OpPerformance_OpMemory* _this = reinterpret_cast< OpPerformance_OpMemory* >(object); + (void)_this; +} +void OpPerformance_OpMemory::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpPerformance_OpMemory::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpPerformance_OpMemory::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpPerformance_OpMemory& OpPerformance_OpMemory::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance_OpMemory.base); + return *internal_default_instance(); +} + + +void OpPerformance_OpMemory::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpPerformance.OpMemory) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + output_memory_.Clear(); + ::memset(&temp_memory_, 0, static_cast( + reinterpret_cast(&device_persistent_memory_) - + reinterpret_cast(&temp_memory_)) + sizeof(device_persistent_memory_)); + _internal_metadata_.Clear(); +} + +bool OpPerformance_OpMemory::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpPerformance.OpMemory) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 output_memory = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_output_memory()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10u, input, this->mutable_output_memory()))); + } else { + goto handle_unusual; + } + break; + } + + // int64 temp_memory = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &temp_memory_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 device_temp_memory = 3 [deprecated = true]; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_temp_memory_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 persistent_memory = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &persistent_memory_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 device_persistent_memory = 5 [deprecated = true]; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &device_persistent_memory_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpPerformance.OpMemory) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpPerformance.OpMemory) + return false; +#undef DO_ +} + +void OpPerformance_OpMemory::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpPerformance.OpMemory) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 output_memory = 1; + if (this->output_memory_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _output_memory_cached_byte_size_)); + } + for (int i = 0, n = this->output_memory_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->output_memory(i), output); + } + + // int64 temp_memory = 2; + if (this->temp_memory() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->temp_memory(), output); + } + + // int64 device_temp_memory = 3 [deprecated = true]; + if (this->device_temp_memory() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->device_temp_memory(), output); + } + + // int64 persistent_memory = 4; + if (this->persistent_memory() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->persistent_memory(), output); + } + + // int64 device_persistent_memory = 5 [deprecated = true]; + if (this->device_persistent_memory() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->device_persistent_memory(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpPerformance.OpMemory) +} + +::google::protobuf::uint8* OpPerformance_OpMemory::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpPerformance.OpMemory) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int64 output_memory = 1; + if (this->output_memory_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _output_memory_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->output_memory_, target); + } + + // int64 temp_memory = 2; + if (this->temp_memory() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->temp_memory(), target); + } + + // int64 device_temp_memory = 3 [deprecated = true]; + if (this->device_temp_memory() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->device_temp_memory(), target); + } + + // int64 persistent_memory = 4; + if (this->persistent_memory() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->persistent_memory(), target); + } + + // int64 device_persistent_memory = 5 [deprecated = true]; + if (this->device_persistent_memory() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->device_persistent_memory(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpPerformance.OpMemory) + return target; +} + +size_t OpPerformance_OpMemory::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpPerformance.OpMemory) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int64 output_memory = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->output_memory_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _output_memory_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // int64 temp_memory = 2; + if (this->temp_memory() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->temp_memory()); + } + + // int64 device_temp_memory = 3 [deprecated = true]; + if (this->device_temp_memory() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_temp_memory()); + } + + // int64 persistent_memory = 4; + if (this->persistent_memory() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->persistent_memory()); + } + + // int64 device_persistent_memory = 5 [deprecated = true]; + if (this->device_persistent_memory() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->device_persistent_memory()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpPerformance_OpMemory::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpPerformance.OpMemory) + GOOGLE_DCHECK_NE(&from, this); + const OpPerformance_OpMemory* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpPerformance.OpMemory) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpPerformance.OpMemory) + MergeFrom(*source); + } +} + +void OpPerformance_OpMemory::MergeFrom(const OpPerformance_OpMemory& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpPerformance.OpMemory) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + output_memory_.MergeFrom(from.output_memory_); + if (from.temp_memory() != 0) { + set_temp_memory(from.temp_memory()); + } + if (from.device_temp_memory() != 0) { + set_device_temp_memory(from.device_temp_memory()); + } + if (from.persistent_memory() != 0) { + set_persistent_memory(from.persistent_memory()); + } + if (from.device_persistent_memory() != 0) { + set_device_persistent_memory(from.device_persistent_memory()); + } +} + +void OpPerformance_OpMemory::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpPerformance.OpMemory) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpPerformance_OpMemory::CopyFrom(const OpPerformance_OpMemory& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpPerformance.OpMemory) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpPerformance_OpMemory::IsInitialized() const { + return true; +} + +void OpPerformance_OpMemory::Swap(OpPerformance_OpMemory* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpPerformance_OpMemory* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpPerformance_OpMemory::UnsafeArenaSwap(OpPerformance_OpMemory* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpPerformance_OpMemory::InternalSwap(OpPerformance_OpMemory* other) { + using std::swap; + output_memory_.InternalSwap(&other->output_memory_); + swap(temp_memory_, other->temp_memory_); + swap(device_temp_memory_, other->device_temp_memory_); + swap(persistent_memory_, other->persistent_memory_); + swap(device_persistent_memory_, other->device_persistent_memory_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpPerformance_OpMemory::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpPerformance::InitAsDefaultInstance() { + ::diplomacy::tensorflow::_OpPerformance_default_instance_._instance.get_mutable()->op_ = const_cast< ::diplomacy::tensorflow::OpInfo*>( + ::diplomacy::tensorflow::OpInfo::internal_default_instance()); + ::diplomacy::tensorflow::_OpPerformance_default_instance_._instance.get_mutable()->session_info_ = const_cast< ::diplomacy::tensorflow::SessionInfo*>( + ::diplomacy::tensorflow::SessionInfo::internal_default_instance()); + ::diplomacy::tensorflow::_OpPerformance_default_instance_.execution_time_normal_ = const_cast< ::diplomacy::tensorflow::NormalDistribution*>( + ::diplomacy::tensorflow::NormalDistribution::internal_default_instance()); + ::diplomacy::tensorflow::_OpPerformance_default_instance_.execution_time_log_normal_ = const_cast< ::diplomacy::tensorflow::LogNormalDistribution*>( + ::diplomacy::tensorflow::LogNormalDistribution::internal_default_instance()); + ::diplomacy::tensorflow::_OpPerformance_default_instance_._instance.get_mutable()->op_memory_ = const_cast< ::diplomacy::tensorflow::OpPerformance_OpMemory*>( + ::diplomacy::tensorflow::OpPerformance_OpMemory::internal_default_instance()); +} +void OpPerformance::unsafe_arena_set_allocated_op( + ::diplomacy::tensorflow::OpInfo* op) { + if (GetArenaNoVirtual() == NULL) { + delete op_; + } + op_ = op; + if (op) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpPerformance.op) +} +void OpPerformance::unsafe_arena_set_allocated_session_info( + ::diplomacy::tensorflow::SessionInfo* session_info) { + if (GetArenaNoVirtual() == NULL) { + delete session_info_; + } + session_info_ = session_info; + if (session_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpPerformance.session_info) +} +void OpPerformance::set_allocated_execution_time_normal(::diplomacy::tensorflow::NormalDistribution* execution_time_normal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_execution_time(); + if (execution_time_normal) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(execution_time_normal); + if (message_arena != submessage_arena) { + execution_time_normal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, execution_time_normal, submessage_arena); + } + set_has_execution_time_normal(); + execution_time_.execution_time_normal_ = execution_time_normal; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpPerformance.execution_time_normal) +} +void OpPerformance::set_allocated_execution_time_log_normal(::diplomacy::tensorflow::LogNormalDistribution* execution_time_log_normal) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_execution_time(); + if (execution_time_log_normal) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(execution_time_log_normal); + if (message_arena != submessage_arena) { + execution_time_log_normal = ::google::protobuf::internal::GetOwnedMessage( + message_arena, execution_time_log_normal, submessage_arena); + } + set_has_execution_time_log_normal(); + execution_time_.execution_time_log_normal_ = execution_time_log_normal; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpPerformance.execution_time_log_normal) +} +void OpPerformance::unsafe_arena_set_allocated_op_memory( + ::diplomacy::tensorflow::OpPerformance_OpMemory* op_memory) { + if (GetArenaNoVirtual() == NULL) { + delete op_memory_; + } + op_memory_ = op_memory; + if (op_memory) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpPerformance.op_memory) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpPerformance::kOpFieldNumber; +const int OpPerformance::kSessionInfoFieldNumber; +const int OpPerformance::kNodeFieldNumber; +const int OpPerformance::kTemporaryMemorySizeFieldNumber; +const int OpPerformance::kComputeCostFieldNumber; +const int OpPerformance::kComputeTimeFieldNumber; +const int OpPerformance::kMemoryTimeFieldNumber; +const int OpPerformance::kComputeEfficiencyFieldNumber; +const int OpPerformance::kMemoryEfficiencyFieldNumber; +const int OpPerformance::kExecutionTimeNormalFieldNumber; +const int OpPerformance::kExecutionTimeLogNormalFieldNumber; +const int OpPerformance::kOpMemoryFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpPerformance::OpPerformance() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpPerformance) +} +OpPerformance::OpPerformance(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpPerformance) +} +OpPerformance::OpPerformance(const OpPerformance& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + node_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.node().size() > 0) { + node_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node(), + GetArenaNoVirtual()); + } + if (from.has_op()) { + op_ = new ::diplomacy::tensorflow::OpInfo(*from.op_); + } else { + op_ = NULL; + } + if (from.has_op_memory()) { + op_memory_ = new ::diplomacy::tensorflow::OpPerformance_OpMemory(*from.op_memory_); + } else { + op_memory_ = NULL; + } + if (from.has_session_info()) { + session_info_ = new ::diplomacy::tensorflow::SessionInfo(*from.session_info_); + } else { + session_info_ = NULL; + } + ::memcpy(&temporary_memory_size_, &from.temporary_memory_size_, + static_cast(reinterpret_cast(&memory_efficiency_) - + reinterpret_cast(&temporary_memory_size_)) + sizeof(memory_efficiency_)); + clear_has_execution_time(); + switch (from.execution_time_case()) { + case kExecutionTimeNormal: { + mutable_execution_time_normal()->::diplomacy::tensorflow::NormalDistribution::MergeFrom(from.execution_time_normal()); + break; + } + case kExecutionTimeLogNormal: { + mutable_execution_time_log_normal()->::diplomacy::tensorflow::LogNormalDistribution::MergeFrom(from.execution_time_log_normal()); + break; + } + case EXECUTION_TIME_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpPerformance) +} + +void OpPerformance::SharedCtor() { + node_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&op_, 0, static_cast( + reinterpret_cast(&memory_efficiency_) - + reinterpret_cast(&op_)) + sizeof(memory_efficiency_)); + clear_has_execution_time(); +} + +OpPerformance::~OpPerformance() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpPerformance) + SharedDtor(); +} + +void OpPerformance::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + node_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete op_; + if (this != internal_default_instance()) delete op_memory_; + if (this != internal_default_instance()) delete session_info_; + if (has_execution_time()) { + clear_execution_time(); + } +} + +void OpPerformance::ArenaDtor(void* object) { + OpPerformance* _this = reinterpret_cast< OpPerformance* >(object); + (void)_this; +} +void OpPerformance::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpPerformance::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpPerformance::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpPerformance& OpPerformance::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformance.base); + return *internal_default_instance(); +} + + +void OpPerformance::clear_execution_time() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.OpPerformance) + switch (execution_time_case()) { + case kExecutionTimeNormal: { + if (GetArenaNoVirtual() == NULL) { + delete execution_time_.execution_time_normal_; + } + break; + } + case kExecutionTimeLogNormal: { + if (GetArenaNoVirtual() == NULL) { + delete execution_time_.execution_time_log_normal_; + } + break; + } + case EXECUTION_TIME_NOT_SET: { + break; + } + } + _oneof_case_[0] = EXECUTION_TIME_NOT_SET; +} + + +void OpPerformance::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpPerformance) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + node_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && op_ != NULL) { + delete op_; + } + op_ = NULL; + if (GetArenaNoVirtual() == NULL && op_memory_ != NULL) { + delete op_memory_; + } + op_memory_ = NULL; + if (GetArenaNoVirtual() == NULL && session_info_ != NULL) { + delete session_info_; + } + session_info_ = NULL; + ::memset(&temporary_memory_size_, 0, static_cast( + reinterpret_cast(&memory_efficiency_) - + reinterpret_cast(&temporary_memory_size_)) + sizeof(memory_efficiency_)); + clear_execution_time(); + _internal_metadata_.Clear(); +} + +bool OpPerformance::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpPerformance) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.OpInfo op = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_op())); + } else { + goto handle_unusual; + } + break; + } + + // int64 temporary_memory_size = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &temporary_memory_size_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compute_cost = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compute_cost_))); + } else { + goto handle_unusual; + } + break; + } + + // double compute_efficiency = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(33u /* 33 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &compute_efficiency_))); + } else { + goto handle_unusual; + } + break; + } + + // string node = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_node())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node().data(), static_cast(this->node().length()), + ::google::protobuf::internal::WireFormatLite::PARSE, + "diplomacy.tensorflow.OpPerformance.node")); + } else { + goto handle_unusual; + } + break; + } + + // int64 compute_time = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &compute_time_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 memory_time = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &memory_time_))); + } else { + goto handle_unusual; + } + break; + } + + // double memory_efficiency = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(65u /* 65 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &memory_efficiency_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.OpPerformance.OpMemory op_memory = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_op_memory())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.NormalDistribution execution_time_normal = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_execution_time_normal())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.LogNormalDistribution execution_time_log_normal = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_execution_time_log_normal())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.SessionInfo session_info = 12 [deprecated = true]; + case 12: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_session_info())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpPerformance) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpPerformance) + return false; +#undef DO_ +} + +void OpPerformance::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpPerformance) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.OpInfo op = 1; + if (this->has_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_op(), output); + } + + // int64 temporary_memory_size = 2; + if (this->temporary_memory_size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->temporary_memory_size(), output); + } + + // int64 compute_cost = 3; + if (this->compute_cost() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->compute_cost(), output); + } + + // double compute_efficiency = 4; + if (this->compute_efficiency() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(4, this->compute_efficiency(), output); + } + + // string node = 5; + if (this->node().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node().data(), static_cast(this->node().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpPerformance.node"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->node(), output); + } + + // int64 compute_time = 6; + if (this->compute_time() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->compute_time(), output); + } + + // int64 memory_time = 7; + if (this->memory_time() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(7, this->memory_time(), output); + } + + // double memory_efficiency = 8; + if (this->memory_efficiency() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(8, this->memory_efficiency(), output); + } + + // .diplomacy.tensorflow.OpPerformance.OpMemory op_memory = 9; + if (this->has_op_memory()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->_internal_op_memory(), output); + } + + // .diplomacy.tensorflow.NormalDistribution execution_time_normal = 10; + if (has_execution_time_normal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, this->_internal_execution_time_normal(), output); + } + + // .diplomacy.tensorflow.LogNormalDistribution execution_time_log_normal = 11; + if (has_execution_time_log_normal()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->_internal_execution_time_log_normal(), output); + } + + // .diplomacy.tensorflow.SessionInfo session_info = 12 [deprecated = true]; + if (this->has_session_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, this->_internal_session_info(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpPerformance) +} + +::google::protobuf::uint8* OpPerformance::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpPerformance) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.OpInfo op = 1; + if (this->has_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_op(), deterministic, target); + } + + // int64 temporary_memory_size = 2; + if (this->temporary_memory_size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->temporary_memory_size(), target); + } + + // int64 compute_cost = 3; + if (this->compute_cost() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->compute_cost(), target); + } + + // double compute_efficiency = 4; + if (this->compute_efficiency() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(4, this->compute_efficiency(), target); + } + + // string node = 5; + if (this->node().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->node().data(), static_cast(this->node().length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "diplomacy.tensorflow.OpPerformance.node"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->node(), target); + } + + // int64 compute_time = 6; + if (this->compute_time() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->compute_time(), target); + } + + // int64 memory_time = 7; + if (this->memory_time() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(7, this->memory_time(), target); + } + + // double memory_efficiency = 8; + if (this->memory_efficiency() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(8, this->memory_efficiency(), target); + } + + // .diplomacy.tensorflow.OpPerformance.OpMemory op_memory = 9; + if (this->has_op_memory()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 9, this->_internal_op_memory(), deterministic, target); + } + + // .diplomacy.tensorflow.NormalDistribution execution_time_normal = 10; + if (has_execution_time_normal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 10, this->_internal_execution_time_normal(), deterministic, target); + } + + // .diplomacy.tensorflow.LogNormalDistribution execution_time_log_normal = 11; + if (has_execution_time_log_normal()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 11, this->_internal_execution_time_log_normal(), deterministic, target); + } + + // .diplomacy.tensorflow.SessionInfo session_info = 12 [deprecated = true]; + if (this->has_session_info()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 12, this->_internal_session_info(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpPerformance) + return target; +} + +size_t OpPerformance::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpPerformance) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // string node = 5; + if (this->node().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->node()); + } + + // .diplomacy.tensorflow.OpInfo op = 1; + if (this->has_op()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *op_); + } + + // .diplomacy.tensorflow.OpPerformance.OpMemory op_memory = 9; + if (this->has_op_memory()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *op_memory_); + } + + // .diplomacy.tensorflow.SessionInfo session_info = 12 [deprecated = true]; + if (this->has_session_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *session_info_); + } + + // int64 temporary_memory_size = 2; + if (this->temporary_memory_size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->temporary_memory_size()); + } + + // int64 compute_cost = 3; + if (this->compute_cost() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compute_cost()); + } + + // double compute_efficiency = 4; + if (this->compute_efficiency() != 0) { + total_size += 1 + 8; + } + + // int64 compute_time = 6; + if (this->compute_time() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->compute_time()); + } + + // int64 memory_time = 7; + if (this->memory_time() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->memory_time()); + } + + // double memory_efficiency = 8; + if (this->memory_efficiency() != 0) { + total_size += 1 + 8; + } + + switch (execution_time_case()) { + // .diplomacy.tensorflow.NormalDistribution execution_time_normal = 10; + case kExecutionTimeNormal: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *execution_time_.execution_time_normal_); + break; + } + // .diplomacy.tensorflow.LogNormalDistribution execution_time_log_normal = 11; + case kExecutionTimeLogNormal: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *execution_time_.execution_time_log_normal_); + break; + } + case EXECUTION_TIME_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpPerformance::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpPerformance) + GOOGLE_DCHECK_NE(&from, this); + const OpPerformance* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpPerformance) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpPerformance) + MergeFrom(*source); + } +} + +void OpPerformance::MergeFrom(const OpPerformance& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpPerformance) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.node().size() > 0) { + set_node(from.node()); + } + if (from.has_op()) { + mutable_op()->::diplomacy::tensorflow::OpInfo::MergeFrom(from.op()); + } + if (from.has_op_memory()) { + mutable_op_memory()->::diplomacy::tensorflow::OpPerformance_OpMemory::MergeFrom(from.op_memory()); + } + if (from.has_session_info()) { + mutable_session_info()->::diplomacy::tensorflow::SessionInfo::MergeFrom(from.session_info()); + } + if (from.temporary_memory_size() != 0) { + set_temporary_memory_size(from.temporary_memory_size()); + } + if (from.compute_cost() != 0) { + set_compute_cost(from.compute_cost()); + } + if (from.compute_efficiency() != 0) { + set_compute_efficiency(from.compute_efficiency()); + } + if (from.compute_time() != 0) { + set_compute_time(from.compute_time()); + } + if (from.memory_time() != 0) { + set_memory_time(from.memory_time()); + } + if (from.memory_efficiency() != 0) { + set_memory_efficiency(from.memory_efficiency()); + } + switch (from.execution_time_case()) { + case kExecutionTimeNormal: { + mutable_execution_time_normal()->::diplomacy::tensorflow::NormalDistribution::MergeFrom(from.execution_time_normal()); + break; + } + case kExecutionTimeLogNormal: { + mutable_execution_time_log_normal()->::diplomacy::tensorflow::LogNormalDistribution::MergeFrom(from.execution_time_log_normal()); + break; + } + case EXECUTION_TIME_NOT_SET: { + break; + } + } +} + +void OpPerformance::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpPerformance) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpPerformance::CopyFrom(const OpPerformance& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpPerformance) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpPerformance::IsInitialized() const { + return true; +} + +void OpPerformance::Swap(OpPerformance* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpPerformance* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpPerformance::UnsafeArenaSwap(OpPerformance* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpPerformance::InternalSwap(OpPerformance* other) { + using std::swap; + node_.Swap(&other->node_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(op_, other->op_); + swap(op_memory_, other->op_memory_); + swap(session_info_, other->session_info_); + swap(temporary_memory_size_, other->temporary_memory_size_); + swap(compute_cost_, other->compute_cost_); + swap(compute_efficiency_, other->compute_efficiency_); + swap(compute_time_, other->compute_time_); + swap(memory_time_, other->memory_time_); + swap(memory_efficiency_, other->memory_efficiency_); + swap(execution_time_, other->execution_time_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpPerformance::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void OpPerformanceList::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpPerformanceList::kOpPerformanceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpPerformanceList::OpPerformanceList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformanceList.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.OpPerformanceList) +} +OpPerformanceList::OpPerformanceList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + op_performance_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformanceList.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.OpPerformanceList) +} +OpPerformanceList::OpPerformanceList(const OpPerformanceList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + op_performance_(from.op_performance_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.OpPerformanceList) +} + +void OpPerformanceList::SharedCtor() { +} + +OpPerformanceList::~OpPerformanceList() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.OpPerformanceList) + SharedDtor(); +} + +void OpPerformanceList::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void OpPerformanceList::ArenaDtor(void* object) { + OpPerformanceList* _this = reinterpret_cast< OpPerformanceList* >(object); + (void)_this; +} +void OpPerformanceList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpPerformanceList::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* OpPerformanceList::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const OpPerformanceList& OpPerformanceList::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::scc_info_OpPerformanceList.base); + return *internal_default_instance(); +} + + +void OpPerformanceList::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.OpPerformanceList) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + op_performance_.Clear(); + _internal_metadata_.Clear(); +} + +bool OpPerformanceList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.OpPerformanceList) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.OpPerformance op_performance = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_op_performance())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.OpPerformanceList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.OpPerformanceList) + return false; +#undef DO_ +} + +void OpPerformanceList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.OpPerformanceList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.OpPerformance op_performance = 1; + for (unsigned int i = 0, + n = static_cast(this->op_performance_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->op_performance(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.OpPerformanceList) +} + +::google::protobuf::uint8* OpPerformanceList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.OpPerformanceList) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.OpPerformance op_performance = 1; + for (unsigned int i = 0, + n = static_cast(this->op_performance_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->op_performance(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.OpPerformanceList) + return target; +} + +size_t OpPerformanceList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.OpPerformanceList) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.OpPerformance op_performance = 1; + { + unsigned int count = static_cast(this->op_performance_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->op_performance(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void OpPerformanceList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.OpPerformanceList) + GOOGLE_DCHECK_NE(&from, this); + const OpPerformanceList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.OpPerformanceList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.OpPerformanceList) + MergeFrom(*source); + } +} + +void OpPerformanceList::MergeFrom(const OpPerformanceList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.OpPerformanceList) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + op_performance_.MergeFrom(from.op_performance_); +} + +void OpPerformanceList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.OpPerformanceList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpPerformanceList::CopyFrom(const OpPerformanceList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.OpPerformanceList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OpPerformanceList::IsInitialized() const { + return true; +} + +void OpPerformanceList::Swap(OpPerformanceList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpPerformanceList* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void OpPerformanceList::UnsafeArenaSwap(OpPerformanceList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpPerformanceList::InternalSwap(OpPerformanceList* other) { + using std::swap; + CastToBase(&op_performance_)->InternalSwap(CastToBase(&other->op_performance_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata OpPerformanceList::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::SessionInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::SessionInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::SessionInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpInfo_TensorProperties* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpInfo_TensorProperties >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpInfo_TensorProperties >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpInfo* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpInfo >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::NormalDistribution* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::NormalDistribution >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::NormalDistribution >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::LogNormalDistribution* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::LogNormalDistribution >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::LogNormalDistribution >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpPerformance_OpMemory* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpPerformance_OpMemory >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpPerformance_OpMemory >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpPerformance* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpPerformance >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpPerformance >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::OpPerformanceList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::OpPerformanceList >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::OpPerformanceList >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.pb.h new file mode 100644 index 0000000..ce77692 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.pb.h @@ -0,0 +1,2565 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "diplomacy_tensorflow/core/framework/tensor.pb.h" +#include "diplomacy_tensorflow/core/framework/tensor_shape.pb.h" +#include "diplomacy_tensorflow/core/framework/types.pb.h" +#include "diplomacy_tensorflow/core/framework/attr_value.pb.h" +#include "diplomacy_tensorflow/core/protobuf/device_properties.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[9]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto +namespace diplomacy { +namespace tensorflow { +class LogNormalDistribution; +class LogNormalDistributionDefaultTypeInternal; +extern LogNormalDistributionDefaultTypeInternal _LogNormalDistribution_default_instance_; +class NormalDistribution; +class NormalDistributionDefaultTypeInternal; +extern NormalDistributionDefaultTypeInternal _NormalDistribution_default_instance_; +class OpInfo; +class OpInfoDefaultTypeInternal; +extern OpInfoDefaultTypeInternal _OpInfo_default_instance_; +class OpInfo_AttrEntry_DoNotUse; +class OpInfo_AttrEntry_DoNotUseDefaultTypeInternal; +extern OpInfo_AttrEntry_DoNotUseDefaultTypeInternal _OpInfo_AttrEntry_DoNotUse_default_instance_; +class OpInfo_TensorProperties; +class OpInfo_TensorPropertiesDefaultTypeInternal; +extern OpInfo_TensorPropertiesDefaultTypeInternal _OpInfo_TensorProperties_default_instance_; +class OpPerformance; +class OpPerformanceDefaultTypeInternal; +extern OpPerformanceDefaultTypeInternal _OpPerformance_default_instance_; +class OpPerformanceList; +class OpPerformanceListDefaultTypeInternal; +extern OpPerformanceListDefaultTypeInternal _OpPerformanceList_default_instance_; +class OpPerformance_OpMemory; +class OpPerformance_OpMemoryDefaultTypeInternal; +extern OpPerformance_OpMemoryDefaultTypeInternal _OpPerformance_OpMemory_default_instance_; +class SessionInfo; +class SessionInfoDefaultTypeInternal; +extern SessionInfoDefaultTypeInternal _SessionInfo_default_instance_; +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::LogNormalDistribution* Arena::CreateMaybeMessage<::diplomacy::tensorflow::LogNormalDistribution>(Arena*); +template<> ::diplomacy::tensorflow::NormalDistribution* Arena::CreateMaybeMessage<::diplomacy::tensorflow::NormalDistribution>(Arena*); +template<> ::diplomacy::tensorflow::OpInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpInfo>(Arena*); +template<> ::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpInfo_AttrEntry_DoNotUse>(Arena*); +template<> ::diplomacy::tensorflow::OpInfo_TensorProperties* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpInfo_TensorProperties>(Arena*); +template<> ::diplomacy::tensorflow::OpPerformance* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpPerformance>(Arena*); +template<> ::diplomacy::tensorflow::OpPerformanceList* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpPerformanceList>(Arena*); +template<> ::diplomacy::tensorflow::OpPerformance_OpMemory* Arena::CreateMaybeMessage<::diplomacy::tensorflow::OpPerformance_OpMemory>(Arena*); +template<> ::diplomacy::tensorflow::SessionInfo* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SessionInfo>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { + +// =================================================================== + +class SessionInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SessionInfo) */ { + public: + SessionInfo(); + virtual ~SessionInfo(); + + SessionInfo(const SessionInfo& from); + + inline SessionInfo& operator=(const SessionInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SessionInfo(SessionInfo&& from) noexcept + : SessionInfo() { + *this = ::std::move(from); + } + + inline SessionInfo& operator=(SessionInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SessionInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SessionInfo* internal_default_instance() { + return reinterpret_cast( + &_SessionInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(SessionInfo* other); + void Swap(SessionInfo* other); + friend void swap(SessionInfo& a, SessionInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SessionInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + SessionInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SessionInfo& from); + void MergeFrom(const SessionInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SessionInfo* other); + protected: + explicit SessionInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 intra_op_parallelism = 1; + void clear_intra_op_parallelism(); + static const int kIntraOpParallelismFieldNumber = 1; + ::google::protobuf::int64 intra_op_parallelism() const; + void set_intra_op_parallelism(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SessionInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 intra_op_parallelism_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpInfo_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry { +public: + typedef ::google::protobuf::internal::MapEntry SuperType; + OpInfo_AttrEntry_DoNotUse(); + OpInfo_AttrEntry_DoNotUse(::google::protobuf::Arena* arena); + void MergeFrom(const OpInfo_AttrEntry_DoNotUse& other); + static const OpInfo_AttrEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_OpInfo_AttrEntry_DoNotUse_default_instance_); } + void MergeFrom(const ::google::protobuf::Message& other) final; + ::google::protobuf::Metadata GetMetadata() const; +}; + +// ------------------------------------------------------------------- + +class OpInfo_TensorProperties : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpInfo.TensorProperties) */ { + public: + OpInfo_TensorProperties(); + virtual ~OpInfo_TensorProperties(); + + OpInfo_TensorProperties(const OpInfo_TensorProperties& from); + + inline OpInfo_TensorProperties& operator=(const OpInfo_TensorProperties& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpInfo_TensorProperties(OpInfo_TensorProperties&& from) noexcept + : OpInfo_TensorProperties() { + *this = ::std::move(from); + } + + inline OpInfo_TensorProperties& operator=(OpInfo_TensorProperties&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpInfo_TensorProperties& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpInfo_TensorProperties* internal_default_instance() { + return reinterpret_cast( + &_OpInfo_TensorProperties_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(OpInfo_TensorProperties* other); + void Swap(OpInfo_TensorProperties* other); + friend void swap(OpInfo_TensorProperties& a, OpInfo_TensorProperties& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpInfo_TensorProperties* New() const final { + return CreateMaybeMessage(NULL); + } + + OpInfo_TensorProperties* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpInfo_TensorProperties& from); + void MergeFrom(const OpInfo_TensorProperties& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpInfo_TensorProperties* other); + protected: + explicit OpInfo_TensorProperties(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.TensorShapeProto shape = 2; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 2; + private: + const ::diplomacy::tensorflow::TensorShapeProto& _internal_shape() const; + public: + const ::diplomacy::tensorflow::TensorShapeProto& shape() const; + ::diplomacy::tensorflow::TensorShapeProto* release_shape(); + ::diplomacy::tensorflow::TensorShapeProto* mutable_shape(); + void set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape); + void unsafe_arena_set_allocated_shape( + ::diplomacy::tensorflow::TensorShapeProto* shape); + ::diplomacy::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + + // .diplomacy.tensorflow.TensorProto value = 3; + bool has_value() const; + void clear_value(); + static const int kValueFieldNumber = 3; + private: + const ::diplomacy::tensorflow::TensorProto& _internal_value() const; + public: + const ::diplomacy::tensorflow::TensorProto& value() const; + ::diplomacy::tensorflow::TensorProto* release_value(); + ::diplomacy::tensorflow::TensorProto* mutable_value(); + void set_allocated_value(::diplomacy::tensorflow::TensorProto* value); + void unsafe_arena_set_allocated_value( + ::diplomacy::tensorflow::TensorProto* value); + ::diplomacy::tensorflow::TensorProto* unsafe_arena_release_value(); + + // .diplomacy.tensorflow.DataType dtype = 1; + void clear_dtype(); + static const int kDtypeFieldNumber = 1; + ::diplomacy::tensorflow::DataType dtype() const; + void set_dtype(::diplomacy::tensorflow::DataType value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpInfo.TensorProperties) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::TensorShapeProto* shape_; + ::diplomacy::tensorflow::TensorProto* value_; + int dtype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpInfo) */ { + public: + OpInfo(); + virtual ~OpInfo(); + + OpInfo(const OpInfo& from); + + inline OpInfo& operator=(const OpInfo& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpInfo(OpInfo&& from) noexcept + : OpInfo() { + *this = ::std::move(from); + } + + inline OpInfo& operator=(OpInfo&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpInfo* internal_default_instance() { + return reinterpret_cast( + &_OpInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(OpInfo* other); + void Swap(OpInfo* other); + friend void swap(OpInfo& a, OpInfo& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpInfo* New() const final { + return CreateMaybeMessage(NULL); + } + + OpInfo* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpInfo& from); + void MergeFrom(const OpInfo& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpInfo* other); + protected: + explicit OpInfo(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef OpInfo_TensorProperties TensorProperties; + + // accessors ------------------------------------------------------- + + // map attr = 2; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 2; + const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& + attr() const; + ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* + mutable_attr(); + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties inputs = 3; + int inputs_size() const; + void clear_inputs(); + static const int kInputsFieldNumber = 3; + ::diplomacy::tensorflow::OpInfo_TensorProperties* mutable_inputs(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >* + mutable_inputs(); + const ::diplomacy::tensorflow::OpInfo_TensorProperties& inputs(int index) const; + ::diplomacy::tensorflow::OpInfo_TensorProperties* add_inputs(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >& + inputs() const; + + // repeated .diplomacy.tensorflow.OpInfo.TensorProperties outputs = 5; + int outputs_size() const; + void clear_outputs(); + static const int kOutputsFieldNumber = 5; + ::diplomacy::tensorflow::OpInfo_TensorProperties* mutable_outputs(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >* + mutable_outputs(); + const ::diplomacy::tensorflow::OpInfo_TensorProperties& outputs(int index) const; + ::diplomacy::tensorflow::OpInfo_TensorProperties* add_outputs(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >& + outputs() const; + + // string op = 1; + void clear_op(); + static const int kOpFieldNumber = 1; + const ::std::string& op() const; + void set_op(const ::std::string& value); + #if LANG_CXX11 + void set_op(::std::string&& value); + #endif + void set_op(const char* value); + void set_op(const char* value, size_t size); + ::std::string* mutable_op(); + ::std::string* release_op(); + void set_allocated_op(::std::string* op); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_op(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_op( + ::std::string* op); + + // .diplomacy.tensorflow.DeviceProperties device = 4; + bool has_device() const; + void clear_device(); + static const int kDeviceFieldNumber = 4; + private: + const ::diplomacy::tensorflow::DeviceProperties& _internal_device() const; + public: + const ::diplomacy::tensorflow::DeviceProperties& device() const; + ::diplomacy::tensorflow::DeviceProperties* release_device(); + ::diplomacy::tensorflow::DeviceProperties* mutable_device(); + void set_allocated_device(::diplomacy::tensorflow::DeviceProperties* device); + void unsafe_arena_set_allocated_device( + ::diplomacy::tensorflow::DeviceProperties* device); + ::diplomacy::tensorflow::DeviceProperties* unsafe_arena_release_device(); + + // .diplomacy.tensorflow.SessionInfo session_info = 6; + bool has_session_info() const; + void clear_session_info(); + static const int kSessionInfoFieldNumber = 6; + private: + const ::diplomacy::tensorflow::SessionInfo& _internal_session_info() const; + public: + const ::diplomacy::tensorflow::SessionInfo& session_info() const; + ::diplomacy::tensorflow::SessionInfo* release_session_info(); + ::diplomacy::tensorflow::SessionInfo* mutable_session_info(); + void set_allocated_session_info(::diplomacy::tensorflow::SessionInfo* session_info); + void unsafe_arena_set_allocated_session_info( + ::diplomacy::tensorflow::SessionInfo* session_info); + ::diplomacy::tensorflow::SessionInfo* unsafe_arena_release_session_info(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::MapField< + OpInfo_AttrEntry_DoNotUse, + ::std::string, ::diplomacy::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > attr_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties > inputs_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties > outputs_; + ::google::protobuf::internal::ArenaStringPtr op_; + ::diplomacy::tensorflow::DeviceProperties* device_; + ::diplomacy::tensorflow::SessionInfo* session_info_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class NormalDistribution : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.NormalDistribution) */ { + public: + NormalDistribution(); + virtual ~NormalDistribution(); + + NormalDistribution(const NormalDistribution& from); + + inline NormalDistribution& operator=(const NormalDistribution& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NormalDistribution(NormalDistribution&& from) noexcept + : NormalDistribution() { + *this = ::std::move(from); + } + + inline NormalDistribution& operator=(NormalDistribution&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NormalDistribution& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NormalDistribution* internal_default_instance() { + return reinterpret_cast( + &_NormalDistribution_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(NormalDistribution* other); + void Swap(NormalDistribution* other); + friend void swap(NormalDistribution& a, NormalDistribution& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NormalDistribution* New() const final { + return CreateMaybeMessage(NULL); + } + + NormalDistribution* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NormalDistribution& from); + void MergeFrom(const NormalDistribution& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NormalDistribution* other); + protected: + explicit NormalDistribution(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // double mu = 1; + void clear_mu(); + static const int kMuFieldNumber = 1; + double mu() const; + void set_mu(double value); + + // double sigma = 2; + void clear_sigma(); + static const int kSigmaFieldNumber = 2; + double sigma() const; + void set_sigma(double value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NormalDistribution) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + double mu_; + double sigma_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class LogNormalDistribution : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.LogNormalDistribution) */ { + public: + LogNormalDistribution(); + virtual ~LogNormalDistribution(); + + LogNormalDistribution(const LogNormalDistribution& from); + + inline LogNormalDistribution& operator=(const LogNormalDistribution& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + LogNormalDistribution(LogNormalDistribution&& from) noexcept + : LogNormalDistribution() { + *this = ::std::move(from); + } + + inline LogNormalDistribution& operator=(LogNormalDistribution&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const LogNormalDistribution& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const LogNormalDistribution* internal_default_instance() { + return reinterpret_cast( + &_LogNormalDistribution_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(LogNormalDistribution* other); + void Swap(LogNormalDistribution* other); + friend void swap(LogNormalDistribution& a, LogNormalDistribution& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline LogNormalDistribution* New() const final { + return CreateMaybeMessage(NULL); + } + + LogNormalDistribution* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const LogNormalDistribution& from); + void MergeFrom(const LogNormalDistribution& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LogNormalDistribution* other); + protected: + explicit LogNormalDistribution(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // double mu = 1; + void clear_mu(); + static const int kMuFieldNumber = 1; + double mu() const; + void set_mu(double value); + + // double sigma = 2; + void clear_sigma(); + static const int kSigmaFieldNumber = 2; + double sigma() const; + void set_sigma(double value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.LogNormalDistribution) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + double mu_; + double sigma_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpPerformance_OpMemory : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpPerformance.OpMemory) */ { + public: + OpPerformance_OpMemory(); + virtual ~OpPerformance_OpMemory(); + + OpPerformance_OpMemory(const OpPerformance_OpMemory& from); + + inline OpPerformance_OpMemory& operator=(const OpPerformance_OpMemory& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpPerformance_OpMemory(OpPerformance_OpMemory&& from) noexcept + : OpPerformance_OpMemory() { + *this = ::std::move(from); + } + + inline OpPerformance_OpMemory& operator=(OpPerformance_OpMemory&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpPerformance_OpMemory& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpPerformance_OpMemory* internal_default_instance() { + return reinterpret_cast( + &_OpPerformance_OpMemory_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(OpPerformance_OpMemory* other); + void Swap(OpPerformance_OpMemory* other); + friend void swap(OpPerformance_OpMemory& a, OpPerformance_OpMemory& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpPerformance_OpMemory* New() const final { + return CreateMaybeMessage(NULL); + } + + OpPerformance_OpMemory* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpPerformance_OpMemory& from); + void MergeFrom(const OpPerformance_OpMemory& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpPerformance_OpMemory* other); + protected: + explicit OpPerformance_OpMemory(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 output_memory = 1; + int output_memory_size() const; + void clear_output_memory(); + static const int kOutputMemoryFieldNumber = 1; + ::google::protobuf::int64 output_memory(int index) const; + void set_output_memory(int index, ::google::protobuf::int64 value); + void add_output_memory(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + output_memory() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_output_memory(); + + // int64 temp_memory = 2; + void clear_temp_memory(); + static const int kTempMemoryFieldNumber = 2; + ::google::protobuf::int64 temp_memory() const; + void set_temp_memory(::google::protobuf::int64 value); + + // int64 device_temp_memory = 3 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_device_temp_memory(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kDeviceTempMemoryFieldNumber = 3; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 device_temp_memory() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_device_temp_memory(::google::protobuf::int64 value); + + // int64 persistent_memory = 4; + void clear_persistent_memory(); + static const int kPersistentMemoryFieldNumber = 4; + ::google::protobuf::int64 persistent_memory() const; + void set_persistent_memory(::google::protobuf::int64 value); + + // int64 device_persistent_memory = 5 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_device_persistent_memory(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kDevicePersistentMemoryFieldNumber = 5; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int64 device_persistent_memory() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_device_persistent_memory(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpPerformance.OpMemory) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > output_memory_; + mutable int _output_memory_cached_byte_size_; + ::google::protobuf::int64 temp_memory_; + ::google::protobuf::int64 device_temp_memory_; + ::google::protobuf::int64 persistent_memory_; + ::google::protobuf::int64 device_persistent_memory_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpPerformance : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpPerformance) */ { + public: + OpPerformance(); + virtual ~OpPerformance(); + + OpPerformance(const OpPerformance& from); + + inline OpPerformance& operator=(const OpPerformance& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpPerformance(OpPerformance&& from) noexcept + : OpPerformance() { + *this = ::std::move(from); + } + + inline OpPerformance& operator=(OpPerformance&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpPerformance& default_instance(); + + enum ExecutionTimeCase { + kExecutionTimeNormal = 10, + kExecutionTimeLogNormal = 11, + EXECUTION_TIME_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpPerformance* internal_default_instance() { + return reinterpret_cast( + &_OpPerformance_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(OpPerformance* other); + void Swap(OpPerformance* other); + friend void swap(OpPerformance& a, OpPerformance& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpPerformance* New() const final { + return CreateMaybeMessage(NULL); + } + + OpPerformance* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpPerformance& from); + void MergeFrom(const OpPerformance& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpPerformance* other); + protected: + explicit OpPerformance(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef OpPerformance_OpMemory OpMemory; + + // accessors ------------------------------------------------------- + + // string node = 5; + void clear_node(); + static const int kNodeFieldNumber = 5; + const ::std::string& node() const; + void set_node(const ::std::string& value); + #if LANG_CXX11 + void set_node(::std::string&& value); + #endif + void set_node(const char* value); + void set_node(const char* value, size_t size); + ::std::string* mutable_node(); + ::std::string* release_node(); + void set_allocated_node(::std::string* node); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + ::std::string* unsafe_arena_release_node(); + PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_node( + ::std::string* node); + + // .diplomacy.tensorflow.OpInfo op = 1; + bool has_op() const; + void clear_op(); + static const int kOpFieldNumber = 1; + private: + const ::diplomacy::tensorflow::OpInfo& _internal_op() const; + public: + const ::diplomacy::tensorflow::OpInfo& op() const; + ::diplomacy::tensorflow::OpInfo* release_op(); + ::diplomacy::tensorflow::OpInfo* mutable_op(); + void set_allocated_op(::diplomacy::tensorflow::OpInfo* op); + void unsafe_arena_set_allocated_op( + ::diplomacy::tensorflow::OpInfo* op); + ::diplomacy::tensorflow::OpInfo* unsafe_arena_release_op(); + + // .diplomacy.tensorflow.OpPerformance.OpMemory op_memory = 9; + bool has_op_memory() const; + void clear_op_memory(); + static const int kOpMemoryFieldNumber = 9; + private: + const ::diplomacy::tensorflow::OpPerformance_OpMemory& _internal_op_memory() const; + public: + const ::diplomacy::tensorflow::OpPerformance_OpMemory& op_memory() const; + ::diplomacy::tensorflow::OpPerformance_OpMemory* release_op_memory(); + ::diplomacy::tensorflow::OpPerformance_OpMemory* mutable_op_memory(); + void set_allocated_op_memory(::diplomacy::tensorflow::OpPerformance_OpMemory* op_memory); + void unsafe_arena_set_allocated_op_memory( + ::diplomacy::tensorflow::OpPerformance_OpMemory* op_memory); + ::diplomacy::tensorflow::OpPerformance_OpMemory* unsafe_arena_release_op_memory(); + + // .diplomacy.tensorflow.SessionInfo session_info = 12 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR bool has_session_info() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_session_info(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kSessionInfoFieldNumber = 12; + private: + const ::diplomacy::tensorflow::SessionInfo& _internal_session_info() const; + public: + GOOGLE_PROTOBUF_DEPRECATED_ATTR const ::diplomacy::tensorflow::SessionInfo& session_info() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::diplomacy::tensorflow::SessionInfo* release_session_info(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::diplomacy::tensorflow::SessionInfo* mutable_session_info(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_allocated_session_info(::diplomacy::tensorflow::SessionInfo* session_info); + GOOGLE_PROTOBUF_DEPRECATED_ATTR void unsafe_arena_set_allocated_session_info( + ::diplomacy::tensorflow::SessionInfo* session_info); + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::diplomacy::tensorflow::SessionInfo* unsafe_arena_release_session_info(); + + // int64 temporary_memory_size = 2; + void clear_temporary_memory_size(); + static const int kTemporaryMemorySizeFieldNumber = 2; + ::google::protobuf::int64 temporary_memory_size() const; + void set_temporary_memory_size(::google::protobuf::int64 value); + + // int64 compute_cost = 3; + void clear_compute_cost(); + static const int kComputeCostFieldNumber = 3; + ::google::protobuf::int64 compute_cost() const; + void set_compute_cost(::google::protobuf::int64 value); + + // double compute_efficiency = 4; + void clear_compute_efficiency(); + static const int kComputeEfficiencyFieldNumber = 4; + double compute_efficiency() const; + void set_compute_efficiency(double value); + + // int64 compute_time = 6; + void clear_compute_time(); + static const int kComputeTimeFieldNumber = 6; + ::google::protobuf::int64 compute_time() const; + void set_compute_time(::google::protobuf::int64 value); + + // int64 memory_time = 7; + void clear_memory_time(); + static const int kMemoryTimeFieldNumber = 7; + ::google::protobuf::int64 memory_time() const; + void set_memory_time(::google::protobuf::int64 value); + + // double memory_efficiency = 8; + void clear_memory_efficiency(); + static const int kMemoryEfficiencyFieldNumber = 8; + double memory_efficiency() const; + void set_memory_efficiency(double value); + + // .diplomacy.tensorflow.NormalDistribution execution_time_normal = 10; + bool has_execution_time_normal() const; + void clear_execution_time_normal(); + static const int kExecutionTimeNormalFieldNumber = 10; + private: + const ::diplomacy::tensorflow::NormalDistribution& _internal_execution_time_normal() const; + public: + const ::diplomacy::tensorflow::NormalDistribution& execution_time_normal() const; + ::diplomacy::tensorflow::NormalDistribution* release_execution_time_normal(); + ::diplomacy::tensorflow::NormalDistribution* mutable_execution_time_normal(); + void set_allocated_execution_time_normal(::diplomacy::tensorflow::NormalDistribution* execution_time_normal); + void unsafe_arena_set_allocated_execution_time_normal( + ::diplomacy::tensorflow::NormalDistribution* execution_time_normal); + ::diplomacy::tensorflow::NormalDistribution* unsafe_arena_release_execution_time_normal(); + + // .diplomacy.tensorflow.LogNormalDistribution execution_time_log_normal = 11; + bool has_execution_time_log_normal() const; + void clear_execution_time_log_normal(); + static const int kExecutionTimeLogNormalFieldNumber = 11; + private: + const ::diplomacy::tensorflow::LogNormalDistribution& _internal_execution_time_log_normal() const; + public: + const ::diplomacy::tensorflow::LogNormalDistribution& execution_time_log_normal() const; + ::diplomacy::tensorflow::LogNormalDistribution* release_execution_time_log_normal(); + ::diplomacy::tensorflow::LogNormalDistribution* mutable_execution_time_log_normal(); + void set_allocated_execution_time_log_normal(::diplomacy::tensorflow::LogNormalDistribution* execution_time_log_normal); + void unsafe_arena_set_allocated_execution_time_log_normal( + ::diplomacy::tensorflow::LogNormalDistribution* execution_time_log_normal); + ::diplomacy::tensorflow::LogNormalDistribution* unsafe_arena_release_execution_time_log_normal(); + + void clear_execution_time(); + ExecutionTimeCase execution_time_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpPerformance) + private: + void set_has_execution_time_normal(); + void set_has_execution_time_log_normal(); + + inline bool has_execution_time() const; + inline void clear_has_execution_time(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr node_; + ::diplomacy::tensorflow::OpInfo* op_; + ::diplomacy::tensorflow::OpPerformance_OpMemory* op_memory_; + ::diplomacy::tensorflow::SessionInfo* session_info_; + ::google::protobuf::int64 temporary_memory_size_; + ::google::protobuf::int64 compute_cost_; + double compute_efficiency_; + ::google::protobuf::int64 compute_time_; + ::google::protobuf::int64 memory_time_; + double memory_efficiency_; + union ExecutionTimeUnion { + ExecutionTimeUnion() {} + ::diplomacy::tensorflow::NormalDistribution* execution_time_normal_; + ::diplomacy::tensorflow::LogNormalDistribution* execution_time_log_normal_; + } execution_time_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class OpPerformanceList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.OpPerformanceList) */ { + public: + OpPerformanceList(); + virtual ~OpPerformanceList(); + + OpPerformanceList(const OpPerformanceList& from); + + inline OpPerformanceList& operator=(const OpPerformanceList& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + OpPerformanceList(OpPerformanceList&& from) noexcept + : OpPerformanceList() { + *this = ::std::move(from); + } + + inline OpPerformanceList& operator=(OpPerformanceList&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpPerformanceList& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const OpPerformanceList* internal_default_instance() { + return reinterpret_cast( + &_OpPerformanceList_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(OpPerformanceList* other); + void Swap(OpPerformanceList* other); + friend void swap(OpPerformanceList& a, OpPerformanceList& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline OpPerformanceList* New() const final { + return CreateMaybeMessage(NULL); + } + + OpPerformanceList* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const OpPerformanceList& from); + void MergeFrom(const OpPerformanceList& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(OpPerformanceList* other); + protected: + explicit OpPerformanceList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.OpPerformance op_performance = 1; + int op_performance_size() const; + void clear_op_performance(); + static const int kOpPerformanceFieldNumber = 1; + ::diplomacy::tensorflow::OpPerformance* mutable_op_performance(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpPerformance >* + mutable_op_performance(); + const ::diplomacy::tensorflow::OpPerformance& op_performance(int index) const; + ::diplomacy::tensorflow::OpPerformance* add_op_performance(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpPerformance >& + op_performance() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpPerformanceList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpPerformance > op_performance_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// SessionInfo + +// int64 intra_op_parallelism = 1; +inline void SessionInfo::clear_intra_op_parallelism() { + intra_op_parallelism_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 SessionInfo::intra_op_parallelism() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SessionInfo.intra_op_parallelism) + return intra_op_parallelism_; +} +inline void SessionInfo::set_intra_op_parallelism(::google::protobuf::int64 value) { + + intra_op_parallelism_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SessionInfo.intra_op_parallelism) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// OpInfo_TensorProperties + +// .diplomacy.tensorflow.DataType dtype = 1; +inline void OpInfo_TensorProperties::clear_dtype() { + dtype_ = 0; +} +inline ::diplomacy::tensorflow::DataType OpInfo_TensorProperties::dtype() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.TensorProperties.dtype) + return static_cast< ::diplomacy::tensorflow::DataType >(dtype_); +} +inline void OpInfo_TensorProperties::set_dtype(::diplomacy::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpInfo.TensorProperties.dtype) +} + +// .diplomacy.tensorflow.TensorShapeProto shape = 2; +inline bool OpInfo_TensorProperties::has_shape() const { + return this != internal_default_instance() && shape_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& OpInfo_TensorProperties::_internal_shape() const { + return *shape_; +} +inline const ::diplomacy::tensorflow::TensorShapeProto& OpInfo_TensorProperties::shape() const { + const ::diplomacy::tensorflow::TensorShapeProto* p = shape_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.TensorProperties.shape) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorShapeProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorShapeProto* OpInfo_TensorProperties::release_shape() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpInfo.TensorProperties.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* OpInfo_TensorProperties::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpInfo.TensorProperties.shape) + + ::diplomacy::tensorflow::TensorShapeProto* temp = shape_; + shape_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorShapeProto* OpInfo_TensorProperties::mutable_shape() { + + if (shape_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorShapeProto>(GetArenaNoVirtual()); + shape_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpInfo.TensorProperties.shape) + return shape_; +} +inline void OpInfo_TensorProperties::set_allocated_shape(::diplomacy::tensorflow::TensorShapeProto* shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(shape_); + } + if (shape) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(shape)->GetArena(); + if (message_arena != submessage_arena) { + shape = ::google::protobuf::internal::GetOwnedMessage( + message_arena, shape, submessage_arena); + } + + } else { + + } + shape_ = shape; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpInfo.TensorProperties.shape) +} + +// .diplomacy.tensorflow.TensorProto value = 3; +inline bool OpInfo_TensorProperties::has_value() const { + return this != internal_default_instance() && value_ != NULL; +} +inline const ::diplomacy::tensorflow::TensorProto& OpInfo_TensorProperties::_internal_value() const { + return *value_; +} +inline const ::diplomacy::tensorflow::TensorProto& OpInfo_TensorProperties::value() const { + const ::diplomacy::tensorflow::TensorProto* p = value_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.TensorProperties.value) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_TensorProto_default_instance_); +} +inline ::diplomacy::tensorflow::TensorProto* OpInfo_TensorProperties::release_value() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpInfo.TensorProperties.value) + + ::diplomacy::tensorflow::TensorProto* temp = value_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorProto* OpInfo_TensorProperties::unsafe_arena_release_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpInfo.TensorProperties.value) + + ::diplomacy::tensorflow::TensorProto* temp = value_; + value_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::TensorProto* OpInfo_TensorProperties::mutable_value() { + + if (value_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::TensorProto>(GetArenaNoVirtual()); + value_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpInfo.TensorProperties.value) + return value_; +} +inline void OpInfo_TensorProperties::set_allocated_value(::diplomacy::tensorflow::TensorProto* value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(value_); + } + if (value) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage( + message_arena, value, submessage_arena); + } + + } else { + + } + value_ = value; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpInfo.TensorProperties.value) +} + +// ------------------------------------------------------------------- + +// OpInfo + +// string op = 1; +inline void OpInfo::clear_op() { + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpInfo::op() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.op) + return op_.Get(); +} +inline void OpInfo::set_op(const ::std::string& value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpInfo.op) +} +#if LANG_CXX11 +inline void OpInfo::set_op(::std::string&& value) { + + op_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpInfo.op) +} +#endif +inline void OpInfo::set_op(const char* value) { + GOOGLE_DCHECK(value != NULL); + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpInfo.op) +} +inline void OpInfo::set_op(const char* value, + size_t size) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpInfo.op) +} +inline ::std::string* OpInfo::mutable_op() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpInfo.op) + return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpInfo::release_op() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpInfo.op) + + return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpInfo::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpInfo.op) +} +inline ::std::string* OpInfo::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpInfo.op) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpInfo::unsafe_arena_set_allocated_op( + ::std::string* op) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op != NULL) { + + } else { + + } + op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpInfo.op) +} + +// map attr = 2; +inline int OpInfo::attr_size() const { + return attr_.size(); +} +inline const ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >& +OpInfo::attr() const { + // @@protoc_insertion_point(field_map:diplomacy.tensorflow.OpInfo.attr) + return attr_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::AttrValue >* +OpInfo::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:diplomacy.tensorflow.OpInfo.attr) + return attr_.MutableMap(); +} + +// repeated .diplomacy.tensorflow.OpInfo.TensorProperties inputs = 3; +inline int OpInfo::inputs_size() const { + return inputs_.size(); +} +inline void OpInfo::clear_inputs() { + inputs_.Clear(); +} +inline ::diplomacy::tensorflow::OpInfo_TensorProperties* OpInfo::mutable_inputs(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpInfo.inputs) + return inputs_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >* +OpInfo::mutable_inputs() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpInfo.inputs) + return &inputs_; +} +inline const ::diplomacy::tensorflow::OpInfo_TensorProperties& OpInfo::inputs(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.inputs) + return inputs_.Get(index); +} +inline ::diplomacy::tensorflow::OpInfo_TensorProperties* OpInfo::add_inputs() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpInfo.inputs) + return inputs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >& +OpInfo::inputs() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpInfo.inputs) + return inputs_; +} + +// repeated .diplomacy.tensorflow.OpInfo.TensorProperties outputs = 5; +inline int OpInfo::outputs_size() const { + return outputs_.size(); +} +inline void OpInfo::clear_outputs() { + outputs_.Clear(); +} +inline ::diplomacy::tensorflow::OpInfo_TensorProperties* OpInfo::mutable_outputs(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpInfo.outputs) + return outputs_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >* +OpInfo::mutable_outputs() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpInfo.outputs) + return &outputs_; +} +inline const ::diplomacy::tensorflow::OpInfo_TensorProperties& OpInfo::outputs(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.outputs) + return outputs_.Get(index); +} +inline ::diplomacy::tensorflow::OpInfo_TensorProperties* OpInfo::add_outputs() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpInfo.outputs) + return outputs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpInfo_TensorProperties >& +OpInfo::outputs() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpInfo.outputs) + return outputs_; +} + +// .diplomacy.tensorflow.DeviceProperties device = 4; +inline bool OpInfo::has_device() const { + return this != internal_default_instance() && device_ != NULL; +} +inline const ::diplomacy::tensorflow::DeviceProperties& OpInfo::_internal_device() const { + return *device_; +} +inline const ::diplomacy::tensorflow::DeviceProperties& OpInfo::device() const { + const ::diplomacy::tensorflow::DeviceProperties* p = device_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.device) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_DeviceProperties_default_instance_); +} +inline ::diplomacy::tensorflow::DeviceProperties* OpInfo::release_device() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpInfo.device) + + ::diplomacy::tensorflow::DeviceProperties* temp = device_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + device_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::DeviceProperties* OpInfo::unsafe_arena_release_device() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpInfo.device) + + ::diplomacy::tensorflow::DeviceProperties* temp = device_; + device_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::DeviceProperties* OpInfo::mutable_device() { + + if (device_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::DeviceProperties>(GetArenaNoVirtual()); + device_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpInfo.device) + return device_; +} +inline void OpInfo::set_allocated_device(::diplomacy::tensorflow::DeviceProperties* device) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(device_); + } + if (device) { + ::google::protobuf::Arena* submessage_arena = + reinterpret_cast<::google::protobuf::MessageLite*>(device)->GetArena(); + if (message_arena != submessage_arena) { + device = ::google::protobuf::internal::GetOwnedMessage( + message_arena, device, submessage_arena); + } + + } else { + + } + device_ = device; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpInfo.device) +} + +// .diplomacy.tensorflow.SessionInfo session_info = 6; +inline bool OpInfo::has_session_info() const { + return this != internal_default_instance() && session_info_ != NULL; +} +inline void OpInfo::clear_session_info() { + if (GetArenaNoVirtual() == NULL && session_info_ != NULL) { + delete session_info_; + } + session_info_ = NULL; +} +inline const ::diplomacy::tensorflow::SessionInfo& OpInfo::_internal_session_info() const { + return *session_info_; +} +inline const ::diplomacy::tensorflow::SessionInfo& OpInfo::session_info() const { + const ::diplomacy::tensorflow::SessionInfo* p = session_info_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpInfo.session_info) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_SessionInfo_default_instance_); +} +inline ::diplomacy::tensorflow::SessionInfo* OpInfo::release_session_info() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpInfo.session_info) + + ::diplomacy::tensorflow::SessionInfo* temp = session_info_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + session_info_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SessionInfo* OpInfo::unsafe_arena_release_session_info() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpInfo.session_info) + + ::diplomacy::tensorflow::SessionInfo* temp = session_info_; + session_info_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SessionInfo* OpInfo::mutable_session_info() { + + if (session_info_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::SessionInfo>(GetArenaNoVirtual()); + session_info_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpInfo.session_info) + return session_info_; +} +inline void OpInfo::set_allocated_session_info(::diplomacy::tensorflow::SessionInfo* session_info) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete session_info_; + } + if (session_info) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(session_info); + if (message_arena != submessage_arena) { + session_info = ::google::protobuf::internal::GetOwnedMessage( + message_arena, session_info, submessage_arena); + } + + } else { + + } + session_info_ = session_info; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpInfo.session_info) +} + +// ------------------------------------------------------------------- + +// NormalDistribution + +// double mu = 1; +inline void NormalDistribution::clear_mu() { + mu_ = 0; +} +inline double NormalDistribution::mu() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NormalDistribution.mu) + return mu_; +} +inline void NormalDistribution::set_mu(double value) { + + mu_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NormalDistribution.mu) +} + +// double sigma = 2; +inline void NormalDistribution::clear_sigma() { + sigma_ = 0; +} +inline double NormalDistribution::sigma() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.NormalDistribution.sigma) + return sigma_; +} +inline void NormalDistribution::set_sigma(double value) { + + sigma_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.NormalDistribution.sigma) +} + +// ------------------------------------------------------------------- + +// LogNormalDistribution + +// double mu = 1; +inline void LogNormalDistribution::clear_mu() { + mu_ = 0; +} +inline double LogNormalDistribution::mu() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.LogNormalDistribution.mu) + return mu_; +} +inline void LogNormalDistribution::set_mu(double value) { + + mu_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.LogNormalDistribution.mu) +} + +// double sigma = 2; +inline void LogNormalDistribution::clear_sigma() { + sigma_ = 0; +} +inline double LogNormalDistribution::sigma() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.LogNormalDistribution.sigma) + return sigma_; +} +inline void LogNormalDistribution::set_sigma(double value) { + + sigma_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.LogNormalDistribution.sigma) +} + +// ------------------------------------------------------------------- + +// OpPerformance_OpMemory + +// repeated int64 output_memory = 1; +inline int OpPerformance_OpMemory::output_memory_size() const { + return output_memory_.size(); +} +inline void OpPerformance_OpMemory::clear_output_memory() { + output_memory_.Clear(); +} +inline ::google::protobuf::int64 OpPerformance_OpMemory::output_memory(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.OpMemory.output_memory) + return output_memory_.Get(index); +} +inline void OpPerformance_OpMemory::set_output_memory(int index, ::google::protobuf::int64 value) { + output_memory_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.OpMemory.output_memory) +} +inline void OpPerformance_OpMemory::add_output_memory(::google::protobuf::int64 value) { + output_memory_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpPerformance.OpMemory.output_memory) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +OpPerformance_OpMemory::output_memory() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpPerformance.OpMemory.output_memory) + return output_memory_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +OpPerformance_OpMemory::mutable_output_memory() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpPerformance.OpMemory.output_memory) + return &output_memory_; +} + +// int64 temp_memory = 2; +inline void OpPerformance_OpMemory::clear_temp_memory() { + temp_memory_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance_OpMemory::temp_memory() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.OpMemory.temp_memory) + return temp_memory_; +} +inline void OpPerformance_OpMemory::set_temp_memory(::google::protobuf::int64 value) { + + temp_memory_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.OpMemory.temp_memory) +} + +// int64 persistent_memory = 4; +inline void OpPerformance_OpMemory::clear_persistent_memory() { + persistent_memory_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance_OpMemory::persistent_memory() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.OpMemory.persistent_memory) + return persistent_memory_; +} +inline void OpPerformance_OpMemory::set_persistent_memory(::google::protobuf::int64 value) { + + persistent_memory_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.OpMemory.persistent_memory) +} + +// int64 device_temp_memory = 3 [deprecated = true]; +inline void OpPerformance_OpMemory::clear_device_temp_memory() { + device_temp_memory_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance_OpMemory::device_temp_memory() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.OpMemory.device_temp_memory) + return device_temp_memory_; +} +inline void OpPerformance_OpMemory::set_device_temp_memory(::google::protobuf::int64 value) { + + device_temp_memory_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.OpMemory.device_temp_memory) +} + +// int64 device_persistent_memory = 5 [deprecated = true]; +inline void OpPerformance_OpMemory::clear_device_persistent_memory() { + device_persistent_memory_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance_OpMemory::device_persistent_memory() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.OpMemory.device_persistent_memory) + return device_persistent_memory_; +} +inline void OpPerformance_OpMemory::set_device_persistent_memory(::google::protobuf::int64 value) { + + device_persistent_memory_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.OpMemory.device_persistent_memory) +} + +// ------------------------------------------------------------------- + +// OpPerformance + +// .diplomacy.tensorflow.OpInfo op = 1; +inline bool OpPerformance::has_op() const { + return this != internal_default_instance() && op_ != NULL; +} +inline void OpPerformance::clear_op() { + if (GetArenaNoVirtual() == NULL && op_ != NULL) { + delete op_; + } + op_ = NULL; +} +inline const ::diplomacy::tensorflow::OpInfo& OpPerformance::_internal_op() const { + return *op_; +} +inline const ::diplomacy::tensorflow::OpInfo& OpPerformance::op() const { + const ::diplomacy::tensorflow::OpInfo* p = op_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.op) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_OpInfo_default_instance_); +} +inline ::diplomacy::tensorflow::OpInfo* OpPerformance::release_op() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpPerformance.op) + + ::diplomacy::tensorflow::OpInfo* temp = op_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + op_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpInfo* OpPerformance::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpPerformance.op) + + ::diplomacy::tensorflow::OpInfo* temp = op_; + op_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpInfo* OpPerformance::mutable_op() { + + if (op_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::OpInfo>(GetArenaNoVirtual()); + op_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpPerformance.op) + return op_; +} +inline void OpPerformance::set_allocated_op(::diplomacy::tensorflow::OpInfo* op) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete op_; + } + if (op) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(op); + if (message_arena != submessage_arena) { + op = ::google::protobuf::internal::GetOwnedMessage( + message_arena, op, submessage_arena); + } + + } else { + + } + op_ = op; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpPerformance.op) +} + +// .diplomacy.tensorflow.SessionInfo session_info = 12 [deprecated = true]; +inline bool OpPerformance::has_session_info() const { + return this != internal_default_instance() && session_info_ != NULL; +} +inline void OpPerformance::clear_session_info() { + if (GetArenaNoVirtual() == NULL && session_info_ != NULL) { + delete session_info_; + } + session_info_ = NULL; +} +inline const ::diplomacy::tensorflow::SessionInfo& OpPerformance::_internal_session_info() const { + return *session_info_; +} +inline const ::diplomacy::tensorflow::SessionInfo& OpPerformance::session_info() const { + const ::diplomacy::tensorflow::SessionInfo* p = session_info_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.session_info) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_SessionInfo_default_instance_); +} +inline ::diplomacy::tensorflow::SessionInfo* OpPerformance::release_session_info() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpPerformance.session_info) + + ::diplomacy::tensorflow::SessionInfo* temp = session_info_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + session_info_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SessionInfo* OpPerformance::unsafe_arena_release_session_info() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpPerformance.session_info) + + ::diplomacy::tensorflow::SessionInfo* temp = session_info_; + session_info_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::SessionInfo* OpPerformance::mutable_session_info() { + + if (session_info_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::SessionInfo>(GetArenaNoVirtual()); + session_info_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpPerformance.session_info) + return session_info_; +} +inline void OpPerformance::set_allocated_session_info(::diplomacy::tensorflow::SessionInfo* session_info) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete session_info_; + } + if (session_info) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(session_info); + if (message_arena != submessage_arena) { + session_info = ::google::protobuf::internal::GetOwnedMessage( + message_arena, session_info, submessage_arena); + } + + } else { + + } + session_info_ = session_info; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpPerformance.session_info) +} + +// string node = 5; +inline void OpPerformance::clear_node() { + node_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpPerformance::node() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.node) + return node_.Get(); +} +inline void OpPerformance::set_node(const ::std::string& value) { + + node_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.node) +} +#if LANG_CXX11 +inline void OpPerformance::set_node(::std::string&& value) { + + node_.Set( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.OpPerformance.node) +} +#endif +inline void OpPerformance::set_node(const char* value) { + GOOGLE_DCHECK(value != NULL); + + node_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.OpPerformance.node) +} +inline void OpPerformance::set_node(const char* value, + size_t size) { + + node_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.OpPerformance.node) +} +inline ::std::string* OpPerformance::mutable_node() { + + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpPerformance.node) + return node_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpPerformance::release_node() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpPerformance.node) + + return node_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline void OpPerformance::set_allocated_node(::std::string* node) { + if (node != NULL) { + + } else { + + } + node_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), node, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpPerformance.node) +} +inline ::std::string* OpPerformance::unsafe_arena_release_node() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpPerformance.node) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return node_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpPerformance::unsafe_arena_set_allocated_node( + ::std::string* node) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (node != NULL) { + + } else { + + } + node_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + node, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpPerformance.node) +} + +// int64 temporary_memory_size = 2; +inline void OpPerformance::clear_temporary_memory_size() { + temporary_memory_size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance::temporary_memory_size() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.temporary_memory_size) + return temporary_memory_size_; +} +inline void OpPerformance::set_temporary_memory_size(::google::protobuf::int64 value) { + + temporary_memory_size_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.temporary_memory_size) +} + +// int64 compute_cost = 3; +inline void OpPerformance::clear_compute_cost() { + compute_cost_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance::compute_cost() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.compute_cost) + return compute_cost_; +} +inline void OpPerformance::set_compute_cost(::google::protobuf::int64 value) { + + compute_cost_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.compute_cost) +} + +// int64 compute_time = 6; +inline void OpPerformance::clear_compute_time() { + compute_time_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance::compute_time() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.compute_time) + return compute_time_; +} +inline void OpPerformance::set_compute_time(::google::protobuf::int64 value) { + + compute_time_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.compute_time) +} + +// int64 memory_time = 7; +inline void OpPerformance::clear_memory_time() { + memory_time_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpPerformance::memory_time() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.memory_time) + return memory_time_; +} +inline void OpPerformance::set_memory_time(::google::protobuf::int64 value) { + + memory_time_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.memory_time) +} + +// double compute_efficiency = 4; +inline void OpPerformance::clear_compute_efficiency() { + compute_efficiency_ = 0; +} +inline double OpPerformance::compute_efficiency() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.compute_efficiency) + return compute_efficiency_; +} +inline void OpPerformance::set_compute_efficiency(double value) { + + compute_efficiency_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.compute_efficiency) +} + +// double memory_efficiency = 8; +inline void OpPerformance::clear_memory_efficiency() { + memory_efficiency_ = 0; +} +inline double OpPerformance::memory_efficiency() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.memory_efficiency) + return memory_efficiency_; +} +inline void OpPerformance::set_memory_efficiency(double value) { + + memory_efficiency_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.OpPerformance.memory_efficiency) +} + +// .diplomacy.tensorflow.NormalDistribution execution_time_normal = 10; +inline bool OpPerformance::has_execution_time_normal() const { + return execution_time_case() == kExecutionTimeNormal; +} +inline void OpPerformance::set_has_execution_time_normal() { + _oneof_case_[0] = kExecutionTimeNormal; +} +inline void OpPerformance::clear_execution_time_normal() { + if (has_execution_time_normal()) { + if (GetArenaNoVirtual() == NULL) { + delete execution_time_.execution_time_normal_; + } + clear_has_execution_time(); + } +} +inline const ::diplomacy::tensorflow::NormalDistribution& OpPerformance::_internal_execution_time_normal() const { + return *execution_time_.execution_time_normal_; +} +inline ::diplomacy::tensorflow::NormalDistribution* OpPerformance::release_execution_time_normal() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpPerformance.execution_time_normal) + if (has_execution_time_normal()) { + clear_has_execution_time(); + ::diplomacy::tensorflow::NormalDistribution* temp = execution_time_.execution_time_normal_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + execution_time_.execution_time_normal_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::NormalDistribution& OpPerformance::execution_time_normal() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.execution_time_normal) + return has_execution_time_normal() + ? *execution_time_.execution_time_normal_ + : *reinterpret_cast< ::diplomacy::tensorflow::NormalDistribution*>(&::diplomacy::tensorflow::_NormalDistribution_default_instance_); +} +inline ::diplomacy::tensorflow::NormalDistribution* OpPerformance::unsafe_arena_release_execution_time_normal() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpPerformance.execution_time_normal) + if (has_execution_time_normal()) { + clear_has_execution_time(); + ::diplomacy::tensorflow::NormalDistribution* temp = execution_time_.execution_time_normal_; + execution_time_.execution_time_normal_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OpPerformance::unsafe_arena_set_allocated_execution_time_normal(::diplomacy::tensorflow::NormalDistribution* execution_time_normal) { + clear_execution_time(); + if (execution_time_normal) { + set_has_execution_time_normal(); + execution_time_.execution_time_normal_ = execution_time_normal; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpPerformance.execution_time_normal) +} +inline ::diplomacy::tensorflow::NormalDistribution* OpPerformance::mutable_execution_time_normal() { + if (!has_execution_time_normal()) { + clear_execution_time(); + set_has_execution_time_normal(); + execution_time_.execution_time_normal_ = CreateMaybeMessage< ::diplomacy::tensorflow::NormalDistribution >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpPerformance.execution_time_normal) + return execution_time_.execution_time_normal_; +} + +// .diplomacy.tensorflow.LogNormalDistribution execution_time_log_normal = 11; +inline bool OpPerformance::has_execution_time_log_normal() const { + return execution_time_case() == kExecutionTimeLogNormal; +} +inline void OpPerformance::set_has_execution_time_log_normal() { + _oneof_case_[0] = kExecutionTimeLogNormal; +} +inline void OpPerformance::clear_execution_time_log_normal() { + if (has_execution_time_log_normal()) { + if (GetArenaNoVirtual() == NULL) { + delete execution_time_.execution_time_log_normal_; + } + clear_has_execution_time(); + } +} +inline const ::diplomacy::tensorflow::LogNormalDistribution& OpPerformance::_internal_execution_time_log_normal() const { + return *execution_time_.execution_time_log_normal_; +} +inline ::diplomacy::tensorflow::LogNormalDistribution* OpPerformance::release_execution_time_log_normal() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpPerformance.execution_time_log_normal) + if (has_execution_time_log_normal()) { + clear_has_execution_time(); + ::diplomacy::tensorflow::LogNormalDistribution* temp = execution_time_.execution_time_log_normal_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + execution_time_.execution_time_log_normal_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::LogNormalDistribution& OpPerformance::execution_time_log_normal() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.execution_time_log_normal) + return has_execution_time_log_normal() + ? *execution_time_.execution_time_log_normal_ + : *reinterpret_cast< ::diplomacy::tensorflow::LogNormalDistribution*>(&::diplomacy::tensorflow::_LogNormalDistribution_default_instance_); +} +inline ::diplomacy::tensorflow::LogNormalDistribution* OpPerformance::unsafe_arena_release_execution_time_log_normal() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpPerformance.execution_time_log_normal) + if (has_execution_time_log_normal()) { + clear_has_execution_time(); + ::diplomacy::tensorflow::LogNormalDistribution* temp = execution_time_.execution_time_log_normal_; + execution_time_.execution_time_log_normal_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OpPerformance::unsafe_arena_set_allocated_execution_time_log_normal(::diplomacy::tensorflow::LogNormalDistribution* execution_time_log_normal) { + clear_execution_time(); + if (execution_time_log_normal) { + set_has_execution_time_log_normal(); + execution_time_.execution_time_log_normal_ = execution_time_log_normal; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.OpPerformance.execution_time_log_normal) +} +inline ::diplomacy::tensorflow::LogNormalDistribution* OpPerformance::mutable_execution_time_log_normal() { + if (!has_execution_time_log_normal()) { + clear_execution_time(); + set_has_execution_time_log_normal(); + execution_time_.execution_time_log_normal_ = CreateMaybeMessage< ::diplomacy::tensorflow::LogNormalDistribution >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpPerformance.execution_time_log_normal) + return execution_time_.execution_time_log_normal_; +} + +// .diplomacy.tensorflow.OpPerformance.OpMemory op_memory = 9; +inline bool OpPerformance::has_op_memory() const { + return this != internal_default_instance() && op_memory_ != NULL; +} +inline void OpPerformance::clear_op_memory() { + if (GetArenaNoVirtual() == NULL && op_memory_ != NULL) { + delete op_memory_; + } + op_memory_ = NULL; +} +inline const ::diplomacy::tensorflow::OpPerformance_OpMemory& OpPerformance::_internal_op_memory() const { + return *op_memory_; +} +inline const ::diplomacy::tensorflow::OpPerformance_OpMemory& OpPerformance::op_memory() const { + const ::diplomacy::tensorflow::OpPerformance_OpMemory* p = op_memory_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformance.op_memory) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::_OpPerformance_OpMemory_default_instance_); +} +inline ::diplomacy::tensorflow::OpPerformance_OpMemory* OpPerformance::release_op_memory() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.OpPerformance.op_memory) + + ::diplomacy::tensorflow::OpPerformance_OpMemory* temp = op_memory_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + op_memory_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpPerformance_OpMemory* OpPerformance::unsafe_arena_release_op_memory() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.OpPerformance.op_memory) + + ::diplomacy::tensorflow::OpPerformance_OpMemory* temp = op_memory_; + op_memory_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::OpPerformance_OpMemory* OpPerformance::mutable_op_memory() { + + if (op_memory_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::OpPerformance_OpMemory>(GetArenaNoVirtual()); + op_memory_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpPerformance.op_memory) + return op_memory_; +} +inline void OpPerformance::set_allocated_op_memory(::diplomacy::tensorflow::OpPerformance_OpMemory* op_memory) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete op_memory_; + } + if (op_memory) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(op_memory); + if (message_arena != submessage_arena) { + op_memory = ::google::protobuf::internal::GetOwnedMessage( + message_arena, op_memory, submessage_arena); + } + + } else { + + } + op_memory_ = op_memory; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.OpPerformance.op_memory) +} + +inline bool OpPerformance::has_execution_time() const { + return execution_time_case() != EXECUTION_TIME_NOT_SET; +} +inline void OpPerformance::clear_has_execution_time() { + _oneof_case_[0] = EXECUTION_TIME_NOT_SET; +} +inline OpPerformance::ExecutionTimeCase OpPerformance::execution_time_case() const { + return OpPerformance::ExecutionTimeCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// OpPerformanceList + +// repeated .diplomacy.tensorflow.OpPerformance op_performance = 1; +inline int OpPerformanceList::op_performance_size() const { + return op_performance_.size(); +} +inline void OpPerformanceList::clear_op_performance() { + op_performance_.Clear(); +} +inline ::diplomacy::tensorflow::OpPerformance* OpPerformanceList::mutable_op_performance(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.OpPerformanceList.op_performance) + return op_performance_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpPerformance >* +OpPerformanceList::mutable_op_performance() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.OpPerformanceList.op_performance) + return &op_performance_; +} +inline const ::diplomacy::tensorflow::OpPerformance& OpPerformanceList::op_performance(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.OpPerformanceList.op_performance) + return op_performance_.Get(index); +} +inline ::diplomacy::tensorflow::OpPerformance* OpPerformanceList::add_op_performance() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.OpPerformanceList.op_performance) + return op_performance_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::OpPerformance >& +OpPerformanceList::op_performance() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.OpPerformanceList.op_performance) + return op_performance_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fgrappler_2fcosts_2fop_5fperformance_5fdata_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto new file mode 100644 index 0000000..c321ace --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto @@ -0,0 +1,123 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +syntax = "proto3"; + +package diplomacy.tensorflow; +option cc_enable_arenas = true; + +import "diplomacy_tensorflow/core/framework/tensor.proto"; +import "diplomacy_tensorflow/core/framework/tensor_shape.proto"; +import "diplomacy_tensorflow/core/framework/types.proto"; +import "diplomacy_tensorflow/core/framework/attr_value.proto"; +import "diplomacy_tensorflow/core/protobuf/device_properties.proto"; + +// Description of the session when an op is run. +message SessionInfo { + int64 intra_op_parallelism = 1; +} + +// Description of an operation as well as the parameters expected to impact its +// performance. +message OpInfo { + // The operation name. There may be custom parameters in attrs. + string op = 1; + + // Custom parameters impacting the behavior of the op. + map attr = 2; + + // Input data types, shapes and values if known. + message TensorProperties { + DataType dtype = 1; + TensorShapeProto shape = 2; + TensorProto value = 3; + }; + repeated TensorProperties inputs = 3; + + // Optional description of the op outputs + repeated TensorProperties outputs = 5; + + // Device on which the operation is run. + DeviceProperties device = 4; + + // Information about the session configs. + SessionInfo session_info = 6; +} + +message NormalDistribution { + double mu = 1; + double sigma = 2; +} + +message LogNormalDistribution { + double mu = 1; + double sigma = 2; +} + +// Performance data for tensorflow operations +message OpPerformance { + // The op + OpInfo op = 1; + + // Information about the session configs. + SessionInfo session_info = 12 [deprecated = true]; + + // The node name (optional). Makes it easier to associate the performance data + // with a specific graph node. + string node = 5; + + // Temporary memory used by this node (in bytes). + int64 temporary_memory_size = 2; + + // Time it takes to run the op (in nanoseconds). + int64 compute_cost = 3; + + // Analytical compute cost (in nanoseconds). + int64 compute_time = 6; + + // Analytical memory access cost (in nanoseconds). + int64 memory_time = 7; + + // Percentage of theoretical compute performance. + double compute_efficiency = 4; + + // Percentage of theoretical memory performance. + double memory_efficiency = 8; + + // Expected execution time, modeled using one of 2 possible distributions. + oneof execution_time { + NormalDistribution execution_time_normal = 10; + LogNormalDistribution execution_time_log_normal = 11; + }; + + // Memory usage data for a tensorflow operation. + message OpMemory { + // The output information may have memory usage and output shapes. + repeated int64 output_memory = 1; + + // Temp and persistent memory allocated by this node. + int64 temp_memory = 2; + int64 persistent_memory = 4; + + int64 device_temp_memory = 3 [deprecated = true]; + int64 device_persistent_memory = 5 [deprecated = true]; + } + OpMemory op_memory = 9; +} + +// A collection of OpPerformance data points. +message OpPerformanceList { + repeated OpPerformance op_performance = 1; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data_pb2.py new file mode 100644 index 0000000..05f9345 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/grappler/costs/op_performance_data_pb2.py @@ -0,0 +1,591 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from diplomacy_tensorflow.core.framework import tensor_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2 +from diplomacy_tensorflow.core.framework import tensor_shape_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 +from diplomacy_tensorflow.core.framework import types_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2 +from diplomacy_tensorflow.core.framework import attr_value_pb2 as diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2 +from diplomacy_tensorflow.core.protobuf import device_properties_pb2 as diplomacy__tensorflow_dot_core_dot_protobuf_dot_device__properties__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/grappler/costs/op_performance_data.proto', + package='diplomacy.tensorflow', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\nBdiplomacy_tensorflow/core/grappler/costs/op_performance_data.proto\x12\x14\x64iplomacy.tensorflow\x1a\x30\x64iplomacy_tensorflow/core/framework/tensor.proto\x1a\x36\x64iplomacy_tensorflow/core/framework/tensor_shape.proto\x1a/diplomacy_tensorflow/core/framework/types.proto\x1a\x34\x64iplomacy_tensorflow/core/framework/attr_value.proto\x1a:diplomacy_tensorflow/core/protobuf/device_properties.proto\"+\n\x0bSessionInfo\x12\x1c\n\x14intra_op_parallelism\x18\x01 \x01(\x03\"\xb5\x04\n\x06OpInfo\x12\n\n\x02op\x18\x01 \x01(\t\x12\x34\n\x04\x61ttr\x18\x02 \x03(\x0b\x32&.diplomacy.tensorflow.OpInfo.AttrEntry\x12=\n\x06inputs\x18\x03 \x03(\x0b\x32-.diplomacy.tensorflow.OpInfo.TensorProperties\x12>\n\x07outputs\x18\x05 \x03(\x0b\x32-.diplomacy.tensorflow.OpInfo.TensorProperties\x12\x36\n\x06\x64\x65vice\x18\x04 \x01(\x0b\x32&.diplomacy.tensorflow.DeviceProperties\x12\x37\n\x0csession_info\x18\x06 \x01(\x0b\x32!.diplomacy.tensorflow.SessionInfo\x1aL\n\tAttrEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.diplomacy.tensorflow.AttrValue:\x02\x38\x01\x1a\xaa\x01\n\x10TensorProperties\x12-\n\x05\x64type\x18\x01 \x01(\x0e\x32\x1e.diplomacy.tensorflow.DataType\x12\x35\n\x05shape\x18\x02 \x01(\x0b\x32&.diplomacy.tensorflow.TensorShapeProto\x12\x30\n\x05value\x18\x03 \x01(\x0b\x32!.diplomacy.tensorflow.TensorProto\"/\n\x12NormalDistribution\x12\n\n\x02mu\x18\x01 \x01(\x01\x12\r\n\x05sigma\x18\x02 \x01(\x01\"2\n\x15LogNormalDistribution\x12\n\n\x02mu\x18\x01 \x01(\x01\x12\r\n\x05sigma\x18\x02 \x01(\x01\"\xa5\x05\n\rOpPerformance\x12(\n\x02op\x18\x01 \x01(\x0b\x32\x1c.diplomacy.tensorflow.OpInfo\x12;\n\x0csession_info\x18\x0c \x01(\x0b\x32!.diplomacy.tensorflow.SessionInfoB\x02\x18\x01\x12\x0c\n\x04node\x18\x05 \x01(\t\x12\x1d\n\x15temporary_memory_size\x18\x02 \x01(\x03\x12\x14\n\x0c\x63ompute_cost\x18\x03 \x01(\x03\x12\x14\n\x0c\x63ompute_time\x18\x06 \x01(\x03\x12\x13\n\x0bmemory_time\x18\x07 \x01(\x03\x12\x1a\n\x12\x63ompute_efficiency\x18\x04 \x01(\x01\x12\x19\n\x11memory_efficiency\x18\x08 \x01(\x01\x12I\n\x15\x65xecution_time_normal\x18\n \x01(\x0b\x32(.diplomacy.tensorflow.NormalDistributionH\x00\x12P\n\x19\x65xecution_time_log_normal\x18\x0b \x01(\x0b\x32+.diplomacy.tensorflow.LogNormalDistributionH\x00\x12?\n\top_memory\x18\t \x01(\x0b\x32,.diplomacy.tensorflow.OpPerformance.OpMemory\x1a\x97\x01\n\x08OpMemory\x12\x15\n\routput_memory\x18\x01 \x03(\x03\x12\x13\n\x0btemp_memory\x18\x02 \x01(\x03\x12\x19\n\x11persistent_memory\x18\x04 \x01(\x03\x12\x1e\n\x12\x64\x65vice_temp_memory\x18\x03 \x01(\x03\x42\x02\x18\x01\x12$\n\x18\x64\x65vice_persistent_memory\x18\x05 \x01(\x03\x42\x02\x18\x01\x42\x10\n\x0e\x65xecution_time\"P\n\x11OpPerformanceList\x12;\n\x0eop_performance\x18\x01 \x03(\x0b\x32#.diplomacy.tensorflow.OpPerformanceB\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2.DESCRIPTOR,diplomacy__tensorflow_dot_core_dot_protobuf_dot_device__properties__pb2.DESCRIPTOR,]) + + + + +_SESSIONINFO = _descriptor.Descriptor( + name='SessionInfo', + full_name='diplomacy.tensorflow.SessionInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='intra_op_parallelism', full_name='diplomacy.tensorflow.SessionInfo.intra_op_parallelism', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=361, + serialized_end=404, +) + + +_OPINFO_ATTRENTRY = _descriptor.Descriptor( + name='AttrEntry', + full_name='diplomacy.tensorflow.OpInfo.AttrEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='diplomacy.tensorflow.OpInfo.AttrEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.OpInfo.AttrEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=723, + serialized_end=799, +) + +_OPINFO_TENSORPROPERTIES = _descriptor.Descriptor( + name='TensorProperties', + full_name='diplomacy.tensorflow.OpInfo.TensorProperties', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dtype', full_name='diplomacy.tensorflow.OpInfo.TensorProperties.dtype', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='diplomacy.tensorflow.OpInfo.TensorProperties.shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.OpInfo.TensorProperties.value', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=802, + serialized_end=972, +) + +_OPINFO = _descriptor.Descriptor( + name='OpInfo', + full_name='diplomacy.tensorflow.OpInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op', full_name='diplomacy.tensorflow.OpInfo.op', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attr', full_name='diplomacy.tensorflow.OpInfo.attr', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inputs', full_name='diplomacy.tensorflow.OpInfo.inputs', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='outputs', full_name='diplomacy.tensorflow.OpInfo.outputs', index=3, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device', full_name='diplomacy.tensorflow.OpInfo.device', index=4, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='session_info', full_name='diplomacy.tensorflow.OpInfo.session_info', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_OPINFO_ATTRENTRY, _OPINFO_TENSORPROPERTIES, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=407, + serialized_end=972, +) + + +_NORMALDISTRIBUTION = _descriptor.Descriptor( + name='NormalDistribution', + full_name='diplomacy.tensorflow.NormalDistribution', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='mu', full_name='diplomacy.tensorflow.NormalDistribution.mu', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sigma', full_name='diplomacy.tensorflow.NormalDistribution.sigma', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=974, + serialized_end=1021, +) + + +_LOGNORMALDISTRIBUTION = _descriptor.Descriptor( + name='LogNormalDistribution', + full_name='diplomacy.tensorflow.LogNormalDistribution', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='mu', full_name='diplomacy.tensorflow.LogNormalDistribution.mu', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sigma', full_name='diplomacy.tensorflow.LogNormalDistribution.sigma', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1023, + serialized_end=1073, +) + + +_OPPERFORMANCE_OPMEMORY = _descriptor.Descriptor( + name='OpMemory', + full_name='diplomacy.tensorflow.OpPerformance.OpMemory', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='output_memory', full_name='diplomacy.tensorflow.OpPerformance.OpMemory.output_memory', index=0, + number=1, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='temp_memory', full_name='diplomacy.tensorflow.OpPerformance.OpMemory.temp_memory', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='persistent_memory', full_name='diplomacy.tensorflow.OpPerformance.OpMemory.persistent_memory', index=2, + number=4, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_temp_memory', full_name='diplomacy.tensorflow.OpPerformance.OpMemory.device_temp_memory', index=3, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device_persistent_memory', full_name='diplomacy.tensorflow.OpPerformance.OpMemory.device_persistent_memory', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1584, + serialized_end=1735, +) + +_OPPERFORMANCE = _descriptor.Descriptor( + name='OpPerformance', + full_name='diplomacy.tensorflow.OpPerformance', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op', full_name='diplomacy.tensorflow.OpPerformance.op', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='session_info', full_name='diplomacy.tensorflow.OpPerformance.session_info', index=1, + number=12, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\030\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='node', full_name='diplomacy.tensorflow.OpPerformance.node', index=2, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='temporary_memory_size', full_name='diplomacy.tensorflow.OpPerformance.temporary_memory_size', index=3, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_cost', full_name='diplomacy.tensorflow.OpPerformance.compute_cost', index=4, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_time', full_name='diplomacy.tensorflow.OpPerformance.compute_time', index=5, + number=6, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='memory_time', full_name='diplomacy.tensorflow.OpPerformance.memory_time', index=6, + number=7, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='compute_efficiency', full_name='diplomacy.tensorflow.OpPerformance.compute_efficiency', index=7, + number=4, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='memory_efficiency', full_name='diplomacy.tensorflow.OpPerformance.memory_efficiency', index=8, + number=8, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='execution_time_normal', full_name='diplomacy.tensorflow.OpPerformance.execution_time_normal', index=9, + number=10, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='execution_time_log_normal', full_name='diplomacy.tensorflow.OpPerformance.execution_time_log_normal', index=10, + number=11, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='op_memory', full_name='diplomacy.tensorflow.OpPerformance.op_memory', index=11, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_OPPERFORMANCE_OPMEMORY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='execution_time', full_name='diplomacy.tensorflow.OpPerformance.execution_time', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1076, + serialized_end=1753, +) + + +_OPPERFORMANCELIST = _descriptor.Descriptor( + name='OpPerformanceList', + full_name='diplomacy.tensorflow.OpPerformanceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='op_performance', full_name='diplomacy.tensorflow.OpPerformanceList.op_performance', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1755, + serialized_end=1835, +) + +_OPINFO_ATTRENTRY.fields_by_name['value'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_attr__value__pb2._ATTRVALUE +_OPINFO_ATTRENTRY.containing_type = _OPINFO +_OPINFO_TENSORPROPERTIES.fields_by_name['dtype'].enum_type = diplomacy__tensorflow_dot_core_dot_framework_dot_types__pb2._DATATYPE +_OPINFO_TENSORPROPERTIES.fields_by_name['shape'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_OPINFO_TENSORPROPERTIES.fields_by_name['value'].message_type = diplomacy__tensorflow_dot_core_dot_framework_dot_tensor__pb2._TENSORPROTO +_OPINFO_TENSORPROPERTIES.containing_type = _OPINFO +_OPINFO.fields_by_name['attr'].message_type = _OPINFO_ATTRENTRY +_OPINFO.fields_by_name['inputs'].message_type = _OPINFO_TENSORPROPERTIES +_OPINFO.fields_by_name['outputs'].message_type = _OPINFO_TENSORPROPERTIES +_OPINFO.fields_by_name['device'].message_type = diplomacy__tensorflow_dot_core_dot_protobuf_dot_device__properties__pb2._DEVICEPROPERTIES +_OPINFO.fields_by_name['session_info'].message_type = _SESSIONINFO +_OPPERFORMANCE_OPMEMORY.containing_type = _OPPERFORMANCE +_OPPERFORMANCE.fields_by_name['op'].message_type = _OPINFO +_OPPERFORMANCE.fields_by_name['session_info'].message_type = _SESSIONINFO +_OPPERFORMANCE.fields_by_name['execution_time_normal'].message_type = _NORMALDISTRIBUTION +_OPPERFORMANCE.fields_by_name['execution_time_log_normal'].message_type = _LOGNORMALDISTRIBUTION +_OPPERFORMANCE.fields_by_name['op_memory'].message_type = _OPPERFORMANCE_OPMEMORY +_OPPERFORMANCE.oneofs_by_name['execution_time'].fields.append( + _OPPERFORMANCE.fields_by_name['execution_time_normal']) +_OPPERFORMANCE.fields_by_name['execution_time_normal'].containing_oneof = _OPPERFORMANCE.oneofs_by_name['execution_time'] +_OPPERFORMANCE.oneofs_by_name['execution_time'].fields.append( + _OPPERFORMANCE.fields_by_name['execution_time_log_normal']) +_OPPERFORMANCE.fields_by_name['execution_time_log_normal'].containing_oneof = _OPPERFORMANCE.oneofs_by_name['execution_time'] +_OPPERFORMANCELIST.fields_by_name['op_performance'].message_type = _OPPERFORMANCE +DESCRIPTOR.message_types_by_name['SessionInfo'] = _SESSIONINFO +DESCRIPTOR.message_types_by_name['OpInfo'] = _OPINFO +DESCRIPTOR.message_types_by_name['NormalDistribution'] = _NORMALDISTRIBUTION +DESCRIPTOR.message_types_by_name['LogNormalDistribution'] = _LOGNORMALDISTRIBUTION +DESCRIPTOR.message_types_by_name['OpPerformance'] = _OPPERFORMANCE +DESCRIPTOR.message_types_by_name['OpPerformanceList'] = _OPPERFORMANCELIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +SessionInfo = _reflection.GeneratedProtocolMessageType('SessionInfo', (_message.Message,), dict( + DESCRIPTOR = _SESSIONINFO, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SessionInfo) + )) +_sym_db.RegisterMessage(SessionInfo) + +OpInfo = _reflection.GeneratedProtocolMessageType('OpInfo', (_message.Message,), dict( + + AttrEntry = _reflection.GeneratedProtocolMessageType('AttrEntry', (_message.Message,), dict( + DESCRIPTOR = _OPINFO_ATTRENTRY, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpInfo.AttrEntry) + )) + , + + TensorProperties = _reflection.GeneratedProtocolMessageType('TensorProperties', (_message.Message,), dict( + DESCRIPTOR = _OPINFO_TENSORPROPERTIES, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpInfo.TensorProperties) + )) + , + DESCRIPTOR = _OPINFO, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpInfo) + )) +_sym_db.RegisterMessage(OpInfo) +_sym_db.RegisterMessage(OpInfo.AttrEntry) +_sym_db.RegisterMessage(OpInfo.TensorProperties) + +NormalDistribution = _reflection.GeneratedProtocolMessageType('NormalDistribution', (_message.Message,), dict( + DESCRIPTOR = _NORMALDISTRIBUTION, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.NormalDistribution) + )) +_sym_db.RegisterMessage(NormalDistribution) + +LogNormalDistribution = _reflection.GeneratedProtocolMessageType('LogNormalDistribution', (_message.Message,), dict( + DESCRIPTOR = _LOGNORMALDISTRIBUTION, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.LogNormalDistribution) + )) +_sym_db.RegisterMessage(LogNormalDistribution) + +OpPerformance = _reflection.GeneratedProtocolMessageType('OpPerformance', (_message.Message,), dict( + + OpMemory = _reflection.GeneratedProtocolMessageType('OpMemory', (_message.Message,), dict( + DESCRIPTOR = _OPPERFORMANCE_OPMEMORY, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpPerformance.OpMemory) + )) + , + DESCRIPTOR = _OPPERFORMANCE, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpPerformance) + )) +_sym_db.RegisterMessage(OpPerformance) +_sym_db.RegisterMessage(OpPerformance.OpMemory) + +OpPerformanceList = _reflection.GeneratedProtocolMessageType('OpPerformanceList', (_message.Message,), dict( + DESCRIPTOR = _OPPERFORMANCELIST, + __module__ = 'diplomacy_tensorflow.core.grappler.costs.op_performance_data_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.OpPerformanceList) + )) +_sym_db.RegisterMessage(OpPerformanceList) + + +DESCRIPTOR._options = None +_OPINFO_ATTRENTRY._options = None +_OPPERFORMANCE_OPMEMORY.fields_by_name['device_temp_memory']._options = None +_OPPERFORMANCE_OPMEMORY.fields_by_name['device_persistent_memory']._options = None +_OPPERFORMANCE.fields_by_name['session_info']._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.pb.cc new file mode 100644 index 0000000..52f4124 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.pb.cc @@ -0,0 +1,5684 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto + +#include "diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_BucketizedSplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_CategoricalSplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DenseSplit; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_GrowingMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_SparseVector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TreeMetadata_PostPruneNodeUpdate; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Vector; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_NodeMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Tree; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_TreeMetadata; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Leaf; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto ::google::protobuf::internal::SCCInfo<5> scc_info_Node; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +class NodeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::boosted_trees::Leaf* leaf_; + const ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* bucketized_split_; + const ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* categorical_split_; + const ::diplomacy::tensorflow::boosted_trees::DenseSplit* dense_split_; +} _Node_default_instance_; +class NodeMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _NodeMetadata_default_instance_; +class LeafDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; + const ::diplomacy::tensorflow::boosted_trees::Vector* vector_; + const ::diplomacy::tensorflow::boosted_trees::SparseVector* sparse_vector_; +} _Leaf_default_instance_; +class VectorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Vector_default_instance_; +class SparseVectorDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _SparseVector_default_instance_; +class BucketizedSplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _BucketizedSplit_default_instance_; +class CategoricalSplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _CategoricalSplit_default_instance_; +class DenseSplitDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DenseSplit_default_instance_; +class TreeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Tree_default_instance_; +class TreeMetadata_PostPruneNodeUpdateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TreeMetadata_PostPruneNodeUpdate_default_instance_; +class TreeMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TreeMetadata_default_instance_; +class GrowingMetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _GrowingMetadata_default_instance_; +class TreeEnsembleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _TreeEnsemble_default_instance_; +class DebugOutputDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _DebugOutput_default_instance_; +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto { +static void InitDefaultsNode() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_Node_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::Node(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::Node::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<5> scc_info_Node = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 5, InitDefaultsNode}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Leaf.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_BucketizedSplit.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_CategoricalSplit.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_DenseSplit.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_NodeMetadata.base,}}; + +static void InitDefaultsNodeMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_NodeMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::NodeMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::NodeMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_NodeMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNodeMetadata}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Leaf.base,}}; + +static void InitDefaultsLeaf() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_Leaf_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::Leaf(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::Leaf::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_Leaf = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsLeaf}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Vector.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_SparseVector.base,}}; + +static void InitDefaultsVector() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_Vector_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::Vector(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::Vector::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Vector = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsVector}, {}}; + +static void InitDefaultsSparseVector() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_SparseVector_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::SparseVector(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::SparseVector::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_SparseVector = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSparseVector}, {}}; + +static void InitDefaultsBucketizedSplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_BucketizedSplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::BucketizedSplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_BucketizedSplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsBucketizedSplit}, {}}; + +static void InitDefaultsCategoricalSplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_CategoricalSplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::CategoricalSplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_CategoricalSplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCategoricalSplit}, {}}; + +static void InitDefaultsDenseSplit() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_DenseSplit_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::DenseSplit(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::DenseSplit::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DenseSplit = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDenseSplit}, {}}; + +static void InitDefaultsTree() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_Tree_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::Tree(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::Tree::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Tree = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTree}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Node.base,}}; + +static void InitDefaultsTreeMetadata_PostPruneNodeUpdate() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_TreeMetadata_PostPruneNodeUpdate_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_TreeMetadata_PostPruneNodeUpdate = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTreeMetadata_PostPruneNodeUpdate}, {}}; + +static void InitDefaultsTreeMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_TreeMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::TreeMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::TreeMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_TreeMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTreeMetadata}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata_PostPruneNodeUpdate.base,}}; + +static void InitDefaultsGrowingMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_GrowingMetadata_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::GrowingMetadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_GrowingMetadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsGrowingMetadata}, {}}; + +static void InitDefaultsTreeEnsemble() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_TreeEnsemble_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::TreeEnsemble(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::TreeEnsemble::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_TreeEnsemble = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsTreeEnsemble}, { + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Tree.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata.base, + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_GrowingMetadata.base,}}; + +static void InitDefaultsDebugOutput() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::diplomacy::tensorflow::boosted_trees::_DebugOutput_default_instance_; + new (ptr) ::diplomacy::tensorflow::boosted_trees::DebugOutput(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::diplomacy::tensorflow::boosted_trees::DebugOutput::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DebugOutput = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDebugOutput}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Node.base); + ::google::protobuf::internal::InitSCC(&scc_info_NodeMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_Leaf.base); + ::google::protobuf::internal::InitSCC(&scc_info_Vector.base); + ::google::protobuf::internal::InitSCC(&scc_info_SparseVector.base); + ::google::protobuf::internal::InitSCC(&scc_info_BucketizedSplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_CategoricalSplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_DenseSplit.base); + ::google::protobuf::internal::InitSCC(&scc_info_Tree.base); + ::google::protobuf::internal::InitSCC(&scc_info_TreeMetadata_PostPruneNodeUpdate.base); + ::google::protobuf::internal::InitSCC(&scc_info_TreeMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_GrowingMetadata.base); + ::google::protobuf::internal::InitSCC(&scc_info_TreeEnsemble.base); + ::google::protobuf::internal::InitSCC(&scc_info_DebugOutput.base); +} + +::google::protobuf::Metadata file_level_metadata[14]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Node, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Node, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::boosted_trees::NodeDefaultTypeInternal, leaf_), + offsetof(::diplomacy::tensorflow::boosted_trees::NodeDefaultTypeInternal, bucketized_split_), + offsetof(::diplomacy::tensorflow::boosted_trees::NodeDefaultTypeInternal, categorical_split_), + offsetof(::diplomacy::tensorflow::boosted_trees::NodeDefaultTypeInternal, dense_split_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Node, metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Node, node_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::NodeMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::NodeMetadata, gain_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::NodeMetadata, original_leaf_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Leaf, _internal_metadata_), + ~0u, // no _extensions_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Leaf, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::diplomacy::tensorflow::boosted_trees::LeafDefaultTypeInternal, vector_), + offsetof(::diplomacy::tensorflow::boosted_trees::LeafDefaultTypeInternal, sparse_vector_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Leaf, scalar_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Leaf, leaf_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Vector, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Vector, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::SparseVector, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::SparseVector, index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::SparseVector, value_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::BucketizedSplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::BucketizedSplit, feature_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::BucketizedSplit, threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::BucketizedSplit, left_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::BucketizedSplit, right_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::CategoricalSplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::CategoricalSplit, feature_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::CategoricalSplit, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::CategoricalSplit, left_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::CategoricalSplit, right_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DenseSplit, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DenseSplit, feature_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DenseSplit, threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DenseSplit, left_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DenseSplit, right_id_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Tree, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::Tree, nodes_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate, new_node_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate, logit_change_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeMetadata, num_layers_grown_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeMetadata, is_finalized_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeMetadata, post_pruned_nodes_meta_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::GrowingMetadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::GrowingMetadata, num_trees_attempted_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::GrowingMetadata, num_layers_attempted_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::GrowingMetadata, last_layer_node_start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::GrowingMetadata, last_layer_node_end_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeEnsemble, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeEnsemble, trees_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeEnsemble, tree_weights_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeEnsemble, tree_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::TreeEnsemble, growing_metadata_), + ~0u, // no _has_bits_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DebugOutput, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DebugOutput, feature_ids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::diplomacy::tensorflow::boosted_trees::DebugOutput, logits_path_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::diplomacy::tensorflow::boosted_trees::Node)}, + { 11, -1, sizeof(::diplomacy::tensorflow::boosted_trees::NodeMetadata)}, + { 18, -1, sizeof(::diplomacy::tensorflow::boosted_trees::Leaf)}, + { 27, -1, sizeof(::diplomacy::tensorflow::boosted_trees::Vector)}, + { 33, -1, sizeof(::diplomacy::tensorflow::boosted_trees::SparseVector)}, + { 40, -1, sizeof(::diplomacy::tensorflow::boosted_trees::BucketizedSplit)}, + { 49, -1, sizeof(::diplomacy::tensorflow::boosted_trees::CategoricalSplit)}, + { 58, -1, sizeof(::diplomacy::tensorflow::boosted_trees::DenseSplit)}, + { 67, -1, sizeof(::diplomacy::tensorflow::boosted_trees::Tree)}, + { 73, -1, sizeof(::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate)}, + { 80, -1, sizeof(::diplomacy::tensorflow::boosted_trees::TreeMetadata)}, + { 88, -1, sizeof(::diplomacy::tensorflow::boosted_trees::GrowingMetadata)}, + { 97, -1, sizeof(::diplomacy::tensorflow::boosted_trees::TreeEnsemble)}, + { 106, -1, sizeof(::diplomacy::tensorflow::boosted_trees::DebugOutput)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_Node_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_NodeMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_Leaf_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_Vector_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_SparseVector_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_BucketizedSplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_CategoricalSplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_DenseSplit_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_Tree_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_TreeMetadata_PostPruneNodeUpdate_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_TreeMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_GrowingMetadata_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_TreeEnsemble_default_instance_), + reinterpret_cast(&::diplomacy::tensorflow::boosted_trees::_DebugOutput_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, NULL, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 14); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\nCdiplomacy_tensorflow/core/kernels/boos" + "ted_trees/boosted_trees.proto\022\"diplomacy" + ".tensorflow.boosted_trees\"\370\002\n\004Node\0228\n\004le" + "af\030\001 \001(\0132(.diplomacy.tensorflow.boosted_" + "trees.LeafH\000\022O\n\020bucketized_split\030\002 \001(\01323" + ".diplomacy.tensorflow.boosted_trees.Buck" + "etizedSplitH\000\022Q\n\021categorical_split\030\003 \001(\013" + "24.diplomacy.tensorflow.boosted_trees.Ca" + "tegoricalSplitH\000\022E\n\013dense_split\030\004 \001(\0132.." + "diplomacy.tensorflow.boosted_trees.Dense" + "SplitH\000\022C\n\010metadata\030\211\006 \001(\01320.diplomacy.t" + "ensorflow.boosted_trees.NodeMetadataB\006\n\004" + "node\"]\n\014NodeMetadata\022\014\n\004gain\030\001 \001(\002\022\?\n\ror" + "iginal_leaf\030\002 \001(\0132(.diplomacy.tensorflow" + ".boosted_trees.Leaf\"\247\001\n\004Leaf\022<\n\006vector\030\001" + " \001(\0132*.diplomacy.tensorflow.boosted_tree" + "s.VectorH\000\022I\n\rsparse_vector\030\002 \001(\01320.dipl" + "omacy.tensorflow.boosted_trees.SparseVec" + "torH\000\022\016\n\006scalar\030\003 \001(\002B\006\n\004leaf\"\027\n\006Vector\022" + "\r\n\005value\030\001 \003(\002\",\n\014SparseVector\022\r\n\005index\030" + "\001 \003(\005\022\r\n\005value\030\002 \003(\002\"[\n\017BucketizedSplit\022" + "\022\n\nfeature_id\030\001 \001(\005\022\021\n\tthreshold\030\002 \001(\005\022\017" + "\n\007left_id\030\003 \001(\005\022\020\n\010right_id\030\004 \001(\005\"X\n\020Cat" + "egoricalSplit\022\022\n\nfeature_id\030\001 \001(\005\022\r\n\005val" + "ue\030\002 \001(\005\022\017\n\007left_id\030\003 \001(\005\022\020\n\010right_id\030\004 " + "\001(\005\"V\n\nDenseSplit\022\022\n\nfeature_id\030\001 \001(\005\022\021\n" + "\tthreshold\030\002 \001(\002\022\017\n\007left_id\030\003 \001(\005\022\020\n\010rig" + "ht_id\030\004 \001(\005\"\?\n\004Tree\0227\n\005nodes\030\001 \003(\0132(.dip" + "lomacy.tensorflow.boosted_trees.Node\"\346\001\n" + "\014TreeMetadata\022\030\n\020num_layers_grown\030\002 \001(\005\022" + "\024\n\014is_finalized\030\003 \001(\010\022d\n\026post_pruned_nod" + "es_meta\030\004 \003(\0132D.diplomacy.tensorflow.boo" + "sted_trees.TreeMetadata.PostPruneNodeUpd" + "ate\032@\n\023PostPruneNodeUpdate\022\023\n\013new_node_i" + "d\030\001 \001(\005\022\024\n\014logit_change\030\002 \001(\002\"\210\001\n\017Growin" + "gMetadata\022\033\n\023num_trees_attempted\030\001 \001(\003\022\034" + "\n\024num_layers_attempted\030\002 \001(\003\022\035\n\025last_lay" + "er_node_start\030\003 \001(\005\022\033\n\023last_layer_node_e" + "nd\030\004 \001(\005\"\365\001\n\014TreeEnsemble\0227\n\005trees\030\001 \003(\013" + "2(.diplomacy.tensorflow.boosted_trees.Tr" + "ee\022\024\n\014tree_weights\030\002 \003(\002\022G\n\rtree_metadat" + "a\030\003 \003(\01320.diplomacy.tensorflow.boosted_t" + "rees.TreeMetadata\022M\n\020growing_metadata\030\004 " + "\001(\01323.diplomacy.tensorflow.boosted_trees" + ".GrowingMetadata\"7\n\013DebugOutput\022\023\n\013featu" + "re_ids\030\001 \003(\005\022\023\n\013logits_path\030\002 \003(\002B3\n\030org" + ".tensorflow.frameworkB\022BoostedTreesProto" + "sP\001\370\001\001b\006proto3" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1894); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { + +// =================================================================== + +void Node::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::_Node_default_instance_.leaf_ = const_cast< ::diplomacy::tensorflow::boosted_trees::Leaf*>( + ::diplomacy::tensorflow::boosted_trees::Leaf::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::_Node_default_instance_.bucketized_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::BucketizedSplit*>( + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::_Node_default_instance_.categorical_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::CategoricalSplit*>( + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::_Node_default_instance_.dense_split_ = const_cast< ::diplomacy::tensorflow::boosted_trees::DenseSplit*>( + ::diplomacy::tensorflow::boosted_trees::DenseSplit::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::_Node_default_instance_._instance.get_mutable()->metadata_ = const_cast< ::diplomacy::tensorflow::boosted_trees::NodeMetadata*>( + ::diplomacy::tensorflow::boosted_trees::NodeMetadata::internal_default_instance()); +} +void Node::set_allocated_leaf(::diplomacy::tensorflow::boosted_trees::Leaf* leaf) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (leaf) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(leaf); + if (message_arena != submessage_arena) { + leaf = ::google::protobuf::internal::GetOwnedMessage( + message_arena, leaf, submessage_arena); + } + set_has_leaf(); + node_.leaf_ = leaf; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.Node.leaf) +} +void Node::set_allocated_bucketized_split(::diplomacy::tensorflow::boosted_trees::BucketizedSplit* bucketized_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (bucketized_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(bucketized_split); + if (message_arena != submessage_arena) { + bucketized_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, bucketized_split, submessage_arena); + } + set_has_bucketized_split(); + node_.bucketized_split_ = bucketized_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.Node.bucketized_split) +} +void Node::set_allocated_categorical_split(::diplomacy::tensorflow::boosted_trees::CategoricalSplit* categorical_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (categorical_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(categorical_split); + if (message_arena != submessage_arena) { + categorical_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, categorical_split, submessage_arena); + } + set_has_categorical_split(); + node_.categorical_split_ = categorical_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.Node.categorical_split) +} +void Node::set_allocated_dense_split(::diplomacy::tensorflow::boosted_trees::DenseSplit* dense_split) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_node(); + if (dense_split) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(dense_split); + if (message_arena != submessage_arena) { + dense_split = ::google::protobuf::internal::GetOwnedMessage( + message_arena, dense_split, submessage_arena); + } + set_has_dense_split(); + node_.dense_split_ = dense_split; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.Node.dense_split) +} +void Node::unsafe_arena_set_allocated_metadata( + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* metadata) { + if (GetArenaNoVirtual() == NULL) { + delete metadata_; + } + metadata_ = metadata; + if (metadata) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.Node.metadata) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Node::kLeafFieldNumber; +const int Node::kBucketizedSplitFieldNumber; +const int Node::kCategoricalSplitFieldNumber; +const int Node::kDenseSplitFieldNumber; +const int Node::kMetadataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Node::Node() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Node.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.Node) +} +Node::Node(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Node.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.Node) +} +Node::Node(const Node& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_metadata()) { + metadata_ = new ::diplomacy::tensorflow::boosted_trees::NodeMetadata(*from.metadata_); + } else { + metadata_ = NULL; + } + clear_has_node(); + switch (from.node_case()) { + case kLeaf: { + mutable_leaf()->::diplomacy::tensorflow::boosted_trees::Leaf::MergeFrom(from.leaf()); + break; + } + case kBucketizedSplit: { + mutable_bucketized_split()->::diplomacy::tensorflow::boosted_trees::BucketizedSplit::MergeFrom(from.bucketized_split()); + break; + } + case kCategoricalSplit: { + mutable_categorical_split()->::diplomacy::tensorflow::boosted_trees::CategoricalSplit::MergeFrom(from.categorical_split()); + break; + } + case kDenseSplit: { + mutable_dense_split()->::diplomacy::tensorflow::boosted_trees::DenseSplit::MergeFrom(from.dense_split()); + break; + } + case NODE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.Node) +} + +void Node::SharedCtor() { + metadata_ = NULL; + clear_has_node(); +} + +Node::~Node() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.Node) + SharedDtor(); +} + +void Node::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete metadata_; + if (has_node()) { + clear_node(); + } +} + +void Node::ArenaDtor(void* object) { + Node* _this = reinterpret_cast< Node* >(object); + (void)_this; +} +void Node::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Node::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Node::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Node& Node::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Node.base); + return *internal_default_instance(); +} + + +void Node::clear_node() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.boosted_trees.Node) + switch (node_case()) { + case kLeaf: { + if (GetArenaNoVirtual() == NULL) { + delete node_.leaf_; + } + break; + } + case kBucketizedSplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.bucketized_split_; + } + break; + } + case kCategoricalSplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.categorical_split_; + } + break; + } + case kDenseSplit: { + if (GetArenaNoVirtual() == NULL) { + delete node_.dense_split_; + } + break; + } + case NODE_NOT_SET: { + break; + } + } + _oneof_case_[0] = NODE_NOT_SET; +} + + +void Node::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && metadata_ != NULL) { + delete metadata_; + } + metadata_ = NULL; + clear_node(); + _internal_metadata_.Clear(); +} + +bool Node::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.Node) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.Leaf leaf = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_leaf())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.BucketizedSplit bucketized_split = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_bucketized_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.CategoricalSplit categorical_split = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_categorical_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.DenseSplit dense_split = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_dense_split())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.NodeMetadata metadata = 777; + case 777: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 6218 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_metadata())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.Node) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.Node) + return false; +#undef DO_ +} + +void Node::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.Leaf leaf = 1; + if (has_leaf()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_leaf(), output); + } + + // .diplomacy.tensorflow.boosted_trees.BucketizedSplit bucketized_split = 2; + if (has_bucketized_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_bucketized_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.CategoricalSplit categorical_split = 3; + if (has_categorical_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_categorical_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.DenseSplit dense_split = 4; + if (has_dense_split()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_dense_split(), output); + } + + // .diplomacy.tensorflow.boosted_trees.NodeMetadata metadata = 777; + if (this->has_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 777, this->_internal_metadata(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.Node) +} + +::google::protobuf::uint8* Node::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.Node) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.Leaf leaf = 1; + if (has_leaf()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_leaf(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.BucketizedSplit bucketized_split = 2; + if (has_bucketized_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_bucketized_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.CategoricalSplit categorical_split = 3; + if (has_categorical_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_categorical_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.DenseSplit dense_split = 4; + if (has_dense_split()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_dense_split(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.NodeMetadata metadata = 777; + if (this->has_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 777, this->_internal_metadata(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.Node) + return target; +} + +size_t Node::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.Node) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.boosted_trees.NodeMetadata metadata = 777; + if (this->has_metadata()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *metadata_); + } + + switch (node_case()) { + // .diplomacy.tensorflow.boosted_trees.Leaf leaf = 1; + case kLeaf: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.leaf_); + break; + } + // .diplomacy.tensorflow.boosted_trees.BucketizedSplit bucketized_split = 2; + case kBucketizedSplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.bucketized_split_); + break; + } + // .diplomacy.tensorflow.boosted_trees.CategoricalSplit categorical_split = 3; + case kCategoricalSplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.categorical_split_); + break; + } + // .diplomacy.tensorflow.boosted_trees.DenseSplit dense_split = 4; + case kDenseSplit: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *node_.dense_split_); + break; + } + case NODE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Node::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.Node) + GOOGLE_DCHECK_NE(&from, this); + const Node* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.Node) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.Node) + MergeFrom(*source); + } +} + +void Node::MergeFrom(const Node& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.Node) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_metadata()) { + mutable_metadata()->::diplomacy::tensorflow::boosted_trees::NodeMetadata::MergeFrom(from.metadata()); + } + switch (from.node_case()) { + case kLeaf: { + mutable_leaf()->::diplomacy::tensorflow::boosted_trees::Leaf::MergeFrom(from.leaf()); + break; + } + case kBucketizedSplit: { + mutable_bucketized_split()->::diplomacy::tensorflow::boosted_trees::BucketizedSplit::MergeFrom(from.bucketized_split()); + break; + } + case kCategoricalSplit: { + mutable_categorical_split()->::diplomacy::tensorflow::boosted_trees::CategoricalSplit::MergeFrom(from.categorical_split()); + break; + } + case kDenseSplit: { + mutable_dense_split()->::diplomacy::tensorflow::boosted_trees::DenseSplit::MergeFrom(from.dense_split()); + break; + } + case NODE_NOT_SET: { + break; + } + } +} + +void Node::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.Node) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Node::CopyFrom(const Node& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.Node) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Node::IsInitialized() const { + return true; +} + +void Node::Swap(Node* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Node* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Node::UnsafeArenaSwap(Node* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Node::InternalSwap(Node* other) { + using std::swap; + swap(metadata_, other->metadata_); + swap(node_, other->node_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Node::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void NodeMetadata::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::_NodeMetadata_default_instance_._instance.get_mutable()->original_leaf_ = const_cast< ::diplomacy::tensorflow::boosted_trees::Leaf*>( + ::diplomacy::tensorflow::boosted_trees::Leaf::internal_default_instance()); +} +void NodeMetadata::unsafe_arena_set_allocated_original_leaf( + ::diplomacy::tensorflow::boosted_trees::Leaf* original_leaf) { + if (GetArenaNoVirtual() == NULL) { + delete original_leaf_; + } + original_leaf_ = original_leaf; + if (original_leaf) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.NodeMetadata.original_leaf) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NodeMetadata::kGainFieldNumber; +const int NodeMetadata::kOriginalLeafFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NodeMetadata::NodeMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_NodeMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.NodeMetadata) +} +NodeMetadata::NodeMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_NodeMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.NodeMetadata) +} +NodeMetadata::NodeMetadata(const NodeMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_original_leaf()) { + original_leaf_ = new ::diplomacy::tensorflow::boosted_trees::Leaf(*from.original_leaf_); + } else { + original_leaf_ = NULL; + } + gain_ = from.gain_; + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.NodeMetadata) +} + +void NodeMetadata::SharedCtor() { + ::memset(&original_leaf_, 0, static_cast( + reinterpret_cast(&gain_) - + reinterpret_cast(&original_leaf_)) + sizeof(gain_)); +} + +NodeMetadata::~NodeMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.NodeMetadata) + SharedDtor(); +} + +void NodeMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete original_leaf_; +} + +void NodeMetadata::ArenaDtor(void* object) { + NodeMetadata* _this = reinterpret_cast< NodeMetadata* >(object); + (void)_this; +} +void NodeMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NodeMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* NodeMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const NodeMetadata& NodeMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_NodeMetadata.base); + return *internal_default_instance(); +} + + +void NodeMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == NULL && original_leaf_ != NULL) { + delete original_leaf_; + } + original_leaf_ = NULL; + gain_ = 0; + _internal_metadata_.Clear(); +} + +bool NodeMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // float gain = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &gain_))); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.Leaf original_leaf = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_original_leaf())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.NodeMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.NodeMetadata) + return false; +#undef DO_ +} + +void NodeMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float gain = 1; + if (this->gain() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->gain(), output); + } + + // .diplomacy.tensorflow.boosted_trees.Leaf original_leaf = 2; + if (this->has_original_leaf()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_original_leaf(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.NodeMetadata) +} + +::google::protobuf::uint8* NodeMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // float gain = 1; + if (this->gain() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->gain(), target); + } + + // .diplomacy.tensorflow.boosted_trees.Leaf original_leaf = 2; + if (this->has_original_leaf()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_original_leaf(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.NodeMetadata) + return target; +} + +size_t NodeMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // .diplomacy.tensorflow.boosted_trees.Leaf original_leaf = 2; + if (this->has_original_leaf()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *original_leaf_); + } + + // float gain = 1; + if (this->gain() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NodeMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + GOOGLE_DCHECK_NE(&from, this); + const NodeMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.NodeMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.NodeMetadata) + MergeFrom(*source); + } +} + +void NodeMetadata::MergeFrom(const NodeMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_original_leaf()) { + mutable_original_leaf()->::diplomacy::tensorflow::boosted_trees::Leaf::MergeFrom(from.original_leaf()); + } + if (from.gain() != 0) { + set_gain(from.gain()); + } +} + +void NodeMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NodeMetadata::CopyFrom(const NodeMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.NodeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NodeMetadata::IsInitialized() const { + return true; +} + +void NodeMetadata::Swap(NodeMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NodeMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void NodeMetadata::UnsafeArenaSwap(NodeMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NodeMetadata::InternalSwap(NodeMetadata* other) { + using std::swap; + swap(original_leaf_, other->original_leaf_); + swap(gain_, other->gain_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata NodeMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Leaf::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::_Leaf_default_instance_.vector_ = const_cast< ::diplomacy::tensorflow::boosted_trees::Vector*>( + ::diplomacy::tensorflow::boosted_trees::Vector::internal_default_instance()); + ::diplomacy::tensorflow::boosted_trees::_Leaf_default_instance_.sparse_vector_ = const_cast< ::diplomacy::tensorflow::boosted_trees::SparseVector*>( + ::diplomacy::tensorflow::boosted_trees::SparseVector::internal_default_instance()); +} +void Leaf::set_allocated_vector(::diplomacy::tensorflow::boosted_trees::Vector* vector) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf(); + if (vector) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(vector); + if (message_arena != submessage_arena) { + vector = ::google::protobuf::internal::GetOwnedMessage( + message_arena, vector, submessage_arena); + } + set_has_vector(); + leaf_.vector_ = vector; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.Leaf.vector) +} +void Leaf::set_allocated_sparse_vector(::diplomacy::tensorflow::boosted_trees::SparseVector* sparse_vector) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + clear_leaf(); + if (sparse_vector) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(sparse_vector); + if (message_arena != submessage_arena) { + sparse_vector = ::google::protobuf::internal::GetOwnedMessage( + message_arena, sparse_vector, submessage_arena); + } + set_has_sparse_vector(); + leaf_.sparse_vector_ = sparse_vector; + } + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.Leaf.sparse_vector) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Leaf::kVectorFieldNumber; +const int Leaf::kSparseVectorFieldNumber; +const int Leaf::kScalarFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Leaf::Leaf() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Leaf.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.Leaf) +} +Leaf::Leaf(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Leaf.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.Leaf) +} +Leaf::Leaf(const Leaf& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + scalar_ = from.scalar_; + clear_has_leaf(); + switch (from.leaf_case()) { + case kVector: { + mutable_vector()->::diplomacy::tensorflow::boosted_trees::Vector::MergeFrom(from.vector()); + break; + } + case kSparseVector: { + mutable_sparse_vector()->::diplomacy::tensorflow::boosted_trees::SparseVector::MergeFrom(from.sparse_vector()); + break; + } + case LEAF_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.Leaf) +} + +void Leaf::SharedCtor() { + scalar_ = 0; + clear_has_leaf(); +} + +Leaf::~Leaf() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.Leaf) + SharedDtor(); +} + +void Leaf::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (has_leaf()) { + clear_leaf(); + } +} + +void Leaf::ArenaDtor(void* object) { + Leaf* _this = reinterpret_cast< Leaf* >(object); + (void)_this; +} +void Leaf::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Leaf::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Leaf::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Leaf& Leaf::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Leaf.base); + return *internal_default_instance(); +} + + +void Leaf::clear_leaf() { +// @@protoc_insertion_point(one_of_clear_start:diplomacy.tensorflow.boosted_trees.Leaf) + switch (leaf_case()) { + case kVector: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.vector_; + } + break; + } + case kSparseVector: { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.sparse_vector_; + } + break; + } + case LEAF_NOT_SET: { + break; + } + } + _oneof_case_[0] = LEAF_NOT_SET; +} + + +void Leaf::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + scalar_ = 0; + clear_leaf(); + _internal_metadata_.Clear(); +} + +bool Leaf::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.Leaf) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .diplomacy.tensorflow.boosted_trees.Vector vector = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_vector())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.SparseVector sparse_vector = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_sparse_vector())); + } else { + goto handle_unusual; + } + break; + } + + // float scalar = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scalar_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.Leaf) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.Leaf) + return false; +#undef DO_ +} + +void Leaf::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.Vector vector = 1; + if (has_vector()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->_internal_vector(), output); + } + + // .diplomacy.tensorflow.boosted_trees.SparseVector sparse_vector = 2; + if (has_sparse_vector()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_sparse_vector(), output); + } + + // float scalar = 3; + if (this->scalar() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->scalar(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.Leaf) +} + +::google::protobuf::uint8* Leaf::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.Leaf) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .diplomacy.tensorflow.boosted_trees.Vector vector = 1; + if (has_vector()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->_internal_vector(), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.SparseVector sparse_vector = 2; + if (has_sparse_vector()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_sparse_vector(), deterministic, target); + } + + // float scalar = 3; + if (this->scalar() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->scalar(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.Leaf) + return target; +} + +size_t Leaf::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.Leaf) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // float scalar = 3; + if (this->scalar() != 0) { + total_size += 1 + 4; + } + + switch (leaf_case()) { + // .diplomacy.tensorflow.boosted_trees.Vector vector = 1; + case kVector: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_.vector_); + break; + } + // .diplomacy.tensorflow.boosted_trees.SparseVector sparse_vector = 2; + case kSparseVector: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *leaf_.sparse_vector_); + break; + } + case LEAF_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Leaf::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.Leaf) + GOOGLE_DCHECK_NE(&from, this); + const Leaf* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.Leaf) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.Leaf) + MergeFrom(*source); + } +} + +void Leaf::MergeFrom(const Leaf& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.Leaf) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.scalar() != 0) { + set_scalar(from.scalar()); + } + switch (from.leaf_case()) { + case kVector: { + mutable_vector()->::diplomacy::tensorflow::boosted_trees::Vector::MergeFrom(from.vector()); + break; + } + case kSparseVector: { + mutable_sparse_vector()->::diplomacy::tensorflow::boosted_trees::SparseVector::MergeFrom(from.sparse_vector()); + break; + } + case LEAF_NOT_SET: { + break; + } + } +} + +void Leaf::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.Leaf) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Leaf::CopyFrom(const Leaf& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.Leaf) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Leaf::IsInitialized() const { + return true; +} + +void Leaf::Swap(Leaf* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Leaf* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Leaf::UnsafeArenaSwap(Leaf* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Leaf::InternalSwap(Leaf* other) { + using std::swap; + swap(scalar_, other->scalar_); + swap(leaf_, other->leaf_); + swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Leaf::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Vector::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Vector::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Vector::Vector() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Vector.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.Vector) +} +Vector::Vector(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Vector.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.Vector) +} +Vector::Vector(const Vector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.Vector) +} + +void Vector::SharedCtor() { +} + +Vector::~Vector() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.Vector) + SharedDtor(); +} + +void Vector::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Vector::ArenaDtor(void* object) { + Vector* _this = reinterpret_cast< Vector* >(object); + (void)_this; +} +void Vector::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Vector::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Vector::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Vector& Vector::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Vector.base); + return *internal_default_instance(); +} + + +void Vector::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool Vector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.Vector) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated float value = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 10u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.Vector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.Vector) + return false; +#undef DO_ +} + +void Vector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.Vector) +} + +::google::protobuf::uint8* Vector::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.Vector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated float value = 1; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.Vector) + return target; +} + +size_t Vector::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.Vector) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated float value = 1; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Vector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.Vector) + GOOGLE_DCHECK_NE(&from, this); + const Vector* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.Vector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.Vector) + MergeFrom(*source); + } +} + +void Vector::MergeFrom(const Vector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.Vector) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + value_.MergeFrom(from.value_); +} + +void Vector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.Vector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Vector::CopyFrom(const Vector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.Vector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Vector::IsInitialized() const { + return true; +} + +void Vector::Swap(Vector* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Vector* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Vector::UnsafeArenaSwap(Vector* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Vector::InternalSwap(Vector* other) { + using std::swap; + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Vector::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void SparseVector::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SparseVector::kIndexFieldNumber; +const int SparseVector::kValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SparseVector::SparseVector() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_SparseVector.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.SparseVector) +} +SparseVector::SparseVector(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + index_(arena), + value_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_SparseVector.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.SparseVector) +} +SparseVector::SparseVector(const SparseVector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + index_(from.index_), + value_(from.value_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.SparseVector) +} + +void SparseVector::SharedCtor() { +} + +SparseVector::~SparseVector() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.SparseVector) + SharedDtor(); +} + +void SparseVector::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void SparseVector::ArenaDtor(void* object) { + SparseVector* _this = reinterpret_cast< SparseVector* >(object); + (void)_this; +} +void SparseVector::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void SparseVector::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* SparseVector::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const SparseVector& SparseVector::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_SparseVector.base); + return *internal_default_instance(); +} + + +void SparseVector::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + index_.Clear(); + value_.Clear(); + _internal_metadata_.Clear(); +} + +bool SparseVector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.SparseVector) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 index = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_index()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10u, input, this->mutable_index()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated float value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_value()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 18u, input, this->mutable_value()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.SparseVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.SparseVector) + return false; +#undef DO_ +} + +void SparseVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 index = 1; + if (this->index_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _index_cached_byte_size_)); + } + for (int i = 0, n = this->index_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->index(i), output); + } + + // repeated float value = 2; + if (this->value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _value_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->value().data(), this->value_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.SparseVector) +} + +::google::protobuf::uint8* SparseVector::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.SparseVector) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 index = 1; + if (this->index_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _index_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->index_, target); + } + + // repeated float value = 2; + if (this->value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _value_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->value_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.SparseVector) + return target; +} + +size_t SparseVector::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.SparseVector) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 index = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->index_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _index_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float value = 2; + { + unsigned int count = static_cast(this->value_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _value_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SparseVector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.SparseVector) + GOOGLE_DCHECK_NE(&from, this); + const SparseVector* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.SparseVector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.SparseVector) + MergeFrom(*source); + } +} + +void SparseVector::MergeFrom(const SparseVector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.SparseVector) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + index_.MergeFrom(from.index_); + value_.MergeFrom(from.value_); +} + +void SparseVector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.SparseVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SparseVector::CopyFrom(const SparseVector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.SparseVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SparseVector::IsInitialized() const { + return true; +} + +void SparseVector::Swap(SparseVector* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + SparseVector* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void SparseVector::UnsafeArenaSwap(SparseVector* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void SparseVector::InternalSwap(SparseVector* other) { + using std::swap; + index_.InternalSwap(&other->index_); + value_.InternalSwap(&other->value_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata SparseVector::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void BucketizedSplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BucketizedSplit::kFeatureIdFieldNumber; +const int BucketizedSplit::kThresholdFieldNumber; +const int BucketizedSplit::kLeftIdFieldNumber; +const int BucketizedSplit::kRightIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BucketizedSplit::BucketizedSplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_BucketizedSplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.BucketizedSplit) +} +BucketizedSplit::BucketizedSplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_BucketizedSplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.BucketizedSplit) +} +BucketizedSplit::BucketizedSplit(const BucketizedSplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_id_, &from.feature_id_, + static_cast(reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.BucketizedSplit) +} + +void BucketizedSplit::SharedCtor() { + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); +} + +BucketizedSplit::~BucketizedSplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + SharedDtor(); +} + +void BucketizedSplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void BucketizedSplit::ArenaDtor(void* object) { + BucketizedSplit* _this = reinterpret_cast< BucketizedSplit* >(object); + (void)_this; +} +void BucketizedSplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void BucketizedSplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* BucketizedSplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const BucketizedSplit& BucketizedSplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_BucketizedSplit.base); + return *internal_default_instance(); +} + + +void BucketizedSplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + _internal_metadata_.Clear(); +} + +bool BucketizedSplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 threshold = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &threshold_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 left_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &left_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 right_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &right_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + return false; +#undef DO_ +} + +void BucketizedSplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_id = 1; + if (this->feature_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_id(), output); + } + + // int32 threshold = 2; + if (this->threshold() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->threshold(), output); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->left_id(), output); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->right_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.BucketizedSplit) +} + +::google::protobuf::uint8* BucketizedSplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_id = 1; + if (this->feature_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_id(), target); + } + + // int32 threshold = 2; + if (this->threshold() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->threshold(), target); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->left_id(), target); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->right_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + return target; +} + +size_t BucketizedSplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 feature_id = 1; + if (this->feature_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_id()); + } + + // int32 threshold = 2; + if (this->threshold() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->threshold()); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->left_id()); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->right_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void BucketizedSplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + GOOGLE_DCHECK_NE(&from, this); + const BucketizedSplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + MergeFrom(*source); + } +} + +void BucketizedSplit::MergeFrom(const BucketizedSplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.feature_id() != 0) { + set_feature_id(from.feature_id()); + } + if (from.threshold() != 0) { + set_threshold(from.threshold()); + } + if (from.left_id() != 0) { + set_left_id(from.left_id()); + } + if (from.right_id() != 0) { + set_right_id(from.right_id()); + } +} + +void BucketizedSplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BucketizedSplit::CopyFrom(const BucketizedSplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BucketizedSplit::IsInitialized() const { + return true; +} + +void BucketizedSplit::Swap(BucketizedSplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + BucketizedSplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void BucketizedSplit::UnsafeArenaSwap(BucketizedSplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void BucketizedSplit::InternalSwap(BucketizedSplit* other) { + using std::swap; + swap(feature_id_, other->feature_id_); + swap(threshold_, other->threshold_); + swap(left_id_, other->left_id_); + swap(right_id_, other->right_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata BucketizedSplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void CategoricalSplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CategoricalSplit::kFeatureIdFieldNumber; +const int CategoricalSplit::kValueFieldNumber; +const int CategoricalSplit::kLeftIdFieldNumber; +const int CategoricalSplit::kRightIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CategoricalSplit::CategoricalSplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_CategoricalSplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.CategoricalSplit) +} +CategoricalSplit::CategoricalSplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_CategoricalSplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.CategoricalSplit) +} +CategoricalSplit::CategoricalSplit(const CategoricalSplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_id_, &from.feature_id_, + static_cast(reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.CategoricalSplit) +} + +void CategoricalSplit::SharedCtor() { + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); +} + +CategoricalSplit::~CategoricalSplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + SharedDtor(); +} + +void CategoricalSplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void CategoricalSplit::ArenaDtor(void* object) { + CategoricalSplit* _this = reinterpret_cast< CategoricalSplit* >(object); + (void)_this; +} +void CategoricalSplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void CategoricalSplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* CategoricalSplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const CategoricalSplit& CategoricalSplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_CategoricalSplit.base); + return *internal_default_instance(); +} + + +void CategoricalSplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + _internal_metadata_.Clear(); +} + +bool CategoricalSplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 value = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &value_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 left_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &left_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 right_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &right_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + return false; +#undef DO_ +} + +void CategoricalSplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_id = 1; + if (this->feature_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_id(), output); + } + + // int32 value = 2; + if (this->value() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->value(), output); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->left_id(), output); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->right_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.CategoricalSplit) +} + +::google::protobuf::uint8* CategoricalSplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_id = 1; + if (this->feature_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_id(), target); + } + + // int32 value = 2; + if (this->value() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->value(), target); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->left_id(), target); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->right_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + return target; +} + +size_t CategoricalSplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 feature_id = 1; + if (this->feature_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_id()); + } + + // int32 value = 2; + if (this->value() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->value()); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->left_id()); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->right_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void CategoricalSplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + GOOGLE_DCHECK_NE(&from, this); + const CategoricalSplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + MergeFrom(*source); + } +} + +void CategoricalSplit::MergeFrom(const CategoricalSplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.feature_id() != 0) { + set_feature_id(from.feature_id()); + } + if (from.value() != 0) { + set_value(from.value()); + } + if (from.left_id() != 0) { + set_left_id(from.left_id()); + } + if (from.right_id() != 0) { + set_right_id(from.right_id()); + } +} + +void CategoricalSplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CategoricalSplit::CopyFrom(const CategoricalSplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CategoricalSplit::IsInitialized() const { + return true; +} + +void CategoricalSplit::Swap(CategoricalSplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + CategoricalSplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void CategoricalSplit::UnsafeArenaSwap(CategoricalSplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void CategoricalSplit::InternalSwap(CategoricalSplit* other) { + using std::swap; + swap(feature_id_, other->feature_id_); + swap(value_, other->value_); + swap(left_id_, other->left_id_); + swap(right_id_, other->right_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata CategoricalSplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DenseSplit::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DenseSplit::kFeatureIdFieldNumber; +const int DenseSplit::kThresholdFieldNumber; +const int DenseSplit::kLeftIdFieldNumber; +const int DenseSplit::kRightIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DenseSplit::DenseSplit() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_DenseSplit.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.DenseSplit) +} +DenseSplit::DenseSplit(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_DenseSplit.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.DenseSplit) +} +DenseSplit::DenseSplit(const DenseSplit& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&feature_id_, &from.feature_id_, + static_cast(reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.DenseSplit) +} + +void DenseSplit::SharedCtor() { + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); +} + +DenseSplit::~DenseSplit() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.DenseSplit) + SharedDtor(); +} + +void DenseSplit::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DenseSplit::ArenaDtor(void* object) { + DenseSplit* _this = reinterpret_cast< DenseSplit* >(object); + (void)_this; +} +void DenseSplit::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DenseSplit::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DenseSplit::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DenseSplit& DenseSplit::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_DenseSplit.base); + return *internal_default_instance(); +} + + +void DenseSplit::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&feature_id_, 0, static_cast( + reinterpret_cast(&right_id_) - + reinterpret_cast(&feature_id_)) + sizeof(right_id_)); + _internal_metadata_.Clear(); +} + +bool DenseSplit::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 feature_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &feature_id_))); + } else { + goto handle_unusual; + } + break; + } + + // float threshold = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 left_id = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &left_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 right_id = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &right_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.DenseSplit) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.DenseSplit) + return false; +#undef DO_ +} + +void DenseSplit::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_id = 1; + if (this->feature_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->feature_id(), output); + } + + // float threshold = 2; + if (this->threshold() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->threshold(), output); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->left_id(), output); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->right_id(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.DenseSplit) +} + +::google::protobuf::uint8* DenseSplit::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 feature_id = 1; + if (this->feature_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->feature_id(), target); + } + + // float threshold = 2; + if (this->threshold() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->threshold(), target); + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->left_id(), target); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->right_id(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.DenseSplit) + return target; +} + +size_t DenseSplit::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 feature_id = 1; + if (this->feature_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->feature_id()); + } + + // float threshold = 2; + if (this->threshold() != 0) { + total_size += 1 + 4; + } + + // int32 left_id = 3; + if (this->left_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->left_id()); + } + + // int32 right_id = 4; + if (this->right_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->right_id()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DenseSplit::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + GOOGLE_DCHECK_NE(&from, this); + const DenseSplit* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.DenseSplit) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.DenseSplit) + MergeFrom(*source); + } +} + +void DenseSplit::MergeFrom(const DenseSplit& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.feature_id() != 0) { + set_feature_id(from.feature_id()); + } + if (from.threshold() != 0) { + set_threshold(from.threshold()); + } + if (from.left_id() != 0) { + set_left_id(from.left_id()); + } + if (from.right_id() != 0) { + set_right_id(from.right_id()); + } +} + +void DenseSplit::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DenseSplit::CopyFrom(const DenseSplit& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.DenseSplit) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DenseSplit::IsInitialized() const { + return true; +} + +void DenseSplit::Swap(DenseSplit* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DenseSplit* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DenseSplit::UnsafeArenaSwap(DenseSplit* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DenseSplit::InternalSwap(DenseSplit* other) { + using std::swap; + swap(feature_id_, other->feature_id_); + swap(threshold_, other->threshold_); + swap(left_id_, other->left_id_); + swap(right_id_, other->right_id_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DenseSplit::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void Tree::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Tree::kNodesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Tree::Tree() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Tree.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.Tree) +} +Tree::Tree(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + nodes_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Tree.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.Tree) +} +Tree::Tree(const Tree& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + nodes_(from.nodes_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.Tree) +} + +void Tree::SharedCtor() { +} + +Tree::~Tree() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.Tree) + SharedDtor(); +} + +void Tree::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void Tree::ArenaDtor(void* object) { + Tree* _this = reinterpret_cast< Tree* >(object); + (void)_this; +} +void Tree::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void Tree::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Tree::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Tree& Tree::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_Tree.base); + return *internal_default_instance(); +} + + +void Tree::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.Tree) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + nodes_.Clear(); + _internal_metadata_.Clear(); +} + +bool Tree::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.Tree) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.boosted_trees.Node nodes = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_nodes())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.Tree) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.Tree) + return false; +#undef DO_ +} + +void Tree::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.Tree) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.Node nodes = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->nodes(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.Tree) +} + +::google::protobuf::uint8* Tree::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.Tree) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.Node nodes = 1; + for (unsigned int i = 0, + n = static_cast(this->nodes_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->nodes(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.Tree) + return target; +} + +size_t Tree::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.Tree) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.boosted_trees.Node nodes = 1; + { + unsigned int count = static_cast(this->nodes_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->nodes(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Tree::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.Tree) + GOOGLE_DCHECK_NE(&from, this); + const Tree* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.Tree) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.Tree) + MergeFrom(*source); + } +} + +void Tree::MergeFrom(const Tree& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.Tree) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + nodes_.MergeFrom(from.nodes_); +} + +void Tree::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.Tree) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Tree::CopyFrom(const Tree& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.Tree) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Tree::IsInitialized() const { + return true; +} + +void Tree::Swap(Tree* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + Tree* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void Tree::UnsafeArenaSwap(Tree* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void Tree::InternalSwap(Tree* other) { + using std::swap; + CastToBase(&nodes_)->InternalSwap(CastToBase(&other->nodes_)); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Tree::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TreeMetadata_PostPruneNodeUpdate::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeMetadata_PostPruneNodeUpdate::kNewNodeIdFieldNumber; +const int TreeMetadata_PostPruneNodeUpdate::kLogitChangeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeMetadata_PostPruneNodeUpdate::TreeMetadata_PostPruneNodeUpdate() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata_PostPruneNodeUpdate.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) +} +TreeMetadata_PostPruneNodeUpdate::TreeMetadata_PostPruneNodeUpdate(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata_PostPruneNodeUpdate.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) +} +TreeMetadata_PostPruneNodeUpdate::TreeMetadata_PostPruneNodeUpdate(const TreeMetadata_PostPruneNodeUpdate& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&new_node_id_, &from.new_node_id_, + static_cast(reinterpret_cast(&logit_change_) - + reinterpret_cast(&new_node_id_)) + sizeof(logit_change_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) +} + +void TreeMetadata_PostPruneNodeUpdate::SharedCtor() { + ::memset(&new_node_id_, 0, static_cast( + reinterpret_cast(&logit_change_) - + reinterpret_cast(&new_node_id_)) + sizeof(logit_change_)); +} + +TreeMetadata_PostPruneNodeUpdate::~TreeMetadata_PostPruneNodeUpdate() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + SharedDtor(); +} + +void TreeMetadata_PostPruneNodeUpdate::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TreeMetadata_PostPruneNodeUpdate::ArenaDtor(void* object) { + TreeMetadata_PostPruneNodeUpdate* _this = reinterpret_cast< TreeMetadata_PostPruneNodeUpdate* >(object); + (void)_this; +} +void TreeMetadata_PostPruneNodeUpdate::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeMetadata_PostPruneNodeUpdate::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeMetadata_PostPruneNodeUpdate::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeMetadata_PostPruneNodeUpdate& TreeMetadata_PostPruneNodeUpdate::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata_PostPruneNodeUpdate.base); + return *internal_default_instance(); +} + + +void TreeMetadata_PostPruneNodeUpdate::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&new_node_id_, 0, static_cast( + reinterpret_cast(&logit_change_) - + reinterpret_cast(&new_node_id_)) + sizeof(logit_change_)); + _internal_metadata_.Clear(); +} + +bool TreeMetadata_PostPruneNodeUpdate::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 new_node_id = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_node_id_))); + } else { + goto handle_unusual; + } + break; + } + + // float logit_change = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &logit_change_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + return false; +#undef DO_ +} + +void TreeMetadata_PostPruneNodeUpdate::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 new_node_id = 1; + if (this->new_node_id() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->new_node_id(), output); + } + + // float logit_change = 2; + if (this->logit_change() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->logit_change(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) +} + +::google::protobuf::uint8* TreeMetadata_PostPruneNodeUpdate::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 new_node_id = 1; + if (this->new_node_id() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->new_node_id(), target); + } + + // float logit_change = 2; + if (this->logit_change() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->logit_change(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + return target; +} + +size_t TreeMetadata_PostPruneNodeUpdate::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int32 new_node_id = 1; + if (this->new_node_id() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->new_node_id()); + } + + // float logit_change = 2; + if (this->logit_change() != 0) { + total_size += 1 + 4; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeMetadata_PostPruneNodeUpdate::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + GOOGLE_DCHECK_NE(&from, this); + const TreeMetadata_PostPruneNodeUpdate* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + MergeFrom(*source); + } +} + +void TreeMetadata_PostPruneNodeUpdate::MergeFrom(const TreeMetadata_PostPruneNodeUpdate& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.new_node_id() != 0) { + set_new_node_id(from.new_node_id()); + } + if (from.logit_change() != 0) { + set_logit_change(from.logit_change()); + } +} + +void TreeMetadata_PostPruneNodeUpdate::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeMetadata_PostPruneNodeUpdate::CopyFrom(const TreeMetadata_PostPruneNodeUpdate& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeMetadata_PostPruneNodeUpdate::IsInitialized() const { + return true; +} + +void TreeMetadata_PostPruneNodeUpdate::Swap(TreeMetadata_PostPruneNodeUpdate* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeMetadata_PostPruneNodeUpdate* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeMetadata_PostPruneNodeUpdate::UnsafeArenaSwap(TreeMetadata_PostPruneNodeUpdate* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeMetadata_PostPruneNodeUpdate::InternalSwap(TreeMetadata_PostPruneNodeUpdate* other) { + using std::swap; + swap(new_node_id_, other->new_node_id_); + swap(logit_change_, other->logit_change_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeMetadata_PostPruneNodeUpdate::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TreeMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeMetadata::kNumLayersGrownFieldNumber; +const int TreeMetadata::kIsFinalizedFieldNumber; +const int TreeMetadata::kPostPrunedNodesMetaFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeMetadata::TreeMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.TreeMetadata) +} +TreeMetadata::TreeMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + post_pruned_nodes_meta_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.TreeMetadata) +} +TreeMetadata::TreeMetadata(const TreeMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + post_pruned_nodes_meta_(from.post_pruned_nodes_meta_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&num_layers_grown_, &from.num_layers_grown_, + static_cast(reinterpret_cast(&is_finalized_) - + reinterpret_cast(&num_layers_grown_)) + sizeof(is_finalized_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.TreeMetadata) +} + +void TreeMetadata::SharedCtor() { + ::memset(&num_layers_grown_, 0, static_cast( + reinterpret_cast(&is_finalized_) - + reinterpret_cast(&num_layers_grown_)) + sizeof(is_finalized_)); +} + +TreeMetadata::~TreeMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.TreeMetadata) + SharedDtor(); +} + +void TreeMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void TreeMetadata::ArenaDtor(void* object) { + TreeMetadata* _this = reinterpret_cast< TreeMetadata* >(object); + (void)_this; +} +void TreeMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeMetadata& TreeMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeMetadata.base); + return *internal_default_instance(); +} + + +void TreeMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + post_pruned_nodes_meta_.Clear(); + ::memset(&num_layers_grown_, 0, static_cast( + reinterpret_cast(&is_finalized_) - + reinterpret_cast(&num_layers_grown_)) + sizeof(is_finalized_)); + _internal_metadata_.Clear(); +} + +bool TreeMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 num_layers_grown = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_layers_grown_))); + } else { + goto handle_unusual; + } + break; + } + + // bool is_finalized = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_finalized_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_post_pruned_nodes_meta())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.TreeMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.TreeMetadata) + return false; +#undef DO_ +} + +void TreeMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_layers_grown = 2; + if (this->num_layers_grown() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_layers_grown(), output); + } + + // bool is_finalized = 3; + if (this->is_finalized() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->is_finalized(), output); + } + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4; + for (unsigned int i = 0, + n = static_cast(this->post_pruned_nodes_meta_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, + this->post_pruned_nodes_meta(static_cast(i)), + output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.TreeMetadata) +} + +::google::protobuf::uint8* TreeMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_layers_grown = 2; + if (this->num_layers_grown() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_layers_grown(), target); + } + + // bool is_finalized = 3; + if (this->is_finalized() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->is_finalized(), target); + } + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4; + for (unsigned int i = 0, + n = static_cast(this->post_pruned_nodes_meta_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->post_pruned_nodes_meta(static_cast(i)), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.TreeMetadata) + return target; +} + +size_t TreeMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4; + { + unsigned int count = static_cast(this->post_pruned_nodes_meta_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->post_pruned_nodes_meta(static_cast(i))); + } + } + + // int32 num_layers_grown = 2; + if (this->num_layers_grown() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_layers_grown()); + } + + // bool is_finalized = 3; + if (this->is_finalized() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + GOOGLE_DCHECK_NE(&from, this); + const TreeMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.TreeMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.TreeMetadata) + MergeFrom(*source); + } +} + +void TreeMetadata::MergeFrom(const TreeMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + post_pruned_nodes_meta_.MergeFrom(from.post_pruned_nodes_meta_); + if (from.num_layers_grown() != 0) { + set_num_layers_grown(from.num_layers_grown()); + } + if (from.is_finalized() != 0) { + set_is_finalized(from.is_finalized()); + } +} + +void TreeMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeMetadata::CopyFrom(const TreeMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.TreeMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeMetadata::IsInitialized() const { + return true; +} + +void TreeMetadata::Swap(TreeMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeMetadata::UnsafeArenaSwap(TreeMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeMetadata::InternalSwap(TreeMetadata* other) { + using std::swap; + CastToBase(&post_pruned_nodes_meta_)->InternalSwap(CastToBase(&other->post_pruned_nodes_meta_)); + swap(num_layers_grown_, other->num_layers_grown_); + swap(is_finalized_, other->is_finalized_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void GrowingMetadata::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GrowingMetadata::kNumTreesAttemptedFieldNumber; +const int GrowingMetadata::kNumLayersAttemptedFieldNumber; +const int GrowingMetadata::kLastLayerNodeStartFieldNumber; +const int GrowingMetadata::kLastLayerNodeEndFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GrowingMetadata::GrowingMetadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_GrowingMetadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.GrowingMetadata) +} +GrowingMetadata::GrowingMetadata(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_GrowingMetadata.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.GrowingMetadata) +} +GrowingMetadata::GrowingMetadata(const GrowingMetadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&num_trees_attempted_, &from.num_trees_attempted_, + static_cast(reinterpret_cast(&last_layer_node_end_) - + reinterpret_cast(&num_trees_attempted_)) + sizeof(last_layer_node_end_)); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.GrowingMetadata) +} + +void GrowingMetadata::SharedCtor() { + ::memset(&num_trees_attempted_, 0, static_cast( + reinterpret_cast(&last_layer_node_end_) - + reinterpret_cast(&num_trees_attempted_)) + sizeof(last_layer_node_end_)); +} + +GrowingMetadata::~GrowingMetadata() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + SharedDtor(); +} + +void GrowingMetadata::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void GrowingMetadata::ArenaDtor(void* object) { + GrowingMetadata* _this = reinterpret_cast< GrowingMetadata* >(object); + (void)_this; +} +void GrowingMetadata::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GrowingMetadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* GrowingMetadata::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const GrowingMetadata& GrowingMetadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_GrowingMetadata.base); + return *internal_default_instance(); +} + + +void GrowingMetadata::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&num_trees_attempted_, 0, static_cast( + reinterpret_cast(&last_layer_node_end_) - + reinterpret_cast(&num_trees_attempted_)) + sizeof(last_layer_node_end_)); + _internal_metadata_.Clear(); +} + +bool GrowingMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 num_trees_attempted = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_trees_attempted_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 num_layers_attempted = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &num_layers_attempted_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 last_layer_node_start = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &last_layer_node_start_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 last_layer_node_end = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &last_layer_node_end_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + return false; +#undef DO_ +} + +void GrowingMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 num_trees_attempted = 1; + if (this->num_trees_attempted() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->num_trees_attempted(), output); + } + + // int64 num_layers_attempted = 2; + if (this->num_layers_attempted() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->num_layers_attempted(), output); + } + + // int32 last_layer_node_start = 3; + if (this->last_layer_node_start() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->last_layer_node_start(), output); + } + + // int32 last_layer_node_end = 4; + if (this->last_layer_node_end() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->last_layer_node_end(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.GrowingMetadata) +} + +::google::protobuf::uint8* GrowingMetadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 num_trees_attempted = 1; + if (this->num_trees_attempted() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->num_trees_attempted(), target); + } + + // int64 num_layers_attempted = 2; + if (this->num_layers_attempted() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->num_layers_attempted(), target); + } + + // int32 last_layer_node_start = 3; + if (this->last_layer_node_start() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->last_layer_node_start(), target); + } + + // int32 last_layer_node_end = 4; + if (this->last_layer_node_end() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->last_layer_node_end(), target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + return target; +} + +size_t GrowingMetadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // int64 num_trees_attempted = 1; + if (this->num_trees_attempted() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_trees_attempted()); + } + + // int64 num_layers_attempted = 2; + if (this->num_layers_attempted() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->num_layers_attempted()); + } + + // int32 last_layer_node_start = 3; + if (this->last_layer_node_start() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->last_layer_node_start()); + } + + // int32 last_layer_node_end = 4; + if (this->last_layer_node_end() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->last_layer_node_end()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GrowingMetadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + GOOGLE_DCHECK_NE(&from, this); + const GrowingMetadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + MergeFrom(*source); + } +} + +void GrowingMetadata::MergeFrom(const GrowingMetadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.num_trees_attempted() != 0) { + set_num_trees_attempted(from.num_trees_attempted()); + } + if (from.num_layers_attempted() != 0) { + set_num_layers_attempted(from.num_layers_attempted()); + } + if (from.last_layer_node_start() != 0) { + set_last_layer_node_start(from.last_layer_node_start()); + } + if (from.last_layer_node_end() != 0) { + set_last_layer_node_end(from.last_layer_node_end()); + } +} + +void GrowingMetadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GrowingMetadata::CopyFrom(const GrowingMetadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GrowingMetadata::IsInitialized() const { + return true; +} + +void GrowingMetadata::Swap(GrowingMetadata* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GrowingMetadata* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void GrowingMetadata::UnsafeArenaSwap(GrowingMetadata* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GrowingMetadata::InternalSwap(GrowingMetadata* other) { + using std::swap; + swap(num_trees_attempted_, other->num_trees_attempted_); + swap(num_layers_attempted_, other->num_layers_attempted_); + swap(last_layer_node_start_, other->last_layer_node_start_); + swap(last_layer_node_end_, other->last_layer_node_end_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata GrowingMetadata::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void TreeEnsemble::InitAsDefaultInstance() { + ::diplomacy::tensorflow::boosted_trees::_TreeEnsemble_default_instance_._instance.get_mutable()->growing_metadata_ = const_cast< ::diplomacy::tensorflow::boosted_trees::GrowingMetadata*>( + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata::internal_default_instance()); +} +void TreeEnsemble::unsafe_arena_set_allocated_growing_metadata( + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* growing_metadata) { + if (GetArenaNoVirtual() == NULL) { + delete growing_metadata_; + } + growing_metadata_ = growing_metadata; + if (growing_metadata) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.TreeEnsemble.growing_metadata) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TreeEnsemble::kTreesFieldNumber; +const int TreeEnsemble::kTreeWeightsFieldNumber; +const int TreeEnsemble::kTreeMetadataFieldNumber; +const int TreeEnsemble::kGrowingMetadataFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TreeEnsemble::TreeEnsemble() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeEnsemble.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.TreeEnsemble) +} +TreeEnsemble::TreeEnsemble(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + trees_(arena), + tree_weights_(arena), + tree_metadata_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeEnsemble.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.TreeEnsemble) +} +TreeEnsemble::TreeEnsemble(const TreeEnsemble& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + trees_(from.trees_), + tree_weights_(from.tree_weights_), + tree_metadata_(from.tree_metadata_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_growing_metadata()) { + growing_metadata_ = new ::diplomacy::tensorflow::boosted_trees::GrowingMetadata(*from.growing_metadata_); + } else { + growing_metadata_ = NULL; + } + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.TreeEnsemble) +} + +void TreeEnsemble::SharedCtor() { + growing_metadata_ = NULL; +} + +TreeEnsemble::~TreeEnsemble() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + SharedDtor(); +} + +void TreeEnsemble::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + if (this != internal_default_instance()) delete growing_metadata_; +} + +void TreeEnsemble::ArenaDtor(void* object) { + TreeEnsemble* _this = reinterpret_cast< TreeEnsemble* >(object); + (void)_this; +} +void TreeEnsemble::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TreeEnsemble::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* TreeEnsemble::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const TreeEnsemble& TreeEnsemble::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_TreeEnsemble.base); + return *internal_default_instance(); +} + + +void TreeEnsemble::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + trees_.Clear(); + tree_weights_.Clear(); + tree_metadata_.Clear(); + if (GetArenaNoVirtual() == NULL && growing_metadata_ != NULL) { + delete growing_metadata_; + } + growing_metadata_ = NULL; + _internal_metadata_.Clear(); +} + +bool TreeEnsemble::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .diplomacy.tensorflow.boosted_trees.Tree trees = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_trees())); + } else { + goto handle_unusual; + } + break; + } + + // repeated float tree_weights = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_tree_weights()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 18u, input, this->mutable_tree_weights()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata tree_metadata = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, add_tree_metadata())); + } else { + goto handle_unusual; + } + break; + } + + // .diplomacy.tensorflow.boosted_trees.GrowingMetadata growing_metadata = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_growing_metadata())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + return false; +#undef DO_ +} + +void TreeEnsemble::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.Tree trees = 1; + for (unsigned int i = 0, + n = static_cast(this->trees_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, + this->trees(static_cast(i)), + output); + } + + // repeated float tree_weights = 2; + if (this->tree_weights_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _tree_weights_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->tree_weights().data(), this->tree_weights_size(), output); + } + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata tree_metadata = 3; + for (unsigned int i = 0, + n = static_cast(this->tree_metadata_size()); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, + this->tree_metadata(static_cast(i)), + output); + } + + // .diplomacy.tensorflow.boosted_trees.GrowingMetadata growing_metadata = 4; + if (this->has_growing_metadata()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_growing_metadata(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.TreeEnsemble) +} + +::google::protobuf::uint8* TreeEnsemble::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .diplomacy.tensorflow.boosted_trees.Tree trees = 1; + for (unsigned int i = 0, + n = static_cast(this->trees_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, this->trees(static_cast(i)), deterministic, target); + } + + // repeated float tree_weights = 2; + if (this->tree_weights_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _tree_weights_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->tree_weights_, target); + } + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata tree_metadata = 3; + for (unsigned int i = 0, + n = static_cast(this->tree_metadata_size()); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->tree_metadata(static_cast(i)), deterministic, target); + } + + // .diplomacy.tensorflow.boosted_trees.GrowingMetadata growing_metadata = 4; + if (this->has_growing_metadata()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_growing_metadata(), deterministic, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + return target; +} + +size_t TreeEnsemble::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated .diplomacy.tensorflow.boosted_trees.Tree trees = 1; + { + unsigned int count = static_cast(this->trees_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->trees(static_cast(i))); + } + } + + // repeated float tree_weights = 2; + { + unsigned int count = static_cast(this->tree_weights_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _tree_weights_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata tree_metadata = 3; + { + unsigned int count = static_cast(this->tree_metadata_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize( + this->tree_metadata(static_cast(i))); + } + } + + // .diplomacy.tensorflow.boosted_trees.GrowingMetadata growing_metadata = 4; + if (this->has_growing_metadata()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *growing_metadata_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void TreeEnsemble::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + GOOGLE_DCHECK_NE(&from, this); + const TreeEnsemble* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + MergeFrom(*source); + } +} + +void TreeEnsemble::MergeFrom(const TreeEnsemble& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + trees_.MergeFrom(from.trees_); + tree_weights_.MergeFrom(from.tree_weights_); + tree_metadata_.MergeFrom(from.tree_metadata_); + if (from.has_growing_metadata()) { + mutable_growing_metadata()->::diplomacy::tensorflow::boosted_trees::GrowingMetadata::MergeFrom(from.growing_metadata()); + } +} + +void TreeEnsemble::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TreeEnsemble::CopyFrom(const TreeEnsemble& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TreeEnsemble::IsInitialized() const { + return true; +} + +void TreeEnsemble::Swap(TreeEnsemble* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TreeEnsemble* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void TreeEnsemble::UnsafeArenaSwap(TreeEnsemble* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TreeEnsemble::InternalSwap(TreeEnsemble* other) { + using std::swap; + CastToBase(&trees_)->InternalSwap(CastToBase(&other->trees_)); + tree_weights_.InternalSwap(&other->tree_weights_); + CastToBase(&tree_metadata_)->InternalSwap(CastToBase(&other->tree_metadata_)); + swap(growing_metadata_, other->growing_metadata_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata TreeEnsemble::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// =================================================================== + +void DebugOutput::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DebugOutput::kFeatureIdsFieldNumber; +const int DebugOutput::kLogitsPathFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DebugOutput::DebugOutput() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_DebugOutput.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:diplomacy.tensorflow.boosted_trees.DebugOutput) +} +DebugOutput::DebugOutput(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + feature_ids_(arena), + logits_path_(arena) { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_DebugOutput.base); + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:diplomacy.tensorflow.boosted_trees.DebugOutput) +} +DebugOutput::DebugOutput(const DebugOutput& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + feature_ids_(from.feature_ids_), + logits_path_(from.logits_path_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:diplomacy.tensorflow.boosted_trees.DebugOutput) +} + +void DebugOutput::SharedCtor() { +} + +DebugOutput::~DebugOutput() { + // @@protoc_insertion_point(destructor:diplomacy.tensorflow.boosted_trees.DebugOutput) + SharedDtor(); +} + +void DebugOutput::SharedDtor() { + GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); +} + +void DebugOutput::ArenaDtor(void* object) { + DebugOutput* _this = reinterpret_cast< DebugOutput* >(object); + (void)_this; +} +void DebugOutput::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void DebugOutput::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* DebugOutput::descriptor() { + ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const DebugOutput& DebugOutput::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::scc_info_DebugOutput.base); + return *internal_default_instance(); +} + + +void DebugOutput::Clear() { +// @@protoc_insertion_point(message_clear_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + feature_ids_.Clear(); + logits_path_.Clear(); + _internal_metadata_.Clear(); +} + +bool DebugOutput::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 feature_ids = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_feature_ids()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10u, input, this->mutable_feature_ids()))); + } else { + goto handle_unusual; + } + break; + } + + // repeated float logits_path = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_logits_path()))); + } else if ( + static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 18u, input, this->mutable_logits_path()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:diplomacy.tensorflow.boosted_trees.DebugOutput) + return true; +failure: + // @@protoc_insertion_point(parse_failure:diplomacy.tensorflow.boosted_trees.DebugOutput) + return false; +#undef DO_ +} + +void DebugOutput::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 feature_ids = 1; + if (this->feature_ids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _feature_ids_cached_byte_size_)); + } + for (int i = 0, n = this->feature_ids_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->feature_ids(i), output); + } + + // repeated float logits_path = 2; + if (this->logits_path_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(static_cast< ::google::protobuf::uint32>( + _logits_path_cached_byte_size_)); + ::google::protobuf::internal::WireFormatLite::WriteFloatArray( + this->logits_path().data(), this->logits_path_size(), output); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); + } + // @@protoc_insertion_point(serialize_end:diplomacy.tensorflow.boosted_trees.DebugOutput) +} + +::google::protobuf::uint8* DebugOutput::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated int32 feature_ids = 1; + if (this->feature_ids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _feature_ids_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->feature_ids_, target); + } + + // repeated float logits_path = 2; + if (this->logits_path_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + static_cast< ::google::protobuf::int32>( + _logits_path_cached_byte_size_), target); + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->logits_path_, target); + } + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); + } + // @@protoc_insertion_point(serialize_to_array_end:diplomacy.tensorflow.boosted_trees.DebugOutput) + return target; +} + +size_t DebugOutput::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + size_t total_size = 0; + + if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); + } + // repeated int32 feature_ids = 1; + { + size_t data_size = ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->feature_ids_); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _feature_ids_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float logits_path = 2; + { + unsigned int count = static_cast(this->logits_path_size()); + size_t data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + static_cast< ::google::protobuf::int32>(data_size)); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _logits_path_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DebugOutput::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + GOOGLE_DCHECK_NE(&from, this); + const DebugOutput* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:diplomacy.tensorflow.boosted_trees.DebugOutput) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:diplomacy.tensorflow.boosted_trees.DebugOutput) + MergeFrom(*source); + } +} + +void DebugOutput::MergeFrom(const DebugOutput& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + feature_ids_.MergeFrom(from.feature_ids_); + logits_path_.MergeFrom(from.logits_path_); +} + +void DebugOutput::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DebugOutput::CopyFrom(const DebugOutput& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:diplomacy.tensorflow.boosted_trees.DebugOutput) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DebugOutput::IsInitialized() const { + return true; +} + +void DebugOutput::Swap(DebugOutput* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + DebugOutput* temp = New(GetArenaNoVirtual()); + temp->MergeFrom(*other); + other->CopyFrom(*this); + InternalSwap(temp); + if (GetArenaNoVirtual() == NULL) { + delete temp; + } + } +} +void DebugOutput::UnsafeArenaSwap(DebugOutput* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void DebugOutput::InternalSwap(DebugOutput* other) { + using std::swap; + feature_ids_.InternalSwap(&other->feature_ids_); + logits_path_.InternalSwap(&other->logits_path_); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata DebugOutput::GetMetadata() const { + protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::Node* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::Node >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::Node >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::NodeMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::NodeMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::NodeMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::Leaf* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::Leaf >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::Leaf >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::Vector* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::Vector >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::Vector >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::SparseVector* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::SparseVector >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::SparseVector >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::BucketizedSplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::BucketizedSplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::CategoricalSplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::CategoricalSplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::DenseSplit* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::DenseSplit >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::DenseSplit >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::Tree* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::Tree >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::Tree >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::TreeMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::TreeMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::TreeMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::GrowingMetadata >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::GrowingMetadata >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::TreeEnsemble* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::TreeEnsemble >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::TreeEnsemble >(arena); +} +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::diplomacy::tensorflow::boosted_trees::DebugOutput* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::DebugOutput >(Arena* arena) { + return Arena::CreateMessageInternal< ::diplomacy::tensorflow::boosted_trees::DebugOutput >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.pb.h b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.pb.h new file mode 100644 index 0000000..e0a63db --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.pb.h @@ -0,0 +1,3478 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto + +#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto +#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[14]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { +class BucketizedSplit; +class BucketizedSplitDefaultTypeInternal; +extern BucketizedSplitDefaultTypeInternal _BucketizedSplit_default_instance_; +class CategoricalSplit; +class CategoricalSplitDefaultTypeInternal; +extern CategoricalSplitDefaultTypeInternal _CategoricalSplit_default_instance_; +class DebugOutput; +class DebugOutputDefaultTypeInternal; +extern DebugOutputDefaultTypeInternal _DebugOutput_default_instance_; +class DenseSplit; +class DenseSplitDefaultTypeInternal; +extern DenseSplitDefaultTypeInternal _DenseSplit_default_instance_; +class GrowingMetadata; +class GrowingMetadataDefaultTypeInternal; +extern GrowingMetadataDefaultTypeInternal _GrowingMetadata_default_instance_; +class Leaf; +class LeafDefaultTypeInternal; +extern LeafDefaultTypeInternal _Leaf_default_instance_; +class Node; +class NodeDefaultTypeInternal; +extern NodeDefaultTypeInternal _Node_default_instance_; +class NodeMetadata; +class NodeMetadataDefaultTypeInternal; +extern NodeMetadataDefaultTypeInternal _NodeMetadata_default_instance_; +class SparseVector; +class SparseVectorDefaultTypeInternal; +extern SparseVectorDefaultTypeInternal _SparseVector_default_instance_; +class Tree; +class TreeDefaultTypeInternal; +extern TreeDefaultTypeInternal _Tree_default_instance_; +class TreeEnsemble; +class TreeEnsembleDefaultTypeInternal; +extern TreeEnsembleDefaultTypeInternal _TreeEnsemble_default_instance_; +class TreeMetadata; +class TreeMetadataDefaultTypeInternal; +extern TreeMetadataDefaultTypeInternal _TreeMetadata_default_instance_; +class TreeMetadata_PostPruneNodeUpdate; +class TreeMetadata_PostPruneNodeUpdateDefaultTypeInternal; +extern TreeMetadata_PostPruneNodeUpdateDefaultTypeInternal _TreeMetadata_PostPruneNodeUpdate_default_instance_; +class Vector; +class VectorDefaultTypeInternal; +extern VectorDefaultTypeInternal _Vector_default_instance_; +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy +namespace google { +namespace protobuf { +template<> ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::BucketizedSplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::CategoricalSplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::DebugOutput* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::DebugOutput>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::DenseSplit* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::DenseSplit>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::GrowingMetadata>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::Leaf* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::Leaf>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::Node* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::Node>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::NodeMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::NodeMetadata>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::SparseVector* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::SparseVector>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::Tree* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::Tree>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::TreeEnsemble* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::TreeEnsemble>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::TreeMetadata* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::TreeMetadata>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate>(Arena*); +template<> ::diplomacy::tensorflow::boosted_trees::Vector* Arena::CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::Vector>(Arena*); +} // namespace protobuf +} // namespace google +namespace diplomacy { +namespace tensorflow { +namespace boosted_trees { + +// =================================================================== + +class Node : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.Node) */ { + public: + Node(); + virtual ~Node(); + + Node(const Node& from); + + inline Node& operator=(const Node& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Node(Node&& from) noexcept + : Node() { + *this = ::std::move(from); + } + + inline Node& operator=(Node&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Node& default_instance(); + + enum NodeCase { + kLeaf = 1, + kBucketizedSplit = 2, + kCategoricalSplit = 3, + kDenseSplit = 4, + NODE_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Node* internal_default_instance() { + return reinterpret_cast( + &_Node_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void UnsafeArenaSwap(Node* other); + void Swap(Node* other); + friend void swap(Node& a, Node& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Node* New() const final { + return CreateMaybeMessage(NULL); + } + + Node* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Node& from); + void MergeFrom(const Node& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Node* other); + protected: + explicit Node(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.NodeMetadata metadata = 777; + bool has_metadata() const; + void clear_metadata(); + static const int kMetadataFieldNumber = 777; + private: + const ::diplomacy::tensorflow::boosted_trees::NodeMetadata& _internal_metadata() const; + public: + const ::diplomacy::tensorflow::boosted_trees::NodeMetadata& metadata() const; + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* release_metadata(); + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* mutable_metadata(); + void set_allocated_metadata(::diplomacy::tensorflow::boosted_trees::NodeMetadata* metadata); + void unsafe_arena_set_allocated_metadata( + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* metadata); + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* unsafe_arena_release_metadata(); + + // .diplomacy.tensorflow.boosted_trees.Leaf leaf = 1; + bool has_leaf() const; + void clear_leaf(); + static const int kLeafFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::Leaf& _internal_leaf() const; + public: + const ::diplomacy::tensorflow::boosted_trees::Leaf& leaf() const; + ::diplomacy::tensorflow::boosted_trees::Leaf* release_leaf(); + ::diplomacy::tensorflow::boosted_trees::Leaf* mutable_leaf(); + void set_allocated_leaf(::diplomacy::tensorflow::boosted_trees::Leaf* leaf); + void unsafe_arena_set_allocated_leaf( + ::diplomacy::tensorflow::boosted_trees::Leaf* leaf); + ::diplomacy::tensorflow::boosted_trees::Leaf* unsafe_arena_release_leaf(); + + // .diplomacy.tensorflow.boosted_trees.BucketizedSplit bucketized_split = 2; + bool has_bucketized_split() const; + void clear_bucketized_split(); + static const int kBucketizedSplitFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::BucketizedSplit& _internal_bucketized_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::BucketizedSplit& bucketized_split() const; + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* release_bucketized_split(); + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* mutable_bucketized_split(); + void set_allocated_bucketized_split(::diplomacy::tensorflow::boosted_trees::BucketizedSplit* bucketized_split); + void unsafe_arena_set_allocated_bucketized_split( + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* bucketized_split); + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* unsafe_arena_release_bucketized_split(); + + // .diplomacy.tensorflow.boosted_trees.CategoricalSplit categorical_split = 3; + bool has_categorical_split() const; + void clear_categorical_split(); + static const int kCategoricalSplitFieldNumber = 3; + private: + const ::diplomacy::tensorflow::boosted_trees::CategoricalSplit& _internal_categorical_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::CategoricalSplit& categorical_split() const; + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* release_categorical_split(); + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* mutable_categorical_split(); + void set_allocated_categorical_split(::diplomacy::tensorflow::boosted_trees::CategoricalSplit* categorical_split); + void unsafe_arena_set_allocated_categorical_split( + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* categorical_split); + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* unsafe_arena_release_categorical_split(); + + // .diplomacy.tensorflow.boosted_trees.DenseSplit dense_split = 4; + bool has_dense_split() const; + void clear_dense_split(); + static const int kDenseSplitFieldNumber = 4; + private: + const ::diplomacy::tensorflow::boosted_trees::DenseSplit& _internal_dense_split() const; + public: + const ::diplomacy::tensorflow::boosted_trees::DenseSplit& dense_split() const; + ::diplomacy::tensorflow::boosted_trees::DenseSplit* release_dense_split(); + ::diplomacy::tensorflow::boosted_trees::DenseSplit* mutable_dense_split(); + void set_allocated_dense_split(::diplomacy::tensorflow::boosted_trees::DenseSplit* dense_split); + void unsafe_arena_set_allocated_dense_split( + ::diplomacy::tensorflow::boosted_trees::DenseSplit* dense_split); + ::diplomacy::tensorflow::boosted_trees::DenseSplit* unsafe_arena_release_dense_split(); + + void clear_node(); + NodeCase node_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Node) + private: + void set_has_leaf(); + void set_has_bucketized_split(); + void set_has_categorical_split(); + void set_has_dense_split(); + + inline bool has_node() const; + inline void clear_has_node(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* metadata_; + union NodeUnion { + NodeUnion() {} + ::diplomacy::tensorflow::boosted_trees::Leaf* leaf_; + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* bucketized_split_; + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* categorical_split_; + ::diplomacy::tensorflow::boosted_trees::DenseSplit* dense_split_; + } node_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class NodeMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.NodeMetadata) */ { + public: + NodeMetadata(); + virtual ~NodeMetadata(); + + NodeMetadata(const NodeMetadata& from); + + inline NodeMetadata& operator=(const NodeMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + NodeMetadata(NodeMetadata&& from) noexcept + : NodeMetadata() { + *this = ::std::move(from); + } + + inline NodeMetadata& operator=(NodeMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NodeMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NodeMetadata* internal_default_instance() { + return reinterpret_cast( + &_NodeMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void UnsafeArenaSwap(NodeMetadata* other); + void Swap(NodeMetadata* other); + friend void swap(NodeMetadata& a, NodeMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline NodeMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + NodeMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const NodeMetadata& from); + void MergeFrom(const NodeMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NodeMetadata* other); + protected: + explicit NodeMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // .diplomacy.tensorflow.boosted_trees.Leaf original_leaf = 2; + bool has_original_leaf() const; + void clear_original_leaf(); + static const int kOriginalLeafFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::Leaf& _internal_original_leaf() const; + public: + const ::diplomacy::tensorflow::boosted_trees::Leaf& original_leaf() const; + ::diplomacy::tensorflow::boosted_trees::Leaf* release_original_leaf(); + ::diplomacy::tensorflow::boosted_trees::Leaf* mutable_original_leaf(); + void set_allocated_original_leaf(::diplomacy::tensorflow::boosted_trees::Leaf* original_leaf); + void unsafe_arena_set_allocated_original_leaf( + ::diplomacy::tensorflow::boosted_trees::Leaf* original_leaf); + ::diplomacy::tensorflow::boosted_trees::Leaf* unsafe_arena_release_original_leaf(); + + // float gain = 1; + void clear_gain(); + static const int kGainFieldNumber = 1; + float gain() const; + void set_gain(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.NodeMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::diplomacy::tensorflow::boosted_trees::Leaf* original_leaf_; + float gain_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Leaf : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.Leaf) */ { + public: + Leaf(); + virtual ~Leaf(); + + Leaf(const Leaf& from); + + inline Leaf& operator=(const Leaf& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Leaf(Leaf&& from) noexcept + : Leaf() { + *this = ::std::move(from); + } + + inline Leaf& operator=(Leaf&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Leaf& default_instance(); + + enum LeafCase { + kVector = 1, + kSparseVector = 2, + LEAF_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Leaf* internal_default_instance() { + return reinterpret_cast( + &_Leaf_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + void UnsafeArenaSwap(Leaf* other); + void Swap(Leaf* other); + friend void swap(Leaf& a, Leaf& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Leaf* New() const final { + return CreateMaybeMessage(NULL); + } + + Leaf* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Leaf& from); + void MergeFrom(const Leaf& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Leaf* other); + protected: + explicit Leaf(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // float scalar = 3; + void clear_scalar(); + static const int kScalarFieldNumber = 3; + float scalar() const; + void set_scalar(float value); + + // .diplomacy.tensorflow.boosted_trees.Vector vector = 1; + bool has_vector() const; + void clear_vector(); + static const int kVectorFieldNumber = 1; + private: + const ::diplomacy::tensorflow::boosted_trees::Vector& _internal_vector() const; + public: + const ::diplomacy::tensorflow::boosted_trees::Vector& vector() const; + ::diplomacy::tensorflow::boosted_trees::Vector* release_vector(); + ::diplomacy::tensorflow::boosted_trees::Vector* mutable_vector(); + void set_allocated_vector(::diplomacy::tensorflow::boosted_trees::Vector* vector); + void unsafe_arena_set_allocated_vector( + ::diplomacy::tensorflow::boosted_trees::Vector* vector); + ::diplomacy::tensorflow::boosted_trees::Vector* unsafe_arena_release_vector(); + + // .diplomacy.tensorflow.boosted_trees.SparseVector sparse_vector = 2; + bool has_sparse_vector() const; + void clear_sparse_vector(); + static const int kSparseVectorFieldNumber = 2; + private: + const ::diplomacy::tensorflow::boosted_trees::SparseVector& _internal_sparse_vector() const; + public: + const ::diplomacy::tensorflow::boosted_trees::SparseVector& sparse_vector() const; + ::diplomacy::tensorflow::boosted_trees::SparseVector* release_sparse_vector(); + ::diplomacy::tensorflow::boosted_trees::SparseVector* mutable_sparse_vector(); + void set_allocated_sparse_vector(::diplomacy::tensorflow::boosted_trees::SparseVector* sparse_vector); + void unsafe_arena_set_allocated_sparse_vector( + ::diplomacy::tensorflow::boosted_trees::SparseVector* sparse_vector); + ::diplomacy::tensorflow::boosted_trees::SparseVector* unsafe_arena_release_sparse_vector(); + + void clear_leaf(); + LeafCase leaf_case() const; + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Leaf) + private: + void set_has_vector(); + void set_has_sparse_vector(); + + inline bool has_leaf() const; + inline void clear_has_leaf(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + float scalar_; + union LeafUnion { + LeafUnion() {} + ::diplomacy::tensorflow::boosted_trees::Vector* vector_; + ::diplomacy::tensorflow::boosted_trees::SparseVector* sparse_vector_; + } leaf_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Vector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.Vector) */ { + public: + Vector(); + virtual ~Vector(); + + Vector(const Vector& from); + + inline Vector& operator=(const Vector& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Vector(Vector&& from) noexcept + : Vector() { + *this = ::std::move(from); + } + + inline Vector& operator=(Vector&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Vector& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Vector* internal_default_instance() { + return reinterpret_cast( + &_Vector_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + void UnsafeArenaSwap(Vector* other); + void Swap(Vector* other); + friend void swap(Vector& a, Vector& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Vector* New() const final { + return CreateMaybeMessage(NULL); + } + + Vector* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Vector& from); + void MergeFrom(const Vector& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Vector* other); + protected: + explicit Vector(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated float value = 1; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 1; + float value(int index) const; + void set_value(int index, float value); + void add_value(float value); + const ::google::protobuf::RepeatedField< float >& + value() const; + ::google::protobuf::RepeatedField< float >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Vector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< float > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class SparseVector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.SparseVector) */ { + public: + SparseVector(); + virtual ~SparseVector(); + + SparseVector(const SparseVector& from); + + inline SparseVector& operator=(const SparseVector& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + SparseVector(SparseVector&& from) noexcept + : SparseVector() { + *this = ::std::move(from); + } + + inline SparseVector& operator=(SparseVector&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const SparseVector& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SparseVector* internal_default_instance() { + return reinterpret_cast( + &_SparseVector_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + void UnsafeArenaSwap(SparseVector* other); + void Swap(SparseVector* other); + friend void swap(SparseVector& a, SparseVector& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline SparseVector* New() const final { + return CreateMaybeMessage(NULL); + } + + SparseVector* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const SparseVector& from); + void MergeFrom(const SparseVector& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SparseVector* other); + protected: + explicit SparseVector(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 index = 1; + int index_size() const; + void clear_index(); + static const int kIndexFieldNumber = 1; + ::google::protobuf::int32 index(int index) const; + void set_index(int index, ::google::protobuf::int32 value); + void add_index(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + index() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_index(); + + // repeated float value = 2; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 2; + float value(int index) const; + void set_value(int index, float value); + void add_value(float value); + const ::google::protobuf::RepeatedField< float >& + value() const; + ::google::protobuf::RepeatedField< float >* + mutable_value(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.SparseVector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > index_; + mutable int _index_cached_byte_size_; + ::google::protobuf::RepeatedField< float > value_; + mutable int _value_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class BucketizedSplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.BucketizedSplit) */ { + public: + BucketizedSplit(); + virtual ~BucketizedSplit(); + + BucketizedSplit(const BucketizedSplit& from); + + inline BucketizedSplit& operator=(const BucketizedSplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + BucketizedSplit(BucketizedSplit&& from) noexcept + : BucketizedSplit() { + *this = ::std::move(from); + } + + inline BucketizedSplit& operator=(BucketizedSplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const BucketizedSplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const BucketizedSplit* internal_default_instance() { + return reinterpret_cast( + &_BucketizedSplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + void UnsafeArenaSwap(BucketizedSplit* other); + void Swap(BucketizedSplit* other); + friend void swap(BucketizedSplit& a, BucketizedSplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline BucketizedSplit* New() const final { + return CreateMaybeMessage(NULL); + } + + BucketizedSplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const BucketizedSplit& from); + void MergeFrom(const BucketizedSplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BucketizedSplit* other); + protected: + explicit BucketizedSplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 feature_id = 1; + void clear_feature_id(); + static const int kFeatureIdFieldNumber = 1; + ::google::protobuf::int32 feature_id() const; + void set_feature_id(::google::protobuf::int32 value); + + // int32 threshold = 2; + void clear_threshold(); + static const int kThresholdFieldNumber = 2; + ::google::protobuf::int32 threshold() const; + void set_threshold(::google::protobuf::int32 value); + + // int32 left_id = 3; + void clear_left_id(); + static const int kLeftIdFieldNumber = 3; + ::google::protobuf::int32 left_id() const; + void set_left_id(::google::protobuf::int32 value); + + // int32 right_id = 4; + void clear_right_id(); + static const int kRightIdFieldNumber = 4; + ::google::protobuf::int32 right_id() const; + void set_right_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 feature_id_; + ::google::protobuf::int32 threshold_; + ::google::protobuf::int32 left_id_; + ::google::protobuf::int32 right_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class CategoricalSplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.CategoricalSplit) */ { + public: + CategoricalSplit(); + virtual ~CategoricalSplit(); + + CategoricalSplit(const CategoricalSplit& from); + + inline CategoricalSplit& operator=(const CategoricalSplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + CategoricalSplit(CategoricalSplit&& from) noexcept + : CategoricalSplit() { + *this = ::std::move(from); + } + + inline CategoricalSplit& operator=(CategoricalSplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const CategoricalSplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const CategoricalSplit* internal_default_instance() { + return reinterpret_cast( + &_CategoricalSplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void UnsafeArenaSwap(CategoricalSplit* other); + void Swap(CategoricalSplit* other); + friend void swap(CategoricalSplit& a, CategoricalSplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline CategoricalSplit* New() const final { + return CreateMaybeMessage(NULL); + } + + CategoricalSplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const CategoricalSplit& from); + void MergeFrom(const CategoricalSplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CategoricalSplit* other); + protected: + explicit CategoricalSplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 feature_id = 1; + void clear_feature_id(); + static const int kFeatureIdFieldNumber = 1; + ::google::protobuf::int32 feature_id() const; + void set_feature_id(::google::protobuf::int32 value); + + // int32 value = 2; + void clear_value(); + static const int kValueFieldNumber = 2; + ::google::protobuf::int32 value() const; + void set_value(::google::protobuf::int32 value); + + // int32 left_id = 3; + void clear_left_id(); + static const int kLeftIdFieldNumber = 3; + ::google::protobuf::int32 left_id() const; + void set_left_id(::google::protobuf::int32 value); + + // int32 right_id = 4; + void clear_right_id(); + static const int kRightIdFieldNumber = 4; + ::google::protobuf::int32 right_id() const; + void set_right_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 feature_id_; + ::google::protobuf::int32 value_; + ::google::protobuf::int32 left_id_; + ::google::protobuf::int32 right_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DenseSplit : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.DenseSplit) */ { + public: + DenseSplit(); + virtual ~DenseSplit(); + + DenseSplit(const DenseSplit& from); + + inline DenseSplit& operator=(const DenseSplit& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DenseSplit(DenseSplit&& from) noexcept + : DenseSplit() { + *this = ::std::move(from); + } + + inline DenseSplit& operator=(DenseSplit&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DenseSplit& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DenseSplit* internal_default_instance() { + return reinterpret_cast( + &_DenseSplit_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + void UnsafeArenaSwap(DenseSplit* other); + void Swap(DenseSplit* other); + friend void swap(DenseSplit& a, DenseSplit& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DenseSplit* New() const final { + return CreateMaybeMessage(NULL); + } + + DenseSplit* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DenseSplit& from); + void MergeFrom(const DenseSplit& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DenseSplit* other); + protected: + explicit DenseSplit(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 feature_id = 1; + void clear_feature_id(); + static const int kFeatureIdFieldNumber = 1; + ::google::protobuf::int32 feature_id() const; + void set_feature_id(::google::protobuf::int32 value); + + // float threshold = 2; + void clear_threshold(); + static const int kThresholdFieldNumber = 2; + float threshold() const; + void set_threshold(float value); + + // int32 left_id = 3; + void clear_left_id(); + static const int kLeftIdFieldNumber = 3; + ::google::protobuf::int32 left_id() const; + void set_left_id(::google::protobuf::int32 value); + + // int32 right_id = 4; + void clear_right_id(); + static const int kRightIdFieldNumber = 4; + ::google::protobuf::int32 right_id() const; + void set_right_id(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.DenseSplit) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 feature_id_; + float threshold_; + ::google::protobuf::int32 left_id_; + ::google::protobuf::int32 right_id_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class Tree : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.Tree) */ { + public: + Tree(); + virtual ~Tree(); + + Tree(const Tree& from); + + inline Tree& operator=(const Tree& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Tree(Tree&& from) noexcept + : Tree() { + *this = ::std::move(from); + } + + inline Tree& operator=(Tree&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const Tree& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Tree* internal_default_instance() { + return reinterpret_cast( + &_Tree_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + void UnsafeArenaSwap(Tree* other); + void Swap(Tree* other); + friend void swap(Tree& a, Tree& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Tree* New() const final { + return CreateMaybeMessage(NULL); + } + + Tree* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Tree& from); + void MergeFrom(const Tree& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Tree* other); + protected: + explicit Tree(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.boosted_trees.Node nodes = 1; + int nodes_size() const; + void clear_nodes(); + static const int kNodesFieldNumber = 1; + ::diplomacy::tensorflow::boosted_trees::Node* mutable_nodes(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Node >* + mutable_nodes(); + const ::diplomacy::tensorflow::boosted_trees::Node& nodes(int index) const; + ::diplomacy::tensorflow::boosted_trees::Node* add_nodes(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Node >& + nodes() const; + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Tree) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Node > nodes_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TreeMetadata_PostPruneNodeUpdate : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) */ { + public: + TreeMetadata_PostPruneNodeUpdate(); + virtual ~TreeMetadata_PostPruneNodeUpdate(); + + TreeMetadata_PostPruneNodeUpdate(const TreeMetadata_PostPruneNodeUpdate& from); + + inline TreeMetadata_PostPruneNodeUpdate& operator=(const TreeMetadata_PostPruneNodeUpdate& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeMetadata_PostPruneNodeUpdate(TreeMetadata_PostPruneNodeUpdate&& from) noexcept + : TreeMetadata_PostPruneNodeUpdate() { + *this = ::std::move(from); + } + + inline TreeMetadata_PostPruneNodeUpdate& operator=(TreeMetadata_PostPruneNodeUpdate&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeMetadata_PostPruneNodeUpdate& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeMetadata_PostPruneNodeUpdate* internal_default_instance() { + return reinterpret_cast( + &_TreeMetadata_PostPruneNodeUpdate_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + void UnsafeArenaSwap(TreeMetadata_PostPruneNodeUpdate* other); + void Swap(TreeMetadata_PostPruneNodeUpdate* other); + friend void swap(TreeMetadata_PostPruneNodeUpdate& a, TreeMetadata_PostPruneNodeUpdate& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeMetadata_PostPruneNodeUpdate* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeMetadata_PostPruneNodeUpdate* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeMetadata_PostPruneNodeUpdate& from); + void MergeFrom(const TreeMetadata_PostPruneNodeUpdate& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeMetadata_PostPruneNodeUpdate* other); + protected: + explicit TreeMetadata_PostPruneNodeUpdate(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 new_node_id = 1; + void clear_new_node_id(); + static const int kNewNodeIdFieldNumber = 1; + ::google::protobuf::int32 new_node_id() const; + void set_new_node_id(::google::protobuf::int32 value); + + // float logit_change = 2; + void clear_logit_change(); + static const int kLogitChangeFieldNumber = 2; + float logit_change() const; + void set_logit_change(float value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int32 new_node_id_; + float logit_change_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TreeMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.TreeMetadata) */ { + public: + TreeMetadata(); + virtual ~TreeMetadata(); + + TreeMetadata(const TreeMetadata& from); + + inline TreeMetadata& operator=(const TreeMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeMetadata(TreeMetadata&& from) noexcept + : TreeMetadata() { + *this = ::std::move(from); + } + + inline TreeMetadata& operator=(TreeMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeMetadata* internal_default_instance() { + return reinterpret_cast( + &_TreeMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + void UnsafeArenaSwap(TreeMetadata* other); + void Swap(TreeMetadata* other); + friend void swap(TreeMetadata& a, TreeMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeMetadata& from); + void MergeFrom(const TreeMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeMetadata* other); + protected: + explicit TreeMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef TreeMetadata_PostPruneNodeUpdate PostPruneNodeUpdate; + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4; + int post_pruned_nodes_meta_size() const; + void clear_post_pruned_nodes_meta(); + static const int kPostPrunedNodesMetaFieldNumber = 4; + ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate* mutable_post_pruned_nodes_meta(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate >* + mutable_post_pruned_nodes_meta(); + const ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate& post_pruned_nodes_meta(int index) const; + ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate* add_post_pruned_nodes_meta(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate >& + post_pruned_nodes_meta() const; + + // int32 num_layers_grown = 2; + void clear_num_layers_grown(); + static const int kNumLayersGrownFieldNumber = 2; + ::google::protobuf::int32 num_layers_grown() const; + void set_num_layers_grown(::google::protobuf::int32 value); + + // bool is_finalized = 3; + void clear_is_finalized(); + static const int kIsFinalizedFieldNumber = 3; + bool is_finalized() const; + void set_is_finalized(bool value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.TreeMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate > post_pruned_nodes_meta_; + ::google::protobuf::int32 num_layers_grown_; + bool is_finalized_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class GrowingMetadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.GrowingMetadata) */ { + public: + GrowingMetadata(); + virtual ~GrowingMetadata(); + + GrowingMetadata(const GrowingMetadata& from); + + inline GrowingMetadata& operator=(const GrowingMetadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + GrowingMetadata(GrowingMetadata&& from) noexcept + : GrowingMetadata() { + *this = ::std::move(from); + } + + inline GrowingMetadata& operator=(GrowingMetadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GrowingMetadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GrowingMetadata* internal_default_instance() { + return reinterpret_cast( + &_GrowingMetadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + void UnsafeArenaSwap(GrowingMetadata* other); + void Swap(GrowingMetadata* other); + friend void swap(GrowingMetadata& a, GrowingMetadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline GrowingMetadata* New() const final { + return CreateMaybeMessage(NULL); + } + + GrowingMetadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const GrowingMetadata& from); + void MergeFrom(const GrowingMetadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GrowingMetadata* other); + protected: + explicit GrowingMetadata(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int64 num_trees_attempted = 1; + void clear_num_trees_attempted(); + static const int kNumTreesAttemptedFieldNumber = 1; + ::google::protobuf::int64 num_trees_attempted() const; + void set_num_trees_attempted(::google::protobuf::int64 value); + + // int64 num_layers_attempted = 2; + void clear_num_layers_attempted(); + static const int kNumLayersAttemptedFieldNumber = 2; + ::google::protobuf::int64 num_layers_attempted() const; + void set_num_layers_attempted(::google::protobuf::int64 value); + + // int32 last_layer_node_start = 3; + void clear_last_layer_node_start(); + static const int kLastLayerNodeStartFieldNumber = 3; + ::google::protobuf::int32 last_layer_node_start() const; + void set_last_layer_node_start(::google::protobuf::int32 value); + + // int32 last_layer_node_end = 4; + void clear_last_layer_node_end(); + static const int kLastLayerNodeEndFieldNumber = 4; + ::google::protobuf::int32 last_layer_node_end() const; + void set_last_layer_node_end(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::int64 num_trees_attempted_; + ::google::protobuf::int64 num_layers_attempted_; + ::google::protobuf::int32 last_layer_node_start_; + ::google::protobuf::int32 last_layer_node_end_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class TreeEnsemble : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.TreeEnsemble) */ { + public: + TreeEnsemble(); + virtual ~TreeEnsemble(); + + TreeEnsemble(const TreeEnsemble& from); + + inline TreeEnsemble& operator=(const TreeEnsemble& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + TreeEnsemble(TreeEnsemble&& from) noexcept + : TreeEnsemble() { + *this = ::std::move(from); + } + + inline TreeEnsemble& operator=(TreeEnsemble&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TreeEnsemble& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const TreeEnsemble* internal_default_instance() { + return reinterpret_cast( + &_TreeEnsemble_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + void UnsafeArenaSwap(TreeEnsemble* other); + void Swap(TreeEnsemble* other); + friend void swap(TreeEnsemble& a, TreeEnsemble& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline TreeEnsemble* New() const final { + return CreateMaybeMessage(NULL); + } + + TreeEnsemble* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const TreeEnsemble& from); + void MergeFrom(const TreeEnsemble& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TreeEnsemble* other); + protected: + explicit TreeEnsemble(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .diplomacy.tensorflow.boosted_trees.Tree trees = 1; + int trees_size() const; + void clear_trees(); + static const int kTreesFieldNumber = 1; + ::diplomacy::tensorflow::boosted_trees::Tree* mutable_trees(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Tree >* + mutable_trees(); + const ::diplomacy::tensorflow::boosted_trees::Tree& trees(int index) const; + ::diplomacy::tensorflow::boosted_trees::Tree* add_trees(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Tree >& + trees() const; + + // repeated float tree_weights = 2; + int tree_weights_size() const; + void clear_tree_weights(); + static const int kTreeWeightsFieldNumber = 2; + float tree_weights(int index) const; + void set_tree_weights(int index, float value); + void add_tree_weights(float value); + const ::google::protobuf::RepeatedField< float >& + tree_weights() const; + ::google::protobuf::RepeatedField< float >* + mutable_tree_weights(); + + // repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata tree_metadata = 3; + int tree_metadata_size() const; + void clear_tree_metadata(); + static const int kTreeMetadataFieldNumber = 3; + ::diplomacy::tensorflow::boosted_trees::TreeMetadata* mutable_tree_metadata(int index); + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata >* + mutable_tree_metadata(); + const ::diplomacy::tensorflow::boosted_trees::TreeMetadata& tree_metadata(int index) const; + ::diplomacy::tensorflow::boosted_trees::TreeMetadata* add_tree_metadata(); + const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata >& + tree_metadata() const; + + // .diplomacy.tensorflow.boosted_trees.GrowingMetadata growing_metadata = 4; + bool has_growing_metadata() const; + void clear_growing_metadata(); + static const int kGrowingMetadataFieldNumber = 4; + private: + const ::diplomacy::tensorflow::boosted_trees::GrowingMetadata& _internal_growing_metadata() const; + public: + const ::diplomacy::tensorflow::boosted_trees::GrowingMetadata& growing_metadata() const; + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* release_growing_metadata(); + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* mutable_growing_metadata(); + void set_allocated_growing_metadata(::diplomacy::tensorflow::boosted_trees::GrowingMetadata* growing_metadata); + void unsafe_arena_set_allocated_growing_metadata( + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* growing_metadata); + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* unsafe_arena_release_growing_metadata(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Tree > trees_; + ::google::protobuf::RepeatedField< float > tree_weights_; + mutable int _tree_weights_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata > tree_metadata_; + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* growing_metadata_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// ------------------------------------------------------------------- + +class DebugOutput : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.boosted_trees.DebugOutput) */ { + public: + DebugOutput(); + virtual ~DebugOutput(); + + DebugOutput(const DebugOutput& from); + + inline DebugOutput& operator=(const DebugOutput& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DebugOutput(DebugOutput&& from) noexcept + : DebugOutput() { + *this = ::std::move(from); + } + + inline DebugOutput& operator=(DebugOutput&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline ::google::protobuf::Arena* GetArena() const final { + return GetArenaNoVirtual(); + } + inline void* GetMaybeArenaPointer() const final { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const DebugOutput& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DebugOutput* internal_default_instance() { + return reinterpret_cast( + &_DebugOutput_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + void UnsafeArenaSwap(DebugOutput* other); + void Swap(DebugOutput* other); + friend void swap(DebugOutput& a, DebugOutput& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DebugOutput* New() const final { + return CreateMaybeMessage(NULL); + } + + DebugOutput* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DebugOutput& from); + void MergeFrom(const DebugOutput& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DebugOutput* other); + protected: + explicit DebugOutput(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 feature_ids = 1; + int feature_ids_size() const; + void clear_feature_ids(); + static const int kFeatureIdsFieldNumber = 1; + ::google::protobuf::int32 feature_ids(int index) const; + void set_feature_ids(int index, ::google::protobuf::int32 value); + void add_feature_ids(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + feature_ids() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_feature_ids(); + + // repeated float logits_path = 2; + int logits_path_size() const; + void clear_logits_path(); + static const int kLogitsPathFieldNumber = 2; + float logits_path(int index) const; + void set_logits_path(int index, float value); + void add_logits_path(float value); + const ::google::protobuf::RepeatedField< float >& + logits_path() const; + ::google::protobuf::RepeatedField< float >* + mutable_logits_path(); + + // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.DebugOutput) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > feature_ids_; + mutable int _feature_ids_cached_byte_size_; + ::google::protobuf::RepeatedField< float > logits_path_; + mutable int _logits_path_cached_byte_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Node + +// .diplomacy.tensorflow.boosted_trees.Leaf leaf = 1; +inline bool Node::has_leaf() const { + return node_case() == kLeaf; +} +inline void Node::set_has_leaf() { + _oneof_case_[0] = kLeaf; +} +inline void Node::clear_leaf() { + if (has_leaf()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.leaf_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::Leaf& Node::_internal_leaf() const { + return *node_.leaf_; +} +inline ::diplomacy::tensorflow::boosted_trees::Leaf* Node::release_leaf() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.Node.leaf) + if (has_leaf()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::Leaf* temp = node_.leaf_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.leaf_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::Leaf& Node::leaf() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Node.leaf) + return has_leaf() + ? *node_.leaf_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::Leaf*>(&::diplomacy::tensorflow::boosted_trees::_Leaf_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::Leaf* Node::unsafe_arena_release_leaf() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.Node.leaf) + if (has_leaf()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::Leaf* temp = node_.leaf_; + node_.leaf_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Node::unsafe_arena_set_allocated_leaf(::diplomacy::tensorflow::boosted_trees::Leaf* leaf) { + clear_node(); + if (leaf) { + set_has_leaf(); + node_.leaf_ = leaf; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.Node.leaf) +} +inline ::diplomacy::tensorflow::boosted_trees::Leaf* Node::mutable_leaf() { + if (!has_leaf()) { + clear_node(); + set_has_leaf(); + node_.leaf_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::Leaf >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Node.leaf) + return node_.leaf_; +} + +// .diplomacy.tensorflow.boosted_trees.BucketizedSplit bucketized_split = 2; +inline bool Node::has_bucketized_split() const { + return node_case() == kBucketizedSplit; +} +inline void Node::set_has_bucketized_split() { + _oneof_case_[0] = kBucketizedSplit; +} +inline void Node::clear_bucketized_split() { + if (has_bucketized_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.bucketized_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::BucketizedSplit& Node::_internal_bucketized_split() const { + return *node_.bucketized_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* Node::release_bucketized_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.Node.bucketized_split) + if (has_bucketized_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* temp = node_.bucketized_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.bucketized_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::BucketizedSplit& Node::bucketized_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Node.bucketized_split) + return has_bucketized_split() + ? *node_.bucketized_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::BucketizedSplit*>(&::diplomacy::tensorflow::boosted_trees::_BucketizedSplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* Node::unsafe_arena_release_bucketized_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.Node.bucketized_split) + if (has_bucketized_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* temp = node_.bucketized_split_; + node_.bucketized_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Node::unsafe_arena_set_allocated_bucketized_split(::diplomacy::tensorflow::boosted_trees::BucketizedSplit* bucketized_split) { + clear_node(); + if (bucketized_split) { + set_has_bucketized_split(); + node_.bucketized_split_ = bucketized_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.Node.bucketized_split) +} +inline ::diplomacy::tensorflow::boosted_trees::BucketizedSplit* Node::mutable_bucketized_split() { + if (!has_bucketized_split()) { + clear_node(); + set_has_bucketized_split(); + node_.bucketized_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::BucketizedSplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Node.bucketized_split) + return node_.bucketized_split_; +} + +// .diplomacy.tensorflow.boosted_trees.CategoricalSplit categorical_split = 3; +inline bool Node::has_categorical_split() const { + return node_case() == kCategoricalSplit; +} +inline void Node::set_has_categorical_split() { + _oneof_case_[0] = kCategoricalSplit; +} +inline void Node::clear_categorical_split() { + if (has_categorical_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.categorical_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::CategoricalSplit& Node::_internal_categorical_split() const { + return *node_.categorical_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* Node::release_categorical_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.Node.categorical_split) + if (has_categorical_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* temp = node_.categorical_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.categorical_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::CategoricalSplit& Node::categorical_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Node.categorical_split) + return has_categorical_split() + ? *node_.categorical_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::CategoricalSplit*>(&::diplomacy::tensorflow::boosted_trees::_CategoricalSplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* Node::unsafe_arena_release_categorical_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.Node.categorical_split) + if (has_categorical_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* temp = node_.categorical_split_; + node_.categorical_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Node::unsafe_arena_set_allocated_categorical_split(::diplomacy::tensorflow::boosted_trees::CategoricalSplit* categorical_split) { + clear_node(); + if (categorical_split) { + set_has_categorical_split(); + node_.categorical_split_ = categorical_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.Node.categorical_split) +} +inline ::diplomacy::tensorflow::boosted_trees::CategoricalSplit* Node::mutable_categorical_split() { + if (!has_categorical_split()) { + clear_node(); + set_has_categorical_split(); + node_.categorical_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::CategoricalSplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Node.categorical_split) + return node_.categorical_split_; +} + +// .diplomacy.tensorflow.boosted_trees.DenseSplit dense_split = 4; +inline bool Node::has_dense_split() const { + return node_case() == kDenseSplit; +} +inline void Node::set_has_dense_split() { + _oneof_case_[0] = kDenseSplit; +} +inline void Node::clear_dense_split() { + if (has_dense_split()) { + if (GetArenaNoVirtual() == NULL) { + delete node_.dense_split_; + } + clear_has_node(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::DenseSplit& Node::_internal_dense_split() const { + return *node_.dense_split_; +} +inline ::diplomacy::tensorflow::boosted_trees::DenseSplit* Node::release_dense_split() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.Node.dense_split) + if (has_dense_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::DenseSplit* temp = node_.dense_split_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + node_.dense_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::DenseSplit& Node::dense_split() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Node.dense_split) + return has_dense_split() + ? *node_.dense_split_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::DenseSplit*>(&::diplomacy::tensorflow::boosted_trees::_DenseSplit_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::DenseSplit* Node::unsafe_arena_release_dense_split() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.Node.dense_split) + if (has_dense_split()) { + clear_has_node(); + ::diplomacy::tensorflow::boosted_trees::DenseSplit* temp = node_.dense_split_; + node_.dense_split_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Node::unsafe_arena_set_allocated_dense_split(::diplomacy::tensorflow::boosted_trees::DenseSplit* dense_split) { + clear_node(); + if (dense_split) { + set_has_dense_split(); + node_.dense_split_ = dense_split; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.Node.dense_split) +} +inline ::diplomacy::tensorflow::boosted_trees::DenseSplit* Node::mutable_dense_split() { + if (!has_dense_split()) { + clear_node(); + set_has_dense_split(); + node_.dense_split_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::DenseSplit >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Node.dense_split) + return node_.dense_split_; +} + +// .diplomacy.tensorflow.boosted_trees.NodeMetadata metadata = 777; +inline bool Node::has_metadata() const { + return this != internal_default_instance() && metadata_ != NULL; +} +inline void Node::clear_metadata() { + if (GetArenaNoVirtual() == NULL && metadata_ != NULL) { + delete metadata_; + } + metadata_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::NodeMetadata& Node::_internal_metadata() const { + return *metadata_; +} +inline const ::diplomacy::tensorflow::boosted_trees::NodeMetadata& Node::metadata() const { + const ::diplomacy::tensorflow::boosted_trees::NodeMetadata* p = metadata_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Node.metadata) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::_NodeMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::NodeMetadata* Node::release_metadata() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.Node.metadata) + + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* temp = metadata_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::NodeMetadata* Node::unsafe_arena_release_metadata() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.Node.metadata) + + ::diplomacy::tensorflow::boosted_trees::NodeMetadata* temp = metadata_; + metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::NodeMetadata* Node::mutable_metadata() { + + if (metadata_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::NodeMetadata>(GetArenaNoVirtual()); + metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Node.metadata) + return metadata_; +} +inline void Node::set_allocated_metadata(::diplomacy::tensorflow::boosted_trees::NodeMetadata* metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete metadata_; + } + if (metadata) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(metadata); + if (message_arena != submessage_arena) { + metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, metadata, submessage_arena); + } + + } else { + + } + metadata_ = metadata; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.Node.metadata) +} + +inline bool Node::has_node() const { + return node_case() != NODE_NOT_SET; +} +inline void Node::clear_has_node() { + _oneof_case_[0] = NODE_NOT_SET; +} +inline Node::NodeCase Node::node_case() const { + return Node::NodeCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// NodeMetadata + +// float gain = 1; +inline void NodeMetadata::clear_gain() { + gain_ = 0; +} +inline float NodeMetadata::gain() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.NodeMetadata.gain) + return gain_; +} +inline void NodeMetadata::set_gain(float value) { + + gain_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.NodeMetadata.gain) +} + +// .diplomacy.tensorflow.boosted_trees.Leaf original_leaf = 2; +inline bool NodeMetadata::has_original_leaf() const { + return this != internal_default_instance() && original_leaf_ != NULL; +} +inline void NodeMetadata::clear_original_leaf() { + if (GetArenaNoVirtual() == NULL && original_leaf_ != NULL) { + delete original_leaf_; + } + original_leaf_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::Leaf& NodeMetadata::_internal_original_leaf() const { + return *original_leaf_; +} +inline const ::diplomacy::tensorflow::boosted_trees::Leaf& NodeMetadata::original_leaf() const { + const ::diplomacy::tensorflow::boosted_trees::Leaf* p = original_leaf_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.NodeMetadata.original_leaf) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::_Leaf_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::Leaf* NodeMetadata::release_original_leaf() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.NodeMetadata.original_leaf) + + ::diplomacy::tensorflow::boosted_trees::Leaf* temp = original_leaf_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + original_leaf_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::Leaf* NodeMetadata::unsafe_arena_release_original_leaf() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.NodeMetadata.original_leaf) + + ::diplomacy::tensorflow::boosted_trees::Leaf* temp = original_leaf_; + original_leaf_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::Leaf* NodeMetadata::mutable_original_leaf() { + + if (original_leaf_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::Leaf>(GetArenaNoVirtual()); + original_leaf_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.NodeMetadata.original_leaf) + return original_leaf_; +} +inline void NodeMetadata::set_allocated_original_leaf(::diplomacy::tensorflow::boosted_trees::Leaf* original_leaf) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete original_leaf_; + } + if (original_leaf) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(original_leaf); + if (message_arena != submessage_arena) { + original_leaf = ::google::protobuf::internal::GetOwnedMessage( + message_arena, original_leaf, submessage_arena); + } + + } else { + + } + original_leaf_ = original_leaf; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.NodeMetadata.original_leaf) +} + +// ------------------------------------------------------------------- + +// Leaf + +// .diplomacy.tensorflow.boosted_trees.Vector vector = 1; +inline bool Leaf::has_vector() const { + return leaf_case() == kVector; +} +inline void Leaf::set_has_vector() { + _oneof_case_[0] = kVector; +} +inline void Leaf::clear_vector() { + if (has_vector()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.vector_; + } + clear_has_leaf(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::Vector& Leaf::_internal_vector() const { + return *leaf_.vector_; +} +inline ::diplomacy::tensorflow::boosted_trees::Vector* Leaf::release_vector() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.Leaf.vector) + if (has_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::Vector* temp = leaf_.vector_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_.vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::Vector& Leaf::vector() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Leaf.vector) + return has_vector() + ? *leaf_.vector_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::Vector*>(&::diplomacy::tensorflow::boosted_trees::_Vector_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::Vector* Leaf::unsafe_arena_release_vector() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.Leaf.vector) + if (has_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::Vector* temp = leaf_.vector_; + leaf_.vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Leaf::unsafe_arena_set_allocated_vector(::diplomacy::tensorflow::boosted_trees::Vector* vector) { + clear_leaf(); + if (vector) { + set_has_vector(); + leaf_.vector_ = vector; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.Leaf.vector) +} +inline ::diplomacy::tensorflow::boosted_trees::Vector* Leaf::mutable_vector() { + if (!has_vector()) { + clear_leaf(); + set_has_vector(); + leaf_.vector_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::Vector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Leaf.vector) + return leaf_.vector_; +} + +// .diplomacy.tensorflow.boosted_trees.SparseVector sparse_vector = 2; +inline bool Leaf::has_sparse_vector() const { + return leaf_case() == kSparseVector; +} +inline void Leaf::set_has_sparse_vector() { + _oneof_case_[0] = kSparseVector; +} +inline void Leaf::clear_sparse_vector() { + if (has_sparse_vector()) { + if (GetArenaNoVirtual() == NULL) { + delete leaf_.sparse_vector_; + } + clear_has_leaf(); + } +} +inline const ::diplomacy::tensorflow::boosted_trees::SparseVector& Leaf::_internal_sparse_vector() const { + return *leaf_.sparse_vector_; +} +inline ::diplomacy::tensorflow::boosted_trees::SparseVector* Leaf::release_sparse_vector() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.Leaf.sparse_vector) + if (has_sparse_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::SparseVector* temp = leaf_.sparse_vector_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + leaf_.sparse_vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline const ::diplomacy::tensorflow::boosted_trees::SparseVector& Leaf::sparse_vector() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Leaf.sparse_vector) + return has_sparse_vector() + ? *leaf_.sparse_vector_ + : *reinterpret_cast< ::diplomacy::tensorflow::boosted_trees::SparseVector*>(&::diplomacy::tensorflow::boosted_trees::_SparseVector_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::SparseVector* Leaf::unsafe_arena_release_sparse_vector() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.Leaf.sparse_vector) + if (has_sparse_vector()) { + clear_has_leaf(); + ::diplomacy::tensorflow::boosted_trees::SparseVector* temp = leaf_.sparse_vector_; + leaf_.sparse_vector_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void Leaf::unsafe_arena_set_allocated_sparse_vector(::diplomacy::tensorflow::boosted_trees::SparseVector* sparse_vector) { + clear_leaf(); + if (sparse_vector) { + set_has_sparse_vector(); + leaf_.sparse_vector_ = sparse_vector; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.boosted_trees.Leaf.sparse_vector) +} +inline ::diplomacy::tensorflow::boosted_trees::SparseVector* Leaf::mutable_sparse_vector() { + if (!has_sparse_vector()) { + clear_leaf(); + set_has_sparse_vector(); + leaf_.sparse_vector_ = CreateMaybeMessage< ::diplomacy::tensorflow::boosted_trees::SparseVector >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Leaf.sparse_vector) + return leaf_.sparse_vector_; +} + +// float scalar = 3; +inline void Leaf::clear_scalar() { + scalar_ = 0; +} +inline float Leaf::scalar() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Leaf.scalar) + return scalar_; +} +inline void Leaf::set_scalar(float value) { + + scalar_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.Leaf.scalar) +} + +inline bool Leaf::has_leaf() const { + return leaf_case() != LEAF_NOT_SET; +} +inline void Leaf::clear_has_leaf() { + _oneof_case_[0] = LEAF_NOT_SET; +} +inline Leaf::LeafCase Leaf::leaf_case() const { + return Leaf::LeafCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Vector + +// repeated float value = 1; +inline int Vector::value_size() const { + return value_.size(); +} +inline void Vector::clear_value() { + value_.Clear(); +} +inline float Vector::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Vector.value) + return value_.Get(index); +} +inline void Vector::set_value(int index, float value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.Vector.value) +} +inline void Vector::add_value(float value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.Vector.value) +} +inline const ::google::protobuf::RepeatedField< float >& +Vector::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.Vector.value) + return value_; +} +inline ::google::protobuf::RepeatedField< float >* +Vector::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.Vector.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// SparseVector + +// repeated int32 index = 1; +inline int SparseVector::index_size() const { + return index_.size(); +} +inline void SparseVector::clear_index() { + index_.Clear(); +} +inline ::google::protobuf::int32 SparseVector::index(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.SparseVector.index) + return index_.Get(index); +} +inline void SparseVector::set_index(int index, ::google::protobuf::int32 value) { + index_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.SparseVector.index) +} +inline void SparseVector::add_index(::google::protobuf::int32 value) { + index_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.SparseVector.index) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SparseVector::index() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.SparseVector.index) + return index_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SparseVector::mutable_index() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.SparseVector.index) + return &index_; +} + +// repeated float value = 2; +inline int SparseVector::value_size() const { + return value_.size(); +} +inline void SparseVector::clear_value() { + value_.Clear(); +} +inline float SparseVector::value(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.SparseVector.value) + return value_.Get(index); +} +inline void SparseVector::set_value(int index, float value) { + value_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.SparseVector.value) +} +inline void SparseVector::add_value(float value) { + value_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.SparseVector.value) +} +inline const ::google::protobuf::RepeatedField< float >& +SparseVector::value() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.SparseVector.value) + return value_; +} +inline ::google::protobuf::RepeatedField< float >* +SparseVector::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.SparseVector.value) + return &value_; +} + +// ------------------------------------------------------------------- + +// BucketizedSplit + +// int32 feature_id = 1; +inline void BucketizedSplit::clear_feature_id() { + feature_id_ = 0; +} +inline ::google::protobuf::int32 BucketizedSplit::feature_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.BucketizedSplit.feature_id) + return feature_id_; +} +inline void BucketizedSplit::set_feature_id(::google::protobuf::int32 value) { + + feature_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.BucketizedSplit.feature_id) +} + +// int32 threshold = 2; +inline void BucketizedSplit::clear_threshold() { + threshold_ = 0; +} +inline ::google::protobuf::int32 BucketizedSplit::threshold() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.BucketizedSplit.threshold) + return threshold_; +} +inline void BucketizedSplit::set_threshold(::google::protobuf::int32 value) { + + threshold_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.BucketizedSplit.threshold) +} + +// int32 left_id = 3; +inline void BucketizedSplit::clear_left_id() { + left_id_ = 0; +} +inline ::google::protobuf::int32 BucketizedSplit::left_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.BucketizedSplit.left_id) + return left_id_; +} +inline void BucketizedSplit::set_left_id(::google::protobuf::int32 value) { + + left_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.BucketizedSplit.left_id) +} + +// int32 right_id = 4; +inline void BucketizedSplit::clear_right_id() { + right_id_ = 0; +} +inline ::google::protobuf::int32 BucketizedSplit::right_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.BucketizedSplit.right_id) + return right_id_; +} +inline void BucketizedSplit::set_right_id(::google::protobuf::int32 value) { + + right_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.BucketizedSplit.right_id) +} + +// ------------------------------------------------------------------- + +// CategoricalSplit + +// int32 feature_id = 1; +inline void CategoricalSplit::clear_feature_id() { + feature_id_ = 0; +} +inline ::google::protobuf::int32 CategoricalSplit::feature_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.CategoricalSplit.feature_id) + return feature_id_; +} +inline void CategoricalSplit::set_feature_id(::google::protobuf::int32 value) { + + feature_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.CategoricalSplit.feature_id) +} + +// int32 value = 2; +inline void CategoricalSplit::clear_value() { + value_ = 0; +} +inline ::google::protobuf::int32 CategoricalSplit::value() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.CategoricalSplit.value) + return value_; +} +inline void CategoricalSplit::set_value(::google::protobuf::int32 value) { + + value_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.CategoricalSplit.value) +} + +// int32 left_id = 3; +inline void CategoricalSplit::clear_left_id() { + left_id_ = 0; +} +inline ::google::protobuf::int32 CategoricalSplit::left_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.CategoricalSplit.left_id) + return left_id_; +} +inline void CategoricalSplit::set_left_id(::google::protobuf::int32 value) { + + left_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.CategoricalSplit.left_id) +} + +// int32 right_id = 4; +inline void CategoricalSplit::clear_right_id() { + right_id_ = 0; +} +inline ::google::protobuf::int32 CategoricalSplit::right_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.CategoricalSplit.right_id) + return right_id_; +} +inline void CategoricalSplit::set_right_id(::google::protobuf::int32 value) { + + right_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.CategoricalSplit.right_id) +} + +// ------------------------------------------------------------------- + +// DenseSplit + +// int32 feature_id = 1; +inline void DenseSplit::clear_feature_id() { + feature_id_ = 0; +} +inline ::google::protobuf::int32 DenseSplit::feature_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.DenseSplit.feature_id) + return feature_id_; +} +inline void DenseSplit::set_feature_id(::google::protobuf::int32 value) { + + feature_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.DenseSplit.feature_id) +} + +// float threshold = 2; +inline void DenseSplit::clear_threshold() { + threshold_ = 0; +} +inline float DenseSplit::threshold() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.DenseSplit.threshold) + return threshold_; +} +inline void DenseSplit::set_threshold(float value) { + + threshold_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.DenseSplit.threshold) +} + +// int32 left_id = 3; +inline void DenseSplit::clear_left_id() { + left_id_ = 0; +} +inline ::google::protobuf::int32 DenseSplit::left_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.DenseSplit.left_id) + return left_id_; +} +inline void DenseSplit::set_left_id(::google::protobuf::int32 value) { + + left_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.DenseSplit.left_id) +} + +// int32 right_id = 4; +inline void DenseSplit::clear_right_id() { + right_id_ = 0; +} +inline ::google::protobuf::int32 DenseSplit::right_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.DenseSplit.right_id) + return right_id_; +} +inline void DenseSplit::set_right_id(::google::protobuf::int32 value) { + + right_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.DenseSplit.right_id) +} + +// ------------------------------------------------------------------- + +// Tree + +// repeated .diplomacy.tensorflow.boosted_trees.Node nodes = 1; +inline int Tree::nodes_size() const { + return nodes_.size(); +} +inline void Tree::clear_nodes() { + nodes_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::Node* Tree::mutable_nodes(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.Tree.nodes) + return nodes_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Node >* +Tree::mutable_nodes() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.Tree.nodes) + return &nodes_; +} +inline const ::diplomacy::tensorflow::boosted_trees::Node& Tree::nodes(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.Tree.nodes) + return nodes_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::Node* Tree::add_nodes() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.Tree.nodes) + return nodes_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Node >& +Tree::nodes() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.Tree.nodes) + return nodes_; +} + +// ------------------------------------------------------------------- + +// TreeMetadata_PostPruneNodeUpdate + +// int32 new_node_id = 1; +inline void TreeMetadata_PostPruneNodeUpdate::clear_new_node_id() { + new_node_id_ = 0; +} +inline ::google::protobuf::int32 TreeMetadata_PostPruneNodeUpdate::new_node_id() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate.new_node_id) + return new_node_id_; +} +inline void TreeMetadata_PostPruneNodeUpdate::set_new_node_id(::google::protobuf::int32 value) { + + new_node_id_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate.new_node_id) +} + +// float logit_change = 2; +inline void TreeMetadata_PostPruneNodeUpdate::clear_logit_change() { + logit_change_ = 0; +} +inline float TreeMetadata_PostPruneNodeUpdate::logit_change() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate.logit_change) + return logit_change_; +} +inline void TreeMetadata_PostPruneNodeUpdate::set_logit_change(float value) { + + logit_change_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate.logit_change) +} + +// ------------------------------------------------------------------- + +// TreeMetadata + +// int32 num_layers_grown = 2; +inline void TreeMetadata::clear_num_layers_grown() { + num_layers_grown_ = 0; +} +inline ::google::protobuf::int32 TreeMetadata::num_layers_grown() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeMetadata.num_layers_grown) + return num_layers_grown_; +} +inline void TreeMetadata::set_num_layers_grown(::google::protobuf::int32 value) { + + num_layers_grown_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.TreeMetadata.num_layers_grown) +} + +// bool is_finalized = 3; +inline void TreeMetadata::clear_is_finalized() { + is_finalized_ = false; +} +inline bool TreeMetadata::is_finalized() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeMetadata.is_finalized) + return is_finalized_; +} +inline void TreeMetadata::set_is_finalized(bool value) { + + is_finalized_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.TreeMetadata.is_finalized) +} + +// repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate post_pruned_nodes_meta = 4; +inline int TreeMetadata::post_pruned_nodes_meta_size() const { + return post_pruned_nodes_meta_.size(); +} +inline void TreeMetadata::clear_post_pruned_nodes_meta() { + post_pruned_nodes_meta_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate* TreeMetadata::mutable_post_pruned_nodes_meta(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.TreeMetadata.post_pruned_nodes_meta) + return post_pruned_nodes_meta_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate >* +TreeMetadata::mutable_post_pruned_nodes_meta() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.TreeMetadata.post_pruned_nodes_meta) + return &post_pruned_nodes_meta_; +} +inline const ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate& TreeMetadata::post_pruned_nodes_meta(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeMetadata.post_pruned_nodes_meta) + return post_pruned_nodes_meta_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate* TreeMetadata::add_post_pruned_nodes_meta() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.TreeMetadata.post_pruned_nodes_meta) + return post_pruned_nodes_meta_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata_PostPruneNodeUpdate >& +TreeMetadata::post_pruned_nodes_meta() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.TreeMetadata.post_pruned_nodes_meta) + return post_pruned_nodes_meta_; +} + +// ------------------------------------------------------------------- + +// GrowingMetadata + +// int64 num_trees_attempted = 1; +inline void GrowingMetadata::clear_num_trees_attempted() { + num_trees_attempted_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 GrowingMetadata::num_trees_attempted() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.GrowingMetadata.num_trees_attempted) + return num_trees_attempted_; +} +inline void GrowingMetadata::set_num_trees_attempted(::google::protobuf::int64 value) { + + num_trees_attempted_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.GrowingMetadata.num_trees_attempted) +} + +// int64 num_layers_attempted = 2; +inline void GrowingMetadata::clear_num_layers_attempted() { + num_layers_attempted_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 GrowingMetadata::num_layers_attempted() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.GrowingMetadata.num_layers_attempted) + return num_layers_attempted_; +} +inline void GrowingMetadata::set_num_layers_attempted(::google::protobuf::int64 value) { + + num_layers_attempted_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.GrowingMetadata.num_layers_attempted) +} + +// int32 last_layer_node_start = 3; +inline void GrowingMetadata::clear_last_layer_node_start() { + last_layer_node_start_ = 0; +} +inline ::google::protobuf::int32 GrowingMetadata::last_layer_node_start() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.GrowingMetadata.last_layer_node_start) + return last_layer_node_start_; +} +inline void GrowingMetadata::set_last_layer_node_start(::google::protobuf::int32 value) { + + last_layer_node_start_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.GrowingMetadata.last_layer_node_start) +} + +// int32 last_layer_node_end = 4; +inline void GrowingMetadata::clear_last_layer_node_end() { + last_layer_node_end_ = 0; +} +inline ::google::protobuf::int32 GrowingMetadata::last_layer_node_end() const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.GrowingMetadata.last_layer_node_end) + return last_layer_node_end_; +} +inline void GrowingMetadata::set_last_layer_node_end(::google::protobuf::int32 value) { + + last_layer_node_end_ = value; + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.GrowingMetadata.last_layer_node_end) +} + +// ------------------------------------------------------------------- + +// TreeEnsemble + +// repeated .diplomacy.tensorflow.boosted_trees.Tree trees = 1; +inline int TreeEnsemble::trees_size() const { + return trees_.size(); +} +inline void TreeEnsemble::clear_trees() { + trees_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::Tree* TreeEnsemble::mutable_trees(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.TreeEnsemble.trees) + return trees_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Tree >* +TreeEnsemble::mutable_trees() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.TreeEnsemble.trees) + return &trees_; +} +inline const ::diplomacy::tensorflow::boosted_trees::Tree& TreeEnsemble::trees(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeEnsemble.trees) + return trees_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::Tree* TreeEnsemble::add_trees() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.TreeEnsemble.trees) + return trees_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::Tree >& +TreeEnsemble::trees() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.TreeEnsemble.trees) + return trees_; +} + +// repeated float tree_weights = 2; +inline int TreeEnsemble::tree_weights_size() const { + return tree_weights_.size(); +} +inline void TreeEnsemble::clear_tree_weights() { + tree_weights_.Clear(); +} +inline float TreeEnsemble::tree_weights(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_weights) + return tree_weights_.Get(index); +} +inline void TreeEnsemble::set_tree_weights(int index, float value) { + tree_weights_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_weights) +} +inline void TreeEnsemble::add_tree_weights(float value) { + tree_weights_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_weights) +} +inline const ::google::protobuf::RepeatedField< float >& +TreeEnsemble::tree_weights() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_weights) + return tree_weights_; +} +inline ::google::protobuf::RepeatedField< float >* +TreeEnsemble::mutable_tree_weights() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_weights) + return &tree_weights_; +} + +// repeated .diplomacy.tensorflow.boosted_trees.TreeMetadata tree_metadata = 3; +inline int TreeEnsemble::tree_metadata_size() const { + return tree_metadata_.size(); +} +inline void TreeEnsemble::clear_tree_metadata() { + tree_metadata_.Clear(); +} +inline ::diplomacy::tensorflow::boosted_trees::TreeMetadata* TreeEnsemble::mutable_tree_metadata(int index) { + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_metadata) + return tree_metadata_.Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata >* +TreeEnsemble::mutable_tree_metadata() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_metadata) + return &tree_metadata_; +} +inline const ::diplomacy::tensorflow::boosted_trees::TreeMetadata& TreeEnsemble::tree_metadata(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_metadata) + return tree_metadata_.Get(index); +} +inline ::diplomacy::tensorflow::boosted_trees::TreeMetadata* TreeEnsemble::add_tree_metadata() { + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_metadata) + return tree_metadata_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::diplomacy::tensorflow::boosted_trees::TreeMetadata >& +TreeEnsemble::tree_metadata() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_metadata) + return tree_metadata_; +} + +// .diplomacy.tensorflow.boosted_trees.GrowingMetadata growing_metadata = 4; +inline bool TreeEnsemble::has_growing_metadata() const { + return this != internal_default_instance() && growing_metadata_ != NULL; +} +inline void TreeEnsemble::clear_growing_metadata() { + if (GetArenaNoVirtual() == NULL && growing_metadata_ != NULL) { + delete growing_metadata_; + } + growing_metadata_ = NULL; +} +inline const ::diplomacy::tensorflow::boosted_trees::GrowingMetadata& TreeEnsemble::_internal_growing_metadata() const { + return *growing_metadata_; +} +inline const ::diplomacy::tensorflow::boosted_trees::GrowingMetadata& TreeEnsemble::growing_metadata() const { + const ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* p = growing_metadata_; + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.TreeEnsemble.growing_metadata) + return p != NULL ? *p : *reinterpret_cast( + &::diplomacy::tensorflow::boosted_trees::_GrowingMetadata_default_instance_); +} +inline ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* TreeEnsemble::release_growing_metadata() { + // @@protoc_insertion_point(field_release:diplomacy.tensorflow.boosted_trees.TreeEnsemble.growing_metadata) + + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* temp = growing_metadata_; + if (GetArenaNoVirtual() != NULL) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + growing_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* TreeEnsemble::unsafe_arena_release_growing_metadata() { + // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.boosted_trees.TreeEnsemble.growing_metadata) + + ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* temp = growing_metadata_; + growing_metadata_ = NULL; + return temp; +} +inline ::diplomacy::tensorflow::boosted_trees::GrowingMetadata* TreeEnsemble::mutable_growing_metadata() { + + if (growing_metadata_ == NULL) { + auto* p = CreateMaybeMessage<::diplomacy::tensorflow::boosted_trees::GrowingMetadata>(GetArenaNoVirtual()); + growing_metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.boosted_trees.TreeEnsemble.growing_metadata) + return growing_metadata_; +} +inline void TreeEnsemble::set_allocated_growing_metadata(::diplomacy::tensorflow::boosted_trees::GrowingMetadata* growing_metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete growing_metadata_; + } + if (growing_metadata) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::GetArena(growing_metadata); + if (message_arena != submessage_arena) { + growing_metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, growing_metadata, submessage_arena); + } + + } else { + + } + growing_metadata_ = growing_metadata; + // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.boosted_trees.TreeEnsemble.growing_metadata) +} + +// ------------------------------------------------------------------- + +// DebugOutput + +// repeated int32 feature_ids = 1; +inline int DebugOutput::feature_ids_size() const { + return feature_ids_.size(); +} +inline void DebugOutput::clear_feature_ids() { + feature_ids_.Clear(); +} +inline ::google::protobuf::int32 DebugOutput::feature_ids(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.DebugOutput.feature_ids) + return feature_ids_.Get(index); +} +inline void DebugOutput::set_feature_ids(int index, ::google::protobuf::int32 value) { + feature_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.DebugOutput.feature_ids) +} +inline void DebugOutput::add_feature_ids(::google::protobuf::int32 value) { + feature_ids_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.DebugOutput.feature_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +DebugOutput::feature_ids() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.DebugOutput.feature_ids) + return feature_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +DebugOutput::mutable_feature_ids() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.DebugOutput.feature_ids) + return &feature_ids_; +} + +// repeated float logits_path = 2; +inline int DebugOutput::logits_path_size() const { + return logits_path_.size(); +} +inline void DebugOutput::clear_logits_path() { + logits_path_.Clear(); +} +inline float DebugOutput::logits_path(int index) const { + // @@protoc_insertion_point(field_get:diplomacy.tensorflow.boosted_trees.DebugOutput.logits_path) + return logits_path_.Get(index); +} +inline void DebugOutput::set_logits_path(int index, float value) { + logits_path_.Set(index, value); + // @@protoc_insertion_point(field_set:diplomacy.tensorflow.boosted_trees.DebugOutput.logits_path) +} +inline void DebugOutput::add_logits_path(float value) { + logits_path_.Add(value); + // @@protoc_insertion_point(field_add:diplomacy.tensorflow.boosted_trees.DebugOutput.logits_path) +} +inline const ::google::protobuf::RepeatedField< float >& +DebugOutput::logits_path() const { + // @@protoc_insertion_point(field_list:diplomacy.tensorflow.boosted_trees.DebugOutput.logits_path) + return logits_path_; +} +inline ::google::protobuf::RepeatedField< float >* +DebugOutput::mutable_logits_path() { + // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.boosted_trees.DebugOutput.logits_path) + return &logits_path_; +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace boosted_trees +} // namespace tensorflow +} // namespace diplomacy + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fkernels_2fboosted_5ftrees_2fboosted_5ftrees_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto new file mode 100644 index 0000000..234882a --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto @@ -0,0 +1,161 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.boosted_trees; +option cc_enable_arenas = true; +option java_outer_classname = "BoostedTreesProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +// Node describes a node in a tree. +message Node { + oneof node { + Leaf leaf = 1; + BucketizedSplit bucketized_split = 2; + CategoricalSplit categorical_split = 3; + DenseSplit dense_split = 4; + } + NodeMetadata metadata = 777; +} + +// NodeMetadata encodes metadata associated with each node in a tree. +message NodeMetadata { + // The gain associated with this node. + float gain = 1; + + // The original leaf node before this node was split. + Leaf original_leaf = 2; +} + +// Leaves can either hold dense or sparse information. +message Leaf { + oneof leaf { + // See third_party/tensorflow/contrib/decision_trees/ + // proto/generic_tree_model.proto + // for a description of how vector and sparse_vector might be used. + Vector vector = 1; + SparseVector sparse_vector = 2; + } + float scalar = 3; +} + +message Vector { + repeated float value = 1; +} + +message SparseVector { + repeated int32 index = 1; + repeated float value = 2; +} + +message BucketizedSplit { + // Float feature column and split threshold describing + // the rule feature <= threshold. + int32 feature_id = 1; + int32 threshold = 2; + + // Node children indexing into a contiguous + // vector of nodes starting from the root. + int32 left_id = 3; + int32 right_id = 4; +} + +message CategoricalSplit { + // Categorical feature column and split describing the rule feature value == + // value. + int32 feature_id = 1; + int32 value = 2; + + // Node children indexing into a contiguous + // vector of nodes starting from the root. + int32 left_id = 3; + int32 right_id = 4; +} + +// TODO(nponomareva): move out of boosted_trees and rename to trees.proto +message DenseSplit { + // Float feature column and split threshold describing + // the rule feature <= threshold. + int32 feature_id = 1; + float threshold = 2; + + // Node children indexing into a contiguous + // vector of nodes starting from the root. + int32 left_id = 3; + int32 right_id = 4; +} + +// Tree describes a list of connected nodes. +// Node 0 must be the root and can carry any payload including a leaf +// in the case of representing the bias. +// Note that each node id is implicitly its index in the list of nodes. +message Tree { + repeated Node nodes = 1; +} + +message TreeMetadata { + // Number of layers grown for this tree. + int32 num_layers_grown = 2; + + // Whether the tree is finalized in that no more layers can be grown. + bool is_finalized = 3; + + // If tree was finalized and post pruning happened, it is possible that cache + // still refers to some nodes that were deleted or that the node ids changed + // (e.g. node id 5 became node id 2 due to pruning of the other branch). + // The mapping below allows us to understand where the old ids now map to and + // how the values should be adjusted due to post-pruning. + // The size of the list should be equal to the number of nodes in the tree + // before post-pruning happened. + // If the node was pruned, it will have new_node_id equal to the id of a node + // that this node was collapsed into. For a node that didn't get pruned, it is + // possible that its id still changed, so new_node_id will have the + // corresponding id in the pruned tree. + // If post-pruning didn't happen, or it did and it had no effect (e.g. no + // nodes got pruned), this list will be empty. + repeated PostPruneNodeUpdate post_pruned_nodes_meta = 4; + + message PostPruneNodeUpdate { + int32 new_node_id = 1; + float logit_change = 2; + } +} + +message GrowingMetadata { + // Number of trees that we have attempted to build. After pruning, these + // trees might have been removed. + int64 num_trees_attempted = 1; + // Number of layers that we have attempted to build. After pruning, these + // layers might have been removed. + int64 num_layers_attempted = 2; + // The start (inclusive) and end (exclusive) ids of the nodes in the latest + // layer of the latest tree. + int32 last_layer_node_start = 3; + int32 last_layer_node_end = 4; +} + +// TreeEnsemble describes an ensemble of decision trees. +message TreeEnsemble { + repeated Tree trees = 1; + repeated float tree_weights = 2; + + repeated TreeMetadata tree_metadata = 3; + // Metadata that is used during the training. + GrowingMetadata growing_metadata = 4; +} + +// DebugOutput contains outputs useful for debugging/model interpretation, at +// the individual example-level. Debug outputs that are available to the user +// are: 1) Directional feature contributions (DFCs) 2) Node IDs for ensemble +// prediction path 3) Leaf node IDs. +message DebugOutput { + // Return the logits and associated feature splits across prediction paths for + // each tree, for every example, at predict time. We will use these values to + // compute DFCs in Python, by subtracting each child prediction from its + // parent prediction and associating this change with its respective feature + // id. + repeated int32 feature_ids = 1; + repeated float logits_path = 2; + + // TODO(crawles): return 2) Node IDs for ensemble prediction path 3) Leaf node + // IDs. +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees_pb2.py new file mode 100644 index 0000000..ac941d0 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees_pb2.py @@ -0,0 +1,803 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto', + package='diplomacy.tensorflow.boosted_trees', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\022BoostedTreesProtosP\001\370\001\001'), + serialized_pb=_b('\nCdiplomacy_tensorflow/core/kernels/boosted_trees/boosted_trees.proto\x12\"diplomacy.tensorflow.boosted_trees\"\xf8\x02\n\x04Node\x12\x38\n\x04leaf\x18\x01 \x01(\x0b\x32(.diplomacy.tensorflow.boosted_trees.LeafH\x00\x12O\n\x10\x62ucketized_split\x18\x02 \x01(\x0b\x32\x33.diplomacy.tensorflow.boosted_trees.BucketizedSplitH\x00\x12Q\n\x11\x63\x61tegorical_split\x18\x03 \x01(\x0b\x32\x34.diplomacy.tensorflow.boosted_trees.CategoricalSplitH\x00\x12\x45\n\x0b\x64\x65nse_split\x18\x04 \x01(\x0b\x32..diplomacy.tensorflow.boosted_trees.DenseSplitH\x00\x12\x43\n\x08metadata\x18\x89\x06 \x01(\x0b\x32\x30.diplomacy.tensorflow.boosted_trees.NodeMetadataB\x06\n\x04node\"]\n\x0cNodeMetadata\x12\x0c\n\x04gain\x18\x01 \x01(\x02\x12?\n\roriginal_leaf\x18\x02 \x01(\x0b\x32(.diplomacy.tensorflow.boosted_trees.Leaf\"\xa7\x01\n\x04Leaf\x12<\n\x06vector\x18\x01 \x01(\x0b\x32*.diplomacy.tensorflow.boosted_trees.VectorH\x00\x12I\n\rsparse_vector\x18\x02 \x01(\x0b\x32\x30.diplomacy.tensorflow.boosted_trees.SparseVectorH\x00\x12\x0e\n\x06scalar\x18\x03 \x01(\x02\x42\x06\n\x04leaf\"\x17\n\x06Vector\x12\r\n\x05value\x18\x01 \x03(\x02\",\n\x0cSparseVector\x12\r\n\x05index\x18\x01 \x03(\x05\x12\r\n\x05value\x18\x02 \x03(\x02\"[\n\x0f\x42ucketizedSplit\x12\x12\n\nfeature_id\x18\x01 \x01(\x05\x12\x11\n\tthreshold\x18\x02 \x01(\x05\x12\x0f\n\x07left_id\x18\x03 \x01(\x05\x12\x10\n\x08right_id\x18\x04 \x01(\x05\"X\n\x10\x43\x61tegoricalSplit\x12\x12\n\nfeature_id\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x05\x12\x0f\n\x07left_id\x18\x03 \x01(\x05\x12\x10\n\x08right_id\x18\x04 \x01(\x05\"V\n\nDenseSplit\x12\x12\n\nfeature_id\x18\x01 \x01(\x05\x12\x11\n\tthreshold\x18\x02 \x01(\x02\x12\x0f\n\x07left_id\x18\x03 \x01(\x05\x12\x10\n\x08right_id\x18\x04 \x01(\x05\"?\n\x04Tree\x12\x37\n\x05nodes\x18\x01 \x03(\x0b\x32(.diplomacy.tensorflow.boosted_trees.Node\"\xe6\x01\n\x0cTreeMetadata\x12\x18\n\x10num_layers_grown\x18\x02 \x01(\x05\x12\x14\n\x0cis_finalized\x18\x03 \x01(\x08\x12\x64\n\x16post_pruned_nodes_meta\x18\x04 \x03(\x0b\x32\x44.diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate\x1a@\n\x13PostPruneNodeUpdate\x12\x13\n\x0bnew_node_id\x18\x01 \x01(\x05\x12\x14\n\x0clogit_change\x18\x02 \x01(\x02\"\x88\x01\n\x0fGrowingMetadata\x12\x1b\n\x13num_trees_attempted\x18\x01 \x01(\x03\x12\x1c\n\x14num_layers_attempted\x18\x02 \x01(\x03\x12\x1d\n\x15last_layer_node_start\x18\x03 \x01(\x05\x12\x1b\n\x13last_layer_node_end\x18\x04 \x01(\x05\"\xf5\x01\n\x0cTreeEnsemble\x12\x37\n\x05trees\x18\x01 \x03(\x0b\x32(.diplomacy.tensorflow.boosted_trees.Tree\x12\x14\n\x0ctree_weights\x18\x02 \x03(\x02\x12G\n\rtree_metadata\x18\x03 \x03(\x0b\x32\x30.diplomacy.tensorflow.boosted_trees.TreeMetadata\x12M\n\x10growing_metadata\x18\x04 \x01(\x0b\x32\x33.diplomacy.tensorflow.boosted_trees.GrowingMetadata\"7\n\x0b\x44\x65\x62ugOutput\x12\x13\n\x0b\x66\x65\x61ture_ids\x18\x01 \x03(\x05\x12\x13\n\x0blogits_path\x18\x02 \x03(\x02\x42\x33\n\x18org.tensorflow.frameworkB\x12\x42oostedTreesProtosP\x01\xf8\x01\x01\x62\x06proto3') +) + + + + +_NODE = _descriptor.Descriptor( + name='Node', + full_name='diplomacy.tensorflow.boosted_trees.Node', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='leaf', full_name='diplomacy.tensorflow.boosted_trees.Node.leaf', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bucketized_split', full_name='diplomacy.tensorflow.boosted_trees.Node.bucketized_split', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='categorical_split', full_name='diplomacy.tensorflow.boosted_trees.Node.categorical_split', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dense_split', full_name='diplomacy.tensorflow.boosted_trees.Node.dense_split', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata', full_name='diplomacy.tensorflow.boosted_trees.Node.metadata', index=4, + number=777, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='node', full_name='diplomacy.tensorflow.boosted_trees.Node.node', + index=0, containing_type=None, fields=[]), + ], + serialized_start=108, + serialized_end=484, +) + + +_NODEMETADATA = _descriptor.Descriptor( + name='NodeMetadata', + full_name='diplomacy.tensorflow.boosted_trees.NodeMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='gain', full_name='diplomacy.tensorflow.boosted_trees.NodeMetadata.gain', index=0, + number=1, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='original_leaf', full_name='diplomacy.tensorflow.boosted_trees.NodeMetadata.original_leaf', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=486, + serialized_end=579, +) + + +_LEAF = _descriptor.Descriptor( + name='Leaf', + full_name='diplomacy.tensorflow.boosted_trees.Leaf', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='vector', full_name='diplomacy.tensorflow.boosted_trees.Leaf.vector', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sparse_vector', full_name='diplomacy.tensorflow.boosted_trees.Leaf.sparse_vector', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='scalar', full_name='diplomacy.tensorflow.boosted_trees.Leaf.scalar', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='leaf', full_name='diplomacy.tensorflow.boosted_trees.Leaf.leaf', + index=0, containing_type=None, fields=[]), + ], + serialized_start=582, + serialized_end=749, +) + + +_VECTOR = _descriptor.Descriptor( + name='Vector', + full_name='diplomacy.tensorflow.boosted_trees.Vector', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.boosted_trees.Vector.value', index=0, + number=1, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=751, + serialized_end=774, +) + + +_SPARSEVECTOR = _descriptor.Descriptor( + name='SparseVector', + full_name='diplomacy.tensorflow.boosted_trees.SparseVector', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='diplomacy.tensorflow.boosted_trees.SparseVector.index', index=0, + number=1, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.boosted_trees.SparseVector.value', index=1, + number=2, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=776, + serialized_end=820, +) + + +_BUCKETIZEDSPLIT = _descriptor.Descriptor( + name='BucketizedSplit', + full_name='diplomacy.tensorflow.boosted_trees.BucketizedSplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.boosted_trees.BucketizedSplit.feature_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='threshold', full_name='diplomacy.tensorflow.boosted_trees.BucketizedSplit.threshold', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_id', full_name='diplomacy.tensorflow.boosted_trees.BucketizedSplit.left_id', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_id', full_name='diplomacy.tensorflow.boosted_trees.BucketizedSplit.right_id', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=822, + serialized_end=913, +) + + +_CATEGORICALSPLIT = _descriptor.Descriptor( + name='CategoricalSplit', + full_name='diplomacy.tensorflow.boosted_trees.CategoricalSplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.boosted_trees.CategoricalSplit.feature_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='diplomacy.tensorflow.boosted_trees.CategoricalSplit.value', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_id', full_name='diplomacy.tensorflow.boosted_trees.CategoricalSplit.left_id', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_id', full_name='diplomacy.tensorflow.boosted_trees.CategoricalSplit.right_id', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=915, + serialized_end=1003, +) + + +_DENSESPLIT = _descriptor.Descriptor( + name='DenseSplit', + full_name='diplomacy.tensorflow.boosted_trees.DenseSplit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_id', full_name='diplomacy.tensorflow.boosted_trees.DenseSplit.feature_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='threshold', full_name='diplomacy.tensorflow.boosted_trees.DenseSplit.threshold', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='left_id', full_name='diplomacy.tensorflow.boosted_trees.DenseSplit.left_id', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='right_id', full_name='diplomacy.tensorflow.boosted_trees.DenseSplit.right_id', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1005, + serialized_end=1091, +) + + +_TREE = _descriptor.Descriptor( + name='Tree', + full_name='diplomacy.tensorflow.boosted_trees.Tree', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='nodes', full_name='diplomacy.tensorflow.boosted_trees.Tree.nodes', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1093, + serialized_end=1156, +) + + +_TREEMETADATA_POSTPRUNENODEUPDATE = _descriptor.Descriptor( + name='PostPruneNodeUpdate', + full_name='diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='new_node_id', full_name='diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate.new_node_id', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='logit_change', full_name='diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate.logit_change', index=1, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1325, + serialized_end=1389, +) + +_TREEMETADATA = _descriptor.Descriptor( + name='TreeMetadata', + full_name='diplomacy.tensorflow.boosted_trees.TreeMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='num_layers_grown', full_name='diplomacy.tensorflow.boosted_trees.TreeMetadata.num_layers_grown', index=0, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='is_finalized', full_name='diplomacy.tensorflow.boosted_trees.TreeMetadata.is_finalized', index=1, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='post_pruned_nodes_meta', full_name='diplomacy.tensorflow.boosted_trees.TreeMetadata.post_pruned_nodes_meta', index=2, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TREEMETADATA_POSTPRUNENODEUPDATE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1159, + serialized_end=1389, +) + + +_GROWINGMETADATA = _descriptor.Descriptor( + name='GrowingMetadata', + full_name='diplomacy.tensorflow.boosted_trees.GrowingMetadata', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='num_trees_attempted', full_name='diplomacy.tensorflow.boosted_trees.GrowingMetadata.num_trees_attempted', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_layers_attempted', full_name='diplomacy.tensorflow.boosted_trees.GrowingMetadata.num_layers_attempted', index=1, + number=2, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='last_layer_node_start', full_name='diplomacy.tensorflow.boosted_trees.GrowingMetadata.last_layer_node_start', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='last_layer_node_end', full_name='diplomacy.tensorflow.boosted_trees.GrowingMetadata.last_layer_node_end', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1392, + serialized_end=1528, +) + + +_TREEENSEMBLE = _descriptor.Descriptor( + name='TreeEnsemble', + full_name='diplomacy.tensorflow.boosted_trees.TreeEnsemble', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='trees', full_name='diplomacy.tensorflow.boosted_trees.TreeEnsemble.trees', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tree_weights', full_name='diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_weights', index=1, + number=2, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tree_metadata', full_name='diplomacy.tensorflow.boosted_trees.TreeEnsemble.tree_metadata', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='growing_metadata', full_name='diplomacy.tensorflow.boosted_trees.TreeEnsemble.growing_metadata', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1531, + serialized_end=1776, +) + + +_DEBUGOUTPUT = _descriptor.Descriptor( + name='DebugOutput', + full_name='diplomacy.tensorflow.boosted_trees.DebugOutput', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='feature_ids', full_name='diplomacy.tensorflow.boosted_trees.DebugOutput.feature_ids', index=0, + number=1, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='logits_path', full_name='diplomacy.tensorflow.boosted_trees.DebugOutput.logits_path', index=1, + number=2, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1778, + serialized_end=1833, +) + +_NODE.fields_by_name['leaf'].message_type = _LEAF +_NODE.fields_by_name['bucketized_split'].message_type = _BUCKETIZEDSPLIT +_NODE.fields_by_name['categorical_split'].message_type = _CATEGORICALSPLIT +_NODE.fields_by_name['dense_split'].message_type = _DENSESPLIT +_NODE.fields_by_name['metadata'].message_type = _NODEMETADATA +_NODE.oneofs_by_name['node'].fields.append( + _NODE.fields_by_name['leaf']) +_NODE.fields_by_name['leaf'].containing_oneof = _NODE.oneofs_by_name['node'] +_NODE.oneofs_by_name['node'].fields.append( + _NODE.fields_by_name['bucketized_split']) +_NODE.fields_by_name['bucketized_split'].containing_oneof = _NODE.oneofs_by_name['node'] +_NODE.oneofs_by_name['node'].fields.append( + _NODE.fields_by_name['categorical_split']) +_NODE.fields_by_name['categorical_split'].containing_oneof = _NODE.oneofs_by_name['node'] +_NODE.oneofs_by_name['node'].fields.append( + _NODE.fields_by_name['dense_split']) +_NODE.fields_by_name['dense_split'].containing_oneof = _NODE.oneofs_by_name['node'] +_NODEMETADATA.fields_by_name['original_leaf'].message_type = _LEAF +_LEAF.fields_by_name['vector'].message_type = _VECTOR +_LEAF.fields_by_name['sparse_vector'].message_type = _SPARSEVECTOR +_LEAF.oneofs_by_name['leaf'].fields.append( + _LEAF.fields_by_name['vector']) +_LEAF.fields_by_name['vector'].containing_oneof = _LEAF.oneofs_by_name['leaf'] +_LEAF.oneofs_by_name['leaf'].fields.append( + _LEAF.fields_by_name['sparse_vector']) +_LEAF.fields_by_name['sparse_vector'].containing_oneof = _LEAF.oneofs_by_name['leaf'] +_TREE.fields_by_name['nodes'].message_type = _NODE +_TREEMETADATA_POSTPRUNENODEUPDATE.containing_type = _TREEMETADATA +_TREEMETADATA.fields_by_name['post_pruned_nodes_meta'].message_type = _TREEMETADATA_POSTPRUNENODEUPDATE +_TREEENSEMBLE.fields_by_name['trees'].message_type = _TREE +_TREEENSEMBLE.fields_by_name['tree_metadata'].message_type = _TREEMETADATA +_TREEENSEMBLE.fields_by_name['growing_metadata'].message_type = _GROWINGMETADATA +DESCRIPTOR.message_types_by_name['Node'] = _NODE +DESCRIPTOR.message_types_by_name['NodeMetadata'] = _NODEMETADATA +DESCRIPTOR.message_types_by_name['Leaf'] = _LEAF +DESCRIPTOR.message_types_by_name['Vector'] = _VECTOR +DESCRIPTOR.message_types_by_name['SparseVector'] = _SPARSEVECTOR +DESCRIPTOR.message_types_by_name['BucketizedSplit'] = _BUCKETIZEDSPLIT +DESCRIPTOR.message_types_by_name['CategoricalSplit'] = _CATEGORICALSPLIT +DESCRIPTOR.message_types_by_name['DenseSplit'] = _DENSESPLIT +DESCRIPTOR.message_types_by_name['Tree'] = _TREE +DESCRIPTOR.message_types_by_name['TreeMetadata'] = _TREEMETADATA +DESCRIPTOR.message_types_by_name['GrowingMetadata'] = _GROWINGMETADATA +DESCRIPTOR.message_types_by_name['TreeEnsemble'] = _TREEENSEMBLE +DESCRIPTOR.message_types_by_name['DebugOutput'] = _DEBUGOUTPUT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Node = _reflection.GeneratedProtocolMessageType('Node', (_message.Message,), dict( + DESCRIPTOR = _NODE, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Node) + )) +_sym_db.RegisterMessage(Node) + +NodeMetadata = _reflection.GeneratedProtocolMessageType('NodeMetadata', (_message.Message,), dict( + DESCRIPTOR = _NODEMETADATA, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.NodeMetadata) + )) +_sym_db.RegisterMessage(NodeMetadata) + +Leaf = _reflection.GeneratedProtocolMessageType('Leaf', (_message.Message,), dict( + DESCRIPTOR = _LEAF, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Leaf) + )) +_sym_db.RegisterMessage(Leaf) + +Vector = _reflection.GeneratedProtocolMessageType('Vector', (_message.Message,), dict( + DESCRIPTOR = _VECTOR, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Vector) + )) +_sym_db.RegisterMessage(Vector) + +SparseVector = _reflection.GeneratedProtocolMessageType('SparseVector', (_message.Message,), dict( + DESCRIPTOR = _SPARSEVECTOR, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.SparseVector) + )) +_sym_db.RegisterMessage(SparseVector) + +BucketizedSplit = _reflection.GeneratedProtocolMessageType('BucketizedSplit', (_message.Message,), dict( + DESCRIPTOR = _BUCKETIZEDSPLIT, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.BucketizedSplit) + )) +_sym_db.RegisterMessage(BucketizedSplit) + +CategoricalSplit = _reflection.GeneratedProtocolMessageType('CategoricalSplit', (_message.Message,), dict( + DESCRIPTOR = _CATEGORICALSPLIT, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.CategoricalSplit) + )) +_sym_db.RegisterMessage(CategoricalSplit) + +DenseSplit = _reflection.GeneratedProtocolMessageType('DenseSplit', (_message.Message,), dict( + DESCRIPTOR = _DENSESPLIT, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.DenseSplit) + )) +_sym_db.RegisterMessage(DenseSplit) + +Tree = _reflection.GeneratedProtocolMessageType('Tree', (_message.Message,), dict( + DESCRIPTOR = _TREE, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.Tree) + )) +_sym_db.RegisterMessage(Tree) + +TreeMetadata = _reflection.GeneratedProtocolMessageType('TreeMetadata', (_message.Message,), dict( + + PostPruneNodeUpdate = _reflection.GeneratedProtocolMessageType('PostPruneNodeUpdate', (_message.Message,), dict( + DESCRIPTOR = _TREEMETADATA_POSTPRUNENODEUPDATE, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.TreeMetadata.PostPruneNodeUpdate) + )) + , + DESCRIPTOR = _TREEMETADATA, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.TreeMetadata) + )) +_sym_db.RegisterMessage(TreeMetadata) +_sym_db.RegisterMessage(TreeMetadata.PostPruneNodeUpdate) + +GrowingMetadata = _reflection.GeneratedProtocolMessageType('GrowingMetadata', (_message.Message,), dict( + DESCRIPTOR = _GROWINGMETADATA, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.GrowingMetadata) + )) +_sym_db.RegisterMessage(GrowingMetadata) + +TreeEnsemble = _reflection.GeneratedProtocolMessageType('TreeEnsemble', (_message.Message,), dict( + DESCRIPTOR = _TREEENSEMBLE, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.TreeEnsemble) + )) +_sym_db.RegisterMessage(TreeEnsemble) + +DebugOutput = _reflection.GeneratedProtocolMessageType('DebugOutput', (_message.Message,), dict( + DESCRIPTOR = _DEBUGOUTPUT, + __module__ = 'diplomacy_tensorflow.core.kernels.boosted_trees.boosted_trees_pb2' + # @@protoc_insertion_point(class_scope:diplomacy.tensorflow.boosted_trees.DebugOutput) + )) +_sym_db.RegisterMessage(DebugOutput) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes.pb.cc b/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes.pb.cc new file mode 100644 index 0000000..7248da7 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes.pb.cc @@ -0,0 +1,133 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: diplomacy_tensorflow/core/lib/core/error_codes.proto + +#include "diplomacy_tensorflow/core/lib/core/error_codes.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace diplomacy { +namespace tensorflow { +namespace error { +} // namespace error +} // namespace tensorflow +} // namespace diplomacy +namespace protobuf_diplomacy_5ftensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto { +void InitDefaults() { +} + +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; +const ::google::protobuf::uint32 TableStruct::offsets[1] = {}; +static const ::google::protobuf::internal::MigrationSchema* schemas = NULL; +static const ::google::protobuf::Message* const* file_default_instances = NULL; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "diplomacy_tensorflow/core/lib/core/error_codes.proto", schemas, file_default_instances, TableStruct::offsets, + NULL, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n4diplomacy_tensorflow/core/lib/core/err" + "or_codes.proto\022\032diplomacy.tensorflow.err" + "or*\204\003\n\004Code\022\006\n\002OK\020\000\022\r\n\tCANCELLED\020\001\022\013\n\007UN" + "KNOWN\020\002\022\024\n\020INVALID_ARGUMENT\020\003\022\025\n\021DEADLIN" + "E_EXCEEDED\020\004\022\r\n\tNOT_FOUND\020\005\022\022\n\016ALREADY_E" + "XISTS\020\006\022\025\n\021PERMISSION_DENIED\020\007\022\023\n\017UNAUTH" + "ENTICATED\020\020\022\026\n\022RESOURCE_EXHAUSTED\020\010\022\027\n\023F" + "AILED_PRECONDITION\020\t\022\013\n\007ABORTED\020\n\022\020\n\014OUT" + "_OF_RANGE\020\013\022\021\n\rUNIMPLEMENTED\020\014\022\014\n\010INTERN" + "AL\020\r\022\017\n\013UNAVAILABLE\020\016\022\r\n\tDATA_LOSS\020\017\022K\nG" + "DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION" + "_USE_DEFAULT_IN_SWITCH_INSTEAD_\020\024Bo\n\030org" + ".tensorflow.frameworkB\020ErrorCodesProtosP" + "\001Z + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006001 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto +namespace diplomacy { +namespace tensorflow { +namespace error { +} // namespace error +} // namespace tensorflow +} // namespace diplomacy +namespace diplomacy { +namespace tensorflow { +namespace error { + +enum Code { + OK = 0, + CANCELLED = 1, + UNKNOWN = 2, + INVALID_ARGUMENT = 3, + DEADLINE_EXCEEDED = 4, + NOT_FOUND = 5, + ALREADY_EXISTS = 6, + PERMISSION_DENIED = 7, + UNAUTHENTICATED = 16, + RESOURCE_EXHAUSTED = 8, + FAILED_PRECONDITION = 9, + ABORTED = 10, + OUT_OF_RANGE = 11, + UNIMPLEMENTED = 12, + INTERNAL = 13, + UNAVAILABLE = 14, + DATA_LOSS = 15, + DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_ = 20, + Code_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + Code_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool Code_IsValid(int value); +const Code Code_MIN = OK; +const Code Code_MAX = DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_; +const int Code_ARRAYSIZE = Code_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Code_descriptor(); +inline const ::std::string& Code_Name(Code value) { + return ::google::protobuf::internal::NameOfEnum( + Code_descriptor(), value); +} +inline bool Code_Parse( + const ::std::string& name, Code* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Code_descriptor(), name, value); +} +// =================================================================== + + +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace error +} // namespace tensorflow +} // namespace diplomacy + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::diplomacy::tensorflow::error::Code> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::diplomacy::tensorflow::error::Code>() { + return ::diplomacy::tensorflow::error::Code_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes.proto b/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes.proto new file mode 100644 index 0000000..b59ce75 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes.proto @@ -0,0 +1,149 @@ +syntax = "proto3"; + +package diplomacy.tensorflow.error; +option cc_enable_arenas = true; +option java_outer_classname = "ErrorCodesProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/lib/core"; + +// 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. +enum Code { + // Not an error; returned on success + OK = 0; + + // The operation was cancelled (typically by the caller). + CANCELLED = 1; + + // 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. + UNKNOWN = 2; + + // 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). + INVALID_ARGUMENT = 3; + + // 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. + DEADLINE_EXCEEDED = 4; + + // 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. + NOT_FOUND = 5; + + // Some entity that we attempted to create (e.g., file or directory) + // already exists. + ALREADY_EXISTS = 6; + + // 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). + PERMISSION_DENIED = 7; + + // The request does not have valid authentication credentials for the + // operation. + UNAUTHENTICATED = 16; + + // Some resource has been exhausted, perhaps a per-user quota, or + // perhaps the entire file system is out of space. + RESOURCE_EXHAUSTED = 8; + + // 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. + FAILED_PRECONDITION = 9; + + // 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. + ABORTED = 10; + + // 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. + OUT_OF_RANGE = 11; + + // Operation is not implemented or not supported/enabled in this service. + UNIMPLEMENTED = 12; + + // Internal errors. Means some invariant expected by the underlying + // system has been broken. If you see one of these errors, + // something is very broken. + INTERNAL = 13; + + // 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. + UNAVAILABLE = 14; + + // Unrecoverable data loss or corruption. + DATA_LOSS = 15; + + // 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. + DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_ = 20; +} diff --git a/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes_pb2.py b/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes_pb2.py new file mode 100644 index 0000000..e9637a3 --- /dev/null +++ b/diplomacy_research/proto/diplomacy_tensorflow/core/lib/core/error_codes_pb2.py @@ -0,0 +1,138 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: diplomacy_tensorflow/core/lib/core/error_codes.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='diplomacy_tensorflow/core/lib/core/error_codes.proto', + package='diplomacy.tensorflow.error', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\020ErrorCodesProtosP\001Z + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Function; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Label; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Line; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Mapping; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ValueType; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Location; +extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Sample; +} // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fprofiler_2fprofile_2eproto +namespace diplomacy { +namespace tensorflow { +namespace tfprof { +namespace pprof { +class ProfileDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Profile_default_instance_; +class ValueTypeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _ValueType_default_instance_; +class SampleDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Sample_default_instance_; +class LabelDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed